feat: deal product services

This commit is contained in:
2024-05-18 07:00:12 +03:00
parent be650aca74
commit 30886d223c
5 changed files with 37 additions and 45 deletions

View File

@@ -35,7 +35,6 @@ class DealServiceSchema(CustomModelCamel):
class DealProductServiceSchema(CustomModelCamel):
service: ServiceSchema
quantity: int
price: int
@@ -134,8 +133,7 @@ class DealUpdateProductQuantityRequest(CustomModelCamel):
class DealAddProductRequest(CustomModelCamel):
deal_id: int
product_id: int
quantity: int
product: DealProductSchema
class DealDeleteProductRequest(CustomModelCamel):

View File

@@ -6,9 +6,7 @@ from models import ProductBarcode
# region Entities
class ProductSchema(CustomModelCamel):
id: int
class BaseProductSchema(CustomModelCamel):
name: str
article: str
client_id: int
@@ -29,15 +27,15 @@ class ProductSchema(CustomModelCamel):
return v
class ProductSchema(BaseProductSchema):
id: int
# endregion
# region Requests
class ProductCreateRequest(CustomModelCamel):
name: str
article: str
client_id: int
barcodes: List[str]
barcode_template: BarcodeTemplateSchema | None = None
class ProductCreateRequest(BaseProductSchema):
pass
class ProductDeleteRequest(CustomModelCamel):