Add self-contained configuration and migrations support for modules:
Config auto-discovery (app/modules/config.py):
- Modules can have config.py with Pydantic Settings
- Environment variables prefixed with MODULE_NAME_
- Auto-discovered via get_module_config()
Migrations auto-discovery:
- Each module has migrations/versions/ directory
- Alembic discovers module migrations automatically
- Naming convention: {module}_{seq}_{description}.py
New architecture rules (MOD-013 to MOD-015):
- MOD-013: config.py should export config/config_class
- MOD-014: Migrations must follow naming convention
- MOD-015: Migrations directory must have __init__.py
Created for all 11 self-contained modules:
- config.py placeholder files
- migrations/ directories with __init__.py files
Added core and tenancy module definitions for completeness.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
40 lines
910 B
Python
40 lines
910 B
Python
# app/modules/core/definition.py
|
|
"""
|
|
Core Platform module definition.
|
|
|
|
Dashboard, settings, and profile management.
|
|
Required for basic operation - cannot be disabled.
|
|
"""
|
|
|
|
from app.modules.base import ModuleDefinition
|
|
from models.database.admin_menu_config import FrontendType
|
|
|
|
core_module = ModuleDefinition(
|
|
code="core",
|
|
name="Core Platform",
|
|
description="Dashboard, settings, and profile management. Required for basic operation.",
|
|
version="1.0.0",
|
|
is_core=True,
|
|
features=[
|
|
"dashboard",
|
|
"settings",
|
|
"profile",
|
|
],
|
|
menu_items={
|
|
FrontendType.ADMIN: [
|
|
"dashboard",
|
|
"settings",
|
|
"email-templates",
|
|
"my-menu",
|
|
],
|
|
FrontendType.VENDOR: [
|
|
"dashboard",
|
|
"profile",
|
|
"settings",
|
|
"email-templates",
|
|
],
|
|
},
|
|
)
|
|
|
|
__all__ = ["core_module"]
|