32 lines
810 B
Python
32 lines
810 B
Python
import uuid
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
from . import to_camel
|
|
from .product_link import ProductLink
|
|
|
|
|
|
class MenuCategoryIn(BaseModel):
|
|
name: str = Field(..., min_length=1)
|
|
is_active: bool
|
|
is_fixture: bool
|
|
model_config = ConfigDict(str_strip_whitespace=True, alias_generator=to_camel)
|
|
|
|
|
|
class MenuCategory(MenuCategoryIn):
|
|
id_: uuid.UUID
|
|
sort_order: int
|
|
model_config = ConfigDict(str_strip_whitespace=True, alias_generator=to_camel)
|
|
|
|
|
|
class MenuCategoryBlank(MenuCategoryIn):
|
|
name: str
|
|
model_config = ConfigDict(str_strip_whitespace=True, alias_generator=to_camel)
|
|
|
|
|
|
class MenuCategoryLink(BaseModel):
|
|
id_: uuid.UUID = Field(...)
|
|
name: str | None = None
|
|
products: list[ProductLink]
|
|
model_config = ConfigDict(alias_generator=to_camel)
|