
- Set up project structure with modular organization - Implement database models for users, organizations, clients, invoices - Create Alembic migration scripts for database setup - Implement JWT-based authentication and authorization - Create API endpoints for users, organizations, clients, invoices - Add PDF generation for invoices using ReportLab - Add comprehensive documentation in README
39 lines
796 B
Python
39 lines
796 B
Python
from typing import Optional
|
|
from pydantic import BaseModel, EmailStr
|
|
|
|
|
|
# Shared properties
|
|
class UserBase(BaseModel):
|
|
email: Optional[EmailStr] = None
|
|
full_name: Optional[str] = None
|
|
is_active: Optional[bool] = True
|
|
is_superuser: bool = False
|
|
organization_id: Optional[int] = None
|
|
|
|
|
|
# Properties to receive via API on creation
|
|
class UserCreate(UserBase):
|
|
email: EmailStr
|
|
password: str
|
|
|
|
|
|
# Properties to receive via API on update
|
|
class UserUpdate(UserBase):
|
|
password: Optional[str] = None
|
|
|
|
|
|
class UserInDBBase(UserBase):
|
|
id: Optional[int] = None
|
|
|
|
class Config:
|
|
orm_mode = True
|
|
|
|
|
|
# Additional properties to return via API
|
|
class User(UserInDBBase):
|
|
pass
|
|
|
|
|
|
# Additional properties stored in DB
|
|
class UserInDB(UserInDBBase):
|
|
hashed_password: str |