
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
19 lines
653 B
Python
19 lines
653 B
Python
from sqlalchemy import Boolean, Column, String
|
|
|
|
from app.db.base_class import BaseClass
|
|
from app.db.base import Base
|
|
|
|
|
|
class User(Base, BaseClass):
|
|
"""
|
|
User model for authentication and authorization.
|
|
"""
|
|
email = Column(String, unique=True, index=True, nullable=False)
|
|
full_name = Column(String, index=True)
|
|
hashed_password = Column(String, nullable=False)
|
|
is_active = Column(Boolean, default=True)
|
|
is_superuser = Column(Boolean, default=False)
|
|
|
|
# Relationships
|
|
# When we create inventory transactions, we can link them to users
|
|
# transactions = relationship("InventoryTransaction", back_populates="user") |