-
Notifications
You must be signed in to change notification settings - Fork 0
/
account.go
162 lines (135 loc) · 7.44 KB
/
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
package entities
type MultiCardCluster struct {
Id string `json:"id"`
}
type Card struct {
AccountId string `json:"-" gorm:"index"`
Id string `json:"id" gorm:"primaryKey"`
StatusCode string `json:"statusCode"`
Status string `json:"status"`
PinSet bool `json:"pinSet"`
Expiration Milliseconds `json:"expiration"`
CardDesign string `json:"cardDesign"`
Ucid string `json:"ucid"`
PaymentSystem string `json:"paymentSystem"`
FrozenCard bool `json:"frozenCard"`
HasWrongPins bool `json:"hasWrongPins"`
Value string `json:"value"`
IsEmbossed bool `json:"isEmbossed"`
IsVirtual bool `json:"isVirtual"`
CreationDate Milliseconds `json:"creationDate"`
MultiCardCluster *MultiCardCluster `json:"multiCardCluster,omitempty" gorm:"embedded;embeddedPrefix:multi_card_cluster_"`
Name string `json:"name"`
IsPaymentDevice bool `json:"isPaymentDevice"`
Primary bool `json:"primary"`
CardIssueType *string `json:"cardIssueType,omitempty"`
SharedResourceId *string `json:"sharedResourceId,omitempty"`
}
type Loyalty struct {
ProgramName string `json:"programName"`
ProgramCode string `json:"programCode"`
AccountBackgroundColor string `json:"accountBackgroundColor"`
CashbackProgram bool `json:"cashbackProgram"`
CoreGroup string `json:"coreGroup"`
LoyaltyPointsId uint8 `json:"loyaltyPointsId"`
AccrualBonuses *float64 `json:"accrualBonuses,omitempty"`
LinkedBonuses *string `json:"linkedBonuses,omitempty"`
TotalAvailableBonuses *float64 `json:"totalAvailableBonuses,omitempty"`
AvailableBonuses *float64 `json:"availableBonuses,omitempty"`
}
type AccountShared struct {
Scopes []string `json:"scopes"`
StartDate Milliseconds `json:"startDate"`
OwnerName string `json:"ownerName"`
SharStatus string `json:"sharStatus"`
}
type AccountCreditLimit struct {
CreditLimitCurrencyCode uint `json:"-" gorm:"index"`
CreditLimitCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
CreditLimitValue float64 `json:"value"`
}
type AccountMoneyAmount struct {
MoneyAmountCurrencyCode uint `json:"-" gorm:"index"`
MoneyAmountCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
MoneyAmountValue float64 `json:"value"`
}
type AccountDebtBalance struct {
DebtBalanceCurrencyCode uint `json:"-" gorm:"index"`
DebtBalanceCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
DebtBalanceValue float64 `json:"value"`
}
type AccountCurrentMinimalPayment struct {
CurrentMinimalPaymentCurrencyCode uint `json:"-" gorm:"index"`
CurrentMinimalPaymentCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
CurrentMinimalPaymentValue float64 `json:"value"`
}
type AccountPastDueDebt struct {
PastDueDebtCurrencyCode uint `json:"-" gorm:"index"`
PastDueDebtCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
PastDueDebtValue float64 `json:"value"`
}
type AccountDebtAmount struct {
DebtAmountCurrencyCode uint `json:"-" gorm:"index"`
DebtAmountCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
DebtAmountValue float64 `json:"value"`
}
type Account struct {
UserPhone string `json:"-" gorm:"index"`
User User `json:"-" gorm:"constraint:OnDelete:CASCADE"`
CurrencyCode *uint `json:"-" gorm:"index"`
Currency *Currency `json:"currency,omitempty" gorm:"constraint:OnDelete:CASCADE"`
AccountRequisites *AccountRequisites `json:"-"`
Deleted bool `json:"-" gorm:"index"`
Id string `json:"id" gorm:"primaryKey"`
CreditLimit *AccountCreditLimit `json:"creditLimit,omitempty" gorm:"embedded"`
MoneyAmount *AccountMoneyAmount `json:"moneyAmount,omitempty" gorm:"embedded"`
DebtBalance *AccountDebtBalance `json:"debtBalance,omitempty" gorm:"embedded"`
CurrentMinimalPayment *AccountCurrentMinimalPayment `json:"currentMinimalPayment,omitempty" gorm:"embedded"`
ClientUnverifiedFlag *string `json:"clientUnverifiedFlag,omitempty"`
IdentificationState *string `json:"identificationState,omitempty"`
Status *string `json:"status,omitempty"`
EmoneyFlag *bool `json:"emoneyFlag,omitempty"`
NextStatementDate *Milliseconds `json:"nextStatementDate,omitempty"`
DueDate *Milliseconds `json:"dueDate,omitempty"`
Cards []Card `json:"cards,omitempty" gorm:"constraint:OnDelete:CASCADE;foreignKey:AccountId"`
MultiCardCluster *MultiCardCluster `json:"multiCardCluster,omitempty" gorm:"embedded;embeddedPrefix:multi_card_cluster_"`
LoyaltyId *string `json:"loyaltyId,omitempty"`
MoneyPotFlag *bool `json:"moneyPotFlag,omitempty"`
PartNumber *string `json:"partNumber,omitempty"`
PastDueDebt *AccountPastDueDebt `json:"pastDueDebt,omitempty" gorm:"embedded"`
Name string `json:"name"`
AccountType string `json:"accountType"`
Hidden bool `json:"hidden"`
SharedByMeFlag *bool `json:"sharedByMeFlag,omitempty"`
Loyalty *Loyalty `json:"loyalty,omitempty" gorm:"embedded;embeddedPrefix:loyalty_"`
CreationDate *Milliseconds `json:"creationDate,omitempty"`
DebtAmount *AccountDebtAmount `json:"debtAmount,omitempty" gorm:"embedded"`
LastStatementDate *Milliseconds `json:"lastStatementDate,omitempty"`
DueColor *int `json:"dueColor,omitempty"`
LinkedAccountNumber *string `json:"linkedAccountNumber,omitempty"`
IsKidsSaving *bool `json:"isKidsSaving,omitempty"`
IsCrowdfunding *bool `json:"isCrowdfunding,omitempty"`
//Shared *AccountShared `json:"shared,omitempty"`
FireflyId *string `json:"-" gorm:"<-:false;index"`
}
func (a Account) TableName() string {
return "accounts"
}
type AccountRequisites struct {
AccountId string `json:"-" gorm:"primaryKey"`
CardImage string `json:"cardImage"`
CardLine1 string `json:"cardLine1"`
CardLine2 string `json:"cardLine2"`
Recipient string `json:"recipient"`
BeneficiaryInfo string `json:"beneficiaryInfo"`
BeneficiaryBank string `json:"beneficiaryBank"`
RecipientExternalAccount string `json:"recipientExternalAccount"`
CorrespondentAccountNumber string `json:"correspondentAccountNumber"`
BankBik string `json:"bankBik"`
Name string `json:"name"`
Inn string `json:"inn"`
Kpp string `json:"kpp"`
}
func (ar AccountRequisites) TableName() string {
return "account_requisites"
}