
- Set up project structure and FastAPI application - Create database models with SQLAlchemy - Implement authentication with JWT - Add CRUD operations for products, inventory, categories - Implement purchase order and sales functionality - Create reporting endpoints - Set up Alembic for database migrations - Add comprehensive documentation in README.md
17 lines
644 B
Python
17 lines
644 B
Python
from sqlalchemy import Boolean, Column, Integer, String
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.db.base_class import Base
|
|
|
|
|
|
class User(Base):
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
full_name = Column(String, index=True)
|
|
email = Column(String, unique=True, index=True, nullable=False)
|
|
hashed_password = Column(String, nullable=False)
|
|
is_active = Column(Boolean(), default=True)
|
|
is_admin = Column(Boolean(), default=False)
|
|
|
|
# Relationships
|
|
purchase_orders = relationship("PurchaseOrder", back_populates="created_by_user")
|
|
sales = relationship("Sale", back_populates="created_by_user") |