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

@@ -38,13 +38,13 @@ Content pages follow a three-tier inheritance model:
When a customer visits a store page (e.g., `/stores/shopname/about`):
```
Customer visits: /stores/shopname/about
Customer visits: /platforms/oms/storefront/shopname/about
┌─────────────────────────────────────────────────────────────────────┐
│ Step 1: Check Store Override │
│ SELECT * FROM content_pages │
│ WHERE platform_id=1 AND store_id=123 AND slug='about'
│ WHERE platform_id=:platform_id AND store_id=123 AND slug='about' │
│ Found? → Return store's custom "About" page │
└─────────────────────────────────────────────────────────────────────┘
│ Not found
@@ -52,7 +52,7 @@ Customer visits: /stores/shopname/about
┌─────────────────────────────────────────────────────────────────────┐
│ Step 2: Check Store Default │
│ SELECT * FROM content_pages │
│ WHERE platform_id=1 AND store_id IS NULL
│ WHERE platform_id=:platform_id AND store_id IS NULL │
│ AND is_platform_page=FALSE AND slug='about' │
│ Found? → Return platform's default "About" template │
└─────────────────────────────────────────────────────────────────────┘
@@ -152,7 +152,7 @@ Request: GET /platforms/oms/stores/shopname/about
│ Route Handler (shop_pages.py) │
│ - Gets platform_id from request.state.platform │
│ - Calls content_page_service.get_page_for_store( │
│ platform_id=1, store_id=123, slug='about'
│ platform_id=platform.id, store_id=123, slug='about' │
│ ) │
│ - Service handles three-tier resolution │
└─────────────────────────────────────────────────────────────────────┘
@@ -169,7 +169,7 @@ Request: GET /about
┌─────────────────────────────────────────────────────────────────────┐
│ PlatformContextMiddleware │
│ - No /platforms/ prefix detected │
│ - Uses DEFAULT_PLATFORM_CODE = 'main' │
│ - Uses MAIN_PLATFORM_CODE = 'main'
│ - Sets request.state.platform = Platform(code='main') │
│ - Path unchanged: /about │
└─────────────────────────────────────────────────────────────────────┘