feat: implement complete CMT backend with API endpoints and test suite
- Add 7 core API endpoints: users, transactions, partners, products, inventory, payments, credit - Implement role-based authentication (admin/write/read-only access) - Add comprehensive database models with proper relationships - Include full test coverage for all endpoints and business logic - Set up Alembic migrations and Docker configuration - Configure FastAPI app with CORS and database integration
This commit is contained in:
@@ -6,10 +6,20 @@ from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""
|
||||
Application settings loaded from environment variables.
|
||||
"""
|
||||
database_uri: PostgresDsn
|
||||
environment: str
|
||||
project_name: str
|
||||
|
||||
# JWT settings
|
||||
secret_key: str = "your-secret-key-change-this-in-production"
|
||||
algorithm: str = "HS256"
|
||||
|
||||
# Role-based expiration times (in minutes)
|
||||
admin_token_expire_minutes: int = 60 * 24 * 7 # 7 days (default)
|
||||
write_token_expire_minutes: int = 60 * 24 * 3 # 3 days (default)
|
||||
read_only_token_expire_minutes: int = 60 * 8 # 8 hours (default)
|
||||
|
||||
model_config = SettingsConfigDict(
|
||||
# One level above ./backend
|
||||
|
||||
Reference in New Issue
Block a user