feat: вфыв
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user