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"
	}
}

type TimeStatus int32

const (
	TIME_STATUS_NOT_STARTED   TimeStatus = 0
	TIME_STATUS_IN_PLAY       TimeStatus = 1
	TIME_STATUS_TO_BE_FIXED   TimeStatus = 2
	TIME_STATUS_ENDED         TimeStatus = 3
	TIME_STATUS_POSTPONED     TimeStatus = 4
	TIME_STATUS_CANCELLED     TimeStatus = 5
	TIME_STATUS_WALKOVER      TimeStatus = 6
	TIME_STATUS_INTERRUPTED   TimeStatus = 7
	TIME_STATUS_ABANDONED     TimeStatus = 8
	TIME_STATUS_RETIRED       TimeStatus = 9
	TIME_STATUS_SUSPENDED     TimeStatus = 10
	TIME_STATUS_DECIDED_BY_FA TimeStatus = 11
	TIME_STATUS_REMOVED       TimeStatus = 99
)
