notifier/internal/models/customer.go
2024-04-22 18:59:07 +03:00

43 lines
1.5 KiB
Go

package models
import "time"
type Account struct {
ID string `json:"id" bson:"_id"`
UserID string `json:"userId" bson:"userId"`
Cart []string `json:"cart" bson:"cart"`
Wallet Wallet `json:"wallet" bson:"wallet"`
Name Name `json:"name" bson:"name"`
Status AccountStatus `json:"status" bson:"status"`
Deleted bool `json:"isDeleted" bson:"isDeleted"`
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
DeletedAt *time.Time `json:"deletedAt,omitempty" bson:"deletedAt,omitempty"`
From string `json:"from" bson:"from"`
}
type Wallet struct {
Cash int64 `json:"cash" bson:"cash"`
Currency string `json:"currency" bson:"currency"`
Spent int64 `json:"spent" bson:"spent"`
PurchasesAmount int64 `json:"purchasesAmount" bson:"purchasesAmount"`
Money int64 `json:"money" bson:"money"`
LastPaymentID string `json:"lastPaymentId" bson:"lastPaymentId"`
}
type Name struct {
Middlename string `json:"middlename,omitempty"`
FirstName string `json:"firstname,omitempty"`
Orgname string `json:"orgname,omitempty"`
Secondname string `json:"secondname,omitempty"`
}
type AccountStatus string
const (
AccountStatusNko AccountStatus = "nko"
AccountStatusNo AccountStatus = "no"
AccountStatusOrg AccountStatus = "org"
DefaultAccountStatus AccountStatus = AccountStatusNo
)