-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbilling_personal_account.go
129 lines (97 loc) · 3.87 KB
/
billing_personal_account.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
package tdproto
import "time"
// PersonalAccountBilling struct of billing api
type PersonalAccountBilling struct {
// PersonalAccountBilling ID
PersonalAccountId string `json:"personal_account_id"`
// ID User who owns this personal account
OwnerID string `json:"owner_id"`
// UUID of User who owns this personal account
OwnerUuid string `json:"owner_uuid"`
// Count of teams on personal account
TeamsCount uint32 `json:"teams_count"`
// Count of workplaces on personal account
WorkplaceCount uint32 `json:"workplace_count"`
// Count of empty workplaces on personal account
EmptyWorkplaceCount uint32 `json:"empty_workplace_count"`
// Count of occupied workplaces on personal account
OccupiedWorkplaceCount uint32 `json:"occupied_workplace_count"`
// Count of free workplaces on personal account
FreeWorkplaceCount uint32 `json:"free_workplace_count"`
// Count of paid workplaces on personal account
PaidWorkplaceCount uint32 `json:"paid_workplace_count"`
// Is the account blocked
IsBlocked bool `json:"is_blocked"`
// Is the account suspended
IsSuspended bool `json:"is_suspended"`
// Date of next debiting funds
NextBillingDate *time.Time `json:"next_billing_date,omitempty"`
// Account blocking date
BlockDate *time.Time `json:"block_date,omitempty"`
// Account suspending date
SuspendDate *time.Time `json:"suspend_date,omitempty"`
// Status of personal account
Status PersonalAccountStatus `json:"status"`
// Tariff on this personal account
Tariff TariffBilling `json:"tariff"`
// Owner of this personal account
Owner Contact `json:"owner,omitempty"`
}
// CreatePersonalAccountRequest request on create personal account
type CreatePersonalAccountRequest struct {
OwnerUuid string `json:"owner_uuid"`
FullName string `json:"full_name,omitempty"`
Phone string `json:"phone,omitempty"`
TeamUuid string `json:"team_uuid"`
}
// CreatePersonalAccountResponse response on create personal account
type CreatePersonalAccountResponse struct {
PersonalAccountBilling
}
// UpdatePersonalAccountRequest request on update personal account
type UpdatePersonalAccountRequest struct {
FullName string `json:"full_name,omitempty"`
Phone string `json:"phone,omitempty"`
}
// UpdatePersonalAccountResponse response on update personal account
type UpdatePersonalAccountResponse struct {
Success bool `json:"success,omitempty"`
}
// CheckActivePersonalAccountResponse response on check active personal account
type CheckActivePersonalAccountResponse struct {
Success bool `json:"success,omitempty"`
}
// GetPersonalAccountByIDResponse response on get personal account by ID
type GetPersonalAccountByIDResponse struct {
PersonalAccountBilling
}
// GetPersonalAccountsListResponse response on get list of personal accounts
type GetPersonalAccountsListResponse struct {
PersonalAccounts []PersonalAccountBilling `json:"personal_accounts,omitempty"`
}
// ActivatePersonalAccountResponse response on activate suspended personal account
type ActivatePersonalAccountResponse struct {
Success bool `json:"success"`
}
// BlockPersonalAccountResponse response on block unblocked personal account
type BlockPersonalAccountResponse struct {
Success bool `json:"success"`
}
// UnblockPersonalAccountResponse response on unblock blocked personal account
type UnblockPersonalAccountResponse struct {
Success bool `json:"success"`
}
// SuspendPersonalAccountResponse response on suspend active personal account
type SuspendPersonalAccountResponse struct {
Success bool `json:"success"`
}
type GetTeamsOnPersonalAccountResponse struct {
Teams []GetTeamOnPersonalAccountResponse `json:"teams"`
}
type GetTeamOnPersonalAccountResponse struct {
PersonalAccountId string `json:"personal_account_id"`
TeamId string `json:"team_id"`
TeamUuid string `json:"team_uuid"`
OpenDate time.Time `json:"open_date"`
CloseDate time.Time `json:"close_date,omitempty"`
}