28 lines
692 B
Python
28 lines
692 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
from app.schemas.product import ProductCostBreakdown
|
|
|
|
|
|
class ScenarioCreate(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
name: str = Field(min_length=1, max_length=255)
|
|
description: str | None = Field(default=None, max_length=2000)
|
|
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]
|