
Features include: - User management with JWT authentication and role-based access - Inventory items with SKU/barcode tracking and stock management - Categories and suppliers organization - Inventory transactions with automatic stock updates - Low stock alerts and advanced search/filtering - RESTful API with comprehensive CRUD operations - SQLite database with Alembic migrations - Auto-generated API documentation Co-Authored-By: Claude <noreply@anthropic.com>
24 lines
651 B
Python
24 lines
651 B
Python
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
from app.models.inventory_transaction import TransactionType
|
|
|
|
class InventoryTransactionBase(BaseModel):
|
|
transaction_type: TransactionType
|
|
quantity: int
|
|
unit_cost: Optional[float] = None
|
|
total_cost: Optional[float] = None
|
|
reference_number: Optional[str] = None
|
|
notes: Optional[str] = None
|
|
item_id: int
|
|
|
|
class InventoryTransactionCreate(InventoryTransactionBase):
|
|
pass
|
|
|
|
class InventoryTransaction(InventoryTransactionBase):
|
|
id: int
|
|
user_id: int
|
|
created_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True |