1156 Commits

Author SHA1 Message Date
6c78827c7f feat: add language switching to admin and merchant frontends
Some checks failed
CI / ruff (push) Successful in 10s
CI / pytest (push) Failing after 46m27s
CI / validate (push) Successful in 23s
CI / dependency-scanning (push) Successful in 29s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped
- Add cookie to ADMIN resolution chain (cookie → user_pref → "en")
- Add explicit MERCHANT resolution (cookie → user_pref → "fr")
- Add language selector dropdown to admin and merchant headers
- Add languageSelector() function to merchant init-alpine.js
- Add flag-icons CSS and i18n.js setup to merchant base template
- Add compact flag-based language selector to both login pages
- Make lang attribute dynamic on all base and login templates
- Pass current_language to login route template context
- Update architecture doc with ADMIN/MERCHANT resolution priorities

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 10:26:57 +01:00
0389294b1a fix: language switcher stuck in French on store dashboard
Some checks failed
CI / ruff (push) Successful in 11s
CI / pytest (push) Failing after 44m35s
CI / validate (push) Successful in 23s
CI / dependency-scanning (push) Successful in 28s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped
Three compounding bugs prevented language switching on the store dashboard:
- Cookie missing path="/", scoping it to the API endpoint path only
- STORE frontend resolution chain ignored the cookie entirely
- Store header used inline x-data with wrong language names instead of shared languageSelector()

Also updates architecture doc with correct per-frontend resolution priorities,
cookie name, API endpoint path, and file references.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 05:30:25 +01:00
cd935988c4 fix: store login crash and dashboard misrouted as storefront
Some checks failed
CI / ruff (push) Successful in 10s
CI / pytest (push) Failing after 44m20s
CI / validate (push) Successful in 22s
CI / dependency-scanning (push) Successful in 27s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped
- Seed default RBAC roles per store and assign role_id to StoreUser
  records (was never implemented after RBAC Phase 1 cleanup)
- Handle nullable role in auth_service find_user_store and
  get_user_store_role to prevent NoneType crash on login
- Use platform_clean_path instead of clean_path in FrontendTypeMiddleware
  so /store/X/dashboard is detected as STORE, not STOREFRONT

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 01:19:22 +01:00
05d31a7fc5 docs: add Google Wallet setup guide and loyalty env vars
Some checks failed
CI / ruff (push) Successful in 11s
CI / pytest (push) Failing after 45m26s
CI / validate (push) Successful in 22s
CI / dependency-scanning (push) Successful in 29s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped
Step 25 in Hetzner docs with full Google Cloud/Wallet Console setup,
service account configuration, local testing, and architecture diagrams.
Loyalty module env vars added to environment.md and .env.example.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 00:31:43 +01:00
272b62fbd3 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>
2026-02-23 23:56:26 +01:00
32acc76b49 feat: platform-aware storefront routing and billing improvements
Overhaul storefront URL routing to be platform-aware:
- Dev: /platforms/{code}/storefront/{store_code}/
- Prod: subdomain.platform.lu/ (internally rewritten to /storefront/)
- Add subdomain detection in PlatformContextMiddleware
- Add /storefront/ path rewrite for prod mode (subdomain/custom domain)
- Remove all silent platform fallbacks (platform_id=1)
- Add require_platform dependency for clean endpoint validation
- Update route registration, templates, module definitions, base_url calc
- Update StoreContextMiddleware for /storefront/ path detection
- Remove /stores/ from FrontendDetector STOREFRONT_PATH_PREFIXES

Billing service improvements:
- Add store_platform_sync_service to keep store_platforms in sync
- Make tier lookups platform-aware across billing services
- Add tiers for all platforms in seed data
- Add demo subscriptions to seed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 23:42:41 +01:00
d36783a7f1 feat: add google-auth and PyJWT for Google Wallet loyalty passes
All checks were successful
CI / ruff (push) Successful in 11s
CI / pytest (push) Successful in 45m7s
CI / validate (push) Successful in 23s
CI / dependency-scanning (push) Successful in 29s
CI / docs (push) Successful in 37s
CI / deploy (push) Successful in 2m14s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 22:50:50 +01:00
2fc157d7b2 fix: store menu 404, logger crash, platform detection, and sidebar UX
All checks were successful
CI / ruff (push) Successful in 12s
CI / pytest (push) Successful in 46m12s
CI / validate (push) Successful in 24s
CI / dependency-scanning (push) Successful in 29s
CI / docs (push) Successful in 38s
CI / deploy (push) Successful in 50s
- Fix store menu API URL (/store/menu/render/store, not /store/core/...)
- Fix storeLog/merchantLog fallback to console object instead of console.log
- Embed platform_id/platform_code in store JWT from URL context at login
- Use token_platform_id in store menu endpoint with DB fallback for old tokens
- Add "Menu unavailable" warning in sidebar fallback for all three frontends
- Standardize admin section default to all-open (consistent with store/merchant)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 13:53:31 +01:00
506171503d feat: complete dynamic menu system across all frontends
All checks were successful
CI / ruff (push) Successful in 11s
CI / pytest (push) Successful in 44m40s
CI / validate (push) Successful in 22s
CI / dependency-scanning (push) Successful in 28s
CI / docs (push) Successful in 39s
CI / deploy (push) Successful in 49s
- Add "Merchant Frontend" tab to admin menu-config page
- Merchant render endpoint now respects AdminMenuConfig visibility
  via get_merchant_primary_platform_id() platform resolution
- New store menu render endpoint (GET /store/core/menu/render/store)
  with platform-scoped visibility and store_code interpolation
- Store sidebar migrated from hardcoded Jinja2 macros to dynamic
  Alpine.js x-for rendering with loading skeleton and fallback
- Store init-alpine.js: add loadMenuConfig(), expandSectionForCurrentPage()
- Include store page route fixes, login template updates, and tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 02:14:42 +01:00
be248222bc feat: dynamic merchant sidebar with module-driven menus
Replace the hardcoded merchant sidebar with a dynamic menu system driven
by module definitions, matching the existing admin frontend pattern.
Modules declare FrontendType.MERCHANT menus in their definition.py, and
a new API endpoint unions enabled modules across all platforms the
merchant is subscribed to — so loyalty only appears when enabled.

- Add MERCHANT menu definitions to core, billing, tenancy, loyalty modules
- Extend MenuDiscoveryService with enabled_module_codes parameter
- Create GET /merchants/core/menu/render/merchant endpoint
- Update merchant Alpine.js with loadMenuConfig() and dynamic section state
- Replace hardcoded sidebar.html with x-for rendering + loading skeleton + fallback
- Add 36 unit and integration tests for menu discovery, service, and endpoint

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 00:24:11 +01:00
716a4e3d15 fix: sidebar highlight on detail pages with numeric IDs
When visiting /merchants/billing/subscriptions/3, currentPage was set
to '3' instead of 'subscriptions'. Now skips numeric trailing segments
so the parent page stays highlighted. Applied to both merchant and
store init-alpine.js.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 23:08:17 +01:00
467b1510f4 fix: use apiClient instead of httponly cookie in merchant stores/profile pages
The merchant_token cookie is httponly, so JS cannot read it via
document.cookie. This caused getToken() to return null, redirecting
users to login, which then bounced back to dashboard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 22:53:05 +01:00
5c8fbd21c7 fix: guard LogConfig access in merchant and store init-alpine.js
log-config.js loads with defer but init-alpine.js runs synchronously,
so window.LogConfig is undefined when init-alpine.js executes. The
crash prevented the Alpine data() function from registering, which
broke auth and caused all merchant pages to 302-redirect to login.

Fall back to console.log when LogConfig is not yet available.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 22:13:30 +01:00
1f3042547b fix: correct billing history sidebar page_id for menu highlight
The page_id was 'billing' but the URL /merchants/billing/invoices
yields currentPage='invoices' from the last URL segment. Change
page_id to 'invoices' so the highlight matches.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 21:48:26 +01:00
d7a383f3d7 test: add tests for merchant dashboard metrics and fix invoice template location
Move invoice PDF template from app/templates/invoices/ to
app/modules/orders/templates/invoices/ where InvoicePDFService expects it.
Expand invoice PDF tests to validate template path and existence.

Add unit tests for get_merchant_metrics() in tenancy, billing, and
customer metrics providers. Add unit tests for StatsAggregatorService
merchant methods. Add integration tests for the merchant dashboard
stats endpoint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 21:46:34 +01:00
b77952bf89 fix: correct billing history menu link in merchant sidebar
The sidebar pointed to /merchants/billing/billing (404) instead of
/merchants/billing/invoices which is the actual page route.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 21:33:05 +01:00
ff852f1ab3 fix: use metrics provider pattern for merchant dashboard stats
The merchant dashboard was showing subscription count as "Total Stores".
Add get_merchant_metrics() to MetricsProviderProtocol and implement it
in tenancy, billing, and customer providers. Dashboard now fetches real
stats from a new /merchants/core/dashboard/stats endpoint and displays
4 cards: active subscriptions, total stores, customers, team members.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 21:28:59 +01:00
42b894094a feat: add single endpoint for merchant subscriptions with usage data
Replace N+1 per-platform API calls on merchant detail page with a single
GET /admin/subscriptions/merchants/{id} endpoint. Extract shared
subscription+usage aggregation logic into a reusable service method and
refactor the store endpoint to use it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 20:58:02 +01:00
b9ac252a9f feat: add merchant user edit page with editable profile fields
All checks were successful
CI / ruff (push) Successful in 11s
CI / pytest (push) Successful in 47m48s
CI / validate (push) Successful in 24s
CI / dependency-scanning (push) Successful in 30s
CI / docs (push) Successful in 40s
CI / deploy (push) Successful in 1m18s
- Add /admin/merchant-users/{id}/edit page route and template
- Replace toggle-status button with edit button on merchant-users list
- Editable fields: username, email, first name, last name
- Quick actions: toggle status, delete (with double confirm)
- Move RBAC two-phase plan to docs/proposals/

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 23:30:50 +01:00
51e512ec08 feat: make admin user edit page fields editable (username, email, name)
Some checks failed
CI / ruff (push) Successful in 11s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled
The admin-user-edit page had display-only fields for username, email,
first name, and last name. Convert to editable form inputs with:
- Dirty detection (unsaved changes indicator)
- Only sends changed fields in PUT payload
- Validation error display per field
- Save button disabled when no changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 23:06:18 +01:00
f517a7ccd7 fix: merchant-user-detail page derives role from user.role instead of owned_merchants_count
Some checks failed
CI / ruff (push) Successful in 10s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled
The User Type status card used owned_merchants_count to determine
Owner vs Team Member. Now uses user.role directly. Label changed
from "User Type" to "Role".

The other owned_merchants_count references (delete guards in
user-edit.js and user-detail.js, count display card, debug log)
are correct — they use the actual count for business logic, not
role derivation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 22:56:54 +01:00
c47a394a7b fix: merchant-users page shows role from user.role instead of owned_merchants_count
Some checks failed
CI / ruff (push) Successful in 10s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled
The Role column was deriving Owner/Team Member from owned_merchants_count
which was unreliable. Now uses user.role directly (merchant_owner vs
store_member) which is the source of truth after RBAC Phase 1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 22:54:42 +01:00
1eef69f300 ci: add security/performance/audit validators to pre-commit and CI
Some checks failed
CI / ruff (push) Successful in 10s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has started running
- Add validate-security, validate-performance, validate-audit hooks
  to .pre-commit-config.yaml (previously only architecture was checked)
- Break single "Run all validators" CI step into 4 explicit steps
  (architecture, security, performance, audit) for clearer pipeline output
- Add noqa: SEC001 suppressions for test fixture hashed_password values

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 22:49:04 +01:00
1dcb0e6c33 feat: RBAC Phase 1 — consolidate user roles into 4-value enum
Some checks failed
CI / ruff (push) Successful in 11s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled
Consolidate User.role (2-value: admin/store) + User.is_super_admin (boolean)
into a single 4-value UserRole enum: super_admin, platform_admin,
merchant_owner, store_member. Drop stale StoreUser.user_type column.
Fix role="user" bug in merchant creation.

Key changes:
- Expand UserRole enum from 2 to 4 values with computed properties
  (is_admin, is_super_admin, is_platform_admin, is_merchant_owner, is_store_user)
- Add Alembic migration (tenancy_003) for data migration + column drops
- Remove is_super_admin from JWT token payload
- Update all auth dependencies, services, routes, templates, JS, and tests
- Update all RBAC documentation

66 files changed, 1219 unit tests passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 22:44:29 +01:00
ef21d47533 fix: add missing noqa suppressions for security linter in init_production.py
Some checks failed
CI / ruff (push) Successful in 9s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has started running
Adds SEC001 (hardcoded password) and SEC021 (password in print output)
suppressions for the loyalty admin seed data, consistent with existing
patterns in seed_demo.py.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 22:06:19 +01:00
6c5969e4e1 test: add 42 unit tests for middleware/cloudflare.py and middleware/language.py
Completes middleware test coverage (11/11 files) with 19 cloudflare tests
(dispatch, get_real_client_ip, get_client_country) and 23 language tests
(admin/store/storefront/platform dispatch, helpers, private methods).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 21:55:47 +01:00
6a739bf670 test: add 58 unit tests for middleware/auth.py AuthManager
Cover all 12 methods: constructor, password hashing, authenticate_user,
create_access_token, verify_token, get_current_user, RBAC decorators,
and create_default_admin_user. Achieves 96.45% coverage on auth.py.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 19:11:57 +01:00
ffa12f0255 test: complete remaining deps.py phases — platform, module, merchant, customer, permissions
Add 16 tests covering: require_platform_access (super admin bypass,
platform admin with/without access), get_admin_with_platform_context,
require_module_access (super admin bypass, enabled/disabled module),
and get_user_permissions (owner gets all, member gets specific, empty).

Total: 89 tests for app/api/deps.py (all 31 functions covered).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:49:42 +01:00
93731b7173 test: add 73 unit tests for app/api/deps.py auth dependencies
Cover all core authentication paths: helpers (_get_token_from_request,
_validate_user_token, _get_user_model, _validate_customer_token),
admin/store/merchant/customer auth (cookie + header + API variants),
optional auth, store permission factories, and store ownership checks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:38:31 +01:00
e5dbd7ef1a feat: add JS-015 architecture rule to enforce confirm_modal over native confirm()
Some checks failed
CI / ruff (push) Successful in 13s
CI / pytest (push) Successful in 36m14s
CI / validate (push) Failing after 21s
CI / dependency-scanning (push) Successful in 31s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped
Prevents reintroduction of native browser confirm() dialogs by flagging
them as architecture errors during pre-commit validation. Points
developers to use confirm_modal/confirm_modal_dynamic Jinja2 macros.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:59:19 +01:00
167bb50f4f fix: replace all native confirm() dialogs with styled modal macros
Some checks failed
CI / ruff (push) Successful in 9s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled
Migrated ~68 native browser confirm() calls across 74 files to use the
project's confirm_modal/confirm_modal_dynamic Jinja2 macros, providing
consistent styled confirmation dialogs instead of plain browser popups.

Modules updated: core, tenancy, cms, marketplace, messaging, billing,
customers, orders, cart. Uses danger/warning/info variants and
double-confirm pattern for destructive delete operations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:56:25 +01:00
182610283d fix: map smtp_use_tls/ssl from API response in loadEmailSettings
Some checks failed
CI / ruff (push) Successful in 11s
CI / pytest (push) Successful in 36m26s
CI / validate (push) Failing after 22s
CI / dependency-scanning (push) Successful in 30s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped
The previous fix added the fields to the API response but missed mapping
them in loadEmailSettings() where the response is stored into
emailSettings. The values were dropped before reaching populateEmailForm.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:17:52 +01:00
e23788cb7d fix: SMTP SSL/TLS checkboxes not reflecting actual config in admin settings
Some checks failed
CI / ruff (push) Successful in 11s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / pytest (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
The EmailStatusResponse didn't include smtp_use_tls/smtp_use_ssl fields,
and the JavaScript hardcoded defaults (TLS=true, SSL=false) instead of
reading from the API response. Now the API returns the effective values
and the UI displays them correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:11:24 +01:00
573b0180ad fix: bypass subscription check in middleware tests
Some checks failed
CI / ruff (push) Successful in 11s
CI / pytest (push) Successful in 38m19s
CI / validate (push) Failing after 23s
CI / dependency-scanning (push) Successful in 30s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped
The StorefrontAccessMiddleware was blocking middleware test routes
(/middleware-test/*) with 403 because test stores have no subscriptions.
These tests verify store context detection and theme loading, not
subscription access. Patch SKIP_PATH_PREFIXES in the test conftest to
let test routes through.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 23:47:10 +01:00
d9fc52d47a feat: email verification, merchant/store password reset, seed gap fix
Some checks failed
CI / ruff (push) Successful in 10s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled
- Add EmailVerificationToken and UserPasswordResetToken models with migration
- Add email verification flow: verify-email page route, resend-verification API
- Block login for unverified users (EmailNotVerifiedException in auth_service)
- Add forgot-password/reset-password endpoints for merchant and store auth
- Add "Forgot Password?" links to merchant and store login pages
- Send welcome email with verification link on merchant creation
- Seed email_verification and merchant_password_reset email templates
- Fix db-reset Makefile to run all init-prod seed scripts
- Add UserAuthService to satisfy architecture validation rules
- Add 52 new tests (unit + integration) with full coverage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 23:22:46 +01:00
a8b29750a5 feat: loyalty feature provider, admin data fixes, storefront mobile menu
Some checks failed
CI / ruff (push) Successful in 9s
CI / pytest (push) Failing after 37m24s
CI / validate (push) Failing after 22s
CI / dependency-scanning (push) Successful in 31s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped
- Add LoyaltyFeatureProvider with 11 BINARY/MERCHANT features for billing
  feature gating, wired into loyalty module definition
- Fix subscription-tiers admin page showing 0 features by populating
  feature_codes from tier relationship in all admin tier endpoints
- Fix merchants admin page showing 0 stores and N/A owner by adding
  store_count and owner_email to MerchantResponse and eager-loading owner
- Add "no tiers" warning with link in subscription creation modal when
  platform has no configured tiers
- Add missing mobile menu panel to storefront base template so hamburger
  toggle actually shows navigation links

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 18:59:24 +01:00
2c710ad416 feat: storefront subscription access guard + module-driven nav + URL rename
Add StorefrontAccessMiddleware that blocks storefront access for stores
without an active subscription, returning a multilingual unavailable page
(en/fr/de/lb) for page requests and JSON 403 for API requests. Multi-platform
aware: resolves subscription for detected platform with fallback to primary.

Also includes yesterday's session work:
- Module-driven storefront navigation via FrontendType.STOREFRONT menu declarations
- shop/ → storefront/ URL rename across 30+ templates
- Subscription context (tier_code) passed to storefront templates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 13:27:31 +01:00
682213fdee feat: trim platform modules, rename platforms, fix seed output
Some checks failed
CI / ruff (push) Successful in 13s
CI / pytest (push) Successful in 36m1s
CI / validate (push) Failing after 21s
CI / dependency-scanning (push) Successful in 28s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped
- Rename platforms: Orion OMS → OMS, Orion → Wizard, Loyalty+ → Loyalty
- Per-platform module assignment: core modules always enabled, optional
  modules selectively enabled per platform instead of enabling all 18
- Rename demo store Orion → WizaTech to avoid confusion with app name
- Fix false "already exist" warnings for customers/products in seed
  (broken post-flush id detection replaced with simple counter)
- Make dev port use API_PORT from .env instead of hardcoded 9999
- Add platforms section with dev URLs to init-prod summary
- Add merchant panel and customer login URLs to seed next steps
- Merge alembic heads (z_store_domain_platform_id + tenancy_001)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 18:18:24 +01:00
3d1586f025 fix: I18n not defined — defer race condition in all base templates
Inline scripts calling I18n.init() ran before the deferred i18n.js
loaded. Wrap in DOMContentLoaded so deferred scripts execute first.

Regression from 8ee8c39 (add defer to scripts).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 15:52:31 +01:00
64082ca877 feat: first client onboarding — fix env, add loyalty admin, dev infra-check
- Fix .env: wizamart→orion/wizard.lu, Redis port→6380
- Fix .env.example: orion.lu→wizard.lu domain references
- Add create_loyalty_admin() to init_production.py (platform-scoped admin for rewardflow.lu)
- Add `make infra-check` target running verify-server.sh
- Split verify-server.sh into dev/prod modes (auto-detected from DEBUG flag)
- Dev checks: .env config, PostgreSQL, Redis, health endpoint, migrations
- Remove stale init.sql volume mount from docker-compose.yml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 15:40:07 +01:00
67260e9322 docs: update progress — server fully ready (44/44 checks pass)
All checks were successful
CI / ruff (push) Successful in 11s
CI / pytest (push) Successful in 36m0s
CI / validate (push) Successful in 23s
CI / dependency-scanning (push) Successful in 31s
CI / docs (push) Successful in 39s
CI / deploy (push) Successful in 48s
- Mark all server-side tasks as complete (fail2ban, Flower password,
  unattended-upgrades, verification script)
- Correct memory limits: celery-beat and flower bumped to 256m after OOM
- Update scaling guide memory budget to match actual limits

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 11:04:43 +01:00
44568893fd fix: verify-server.sh exit on first check, bump flower/beat to 256m
Some checks failed
CI / ruff (push) Successful in 10s
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / validate (push) Has been cancelled
CI / pytest (push) Has been cancelled
- Remove set -e so script continues through all checks
- Use POSIX arithmetic to avoid exit code 1 from (( ))
- Bump flower and celery-beat mem_limit from 128m to 256m (OOM killed)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:56:24 +01:00
10fdf91dfa feat(infra): add launch readiness quick wins
Some checks failed
CI / ruff (push) Successful in 12s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled
- Add mem_limit to all 6 app containers (db: 512m, redis: 128m,
  api: 512m, celery-worker: 512m, celery-beat: 128m, flower: 128m)
- Restrict Flower port to localhost (127.0.0.1:5555:5555)
- Add PostgreSQL and Redis health checks to /health/ready endpoint
  with individual check details (name, status, latency)
- Add scaling guide with metrics, thresholds, Hetzner pricing
- Add server verification script (12 infrastructure checks)
- Update hetzner-server-setup.md with progress and pending tasks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:24:20 +01:00
8ee8c398ce perf: add defer to scripts and lazy loading to images
Some checks failed
CI / ruff (push) Successful in 14s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled
Add defer attribute to 145 <script> tags across 103 template files
(PERF-067) and loading="lazy" to 22 <img> tags across 13 template
files (PERF-058). Both improve page load performance.

Validator totals: 0 errors, 2 warnings, 1360 info (down from 1527).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 20:55:52 +01:00
3a7cf29386 docs(deployment): document Cloudflare proxy, SendGrid SMTP, and Caddyfile updates
Captures all server-side work completed on 2026-02-16:
- Cloudflare Full setup for wizard.lu, omsflow.lu, rewardflow.lu (NS, SSL, origin certs)
- SendGrid SMTP configured for Alertmanager and app transactional emails
- Caddyfile updated with origin certs and tls issuer acme for git.wizard.lu
- Alertmanager v2 API for test alerts, multi-domain email strategy documented
- Cloudflare security: bot protection, DDoS, rate limiting on /api/ paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 20:20:17 +01:00
eaab47f2f8 fix: eliminate all 1600 SEC-015 security info findings
Add safe-pattern exceptions to the x-html check in validate_security.py
for $icon(), $store methods, and window.icons lookups. Suppress remaining
8 legitimate x-html uses (admin-authored content, app-controlled JS) with
noqa comments. Security validator now reports 0 errors, 0 warnings, 0 info.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 18:02:59 +01:00
6458ab13d7 docs: update validator noqa proposal with current results
Reflect resolved architecture warnings, performance warnings, and
current info-only findings (3127) from validate_all output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 14:25:45 +01:00
0b701fb847 docs: add proposal to fix 1600 SEC-015 x-html security info findings
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 22:23:15 +01:00
f67510b706 docs: switch email provider recommendation from Mailgun to SendGrid
SendGrid handles both transactional emails and marketing campaigns
under one account. Updated alertmanager SMTP placeholders, hetzner
setup guide (Step 19.5), and environment reference to recommend
SendGrid as the primary email provider.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 22:21:49 +01:00
8c715cfde3 docs(deployment): expand server-side setup for Steps 19-20
- Add Mailgun SMTP setup instructions for Alertmanager with test alert
- Expand fail2ban to fully copy-pasteable sudo tee commands
- Add Caddy access logging config (required for fail2ban Caddy jail)
- Add orion_default network cleanup step
- Expand verification checklist

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 22:17:15 +01:00