Automated Action b51b13eb3e Create backend scaffold for freelancer invoicing API
- Set up FastAPI application with CORS support
- Configure SQLite database connection
- Create database models for users, clients, invoices, and line items
- Set up Alembic for database migrations
- Implement JWT-based authentication system
- Create basic CRUD endpoints for users, clients, and invoices
- Add PDF generation functionality
- Implement activity logging
- Update README with project information
2025-05-26 18:21:20 +00:00

16 lines
662 B
Python

from sqlalchemy import Column, String, Boolean
from sqlalchemy.orm import relationship
import uuid
from app.db.base_class import Base
class User(Base):
id = Column(String, primary_key=True, index=True, default=lambda: str(uuid.uuid4()))
email = Column(String, unique=True, index=True, nullable=False)
hashed_password = Column(String, nullable=False)
full_name = 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")