customer/internal/models/wallet.go

27 lines
837 B
Go
Raw Normal View History

2023-05-22 12:43:15 +00:00
package models
2023-05-31 21:28:35 +00:00
/*
TODO:
5) актуализировать поле spent при покупке средств
*/
2023-05-22 16:42:15 +00:00
type Wallet struct {
2023-05-31 21:28:35 +00:00
Cash int64 `json:"cash" bson:"cash"`
Currency string `json:"currency" bson:"currency"`
Spent int64 `json:"spent" bson:"spent"`
PurchasesAmount int64 `json:"purchasesAmount" bson:"purchasesAmount"`
2023-05-22 16:42:15 +00:00
/*
Money деньги на счету в копейках. Чтобы при перессчётах не возникало денег из ни откуда.
Фиксируемся к одной валюте, она будет внутренней, никому её не покажем.
*/
Money int64 `json:"money"`
}
2023-05-22 12:43:15 +00:00
type ReplenishAccountWallet struct {
2023-05-22 16:42:15 +00:00
Cash int64 `json:"cash"`
Currency string `json:"currency"`
UserID string `json:"userId"`
2023-05-22 12:43:15 +00:00
}