This commit is contained in:
2024-03-31 07:36:35 +03:00
parent df6e2e7fb1
commit 5de5b9b3e4
12 changed files with 1469 additions and 56 deletions

View File

@@ -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