
- Implemented complete authentication system with JWT tokens - Created user management with registration and profile endpoints - Built client management with full CRUD operations - Developed invoice system with line items and automatic calculations - Set up SQLite database with proper migrations using Alembic - Added health monitoring and API documentation - Configured CORS for cross-origin requests - Included comprehensive README with usage examples
19 lines
784 B
Python
19 lines
784 B
Python
from sqlalchemy import Column, Integer, String, DateTime, Boolean
|
|
from sqlalchemy.orm import relationship
|
|
from datetime import datetime
|
|
from app.db.base import Base
|
|
|
|
class User(Base):
|
|
__tablename__ = "users"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
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)
|
|
is_active = Column(Boolean, default=True)
|
|
created_at = Column(DateTime, default=datetime.utcnow)
|
|
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
|
|
|
|
clients = relationship("Client", back_populates="owner")
|
|
invoices = relationship("Invoice", back_populates="owner") |