From 31fe3f6ca2aae3c43626219b77a1b69df552f670 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 21 Nov 2026 23:56:08 +0100 Subject: [PATCH] web-util: ask legal entities for their registered office in VQF 902.1 tops-kyx-check requires REGISTERED_OFFICE_ADDRESS from every legal entity, but the form stored the company's address as DOMICILE_ADDRESS, so each legal entity that filled it in was frozen. Issue: https://bugs.taler.net/n/12295 Assisted by LLM --- .../src/forms/gana/VQF_902_1_customer.test.ts | 46 +++++++++++++++++++ .../src/forms/gana/VQF_902_1_customer.ts | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/packages/web-util/src/forms/gana/VQF_902_1_customer.test.ts b/packages/web-util/src/forms/gana/VQF_902_1_customer.test.ts index 251257f0c..90d035a7e 100644 --- a/packages/web-util/src/forms/gana/VQF_902_1_customer.test.ts +++ b/packages/web-util/src/forms/gana/VQF_902_1_customer.test.ts @@ -41,3 +41,49 @@ test("company ownership upload uses VQF labels with registry clarification", () "Angaben über die Beteiligungsverhältnisse (Aktienregister oder Äquivalent)", ); }); + +/** + * The attributes the form asks for from a customer whose answers so far + * are @a root, at the top level of the form. + */ +function askedAttributes(root: Record): string[] { + setupI18n("en", {}); + const design = design_VQF_902_1_customer(i18n); + return design.sections + .filter((section) => !section.hide?.(root)) + .flatMap((section) => section.fields) + .filter((field) => !("hide" in field && field.hide?.(undefined, root))) + .flatMap((field) => ("id" in field ? [field.id] : [])); +} + +// taler-exchange-helper-measure-tops-kyx-check freezes the account if +// one of these is missing. +test("legal entities are asked for what tops-kyx-check requires", () => { + const asked = askedAttributes({ + [TalerFormAttributes.CUSTOMER_TYPE]: "LEGAL_ENTITY", + }); + for (const attribute of [ + TalerFormAttributes.COMPANY_NAME, + TalerFormAttributes.REGISTERED_OFFICE_ADDRESS, + TalerFormAttributes.LEGAL_ENTITY_IDENTIFICATION_DOCUMENT_COPY, + TalerFormAttributes.ESTABLISHER_LIST, + ]) { + assert.ok(asked.includes(attribute), attribute); + } +}); + +test("natural persons are asked for what tops-kyx-check requires", () => { + const asked = askedAttributes({ + [TalerFormAttributes.CUSTOMER_TYPE]: "NATURAL_PERSON", + }); + for (const attribute of [ + TalerFormAttributes.FULL_NAME, + TalerFormAttributes.DOMICILE_ADDRESS, + TalerFormAttributes.DATE_OF_BIRTH, + TalerFormAttributes.NATIONALITY, + TalerFormAttributes.PERSONAL_IDENTIFICATION_DOCUMENT_COPY, + TalerFormAttributes.CUSTOMER_IS_SOLE_PROPRIETOR, + ]) { + assert.ok(asked.includes(attribute), attribute); + } +}); diff --git a/packages/web-util/src/forms/gana/VQF_902_1_customer.ts b/packages/web-util/src/forms/gana/VQF_902_1_customer.ts index 0af680ff9..d7b49bb11 100644 --- a/packages/web-util/src/forms/gana/VQF_902_1_customer.ts +++ b/packages/web-util/src/forms/gana/VQF_902_1_customer.ts @@ -289,7 +289,7 @@ export function design_VQF_902_1_customer( required: true, }, { - id: TalerFormAttributes.DOMICILE_ADDRESS, + id: TalerFormAttributes.REGISTERED_OFFICE_ADDRESS, label: i18n.fixed({ en: "Domicile", de: "Sitz" }), type: "textArea", required: true, -- 2.47.3