docs: update documentation for platform-aware storefront routing

Update 8 documentation files to reflect new URL scheme:
- Dev: /platforms/{code}/storefront/{store_code}/
- Prod: subdomain.platform.lu/ (root path = storefront)
- Rename DEFAULT_PLATFORM_CODE to MAIN_PLATFORM_CODE
- Replace hardcoded platform_id=1 with dynamic values
- Update route examples, middleware descriptions, code samples

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-23 23:56:26 +01:00
parent 32acc76b49
commit 272b62fbd3
8 changed files with 126 additions and 118 deletions

View File

@@ -190,7 +190,7 @@ if settings.environment == "development":
Development (using /platforms/ prefix):
- [x] `localhost:9999/platforms/oms/` → OMS homepage
- [x] `localhost:9999/platforms/oms/pricing` → OMS pricing page
- [x] `localhost:9999/platforms/oms/stores/{code}/` → Store storefront
- [x] `localhost:9999/platforms/oms/storefront/{code}/` → Store storefront
- [x] `localhost:9999/platforms/loyalty/` → Loyalty homepage
---
@@ -246,7 +246,7 @@ Inserts Loyalty platform with:
| Task | File | Status |
|------|------|--------|
| Update middleware URL detection | `middleware/platform_context.py` | ✅ |
| Change DEFAULT_PLATFORM_CODE | `middleware/platform_context.py` | ✅ |
| Change MAIN_PLATFORM_CODE | `middleware/platform_context.py` | ✅ |
| Remove hardcoded /oms, /loyalty routes | `main.py` | ✅ |
| Update platform_pages.py homepage | `app/routes/platform_pages.py` | ✅ |
| Add 'main' platform migration | `alembic/versions/z6g7h8i9j0k1_...py` | ✅ |
@@ -324,19 +324,19 @@ Included in `docs/architecture/multi-platform-cms.md`:
### Three-Tier Content Resolution
```
Customer visits: omsflow.lu/stores/orion/about
Customer visits: orion.omsflow.lu/about
┌─────────────────────────────────────────────────────────────┐
│ Tier 1: Store Override │
│ WHERE platform_id=1 AND store_id=123 AND slug='about'
│ WHERE platform_id=:pid AND store_id=123 AND slug='about' │
│ Found? → Return store's custom page │
└─────────────────────────────────────────────────────────────┘
│ Not found
┌─────────────────────────────────────────────────────────────┐
│ Tier 2: Store Default │
│ WHERE platform_id=1 AND store_id IS NULL
│ WHERE platform_id=:pid AND store_id IS NULL │
│ AND is_platform_page=FALSE AND slug='about' │
│ Found? → Return platform default │
└─────────────────────────────────────────────────────────────┘
@@ -383,8 +383,8 @@ curl -s localhost:9999/platforms/loyalty/ | grep -o "<title>.*</title>"
# 5. Verify middleware detection
python -c "
from middleware.platform_context import PlatformContextMiddleware, DEFAULT_PLATFORM_CODE
print(f'DEFAULT_PLATFORM_CODE: {DEFAULT_PLATFORM_CODE}')
from middleware.platform_context import PlatformContextMiddleware, MAIN_PLATFORM_CODE
print(f'MAIN_PLATFORM_CODE: {MAIN_PLATFORM_CODE}')
# Expected: main
"
```