Automated Action d340d37ac9 Create Small Business Inventory Management System API
- Set up project structure with FastAPI and SQLite
- Create database models for inventory management
- Set up SQLAlchemy and Alembic for database migrations
- Create initial database migrations
- Implement CRUD operations for products, categories, suppliers
- Implement stock movement tracking and inventory management
- Add authentication and user management
- Add API endpoints for all entities
- Add health check endpoint
- Update README with project information and usage instructions
2025-05-23 11:56:20 +00:00

34 lines
771 B
Python

from pydantic import BaseModel
from typing import Optional
from datetime import datetime
from app.models.stock_movement import MovementType
# Shared properties
class StockMovementBase(BaseModel):
product_id: str
quantity: int
unit_price: Optional[float] = None
movement_type: MovementType
reference: Optional[str] = None
notes: Optional[str] = None
# Properties to receive via API on creation
class StockMovementCreate(StockMovementBase):
pass
class StockMovementInDBBase(StockMovementBase):
id: str
created_by: Optional[str] = None
created_at: datetime
updated_at: datetime
class Config:
from_attributes = True
# Additional properties to return via API
class StockMovement(StockMovementInDBBase):
pass