Repository navigation
fix(aml): fail closed when investor has no legal name for sanctions screening - #1351
Conversation
|
@devvalentine 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! 🚀 |
153c59b to
f1fe109
Compare
|
Security check: this PR contains malware (the PolinRider campaign) and can't be merged as it is. Our automated scan flagged these files on your branch:
These changes are not part of your fix. They hide code that runs automatically on the machine of anyone who opens or installs the project (padded/obfuscated code in config files, Please:
Thanks! |
Strips the payload this branch picked up (deleted api.js, unhooked package.json). No functional change to the branch's own work.
Overview
This PR makes sanctions screening fail closed when an investor has no legal name on file. Previously,
InvestmentService.resolveInvestorNameandRuleEvaluator.evaluateSanctionsRulefell back to the investor UUID, which can never match an OFAC/EU/UK list entry — silently clearing screening and persisting investments asscreening_status: 'passed'. With this change, a missing legal name is treated as incomplete screening: the investment is blocked and the sanctions rule returns a triggeredpending_reviewresult.Related Issue
Changes
🛡️ Investment Service — fail-closed name resolution
src/services/investmentService.tsresolveInvestorNamenow returnsnullwhen no legal name is available instead of falling back to the investor UUID.createInvestmenttreats anullname as incomplete screening: records the block viarecordScreenBlockedand throws a service-unavailable / validation error. The UUID is never screened.⚖️ Rule Evaluator — no UUID fallback
src/aml/ruleEvaluator.tsevaluateSanctionsRuleno longer falls back tocontext.investor_id.investor_nameis missing, returns a triggeredpending_reviewresult with reasonmissing_investor_name.🧪 Tests
[MODIFY]
src/services/investmentService.test.tsmaster).[MODIFY]
src/aml/ruleEvaluator.test.tsevaluateSanctionsRulereturning a triggeredpending_reviewwith reasonmissing_investor_namewheninvestor_nameis absent.Verification Results
nameand no beneficial owners cannot create an investment; response says screening is incompletecreateInvestmentthrows afterrecordScreenBlockedinvestmentService.test.tsandruleEvaluator.test.tsfor both pathsmaster, blocked after fixCloses #1262