This commit is contained in:
2024-03-28 08:22:14 +03:00
parent 6ba041a839
commit a72eb31e07
19 changed files with 243 additions and 28 deletions

49
schemas/service.py Normal file
View File

@@ -0,0 +1,49 @@
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