mirror of
https://github.com/luxfi/aml.git
synced 2026-09-24 00:25:20 +00:00
f7ff1b6e4da5b59d7237811e1c52ae9f08696db6
The other half of the record. Cases and their timelines were two maps, so an investigation lasted until the pod did — and a case is the record that an alert was considered and what was decided, kept whichever way the decision went (AMLR Art. 77(1)(b); JMLSG 6.32). A rollout took the evidence of the work with it: who looked, what they found, what they concluded. Split the state onto a shelf, the way the retention ledger already is: one interface, a memory implementation for the tests, and a Base-backed one for what an instance serves from. Two collections, aml_cases and aml_case_events, declared as store.Kinds so every read is tenant-scoped and every write carries an org. Three things the maps got for free and the shelf has to earn, so each is asserted: the case number continues across a restart rather than starting again at one, which is what stops two cases sharing a number; Get is deliberately unscoped because the caller holding the id is the one that knows whose it should be, and putting the check in two places makes the second one the easy one to forget; and eviction still only removes cases closed longer ago than the window, so an open investigation is never dropped to make room. TestCasesSurviveARestart takes the bytes as they are on disk, drops the instance, opens a second one over them and asks for the case, its note and its author — then checks the other tenant still cannot read or write it, that the next case is number two, and that a resolution sticks. Full suite green under -race. Co-authored-by: Hanzo Dev <[email protected]>
Description
Real-time AML/CFT transaction monitoring, sanctions screening and case management
2.1 MiB
Languages
Go
88.1%
TypeScript
9.3%
CSS
1.2%
Python
0.7%
JavaScript
0.4%
Other
0.2%