
- Set up project structure with FastAPI and SQLite - Created database models for users, categories, suppliers, items, and stock transactions - Implemented Alembic for database migrations with proper absolute paths - Built comprehensive CRUD operations for all entities - Added JWT-based authentication and authorization system - Created RESTful API endpoints for all inventory operations - Implemented search, filtering, and low stock alerts - Added health check endpoint and base URL response - Configured CORS for all origins - Set up Ruff for code linting and formatting - Updated README with comprehensive documentation and usage examples The system provides complete inventory management functionality for small businesses including product tracking, supplier management, stock transactions, and reporting. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
28 lines
637 B
Python
28 lines
637 B
Python
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
from app.models.stock_transaction import TransactionType
|
|
from app.schemas.item import Item
|
|
|
|
|
|
class StockTransactionBase(BaseModel):
|
|
item_id: int
|
|
transaction_type: TransactionType
|
|
quantity: int
|
|
unit_cost: Optional[float] = None
|
|
reference_number: Optional[str] = None
|
|
notes: Optional[str] = None
|
|
|
|
|
|
class StockTransactionCreate(StockTransactionBase):
|
|
pass
|
|
|
|
|
|
class StockTransaction(StockTransactionBase):
|
|
id: int
|
|
created_at: datetime
|
|
item: Optional[Item] = None
|
|
|
|
class Config:
|
|
from_attributes = True
|