24 lines
503 B
Python
24 lines
503 B
Python
|
|
from pydantic import BaseModel, Field
|
||
|
|
|
||
|
|
from app.schemas.common import AppModel
|
||
|
|
|
||
|
|
|
||
|
|
class NamedLookupOut(AppModel):
|
||
|
|
id: int
|
||
|
|
name: str
|
||
|
|
is_active: bool
|
||
|
|
|
||
|
|
|
||
|
|
class LookupCreateIn(BaseModel):
|
||
|
|
name: str = Field(min_length=1, max_length=100)
|
||
|
|
|
||
|
|
|
||
|
|
class LookupPatchIn(BaseModel):
|
||
|
|
name: str | None = Field(default=None, min_length=1, max_length=100)
|
||
|
|
is_active: bool | None = None
|
||
|
|
|
||
|
|
|
||
|
|
class LookupsOut(BaseModel):
|
||
|
|
departments: list[NamedLookupOut]
|
||
|
|
deviation_categories: list[NamedLookupOut]
|