Skip to content

feat: implement resilient mobile money services, dispute workflow, ba… - #1888

Merged
sublime247 merged 1 commit into
sublime247:mainfrom
AbuJulaybeeb:feature/fallback-provider-dispute-batch-profile
Aug 27, 2026
Merged

feat: implement resilient mobile money services, dispute workflow, ba…#1888
sublime247 merged 1 commit into
sublime247:mainfrom
AbuJulaybeeb:feature/fallback-provider-dispute-batch-profile

Conversation

@AbuJulaybeeb

Copy link
Copy Markdown
Contributor

Summary

  • Implemented networkOutageFallbackService.ts to provide threshold-based outage detection and background recovery polling for mobile money providers.
  • Implemented disputeWorkflowTool.ts to orchestrate triage, agent assignment, and SLA-based escalations for customer disputes.
  • Implemented batchTransactionService.ts to process bulk deposit and payout transactions concurrently, with robust deduplication and timeout boundaries.
  • Implemented userProfileService.ts to centralize profile validation, GDPR data export delegation, multi-channel notification preferences, and Stellar address linking.

Why

This PR resolves a batch of core service enhancements required for the platform's stability, support operations, and user management:

  • Provider network outages were previously causing raw request failures without a recovery fallback strategy.
  • Support agents lacked a formalized workflow tool to track, prioritize, and escalate transaction disputes within an SLA.
  • Processing bulk payouts and deposits lacked concurrency control and was susceptible to double-processing on retries.
  • User profile updates and notification preferences lacked a validated, unified service boundary.

Implementation

  • Outage Fallback: Created networkOutageFallbackService using a failure counter and threshold threshold limit. Integrates a watchdog timer (startRecoveryWatchdog) to poll recovering providers asynchronously and emit state-change events.
  • Dispute Workflow: Built DisputeWorkflowTool atop the base dispute model. Added dynamic triage priority scoring based on value/category, and a CRON-friendly escalateOverdue method to identify breached SLAs.
  • Batch Processing: Created BatchTransactionService utilizing Promise concurrency limits. Added internal map-based idempotency deduplication (latest entry wins) and Promise.race() to enforce per-item timeout limits. Emits real-time event streams for progress bars.
  • Profile Management: Built userProfileService as a facade for base user queries and extended attributes (Avatar, Stellar Address, Preferences). Leveraged PostgreSQL ON CONFLICT DO UPDATE for safe upserts of user preferences.

Testing

  • npm run lint:fix
  • npx prettier --write .
  • npx jest src/services/mobilemoney/__tests__/networkOutageFallbackService.test.ts (Passed 24/24 unit tests)
  • npx jest src/services/__tests__/disputeWorkflowTool.test.ts (Passed 17/17 unit tests)
  • npx jest src/services/__tests__/batchTransactionService.test.ts (Passed 20/20 unit tests)
  • npx jest src/services/__tests__/userProfileService.test.ts (Passed 10/10 unit tests)

Scope / Risk

  • Scope: Core service layer additions targeting mobile money orchestration, dispute support workflows, batching logic, and profile updates.
  • Risk: Low. These are newly introduced, highly-encapsulated services. Existing routers and controllers will need to be gradually migrated to integrate these interfaces. Database tables used (user_extended_profile, user_notification_preferences) utilize safe ON CONFLICT constraints.

Issue

Closes #1815
Closes #1816
Closes #1817
Closes #1818

@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@AbuJulaybeeb Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

…files

This commit resolves 4 feature issues by introducing new services:

Implementation:
- networkOutageFallbackService: Fallback and recovery watchdog for provider outages.
- disputeWorkflowTool: Triage and resolution orchestrator for disputes with SLA.
- batchTransactionService: High-throughput batch processing for transactions.
- userProfileService: Profile management, GDPR export, and Stellar linking.

Testing:
- Unit tests added for all new services.
- Validated state transitions and failure modes.

Closes sublime247#1815
Closes sublime247#1816
Closes sublime247#1817
Closes sublime247#1818
@AbuJulaybeeb
AbuJulaybeeb force-pushed the feature/fallback-provider-dispute-batch-profile branch from 9f45eb3 to 81c2f8e Compare August 27, 2026 06:02
@sublime247
sublime247 merged commit e93f2e5 into sublime247:main Aug 27, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants