init
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
from decimal import Decimal
|
||||
|
||||
|
||||
class InventoryResponse(BaseModel):
|
||||
id: int
|
||||
product_id: int
|
||||
product_name: str
|
||||
product_sku: str
|
||||
warehouse_id: int
|
||||
warehouse_name: str
|
||||
quantity: Decimal
|
||||
locked_quantity: Decimal
|
||||
available_quantity: Decimal
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class InventoryCreate(BaseModel):
|
||||
product_id: int
|
||||
warehouse_id: int
|
||||
quantity: Decimal = Decimal("0")
|
||||
locked_quantity: Decimal = Decimal("0")
|
||||
batch_number: Optional[str] = None
|
||||
location: Optional[str] = None
|
||||
|
||||
|
||||
class InventoryUpdate(BaseModel):
|
||||
quantity: Optional[Decimal] = None
|
||||
locked_quantity: Optional[Decimal] = None
|
||||
batch_number: Optional[str] = None
|
||||
location: Optional[str] = None
|
||||
Reference in New Issue
Block a user