Automated Action be0ae5f3b3 Implement small business inventory management system
- 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)
2025-05-12 16:23:23 +00:00

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