
- Created complete RESTful API for inventory management - Set up database models for items, categories, suppliers, and transactions - Implemented user authentication with JWT tokens - Added transaction tracking for inventory movements - Created comprehensive API endpoints for all CRUD operations - Set up Alembic for database migrations - Added input validation and error handling - Created detailed documentation in README
37 lines
759 B
Python
37 lines
759 B
Python
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, EmailStr
|
|
|
|
|
|
# Shared properties
|
|
class SupplierBase(BaseModel):
|
|
name: str
|
|
contact_name: Optional[str] = None
|
|
email: Optional[EmailStr] = None
|
|
phone: Optional[str] = None
|
|
address: 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: Optional[datetime] = None
|
|
|
|
class Config:
|
|
orm_mode = True
|
|
|
|
|
|
# Additional properties to return via API
|
|
class Supplier(SupplierInDBBase):
|
|
pass |