32 lines
661 B
Python
32 lines
661 B
Python
from pydantic import BaseModel
|
|
from typing import Optional
|
|
|
|
|
|
class ProductResponse(BaseModel):
|
|
id: int
|
|
name: str
|
|
default_code: Optional[str] = None
|
|
list_price: float
|
|
qty_available: float
|
|
virtual_available: float
|
|
description: Optional[str] = None
|
|
categ_name: Optional[str] = None
|
|
|
|
|
|
class ProductSearchResult(BaseModel):
|
|
id: int
|
|
name: str
|
|
default_code: Optional[str] = None
|
|
list_price: float
|
|
qty_available: float
|
|
|
|
|
|
class StockInfo(BaseModel):
|
|
product_id: int
|
|
product_name: str
|
|
qty_available: float
|
|
qty_reserved: float
|
|
qty_incoming: float
|
|
qty_outgoing: float
|
|
virtual_available: float
|