feat: modules, products, services, services kits

This commit is contained in:
2025-09-16 10:54:10 +04:00
parent be8052848c
commit 276626d6f7
55 changed files with 1791 additions and 34 deletions

View File

@ -0,0 +1,76 @@
from typing import Optional
from schemas.base import BaseSchema, BaseResponse
# region Entity
class ServicePriceRangeSchema(BaseSchema):
id: int | None
from_quantity: int
to_quantity: int
price: float
class ServiceCategorySchema(BaseSchema):
id: int
name: str
deal_service_rank: str
product_service_rank: str
class ServiceSchema(BaseSchema):
id: int
name: str
category: ServiceCategorySchema
price: float
service_type: int
price_ranges: list[ServicePriceRangeSchema]
cost: Optional[float]
lexorank: str
class UpdateServiceSchema(ServiceSchema):
pass
class CreateServiceSchema(ServiceSchema):
pass
# endregion
# region Request
class CreateServiceRequest(BaseSchema):
entity: CreateServiceSchema
class UpdateServiceRequest(BaseSchema):
entity: UpdateServiceSchema
# endregion
# region Response
class GetServicesResponse(BaseSchema):
items: list[ServiceSchema]
class CreateServiceResponse(BaseResponse):
entity: ServiceSchema
class UpdateServiceResponse(BaseResponse):
pass
class DeleteServiceResponse(BaseResponse):
pass
# endregion