fix: close 8 audit gaps across 20 transfer scenarios (PIX/UPI webhooks, compliance jurisdictions, corridor configs)#13
Merged
munisp merged 1 commit intoJun 20, 2026
Conversation
CRITICAL:
- Fix from_amount column reference in all raw SQL queries (SUM(from_amount) → SUM("fromAmount"))
- Fix ML fraud scorer hardcoded source_country: "NG" → derive from sender currency
HIGH:
- Add PIX webhook handler for Brazil corridor settlement completion
- Add UPI webhook handler for India corridor settlement completion
- Add advanceTransferState call to Mojaloop webhook on COMMITTED
MEDIUM:
- Add 8 missing jurisdictions to compliance auto-filing (BRL, INR, TZS, UGX, XOF, XAF, MWK, ZMW)
- Add inbound reporting for KE (CBK), GH (BoG), ZA (FIC), TZ (BoT), BR (COAF), IN (RBI)
- Add travel rule thresholds for 8 new jurisdictions
LOW:
- Add 18 missing corridor fee configs (CA, US, UK, EU diaspora corridors + PIX/UPI)
- Fix velocity check catch-block fail-open → fail-closed on DB query errors
Co-Authored-By: Patrick Munis <pmunis@gmail.com>
Contributor
Author
Original prompt from Patrick
|
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
Author
Test Results — PR #13: 8 Audit Gap Fixes9/9 tests passed. Ran dev server locally against PostgreSQL, tested via live curl requests (runtime) and vitest/structural verification. Runtime Tests (3/3 passed)
Vitest Tests (9/9 passed, 817ms)
Structural Verification (4/4 passed)
Escalations: None. |
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
Closes all 8 gaps found in the 20-scenario audit (2 CRITICAL, 2 HIGH, 2 MEDIUM, 2 LOW).
CRITICAL — all 20 scenarios affected:
SUM(from_amount)but the actual Drizzle column name is"fromAmount"(camelCase). Fixed 13 occurrences inrouters.ts+ 2 raw admin dashboard queries that also referencedcreated_at→"createdAt".source_country: "NG"for all senders regardless of currency. Now derives fromCURRENCY_TO_COUNTRY_ML[input.fromCurrency](CAD→CA, USD→US, GBP→GB, etc).HIGH — PIX/UPI corridors stuck in
partner_sentforever:server/payment-rail-webhooks.ts— POST/api/webhooks/pix(handles ACSC/RJCT/CANC) and POST/api/webhooks/upi(handles SUCCESS/FAILURE/DEEMED). Both look up the transaction viametadata->>'partnerReference'and calladvanceTransferState("completed").advanceTransferStatecall to the existing Mojaloop webhook handler (mojaloop.webhook.ts) which was missing it.MEDIUM — compliance blind spots:
CURRENCY_TO_JURISDICTION: BRL→BR, INR→IN, TZS→TZ, UGX→UG, XOF→SN, XAF→CM, MWK→MW, ZMW→ZM.LOW:
CORRIDOR_CONFIGSfrom 10 → 28 corridors (18 new: CA→NG/KE/GH/ZA/TZ/UG, US→KE/GH/ZA/BR/IN, UK→KE/GH/ZA, EU→KE/GH/ZA/BR).{ allowed: true, attemptsInWindow: 0 }→{ allowed: false, attemptsInWindow: maxAttempts }(fail-closed on DB errors).7 files changed, 347 insertions, 17 deletions. 0 TypeScript errors.
Link to Devin session: https://app.devin.ai/sessions/64d054ae77da41e9a2b74d8593fa635c
Requested by: @munisp