feat: implement modular platform architecture (Phase 1)
Add module system for enabling/disabling feature bundles per platform. Module System: - ModuleDefinition dataclass for defining modules - 12 modules: core, platform-admin, billing, inventory, orders, marketplace, customers, cms, analytics, messaging, dev-tools, monitoring - Core modules (core, platform-admin) cannot be disabled - Module dependencies (e.g., marketplace requires inventory) MenuService Integration: - Menu items filtered by module enablement - MenuItemConfig includes is_module_enabled and module_code fields - Module-disabled items hidden from sidebar Platform Configuration: - BasePlatformConfig.enabled_modules property - OMS: all modules enabled (full commerce) - Loyalty: focused subset (no billing/inventory/orders/marketplace) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,11 @@ class BasePlatformConfig(ABC):
|
||||
|
||||
Each platform should create a config.py that extends this class
|
||||
and provides platform-specific settings.
|
||||
|
||||
Module Configuration:
|
||||
- enabled_modules: List of module codes to enable for this platform
|
||||
- Core modules (core, platform-admin) are always enabled
|
||||
- If not specified, all modules are enabled (backwards compatibility)
|
||||
"""
|
||||
|
||||
@property
|
||||
@@ -59,6 +64,33 @@ class BasePlatformConfig(ABC):
|
||||
"""List of feature codes enabled for this platform."""
|
||||
return []
|
||||
|
||||
@property
|
||||
def enabled_modules(self) -> list[str]:
|
||||
"""
|
||||
List of module codes enabled for this platform.
|
||||
|
||||
Core modules (core, platform-admin) are always enabled regardless.
|
||||
Override in subclass to customize which modules are available.
|
||||
|
||||
Available modules:
|
||||
- core (always enabled): Dashboard, settings, profile
|
||||
- platform-admin (always enabled): Companies, vendors, admin users
|
||||
- billing: Subscription tiers, billing history
|
||||
- inventory: Stock management, products
|
||||
- orders: Order processing, fulfillment
|
||||
- marketplace: Letzshop integration
|
||||
- customers: Customer management
|
||||
- cms: Content pages, media library
|
||||
- analytics: Reports, dashboard analytics
|
||||
- messaging: Messages, notifications
|
||||
- dev-tools: Component library (internal)
|
||||
- monitoring: Logs, background tasks (internal)
|
||||
|
||||
Returns:
|
||||
List of module codes. Empty list means all modules enabled.
|
||||
"""
|
||||
return [] # Empty = all modules enabled (backwards compatibility)
|
||||
|
||||
@property
|
||||
def marketing_page_slugs(self) -> list[str]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user