You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
from datetime import datetime
|
|
from typing import List, Optional
|
|
from uuid import UUID
|
|
|
|
from pydantic import Field
|
|
|
|
from src.models import DefaultBase, Pagination
|
|
|
|
|
|
class SimulationBase(DefaultBase):
|
|
label: Optional[str] = Field(None, nullable=False)
|
|
version: Optional[int] = Field(None, nullable=True, ge=0, le=9_999_999_999)
|
|
created_at: Optional[datetime] = Field(None, nullable=True)
|
|
updated_at: Optional[datetime] = Field(None, nullable=True)
|
|
created_by: Optional[str] = Field(None, nullable=True)
|
|
updated_by: Optional[str] = Field(None, nullable=True)
|
|
|
|
|
|
class SimulationCreate(SimulationBase):
|
|
label: str = Field(..., nullable=False)
|
|
|
|
|
|
class SimulationUpdate(SimulationBase):
|
|
pass
|
|
|
|
|
|
class SimulationRead(SimulationBase):
|
|
id: UUID
|
|
|
|
|
|
class SimulationPagination(Pagination):
|
|
items: List[SimulationRead] = []
|
|
|
|
|
|
class MasterDataOverride(DefaultBase):
|
|
name: str = Field(..., nullable=False)
|
|
value_num: Optional[float] = Field(None, nullable=True, le=1_000_000_000_000_000)
|
|
value_str: Optional[str] = Field(None, nullable=True)
|
|
|
|
class SimulationRunPayload(DefaultBase):
|
|
label: Optional[str] = Field(None, nullable=True)
|
|
overrides: List[MasterDataOverride] = Field(default_factory=list)
|