50 lines
814 B
Python
50 lines
814 B
Python
from typing import List
|
|
|
|
from schemas.base import CustomModel, OkMessageSchema
|
|
|
|
|
|
# region Entities
|
|
class ServiceCategorySchema(CustomModel):
|
|
id: int
|
|
name: str
|
|
|
|
|
|
class ServiceSchema(CustomModel):
|
|
id: int
|
|
name: str
|
|
category: ServiceCategorySchema
|
|
price: float
|
|
|
|
|
|
# endregion
|
|
|
|
|
|
# region Requests
|
|
class ServiceCreateRequest(CustomModel):
|
|
service: ServiceSchema
|
|
|
|
|
|
class ServiceCreateCategoryRequest(CustomModel):
|
|
category: ServiceCategorySchema
|
|
|
|
|
|
# endregion
|
|
|
|
|
|
# region Responses
|
|
class ServiceGetAllResponse(CustomModel):
|
|
services: List[ServiceSchema]
|
|
|
|
|
|
class ServiceGetAllCategoriesResponse(CustomModel):
|
|
categories: List[ServiceCategorySchema]
|
|
|
|
|
|
class ServiceCreateResponse(OkMessageSchema):
|
|
pass
|
|
|
|
|
|
class ServiceCreateCategoryResponse(OkMessageSchema):
|
|
pass
|
|
# endregion
|