from datetime import datetime

from pydantic import BaseModel, ConfigDict, Field

from app.schemas.product import ProductCostBreakdown


class ScenarioCreate(BaseModel):
    name: str
    description: str | None = None
    overrides: dict = Field(default_factory=dict)


class ScenarioRead(BaseModel):
    id: int
    name: str
    status: str
    description: str | None
    overrides: dict
    created_at: datetime
    model_config = ConfigDict(from_attributes=True)


class ScenarioRunResponse(BaseModel):
    scenario: ScenarioRead
    results: list[ProductCostBreakdown]
