50 lines
		
	
	
		
			849 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			849 B
		
	
	
	
		
			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
 | 
						|
 | 
						|
 | 
						|
# endregion
 | 
						|
 | 
						|
 | 
						|
# region Responses
 | 
						|
class ServiceGetAllResponse(CustomModelCamel):
 | 
						|
    services: List[ServiceSchema]
 | 
						|
 | 
						|
 | 
						|
class ServiceGetAllCategoriesResponse(CustomModelCamel):
 | 
						|
    categories: List[ServiceCategorySchema]
 | 
						|
 | 
						|
 | 
						|
class ServiceCreateResponse(OkMessageSchema):
 | 
						|
    pass
 | 
						|
 | 
						|
 | 
						|
class ServiceCreateCategoryResponse(OkMessageSchema):
 | 
						|
    pass
 | 
						|
# endregion
 |