
- Created FastAPI application with SQLite database - Implemented models for inventory items, categories, suppliers, and transactions - Added authentication system with JWT tokens - Implemented CRUD operations for all models - Set up Alembic for database migrations - Added comprehensive API documentation - Configured Ruff for code linting
21 lines
613 B
Python
21 lines
613 B
Python
from sqlalchemy import Column, Integer, String
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.db.base import Base
|
|
|
|
|
|
class Supplier(Base):
|
|
"""
|
|
Supplier model for tracking inventory suppliers.
|
|
"""
|
|
__tablename__ = "suppliers"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
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(String, nullable=True)
|
|
|
|
# Relationships
|
|
items = relationship("Item", back_populates="supplier") |