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>
84 lines
2.1 KiB
Python
84 lines
2.1 KiB
Python
# app/platforms/loyalty/config.py
|
|
"""
|
|
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
|
|
|
|
|
|
class LoyaltyPlatformConfig(BasePlatformConfig):
|
|
"""Configuration for the Loyalty platform."""
|
|
|
|
@property
|
|
def code(self) -> str:
|
|
return "loyalty"
|
|
|
|
@property
|
|
def name(self) -> str:
|
|
return "Loyalty+"
|
|
|
|
@property
|
|
def description(self) -> str:
|
|
return "Customer loyalty and rewards platform"
|
|
|
|
@property
|
|
def features(self) -> list[str]:
|
|
"""Loyalty-specific features."""
|
|
return [
|
|
"loyalty_points",
|
|
"rewards_catalog",
|
|
"customer_tiers",
|
|
"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."""
|
|
return [
|
|
"about",
|
|
"how-it-works",
|
|
"rewards",
|
|
"terms-of-service",
|
|
"privacy-policy",
|
|
]
|
|
|
|
|
|
# Singleton instance
|
|
loyalty_config = LoyaltyPlatformConfig()
|