diff options
Diffstat (limited to 'packages/aml-backoffice-ui/src/forms/902_1e.ts')
-rw-r--r-- | packages/aml-backoffice-ui/src/forms/902_1e.ts | 493 |
1 files changed, 244 insertions, 249 deletions
diff --git a/packages/aml-backoffice-ui/src/forms/902_1e.ts b/packages/aml-backoffice-ui/src/forms/902_1e.ts index 7fcabe829..58ef7e2e8 100644 --- a/packages/aml-backoffice-ui/src/forms/902_1e.ts +++ b/packages/aml-backoffice-ui/src/forms/902_1e.ts @@ -1,29 +1,42 @@ -import { AbsoluteTime, TranslatedString } from "@gnu-taler/taler-util"; -import { FormState } from "../handlers/FormProvider.js"; -import { BaseForm } from "../pages/AntiMoneyLaunderingForm.js"; -import { FlexibleForm, languageList } from "./index.js"; +/* + This file is part of GNU Taler + (C) 2022-2024 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/> + */ +import type { AbsoluteTime } from "@gnu-taler/taler-util"; +import type { InternationalizationAPI } from "@gnu-taler/web-util/browser"; +import { BaseForm } from "../context/ui-forms.js"; import { resolutionSection } from "./simplest.js"; -export const v1 = (current: BaseForm): FlexibleForm<Form902_1.Form> => ({ +export const v1 = (i18n: InternationalizationAPI) => ({ design: [ { - title: "Information on customer" as TranslatedString, - description: - "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." as TranslatedString, + 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: [ { type: "choiceStacked", - props: { + properties: { name: "customerType", - label: "Type of customer" as TranslatedString, + label: i18n.str`Type of customer`, required: true, choices: [ { - label: "Natural person" as TranslatedString, + label: i18n.str`Natural person`, value: "natural", }, { - label: "Legal entity" as TranslatedString, + label: i18n.str`Legal entity`, value: "legal", }, ], @@ -31,245 +44,241 @@ export const v1 = (current: BaseForm): FlexibleForm<Form902_1.Form> => ({ }, { type: "text", - props: { + properties: { name: "naturalCustomer.fullName", - label: "Full name" as TranslatedString, + label: i18n.str`Full name`, required: true, }, }, { type: "text", - props: { + properties: { name: "naturalCustomer.address", - label: "Residential address" as TranslatedString, + label: i18n.str`Residential address`, required: true, }, }, { type: "integer", - props: { + properties: { name: "naturalCustomer.telephone", - label: "Telephone" as TranslatedString, + label: i18n.str`Telephone`, }, }, { type: "text", - props: { + properties: { name: "naturalCustomer.email", - label: "E-mail" as TranslatedString, + label: i18n.str`E-mail`, }, }, { - type: "date", - props: { + type: "absoluteTime", + properties: { name: "naturalCustomer.dateOfBirth", - label: "Date of birth" as TranslatedString, + label: i18n.str`Date of birth`, required: true, - // help: "format 'dd/MM/yyyy'" as TranslatedString, + // help: i18n.str`format 'dd/MM/yyyy'`, }, }, { type: "text", - props: { + properties: { name: "naturalCustomer.nationality", - label: "Nationality" as TranslatedString, + label: i18n.str`Nationality`, required: true, }, }, { type: "text", - props: { + properties: { name: "naturalCustomer.document", - label: "Identification document" as TranslatedString, + label: i18n.str`Identification document`, required: true, }, }, { type: "file", - props: { + properties: { name: "naturalCustomer.documentAttachment", - label: "Document attachment" as TranslatedString, + label: i18n.str`Document attachment`, required: true, maxBites: 2 * 1024 * 1024, accept: ".png", - help: "Max size of 2 mega bytes" as TranslatedString, + help: i18n.str`Max size of 2 mega bytes`, }, }, { type: "text", - props: { + properties: { name: "naturalCustomer.companyName", - label: "Company name" as TranslatedString, + label: i18n.str`Company name`, }, }, { type: "text", - props: { + properties: { name: "naturalCustomer.office", - label: "Registered office" as TranslatedString, + label: i18n.str`Registered office`, }, }, { type: "text", - props: { + properties: { name: "naturalCustomer.companyDocument", - label: "Company identification document" as TranslatedString, + label: i18n.str`Company identification document`, }, }, { type: "file", - props: { + properties: { name: "naturalCustomer.companyDocumentAttachment", - label: "Document attachment" as TranslatedString, + label: i18n.str`Document attachment`, required: true, maxBites: 2 * 1024 * 1024, accept: ".png", - help: "Max size of 2 mega bytes" as TranslatedString, + help: i18n.str`Max size of 2 mega bytes`, }, }, { type: "text", - props: { + properties: { name: "legalCustomer.companyName", - label: "Company name" as TranslatedString, + label: i18n.str`Company name`, required: true, }, }, { type: "text", - props: { + properties: { name: "legalCustomer.domicile", - label: "Domicile" as TranslatedString, + label: i18n.str`Domicile`, required: true, }, }, { type: "text", - props: { + properties: { name: "legalCustomer.contactPerson", - label: "Contact person" as TranslatedString, + label: i18n.str`Contact person`, }, }, { type: "text", - props: { + properties: { name: "legalCustomer.telephone", - label: "Telephone" as TranslatedString, + label: i18n.str`Telephone`, }, }, { type: "text", - props: { + properties: { name: "legalCustomer.email", - label: "E-mail" as TranslatedString, + label: i18n.str`E-mail`, }, }, { type: "text", - props: { + properties: { name: "legalCustomer.document", - label: "Identification document" as TranslatedString, - help: "Not older than 12 month" as TranslatedString, + label: i18n.str`Identification document`, + help: i18n.str`Not older than 12 month`, }, }, { type: "file", - props: { + properties: { name: "legalCustomer.documentAttachment", - label: "Document attachment" as TranslatedString, + label: i18n.str`Document attachment`, required: true, maxBites: 2 * 1024 * 1024, accept: ".png", - help: "Max size of 2 mega bytes" as TranslatedString, + help: i18n.str`Max size of 2 mega bytes`, }, }, ], }, { - title: - "Information on the natural persons who establish the business relationship for legal entities and partnerships" as TranslatedString, - description: - "For legal entities and partnerships the identity of the natural persons who establish the business relationship must be verified." as TranslatedString, + 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.`, fields: [ { type: "array", - props: { + properties: { name: "businessEstablisher", - label: "Persons" as TranslatedString, + label: i18n.str`Persons`, required: true, - placeholder: "this is the placeholder" as TranslatedString, + placeholder: i18n.str`this is the placeholder`, fields: [ { type: "text", - props: { + properties: { name: "fullName", - label: "Full name" as TranslatedString, + label: i18n.str`Full name`, required: true, }, }, { type: "text", - props: { + properties: { name: "address", - label: "Residential address" as TranslatedString, + label: i18n.str`Residential address`, required: true, }, }, { - type: "date", - props: { + type: "absoluteTime", + properties: { name: "dateOfBirth", - label: "Date of birth" as TranslatedString, + label: i18n.str`Date of birth`, required: true, - // help: "format 'dd/MM/yyyy'" as TranslatedString, + // help: i18n.str`format 'dd/MM/yyyy'`, }, }, { type: "text", - props: { + properties: { name: "nationality", - label: "Nationality" as TranslatedString, + label: i18n.str`Nationality`, required: true, }, }, { type: "text", - props: { + properties: { name: "typeOfAuthorization", - label: - "Type of authorization (signatory of representation)" as TranslatedString, + label: i18n.str`Type of authorization (signatory of representation)`, required: true, }, }, { type: "file", - props: { + properties: { name: "documentAttachment", - label: - "Identification document attachment" as TranslatedString, + label: i18n.str`Identification document attachment`, required: true, maxBites: 2 * 1024 * 1024, accept: ".png", - help: "Max size of 2 mega bytes" as TranslatedString, + help: i18n.str`Max size of 2 mega bytes`, }, }, { type: "choiceStacked", - props: { + properties: { name: "powerOfAttorneyArrangements", - label: "Power of attorney arrangements" as TranslatedString, + label: i18n.str`Power of attorney arrangements`, required: true, choices: [ { - label: "CR extract" as TranslatedString, + label: i18n.str`CR extract`, value: "cr", }, { - label: "Mandate" as TranslatedString, + label: i18n.str`Mandate`, value: "mandate", }, { - label: "Other" as TranslatedString, + label: i18n.str`Other`, value: "other", }, ], @@ -277,9 +286,9 @@ export const v1 = (current: BaseForm): FlexibleForm<Form902_1.Form> => ({ }, { type: "text", - props: { + properties: { name: "powerOfAttorneyArrangementsOther", - label: "Power of attorney arrangements" as TranslatedString, + label: i18n.str`Power of attorney arrangements`, required: true, }, }, @@ -290,36 +299,34 @@ export const v1 = (current: BaseForm): FlexibleForm<Form902_1.Form> => ({ ], }, { - title: "Acceptance of business relationship" as TranslatedString, + title: i18n.str`Acceptance of business relationship`, fields: [ { - type: "date", - props: { + type: "absoluteTime", + properties: { name: "acceptance.when", pattern: "dd/MM/yyyy", - label: "Date (conclusion of contract)" as TranslatedString, - // help: "format 'dd/MM/yyyy'" as TranslatedString, + label: i18n.str`Date (conclusion of contract)`, + // help: i18n.str`format 'dd/MM/yyyy'`, }, }, { type: "choiceStacked", - props: { + properties: { name: "acceptance.acceptedBy", - label: "Accepted by" as TranslatedString, + label: i18n.str`Accepted by`, required: true, choices: [ { - label: "Face-to-face meeting with customer" as TranslatedString, + label: i18n.str`Face-to-face meeting with customer`, value: "face-to-face", }, { - label: - "Correspondence: authenticated copy of identification document obtained" as TranslatedString, + label: i18n.str`Correspondence: authenticated copy of identification document obtained`, value: "correspondence-document", }, { - label: - "Correspondence: residential address validated" as TranslatedString, + label: i18n.str`Correspondence: residential address validated`, value: "correspondence-address", }, ], @@ -327,24 +334,24 @@ export const v1 = (current: BaseForm): FlexibleForm<Form902_1.Form> => ({ }, { type: "choiceStacked", - props: { + properties: { name: "acceptance.typeOfCorrespondence", - label: "Type of correspondence service" as TranslatedString, + label: i18n.str`Type of correspondence service`, choices: [ { - label: "to the customer" as TranslatedString, + label: i18n.str`to the customer`, value: "customer", }, { - label: "hold at bank" as TranslatedString, + label: i18n.str`hold at bank`, value: "bank", }, { - label: "to the member" as TranslatedString, + label: i18n.str`to the member`, value: "member", }, { - label: "to a third party" as TranslatedString, + label: i18n.str`to a third party`, value: "third-party", }, ], @@ -352,73 +359,67 @@ export const v1 = (current: BaseForm): FlexibleForm<Form902_1.Form> => ({ }, { type: "text", - props: { + properties: { name: "acceptance.thirdPartyFullName", - label: "Third party full name" as TranslatedString, + label: i18n.str`Third party full name`, required: true, }, }, { type: "text", - props: { + properties: { name: "acceptance.thirdPartyAddress", - label: "Third party address" as TranslatedString, + label: i18n.str`Third party address`, required: true, }, }, { type: "selectMultiple", - props: { + properties: { name: "acceptance.language", - label: "Languages" as TranslatedString, - choices: languageList, + label: i18n.str`Languages`, + choices: ["asd"], unique: true, }, }, { type: "textArea", - props: { + properties: { name: "acceptance.furtherInformation", - label: "Further information" as TranslatedString, + label: i18n.str`Further information`, }, }, ], }, { - title: - "Information on the beneficial owner of the assets and/or controlling person" as TranslatedString, - description: - "Establishment of the beneficial owner of the assets and/or controlling person" as TranslatedString, + 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`, fields: [ { type: "choiceStacked", - props: { + properties: { name: "establishment", - label: "The customer is" as TranslatedString, + label: i18n.str`The customer is`, required: true, choices: [ { - label: - "a natural person and there are no doubts that this person is the sole beneficial owner of the assets" as TranslatedString, + label: i18n.str`a natural person and there are no doubts that this person is the sole beneficial owner of the assets`, value: "natural", }, { - label: - "a foundation (or a similar construct; incl. underlying companies)" as TranslatedString, + label: i18n.str`a foundation (or a similar construct; incl. underlying companies)`, value: "foundation", }, { - label: - "a trust (incl. underlying companies)" as TranslatedString, + label: i18n.str`a trust (incl. underlying companies)`, value: "trust", }, { - label: - "a life insurance policy with separately managed accounts/securities accounts" as TranslatedString, + label: i18n.str`a life insurance policy with separately managed accounts/securities accounts`, value: "insurance-wrapper", }, { - label: "all other cases" as TranslatedString, + label: i18n.str`all other cases`, value: "other", }, ], @@ -427,44 +428,39 @@ export const v1 = (current: BaseForm): FlexibleForm<Form902_1.Form> => ({ ], }, { - title: - "Evaluation with regard to embargo procedures/terrorism lists on establishing the business relationship" as TranslatedString, - description: - "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)" as TranslatedString, + 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: [ { type: "textArea", - props: { + properties: { name: "embargoEvaluation", - help: "The evaluation must be made at the beginning of the business relationship and has to be repeated in the case of permanent business relationship every time the according lists are updated." as TranslatedString, - label: "Evaluation" as TranslatedString, + help: i18n.str`The evaluation must be made at the beginning of the business relationship and has to be repeated in the case of permanent business relationship every time the according lists are updated.`, + label: i18n.str`Evaluation`, }, }, ], }, { - title: - "In the case of cash transactions/occasional customers: Information on type and purpose of business relationship" as TranslatedString, - description: - "These details are only necessary for occasional customers, i.e. money exchange, money and asset transfer or other cash transactions provided that no customer profile (VQF doc. No. 902.5) is created" as TranslatedString, + title: i18n.str`In the case of cash transactions/occasional customers: Information on type and purpose of business relationship`, + description: i18n.str`These details are only necessary for occasional customers, i.e. money exchange, money and asset transfer or other cash transactions provided that no customer profile (VQF doc. No. 902.5) is created`, fields: [ { type: "choiceStacked", - props: { + properties: { name: "cashTransactions.typeOfBusiness", - label: "Type of business relationship" as TranslatedString, + label: i18n.str`Type of business relationship`, choices: [ { - label: "Money exchange" as TranslatedString, + label: i18n.str`Money exchange`, value: "money-exchange", }, { - label: "Money and asset transfer" as TranslatedString, + label: i18n.str`Money and asset transfer`, value: "money-and-asset-transfer", }, { - label: - "Other cash transactions. Specify below" as TranslatedString, + label: i18n.str`Other cash transactions. Specify below`, value: "other", }, ], @@ -472,116 +468,115 @@ export const v1 = (current: BaseForm): FlexibleForm<Form902_1.Form> => ({ }, { type: "text", - props: { + properties: { name: "cashTransactions.otherTypeOfBusiness", required: true, - label: "Specify other cash transactions:" as TranslatedString, + label: i18n.str`Specify other cash transactions:`, }, }, { type: "textArea", - props: { + properties: { name: "cashTransactions.purpose", - label: - "Purpose of the business relationship (purpose of service requested)" as TranslatedString, + label: i18n.str`Purpose of the business relationship (purpose of service requested)`, }, }, ], }, - resolutionSection(current), + resolutionSection(i18n), ], - behavior: function formBehavior( - v: Partial<Form902_1.Form>, - ): FormState<Form902_1.Form> { - return { - fullName: { - disabled: true, - }, - businessEstablisher: { - elements: (v.businessEstablisher ?? []).map((be) => { - return { - powerOfAttorneyArrangementsOther: { - hidden: be.powerOfAttorneyArrangements !== "other", - }, - }; - }), - }, - acceptance: { - thirdPartyFullName: { - hidden: v.acceptance?.typeOfCorrespondence !== "third-party", - }, - thirdPartyAddress: { - hidden: v.acceptance?.typeOfCorrespondence !== "third-party", - }, - }, - cashTransactions: { - otherTypeOfBusiness: { - hidden: v.cashTransactions?.typeOfBusiness !== "other", - }, - }, - naturalCustomer: { - fullName: { - hidden: v.customerType !== "natural", - }, - address: { - hidden: v.customerType !== "natural", - }, - telephone: { - hidden: v.customerType !== "natural", - }, - email: { - hidden: v.customerType !== "natural", - }, - dateOfBirth: { - hidden: v.customerType !== "natural", - }, - nationality: { - hidden: v.customerType !== "natural", - }, - document: { - hidden: v.customerType !== "natural", - }, - companyName: { - hidden: v.customerType !== "natural", - }, - office: { - hidden: v.customerType !== "natural", - }, - companyDocument: { - hidden: v.customerType !== "natural", - }, - companyDocumentAttachment: { - hidden: v.customerType !== "natural", - }, - documentAttachment: { - hidden: v.customerType !== "natural", - }, - }, - legalCustomer: { - companyName: { - hidden: v.customerType !== "legal", - }, - contactPerson: { - hidden: v.customerType !== "legal", - }, - document: { - hidden: v.customerType !== "legal", - }, - domicile: { - hidden: v.customerType !== "legal", - }, - email: { - hidden: v.customerType !== "legal", - }, - telephone: { - hidden: v.customerType !== "legal", - }, - documentAttachment: { - hidden: v.customerType !== "legal", - }, - }, - }; - }, + // behavior: function formBehavior( + // v: Partial<Form902_1.Form>, + // ): FormState<Form902_1.Form> { + // return { + // fullName: { + // disabled: true, + // }, + // businessEstablisher: { + // elements: (v.businessEstablisher ?? []).map((be) => { + // return { + // powerOfAttorneyArrangementsOther: { + // hidden: be.powerOfAttorneyArrangements !== "other", + // }, + // }; + // }), + // }, + // acceptance: { + // thirdPartyFullName: { + // hidden: v.acceptance?.typeOfCorrespondence !== "third-party", + // }, + // thirdPartyAddress: { + // hidden: v.acceptance?.typeOfCorrespondence !== "third-party", + // }, + // }, + // cashTransactions: { + // otherTypeOfBusiness: { + // hidden: v.cashTransactions?.typeOfBusiness !== "other", + // }, + // }, + // naturalCustomer: { + // fullName: { + // hidden: v.customerType !== "natural", + // }, + // address: { + // hidden: v.customerType !== "natural", + // }, + // telephone: { + // hidden: v.customerType !== "natural", + // }, + // email: { + // hidden: v.customerType !== "natural", + // }, + // dateOfBirth: { + // hidden: v.customerType !== "natural", + // }, + // nationality: { + // hidden: v.customerType !== "natural", + // }, + // document: { + // hidden: v.customerType !== "natural", + // }, + // companyName: { + // hidden: v.customerType !== "natural", + // }, + // office: { + // hidden: v.customerType !== "natural", + // }, + // companyDocument: { + // hidden: v.customerType !== "natural", + // }, + // companyDocumentAttachment: { + // hidden: v.customerType !== "natural", + // }, + // documentAttachment: { + // hidden: v.customerType !== "natural", + // }, + // }, + // legalCustomer: { + // companyName: { + // hidden: v.customerType !== "legal", + // }, + // contactPerson: { + // hidden: v.customerType !== "legal", + // }, + // document: { + // hidden: v.customerType !== "legal", + // }, + // domicile: { + // hidden: v.customerType !== "legal", + // }, + // email: { + // hidden: v.customerType !== "legal", + // }, + // telephone: { + // hidden: v.customerType !== "legal", + // }, + // documentAttachment: { + // hidden: v.customerType !== "legal", + // }, + // }, + // }; + // }, }); namespace Form902_1 { @@ -633,11 +628,11 @@ namespace Form902_1 { interface BeneficialOwner { establishment: - | "natural-person" - | "foundation" - | "trust" - | "insurance-wrapper" - | "other"; + | "natural-person" + | "foundation" + | "trust" + | "insurance-wrapper" + | "other"; } interface CashTransactions { |