from pydantic import Field
from pydantic_settings import BaseSettings, SettingsConfigDict


class Config(BaseSettings):
    model_config = SettingsConfigDict(
        extra="ignore",
        env_prefix="GROUP_HORSE_RACING_",
    )

    TEST_MODE: bool = False
    TESTERS: set[int] = Field(default_factory=set)
    TEST_GROUPS: set[int] = Field(default_factory=set)
    ALLOWED_GROUPS: set[int] = Field(default_factory=set)

    PARTICIPANT_REWARD: int = 50
    CHAMPION_REWARD: int = 200
    MIN_BET: int = 10
    MIN_ODDS: float = 1.2
    RACE_DISTANCE: int = 100
    RACE_TICK_INTERVAL: int = 5

    MESSAGE_RECALL: dict[str, int] = Field(
        default_factory=lambda: {
            "race_update": 30,
            "registration": 180,
            "bet_confirm": 180,
            "cancel_confirm": 60,
            "error": 60,
            "race_result": 0,
            "leaderboard": 0,
            "help": 0,
            "odds_display": 0,
        }
    )

    RACE_DB_FILE: str = "data/group_horse_racing/race.db"
