taler-typescript-core

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

commit 84767cbffd2e535cb750f3e89fccd0ea5dac8488
parent 2bea57adb0c087ce2bf01e96f4ad999443d41a29
Author: Florian Dold <florian@dold.me>
Date:   Mon, 10 Mar 2025 12:56:27 +0100

split vqf-902.1 into two, not three forms

Diffstat:
Mpackages/aml-backoffice-ui/src/forms/index.ts | 8++++----
Dpackages/web-util/src/forms/gana/VQF_902_1_all.stories.tsx | 37-------------------------------------
Dpackages/web-util/src/forms/gana/VQF_902_1_all.ts | 518-------------------------------------------------------------------------------
Mpackages/web-util/src/forms/gana/VQF_902_1_customer.ts | 207+++++++++++++++++++++++++++++++------------------------------------------------
Mpackages/web-util/src/forms/gana/VQF_902_1_officer.ts | 4++--
Mpackages/web-util/src/forms/gana/index.stories.ts | 1-
Mpackages/web-util/src/forms/index.ts | 1-
7 files changed, 86 insertions(+), 690 deletions(-)

diff --git a/packages/aml-backoffice-ui/src/forms/index.ts b/packages/aml-backoffice-ui/src/forms/index.ts @@ -19,7 +19,7 @@ import { VQF_902_13, VQF_902_14, VQF_902_15, - VQF_902_1_all, + VQF_902_1_customer, VQF_902_1_officer, VQF_902_4, VQF_902_5, @@ -150,14 +150,14 @@ export const preloadedForms: ( config: simplest(i18n), }, { - label: i18n.str`Identification Form (full)`, + label: i18n.str`Identification Form (customer)`, 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", version: 1, - config: VQF_902_1_all(i18n), + config: VQF_902_1_customer(i18n), }, { - label: i18n.str`Identification Form (Only officer)`, + 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, diff --git a/packages/web-util/src/forms/gana/VQF_902_1_all.stories.tsx b/packages/web-util/src/forms/gana/VQF_902_1_all.stories.tsx @@ -1,37 +0,0 @@ -/* - 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_1_all } from "./VQF_902_1_all.js"; -export default { - title: "VQF_902_1e ALL fields", -}; - -setupI18n("en", {}); -type TargetObject = {}; -const initial: TargetObject = {}; - -export const EmptyForm = tests.createExample(TestedComponent, { - initial, - design: VQF_902_1_all(i18n), -}); diff --git a/packages/web-util/src/forms/gana/VQF_902_1_all.ts b/packages/web-util/src/forms/gana/VQF_902_1_all.ts @@ -1,518 +0,0 @@ -import { - DoubleColumnFormDesign, - InternationalizationAPI, -} from "../../index.browser.js"; -import { - countryNationalityList, - languageNameList, -} from "../../utils/select-ui-lists.js"; -import { TalerFormAttributes } from "./taler_form_attributes.js"; - -/** - * VQF_902_1 filled with all fieldsto be filled - * - * @returns - */ -export function VQF_902_1_all( - i18n: InternationalizationAPI, -): DoubleColumnFormDesign { - return { - type: "double-column", - sections: [ - { - title: i18n.str`Information on customer`, - description: i18n.str`The customer is the person with whom the member concludes the contract with regard to the financial service provided (civil law). Does the -member act as director of a domiciliary company, this domiciliary company is the customer.`, - fields: [ - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_INFO_TYPE.id, - label: i18n.str`Customer type`, - type: "choiceStacked", - choices: [ - { - value: "NATURAL_PERSON", - label: i18n.str`Natural person`, - }, - { - value: "LEGAL_ENTITY", - label: i18n.str`Legal entity`, - }, - ], - required: true, - }, - ], - }, - { - title: i18n.str`Information on customer`, - description: i18n.str`The customer is a natural person`, - hide(root) { - return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, - fields: [ - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_FULL_NAME.id, - label: i18n.str`Full name`, - type: "text", - required: true, - hide(value, root) { - return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, - }, - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_RESIDENTIAL.id, - label: i18n.str`Residential address`, - type: "textArea", - required: true, - hide(value, root) { - return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, - }, - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_PHONE.id, - label: i18n.str`Telephone`, - type: "text", - required: false, - hide(value, root) { - return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, - }, - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_EMAIL.id, - label: i18n.str`E-mail`, - type: "text", - required: false, - hide(value, root) { - return !!root && root["CUSTOMER_INFO"] !== "NATURAL_PERSON"; - }, - }, - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_BIRTHDATE.id, - label: i18n.str`Date of birth`, - type: "isoTimeText", - placeholder: "dd/MM/yyyy", - pattern: "dd/MM/yyyy", - required: true, - hide(value, root) { - return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, - }, - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_NATIONALITY.id, - label: i18n.str`Nationality`, - type: "selectOne", - choices: countryNationalityList(i18n), - required: true, - hide(value, root) { - return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, - }, - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_NATIONAL_ID.id, - label: i18n.str`Identification document`, - type: "file", - accept: "application/pdf", - required: true, - hide(value, root) { - return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, - }, - ], - }, - { - title: i18n.str`Information on customer (sole proprietor)`, - description: i18n.str`The customer is a sole proprietor`, - hide(root) { - return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, - fields: [ - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_COMPANY_NAME.id, - label: i18n.str`Company name`, - type: "text", - required: false, - hide(value, root) { - return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, - }, - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_REGISTERED_OFFICE - .id, - label: i18n.str`Registered office`, - type: "text", - required: false, - hide(value, root) { - return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, - }, - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_COMPANY_ID_DOC - .id, - label: i18n.str`Company identification document`, - type: "file", - required: false, - accept: "application/pdf", - hide(value, root) { - return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, - }, - ], - }, - { - title: i18n.str`Information on customer`, - description: i18n.str`The customer is a legal entity`, - hide(root) { - return !!root && root["CUSTOMER_INFO_TYPE"] !== "LEGAL_ENTITY"; - }, - fields: [ - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_COMPANY_NAME.id, - label: i18n.str`Company name`, - type: "text", - required: false, - hide(value, root) { - return !!root && root["CUSTOMER_INFO_TYPE"] !== "LEGAL_ENTITY"; - }, - }, - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_REGISTERED_OFFICE - .id, - label: i18n.str`Registered office`, - type: "text", - required: false, - hide(value, root) { - return !!root && root["CUSTOMER_INFO_TYPE"] !== "LEGAL_ENTITY"; - }, - }, - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_ENTITY_COMPANY_NAME.id, - label: i18n.str`Company name`, - type: "text", - required: true, - hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "LEGAL_ENTITY"; - }, - }, - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_ENTITY_ADDRESS.id, - label: i18n.str`Domicile`, - type: "textArea", - required: true, - hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "LEGAL_ENTITY"; - }, - }, - { - id: TalerFormAttributes.VQF_902_1 - .CUSTOMER_ENTITY_CONTACT_PERSON_NAME.id, - label: i18n.str`Contact person`, - type: "text", - required: false, - hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "LEGAL_ENTITY"; - }, - }, - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_ENTITY_PHONE.id, - label: i18n.str`Telephone`, - type: "text", - required: false, - hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "LEGAL_ENTITY"; - }, - }, - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_ENTITY_EMAIL.id, - label: i18n.str`E-mail`, - type: "text", - required: false, - hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "LEGAL_ENTITY"; - }, - }, - // { - // id: TalerFormAttributes.VQF_902_1.CUSTOMER_ENTITY_ID.id, - // label: i18n.str`Identification document`, - // type: "text", - // required: true, - // hide(value, root) { - // return !!root && root["CUSTOMER_TYPE"] !== "OPERATIONAL"; - // }, - // }, - { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_ENTITY_ID_COPY.id, - label: i18n.str`Copy of identification document`, - type: "file", - accept: "application/pdf", - required: true, - hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "LEGAL_ENTITY"; - }, - }, - ], - }, - { - title: i18n.str`Information on the natural persons who establish the business relationship for legal entities and partnerships`, - description: i18n.str`For legal entities and partnerships the identity of the natural persons who establish the business relationship must be verified.`, - hide(root) { - return !!root && root["CUSTOMER_TYPE"] !== "OPERATIONAL"; - }, - fields: [ - { - id: TalerFormAttributes.VQF_902_1.FOUNDER_LIST.id, - label: i18n.str`Founders`, - type: "array", - labelFieldId: - TalerFormAttributes.VQF_902_1_founder.FOUNDER_FULL_NAME.id, - fields: [ - { - id: TalerFormAttributes.VQF_902_1_founder.FOUNDER_FULL_NAME.id, - label: i18n.str`Full name`, - type: "text", - required: true, - }, - { - id: TalerFormAttributes.VQF_902_1_founder - .FOUNDER_RESIDENTIAL_ADDRESS.id, - label: i18n.str`Residential address`, - type: "textArea", - required: true, - }, - { - id: TalerFormAttributes.VQF_902_1_founder.FOUNDER_BIRTHDATE.id, - label: i18n.str`Date of birth`, - type: "isoTimeText", - placeholder: "dd/MM/yyyy", - pattern: "dd/MM/yyyy", - required: true, - }, - { - id: TalerFormAttributes.VQF_902_1_founder.FOUNDER_NATIONALITY - .id, - label: i18n.str`Nationality`, - type: "selectOne", - choices: countryNationalityList(i18n), - required: true, - }, - { - id: TalerFormAttributes.VQF_902_1_founder - .FOUNDER_AUTHORIZATION_TYPE.id, - label: i18n.str`Type of authorization`, - type: "text", - required: true, - }, - // { - // id: TalerFormAttributes.VQF_902_1_founder.FOUNDER_NATIONAL_ID - // .id, - // label: i18n.str`Identification document`, - // type: "text", - // required: true, - // }, - { - id: TalerFormAttributes.VQF_902_1_founder.FOUNDER_NATIONAL_COPY - .id, - label: i18n.str`Copy of identification document`, - type: "file", - accept: "application/pdf", - - required: true, - }, - { - id: TalerFormAttributes.VQF_902_1_founder - .FOUNDER_POWER_OF_ATTORNEY.id, - label: i18n.str`Power of attorney arrangements`, - type: "choiceStacked", - choices: [ - { - value: "CR", - label: i18n.str`CR extract`, - }, - { - value: "MANDATE", - label: i18n.str`Mandate`, - }, - ], - required: true, - }, - ], - required: true, - }, - ], - }, - { - title: i18n.str`Acceptance of business relationship`, - fields: [ - { - id: TalerFormAttributes.VQF_902_1.ACCEPTANCE_DATE.id, - label: i18n.str`Date`, - type: "isoTimeText", - placeholder: "dd/MM/yyyy", - pattern: "dd/MM/yyyy", - required: false, - }, - { - id: TalerFormAttributes.VQF_902_1.ACCEPTANCE_METHOD.id, - label: i18n.str`Accepted by`, - type: "choiceStacked", - choices: [ - { - value: "FACE_TO_FACE", - label: i18n.str`Face to face`, - }, - { - value: "AUTHENTICATED_COPY", - label: i18n.str`Authenticated copy`, - }, - { - value: "RESIDENTIAL_ADDRESS_VALIDATED", - label: i18n.str`Residentail address validated`, - }, - ], - required: false, - }, - { - id: TalerFormAttributes.VQF_902_1 - .ACCEPTANCE_CORRESPONDENCE_SERVICE_TYPE.id, - label: i18n.str`Type of correspondence service`, - type: "choiceStacked", - choices: [ - { - value: "HOLD_AT_BANK", - label: i18n.str`Hold at a bank`, - }, - { - value: "TO_THE_CUSTOMER", - label: i18n.str`To the customer`, - }, - { - value: "TO_THE_MEMBER", - label: i18n.str`To the member`, - }, - { - value: "TO_A_THIRD_PARTY", - label: i18n.str`To a third party`, - }, - ], - required: false, - }, - { - id: TalerFormAttributes.VQF_902_1 - .ACCEPTANCE_CORRESPONDENCE_SERVICE_THIRD_PARTY_FULL_NAME.id, - label: i18n.str`Third party full name`, - type: "text", - required: true, - hide(value, root) { - return ( - !!root && - root["ACCEPTANCE_CORRESPONDENCE_SERVICE_TYPE"] !== - "TO_A_THIRD_PARTY" - ); - }, - }, - { - id: TalerFormAttributes.VQF_902_1 - .ACCEPTANCE_CORRESPONDENCE_SERVICE_THIRD_PARTY_ADDRESS.id, - label: i18n.str`Third party address`, - type: "textArea", - required: true, - hide(value, root) { - return ( - !!root && - root["ACCEPTANCE_CORRESPONDENCE_SERVICE_TYPE"] !== - "TO_A_THIRD_PARTY" - ); - }, - }, - { - id: TalerFormAttributes.VQF_902_1.ACCEPTANCE_LANGUAGE.id, - label: i18n.str`Language`, - type: "selectOne", - choices: languageNameList(i18n), - required: false, - }, - { - id: TalerFormAttributes.VQF_902_1.ACCEPTANCE_FURTHER_INFO.id, - label: i18n.str`Further information`, - type: "textArea", - required: false, - }, - ], - }, - { - title: i18n.str`Evaluation with regard to embargo procedures/terrorism lists on establishing the business relationship`, - description: i18n.str`Verification whether the customer, beneficial owners of the assets, controlling persons, authorized representatives or other involved persons are listed on an embargo/terrorism list (date of verification/result)`, - fields: [ - { - id: TalerFormAttributes.VQF_902_1.EMBARGO_TERRORISM_INFO.id, - label: i18n.str`Embargo information`, - type: "textArea", - required: false, - }, - ], - }, - // { - // title: i18n.str`Relationship`, - // fields: [ - // { - // id: TalerFormAttributes.VQF_902_1.RELATIONSHIP_TYPE.id, - // label: i18n.str`Type of business relationship`, - // type: "choiceStacked", - // choices: [ - // { - // value: "MONEY_EXCHANGE", - // label: i18n.str`Money exchange`, - // }, - // { - // value: "MONEY_ASSET_TRANSFER", - // label: i18n.str`Money asset transfer`, - // }, - // ], - // allowFreeForm: true, - // required: false, - // }, - // { - // id: TalerFormAttributes.VQF_902_1.RELATIONSHIP_PURPOSE.id, - // label: i18n.str`Purpose of the business relationship`, - // type: "textArea", - // required: false, - // }, - // ], - // }, - // { - // title: i18n.str`Enclosures`, - // fields: [ - // { - // id: TalerFormAttributes.VQF_902_1.ENCLOSURE_CUSTOMER_DOCUMENTS.id, - // label: i18n.str`Customer identification documents`, - // type: "toggle", - // required: false, - // }, - // { - // id: TalerFormAttributes.VQF_902_1.ENCLOSURE_IDENTIFICATION_DOCUMENTS - // .id, - // label: i18n.str`Customer identification documents`, - // type: "toggle", - // required: false, - // }, - // { - // id: TalerFormAttributes.VQF_902_1.ENCLOSURE_BENEFICIAL_OWNER.id, - // label: i18n.str`Customer identification documents`, - // type: "toggle", - // required: false, - // }, - // { - // id: TalerFormAttributes.VQF_902_1.ENCLOSURE_CUSTOMER_PROFILE.id, - // label: i18n.str`Customer identification documents`, - // type: "toggle", - // required: false, - // }, - // { - // id: TalerFormAttributes.VQF_902_1.ENCLOSURE_RISK_PROFILE.id, - // label: i18n.str`Customer identification documents`, - // type: "toggle", - // required: false, - // }, - // ], - // }, - ], - }; -} 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 @@ -17,38 +17,23 @@ export function VQF_902_1_customer( type: "double-column", sections: [ { - title: i18n.str`Information on the beneficial owner of the assets and/or controlling person`, - description: i18n.str`Establishment of the beneficial owner of the assets and/or controlling person`, + title: i18n.str`Information on customer`, + description: i18n.str`The customer is the person with whom the member concludes the contract with regard to the financial service provided (civil law). Does the +member act as director of a domiciliary company, this domiciliary company is the customer.`, fields: [ { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_TYPE.id, + id: TalerFormAttributes.VQF_902_1.CUSTOMER_INFO_TYPE.id, label: i18n.str`Customer type`, type: "choiceStacked", choices: [ { - value: "NATURAL", + value: "NATURAL_PERSON", label: i18n.str`Natural person`, }, { - value: "OPERATIONAL", - label: i18n.str`Operational legal entity or partnership`, + value: "LEGAL_ENTITY", + label: i18n.str`Legal entity`, }, - // { - // value: "FOUNDATION", - // label: i18n.str`Foundation`, - // }, - // { - // value: "TRUST", - // label: i18n.str`Trust`, - // }, - // { - // value: "LIFE_INSURANCE", - // label: i18n.str`Life insurance`, - // }, - // { - // value: "OTHER", - // label: i18n.str`Other`, - // }, ], required: true, }, @@ -56,7 +41,10 @@ export function VQF_902_1_customer( }, { title: i18n.str`Information on customer`, - description: i18n.str`The customer is the person with whom the member concludes the contract with regard to the financial service provided (civil law). Does the member act as director of a domiciliary company, this domiciliary company is the customer.`, + description: i18n.str`The customer is a natural person`, + hide(root) { + return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; + }, fields: [ { id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_FULL_NAME.id, @@ -64,7 +52,7 @@ export function VQF_902_1_customer( type: "text", required: true, hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "NATURAL"; + return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; }, }, { @@ -73,7 +61,7 @@ export function VQF_902_1_customer( type: "textArea", required: true, hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "NATURAL"; + return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; }, }, { @@ -82,7 +70,7 @@ export function VQF_902_1_customer( type: "text", required: false, hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "NATURAL"; + return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; }, }, { @@ -91,7 +79,7 @@ export function VQF_902_1_customer( type: "text", required: false, hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "NATURAL"; + return !!root && root["CUSTOMER_INFO"] !== "NATURAL_PERSON"; }, }, { @@ -102,7 +90,7 @@ export function VQF_902_1_customer( pattern: "dd/MM/yyyy", required: true, hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "NATURAL"; + return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; }, }, { @@ -112,36 +100,74 @@ export function VQF_902_1_customer( choices: countryNationalityList(i18n), required: true, hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "NATURAL"; + return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; }, }, - // { - // id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_NATIONAL_ID.id, - // label: i18n.str`Identification document`, - // type: "text", - // required: true, - // hide(value, root) { - // return !!root && root["CUSTOMER_TYPE"] !== "NATURAL"; - // }, - // }, { - id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_NATIONAL_ID_COPY - .id, - label: i18n.str`Copy of identification document`, + id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_NATIONAL_ID.id, + label: i18n.str`Identification document`, type: "file", accept: "application/pdf", required: true, hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "NATURAL"; + return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; + }, + }, + ], + }, + { + title: i18n.str`Information on customer (sole proprietor)`, + description: i18n.str`The customer is a sole proprietor`, + hide(root) { + return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; + }, + fields: [ + { + id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_COMPANY_NAME.id, + label: i18n.str`Company name`, + type: "text", + required: false, + hide(value, root) { + return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; + }, + }, + { + id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_REGISTERED_OFFICE + .id, + label: i18n.str`Registered office`, + type: "text", + required: false, + hide(value, root) { + return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; }, }, { + id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_COMPANY_ID_DOC + .id, + label: i18n.str`Company identification document`, + type: "file", + required: false, + accept: "application/pdf", + hide(value, root) { + return !!root && root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; + }, + }, + ], + }, + { + title: i18n.str`Information on customer`, + description: i18n.str`The customer is a legal entity`, + hide(root) { + return !!root && root["CUSTOMER_INFO_TYPE"] !== "LEGAL_ENTITY"; + }, + fields: [ + { id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_COMPANY_NAME.id, label: i18n.str`Company name`, type: "text", required: false, hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "NATURAL"; + return !!root && root["CUSTOMER_INFO_TYPE"] !== "LEGAL_ENTITY"; }, }, { @@ -151,7 +177,7 @@ export function VQF_902_1_customer( type: "text", required: false, hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "NATURAL"; + return !!root && root["CUSTOMER_INFO_TYPE"] !== "LEGAL_ENTITY"; }, }, { @@ -160,7 +186,7 @@ export function VQF_902_1_customer( type: "text", required: true, hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "OPERATIONAL"; + return !!root && root["CUSTOMER_TYPE"] !== "LEGAL_ENTITY"; }, }, { @@ -169,7 +195,7 @@ export function VQF_902_1_customer( type: "textArea", required: true, hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "OPERATIONAL"; + return !!root && root["CUSTOMER_TYPE"] !== "LEGAL_ENTITY"; }, }, { @@ -179,7 +205,7 @@ export function VQF_902_1_customer( type: "text", required: false, hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "OPERATIONAL"; + return !!root && root["CUSTOMER_TYPE"] !== "LEGAL_ENTITY"; }, }, { @@ -188,7 +214,7 @@ export function VQF_902_1_customer( type: "text", required: false, hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "OPERATIONAL"; + return !!root && root["CUSTOMER_TYPE"] !== "LEGAL_ENTITY"; }, }, { @@ -197,18 +223,9 @@ export function VQF_902_1_customer( type: "text", required: false, hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "OPERATIONAL"; + return !!root && root["CUSTOMER_TYPE"] !== "LEGAL_ENTITY"; }, }, - // { - // id: TalerFormAttributes.VQF_902_1.CUSTOMER_ENTITY_ID.id, - // label: i18n.str`Identification document`, - // type: "text", - // required: true, - // hide(value, root) { - // return !!root && root["CUSTOMER_TYPE"] !== "OPERATIONAL"; - // }, - // }, { id: TalerFormAttributes.VQF_902_1.CUSTOMER_ENTITY_ID_COPY.id, label: i18n.str`Copy of identification document`, @@ -216,7 +233,7 @@ export function VQF_902_1_customer( accept: "application/pdf", required: true, hide(value, root) { - return !!root && root["CUSTOMER_TYPE"] !== "OPERATIONAL"; + return !!root && root["CUSTOMER_TYPE"] !== "LEGAL_ENTITY"; }, }, ], @@ -271,19 +288,14 @@ export function VQF_902_1_customer( type: "text", required: true, }, - // { - // id: TalerFormAttributes.VQF_902_1_founder.FOUNDER_NATIONAL_ID - // .id, - // label: i18n.str`Identification document`, - // type: "text", - // required: true, - // }, + // FIXME: ID name is weird! { id: TalerFormAttributes.VQF_902_1_founder.FOUNDER_NATIONAL_COPY .id, label: i18n.str`Copy of identification document`, type: "file", accept: "application/pdf", + required: true, }, { @@ -294,79 +306,20 @@ export function VQF_902_1_customer( choices: [ { value: "CR", - label: i18n.str`Hold at a bank`, + label: i18n.str`CR extract`, }, { value: "MANDATE", - label: i18n.str`To a third party`, - }, - { - value: "OTHER", - label: i18n.str`Other`, + label: i18n.str`Mandate`, }, ], required: true, }, - { - id: TalerFormAttributes.VQF_902_1_founder - .FOUNDER_POWER_OF_ATTORNEY_OTHER.id, - type: "text", - label: i18n.str`Power of attorney arrangements clarification`, - required: true, - hide(value, root) { - if (!root) return true; - if ( - root[ - TalerFormAttributes.VQF_902_1_founder - .FOUNDER_POWER_OF_ATTORNEY.id - ] === "OTHER" - ) - return false; - return true; - }, - }, ], required: true, }, ], }, - - // { - // title: i18n.str`Enclosures`, - // fields: [ - // { - // id: TalerFormAttributes.VQF_902_1.ENCLOSURE_CUSTOMER_DOCUMENTS.id, - // label: i18n.str`Customer identification documents`, - // type: "toggle", - // required: false, - // }, - // { - // id: TalerFormAttributes.VQF_902_1.ENCLOSURE_IDENTIFICATION_DOCUMENTS - // .id, - // label: i18n.str`Customer identification documents`, - // type: "toggle", - // required: false, - // }, - // { - // id: TalerFormAttributes.VQF_902_1.ENCLOSURE_BENEFICIAL_OWNER.id, - // label: i18n.str`Customer identification documents`, - // type: "toggle", - // required: false, - // }, - // { - // id: TalerFormAttributes.VQF_902_1.ENCLOSURE_CUSTOMER_PROFILE.id, - // label: i18n.str`Customer identification documents`, - // type: "toggle", - // required: false, - // }, - // { - // id: TalerFormAttributes.VQF_902_1.ENCLOSURE_RISK_PROFILE.id, - // label: i18n.str`Customer identification documents`, - // type: "toggle", - // required: false, - // }, - // ], - // }, ], }; } 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 @@ -22,7 +22,7 @@ export function VQF_902_1_officer( fields: [ { id: TalerFormAttributes.VQF_902_1.ACCEPTANCE_DATE.id, - label: i18n.str`Date`, + label: i18n.str`Date (conclusion of contract)`, type: "isoTimeText", placeholder: "dd/MM/yyyy", pattern: "dd/MM/yyyy", @@ -39,7 +39,7 @@ export function VQF_902_1_officer( }, { value: "AUTHENTICATED_COPY", - label: i18n.str`Authenticated copy`, + label: i18n.str`Authenticated copy of identification document`, }, { value: "RESIDENTIAL_ADDRESS_VALIDATED", diff --git a/packages/web-util/src/forms/gana/index.stories.ts b/packages/web-util/src/forms/gana/index.stories.ts @@ -1,5 +1,4 @@ export * as a1 from "./GLS_Onboarding.stories.js"; -export * as a21 from "./VQF_902_1_all.stories.js"; export * as a22 from "./VQF_902_1_customer.stories.js"; export * as a23 from "./VQF_902_1_officer.stories.js"; export * as a3 from "./VQF_902_4.stories.js"; diff --git a/packages/web-util/src/forms/index.ts b/packages/web-util/src/forms/index.ts @@ -4,7 +4,6 @@ export * from "./HtmlIframe.js"; export * from "./Dialog.js"; export * from "./FormProvider.js"; export * from "./Group.js"; -export * from "./gana/VQF_902_1_all.js"; export * from "./gana/VQF_902_1_customer.js"; export * from "./gana/VQF_902_1_officer.js"; export * from "./gana/VQF_902_4.js";