This commit is contained in:
2024-04-11 14:25:40 +03:00
parent 7f302acdb5
commit 5c81af05d5
9 changed files with 63 additions and 17 deletions

View File

@@ -31,8 +31,8 @@ class OkMessageSchema(CustomModelCamel):
class PaginationSchema(CustomModelCamel):
page: int
items_per_page: int
page: int | None = None
items_per_page: int | None = None
class PaginationInfoSchema(CustomModelCamel):

View File

@@ -3,6 +3,7 @@ from typing import List
from schemas.base import CustomModelCamel, OkMessageSchema
from schemas.client import ClientSchema
from schemas.product import ProductSchema
from schemas.service import ServiceSchema
@@ -28,6 +29,11 @@ class DealServiceSchema(CustomModelCamel):
quantity: int
class DealProductSchema(CustomModelCamel):
product: ProductSchema
quantity: int
class DealSchema(CustomModelCamel):
id: int
name: str
@@ -35,6 +41,7 @@ class DealSchema(CustomModelCamel):
created_at: datetime.datetime
current_status: int
services: List[DealServiceSchema]
products: List[DealProductSchema]
# total_price: int

View File

@@ -4,12 +4,16 @@ from schemas.base import CustomModelCamel, PaginationInfoSchema, OkMessageSchema
# region Entities
class ProductBarcodeSchema(CustomModelCamel):
barcode: str
class ProductSchema(CustomModelCamel):
id: int
name: str
article: str
client_id: int
barcodes: list[str]
barcodes: list[ProductBarcodeSchema]
# endregion