52 lines
909 B
Python
52 lines
909 B
Python
from typing import List
|
|
|
|
from schemas.base import CustomModelCamel, PaginationInfoSchema, OkMessageSchema
|
|
|
|
|
|
# region Entities
|
|
class ProductSchema(CustomModelCamel):
|
|
id: int
|
|
name: str
|
|
article: str
|
|
client_id: int
|
|
barcodes: list[str]
|
|
|
|
|
|
# endregion
|
|
|
|
# region Requests
|
|
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(OkMessageSchema):
|
|
product_id: int | None = None
|
|
|
|
|
|
class ProductGetResponse(CustomModelCamel):
|
|
products: List[ProductSchema]
|
|
pagination_info: PaginationInfoSchema
|
|
|
|
|
|
class ProductDeleteResponse(OkMessageSchema):
|
|
pass
|
|
|
|
|
|
class ProductUpdateResponse(OkMessageSchema):
|
|
pass
|
|
# endregion
|