taler-typescript-core

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

commit 582960d48fff593c9067d9fae2a3bb22f8ee322c
parent ddbcc263b03de6dacea0f2781c0f57d79f6f224d
Author: Sebastian <sebasjm@gmail.com>
Date:   Tue,  1 Apr 2025 15:06:52 -0300

TalerForAttr updated from GANA, commented out forms what are not in the spec

Diffstat:
Dpackages/kyc-ui/src/forms/accept-tos.ts | 63---------------------------------------------------------------
Mpackages/kyc-ui/src/forms/index.ts | 82+++++++++++++++++++++++++++++++++++--------------------------------------------
Mpackages/taler-util/src/taler-form-attributes.ts | 10++++++++++
3 files changed, 46 insertions(+), 109 deletions(-)

diff --git a/packages/kyc-ui/src/forms/accept-tos.ts b/packages/kyc-ui/src/forms/accept-tos.ts @@ -1,63 +0,0 @@ -/* - 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 { - InternationalizationAPI, - SingleColumnFormDesign, - UIFormElementConfig, - UIHandlerId, -} from "@gnu-taler/web-util/browser"; - -const TALER_SCREEN_ID = 107; - -function filterUndefined<T>(ar: Array<T | undefined>): Array<T> { - return ar.filter((a): a is T => !!a); -} - -export const acceptTos = ( - i18n: InternationalizationAPI, - context?: any, -): SingleColumnFormDesign => ({ - type: "single-column" as const, - fields: filterUndefined<UIFormElementConfig>([ - { - type: "toggle", - id: "ACCEPTED_TERMS_OF_SERVICE" as UIHandlerId, - required: true, - threeState: true, - label: i18n.str`Do you accept terms of service`, - }, - context?.tos_url - ? { - type: "htmlIframe", - label: context?.provider_name ?? `Link`, - url: context.tos_url, - } - : { type: "void" }, - { - type: "download-link", - url: context.tos_url, - label: "Download text version", - media: "text/plain", - }, - { - type: "download-link", - url: context.tos_url, - label: "Download PDF version", - media: "application/pdf", - }, - ]), -}); diff --git a/packages/kyc-ui/src/forms/index.ts b/packages/kyc-ui/src/forms/index.ts @@ -19,13 +19,9 @@ import { FormMetadata, GLS_Onboarding, InternationalizationAPI, - VQF_902_11, - VQF_902_14, - VQF_902_4, - VQF_902_5, - VQF_902_9, + acceptTos, + AcceptTermOfServiceContext } from "@gnu-taler/web-util/browser"; -import { acceptTos } from "./accept-tos.js"; import { nameAndDob } from "./nameAndBirthdate.js"; import { simplest } from "./simplest.js"; @@ -41,17 +37,11 @@ export const preloadedForms: ( version: 1, config: simplest(i18n), }, - // { - // label: i18n.str`Personal info`, - // id: "personal-info", - // version: 1, - // config: personalInfo(i18n), - // }, { label: i18n.str`Terms of Service`, id: "accept-tos", version: 1, - config: acceptTos(i18n, context), + config: acceptTos(i18n, context as AcceptTermOfServiceContext), }, { label: i18n.str`GLS onboarding`, @@ -60,39 +50,39 @@ export const preloadedForms: ( 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`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", diff --git a/packages/taler-util/src/taler-form-attributes.ts b/packages/taler-util/src/taler-form-attributes.ts @@ -21,6 +21,10 @@ but it does apply to this file. */ +/** + * Imports. + */ + export const TalerFormAttributes = { /** * Description: Suppress flagging this account when it creates a hit on a sanctions list, this is a false-positive. @@ -1385,6 +1389,12 @@ export const TalerFormAttributes = { */ ACCEPTED_TERMS_OF_SERVICE: "ACCEPTED_TERMS_OF_SERVICE" as const, /** + * Description: True if the customer read or downloaded the terms of service. It should be set automatically. + * + * GANA Type: Boolean + */ + DOWNLOADED_TERMS_OF_SERVICE: "DOWNLOADED_TERMS_OF_SERVICE" as const, + /** * Description: Current note on the GWG file. * * GANA Type: String