28 lines
583 B
Python
28 lines
583 B
Python
|
|
from pydantic import BaseModel
|
||
|
|
from typing import Optional
|
||
|
|
from datetime import datetime
|
||
|
|
|
||
|
|
|
||
|
|
class StockMovementCreate(BaseModel):
|
||
|
|
product_id: int
|
||
|
|
warehouse_id: int
|
||
|
|
movement_type: str
|
||
|
|
quantity: int
|
||
|
|
unit_price: Optional[float] = None
|
||
|
|
remark: Optional[str] = None
|
||
|
|
|
||
|
|
|
||
|
|
class StockMovementResponse(BaseModel):
|
||
|
|
id: int
|
||
|
|
product_name: str
|
||
|
|
movement_type: str
|
||
|
|
quantity: int
|
||
|
|
before_quantity: int
|
||
|
|
after_quantity: int
|
||
|
|
reference_no: Optional[str]
|
||
|
|
remark: Optional[str]
|
||
|
|
created_at: datetime
|
||
|
|
|
||
|
|
class Config:
|
||
|
|
from_attributes = True
|