
This commit includes: - Project structure setup with FastAPI and SQLite - Database models and schemas for inventory management - CRUD operations for all entities - API endpoints for product, category, supplier, and inventory management - User authentication with JWT tokens - Initial database migration - Comprehensive README with setup instructions
21 lines
683 B
Python
21 lines
683 B
Python
from sqlalchemy import Column, String, Text
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.db.base_class import BaseClass
|
|
from app.db.base import Base
|
|
|
|
|
|
class Supplier(Base, BaseClass):
|
|
"""
|
|
Supplier model for managing product suppliers.
|
|
"""
|
|
name = Column(String(255), index=True, nullable=False)
|
|
contact_name = Column(String(255), nullable=True)
|
|
email = Column(String(255), nullable=True)
|
|
phone = Column(String(50), nullable=True)
|
|
address = Column(Text, nullable=True)
|
|
website = Column(String(255), nullable=True)
|
|
notes = Column(Text, nullable=True)
|
|
|
|
# Relationships
|
|
products = relationship("Product", back_populates="supplier") |