refactor: migrate templates and static files to self-contained modules

Templates Migration:
- Migrate admin templates to modules (tenancy, billing, monitoring, marketplace, etc.)
- Migrate vendor templates to modules (tenancy, billing, orders, messaging, etc.)
- Migrate storefront templates to modules (catalog, customers, orders, cart, checkout, cms)
- Migrate public templates to modules (billing, marketplace, cms)
- Keep shared templates in app/templates/ (base.html, errors/, partials/, macros/)
- Migrate letzshop partials to marketplace module

Static Files Migration:
- Migrate admin JS to modules: tenancy (23 files), core (5 files), monitoring (1 file)
- Migrate vendor JS to modules: tenancy (4 files), core (2 files)
- Migrate shared JS: vendor-selector.js to core, media-picker.js to cms
- Migrate storefront JS: storefront-layout.js to core
- Keep framework JS in static/ (api-client, utils, money, icons, log-config, lib/)
- Update all template references to use module_static paths

Naming Consistency:
- Rename static/platform/ to static/public/
- Rename app/templates/platform/ to app/templates/public/
- Update all extends and static references

Documentation:
- Update module-system.md with shared templates documentation
- Update frontend-structure.md with new module JS organization

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-01 14:34:16 +01:00
parent 843703258f
commit 4e28d91a78
542 changed files with 11603 additions and 9037 deletions

View File

@@ -53,7 +53,7 @@ Based on `docs/marketing/pricing.md`:
### 1. Marketing Homepage (`/`)
**Template:** `app/templates/platform/homepage-wizamart.html`
**Template:** `app/templates/public/homepage-wizamart.html`
**Sections:**
@@ -84,7 +84,7 @@ Based on `docs/marketing/pricing.md`:
### 2. Pricing Page (`/pricing`)
**Template:** `app/templates/platform/pricing.html`
**Template:** `app/templates/public/pricing.html`
Standalone page with:
- Large tier cards
@@ -94,7 +94,7 @@ Standalone page with:
### 3. Find Your Shop (`/find-shop`)
**Template:** `app/templates/platform/find-shop.html`
**Template:** `app/templates/public/find-shop.html`
- URL input with examples
- Real-time Letzshop vendor lookup
@@ -103,7 +103,7 @@ Standalone page with:
### 4. Signup Wizard (`/signup`)
**Template:** `app/templates/platform/signup.html`
**Template:** `app/templates/public/signup.html`
**4-Step Flow:**
@@ -121,7 +121,7 @@ Standalone page with:
### 5. Signup Success (`/signup/success`)
**Template:** `app/templates/platform/signup-success.html`
**Template:** `app/templates/public/signup-success.html`
- Success confirmation
- Next steps checklist
@@ -132,24 +132,24 @@ Standalone page with:
## API Endpoints
All endpoints under `/api/v1/platform/`:
All endpoints under `/api/v1/public/`:
### Pricing Endpoints
```
GET /api/v1/platform/tiers
GET /api/v1/public/tiers
Returns all public subscription tiers
Response: TierResponse[]
GET /api/v1/platform/tiers/{tier_code}
GET /api/v1/public/tiers/{tier_code}
Returns specific tier by code
Response: TierResponse
GET /api/v1/platform/addons
GET /api/v1/public/addons
Returns all active add-on products
Response: AddOnResponse[]
GET /api/v1/platform/pricing
GET /api/v1/public/pricing
Returns complete pricing info (tiers + addons + trial_days)
Response: PricingResponse
```
@@ -157,17 +157,17 @@ GET /api/v1/platform/pricing
### Letzshop Vendor Endpoints
```
GET /api/v1/platform/letzshop-vendors
GET /api/v1/public/letzshop-vendors
Query params: ?search=&category=&city=&page=1&limit=20
Returns paginated vendor list (placeholder for future)
Response: LetzshopVendorListResponse
POST /api/v1/platform/letzshop-vendors/lookup
POST /api/v1/public/letzshop-vendors/lookup
Body: { "url": "letzshop.lu/vendors/my-shop" }
Returns vendor info from URL lookup
Response: LetzshopLookupResponse
GET /api/v1/platform/letzshop-vendors/{slug}
GET /api/v1/public/letzshop-vendors/{slug}
Returns vendor info by slug
Response: LetzshopVendorInfo
```
@@ -175,17 +175,17 @@ GET /api/v1/platform/letzshop-vendors/{slug}
### Signup Endpoints
```
POST /api/v1/platform/signup/start
POST /api/v1/public/signup/start
Body: { "tier_code": "professional", "is_annual": false }
Creates signup session
Response: { "session_id": "...", "tier_code": "...", "is_annual": false }
POST /api/v1/platform/signup/claim-vendor
POST /api/v1/public/signup/claim-vendor
Body: { "session_id": "...", "letzshop_slug": "my-shop" }
Claims Letzshop vendor for session
Response: { "session_id": "...", "letzshop_slug": "...", "vendor_name": "..." }
POST /api/v1/platform/signup/create-account
POST /api/v1/public/signup/create-account
Body: {
"session_id": "...",
"email": "user@example.com",
@@ -197,17 +197,17 @@ POST /api/v1/platform/signup/create-account
Creates User, Company, Vendor, Stripe Customer
Response: { "session_id": "...", "user_id": 1, "vendor_id": 1, "stripe_customer_id": "cus_..." }
POST /api/v1/platform/signup/setup-payment
POST /api/v1/public/signup/setup-payment
Body: { "session_id": "..." }
Creates Stripe SetupIntent
Response: { "session_id": "...", "client_secret": "seti_...", "stripe_customer_id": "cus_..." }
POST /api/v1/platform/signup/complete
POST /api/v1/public/signup/complete
Body: { "session_id": "...", "setup_intent_id": "seti_..." }
Completes signup, attaches payment method
Response: { "success": true, "vendor_code": "...", "vendor_id": 1, "redirect_url": "...", "trial_ends_at": "..." }
GET /api/v1/platform/signup/session/{session_id}
GET /api/v1/public/signup/session/{session_id}
Returns session status for resuming signup
Response: { "session_id": "...", "step": "...", ... }
```
@@ -430,7 +430,7 @@ STRIPE_TRIAL_DAYS=30
### Automated Tests
Test files located in `tests/integration/api/v1/platform/`:
Test files located in `tests/integration/api/v1/public/`:
| File | Tests | Description |
|------|-------|-------------|
@@ -440,7 +440,7 @@ Test files located in `tests/integration/api/v1/platform/`:
**Run tests:**
```bash
pytest tests/integration/api/v1/platform/ -v
pytest tests/integration/api/v1/public/ -v
```
**Test categories:**
@@ -479,15 +479,15 @@ pytest tests/integration/api/v1/platform/ -v
```bash
# Get pricing
curl http://localhost:8000/api/v1/platform/pricing
curl http://localhost:8000/api/v1/public/pricing
# Lookup vendor
curl -X POST http://localhost:8000/api/v1/platform/letzshop-vendors/lookup \
curl -X POST http://localhost:8000/api/v1/public/letzshop-vendors/lookup \
-H "Content-Type: application/json" \
-d '{"url": "letzshop.lu/vendors/test-shop"}'
# Start signup
curl -X POST http://localhost:8000/api/v1/platform/signup/start \
curl -X POST http://localhost:8000/api/v1/public/signup/start \
-H "Content-Type: application/json" \
-d '{"tier_code": "professional", "is_annual": false}'
```