Implement batch disbursement logic for mtn b2 b operations#1144
Open
Aonlike wants to merge 4 commits into
Open
Implement batch disbursement logic for mtn b2 b operations#1144Aonlike wants to merge 4 commits into
Aonlike wants to merge 4 commits into
Conversation
|
@Aonlike 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #857
📝 Description
Currently, bulk payouts executed via the platform route through a iterative loop that triggers individual HTTP API calls to mobile money providers. This architecture bottlenecks throughput, exposes the system to provider rate-limiting (
429 Too Many Requests), and creates complex failure states if a runtime crash or network failure occurs mid-loop.This PR implements MTN’s native batch disbursement API within the core financial orchestration engine. Bulk payout requests targeting MTN MoMo are now bundled into atomic batches of up to 100 items, dispatched asynchronously to MTN, and tracked safely via a decoupled background worker.
🚀 Changes
Core Platform & Financial Engine
sendBatchPayout()andgetBatchStatus()methods tosrc/services/mobilemoney/providers/mtn.tsusing MTN’s asynchronous batch orchestration endpoints.batchestracking table and added a nullablebatch_idforeign key to the partitionedtransactionstable.mtnBatchProcessorinsidesrc/jobs/processors/tasked with safely polling the third-party infrastructure.Testing & Infrastructure
PENDING,COMPLETED).🛠️ Technical Implementation Details
Database Migration Details