feat: add multi-platform CMS architecture (Phase 1)
Implement the foundation for multi-platform support allowing independent business offerings (OMS, Loyalty, etc.) with their own CMS pages. Database Models: - Add Platform model for business offerings (domain, branding, config) - Add VendorPlatform junction table for many-to-many relationship - Update SubscriptionTier with platform_id and CMS limits - Update ContentPage with platform_id, is_platform_page for three-tier hierarchy - Add CMS feature codes (cms_basic, cms_custom_pages, cms_templates, etc.) Three-Tier Content Resolution: 1. Vendor override (platform_id + vendor_id + slug) 2. Vendor default (platform_id + vendor_id=NULL + is_platform_page=False) 3. Platform marketing pages (is_platform_page=True) New Components: - PlatformContextMiddleware for detecting platform from domain/path - ContentPageService updated with full three-tier resolution - Platform folder structure (app/platforms/oms/, app/platforms/loyalty/) - Alembic migration with backfill for existing data Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
10
app/platforms/loyalty/__init__.py
Normal file
10
app/platforms/loyalty/__init__.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# app/platforms/loyalty/__init__.py
|
||||
"""
|
||||
Loyalty Platform
|
||||
|
||||
Platform for customer loyalty programs and rewards.
|
||||
"""
|
||||
|
||||
from .config import LoyaltyPlatformConfig
|
||||
|
||||
__all__ = ["LoyaltyPlatformConfig"]
|
||||
49
app/platforms/loyalty/config.py
Normal file
49
app/platforms/loyalty/config.py
Normal file
@@ -0,0 +1,49 @@
|
||||
# app/platforms/loyalty/config.py
|
||||
"""
|
||||
Loyalty Platform Configuration
|
||||
|
||||
Configuration for the Loyalty/Rewards platform.
|
||||
"""
|
||||
|
||||
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 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()
|
||||
2
app/platforms/loyalty/routes/__init__.py
Normal file
2
app/platforms/loyalty/routes/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# app/platforms/loyalty/routes/__init__.py
|
||||
"""Loyalty platform routes."""
|
||||
2
app/platforms/loyalty/templates/__init__.py
Normal file
2
app/platforms/loyalty/templates/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# app/platforms/loyalty/templates/__init__.py
|
||||
"""Loyalty platform templates."""
|
||||
Reference in New Issue
Block a user