-
Notifications
You must be signed in to change notification settings - Fork 0
/
billing_personal_account.go
123 lines (93 loc) · 3.71 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
package tdproto
import "time"
// PersonalAccountBilling struct of billing api
type PersonalAccountBilling struct {
// PersonalAccountBilling ID
PersonalAccountId string `json:"personal_account_id"` // TODO: must be int64
// Full name of owner personal account
FullName string `json:"full_name,omitempty"`
// Phone number of owner account
Phone string `json:"phone,omitempty"`
// ID User who owns this personal account
OwnerUuid string `json:"owner_uuid"`
// ID Tariff on this personal account
TariffId string `json:"tariff_id"` // TODO: must be int64
// Name Tariff on this personal account
TariffName string `json:"tariff_name"`
// ID Discount on personal account
DiscountId string `json:"discount_id"` // TODO: must be int64
// Amount of Discount on personal account
DiscountAmount int32 `json:"discount_amount"`
// Status of personal account
Status PersonalAccountStatus `json:"status"`
// Date of next debiting funds
NextBillingDate time.Time `json:"next_billing_date"`
// Count of teams on personal account
TeamCount int32 `json:"team_count"`
// Count of workplaces on personal account
WorkplaceCount int32 `json:"workplace_count"`
// Count of user on personal account
UsersCount int32 `json:"users_count"`
// Count of free workplaces on personal account
FreeWorkplaces int32 `json:"free_workplaces"`
// Count of paid workplaces on personal account
PaidWorkplaces int32 `json:"paid_workplaces"`
}
// 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"`
}