Wallet & Member Wallet UI/UX - Gap & SWOT Analysis
Date: 2025-12-21
Analysis Scope: Wallet Admin and Member Portal UI/UX Completeness
Current Completeness: ~98%
Architecture Status: Three-tier component structure complete
MCA Migration Status: Complete - memberWallets.tsx uses new wallet wrapper modals
Statement Export: Complete - PDF/CSV export in TransactionHistoryPage and MemberWalletDetail
Wallet Status Management: Complete - Suspend/reactivate/close in MemberWalletDetail
Recurring Top-Up: Complete - Auto top-up config + checkout + worker + mandate sync
Audit + Outbox: Complete - Wallet audit page + outbox monitoring + journal entries
Spending Categories: Complete - Admin category rules + manual tagging + portal display
Advanced Analytics: Complete - Merchant rollups + tier/club cohorts + retention curves
API Hooks: Complete - @digiwedge/wallet-api-client + @digiwedge/wallet-api-hooks
Real-time Updates: Complete - SSE-based wallet events with outbox polling
Double-Entry Ledger: Complete - Journal entries with balanced assertions
Executive Summary
The Wallet UI/UX system has achieved near-complete implementation with a clean three-tier component library structure:
@digiwedge/ui-wallet- Presentational components (Ant Design)@digiwedge/ui-wallet-pages- Composed page components (Ant Design)libs/ui/mca/src/components/wallet- MCA wrappers (Mantine UI)
All core admin and member-facing wallet features are now functional. The remaining gaps are advanced analytics and notification enhancements rather than core functionality.
Issue Tracker
Open Issues
| Issue | Title | Priority | Notes |
|---|---|---|---|
| #10515 | feat(mobile): add Wallet deep link screen | P2 | Implemented in repo; verify/close if still open |
Gaps Requiring Issues
| Gap | Priority | Status |
|---|---|---|
| Mobile WalletView screen | P2 | ✅ Implemented |
Web /wallet page | P2 | ✅ Implemented |
Link-router /wallet route | P2 | ✅ Implemented; deploy pending in UAT/prod |
Part 1: Architecture Assessment
1.1 Current Library Structure
| Library | UI Framework | Purpose | Components |
|---|---|---|---|
@digiwedge/ui-wallet | Ant Design | Presentational components | 18 core components + 1 hook |
@digiwedge/ui-wallet-pages | Ant Design | Composed page components | 6 pages + bulk adjust modal |
@digiwedge/wallet-api-client | - | REST API client | Typed client with all endpoints |
@digiwedge/wallet-api-hooks | React Query | Data fetching hooks | 23 hooks (admin + portal) |
libs/ui/mca/.../wallet | Mantine | MCA app wrappers | 3 modals + types |
1.2 @digiwedge/ui-wallet Components
| Component | Status | Storybook | Tests |
|---|---|---|---|
AppleWalletButton | Complete | Yes | Yes |
GoogleWalletButton | Complete | Yes | Yes |
AddToWalletButtons | Complete | Yes | Yes |
WalletCardPreview | Complete | Yes | Yes |
WalletBalance | Complete | Yes | Yes |
WalletTopUpForm | Complete | Yes | Yes |
WalletTransferForm | Complete | Yes | Yes |
WalletReversalModal | Complete | Yes | Yes |
TransactionTable | Complete | Yes | Yes |
StatementExport | Complete | Yes | Yes |
WalletStatusModal | Complete | Yes | Yes |
WalletJournalEntryDrawer | Complete | Yes | Yes |
WalletStatusTimeline | Complete | Yes | Yes |
WalletOutboxPayloadDrawer | Complete | Yes | Yes |
EventTicketCard | Complete | Yes | Yes |
WalletQrLink | Complete | Yes | Yes |
WalletEmailTemplate | Complete | Yes | Yes |
WalletWhatsAppTemplate | Complete | Yes | Yes |
useSendWalletLinkWhatsApp | Complete | - | Yes |
1.3 @digiwedge/ui-wallet-pages Pages
| Page | Audience | Status | Storybook | Tests |
|---|---|---|---|---|
WalletsDashboard | Admin | Complete | Yes | Yes |
MemberWalletDetail | Admin | Complete | Yes | Yes |
WalletAuditPage | Admin | Complete | Yes | Yes |
WalletOutboxDashboard | Admin | Complete | Yes | Yes |
WalletsBulkAdjustModal | Admin | Complete | Yes | Yes |
MyWalletPage | Member | Complete | Yes | Yes |
TransactionHistoryPage | Member | Complete | Yes | Yes |
1.4 @digiwedge/wallet-api-hooks Hooks
| Hook Category | Hooks | Status |
|---|---|---|
| Admin Wallets | useAdminWallets, useAdminWalletSummary, useAdminWalletTransactions | Complete |
| Admin Journal | useAdminWalletJournalEntries, useAdminWalletStatusEvents | Complete |
| Admin Outbox | useAdminWalletOutbox, useAdminWalletOutboxRetry, useAdminWalletOutboxRetryMany | Complete |
| Admin Bulk | useAdminWalletBulkAdjust | Complete |
| Admin Auto TopUp | useAdminWalletAutoTopUp, useAdminWalletAutoTopUpStatus | Complete |
| Portal History | usePortalWalletHistory, usePortalWalletStatusEvents | Complete |
| Portal Auto TopUp | usePortalWalletAutoTopUp, usePortalWalletAutoTopUpUpdate, usePortalWalletAutoTopUpCheckout, usePortalWalletAutoTopUpPause, usePortalWalletAutoTopUpResume, usePortalWalletAutoTopUpCancel | Complete |
1.5 Backend Services
| Service | Purpose | Status |
|---|---|---|
WalletRealtimeService | Polls wallet outbox, emits events via RxJS Subject | Complete |
WalletRealtimeController | SSE endpoints for portal/admin with tenant/wallet filtering | Complete |
JwtQueryGuard | Enables JWT auth via query param for EventSource | Complete |
WalletAutoTopUpService | Manages auto top-up config and BullMQ schedulers | Complete |
WalletAutoTopUpWorker | Processes scheduled/threshold jobs, creates charges | Complete |
WalletLedgerService | Double-entry journal posting with balance assertion | Complete |
1.6 MCA Integration Layer
| Component | Purpose | Status |
|---|---|---|
WalletTopUpModal | Mantine wrapper for top-up | Complete |
WalletTransferModal | Mantine wrapper for transfer | Complete |
WalletReversalModal | Mantine wrapper for reversal | Complete |
memberWallets.tsx | Member wallet transactions view | Migrated |
wallets.tsx | Finances tab wallets list | Migrated |
Part 2: Gap Analysis
2.1 Feature Completeness by Domain
Digital Wallet Passes [█████████████████████] 98%
├── Apple Wallet Button Complete (with i18n)
├── Google Wallet Button Complete (with i18n)
├── Pass Preview Complete
├── QR Code Distribution Complete
├── Email Distribution Complete
├── WhatsApp Distribution Complete
└── Pass Analytics Complete (admin analytics panel)
Admin Wallet Management [███████████████████░░] 95%
├── Member Wallets List Complete
├── Member Wallet Detail Complete
├── Top-Up Functionality Complete
├── Transfer Functionality Complete
├── Transaction Reversal Complete
├── Wallet Status Management Complete (suspend/reactivate/close)
├── Bulk Operations Complete (bulk adjustments + CSV import)
├── Spending Category Rules Complete (rules + manual tagging)
├── Spending Limits 98% Complete (schema, service, controller, portal UI done; auto-enforcement + tests pending)
├── Transaction Export Complete (Statement export)
├── Audit Trail Complete (Audit page + journal)
├── Real-time Updates Complete (SSE events)
└── Auto Top-Up Admin Complete (view/pause/resume/cancel)
Member Portal Features [███████████████████░] 95%
├── View Balance Complete
├── Transaction History Complete
├── Top-Up (Self-Service) Complete
├── Transfer to Member Complete
├── Add to Apple Wallet Complete
├── Add to Google Wallet Complete
├── Transaction Filters Complete
├── Statement Export Complete (PDF/CSV export)
├── Spending Analytics Complete (totals + categories + trend + merchants + cohorts + retention)
├── Recurring Top-Up Complete (auto top-up config + checkout)
├── Real-time Updates Complete (SSE events)
└── Notification Preferences Complete (member-configurable alerts)
Integration & Hooks [████████████████████░] 95%
├── GraphQL Queries Partial (MCA only)
├── REST API Integration Complete (wallet-api-client + hooks)
├── Real-time Updates Complete (SSE wallet events)
├── Error Handling Complete (React Query error states)
├── Loading States Complete
└── Double-Entry Ledger Complete (balanced assertions)
2.2 Remaining Gaps
Priority 1 (High) - Business Impact
| Gap | Description | Effort | Status |
|---|---|---|---|
| COMPLETE | |||
| COMPLETE | |||
| COMPLETE | |||
| COMPLETE | |||
| COMPLETE |
Priority 2 (Medium) - Enhancement
| Gap | Description | Effort | Impact |
|---|---|---|---|
| COMPLETE | |||
| COMPLETE | |||
| COMPLETE | |||
| COMPLETE |
Priority 3 (Low) - Nice to Have
| Gap | Description | Effort | Impact |
|---|---|---|---|
memberWallets.tsx uses legacy modals | COMPLETE | ||
| 98% Complete (auto-enforce + tests pending) | |||
| COMPLETE | |||
| Multi-Currency | UI assumes single currency (ZAR) | Medium | Low |
2.3 Analytics Metrics + Data Sources
| Metric | Source | Notes |
|---|---|---|
| Merchant rollups | wallet-data.WalletTransaction.metadata.merchantName | Populated on purchase ingestion from Company.brandName/legalName (fallback to metadata.merchant) |
| Cohorts by club | scl-data.MemberClub + Member.walletAccountId | Wallets grouped by club membership; respects tenant/club filter |
| Cohorts by tier | scl-data.Member.membershipTierId + MembershipTier | Current tier only; label includes club name to avoid collisions |
| Retention curves | wallet-data.WalletAccount.createdAt + WalletTransaction (DEBIT) | Cohort month = account created month; active if spend in month; 6-month window |
2.4 Comparison: MCA vs Wallet-Pages
| Feature | MCA (Current) | wallet-pages (New) |
|---|---|---|
| Data Fetching | GraphQL hooks | React Query hooks (wallet-api-hooks) |
| UI Framework | Mantine | Ant Design |
| Transaction List | TanStack Table | Ant Design Table |
| Modal Management | useDisclosure | useState |
| Reversal Logic | Server-side | Client-side detection |
| Type Safety | Partial | Complete |
| Storybook Coverage | Partial | Complete |
| Test Coverage | Limited | Comprehensive |
| Real-time Updates | Manual refresh | SSE EventSource |
Part 3: SWOT Analysis
Strengths
-
Clean Three-Tier Architecture
- Clear separation: components → pages → app wrappers
- Shared types via
@digiwedge/ui-wallet-pagestypes - Presentational components are fully reusable
-
Comprehensive Digital Wallet Support
- Apple and Google Wallet button components
- Proper branding guideline compliance
- Multi-language support (en, es, fr, ar, id)
- Multiple distribution channels (QR, email, WhatsApp)
-
Complete Storybook Coverage
- All components have stories
- Page-level stories with mock data
- Interactive development possible
-
Type Safety
- Shared types between libraries
- Form value types exported
- Transaction type detection helper
- API client fully typed
-
Modern UI Patterns
- Ant Design for consistency
- Proper form validation
- Accessible components
- Responsive layouts
-
Complete API Integration (New)
@digiwedge/wallet-api-clientfor REST calls@digiwedge/wallet-api-hooksfor React Query integration- 23 hooks covering all admin and portal operations
-
Real-time Updates (New)
- SSE-based wallet event streaming
- Automatic React Query invalidation on events
- Per-tenant/wallet event filtering
- Heartbeat mechanism for connection health
-
Double-Entry Ledger (New)
- Balanced journal entries for all transactions
- Audit trail with journal entry drawer
- Outbox pattern for durable event publishing
Weaknesses
-
No Data Fetching LayerRESOLVEDHooks now ship with wallet API clientwallet-pageshas no hooks for API integrationConsumers must implement all data fetchingHook layer handles fetch + error statesNo React Query or Apollo integrationReact Query hooks added
-
MCA Integration IncompleteRESOLVEDNow uses new wrapper modalsmemberWallets.tsxuses legacy modal importsNot yet consuming wrapper componentsWrapper components in useDual patterns existLegacy modals removed
-
Limited Admin CapabilitiesRESOLVEDCannot manage wallet status✅ Now completeNo bulk operations✅ Bulk adjustments availableNo audit trail✅ Audit page + journal view added
-
No Real-Time UpdatesRESOLVEDTransactions require manual refresh✅ SSE integration addedNo WebSocket integration✅ Using SSE (more appropriate for this use case)Balance updates not pushed✅ React Query invalidation on events
-
Export Functionality MissingRESOLVEDNo statement export✅StatementExportcomponent addedNo transaction export for admin✅ Statement export in MemberWalletDetail
-
Limited Analytics (Partially resolved)
- ✅ Pass install + status metrics (provider + status counts, 30-day installs/events)
- ✅ Tenant-level spend analytics (90-day spend, type/category breakdown, 6-month trend)
- ✅ Cohort signals (new wallets 30d, active wallets 30d/90d, repeat spend rate, churn after zero balance)
- ✅ Merchant rollups when merchant metadata is present
- Concrete metrics + data sources:
WalletTransaction+WalletTransactionCategory→ spend totals, category mix, top transaction typesWalletJournalEntry+WalletJournalLine→ double-entry rollups by account, audit-ready totalsWalletPass+WalletPassUpdate+WalletPassEvent→ installs, status mix, 30-day engagementWalletAccountStatusEvent→ status change volume, suspension/reactivation rates
- Remaining advanced analytics:
- Cohort segmentation (new vs returning by tier/club)
- Merchant enrichment + verified merchant taxonomy
- Pass engagement depth (
opens_per_pass,avg_time_between_updates,last_pass_event_at)
-
No Notification SystemRESOLVED- ✅ Low balance alerts
- ✅ Transaction notifications (credit/debit)
- ✅ Configurable member alert preferences
Opportunities
-
Pass Engagement Analytics
- Deep usage patterns (opens per pass, update cadence)
- Geo distribution and location relevance
- Adoption trends segmented by device
-
Self-Service Expansion
- Spending budgets and limits
- Transaction categorization
- Personal spending insights
-
Member Engagement
- Low balance notifications
- Transaction alerts
- Spending insights dashboard
-
Mobile App Integration
- Share wallet-api-hooks with mobile
- Consistent behavior across platforms
- Real-time updates in mobile app
Threats
-
Fragmentation Risk (Mitigated)
- MCA migration complete
- Wrapper pattern established
- Single source of truth for components
-
Mobile App Divergence
- Mobile may implement separate wallet UI
- Native vs web parity issues
- Feature drift between platforms
-
API Evolution
- Backend may change without UI updates
- Type mismatches possible
- Need to keep client library in sync
-
Competition
- Third-party wallet solutions
- Apple/Google native features
- Payment app wallet features
Part 4: Recommendations
Completed Items
The following high-priority items have been delivered:
| Item | Status | Delivered |
|---|---|---|
| API Integration Hooks | Complete | @digiwedge/wallet-api-hooks with 23 hooks |
| Statement Export | Complete | PDF/CSV via StatementExport component |
| Wallet Status Management | Complete | Suspend/reactivate/close via WalletStatusModal |
| Bulk Operations | Complete | WalletsBulkAdjustModal with CSV import |
| Recurring Top-Up | Complete | Auto top-up config, checkout, worker |
| Audit Trail | Complete | WalletAuditPage, journal entries, status timeline |
| Spending Insights (basic) | Partial | 90-day totals + category breakdown + trend |
| Real-time Updates | Complete | SSE via WalletRealtimeService + EventSource wiring |
| MCA Migration | Complete | Wrapper modals in use, legacy modals removed |
| Double-Entry Ledger | Complete | Balanced journal posting with outbox |
Next Priority Items
1. Transaction Notifications (Medium effort, Medium impact)
Enable configurable wallet alerts:
- Low balance threshold alerts
- Transaction notifications (credit/debit)
- Delivery via email/push/WhatsApp
- User preference management UI
2. Spending Insights (advanced) (Medium effort, Medium impact)
Member-facing analytics:
- Balance history chart
- Month-over-month change indicators
- Merchant-level analytics (when references are enriched)
- Comparison to cohort averages
Long-Term (Backlog)
| Item | Description | Effort |
|---|---|---|
| Multi-Currency | Partial support (wallet currency wired to portal history); remaining defaults still ZAR in some components/tests | Medium |
| Batch Processing Status | Real-time status for bulk operations | Low |
| GraphQL Deprecation | Migrate MCA to REST hooks | Medium |
Part 5: Technical Debt Register
| Item | Description | Priority | Effort | Status |
|---|---|---|---|---|
memberWallets.tsx imports old modals | RESOLVED | |||
libs/ui/mca/src/modals/wallet*.tsx | REMOVED | |||
useWallet hook in wallet lib | RESOLVED | |||
| Currency hardcoding | ZAR defaults remain in some components/tests (portal history now honors wallet currency) | Low | Low | Partial |
| Date formatting | Inconsistent date formats | Low | Low | Open |
| RESOLVED | ||||
| RESOLVED |
Part 6: Success Metrics
| Metric | Current | Target | Notes |
|---|---|---|---|
| Component library coverage | 95% | 95% | All core components complete |
| Storybook coverage | 100% | 100% | All components have stories |
| Test coverage | 80% | 80% | Comprehensive page + hook tests |
| Admin features complete | 97% | 95% | Analytics panel added |
| Member features complete | 95% | 95% | Advanced analytics pending |
| MCA migration complete | 100% | 100% | Wrapper modals in use |
| Wallet status management | 100% | 100% | Suspend/reactivate/close done |
| Real-time updates | 100% | 100% | SSE integration complete |
| API hooks coverage | 100% | 100% | 23 hooks covering all operations |
Appendix A: File References
Core Libraries
libs/ui/wallet/src/- Presentational componentslibs/ui/wallet-pages/src/- Page compositionslibs/wallet/api-client/src/- REST API clientlibs/hooks/wallet-api-hooks/src/- React Query hookslibs/ui/mca/src/components/wallet/- MCA wrappers
Backend Services
apps/scl/scl-backend/src/app/wallet-realtime.service.ts- Outbox pollerapps/scl/scl-backend/src/app/wallet-realtime.controller.ts- SSE endpointsapps/scl/scl-backend/src/app/guards/jwt-query.guard.ts- Query param authapps/scl/scl-backend/src/app/wallet-auto-topup.service.ts- Auto top-up configapps/scl/events-worker/src/app/wallet-auto-topup.worker.ts- Job processing
Key Types
libs/ui/wallet-pages/src/types.ts- Shared typeslibs/wallet/api-client/src/types.ts- API types
MCA Integration Points
libs/ui/mca/src/components/membership/viewMemberContent/memberWallets.tsxlibs/ui/mca/src/components/finances/financeTabs/wallets.tsx
Appendix B: Implementation Timeline
| Date | Milestone |
|---|---|
| 2025-12-18 | Statement export added |
| 2025-12-19 | Wallet status management complete |
| 2025-12-19 | MCA migration + legacy modal removal |
| 2025-12-20 | Double-entry journal ledger |
| 2025-12-20 | Wallet outbox + audit trail |
| 2025-12-20 | Bulk adjustments + CSV import |
| 2025-12-21 | Auto top-up end-to-end flow |
| 2025-12-21 | SSE real-time updates |
| 2025-12-21 | Spending categories + portal insights + currency wiring |
Last updated: 2025-12-21