feat: complete multi-platform CMS phases 2-5

Phase 2 - OMS Migration & Integration:
- Fix platform_pages.py to use get_platform_page for marketing pages
- Fix shop_pages.py to pass platform_id to content page service calls

Phase 3 - Admin Interface:
- Add platform management API (app/api/v1/admin/platforms.py)
- Add platforms admin page with stats cards
- Add Platforms menu item to admin sidebar
- Update content pages admin with platform filter and four-tab tier system

Phase 4 - Documentation:
- Add comprehensive architecture docs (docs/architecture/multi-platform-cms.md)
- Update implementation plan with completion status

Phase 5 - Vendor Dashboard:
- Add CMS usage API endpoint with tier limits
- Add usage progress bar to vendor content pages
- Add platform-default/{slug} API for preview
- Add View Default button and modal in page editor

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-19 16:30:31 +01:00
parent fe49008fef
commit 968002630e
19 changed files with 1424 additions and 99 deletions

View File

@@ -1039,6 +1039,78 @@ async def admin_logs_page(
)
# ============================================================================
# PLATFORM MANAGEMENT ROUTES (Multi-Platform Support)
# ============================================================================
@router.get("/platforms", response_class=HTMLResponse, include_in_schema=False)
async def admin_platforms_list(
request: Request,
current_user: User = Depends(get_current_admin_from_cookie_or_header),
db: Session = Depends(get_db),
):
"""
Render platforms management page.
Shows all platforms (OMS, Loyalty, etc.) with their configuration.
"""
return templates.TemplateResponse(
"admin/platforms.html",
{
"request": request,
"user": current_user,
},
)
@router.get(
"/platforms/{platform_code}", response_class=HTMLResponse, include_in_schema=False
)
async def admin_platform_detail(
request: Request,
platform_code: str = Path(..., description="Platform code (oms, loyalty, etc.)"),
current_user: User = Depends(get_current_admin_from_cookie_or_header),
db: Session = Depends(get_db),
):
"""
Render platform detail page.
Shows platform configuration, marketing pages, and vendor defaults.
"""
return templates.TemplateResponse(
"admin/platform-detail.html",
{
"request": request,
"user": current_user,
"platform_code": platform_code,
},
)
@router.get(
"/platforms/{platform_code}/edit",
response_class=HTMLResponse,
include_in_schema=False,
)
async def admin_platform_edit(
request: Request,
platform_code: str = Path(..., description="Platform code"),
current_user: User = Depends(get_current_admin_from_cookie_or_header),
db: Session = Depends(get_db),
):
"""
Render platform edit form.
Allows editing platform settings, branding, and configuration.
"""
return templates.TemplateResponse(
"admin/platform-edit.html",
{
"request": request,
"user": current_user,
"platform_code": platform_code,
},
)
# ============================================================================
# CONTENT MANAGEMENT SYSTEM (CMS) ROUTES
# ============================================================================