Skip to content

Build transaction pre-compliance filter before provider send#1

Open
pchieneye wants to merge 1 commit into
mainfrom
feat/transaction-pre-compliance-filter
Open

Build transaction pre-compliance filter before provider send#1
pchieneye wants to merge 1 commit into
mainfrom
feat/transaction-pre-compliance-filter

Conversation

@pchieneye
Copy link
Copy Markdown
Owner

@pchieneye pchieneye commented Apr 28, 2026

Summary

Implements transaction pre-compliance filter that checks AML compliance before sending transactions to the mobile money provider.

What Changed

  • Created PreComplianceService to gate transactions through AML monitoring
  • Integrated pre-compliance check into worker transaction processing flow (before initiatePayment() and sendPayout() calls)
  • Non-compliant transactions are blocked and tagged with aml-flagged and compliance-blocked
  • Added AML alert deduplication by transaction ID to prevent duplicate records

Files Modified

  • src/compliance/preCompliance.ts - New PreComplianceService class
  • src/compliance/__tests__/preCompliance.test.ts - Unit tests (2 passing)
  • src/queue/worker.ts - Integrated pre-compliance gate
  • src/models/amlAlert.ts - Added findByTransactionId() deduplication method
  • src/services/aml.ts - Enhanced alert persistence with deduplication

Testing

  • Unit tests written and passing (2/2)
  • Pre-compliance check runs at transaction progress 20 for both deposit and withdraw flows
  • Blocked transactions are tagged and logged with compliance reasons in metadata

Closes sublime247#592

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[HARD] Build Transaction Pre-Compliance Filter

1 participant