partial repository layer added

This commit is contained in:
Fran Jurmanović
2022-09-27 00:33:44 +02:00
parent 13ce0735d0
commit 82e97fc97f
73 changed files with 2686 additions and 1216 deletions

35
pkg/model/wallet.go Normal file
View File

@@ -0,0 +1,35 @@
package model
type Wallet struct {
tableName struct{} `pg:"wallets,alias:wallets"`
BaseModel
Name string `json:"name" pg:"name"`
UserID string `json:"userId" pg:"user_id"`
User *UserReturnInfo `json:"user" pg:"rel:has-one,fk:user_id"`
}
type NewWalletBody struct {
Name string `json:"name" form:"name"`
UserID string `json:"userId" form:"userId"`
}
type WalletHeader struct {
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
CurrentBalance float32
LastMonth float32
NextMonth float32
}
type WalletEdit struct {
Id string `json:"id" form:"id"`
Name string `json:"name" form:"name"`
}