
- Setup project structure with FastAPI application - Create database models with SQLAlchemy - Configure Alembic for database migrations - Implement CRUD operations for products, categories, suppliers - Add inventory transaction functionality - Implement user authentication with JWT - Add health check endpoint - Create comprehensive documentation
19 lines
586 B
Python
19 lines
586 B
Python
from sqlalchemy import Column, Integer, String, Text
|
|
from sqlalchemy.orm import relationship
|
|
from app.db.base_class import Base
|
|
|
|
|
|
class Supplier(Base):
|
|
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(Text, nullable=True)
|
|
|
|
# Relationships
|
|
products = relationship(
|
|
"Product",
|
|
back_populates="supplier",
|
|
cascade="all, delete-orphan"
|
|
) |