WA-9 - implemented wallet

This commit is contained in:
Fran Jurmanović
2021-05-16 17:43:45 +02:00
parent 32fd64716e
commit 55010c83d6
15 changed files with 64 additions and 68 deletions

View File

@@ -1,16 +1,14 @@
package models
type WalletModel struct {
type Wallet struct {
tableName struct{} `pg:"wallets,alias:wallets"`
CommonModel
WalletTypeID string `json:"walletTypeId" pg:"wallet_type_id"`
WalletType *WalletTypeModel `json:"walletType" pg:"rel:has-one,fk:wallet_type_id"`
UserID string `json:"userId" pg:"user_id"`
User *UserReturnInfoModel `json:"user" pg:"rel:has-one,fk:user_id"`
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 WalletTypeModel struct {
tableName struct{} `pg:"walletTypes,alias:walletTypes"`
CommonModel
Name string `json:"name"`
type NewWalletBody struct {
Name string `json:"name"`
UserID string `json:"userId"`
}