commit 23c42e568d3a9cc75f8fff1e7b9c83b447fd859f
parent c9ce45dbb27e278b364cadc9842e7d586edf220a
Author: Florian Dold <florian@dold.me>
Date: Sun, 6 Apr 2025 23:11:14 +0200
forms: put form metadata next to form
Diffstat:
11 files changed, 121 insertions(+), 97 deletions(-)
diff --git a/packages/aml-backoffice-ui/src/forms/index.ts b/packages/aml-backoffice-ui/src/forms/index.ts
@@ -14,61 +14,27 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
import {
- design_VQF_902_1_customer,
+ form_generic_note,
+ form_vqf_902_11,
+ form_vqf_902_14,
form_vqf_902_1_customer,
- VQF_902_11,
- VQF_902_14,
- VQF_902_1_officer,
- VQF_902_4,
- VQF_902_5,
- VQF_902_9,
+ form_vqf_902_1_officer,
+ form_vqf_902_4,
+ form_vqf_902_5,
+ form_vqf_902_9,
type FormMetadata,
type InternationalizationAPI,
} from "@gnu-taler/web-util/browser";
-import { v1 as simplest } from "./simplest.js";
export const preloadedForms: (
i18n: InternationalizationAPI,
) => Array<FormMetadata> = (i18n) => [
form_vqf_902_1_customer(i18n),
- {
- label: i18n.str`Identification Form (acceptance)`,
- description: i18n.str`The customer has to be identified on entering into a permanent business relationship or on concluding a cash transaction, which meets the according threshold.`,
- id: "vqf_902_1_officer",
- version: 1,
- config: VQF_902_1_officer(i18n),
- },
- {
- label: i18n.str`Risk Profile AMLA`,
- id: "vqf_902_4",
- version: 1,
- config: VQF_902_4(i18n),
- },
- {
- label: i18n.str`Customer Profile`,
- description: i18n.str`The information below has to refer to the persons from whom the assets originate ultimately (e.g. beneficial owner of the assets, founder/creator of a trust or foundation). Is the customer an operational legal entity or partnership the information may refer to the entity itself (not to the controlling person), unless the entity holds the assets in trust for a third party.`,
- id: "vqf_902_5",
- version: 1,
- config: VQF_902_5(i18n),
- },
- {
- label: i18n.str`Declaration of identity of the beneficial owner (A)`,
- id: "vqf_902_9",
- version: 1,
- config: VQF_902_9(i18n),
- },
- {
- label: i18n.str`Establishing of the controlling person of operating legal entities and partnerships both not quoted on the stock exchange (K)`,
- description: i18n.str`for operating legal entities and partnerships that are contracting partner as well as analogously for operating legal entities and partnership that are beneficial owners`,
- id: "vqf_902_11",
- version: 1,
- config: VQF_902_11(i18n),
- },
- {
- label: i18n.str`Special Clarifications`,
- description: i18n.str`When a business relationship or transaction is associated with increased risk, appears unusual or evidence exists that the assets are the proceeds of a felony or a qualified tax offence, the member has to perform additional clarifications.`,
- id: "vqf_902_14",
- version: 1,
- config: VQF_902_14(i18n),
- },
+ form_vqf_902_1_officer(i18n),
+ form_vqf_902_4(i18n),
+ form_vqf_902_5(i18n),
+ form_vqf_902_9(i18n),
+ form_vqf_902_11(i18n),
+ form_vqf_902_14(i18n),
+ form_generic_note(i18n),
];
diff --git a/packages/kyc-ui/src/forms/index.ts b/packages/kyc-ui/src/forms/index.ts
@@ -15,18 +15,23 @@
*/
import {
+ AcceptTermOfServiceContext,
+ acceptTos,
+ form_generic_note,
+ form_vqf_902_11,
+ form_vqf_902_14,
form_vqf_902_1_customer,
+ form_vqf_902_1_officer,
+ form_vqf_902_4,
+ form_vqf_902_5,
+ form_vqf_902_9,
FormMetadata,
GLS_Onboarding,
InternationalizationAPI,
- acceptTos,
- AcceptTermOfServiceContext
} from "@gnu-taler/web-util/browser";
import { nameAndDob } from "./nameAndBirthdate.js";
import { simplest } from "./simplest.js";
-const TALER_SCREEN_ID = 105;
-
export const preloadedForms: (
i18n: InternationalizationAPI,
context: object | undefined,
@@ -49,44 +54,18 @@ export const preloadedForms: (
version: 1,
config: GLS_Onboarding(i18n),
},
- form_vqf_902_1_customer(i18n),
- // {
- // label: i18n.str`Risk Profile AMLA`,
- // id: "vqf_902_4",
- // version: 1,
- // config: VQF_902_4(i18n),
- // },
- // {
- // label: i18n.str`Customer Profile`,
- // description: i18n.str`The information below has to refer to the persons from whom the assets originate ultimately (e.g. beneficial owner of the assets, founder/creator of a trust or foundation). Is the customer an operational legal entity or partnership the information may refer to the entity itself (not to the controlling person), unless the entity holds the assets in trust for a third party.`,
- // id: "vqf_902_5",
- // version: 1,
- // config: VQF_902_5(i18n),
- // },
- // {
- // label: i18n.str`Declaration of identity of the beneficial owner (A)`,
- // id: "vqf_902_9",
- // version: 1,
- // config: VQF_902_9(i18n),
- // },
- // {
- // label: i18n.str`Establishing of the controlling person of operating legal entities and partnerships both not quoted on the stock exchange (K)`,
- // description: i18n.str`for operating legal entities and partnerships that are contracting partner as well as analogously for operating legal entities and partnership that are beneficial owners`,
- // id: "vqf_902_11",
- // version: 1,
- // config: VQF_902_11(i18n),
- // },
- // {
- // label: i18n.str`Special Clarifications`,
- // description: i18n.str`When a business relationship or transaction is associated with increased risk, appears unusual or evidence exists that the assets are the proceeds of a felony or a qualified tax offence, the member has to perform additional clarifications.`,
- // id: "vqf_902_14",
- // version: 1,
- // config: VQF_902_14(i18n),
- // },
{
label: i18n.str`Name and birthdate`,
id: "name_and_dob",
version: 1,
config: nameAndDob(i18n),
},
+ form_vqf_902_1_customer(i18n),
+ form_vqf_902_1_officer(i18n),
+ form_vqf_902_4(i18n),
+ form_vqf_902_5(i18n),
+ form_vqf_902_9(i18n),
+ form_vqf_902_11(i18n),
+ form_vqf_902_14(i18n),
+ form_generic_note(i18n),
];
diff --git a/packages/web-util/src/forms/gana/VQF_902_11.ts b/packages/web-util/src/forms/gana/VQF_902_11.ts
@@ -1,8 +1,20 @@
+import { TalerFormAttributes } from "@gnu-taler/taler-util";
import {
DoubleColumnFormDesign,
+ FormMetadata,
InternationalizationAPI,
} from "../../index.browser.js";
-import { TalerFormAttributes } from "@gnu-taler/taler-util";
+
+export const form_vqf_902_11 = (
+ i18n: InternationalizationAPI,
+): FormMetadata => ({
+ label: i18n.str`Establishing of the controlling person of operating legal entities and partnerships both not quoted on the stock exchange (K)`,
+ description: i18n.str`for operating legal entities and partnerships that are contracting partner as well as analogously for operating legal entities and partnership that are beneficial owners`,
+ id: "vqf_902_11",
+ version: 1,
+ config: VQF_902_11(i18n),
+});
+
export function VQF_902_11(
i18n: InternationalizationAPI,
): DoubleColumnFormDesign {
diff --git a/packages/web-util/src/forms/gana/VQF_902_14.ts b/packages/web-util/src/forms/gana/VQF_902_14.ts
@@ -1,8 +1,19 @@
+import { TalerFormAttributes } from "@gnu-taler/taler-util";
import {
DoubleColumnFormDesign,
+ FormMetadata,
InternationalizationAPI,
} from "../../index.browser.js";
-import { TalerFormAttributes } from "@gnu-taler/taler-util";
+
+export const form_vqf_902_14 = (
+ i18n: InternationalizationAPI,
+): FormMetadata => ({
+ label: i18n.str`Special Clarifications`,
+ description: i18n.str`When a business relationship or transaction is associated with increased risk, appears unusual or evidence exists that the assets are the proceeds of a felony or a qualified tax offence, the member has to perform additional clarifications.`,
+ id: "vqf_902_14",
+ version: 1,
+ config: VQF_902_14(i18n),
+});
export function VQF_902_14(
i18n: InternationalizationAPI,
diff --git a/packages/web-util/src/forms/gana/VQF_902_1_officer.ts b/packages/web-util/src/forms/gana/VQF_902_1_officer.ts
@@ -14,12 +14,23 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
+import { TalerFormAttributes } from "@gnu-taler/taler-util";
import { format } from "date-fns";
import {
DoubleColumnFormDesign,
+ FormMetadata,
InternationalizationAPI,
} from "../../index.browser.js";
-import { TalerFormAttributes } from "@gnu-taler/taler-util";
+
+export const form_vqf_902_1_officer = (
+ i18n: InternationalizationAPI,
+): FormMetadata => ({
+ label: i18n.str`Identification Form (acceptance)`,
+ description: i18n.str`The customer has to be identified on entering into a permanent business relationship or on concluding a cash transaction, which meets the according threshold.`,
+ id: "vqf_902_1_officer",
+ version: 1,
+ config: VQF_902_1_officer(i18n),
+});
/**
* Design of the vqf_902_1_officer form.
diff --git a/packages/web-util/src/forms/gana/VQF_902_4.ts b/packages/web-util/src/forms/gana/VQF_902_4.ts
@@ -1,8 +1,18 @@
+import { TalerFormAttributes } from "@gnu-taler/taler-util";
import {
DoubleColumnFormDesign,
+ FormMetadata,
InternationalizationAPI,
} from "../../index.browser.js";
-import { TalerFormAttributes } from "@gnu-taler/taler-util";
+
+export const form_vqf_902_4 = (
+ i18n: InternationalizationAPI,
+): FormMetadata => ({
+ label: i18n.str`Risk Profile AMLA`,
+ id: "vqf_902_4",
+ version: 1,
+ config: VQF_902_4(i18n),
+});
export function VQF_902_4(
i18n: InternationalizationAPI,
diff --git a/packages/web-util/src/forms/gana/VQF_902_5.ts b/packages/web-util/src/forms/gana/VQF_902_5.ts
@@ -1,9 +1,20 @@
import {
DoubleColumnFormDesign,
+ FormMetadata,
InternationalizationAPI,
} from "../../index.browser.js";
import { TalerFormAttributes } from "@gnu-taler/taler-util";
+export const form_vqf_902_5 = (
+ i18n: InternationalizationAPI,
+): FormMetadata => ({
+ label: i18n.str`Customer Profile`,
+ description: i18n.str`The information below has to refer to the persons from whom the assets originate ultimately (e.g. beneficial owner of the assets, founder/creator of a trust or foundation). Is the customer an operational legal entity or partnership the information may refer to the entity itself (not to the controlling person), unless the entity holds the assets in trust for a third party.`,
+ id: "vqf_902_5",
+ version: 1,
+ config: VQF_902_5(i18n),
+});
+
export function VQF_902_5(
i18n: InternationalizationAPI,
): DoubleColumnFormDesign {
diff --git a/packages/web-util/src/forms/gana/VQF_902_9.ts b/packages/web-util/src/forms/gana/VQF_902_9.ts
@@ -1,9 +1,19 @@
+import { TalerFormAttributes } from "@gnu-taler/taler-util";
import {
DoubleColumnFormDesign,
+ FormMetadata,
InternationalizationAPI,
} from "../../index.browser.js";
import { countryNationalityList } from "../../utils/select-ui-lists.js";
-import { TalerFormAttributes } from "@gnu-taler/taler-util";
+
+export const form_vqf_902_9 = (
+ i18n: InternationalizationAPI,
+): FormMetadata => ({
+ label: i18n.str`Declaration of identity of the beneficial owner (A)`,
+ id: "vqf_902_9",
+ version: 1,
+ config: VQF_902_9(i18n),
+});
export function VQF_902_9(
i18n: InternationalizationAPI,
diff --git a/packages/web-util/src/forms/gana/generic_note.stories.tsx b/packages/web-util/src/forms/gana/generic_note.stories.tsx
@@ -22,13 +22,13 @@
import { i18n, setupI18n } from "@gnu-taler/taler-util";
import * as tests from "../../tests/hook.js";
import { DefaultForm } from "../forms-ui.js";
-import { form_generic_note } from "./generic_note.js";
+import { design_generic_note } from "./generic_note.js";
setupI18n("en", {});
export const EmptyForm = tests.createExample(DefaultForm, {
initial: {},
- design: form_generic_note(i18n),
+ design: design_generic_note(i18n),
});
export default { title: "generic_note" };
diff --git a/packages/web-util/src/forms/gana/generic_note.ts b/packages/web-util/src/forms/gana/generic_note.ts
@@ -14,17 +14,28 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
+import { TalerFormAttributes } from "@gnu-taler/taler-util";
import { format } from "date-fns";
import {
DoubleColumnFormDesign,
+ FormMetadata,
InternationalizationAPI,
} from "../../index.browser.js";
-import { TalerFormAttributes } from "@gnu-taler/taler-util";
+
+export const form_generic_note = (
+ i18n: InternationalizationAPI,
+): FormMetadata => ({
+ label: i18n.str`Generic note`,
+ description: i18n.str`Free-form, generic note`,
+ id: "generic_note",
+ version: 1,
+ config: design_generic_note(i18n),
+});
/**
- * Design of the vqf_902_1_officer form.
+ * Design of the generic note form.
*/
-export function form_generic_note(
+export function design_generic_note(
i18n: InternationalizationAPI,
): DoubleColumnFormDesign {
const today = format(new Date(), "yyyy-MM-dd");
diff --git a/packages/web-util/src/forms/index.ts b/packages/web-util/src/forms/index.ts
@@ -19,6 +19,9 @@ export * from "./fields/InputToggle.js";
export * from "./FormProvider.js";
export * from "./forms-types.js";
export * from "./forms-ui.js";
+
+export * from "./gana/accept-tos.js";
+export * from "./gana/generic_note.js";
export * from "./gana/GLS_Onboarding.js";
export * from "./gana/VQF_902_11.js";
export * from "./gana/VQF_902_14.js";
@@ -27,7 +30,7 @@ export * from "./gana/VQF_902_1_officer.js";
export * from "./gana/VQF_902_4.js";
export * from "./gana/VQF_902_5.js";
export * from "./gana/VQF_902_9.js";
-export * from "./gana/accept-tos.js";
+
export * from "./Group.js";
export * from "./HtmlIframe.js";
export * from "./TimePicker.js";