commit 211b157842bb97a3078d9c75680631764d6c0898
parent 30e34dfd2dbc6ccb209253c22256e57174ae84c9
Author: Sebastian <sebasjm@gmail.com>
Date: Sun, 4 May 2025 18:42:00 -0300
fix #9863
Diffstat:
7 files changed, 294 insertions(+), 0 deletions(-)
diff --git a/packages/web-util/src/forms/gana/VQF_902_11_officer.ts b/packages/web-util/src/forms/gana/VQF_902_11_officer.ts
@@ -133,6 +133,7 @@ export function VQF_902_11_officer(
placeholder: "dd/MM/yyyy",
pattern: "dd/MM/yyyy",
required: true,
+ disabled: true,
},
],
},
diff --git a/packages/web-util/src/forms/gana/VQF_902_9.ts b/packages/web-util/src/forms/gana/VQF_902_9.ts
@@ -45,6 +45,9 @@ export function VQF_902_9(
},
{
title: "Identity of the contracting partner",
+ hide(root) {
+ return !root[TalerFormAttributes.SUBMITTED_BY];
+ },
fields: [
{
id: TalerFormAttributes.IDENTITY_CONTRACTING_PARTNER,
@@ -56,6 +59,9 @@ export function VQF_902_9(
},
{
title: i18n.str`Beneficial owner details`,
+ hide(root) {
+ return !root[TalerFormAttributes.SUBMITTED_BY];
+ },
fields: [
{
id: TalerFormAttributes.IDENTITY_LIST,
@@ -126,6 +132,7 @@ export function VQF_902_9(
placeholder: "dd/MM/yyyy",
pattern: "dd/MM/yyyy",
required: true,
+ disabled: true,
},
],
},
diff --git a/packages/web-util/src/forms/gana/VQF_902_9_customer.stories.tsx b/packages/web-util/src/forms/gana/VQF_902_9_customer.stories.tsx
@@ -0,0 +1,35 @@
+/*
+ This file is part of GNU Taler
+ (C) 2022 Taler Systems S.A.
+
+ GNU Taler is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+/**
+ *
+ * @author Sebastian Javier Marchano (sebasjm)
+ */
+
+import { i18n, setupI18n } from "@gnu-taler/taler-util";
+import * as tests from "../../tests/hook.js";
+import { DefaultForm as TestedComponent } from "../forms-ui.js";
+import { VQF_902_9_customer } from "./VQF_902_9_customer.js";
+export default {
+ title: "vqf_902_9_customer",
+};
+
+setupI18n("en", {});
+
+export const EmptyForm = tests.createExample(TestedComponent, {
+ initial: {},
+ design: VQF_902_9_customer(i18n),
+});
diff --git a/packages/web-util/src/forms/gana/VQF_902_9_customer.ts b/packages/web-util/src/forms/gana/VQF_902_9_customer.ts
@@ -0,0 +1,111 @@
+import { TalerFormAttributes } from "@gnu-taler/taler-util";
+import {
+ DoubleColumnFormDesign,
+ FormMetadata,
+ InternationalizationAPI,
+} from "../../index.browser.js";
+import { countryNationalityList } from "../../utils/select-ui-lists.js";
+
+export const form_vqf_902_9_customer = (
+ i18n: InternationalizationAPI,
+): FormMetadata => ({
+ label: i18n.str`Declaration of identity of the beneficial owner (A)`,
+ id: "vqf_902_9_customer",
+ version: 1,
+ config: VQF_902_9_customer(i18n),
+});
+
+export function VQF_902_9_customer(
+ i18n: InternationalizationAPI,
+): DoubleColumnFormDesign {
+ return {
+ type: "double-column",
+ title: i18n.str`Declaration of identity of the beneficial owner`,
+ sections: [
+ {
+ title: "Identity of the contracting partner",
+ fields: [
+ {
+ id: TalerFormAttributes.IDENTITY_CONTRACTING_PARTNER,
+ label: i18n.str`Contracting partner`,
+ type: "textArea",
+ required: true,
+ },
+ ],
+ },
+ {
+ title: i18n.str`Beneficial owner details`,
+ fields: [
+ {
+ id: TalerFormAttributes.IDENTITY_LIST,
+ label: i18n.str`Beneficial owner(s)`,
+ help: i18n.str`The person(s) listed below is/are the beneficial owner(s) of the assets involved in the business relationship. If the contracting partner is also the sole beneficial owner of the assets, the contracting partner's detail must be set out below`,
+ type: "array",
+ validator(persons) {
+ if (!persons || persons.length < 1) {
+ return i18n.str`Can't be empty`;
+ }
+ return undefined;
+ },
+ labelFieldId: TalerFormAttributes.FULL_NAME,
+ fields: [
+ {
+ id: TalerFormAttributes.FULL_NAME,
+ label: i18n.str`Full name`,
+ type: "text",
+ required: true,
+ },
+ {
+ id: TalerFormAttributes.DOMICILE_ADDRESS,
+ label: i18n.str`Domicile address`,
+ type: "textArea",
+ required: true,
+ },
+ {
+ id: TalerFormAttributes.DATE_OF_BIRTH,
+ label: i18n.str`Date of birth`,
+ type: "isoDateText",
+ placeholder: "dd/MM/yyyy",
+ pattern: "dd/MM/yyyy",
+ required: true,
+ },
+ {
+ id: TalerFormAttributes.NATIONALITY,
+ label: i18n.str`Nationality`,
+ type: "selectOne",
+ choices: countryNationalityList(i18n),
+ required: true,
+ },
+ ],
+ required: false,
+ },
+ ],
+ },
+ {
+ title: i18n.str`Signature(s)`,
+ description: i18n.str`It is a criminal offence to deliberately provide false information on this form (article 251 of the Swiss Criminal Code, documents forgery)`,
+ fields: [
+ {
+ type: "caption",
+ label: i18n.str`The contracting partner hereby undertakes to inform automatically of any changes to the information contained herein.`,
+ },
+ {
+ id: TalerFormAttributes.SIGNATURE,
+ label: i18n.str`Signature(s)`,
+ type: "text",
+ required: true,
+ },
+ {
+ id: TalerFormAttributes.SIGN_DATE,
+ label: i18n.str`Date`,
+ type: "absoluteTimeText",
+ placeholder: "dd/MM/yyyy",
+ pattern: "dd/MM/yyyy",
+ required: true,
+ disabled: true,
+ },
+ ],
+ },
+ ],
+ };
+}
diff --git a/packages/web-util/src/forms/gana/VQF_902_9_officer.stories.tsx b/packages/web-util/src/forms/gana/VQF_902_9_officer.stories.tsx
@@ -0,0 +1,35 @@
+/*
+ This file is part of GNU Taler
+ (C) 2022 Taler Systems S.A.
+
+ GNU Taler is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+/**
+ *
+ * @author Sebastian Javier Marchano (sebasjm)
+ */
+
+import { i18n, setupI18n } from "@gnu-taler/taler-util";
+import * as tests from "../../tests/hook.js";
+import { DefaultForm as TestedComponent } from "../forms-ui.js";
+import { VQF_902_9_officer } from "./VQF_902_9_officer.js";
+export default {
+ title: "VQF_902_9_officer",
+};
+
+setupI18n("en", {});
+
+export const EmptyForm = tests.createExample(TestedComponent, {
+ initial: {},
+ design: VQF_902_9_officer(i18n),
+});
diff --git a/packages/web-util/src/forms/gana/VQF_902_9_officer.ts b/packages/web-util/src/forms/gana/VQF_902_9_officer.ts
@@ -0,0 +1,103 @@
+import { TalerFormAttributes } from "@gnu-taler/taler-util";
+import {
+ DoubleColumnFormDesign,
+ FormMetadata,
+ InternationalizationAPI,
+} from "../../index.browser.js";
+import { countryNationalityList } from "../../utils/select-ui-lists.js";
+
+export const form_vqf_902_9_officer = (
+ i18n: InternationalizationAPI,
+): FormMetadata => ({
+ label: i18n.str`Declaration of identity of the beneficial owner (A)`,
+ id: "vqf_902_9_officer",
+ version: 1,
+ config: VQF_902_9_officer(i18n),
+});
+
+export function VQF_902_9_officer(
+ i18n: InternationalizationAPI,
+): DoubleColumnFormDesign {
+ return {
+ type: "double-column",
+ title: i18n.str`Declaration of identity of the beneficial owner`,
+ sections: [
+ {
+ title: "Identity of the contracting partner",
+ fields: [
+ {
+ id: TalerFormAttributes.IDENTITY_CONTRACTING_PARTNER,
+ label: i18n.str`Contracting partner`,
+ type: "textArea",
+ required: true,
+ },
+ ],
+ },
+ {
+ title: i18n.str`Beneficial owner details`,
+ fields: [
+ {
+ id: TalerFormAttributes.IDENTITY_LIST,
+ label: i18n.str`Beneficial owner(s)`,
+ help: i18n.str`The person(s) listed below is/are the beneficial owner(s) of the assets involved in the business relationship. If the contracting partner is also the sole beneficial owner of the assets, the contracting partner's detail must be set out below`,
+ type: "array",
+ validator(persons) {
+ if (!persons || persons.length < 1) {
+ return i18n.str`Can't be empty`;
+ }
+ return undefined;
+ },
+ labelFieldId: TalerFormAttributes.FULL_NAME,
+ fields: [
+ {
+ id: TalerFormAttributes.FULL_NAME,
+ label: i18n.str`Full name`,
+ type: "text",
+ required: true,
+ },
+ {
+ id: TalerFormAttributes.DOMICILE_ADDRESS,
+ label: i18n.str`Domicile address`,
+ type: "textArea",
+ required: true,
+ },
+ {
+ id: TalerFormAttributes.DATE_OF_BIRTH,
+ label: i18n.str`Date of birth`,
+ type: "isoDateText",
+ placeholder: "dd/MM/yyyy",
+ pattern: "dd/MM/yyyy",
+ required: true,
+ },
+ {
+ id: TalerFormAttributes.NATIONALITY,
+ label: i18n.str`Nationality`,
+ type: "selectOne",
+ choices: countryNationalityList(i18n),
+ required: true,
+ },
+ ],
+ required: false,
+ },
+ ],
+ },
+ {
+ title: i18n.str`Signed Declaration`,
+ description: i18n.str`Signed declaration by the customer`,
+ fields: [
+ {
+ type: "caption",
+ label: i18n.str`The uploaded document must contain the customer's signature on the beneficial owner declaration.`,
+ },
+ {
+ id: TalerFormAttributes.ATTACHMENT_SIGNED_DOCUMENT,
+ label: i18n.str`Signed Document`,
+ type: "file",
+ accept: "application/pdf",
+ required: true,
+ },
+ ],
+ },
+ ],
+ };
+}
diff --git a/packages/web-util/src/forms/gana/index.stories.ts b/packages/web-util/src/forms/gana/index.stories.ts
@@ -10,3 +10,5 @@ export * as vqf_902_1_officer_stories from "./VQF_902_1_officer.stories.js";
export * as vqf_902_4_stories from "./VQF_902_4.stories.js";
export * as vqf_902_5_stories from "./VQF_902_5.stories.js";
export * as vqf_902_9_stories from "./VQF_902_9.stories.js";
+export * as vqf_902_9_officer_stories from "./VQF_902_9_officer.stories.js";
+export * as vqf_902_9_customer_stories from "./VQF_902_9_customer.stories.js";