
- Create project structure with FastAPI and SQLAlchemy - Implement database models for items, categories, suppliers, and stock movements - Add CRUD operations for all models - Configure Alembic for database migrations - Create RESTful API endpoints for inventory management - Add health endpoint for system monitoring - Update README with setup and usage instructions generated with BackendIM... (backend.im)
25 lines
637 B
Python
25 lines
637 B
Python
from pydantic import BaseModel
|
|
from typing import Optional
|
|
from datetime import datetime
|
|
from app.models.stock_movement import MovementType
|
|
|
|
class StockMovementBase(BaseModel):
|
|
item_id: int
|
|
quantity: int
|
|
movement_type: MovementType
|
|
reference: Optional[str] = None
|
|
notes: Optional[str] = None
|
|
unit_price: Optional[float] = None
|
|
|
|
class StockMovementCreate(StockMovementBase):
|
|
pass
|
|
|
|
class StockMovementResponse(StockMovementBase):
|
|
id: int
|
|
created_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
class StockMovementDetailResponse(StockMovementResponse):
|
|
item: Optional[dict] = None |