crappy
This commit is contained in:
@@ -14,3 +14,13 @@ class CustomModel(BaseModel):
|
||||
class OkMessageSchema(BaseModel):
|
||||
ok: bool
|
||||
message: str
|
||||
|
||||
|
||||
class PaginationSchema(CustomModel):
|
||||
page: int
|
||||
items_per_page: int
|
||||
|
||||
|
||||
class PaginationInfoSchema(CustomModel):
|
||||
total_pages: int
|
||||
total_items: int
|
||||
|
||||
@@ -19,6 +19,12 @@ class DealSummary(CustomModel):
|
||||
client_name: str
|
||||
changed_at: datetime.datetime
|
||||
status: int
|
||||
total_price: int
|
||||
|
||||
|
||||
class DealServiceSchema(CustomModel):
|
||||
id: int
|
||||
quantity: int
|
||||
|
||||
|
||||
# endregion Entities
|
||||
@@ -45,6 +51,11 @@ class DealSummaryRequest(CustomModel):
|
||||
pass
|
||||
|
||||
|
||||
class DealAddServicesRequest(CustomModel):
|
||||
deal_id: int
|
||||
services: list[DealServiceSchema]
|
||||
|
||||
|
||||
# endregion Requests
|
||||
|
||||
# region Responses
|
||||
@@ -64,4 +75,8 @@ class DealQuickCreateResponse(CustomModel):
|
||||
class DealSummaryResponse(CustomModel):
|
||||
summaries: List[DealSummary]
|
||||
|
||||
|
||||
class DealAddServicesResponse(CustomModel):
|
||||
ok: bool
|
||||
message: str
|
||||
# endregion Responses
|
||||
|
||||
33
schemas/product.py
Normal file
33
schemas/product.py
Normal file
@@ -0,0 +1,33 @@
|
||||
from typing import List
|
||||
|
||||
from schemas.base import CustomModel, PaginationInfoSchema
|
||||
|
||||
|
||||
# region Entities
|
||||
class ProductSchema(CustomModel):
|
||||
id: int
|
||||
name: str
|
||||
article: str
|
||||
client_id: int
|
||||
|
||||
|
||||
# endregion
|
||||
|
||||
# region Requests
|
||||
class ProductCreateRequest(CustomModel):
|
||||
name: str
|
||||
article: str
|
||||
client_id: int
|
||||
|
||||
|
||||
# endregion
|
||||
|
||||
# region Responses
|
||||
class ProductCreateResponse(CustomModel):
|
||||
product_id: int
|
||||
|
||||
|
||||
class ProductGetResponse(CustomModel):
|
||||
products: List[ProductSchema]
|
||||
pagination_info: PaginationInfoSchema
|
||||
# endregion
|
||||
Reference in New Issue
Block a user