Add app/schemas/stock_movement.py
This commit is contained in:
29
app/schemas/stock_movement.py
Normal file
29
app/schemas/stock_movement.py
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
from datetime import datetime
|
||||||
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
|
||||||
|
class StockMoveRequest(BaseModel):
|
||||||
|
product_id: str
|
||||||
|
type: str # IN, OUT, ADJUST
|
||||||
|
quantity: int
|
||||||
|
reason: str | None = None
|
||||||
|
|
||||||
|
|
||||||
|
class StockMovementResponse(BaseModel):
|
||||||
|
id: str
|
||||||
|
product_id: str
|
||||||
|
type: str
|
||||||
|
quantity: int
|
||||||
|
reason: str | None
|
||||||
|
created_at: datetime
|
||||||
|
|
||||||
|
class Config:
|
||||||
|
from_attributes = True
|
||||||
|
|
||||||
|
|
||||||
|
class StockSummary(BaseModel):
|
||||||
|
product_id: str
|
||||||
|
product_name: str
|
||||||
|
current_stock: int
|
||||||
|
min_stock: int
|
||||||
|
is_low_stock: bool
|
||||||
Reference in New Issue
Block a user