67 lines
1.3 KiB
Go
67 lines
1.3 KiB
Go
package domain
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type MarketConfig struct {
|
|
Sport string
|
|
MarketCategories map[string]bool
|
|
MarketTypes map[int64]bool
|
|
}
|
|
|
|
type Result struct {
|
|
ID int64
|
|
BetOutcomeID int64
|
|
EventID int64
|
|
OddID int64
|
|
MarketID int64
|
|
Status OutcomeStatus
|
|
Score string
|
|
FullTimeScore string
|
|
HalfTimeScore string
|
|
SS string
|
|
Scores map[string]Score
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type CreateResult struct {
|
|
BetOutcomeID int64
|
|
EventID int64
|
|
OddID int64
|
|
MarketID int64
|
|
Status OutcomeStatus
|
|
Score string
|
|
}
|
|
|
|
type OutcomeStatus int32
|
|
|
|
const (
|
|
OUTCOME_STATUS_PENDING OutcomeStatus = 0
|
|
OUTCOME_STATUS_WIN OutcomeStatus = 1
|
|
OUTCOME_STATUS_LOSS OutcomeStatus = 2
|
|
OUTCOME_STATUS_VOID OutcomeStatus = 3 //Give Back
|
|
OUTCOME_STATUS_HALF OutcomeStatus = 4 //Half Win and Half Given Back
|
|
OUTCOME_STATUS_ERROR OutcomeStatus = 5 //Half Win and Half Given Back
|
|
)
|
|
|
|
func (o *OutcomeStatus) String() string {
|
|
switch *o {
|
|
case OUTCOME_STATUS_PENDING:
|
|
return "PENDING"
|
|
case OUTCOME_STATUS_WIN:
|
|
return "WIN"
|
|
case OUTCOME_STATUS_LOSS:
|
|
return "LOSS"
|
|
case OUTCOME_STATUS_VOID:
|
|
return "VOID"
|
|
case OUTCOME_STATUS_HALF:
|
|
return "HALF"
|
|
case OUTCOME_STATUS_ERROR:
|
|
return "ERROR"
|
|
default:
|
|
return "UNKNOWN"
|
|
}
|
|
}
|