75 lines
1.3 KiB
Python
75 lines
1.3 KiB
Python
from typing import List, Optional
|
|
|
|
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
|
|
|
|
|
|
class ServiceSchema(CustomModelCamel):
|
|
id: int
|
|
name: str
|
|
category: ServiceCategorySchema
|
|
price: float
|
|
service_type: int
|
|
price_ranges: List[ServicePriceRangeSchema]
|
|
|
|
|
|
# endregion
|
|
|
|
|
|
# region Requests
|
|
class ServiceCreateRequest(CustomModelCamel):
|
|
service: ServiceSchema
|
|
|
|
|
|
class ServiceCreateCategoryRequest(CustomModelCamel):
|
|
category: ServiceCategorySchema
|
|
|
|
|
|
class ServiceUpdateRequest(CustomModelCamel):
|
|
data: ServiceSchema
|
|
|
|
|
|
class ServiceDeleteRequest(CustomModelCamel):
|
|
service_id: int
|
|
|
|
|
|
# endregion
|
|
|
|
|
|
# region Responses
|
|
class ServiceGetAllResponse(CustomModelCamel):
|
|
services: List[ServiceSchema]
|
|
|
|
|
|
class ServiceGetAllCategoriesResponse(CustomModelCamel):
|
|
categories: List[ServiceCategorySchema]
|
|
|
|
|
|
class ServiceCreateResponse(OkMessageSchema):
|
|
pass
|
|
|
|
|
|
class ServiceCreateCategoryResponse(OkMessageSchema):
|
|
pass
|
|
|
|
|
|
class ServiceUpdateResponse(OkMessageSchema):
|
|
pass
|
|
|
|
|
|
class ServiceDeleteResponse(OkMessageSchema):
|
|
pass
|
|
# endregion
|