
- 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)
30 lines
751 B
Python
30 lines
751 B
Python
from pydantic import BaseModel, EmailStr
|
|
from typing import Optional
|
|
from datetime import datetime
|
|
|
|
class SupplierBase(BaseModel):
|
|
name: str
|
|
contact_name: Optional[str] = None
|
|
email: Optional[EmailStr] = None
|
|
phone: Optional[str] = None
|
|
address: Optional[str] = None
|
|
|
|
class SupplierCreate(SupplierBase):
|
|
pass
|
|
|
|
class SupplierUpdate(BaseModel):
|
|
name: Optional[str] = None
|
|
contact_name: Optional[str] = None
|
|
email: Optional[EmailStr] = None
|
|
phone: Optional[str] = None
|
|
address: Optional[str] = None
|
|
is_active: Optional[bool] = None
|
|
|
|
class SupplierResponse(SupplierBase):
|
|
id: int
|
|
is_active: bool
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True |