-
Notifications
You must be signed in to change notification settings - Fork 0
/
statement.go
198 lines (150 loc) · 7.95 KB
/
statement.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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
package entities
type StatementPeriod struct {
Start Milliseconds `json:"start"`
End Milliseconds `json:"end"`
}
type StatementOverdraftFee struct {
OverdraftFeeCurrencyCode uint `json:"-" gorm:"index"`
OverdraftFeeCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
OverdraftFeeValue float64 `json:"value"`
}
type StatementExpense struct {
ExpenseCurrencyCode uint `json:"-" gorm:"index"`
ExpenseCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
ExpenseValue float64 `json:"value"`
}
type StatementOverLimitDebt struct {
OverLimitDebtCurrencyCode uint `json:"-" gorm:"index"`
OverLimitDebtCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
OverLimitDebtValue float64 `json:"value"`
}
type StatementPeriodEndBalance struct {
PeriodEndBalanceCurrencyCode uint `json:"-" gorm:"index"`
PeriodEndBalanceCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
PeriodEndBalanceValue float64 `json:"value"`
}
type StatementArrestAmount struct {
ArrestAmountCurrencyCode uint `json:"-" gorm:"index"`
ArrestAmountCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
ArrestAmountValue float64 `json:"value"`
}
type StatementOtherBonus struct {
OtherBonusCurrencyCode uint `json:"-" gorm:"index"`
OtherBonusCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
OtherBonusValue float64 `json:"value"`
}
type StatementCreditLimit struct {
CreditLimitCurrencyCode uint `json:"-" gorm:"index"`
CreditLimitCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
CreditLimitValue float64 `json:"value"`
}
type StatementTranchesMonthlyPayment struct {
TranchesMonthlyPaymentCurrencyCode uint `json:"-" gorm:"index"`
TranchesMonthlyPaymentCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
TranchesMonthlyPaymentValue float64 `json:"value"`
}
type StatementBilledDebt struct {
BilledDebtCurrencyCode uint `json:"-" gorm:"index"`
BilledDebtCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
BilledDebtValue float64 `json:"value"`
}
type StatementCashback struct {
CashbackCurrencyCode uint `json:"-" gorm:"index"`
CashbackCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
CashbackValue float64 `json:"value"`
}
type StatementBalance struct {
BalanceCurrencyCode uint `json:"-" gorm:"index"`
BalanceCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
BalanceValue float64 `json:"value"`
}
type StatementHighCashback struct {
HighCashbackCurrencyCode uint `json:"-" gorm:"index"`
HighCashbackCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
HighCashbackValue float64 `json:"value"`
}
type StatementPeriodStartBalance struct {
PeriodStartBalanceCurrencyCode uint `json:"-" gorm:"index"`
PeriodStartBalanceCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
PeriodStartBalanceValue float64 `json:"value"`
}
type StatementLowCashback struct {
LowCashbackCurrencyCode uint `json:"-" gorm:"index"`
LowCashbackCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
LowCashbackValue float64 `json:"value"`
}
type StatementAvailableLimit struct {
AvailableLimitCurrencyCode uint `json:"-" gorm:"index"`
AvailableLimitCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
AvailableLimitValue float64 `json:"value"`
}
type StatementInterestBonus struct {
InterestBonusCurrencyCode uint `json:"-" gorm:"index"`
InterestBonusCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
InterestBonusValue float64 `json:"value"`
}
type StatementInterest struct {
InterestCurrencyCode uint `json:"-" gorm:"index"`
InterestCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
InterestValue float64 `json:"value"`
}
type StatementIncome struct {
IncomeCurrencyCode uint `json:"-" gorm:"index"`
IncomeCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
IncomeValue float64 `json:"value"`
}
type StatementCreditBonus struct {
CreditBonusCurrencyCode uint `json:"-" gorm:"index"`
CreditBonusCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
CreditBonusValue float64 `json:"value"`
}
type StatementOtherCashback struct {
OtherCashbackCurrencyCode uint `json:"-" gorm:"index"`
OtherCashbackCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
OtherCashbackValue float64 `json:"value"`
}
type StatementMinimalPaymentAmount struct {
MinimalPaymentAmountCurrencyCode uint `json:"-" gorm:"index"`
MinimalPaymentAmountCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
MinimalPaymentAmountValue float64 `json:"value"`
}
type StatementPastDueDebt struct {
PastDueDebtCurrencyCode uint `json:"-" gorm:"index"`
PastDueDebtCurrency Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`
PastDueDebtValue float64 `json:"value"`
}
type Statement struct {
AccountId string `json:"-" gorm:"index"`
Account Account `json:"-" gorm:"constraint:OnDelete:CASCADE"`
OverdraftFee *StatementOverdraftFee `json:"overdraftFee,omitempty" gorm:"embedded"`
Expense StatementExpense `json:"expense" gorm:"embedded"`
OverLimitDebt *StatementOverLimitDebt `json:"overLimitDebt,omitempty" gorm:"embedded"`
PeriodEndBalance StatementPeriodEndBalance `json:"periodEndBalance" gorm:"embedded"`
ArrestAmount *StatementArrestAmount `json:"arrestAmount,omitempty" gorm:"embedded"`
OtherBonus *StatementOtherBonus `json:"otherBonus,omitempty" gorm:"embedded"`
CreditLimit *StatementCreditLimit `json:"creditLimit,omitempty" gorm:"embedded"`
TranchesMonthlyPayment *StatementTranchesMonthlyPayment `json:"tranchesMonthlyPayment,omitempty" gorm:"embedded"`
BilledDebt *StatementBilledDebt `json:"billedDebt,omitempty" gorm:"embedded"`
Cashback StatementCashback `json:"cashback" gorm:"embedded"`
Balance StatementBalance `json:"balance" gorm:"embedded"`
HighCashback *StatementHighCashback `json:"highCashback,omitempty" gorm:"embedded"`
PeriodStartBalance StatementPeriodStartBalance `json:"periodStartBalance" gorm:"embedded"`
LowCashback *StatementLowCashback `json:"lowCashback,omitempty" gorm:"embedded"`
AvailableLimit *StatementAvailableLimit `json:"availableLimit,omitempty" gorm:"embedded"`
Id string `json:"id" gorm:"primaryKey"`
InterestBonus *StatementInterestBonus `json:"interestBonus,omitempty" gorm:"embedded"`
Interest StatementInterest `json:"interest" gorm:"embedded"`
Date Milliseconds `json:"date" gorm:"index"`
Income StatementIncome `json:"income" gorm:"embedded"`
CreditBonus *StatementCreditBonus `json:"creditBonus,omitempty" gorm:"embedded"`
LastPaymentDate *Milliseconds `json:"lastPaymentDate,omitempty"`
OtherCashback *StatementOtherCashback `json:"otherCashback,omitempty" gorm:"embedded"`
MinimalPaymentAmount *StatementMinimalPaymentAmount `json:"minimalPaymentAmount,omitempty" gorm:"embedded"`
PastDueDebt *StatementPastDueDebt `json:"pastDueDebt,omitempty" gorm:"embedded"`
Period StatementPeriod `json:"period" gorm:"embedded;embeddedPrefix:period_"`
NoOverdue *bool `json:"noOverdue,omitempty"`
Repaid *string `json:"repaid,omitempty"`
}
func (s Statement) TableName() string {
return "statements"
}