feat: вфыв

This commit is contained in:
2024-07-20 09:32:22 +03:00
parent e7235021f9
commit 6b09251141
27 changed files with 536 additions and 119 deletions

View File

@@ -1,18 +1,18 @@
from typing import List
from schemas.barcode import BarcodeTemplateSchema
from schemas.base import CustomModelCamel, PaginationInfoSchema, OkMessageSchema
from schemas.base import BaseSchema, PaginationInfoSchema, OkMessageSchema
from pydantic import field_validator, model_validator
from models import ProductBarcode
# region Entities
class ProductImageSchema(CustomModelCamel):
class ProductImageSchema(BaseSchema):
id: int
product_id: int
image_url: str
class BaseProductSchema(CustomModelCamel):
class BaseProductSchema(BaseSchema):
name: str
article: str | None = ''
client_id: int
@@ -55,25 +55,25 @@ class ProductCreateRequest(BaseProductSchema):
pass
class ProductDeleteRequest(CustomModelCamel):
class ProductDeleteRequest(BaseSchema):
product_id: int
class ProductUpdateRequest(CustomModelCamel):
class ProductUpdateRequest(BaseSchema):
product: ProductSchema
class ProductAddBarcodeRequest(CustomModelCamel):
class ProductAddBarcodeRequest(BaseSchema):
product_id: int
barcode: str
class ProductDeleteBarcodeRequest(CustomModelCamel):
class ProductDeleteBarcodeRequest(BaseSchema):
product_id: int
barcode: str
class ProductGenerateBarcodeRequest(CustomModelCamel):
class ProductGenerateBarcodeRequest(BaseSchema):
product_id: int
@@ -84,7 +84,7 @@ class ProductCreateResponse(OkMessageSchema):
product_id: int | None = None
class ProductGetResponse(CustomModelCamel):
class ProductGetResponse(BaseSchema):
products: List[ProductSchema]
pagination_info: PaginationInfoSchema
@@ -109,7 +109,7 @@ class ProductGenerateBarcodeResponse(OkMessageSchema):
barcode: str
class ProductExistsBarcodeResponse(CustomModelCamel):
class ProductExistsBarcodeResponse(BaseSchema):
exists: bool