Files
Fulfillment-Backend/schemas/service.py
2024-03-28 08:22:14 +03:00

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