docs: update multi-platform implementation plan with Phase 1 status

- Mark Phase 1 tasks as complete
- Add detailed Phase 2 (OMS Migration) checklist
- Add documentation requirements section
- Add next session checklist for easy continuation
- Include quick reference for three-tier resolution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-18 19:55:10 +01:00
parent 408019dbb3
commit 081f81af47

View File

@@ -1,406 +1,328 @@
Multi-Platform CMS Architecture Implementation Plan # Multi-Platform CMS Architecture - Implementation Plan
Summary > **Status:** Phase 1 Complete | Phases 2-6 Pending
> **Last Updated:** 2026-01-18
Transform the single-platform OMS into a multi-platform system supporting independent business offerings (OMS, Loyalty, Site Builder), each with its own CMS, > **Commit:** `408019d` (feat: add multi-platform CMS architecture Phase 1)
vendor defaults, and marketing pages.
---
---
URL/Access Pattern Matrix ## Executive Summary
Production Environment Transform the single-platform OMS into a multi-platform system supporting independent business offerings (OMS, Loyalty, Site Builder), each with its own CMS, vendor defaults, and marketing pages.
┌─────────────┬──────────┬───────────────────────────────────────────┬────────────────────────────────────────┐
│ Persona │ Platform │ URL │ Purpose │ ---
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤
│ Super Admin │ Global │ admin.wizamart.lu/ │ Global admin dashboard │ ## Phase 1: Database & Models ✅ COMPLETE
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤
│ │ │ admin.wizamart.lu/platforms │ Manage all platforms │ ### Completed Work
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤
│ │ │ admin.wizamart.lu/platforms/oms/pages │ OMS platform marketing pages │ | Task | File | Status |
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤ |------|------|--------|
│ │ │ admin.wizamart.lu/platforms/oms/defaults │ OMS vendor default pages │ | Platform model | `models/database/platform.py` | ✅ |
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤ | VendorPlatform junction table | `models/database/vendor_platform.py` | ✅ |
│ │ │ admin.wizamart.lu/platforms/loyalty/pages │ Loyalty platform pages │ | SubscriptionTier updates | `models/database/subscription.py` | ✅ |
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤ | ContentPage updates | `models/database/content_page.py` | ✅ |
│ Vendor │ OMS │ oms.lu/vendor/{code}/login │ Vendor login │ | CMS feature codes | `models/database/feature.py` | ✅ |
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤ | Model exports | `models/database/__init__.py` | ✅ |
│ │ │ oms.lu/vendor/{code}/dashboard │ Vendor dashboard │ | PlatformContextMiddleware | `middleware/platform_context.py` | ✅ |
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤ | Middleware exports | `middleware/__init__.py` | ✅ |
│ │ │ oms.lu/vendor/{code}/content-pages │ Manage CMS pages │ | ContentPageService updates | `app/services/content_page_service.py` | ✅ |
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤ | Alembic migration | `alembic/versions/z4e5f6a7b8c9_...py` | ✅ |
│ │ Loyalty │ loyalty.lu/vendor/{code}/login │ Loyalty vendor login │ | Platform folder structure | `app/platforms/` | ✅ |
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤
│ Customer │ OMS │ {vendor}.oms.lu/ │ Vendor storefront (subdomain) │ ---
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤
│ │ │ {vendor}.oms.lu/shop/ │ Shop pages │ ## Phase 2: OMS Migration & Integration 🔄 NEXT
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤
│ │ │ {vendor}.oms.lu/about │ Content page (3-tier fallback) │ ### 2.1 Run Database Migration
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤
│ │ │ {customdomain}.com/ │ Custom domain storefront │ ```bash
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤ # 1. Backup database first
│ Public │ OMS │ oms.lu/ │ Platform homepage │ pg_dump wizamart > wizamart_backup_$(date +%Y%m%d).sql
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤
│ │ │ oms.lu/pricing │ Platform pricing page │ # 2. Run migration
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤ alembic upgrade head
│ │ │ oms.lu/about │ Platform about (is_platform_page=True) │
├─────────────┼──────────┼───────────────────────────────────────────┼────────────────────────────────────────┤ # 3. Verify migration
│ │ Loyalty │ loyalty.lu/ │ Loyalty platform homepage │ psql -d wizamart -c "SELECT * FROM platforms;"
└─────────────┴──────────┴───────────────────────────────────────────┴────────────────────────────────────────┘ psql -d wizamart -c "SELECT COUNT(*) FROM vendor_platforms;"
Development Environment (localhost:9999) psql -d wizamart -c "SELECT platform_id, is_platform_page, COUNT(*) FROM content_pages GROUP BY 1, 2;"
┌─────────────┬──────────┬────────────────────────────────────────────┬───────────────────────────┐ ```
│ Persona │ Platform │ URL │ Purpose │
├─────────────┼──────────┼────────────────────────────────────────────┼───────────────────────────┤ ### 2.2 Register PlatformContextMiddleware in main.py
│ Super Admin │ Global │ localhost:9999/admin/ │ Global admin │
├─────────────┼──────────┼────────────────────────────────────────────┼───────────────────────────┤ ```python
│ │ │ localhost:9999/admin/platforms │ Platform management │ # In main.py, add BEFORE VendorContextMiddleware
├─────────────┼──────────┼────────────────────────────────────────────┼───────────────────────────┤ from middleware import PlatformContextMiddleware
│ │ │ localhost:9999/admin/platforms/oms/pages │ OMS platform pages │
├─────────────┼──────────┼────────────────────────────────────────────┼───────────────────────────┤ # Order matters: Platform detection must run first
│ Vendor │ OMS │ localhost:9999/oms/vendor/{code}/login │ OMS vendor login │ app.add_middleware(VendorContextMiddleware) # Runs second (existing)
├─────────────┼──────────┼────────────────────────────────────────────┼───────────────────────────┤ app.add_middleware(PlatformContextMiddleware) # Runs first (NEW)
│ │ │ localhost:9999/oms/vendor/{code}/dashboard │ OMS vendor dashboard │ ```
├─────────────┼──────────┼────────────────────────────────────────────┼───────────────────────────┤
│ │ Loyalty │ localhost:9999/loyalty/vendor/{code}/login │ Loyalty vendor login │ ### 2.3 Update VendorContextMiddleware
├─────────────┼──────────┼────────────────────────────────────────────┼───────────────────────────┤
│ Customer │ OMS │ localhost:9999/oms/vendors/{code}/ │ Vendor root │ File: `middleware/vendor_context.py`
├─────────────┼──────────┼────────────────────────────────────────────┼───────────────────────────┤
│ │ │ localhost:9999/oms/vendors/{code}/shop/ │ Vendor shop │ Changes needed:
├─────────────┼──────────┼────────────────────────────────────────────┼───────────────────────────┤ - [ ] Use `request.state.platform_clean_path` instead of `request.url.path` for path-based vendor detection
│ │ │ localhost:9999/oms/vendors/{code}/about │ Content page │ - [ ] Skip vendor detection if no platform found (platform marketing pages like /oms/pricing)
├─────────────┼──────────┼────────────────────────────────────────────┼───────────────────────────┤ - [ ] Pass platform context to vendor lookup for multi-platform vendor support
│ │ Loyalty │ localhost:9999/loyalty/vendors/{code}/ │ Loyalty vendor storefront │
├─────────────┼──────────┼────────────────────────────────────────────┼───────────────────────────┤ ### 2.4 Fix Platform Homepage Route
│ Public │ OMS │ localhost:9999/oms/ │ OMS platform homepage │
├─────────────┼──────────┼────────────────────────────────────────────┼───────────────────────────┤ File: `app/routes/platform/homepage.py`
│ │ │ localhost:9999/oms/pricing │ OMS pricing │
├─────────────┼──────────┼────────────────────────────────────────────┼───────────────────────────┤ Current state (BROKEN):
│ │ Loyalty │ localhost:9999/loyalty/ │ Loyalty platform homepage │ - Uses hardcoded `homepage-wizamart.html` template
└─────────────┴──────────┴────────────────────────────────────────────┴───────────────────────────┘ - Admin CMS changes are saved but ignored by route
---
Three-Tier Content Resolution Fix required:
```python
Customer visits: oms.lu/vendors/wizamart/about # Get platform from middleware
platform = request.state.platform
┌─────────────────────────────────────────────────────────────┐ # Query CMS for platform homepage
│ Tier 1: Vendor Override │ page = content_page_service.get_platform_page(
│ SELECT * FROM content_pages │ db,
│ WHERE platform_id = 1 AND vendor_id = 123 AND slug = 'about' │ platform_id=platform.id,
│ │ slug="home"
│ Found? → Return vendor's custom page │ )
└─────────────────────────────────────────────────────────────┘
│ Not found if page:
# Render with selected template
┌─────────────────────────────────────────────────────────────┐ return templates.TemplateResponse(
│ Tier 2: Platform Vendor Default │ f"platform/homepage-{page.template}.html",
│ SELECT * FROM content_pages │ {"request": request, "page": page}
│ WHERE platform_id = 1 AND vendor_id IS NULL │ )
│ AND is_platform_page = FALSE AND slug = 'about' │ else:
│ │ # Fallback to hardcoded (temporary)
│ Found? → Return platform default │ return templates.TemplateResponse("platform/homepage-wizamart.html", {...})
└─────────────────────────────────────────────────────────────┘ ```
│ Not found
### 2.5 Update Content Page Routes
Return 404
Files to update:
--- - [ ] `app/routes/platform/content_pages.py` - Add platform_id from request.state.platform
Data Models - [ ] `app/routes/vendor/content_pages.py` - Add platform_id to queries
- [ ] `app/routes/admin/content_pages.py` - Add platform filtering
New: Platform Model
---
File: models/database/platform.py
## Phase 3: Admin Interface
class Platform(Base):
id: Integer (PK) ### 3.1 Platform Management UI
code: String(50) unique # "oms", "loyalty", "sites"
name: String(100) # "Wizamart OMS" New routes needed:
domain: String(255) # "oms.lu" (production) - [ ] `GET /admin/platforms` - List all platforms
path_prefix: String(50) # "oms" (for localhost:9999/oms/*) - [ ] `GET /admin/platforms/{code}` - Platform details
logo: String(500) - [ ] `GET /admin/platforms/{code}/pages` - Platform marketing pages
theme_config: JSON - [ ] `GET /admin/platforms/{code}/defaults` - Vendor default pages
is_active: Boolean - [ ] `POST/PUT/DELETE` endpoints for CRUD operations
default_language: String(5)
supported_languages: JSON ### 3.2 Update Content Pages Admin
New: VendorPlatform Junction Table Changes to existing admin:
- [ ] Add platform dropdown filter
File: models/database/vendor_platform.py - [ ] Show page tier badge (Platform / Default / Override)
- [ ] Add `is_platform_page` toggle for platform-level pages
class VendorPlatform(Base): - [ ] Group pages by tier in list view
id: Integer (PK)
vendor_id: FK → vendors.id ---
platform_id: FK → platforms.id
tier_id: FK → platform_subscription_tiers.id ## Phase 4: Vendor Dashboard
is_active: Boolean
is_primary: Boolean # Vendor's primary platform ### 4.1 Content Pages List Updates
custom_subdomain: String(100)
settings: JSON - [ ] Show source indicator: "Default" / "Override" / "Custom"
joined_at: DateTime - [ ] Add "Override Default" button for vendor default pages
- [ ] Add "Revert to Default" button for vendor overrides
# Constraints - [ ] Show CMS usage: "3 of 10 pages used" with progress bar
UniqueConstraint(vendor_id, platform_id) - [ ] Upgrade prompt when approaching limit
Updated: SubscriptionTier Model (Extend Existing) ### 4.2 Page Editor Updates
File: models/database/subscription.py - [ ] Show banner: "This page overrides the platform default"
- [ ] "View Default" button to preview default content
Add fields to existing model: - [ ] "Revert" button inline in editor
platform_id: FK → platforms.id (nullable for global tiers, set for platform-specific)
cms_pages_limit: Integer (nullable) # NULL = unlimited ---
cms_custom_pages_limit: Integer (nullable)
## Phase 5: Routes & Templates
Update constraint:
UniqueConstraint(platform_id, code) # Allow same tier code per platform ### 5.1 Platform-Prefixed Routes (Development)
Updated: ContentPage Model Register in `main.py`:
```python
File: models/database/content_page.py # Development mode: path-based routing
if settings.environment == "development":
Add fields: app.mount("/oms", oms_router)
platform_id: FK → platforms.id (NOT NULL) app.mount("/loyalty", loyalty_router)
is_platform_page: Boolean (default=False) ```
# True = Platform marketing page (homepage, pricing)
# False = Vendor default OR vendor override/custom ### 5.2 Update Shop Routes
Update constraint: - [ ] Add platform context to shop routes
UniqueConstraint(platform_id, vendor_id, slug) - [ ] Use `request.state.platform` for template selection
- [ ] Pass platform to content page lookups
New CMS Feature Codes
### 5.3 Test All URL Patterns
File: models/database/feature.py
Development:
CMS_BASIC = "cms_basic" - [ ] `localhost:9999/oms/` → OMS homepage
CMS_CUSTOM_PAGES = "cms_custom_pages" - [ ] `localhost:9999/oms/pricing` → OMS pricing page
CMS_UNLIMITED_PAGES = "cms_unlimited_pages" - [ ] `localhost:9999/oms/vendors/{code}/` → Vendor storefront
CMS_TEMPLATES = "cms_templates" - [ ] `localhost:9999/loyalty/` → Loyalty homepage
CMS_SEO = "cms_seo"
---
---
New Middleware: PlatformContextMiddleware ## Phase 6: Loyalty Platform Setup
File: middleware/platform_context.py ### 6.1 Database Setup
Runs BEFORE VendorContextMiddleware. ```sql
-- Insert loyalty platform
Detection Priority: INSERT INTO platforms (code, name, description, domain, path_prefix, ...)
1. Path-based (dev): localhost:9999/oms/* → platform_code = "oms" VALUES ('loyalty', 'Loyalty+', 'Customer loyalty program', 'loyalty.lu', 'loyalty', ...);
2. Domain-based (prod): oms.lu → platform_code = "oms" ```
3. Default: localhost → platform_code = "oms" (backwards compatibility)
### 6.2 Create Platform Pages
Sets:
- request.state.platform → Platform object - [ ] Loyalty homepage
- request.state.platform_context → Detection metadata - [ ] Loyalty pricing
- request.state.platform_clean_path → Path without platform prefix - [ ] Loyalty features
- [ ] How it works
---
Folder Organization ### 6.3 Create Vendor Defaults
Platform-Specific Folders (NEW) - [ ] About (loyalty-specific)
- [ ] Rewards catalog
app/ - [ ] Terms of service
├── platforms/ # NEW - Platform-specific code - [ ] Privacy policy
│ ├── oms/ # OMS-specific
│ │ ├── routes/ # OMS-specific routes ---
│ │ ├── templates/ # OMS templates (homepage, etc.)
│ │ └── config.py # OMS configuration ## Documentation Requirements
│ ├── loyalty/ # Loyalty-specific
│ │ ├── routes/ ### Architecture Documentation
│ │ ├── templates/
│ │ └── config.py Create `docs/architecture/multi-platform-cms.md`:
│ └── shared/ # Shared across platforms - [ ] Three-tier content hierarchy explanation
│ └── base_platform.py - [ ] Platform vs Vendor Default vs Vendor Override
├── services/ # Shared services (extended) - [ ] Database schema diagrams
│ ├── content_page_service.py # Add platform_id support - [ ] Request flow diagrams
│ ├── feature_service.py # Extend with platform awareness
│ └── subscription_service.py # Extend with platform awareness ### API Documentation
├── templates/
│ └── platform/ # Keep existing, used by platform router Update OpenAPI specs:
└── middleware/ - [ ] Platform endpoints
└── platform_context.py # NEW - Platform detection - [ ] Content page endpoints with platform_id
- [ ] Vendor platform membership endpoints
Shared vs Platform-Specific
┌────────────────────┬─────────────────────────────────┬─────────────────────────────────────┐ ### Developer Guide
│ Type │ Location │ Example │
├────────────────────┼─────────────────────────────────┼─────────────────────────────────────┤ Create `docs/guides/adding-new-platform.md`:
│ Shared models │ models/database/ │ Platform, ContentPage, Vendor │ - [ ] Step-by-step platform creation
├────────────────────┼─────────────────────────────────┼─────────────────────────────────────┤ - [ ] Required database records
│ Shared services │ app/services/ │ FeatureService, SubscriptionService │ - [ ] Required config files
├────────────────────┼─────────────────────────────────┼─────────────────────────────────────┤ - [ ] Required routes and templates
│ Shared middleware │ middleware/ │ PlatformContextMiddleware │
├────────────────────┼─────────────────────────────────┼─────────────────────────────────────┤ ---
│ Platform routes │ app/platforms/{code}/routes/ │ OMS homepage, Loyalty dashboard │
├────────────────────┼─────────────────────────────────┼─────────────────────────────────────┤ ## Quick Reference
│ Platform templates │ app/platforms/{code}/templates/ │ OMS-specific homepage │
├────────────────────┼─────────────────────────────────┼─────────────────────────────────────┤ ### Three-Tier Content Resolution
│ Platform config │ app/platforms/{code}/config.py │ Domain, features, defaults │
└────────────────────┴─────────────────────────────────┴─────────────────────────────────────┘ ```
--- Customer visits: oms.lu/vendors/wizamart/about
Critical Files to Modify
┌──────────────────────────────────────┬───────────────────────────────────────────────────────────────┐
│ File │ Changes │ ┌─────────────────────────────────────────────────────────────┐
├──────────────────────────────────────┼───────────────────────────────────────────────────────────────┤ │ Tier 1: Vendor Override
models/database/platform.py │ NEW - Platform model │ WHERE platform_id=1 AND vendor_id=123 AND slug='about' │
├──────────────────────────────────────┼───────────────────────────────────────────────────────────────┤ │ Found? → Return vendor's custom page
│ models/database/vendor_platform.py │ NEW - Junction table │ └─────────────────────────────────────────────────────────────┘
├──────────────────────────────────────┼───────────────────────────────────────────────────────────────┤ │ Not found
│ models/database/subscription.py │ Add platform_id, cms_pages_limit to existing SubscriptionTier │
├──────────────────────────────────────┼─────────────────────────────────────────────────────────────── ─────────────────────────────────────────────────────────────
models/database/content_page.py │ Add platform_id, is_platform_page │ Tier 2: Vendor Default │
├──────────────────────────────────────┼───────────────────────────────────────────────────────────────┤ │ WHERE platform_id=1 AND vendor_id IS NULL
│ models/database/feature.py │ Add CMS feature codes │ │ AND is_platform_page=FALSE AND slug='about' │
├──────────────────────────────────────┼───────────────────────────────────────────────────────────────┤ │ Found? → Return platform default
│ middleware/platform_context.py │ NEW - Platform detection middleware │ └─────────────────────────────────────────────────────────────┘
├──────────────────────────────────────┼───────────────────────────────────────────────────────────────┤ │ Not found
│ middleware/vendor_context.py │ Update to use platform_clean_path │
├──────────────────────────────────────┼───────────────────────────────────────────────────────────────┤ Return 404
│ app/services/content_page_service.py │ Add platform_id to all methods │ ```
├──────────────────────────────────────┼───────────────────────────────────────────────────────────────┤
│ app/services/feature_service.py │ Extend has_feature() with platform context │ ### CMS Tier Limits
├──────────────────────────────────────┼───────────────────────────────────────────────────────────────┤
│ app/services/subscription_service.py │ Extend tier lookup with platform context │ | Tier | Total Pages | Custom Pages |
├──────────────────────────────────────┼───────────────────────────────────────────────────────────────┤ |------|-------------|--------------|
│ app/platforms/oms/ │ NEW - OMS-specific code │ | Essential | 3 | 0 |
├──────────────────────────────────────┼───────────────────────────────────────────────────────────────┤ | Professional | 10 | 5 |
│ app/platforms/loyalty/ │ NEW - Loyalty-specific code │ | Business | 30 | 20 |
├──────────────────────────────────────┼───────────────────────────────────────────────────────────────┤ | Enterprise | Unlimited | Unlimited |
│ main.py │ Register PlatformContextMiddleware, platform-prefixed routes │
└──────────────────────────────────────┴───────────────────────────────────────────────────────────────┘ ### Platform Marketing Page Slugs
---
Migration Strategy `home`, `platform_homepage`, `pricing`, `about`, `contact`, `faq`, `terms`, `privacy`, `features`, `integrations`
Pre-Migration ---
# 1. Create git tag ## Next Session Checklist
git add -A && git commit -m "chore: prepare for multi-platform migration"
git tag -a v1.0.0-pre-multiplatform -m "Before multi-platform CMS migration" Start here when resuming work:
git push origin v1.0.0-pre-multiplatform
1. [ ] Run `alembic upgrade head` (backup DB first!)
# 2. Backup database 2. [ ] Verify migration: `SELECT * FROM platforms;`
pg_dump wizamart > wizamart_backup_$(date +%Y%m%d).sql 3. [ ] Register PlatformContextMiddleware in `main.py`
4. [ ] Update VendorContextMiddleware to use `platform_clean_path`
Migration Steps 5. [ ] Fix platform homepage to use CMS
6. [ ] Test: `localhost:9999/oms/` shows CMS homepage
1. Create platforms table with default "oms" platform 7. [ ] Test: Three-tier resolution works
2. Create vendor_platforms junction table
3. Add platform_id, cms_pages_limit, cms_custom_pages_limit to existing subscription_tiers ---
4. Add platform_id and is_platform_page to content_pages
5. Backfill: Set all subscription_tiers.platform_id = OMS platform ID ## Files Created/Modified in Phase 1
6. Backfill: Set all content_pages.platform_id = OMS platform ID
7. Backfill: Set is_platform_page=True for extended slugs (homepage, pricing, about, contact, faq, terms, privacy, features, integrations) ### New Files (17)
8. Create vendor_platforms entries for all existing vendors → OMS ```
9. Update unique constraint on content_pages and subscription_tiers models/database/platform.py
models/database/vendor_platform.py
--- middleware/platform_context.py
Implementation Phases alembic/versions/z4e5f6a7b8c9_add_multi_platform_support.py
app/platforms/__init__.py
Phase 1: Database & Models app/platforms/oms/__init__.py
app/platforms/oms/config.py
- Create Platform model app/platforms/oms/routes/__init__.py
- Create VendorPlatform junction table app/platforms/oms/templates/__init__.py
- Create PlatformSubscriptionTier model app/platforms/loyalty/__init__.py
- Update ContentPage with platform_id, is_platform_page app/platforms/loyalty/config.py
- Add CMS feature codes app/platforms/loyalty/routes/__init__.py
- Write Alembic migration app/platforms/loyalty/templates/__init__.py
- Test migration on dev database app/platforms/shared/__init__.py
app/platforms/shared/base_platform.py
Phase 2: Middleware & Services app/platforms/shared/routes/__init__.py
app/platforms/shared/templates/__init__.py
- Create PlatformContextMiddleware ```
- Update VendorContextMiddleware
- Update ContentPageService with three-tier resolution ### Modified Files (7)
- Create CMSLimitService ```
- Update middleware registration order in main.py models/database/__init__.py
models/database/content_page.py
Phase 3: Admin Interface models/database/subscription.py
models/database/feature.py
- Platform management UI (/admin/platforms) models/database/vendor.py
- Platform pages editor middleware/__init__.py
- Vendor defaults editor app/services/content_page_service.py
- Update content-pages list ```
Phase 4: Vendor Dashboard ---
- Show page source (Default/Override/Custom) ## Notes
- "Override" action for defaults
- "Revert to Default" action - Git tag `v1.0.0-pre-multiplatform` was created before starting
- Page limit indicators - All existing `content_pages` will be backfilled to OMS platform
- All existing vendors will be linked to OMS via `vendor_platforms`
Phase 5: Routes & Templates - Migration is reversible (see downgrade function in migration file)
- Register platform-prefixed routes (dev mode)
- Fix platform homepage to use CMS
- Update shop routes with platform context
- Test all URL patterns
Phase 6: Loyalty Platform Setup
- Create "loyalty" platform record
- Create loyalty platform pages
- Create loyalty vendor defaults
- Test full flow
---
Verification Steps
1. Git tag created: git tag -l | grep pre-multiplatform
2. Migration successful:
SELECT * FROM platforms;
SELECT COUNT(*) FROM vendor_platforms;
SELECT platform_id, is_platform_page, COUNT(*) FROM content_pages GROUP BY 1, 2;
3. Dev URLs work:
- localhost:9999/oms/ → OMS homepage
- localhost:9999/loyalty/ → Loyalty homepage
- localhost:9999/oms/vendor/wizamart/dashboard → Vendor dashboard
4. Three-tier resolution:
- Create vendor override → shows override
- Delete override → shows platform default
- Delete default → shows 404
5. Page limits: Create pages until limit → shows upgrade prompt
---
Open Questions Resolved
┌───────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────┐
│ Question │ Answer │
├───────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────┤
│ Domain routing │ Prod: separate domains / Dev: path-based │
├───────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────┤
│ Vendor multi-platform │ Yes, junction table │
├───────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────┤
│ Tier CMS restrictions │ Yes, integrate with existing feature system │
├───────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────┤
│ MVP scope │ OMS + Loyalty, git tag first │
├───────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────┤
│ Admin structure │ Global super admin only (/admin/*) │
├───────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────┤
│ CMS page limits │ Essential: 3, Pro: 10, Business: 30, Enterprise: unlimited │
├───────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────┤
│ Platform page slugs │ platform_homepage, pricing, about, contact, faq, terms, privacy, features, integrations │
└───────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────┘
---
CMS Tier Limits (Final)
┌──────────────┬─────────────┬──────────────┬─────────────────────────────────────────────────────┐
│ Tier │ Total Pages │ Custom Pages │ Features │
├──────────────┼─────────────┼──────────────┼─────────────────────────────────────────────────────┤
│ Essential │ 3 │ 0 │ cms_basic │
├──────────────┼─────────────┼──────────────┼─────────────────────────────────────────────────────┤
│ Professional │ 10 │ 5 │ cms_basic, cms_custom_pages, cms_seo │
├──────────────┼─────────────┼──────────────┼─────────────────────────────────────────────────────┤
│ Business │ 30 │ 20 │ cms_basic, cms_custom_pages, cms_seo, cms_templates │
├──────────────┼─────────────┼──────────────┼─────────────────────────────────────────────────────┤
│ Enterprise │ Unlimited │ Unlimited │ cms_unlimited_pages, cms_scheduling │
└──────────────┴─────────────┴──────────────┴─────────────────────────────────────────────────────┘
---
Platform Marketing Page Slugs (is_platform_page=True)
These slugs will be marked as platform marketing pages during migration:
- platform_homepage (or home)
- pricing
- about
- contact
- faq
- terms
- privacy
- features
- integrations
All other vendor_id=NULL pages become vendor defaults (is_platform_page=False).