Files
geMoldInsight/src/inventory/api/schemas/stock_movement_schemas.py
T
2026-05-29 18:10:08 +08:00

32 lines
718 B
Python

from pydantic import BaseModel
from typing import Optional
from datetime import datetime
from decimal import Decimal
class StockMovementCreate(BaseModel):
product_id: int
product_sku: Optional[str] = None
warehouse_id: int
movement_type: str
quantity: Decimal
unit_price: Optional[Decimal] = None
remark: Optional[str] = None
class StockMovementResponse(BaseModel):
id: int
product_id: int
product_sku: Optional[str]
product_name: str
movement_type: str
quantity: Decimal
before_quantity: Decimal
after_quantity: Decimal
reference_no: Optional[str]
remark: Optional[str]
created_at: datetime
class Config:
from_attributes = True