Files
api-inventario/app/schemas/stock_movement.py

30 lines
543 B
Python

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