
- 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
33 lines
603 B
Python
33 lines
603 B
Python
from pydantic import BaseModel, EmailStr, Field
|
|
from typing import Optional
|
|
|
|
|
|
class UserBase(BaseModel):
|
|
email: EmailStr
|
|
full_name: Optional[str] = None
|
|
|
|
|
|
class UserCreate(UserBase):
|
|
password: str = Field(..., min_length=8)
|
|
|
|
|
|
class UserUpdate(BaseModel):
|
|
email: Optional[EmailStr] = None
|
|
full_name: Optional[str] = None
|
|
password: Optional[str] = Field(None, min_length=8)
|
|
|
|
|
|
class UserInDBBase(UserBase):
|
|
id: str
|
|
is_active: bool
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class User(UserInDBBase):
|
|
pass
|
|
|
|
|
|
class UserInDB(UserInDBBase):
|
|
hashed_password: str |