Feat/aml monitoring#472
Open
Kenlachy wants to merge 3 commits into
Open
Conversation
- Register AML routes in main application (src/index.ts) - Add comprehensive test coverage for AML repositories and routes - amlAlertRepository.test.ts: 92.2% coverage - amlRuleRepository.test.ts: 97.77% coverage - amlRoutes.test.ts: 79.36% coverage - Add detailed documentation (src/docs/aml-monitoring.md) - Total: 89 passing tests with 92.55% AML module coverage Implements rule-based transaction monitoring with: - Velocity, structuring, geo-mismatch, and amount_threshold rules - Semver versioning with rollback capability - Case management workflow (open/assign/investigating/closed/dismissed) - Full audit logging for regulatory compliance
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.
AML Transaction Monitoring with Case Management Workflow
Overview
Implements regulatory compliance AML transaction monitoring with configurable rules (velocity, structuring, geo-mismatch) and a case-management workflow for analysts to review flagged events.
Implementation Details
Core Components
Rule Engine (
src/aml/ruleEvaluator.ts)Rule Management (
src/aml/amlRuleRepository.ts)aml_rule_version_historytableAlert Management (
src/aml/amlAlertRepository.ts)Case Management (
src/aml/amlAlertRepository.ts)Service Layer (
src/aml/amlService.ts)REST API (src/routes/amlRoutes.ts)
Database Schema
Created 4 new tables in
src/db/migrations/001_aml_tables.sql:aml_rules- Rule definitions with semver versioningaml_rule_version_history- Complete audit trail for rule changesaml_alerts- Alerts generated from rule triggersaml_cases- Investigation cases for analyst workflowAll tables include proper indexes for performance and audit compliance.
Investment Pipeline Integration
Hooked AML evaluator into post-investment pipeline in
src/services/investmentService.ts:Security & Compliance
Rule Versioning
Audit Logging
Access Control
Data Privacy
Testing
Test Coverage
Comprehensive test suite with 89 tests (all passing):
Rule Evaluator Tests (src/aml/ruleEvaluator.test.ts) - 14 tests
AML Service Tests (
src/aml/amlService.test.ts) - 16 testsAML Rule Repository Tests (src/aml/amlRuleRepository.test.ts) - 16 tests
AML Alert Repository Tests (src/aml/amlAlertRepository.test.ts) - 17 tests
AML Routes Tests (src/routes/amlRoutes.test.ts) - 26 tests
Coverage Metrics
Running Tests
closes #431