66 lines
1.1 KiB
Python
66 lines
1.1 KiB
Python
from typing import List
|
|
|
|
from schemas.base import CustomModelCamel, OkMessageSchema
|
|
|
|
|
|
# region Entities
|
|
class ServiceCategorySchema(CustomModelCamel):
|
|
id: int
|
|
name: str
|
|
|
|
|
|
class ServiceSchema(CustomModelCamel):
|
|
id: int
|
|
name: str
|
|
category: ServiceCategorySchema
|
|
price: float
|
|
|
|
|
|
# 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
|