taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit e7613b0d7f3c517f10f82c246d5d743ea3a14558
parent 054d62aeaccee74854a881a774cefa034e9a0b59
Author: Florian Dold <dold@taler.net>
Date:   Mon, 20 Jul 2026 20:48:32 +0200

util: test the AML investigation state derivation

Diffstat:
Mpackages/taler-util/src/aml/properties.test.ts | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+), 0 deletions(-)

diff --git a/packages/taler-util/src/aml/properties.test.ts b/packages/taler-util/src/aml/properties.test.ts @@ -57,3 +57,55 @@ test("AML prop derivation for TOPS, vqf_902_1_officer", (t) => { }); } }); + +// The permitted values of INCRISK_RESULT are fixed by the GANA registry: +// 'NO_SUSPICION' | 'REASONABLE_SUSPICION' | 'SIMPLE_SUSPICION' | 'OTHER'. +// REASONABLE_SUSPICION is the "Begruendeter Verdacht nach Art. 9 GwG" case that +// carries a statutory duty to notify MROS, so it must derive an investigation +// state -- otherwise the report is never counted. +test("AML prop derivation for TOPS, vqf_902_14 investigation state", (t) => { + assert.deepStrictEqual( + deriveTopsAmlProperties( + "vqf_902_14", + { [TalerFormAttributes.INCRISK_RESULT]: "REASONABLE_SUSPICION" }, + {}, + ), + { + [TalerAmlProperties.INVESTIGATION_STATE]: + "REPORTED_SUSPICION_SUBSTANTIATED", + }, + ); + + assert.deepStrictEqual( + deriveTopsAmlProperties( + "vqf_902_14", + { [TalerFormAttributes.INCRISK_RESULT]: "SIMPLE_SUSPICION" }, + {}, + ), + { + [TalerAmlProperties.INVESTIGATION_STATE]: "REPORTED_SUSPICION_SIMPLE", + }, + ); + + assert.deepStrictEqual( + deriveTopsAmlProperties( + "vqf_902_14", + { [TalerFormAttributes.INCRISK_RESULT]: "NO_SUSPICION" }, + {}, + ), + { + [TalerAmlProperties.INVESTIGATION_STATE]: + "INVESTIGATION_COMPLETED_WITHOUT_SUSPICION", + }, + ); + + // Not a value the registry defines; must not derive anything. + assert.deepStrictEqual( + deriveTopsAmlProperties( + "vqf_902_14", + { [TalerFormAttributes.INCRISK_RESULT]: "SUBSTANTIATED_SUSPICION" }, + {}, + ), + {}, + ); +});