package entity

// MarketCategory classifies a market by risk tier.
type MarketCategory string

const (
	MarketCategoryPrimary   MarketCategory = "primary"
	MarketCategorySecondary MarketCategory = "secondary"
	MarketCategoryExotic    MarketCategory = "exotic"
)

// MarketStatus tracks whether a market is tradeable.
type MarketStatus string

const (
	MarketStatusOpen      MarketStatus = "OPEN"
	MarketStatusSuspended MarketStatus = "SUSPENDED"
	MarketStatusClosed    MarketStatus = "CLOSED"
)

// Market represents a single betting market within a match.
type Market struct {
	ID                 string         `json:"id"`
	TemplateID         string         `json:"templateId"`
	Name               string         `json:"name"`
	Category           MarketCategory `json:"category"`
	Price              float64        `json:"price"`
	PreviousPrice      float64        `json:"previousPrice"`
	Trend              string         `json:"trend"`
	Status             MarketStatus   `json:"status"`
	ImpliedProbability float64        `json:"impliedProbability"`
}

// MarketTemplate defines the blueprint for generating markets.
type MarketTemplate struct {
	ID          string              `json:"id"`
	Name        string              `json:"name"`
	Description string              `json:"description"`
	Category    MarketCategory      `json:"category"`
	Selections  []SelectionTemplate `json:"selections"`
}

// SelectionTemplate is a single outcome option within a market template.
type SelectionTemplate struct {
	Type      string  `json:"type"`
	Name      string  `json:"name,omitempty"`
	Suffix    string  `json:"suffix,omitempty"`
	BasePrice float64 `json:"basePrice"`
}
