sub to trans

This commit is contained in:
Fran Jurmanović
2021-06-20 12:03:56 +02:00
parent 3d43716669
commit 27742223ed
7 changed files with 101 additions and 77 deletions

View File

@@ -20,7 +20,7 @@ type Subscription struct {
TransactionTypeID string `json:"transactionTypeId", pg:"transaction_type_id"`
TransactionType *TransactionType `json:"transactionType", pg:"rel:has-one, fk:transaction_type_id"`
LastTransactionDate time.Time `json:"lastTransactionDate", pg:"last_transaction_date"`
Amount int `json:"amount", pg:"amount"`
Amount float32 `json:"amount", pg:"amount"`
}
type NewSubscriptionBody struct {

View File

@@ -12,7 +12,7 @@ type Transaction struct {
TransactionTypeID string `json:"transactionTypeId", pg:"transaction_type_id"`
TransactionType *TransactionType `json:"transactionType", pg:"rel:has-one, fk:transaction_type_id"`
WalletID string `json:"walletId", pg:"wallet_id"`
Amount int `json:"amount", pg:"amount"`
Amount float32 `json:"amount", pg:"amount"`
Wallet *Wallet `json:"wallet" pg:"rel:has-one, fk:wallet_id"`
TransactionDate time.Time `json:"transactionDate" pg:"transaction_date"`
SubscriptionID string `json:"subscriptionId", pg:"subscription_id"`

View File

@@ -14,14 +14,17 @@ type NewWalletBody struct {
}
type WalletHeader struct {
WalletId string `json:"walletId"`
CurrentBalance int `json:"currentBalance"`
LastMonth int `json:"lastMonth"`
NextMonth int `json:"nextMonth"`
Currency string `json:"currency"`
WalletId string `json:"walletId"`
CurrentBalance float32 `json:"currentBalance"`
LastMonth float32 `json:"lastMonth"`
NextMonth float32 `json:"nextMonth"`
Currency string `json:"currency"`
}
type WalletTransactions struct {
WalletId string
Transactions []Transaction
WalletId string
Transactions []Transaction
CurrentBalance float32
LastMonth float32
NextMonth float32
}