feat: SEP-31 payout retry, SEP-9 fields, SEP-6 DB config, withdrawal logic - #531
Open
levibliz wants to merge 1 commit into
Open
Conversation
…logic - SEP-31 Payout Logic (Pidoko257#350): New sep31PayoutService with provider-specific routing (MTN, Airtel, Orange, Vodacom, Tigo), amount validation per provider, exponential backoff retry (base 10s, max 10min, configurable), dead letter queue for unrecoverable failures, and runPayoutRetryJob for automated retries. Tracks full attempt history in payout_attempts table. - SEP-9 Fields Support (Pidoko257#349): Added SEP-9 KYC field specifications to sep6Service with database-backed field definitions (field_name, field_type, description, optional, enum_values). Config loaded from sep6_field_specs table with 60s cache TTL. - Replace Hard-coded Database in SEP-6 (Pidoko257#348): New sep6Service replaces in-memory Map with database-backed configuration via sep6_asset_configs, sep6_field_specs, and sep6_withdraw_types tables. Includes config caching with TTL, full CRUD for SEP-6 transactions (create, get, update, list by account), and invalidateConfigCache for admin updates. - Withdrawal Logic (Pidoko257#347): Completed TransactionService.withdraw() with balance validation, fee calculation from fee_configurations table, atomic balance deduction via database transaction, withdrawal ledger logging, and proper error handling with rollback. Returns transaction, fee breakdown, and new balance. Closes Pidoko257#350 Closes Pidoko257#349 Closes Pidoko257#348 Closes Pidoko257#347
|
@levibliz 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.
Summary
Addresses 4 issues: SEP-31 payout retry with dead letter queue, SEP-9 KYC fields for SEP-6, database-backed SEP-6 configuration, and complete withdrawal logic with fee calculation.
Changes
SEP-31 Payout Logic (#350)
src/services/sep31PayoutService.tswith provider-specific payout routing for 5 mobile money providers (MTN, Airtel, Orange, Vodacom, Tigo)runPayoutRetryJob()for automated retry processing of queued payoutspayout_attemptstableSEP-9 Fields Support (#349)
src/services/sep6Service.tsfield_name,field_type,description,optional, andenum_valuessep6_field_specstable with 60s cache TTLReplace Hard-coded Database in SEP-6 (#348)
src/services/sep6Service.tsreplaces in-memory Map with database-backed configurationsep6_asset_configs,sep6_field_specs, andsep6_withdraw_typestablescreateSep6Transaction(),getSep6Transaction(),updateSep6TransactionStatus(),getSep6TransactionsByAccount()invalidateConfigCache()for admin configuration updatesWithdrawal Logic (#347)
TransactionService.withdraw()with full withdrawal flowfee_configurationstable (1% default, $0.50 minimum)Closes #350
Closes #349
Closes #348
Closes #347