Add frontend/modules/loyalty with types, API client, design system, feature pages and thin App Router routes under app/loyalty/. BFF proxy at app/api/loyalty/. Include loyalty frontend docs. Co-authored-by: Cursor <cursoragent@cursor.com>
1.2 KiB
1.2 KiB
Loyalty Frontend Architecture
Status: Production scaffold — connected to Loyalty service 7.0–7.6
Package: frontend/modules/loyalty/
Routes: frontend/app/loyalty/ (thin App Router only)
BFF: frontend/app/api/loyalty/[...path] → :8004
Layers
- App Router —
page.tsx/layout.tsx/loading.tsx/error.tsx/not-found.tsxonly - Module package — features, components, services, design-system, constants
- Shared DS —
@/components/ds+ module tokens--loyalty-* - BFF — same-origin proxy with
Authorization+X-Tenant-ID
Portal
Single portal engage under /loyalty/engage/* with shell navigation. Hub at /loyalty/hub.
API client
loyaltyApi in modules/loyalty/services/loyalty-api.ts covers programs, tiers, members (+lifecycle), point accounts (+ledger ops), rewards/redemptions, campaigns (+lifecycle), referrals, wallets, audit, health.
Query keys
["loyalty", tenantId, resource, ...]
Out-of-scope honesty
Screens without backend APIs (gift cards 7.7, gamification entities, segments, partners, branches, API keys) use LoyaltyScopeNotice — no fake CRUD.