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:
2026-01-25 21:42:44 +01:00
parent 899935ab13
commit 5be42c5907
8 changed files with 1985 additions and 0 deletions

View File

@@ -3,6 +3,18 @@
Loyalty Platform Configuration
Configuration for the Loyalty/Rewards platform.
Loyalty is a focused customer rewards platform with:
- Customer management and segmentation
- Analytics and reporting
- Content management (for rewards pages)
- Messaging and notifications
It does NOT include:
- Inventory management (no physical products)
- Order processing (rewards are claimed, not purchased)
- Marketplace integration (internal program only)
- Billing (typically internal/free programs)
"""
from app.platforms.shared.base_platform import BasePlatformConfig
@@ -33,6 +45,28 @@ class LoyaltyPlatformConfig(BasePlatformConfig):
"referral_program",
]
@property
def enabled_modules(self) -> list[str]:
"""
Loyalty platform has a focused module set.
Core modules (core, platform-admin) are always included.
Does not include: billing, inventory, orders, marketplace
"""
return [
# Core modules (always enabled, listed for clarity)
"core",
"platform-admin",
# Customer-focused modules
"customers",
"analytics",
"messaging",
# Content for rewards pages
"cms",
# Internal tools (reduced set)
"monitoring",
]
@property
def vendor_default_page_slugs(self) -> list[str]:
"""Default pages for Loyalty vendor storefronts."""