commit ebb5cc274a51020004e247848eeba558f6add5f5
parent d35ff8eaea3975c84fa4585513596b9ecbe9091a
Author: Florian Dold <dold@taler.net>
Date: Tue, 21 Jul 2026 11:11:03 +0200
util: test AML events for the first decision on an account
Diffstat:
1 file changed, 21 insertions(+), 0 deletions(-)
diff --git a/packages/taler-util/src/aml/events.test.ts b/packages/taler-util/src/aml/events.test.ts
@@ -109,3 +109,24 @@ test("AML event derivation for TOPS, vqf_902_4", (t) => {
assert.deepStrictEqual([...events], ["DECR_PEP", "DECR_PEP_FOREIGN"]);
}
});
+
+test("AML event derivation for TOPS, first decision on an account", (t) => {
+ // An account with no previous AML decision has no properties yet. The
+ // specification's precondition is INVESTIGATION_STATE == null, which covers
+ // that case, so a report filed on such an account must still be counted.
+ const events = deriveTopsAmlEvents(
+ "vqf_902_14_officer",
+ {},
+ undefined as any,
+ {
+ INVESTIGATION_STATE: "REPORTED_SUSPICION_SUBSTANTIATED",
+ },
+ );
+ assert.deepStrictEqual(
+ [...events].sort(),
+ [
+ "INCR_INVESTIGATION_CONCLUDED",
+ "MROS_REPORTED_SUSPICION_SUBSTANTIATED",
+ ].sort(),
+ );
+});