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>
29 lines
660 B
Python
29 lines
660 B
Python
# middleware/__init__.py
|
|
"""Middleware package for request processing."""
|
|
|
|
from .platform_context import (
|
|
PlatformContextManager,
|
|
PlatformContextMiddleware,
|
|
get_current_platform,
|
|
require_platform_context,
|
|
)
|
|
from .vendor_context import (
|
|
VendorContextManager,
|
|
VendorContextMiddleware,
|
|
get_current_vendor,
|
|
require_vendor_context,
|
|
)
|
|
|
|
__all__ = [
|
|
# Platform context
|
|
"PlatformContextManager",
|
|
"PlatformContextMiddleware",
|
|
"get_current_platform",
|
|
"require_platform_context",
|
|
# Vendor context
|
|
"VendorContextManager",
|
|
"VendorContextMiddleware",
|
|
"get_current_vendor",
|
|
"require_vendor_context",
|
|
]
|