feat: a few shipping products in box

This commit is contained in:
2025-03-01 17:04:55 +04:00
parent a2c9fd8e3b
commit 6fb9dcf6f0
5 changed files with 48 additions and 57 deletions

View File

@@ -11,19 +11,19 @@ class ProductAndQuantitySchema(BaseSchema):
quantity: Optional[int]
class BoxSchema(BaseSchema):
id: int
quantity: int
product: Optional[ProductSchema]
pallet_id: Optional[int]
card_id: Optional[int]
class ShippingProductSchema(BaseSchema):
id: int
quantity: int
product: ProductSchema
pallet_id: int
pallet_id: Optional[int]
box_id: Optional[int]
class BoxSchema(BaseSchema):
id: int
pallet_id: Optional[int]
card_id: Optional[int]
shipping_products: list[ShippingProductSchema]
class PalletSchema(BaseSchema):
@@ -33,7 +33,8 @@ class PalletSchema(BaseSchema):
class CreateShippingProductSchema(ProductAndQuantitySchema):
pallet_id: int
pallet_id: Optional[int] = None
box_id: Optional[int] = None
class UpdateShippingProductSchema(ProductAndQuantitySchema):
@@ -48,10 +49,6 @@ class CreateBoxInCardSchema(BaseSchema):
card_id: Optional[int]
class UpdateBoxSchema(ProductAndQuantitySchema):
box_id: Optional[int]
# endregion
# region Requests
@@ -60,8 +57,8 @@ class UpdateShippingProductRequest(BaseSchema):
data: CreateShippingProductSchema | UpdateShippingProductSchema
class UpdateBoxRequest(BaseSchema):
data: CreateBoxInCardSchema | CreateBoxInPalletSchema | UpdateBoxSchema
class CreateBoxRequest(BaseSchema):
data: CreateBoxInCardSchema | CreateBoxInPalletSchema
# endregion
@@ -80,7 +77,7 @@ class UpdateShippingProductResponse(OkMessageSchema):
pass
class UpdateBoxResponse(OkMessageSchema):
class CreateBoxResponse(OkMessageSchema):
pass