
- Set up project structure for FastAPI application - Create database models for items, categories, suppliers, and transactions - Set up Alembic for database migrations - Implement API endpoints for all entities - Add authentication with JWT tokens - Add health check endpoint - Create comprehensive README with documentation
20 lines
628 B
Python
20 lines
628 B
Python
from sqlalchemy import Column, String, Text
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.db.base import Base
|
|
from app.db.base_class import BaseModel
|
|
|
|
|
|
class Supplier(Base, BaseModel):
|
|
"""Supplier model for inventory item sources."""
|
|
__tablename__ = "suppliers"
|
|
|
|
name = Column(String, index=True, nullable=False)
|
|
contact_name = Column(String, nullable=True)
|
|
email = Column(String, nullable=True)
|
|
phone = Column(String, nullable=True)
|
|
address = Column(Text, nullable=True)
|
|
notes = Column(Text, nullable=True)
|
|
|
|
# Relationships
|
|
items = relationship("Item", back_populates="supplier") |