feat: deal product services

This commit is contained in:
2024-05-13 07:46:13 +03:00
parent e9aec10feb
commit be650aca74
10 changed files with 136 additions and 10 deletions

View File

@@ -38,3 +38,12 @@ class PaginationSchema(CustomModelCamel):
class PaginationInfoSchema(CustomModelCamel):
total_pages: int
total_items: int
class BaseEnumSchema(CustomModelCamel):
id: int
name: str
class BaseEnumListSchema(CustomModelCamel):
items: list[BaseEnumSchema]

View File

@@ -30,10 +30,18 @@ class DealSummary(CustomModelCamel):
class DealServiceSchema(CustomModelCamel):
service: ServiceSchema
quantity: int
price: int
class DealProductServiceSchema(CustomModelCamel):
service: ServiceSchema
quantity: int
price: int
class DealProductSchema(CustomModelCamel):
product: ProductSchema
services: List[DealProductServiceSchema]
quantity: int

View File

@@ -1,9 +1,16 @@
from typing import List
from typing import List, Optional
from schemas.base import CustomModelCamel, OkMessageSchema
from schemas.base import CustomModelCamel, OkMessageSchema, BaseEnumSchema
# region Entities
class ServicePriceRangeSchema(CustomModelCamel):
id: int | None
from_quantity: int
to_quantity: int
price: float
class ServiceCategorySchema(CustomModelCamel):
id: int
name: str
@@ -14,6 +21,8 @@ class ServiceSchema(CustomModelCamel):
name: str
category: ServiceCategorySchema
price: float
service_type: int
price_ranges: List[ServicePriceRangeSchema]
# endregion