Automated Action 77865dae90 Setup complete FastAPI backend with user authentication, client management, and invoice generation
Features:
- User authentication with JWT
- Client management with CRUD operations
- Invoice generation and management
- SQLite database with Alembic migrations
- Detailed project documentation
2025-05-26 17:41:47 +00:00

22 lines
864 B
Python

from sqlalchemy import Boolean, Column, String
from sqlalchemy.orm import relationship
from app.models.base import ModelBase, TimestampMixin
class User(ModelBase, TimestampMixin):
"""
User model
"""
email = Column(String, unique=True, index=True, nullable=False)
hashed_password = Column(String, nullable=False)
full_name = Column(String, nullable=False)
company_name = Column(String, nullable=True)
address = Column(String, nullable=True)
phone = Column(String, nullable=True)
is_active = Column(Boolean, default=True)
# Relationships
clients = relationship("Client", back_populates="user", cascade="all, delete-orphan")
invoices = relationship("Invoice", back_populates="user", cascade="all, delete-orphan")
activities = relationship("Activity", back_populates="user", cascade="all, delete-orphan")