Skip to main content

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:

  1. @digiwedge/ui-wallet - Presentational components (Ant Design)
  2. @digiwedge/ui-wallet-pages - Composed page components (Ant Design)
  3. 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

IssueTitlePriorityNotes
#10515feat(mobile): add Wallet deep link screenP2Implemented in repo; verify/close if still open

Gaps Requiring Issues

GapPriorityStatus
Mobile WalletView screenP2✅ Implemented
Web /wallet pageP2✅ Implemented
Link-router /wallet routeP2✅ Implemented; deploy pending in UAT/prod

Part 1: Architecture Assessment

1.1 Current Library Structure

LibraryUI FrameworkPurposeComponents
@digiwedge/ui-walletAnt DesignPresentational components18 core components + 1 hook
@digiwedge/ui-wallet-pagesAnt DesignComposed page components6 pages + bulk adjust modal
@digiwedge/wallet-api-client-REST API clientTyped client with all endpoints
@digiwedge/wallet-api-hooksReact QueryData fetching hooks23 hooks (admin + portal)
libs/ui/mca/.../walletMantineMCA app wrappers3 modals + types

1.2 @digiwedge/ui-wallet Components

ComponentStatusStorybookTests
AppleWalletButtonCompleteYesYes
GoogleWalletButtonCompleteYesYes
AddToWalletButtonsCompleteYesYes
WalletCardPreviewCompleteYesYes
WalletBalanceCompleteYesYes
WalletTopUpFormCompleteYesYes
WalletTransferFormCompleteYesYes
WalletReversalModalCompleteYesYes
TransactionTableCompleteYesYes
StatementExportCompleteYesYes
WalletStatusModalCompleteYesYes
WalletJournalEntryDrawerCompleteYesYes
WalletStatusTimelineCompleteYesYes
WalletOutboxPayloadDrawerCompleteYesYes
EventTicketCardCompleteYesYes
WalletQrLinkCompleteYesYes
WalletEmailTemplateCompleteYesYes
WalletWhatsAppTemplateCompleteYesYes
useSendWalletLinkWhatsAppComplete-Yes

1.3 @digiwedge/ui-wallet-pages Pages

PageAudienceStatusStorybookTests
WalletsDashboardAdminCompleteYesYes
MemberWalletDetailAdminCompleteYesYes
WalletAuditPageAdminCompleteYesYes
WalletOutboxDashboardAdminCompleteYesYes
WalletsBulkAdjustModalAdminCompleteYesYes
MyWalletPageMemberCompleteYesYes
TransactionHistoryPageMemberCompleteYesYes

1.4 @digiwedge/wallet-api-hooks Hooks

Hook CategoryHooksStatus
Admin WalletsuseAdminWallets, useAdminWalletSummary, useAdminWalletTransactionsComplete
Admin JournaluseAdminWalletJournalEntries, useAdminWalletStatusEventsComplete
Admin OutboxuseAdminWalletOutbox, useAdminWalletOutboxRetry, useAdminWalletOutboxRetryManyComplete
Admin BulkuseAdminWalletBulkAdjustComplete
Admin Auto TopUpuseAdminWalletAutoTopUp, useAdminWalletAutoTopUpStatusComplete
Portal HistoryusePortalWalletHistory, usePortalWalletStatusEventsComplete
Portal Auto TopUpusePortalWalletAutoTopUp, usePortalWalletAutoTopUpUpdate, usePortalWalletAutoTopUpCheckout, usePortalWalletAutoTopUpPause, usePortalWalletAutoTopUpResume, usePortalWalletAutoTopUpCancelComplete

1.5 Backend Services

ServicePurposeStatus
WalletRealtimeServicePolls wallet outbox, emits events via RxJS SubjectComplete
WalletRealtimeControllerSSE endpoints for portal/admin with tenant/wallet filteringComplete
JwtQueryGuardEnables JWT auth via query param for EventSourceComplete
WalletAutoTopUpServiceManages auto top-up config and BullMQ schedulersComplete
WalletAutoTopUpWorkerProcesses scheduled/threshold jobs, creates chargesComplete
WalletLedgerServiceDouble-entry journal posting with balance assertionComplete

1.6 MCA Integration Layer

ComponentPurposeStatus
WalletTopUpModalMantine wrapper for top-upComplete
WalletTransferModalMantine wrapper for transferComplete
WalletReversalModalMantine wrapper for reversalComplete
memberWallets.tsxMember wallet transactions viewMigrated
wallets.tsxFinances tab wallets listMigrated

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

GapDescriptionEffortStatus
API Integration HooksPages have no data fetching hooksMediumCOMPLETE
Wallet Status ManagementCannot suspend/reactivate/close walletsMediumCOMPLETE
Statement ExportMembers cannot export statementsLowCOMPLETE
Bulk OperationsNo bulk top-up or batch processingHighCOMPLETE
Real-time UpdatesNo live updates, manual refresh requiredMediumCOMPLETE

Priority 2 (Medium) - Enhancement

GapDescriptionEffortImpact
Pass Analytics DashboardNo visibility into wallet pass installations, usageMediumCOMPLETE
Spending Insights (advanced)Merchant rollups + cohort segmentation + retention curvesMediumCOMPLETE
Recurring Top-UpNo automated wallet funding configurationHighCOMPLETE
Transaction NotificationsNo configurable alerts for low balance, transactionsMediumCOMPLETE

Priority 3 (Low) - Nice to Have

GapDescriptionEffortImpact
MCA MigrationmemberWallets.tsx uses legacy modalsLowCOMPLETE
Wallet LimitsSpending limits, transfer limits per memberMedium98% Complete (auto-enforce + tests pending)
Audit TrailWallet-specific audit log with admin actionsLowCOMPLETE
Multi-CurrencyUI assumes single currency (ZAR)MediumLow

2.3 Analytics Metrics + Data Sources

MetricSourceNotes
Merchant rollupswallet-data.WalletTransaction.metadata.merchantNamePopulated on purchase ingestion from Company.brandName/legalName (fallback to metadata.merchant)
Cohorts by clubscl-data.MemberClub + Member.walletAccountIdWallets grouped by club membership; respects tenant/club filter
Cohorts by tierscl-data.Member.membershipTierId + MembershipTierCurrent tier only; label includes club name to avoid collisions
Retention curveswallet-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

FeatureMCA (Current)wallet-pages (New)
Data FetchingGraphQL hooksReact Query hooks (wallet-api-hooks)
UI FrameworkMantineAnt Design
Transaction ListTanStack TableAnt Design Table
Modal ManagementuseDisclosureuseState
Reversal LogicServer-sideClient-side detection
Type SafetyPartialComplete
Storybook CoveragePartialComplete
Test CoverageLimitedComprehensive
Real-time UpdatesManual refreshSSE EventSource

Part 3: SWOT Analysis

Strengths

  1. Clean Three-Tier Architecture

    • Clear separation: components → pages → app wrappers
    • Shared types via @digiwedge/ui-wallet-pages types
    • Presentational components are fully reusable
  2. 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)
  3. Complete Storybook Coverage

    • All components have stories
    • Page-level stories with mock data
    • Interactive development possible
  4. Type Safety

    • Shared types between libraries
    • Form value types exported
    • Transaction type detection helper
    • API client fully typed
  5. Modern UI Patterns

    • Ant Design for consistency
    • Proper form validation
    • Accessible components
    • Responsive layouts
  6. Complete API Integration (New)

    • @digiwedge/wallet-api-client for REST calls
    • @digiwedge/wallet-api-hooks for React Query integration
    • 23 hooks covering all admin and portal operations
  7. 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
  8. Double-Entry Ledger (New)

    • Balanced journal entries for all transactions
    • Audit trail with journal entry drawer
    • Outbox pattern for durable event publishing

Weaknesses

  1. No Data Fetching Layer RESOLVED

    • wallet-pages has no hooks for API integration Hooks now ship with wallet API client
    • Consumers must implement all data fetching Hook layer handles fetch + error states
    • No React Query or Apollo integration React Query hooks added
  2. MCA Integration Incomplete RESOLVED

    • memberWallets.tsx uses legacy modal imports Now uses new wrapper modals
    • Not yet consuming wrapper components Wrapper components in use
    • Dual patterns exist Legacy modals removed
  3. Limited Admin Capabilities RESOLVED

    • Cannot manage wallet status ✅ Now complete
    • No bulk operations ✅ Bulk adjustments available
    • No audit trail ✅ Audit page + journal view added
  4. No Real-Time Updates RESOLVED

    • Transactions require manual refresh ✅ SSE integration added
    • No WebSocket integration ✅ Using SSE (more appropriate for this use case)
    • Balance updates not pushed ✅ React Query invalidation on events
  5. Export Functionality Missing RESOLVED

    • No statement exportStatementExport component added
    • No transaction export for admin ✅ Statement export in MemberWalletDetail
  6. 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 types
      • WalletJournalEntry + WalletJournalLine → double-entry rollups by account, audit-ready totals
      • WalletPass + WalletPassUpdate + WalletPassEvent → installs, status mix, 30-day engagement
      • WalletAccountStatusEvent → 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)
  7. No Notification System RESOLVED

    • ✅ Low balance alerts
    • ✅ Transaction notifications (credit/debit)
    • ✅ Configurable member alert preferences

Opportunities

  1. Pass Engagement Analytics

    • Deep usage patterns (opens per pass, update cadence)
    • Geo distribution and location relevance
    • Adoption trends segmented by device
  2. Self-Service Expansion

    • Spending budgets and limits
    • Transaction categorization
    • Personal spending insights
  3. Member Engagement

    • Low balance notifications
    • Transaction alerts
    • Spending insights dashboard
  4. Mobile App Integration

    • Share wallet-api-hooks with mobile
    • Consistent behavior across platforms
    • Real-time updates in mobile app

Threats

  1. Fragmentation Risk (Mitigated)

    • MCA migration complete
    • Wrapper pattern established
    • Single source of truth for components
  2. Mobile App Divergence

    • Mobile may implement separate wallet UI
    • Native vs web parity issues
    • Feature drift between platforms
  3. API Evolution

    • Backend may change without UI updates
    • Type mismatches possible
    • Need to keep client library in sync
  4. 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:

ItemStatusDelivered
API Integration HooksComplete@digiwedge/wallet-api-hooks with 23 hooks
Statement ExportCompletePDF/CSV via StatementExport component
Wallet Status ManagementCompleteSuspend/reactivate/close via WalletStatusModal
Bulk OperationsCompleteWalletsBulkAdjustModal with CSV import
Recurring Top-UpCompleteAuto top-up config, checkout, worker
Audit TrailCompleteWalletAuditPage, journal entries, status timeline
Spending Insights (basic)Partial90-day totals + category breakdown + trend
Real-time UpdatesCompleteSSE via WalletRealtimeService + EventSource wiring
MCA MigrationCompleteWrapper modals in use, legacy modals removed
Double-Entry LedgerCompleteBalanced 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)

ItemDescriptionEffort
Wallet LimitsSpending/transfer limits per memberMedium
Multi-CurrencyPartial support (wallet currency wired to portal history); remaining defaults still ZAR in some components/testsMedium
Batch Processing StatusReal-time status for bulk operationsLow
GraphQL DeprecationMigrate MCA to REST hooksMedium

Part 5: Technical Debt Register

ItemDescriptionPriorityEffortStatus
Legacy MCA modalsmemberWallets.tsx imports old modalsMediumLowRESOLVED
Deprecate old modalsRemove libs/ui/mca/src/modals/wallet*.tsxLowLowREMOVED
Missing wallet hooksNo useWallet hook in wallet libHighMediumRESOLVED
Currency hardcodingZAR defaults remain in some components/tests (portal history now honors wallet currency)LowLowPartial
Date formattingInconsistent date formatsLowLowOpen
Error handlingBasic error display, no retryMediumMediumRESOLVED
Real-time updatesManual refresh requiredMediumMediumRESOLVED

Part 6: Success Metrics

MetricCurrentTargetNotes
Component library coverage95%95%All core components complete
Storybook coverage100%100%All components have stories
Test coverage80%80%Comprehensive page + hook tests
Admin features complete97%95%Analytics panel added
Member features complete95%95%Advanced analytics pending
MCA migration complete100%100%Wrapper modals in use
Wallet status management100%100%Suspend/reactivate/close done
Real-time updates100%100%SSE integration complete
API hooks coverage100%100%23 hooks covering all operations

Appendix A: File References

Core Libraries

  • libs/ui/wallet/src/ - Presentational components
  • libs/ui/wallet-pages/src/ - Page compositions
  • libs/wallet/api-client/src/ - REST API client
  • libs/hooks/wallet-api-hooks/src/ - React Query hooks
  • libs/ui/mca/src/components/wallet/ - MCA wrappers

Backend Services

  • apps/scl/scl-backend/src/app/wallet-realtime.service.ts - Outbox poller
  • apps/scl/scl-backend/src/app/wallet-realtime.controller.ts - SSE endpoints
  • apps/scl/scl-backend/src/app/guards/jwt-query.guard.ts - Query param auth
  • apps/scl/scl-backend/src/app/wallet-auto-topup.service.ts - Auto top-up config
  • apps/scl/events-worker/src/app/wallet-auto-topup.worker.ts - Job processing

Key Types

  • libs/ui/wallet-pages/src/types.ts - Shared types
  • libs/wallet/api-client/src/types.ts - API types

MCA Integration Points

  • libs/ui/mca/src/components/membership/viewMemberContent/memberWallets.tsx
  • libs/ui/mca/src/components/finances/financeTabs/wallets.tsx

Appendix B: Implementation Timeline

DateMilestone
2025-12-18Statement export added
2025-12-19Wallet status management complete
2025-12-19MCA migration + legacy modal removal
2025-12-20Double-entry journal ledger
2025-12-20Wallet outbox + audit trail
2025-12-20Bulk adjustments + CSV import
2025-12-21Auto top-up end-to-end flow
2025-12-21SSE real-time updates
2025-12-21Spending categories + portal insights + currency wiring

Last updated: 2025-12-21