feat: modules, products, services, services kits

This commit is contained in:
2025-09-16 10:54:10 +04:00
parent be8052848c
commit 276626d6f7
55 changed files with 1791 additions and 34 deletions

View File

@ -0,0 +1,77 @@
from typing import Optional
from schemas.base import BaseSchema, BaseResponse
# region Entity
class ProductImageSchema(BaseSchema):
id: int
product_id: int
image_url: str
class CreateProductSchema(BaseSchema):
name: str
article: str
factory_article: str
brand: Optional[str]
color: Optional[str]
composition: Optional[str]
size: Optional[str]
additional_info: Optional[str]
class ProductSchema(CreateProductSchema):
id: int
class UpdateProductSchema(BaseSchema):
name: Optional[str] = None
article: Optional[str] = None
factory_article: Optional[str] = None
brand: Optional[str] = None
color: Optional[str] = None
composition: Optional[str] = None
size: Optional[str] = None
additional_info: Optional[str] = None
images: list[ProductImageSchema] | None = []
# endregion
# region Request
class CreateProductRequest(BaseSchema):
entity: CreateProductSchema
class UpdateProductRequest(BaseSchema):
entity: UpdateProductSchema
# endregion
# region Response
class GetProductsResponse(BaseSchema):
items: list[ProductSchema]
class CreateProductResponse(BaseResponse):
entity: ProductSchema
class UpdateProductResponse(BaseResponse):
pass
class DeleteProductResponse(BaseResponse):
pass
# endregion