45 lines
948 B
Go
45 lines
948 B
Go
package domain
|
|
|
|
type BetStatus int
|
|
|
|
const (
|
|
BET_STATUS_PENDING BetStatus = iota
|
|
BET_STATUS_WIN
|
|
BET_STATUS_LOSS
|
|
BET_STATUS_ERROR
|
|
)
|
|
|
|
// If it is a ShopBet then UserID will be the cashier
|
|
// If it is a DigitalBet then UserID will be the user and the branchID will be 0 or nil
|
|
type Bet struct {
|
|
ID int64
|
|
Outcomes []Outcome
|
|
Amount Currency
|
|
TotalOdds float32
|
|
Status BetStatus
|
|
FullName string
|
|
PhoneNumber string
|
|
BranchID ValidInt64 // Can Be Nullable
|
|
UserID ValidInt64 // Can Be Nullable
|
|
IsShopBet bool
|
|
CashedOut bool
|
|
}
|
|
|
|
type CreateBet struct {
|
|
Outcomes []int64
|
|
Amount Currency
|
|
TotalOdds float32
|
|
Status BetStatus
|
|
FullName string
|
|
PhoneNumber string
|
|
BranchID ValidInt64 // Can Be Nullable
|
|
UserID ValidInt64 // Can Be Nullable
|
|
IsShopBet bool
|
|
}
|
|
|
|
func (b BetStatus) String() string {
|
|
return []string{"Pending", "Win", "Loss", "Error"}[b]
|
|
}
|
|
|
|
// func isBetStatusValid()
|