customer/internal/models/account.go

33 lines
1.0 KiB
Go
Raw Normal View History

2023-05-17 20:27:09 +00:00
package models
import "time"
type Account struct {
2023-05-31 21:28:35 +00:00
ID string `json:"id" bson:"_id,omitempty"`
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:"deleted" bson:"deleted"`
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
DeletedAt *time.Time `json:"deletedAt,omitempty" bson:"deletedAt,omitempty"`
2023-05-17 20:27:09 +00:00
}
2023-05-31 21:28:35 +00:00
type Name struct {
2023-06-01 11:38:53 +00:00
Lastname string `json:"lastname,omitempty"`
FirstName string `json:"firstname,omitempty"`
Orgname string `json:"orgname,omitempty"`
Secondname string `json:"secondname,omitempty"`
2023-05-31 21:28:35 +00:00
}
type AccountStatus string
const (
2023-06-01 11:38:53 +00:00
AccountStatusNko AccountStatus = "nko"
AccountStatusNo AccountStatus = "no"
AccountStatusOrg AccountStatus = "org"
DefaultAccountStatus AccountStatus = AccountStatusNo
2023-05-31 21:28:35 +00:00
)