feat: deal product services
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user