This commit is contained in:
2024-03-19 09:01:46 +03:00
parent aafa1050a7
commit 6ba041a839
23 changed files with 369 additions and 39 deletions

49
schemas/services.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