
- 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
37 lines
780 B
Python
37 lines
780 B
Python
from pydantic import BaseModel, EmailStr
|
|
from typing import Optional
|
|
from datetime import datetime
|
|
|
|
|
|
# Shared properties
|
|
class SupplierBase(BaseModel):
|
|
name: str
|
|
contact_name: Optional[str] = None
|
|
email: Optional[EmailStr] = None
|
|
phone: Optional[str] = None
|
|
address: Optional[str] = None
|
|
notes: Optional[str] = None
|
|
|
|
|
|
# Properties to receive via API on creation
|
|
class SupplierCreate(SupplierBase):
|
|
pass
|
|
|
|
|
|
# Properties to receive via API on update
|
|
class SupplierUpdate(SupplierBase):
|
|
name: Optional[str] = None
|
|
|
|
|
|
class SupplierInDBBase(SupplierBase):
|
|
id: str
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
# Additional properties to return via API
|
|
class Supplier(SupplierInDBBase):
|
|
pass |