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:
2025-09-14 21:04:07 +02:00
parent 49c813778b
commit c086f64363
48 changed files with 6992 additions and 126 deletions
+10
View File
@@ -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