Files
geMoldInsight/src/inventory/schemas/inventory_schemas.py
T

35 lines
807 B
Python
Raw Normal View History

2026-03-08 22:58:25 +08:00
from pydantic import BaseModel
2026-03-17 22:20:56 +08:00
from typing import Optional
2026-04-19 23:41:35 +08:00
from decimal import Decimal
2026-03-08 22:58:25 +08:00
class InventoryResponse(BaseModel):
id: int
product_id: int
product_name: str
product_sku: str
warehouse_id: int
warehouse_name: str
2026-04-19 23:41:35 +08:00
quantity: Decimal
locked_quantity: Decimal
available_quantity: Decimal
2026-03-08 22:58:25 +08:00
class Config:
from_attributes = True
2026-03-17 22:20:56 +08:00
class InventoryCreate(BaseModel):
product_id: int
warehouse_id: int
2026-04-19 23:41:35 +08:00
quantity: Decimal = Decimal("0")
locked_quantity: Decimal = Decimal("0")
2026-03-17 22:20:56 +08:00
batch_number: Optional[str] = None
location: Optional[str] = None
class InventoryUpdate(BaseModel):
2026-04-19 23:41:35 +08:00
quantity: Optional[Decimal] = None
locked_quantity: Optional[Decimal] = None
2026-03-17 22:20:56 +08:00
batch_number: Optional[str] = None
location: Optional[str] = None