2024-01-20 03:29:15 +03:00
|
|
|
from uuid import UUID
|
2024-01-19 03:15:48 +03:00
|
|
|
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
|
|
|
|
|
|
class MenuBase(BaseModel):
|
|
|
|
title: str
|
2024-02-03 01:08:04 +03:00
|
|
|
description: str | None
|
2024-01-21 08:12:51 +03:00
|
|
|
|
2024-01-19 03:15:48 +03:00
|
|
|
class Config:
|
2024-01-20 03:29:15 +03:00
|
|
|
from_attributes = True
|
2024-01-19 03:15:48 +03:00
|
|
|
|
|
|
|
|
|
|
|
class Menu(MenuBase):
|
2024-01-20 03:29:15 +03:00
|
|
|
id: UUID
|
2024-01-19 03:15:48 +03:00
|
|
|
|
2024-01-21 06:25:32 +03:00
|
|
|
|
2024-01-21 21:40:58 +03:00
|
|
|
class MenuRead(Menu):
|
|
|
|
submenus_count: int
|
|
|
|
dishes_count: int
|
|
|
|
|
2024-01-22 01:28:32 +03:00
|
|
|
|
2024-01-21 21:40:58 +03:00
|
|
|
class SubMenuRead(Menu):
|
|
|
|
dishes_count: int
|
|
|
|
|
|
|
|
|
2024-01-21 08:12:51 +03:00
|
|
|
class DishBase(MenuBase):
|
2024-02-04 00:14:13 +03:00
|
|
|
price: str
|
2024-01-21 06:25:32 +03:00
|
|
|
|
|
|
|
|
2024-01-21 08:12:51 +03:00
|
|
|
class Dish(DishBase, Menu):
|
|
|
|
pass
|
2024-02-04 00:14:13 +03:00
|
|
|
|
|
|
|
|
|
|
|
class Dish_db(MenuBase):
|
|
|
|
price: float
|
2024-02-09 02:57:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
class SubMenuSummary(Menu):
|
|
|
|
dishes: list[Dish_db]
|
|
|
|
|
|
|
|
|
|
|
|
class MenuSummary(Menu):
|
|
|
|
submenus: list[SubMenuSummary]
|