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

31 lines
733 B
Python
Raw Normal View History

from pydantic import BaseModel, ConfigDict
2026-03-08 22:58:25 +08:00
from typing import Optional
from datetime import datetime
2026-04-19 23:41:35 +08:00
from decimal import Decimal
2026-03-08 22:58:25 +08:00
class StockMovementCreate(BaseModel):
product_id: int
2026-03-15 22:04:28 +08:00
product_sku: Optional[str] = None
2026-03-08 22:58:25 +08:00
warehouse_id: int
movement_type: str
2026-04-19 23:41:35 +08:00
quantity: Decimal
unit_price: Optional[Decimal] = None
2026-03-08 22:58:25 +08:00
remark: Optional[str] = None
class StockMovementResponse(BaseModel):
id: int
2026-03-15 22:04:28 +08:00
product_id: int
product_sku: Optional[str]
2026-03-08 22:58:25 +08:00
product_name: str
movement_type: str
2026-04-19 23:41:35 +08:00
quantity: Decimal
before_quantity: Decimal
after_quantity: Decimal
2026-03-08 22:58:25 +08:00
reference_no: Optional[str]
remark: Optional[str]
created_at: datetime
model_config = ConfigDict(from_attributes=True)