from datetime import datetime

from app.schemas.base import CamelModel
from app.schemas.encounter import EncounterDetailResponse
from app.schemas.game import GameResponse


class RunCreate(CamelModel):
    game_id: int
    name: str
    rules: dict = {}


class RunUpdate(CamelModel):
    name: str | None = None
    status: str | None = None
    rules: dict | None = None


class RunResponse(CamelModel):
    id: int
    game_id: int
    name: str
    status: str
    rules: dict
    started_at: datetime
    completed_at: datetime | None


class RunDetailResponse(RunResponse):
    game: GameResponse
    encounters: list[EncounterDetailResponse] = []
