crappy
This commit is contained in:
		@@ -1,33 +1,51 @@
 | 
			
		||||
from typing import List
 | 
			
		||||
 | 
			
		||||
from schemas.base import CustomModel, PaginationInfoSchema
 | 
			
		||||
from schemas.base import CustomModelCamel, PaginationInfoSchema, OkMessageSchema
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# region Entities
 | 
			
		||||
class ProductSchema(CustomModel):
 | 
			
		||||
class ProductSchema(CustomModelCamel):
 | 
			
		||||
    id: int
 | 
			
		||||
    name: str
 | 
			
		||||
    article: str
 | 
			
		||||
    client_id: int
 | 
			
		||||
    barcodes: list[str]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# endregion
 | 
			
		||||
 | 
			
		||||
# region Requests
 | 
			
		||||
class ProductCreateRequest(CustomModel):
 | 
			
		||||
class ProductCreateRequest(CustomModelCamel):
 | 
			
		||||
    name: str
 | 
			
		||||
    article: str
 | 
			
		||||
    client_id: int
 | 
			
		||||
    barcodes: List[str]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ProductDeleteRequest(CustomModelCamel):
 | 
			
		||||
    product_id: int
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ProductUpdateRequest(CustomModelCamel):
 | 
			
		||||
    product: ProductSchema
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# endregion
 | 
			
		||||
 | 
			
		||||
# region Responses
 | 
			
		||||
class ProductCreateResponse(CustomModel):
 | 
			
		||||
    product_id: int
 | 
			
		||||
class ProductCreateResponse(OkMessageSchema):
 | 
			
		||||
    product_id: int | None = None
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ProductGetResponse(CustomModel):
 | 
			
		||||
class ProductGetResponse(CustomModelCamel):
 | 
			
		||||
    products: List[ProductSchema]
 | 
			
		||||
    pagination_info: PaginationInfoSchema
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ProductDeleteResponse(OkMessageSchema):
 | 
			
		||||
    pass
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ProductUpdateResponse(OkMessageSchema):
 | 
			
		||||
    pass
 | 
			
		||||
# endregion
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user