diff options
author | Sebastian <sebasjm@gmail.com> | 2023-11-20 12:38:16 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-11-20 12:38:16 -0300 |
commit | 6138846050563e0dca95b0b6d792776925e4c35f (patch) | |
tree | b33cd36acf4b38d3a016506d4f7fa681c83beb63 /packages/aml-backoffice-ui/src/forms | |
parent | 7ed3e78f790837479fc2bb2eb6ddc40c78ce59b5 (diff) |
new forms api
Diffstat (limited to 'packages/aml-backoffice-ui/src/forms')
-rw-r--r-- | packages/aml-backoffice-ui/src/forms/902_11e.ts | 18 | ||||
-rw-r--r-- | packages/aml-backoffice-ui/src/forms/902_12e.ts | 20 | ||||
-rw-r--r-- | packages/aml-backoffice-ui/src/forms/902_13e.ts | 32 | ||||
-rw-r--r-- | packages/aml-backoffice-ui/src/forms/902_15e.ts | 22 | ||||
-rw-r--r-- | packages/aml-backoffice-ui/src/forms/902_1e.ts | 49 | ||||
-rw-r--r-- | packages/aml-backoffice-ui/src/forms/902_4e.ts | 69 | ||||
-rw-r--r-- | packages/aml-backoffice-ui/src/forms/902_5e.ts | 27 | ||||
-rw-r--r-- | packages/aml-backoffice-ui/src/forms/902_9e.ts | 22 | ||||
-rw-r--r-- | packages/aml-backoffice-ui/src/forms/simplest.ts | 23 |
9 files changed, 70 insertions, 212 deletions
diff --git a/packages/aml-backoffice-ui/src/forms/902_11e.ts b/packages/aml-backoffice-ui/src/forms/902_11e.ts index 5507c72dc..a604b560e 100644 --- a/packages/aml-backoffice-ui/src/forms/902_11e.ts +++ b/packages/aml-backoffice-ui/src/forms/902_11e.ts @@ -1,10 +1,10 @@ import { TranslatedString } from "@gnu-taler/taler-util"; import { FormState } from "../handlers/FormProvider.js"; -import { State } from "../pages/AntiMoneyLaunderingForm.js"; +import { BaseForm } from "../pages/AntiMoneyLaunderingForm.js"; import { FlexibleForm } from "./index.js"; import { Simplest, resolutionSection } from "./simplest.js"; -export const v1 = (current: State): FlexibleForm<Form902_11.Form> => ({ +export const v1 = (current: BaseForm): FlexibleForm<Form902_11.Form> => ({ versionId: "2023-05-15", design: [ { @@ -103,15 +103,6 @@ export const v1 = (current: State): FlexibleForm<Form902_11.Form> => ({ ], }, }, - { - type: "date", - props: { - name: "when", - pattern: "dd/MM/yyyy", - label: "Date" as TranslatedString, - help: "format 'dd/MM/yyyy'" as TranslatedString, - }, - }, ], }, resolutionSection(current), @@ -125,9 +116,6 @@ export const v1 = (current: State): FlexibleForm<Form902_11.Form> => ({ v.declares !== "controlling-in-other-ways" && v.declares !== "managing-director", }, - when: { - disabled: true, - }, }; }, }); @@ -138,7 +126,7 @@ namespace Form902_11 { firstName: string; address: string; } - export interface Form extends Simplest.WithResolution { + export interface Form extends BaseForm { contractingPartner: string; declares: "25-or-more" | "controlling-in-other-ways" | "managing-director"; person: Person[]; diff --git a/packages/aml-backoffice-ui/src/forms/902_12e.ts b/packages/aml-backoffice-ui/src/forms/902_12e.ts index ea95b494b..12e885e8f 100644 --- a/packages/aml-backoffice-ui/src/forms/902_12e.ts +++ b/packages/aml-backoffice-ui/src/forms/902_12e.ts @@ -1,10 +1,10 @@ import { AbsoluteTime, TranslatedString } from "@gnu-taler/taler-util"; import { FormState } from "../handlers/FormProvider.js"; -import { State } from "../pages/AntiMoneyLaunderingForm.js"; +import { BaseForm } from "../pages/AntiMoneyLaunderingForm.js"; import { FlexibleForm } from "./index.js"; -import { Simplest, resolutionSection } from "./simplest.js"; +import { resolutionSection } from "./simplest.js"; -export const v1 = (current: State): FlexibleForm<Form902_12.Form> => ({ +export const v1 = (current: BaseForm): FlexibleForm<Form902_12.Form> => ({ versionId: "2023-05-15", design: [ { @@ -347,15 +347,6 @@ export const v1 = (current: State): FlexibleForm<Form902_12.Form> => ({ }, }, { - type: "date", - props: { - name: "when", - pattern: "dd/MM/yyyy", - label: "Date" as TranslatedString, - help: "format 'dd/MM/yyyy'" as TranslatedString, - }, - }, - { type: "text", props: { name: "signature", @@ -388,9 +379,6 @@ export const v1 = (current: State): FlexibleForm<Form902_12.Form> => ({ }; }), }, - when: { - disabled: true, - }, }; }, }); @@ -421,7 +409,7 @@ namespace Form902_12 { type Founder = WithRevoke<WithDeath<Person>>; type Beneficiary = WithClaim<Person>; - export interface Form extends Simplest.WithResolution { + export interface Form extends BaseForm { contractingPartner: string; knownAs: string; boardMember: string; diff --git a/packages/aml-backoffice-ui/src/forms/902_13e.ts b/packages/aml-backoffice-ui/src/forms/902_13e.ts index 666cf35d4..f03364de0 100644 --- a/packages/aml-backoffice-ui/src/forms/902_13e.ts +++ b/packages/aml-backoffice-ui/src/forms/902_13e.ts @@ -1,10 +1,10 @@ import { AbsoluteTime, TranslatedString } from "@gnu-taler/taler-util"; import { FormState } from "../handlers/FormProvider.js"; -import { State } from "../pages/AntiMoneyLaunderingForm.js"; +import { BaseForm, } from "../pages/AntiMoneyLaunderingForm.js"; import { FlexibleForm } from "./index.js"; -import { Simplest, resolutionSection } from "./simplest.js"; +import { resolutionSection } from "./simplest.js"; -export const v1 = (current: State): FlexibleForm<Form902_13.Form> => ({ +export const v1 = (current: BaseForm): FlexibleForm<Form902_13.Form> => ({ versionId: "2023-05-15", design: [ { @@ -104,7 +104,7 @@ export const v1 = (current: State): FlexibleForm<Form902_13.Form> => ({ name: "dateOfBirth", label: "Date of birth" as TranslatedString, pattern: "dd/MM/yyyy", - help: "format 'dd/MM/yyyy'" as TranslatedString, + // help: "format 'dd/MM/yyyy'" as TranslatedString, }, }, { @@ -120,7 +120,8 @@ export const v1 = (current: State): FlexibleForm<Form902_13.Form> => ({ name: "dateOfDeath", label: "Date of death" as TranslatedString, pattern: "dd/MM/yyyy", - help: "if deceased. format 'dd/MM/yyyy'" as TranslatedString, + // help: "if deceased. format 'dd/MM/yyyy'" as TranslatedString, + help: "if deceased'" as TranslatedString, }, }, { @@ -182,7 +183,7 @@ export const v1 = (current: State): FlexibleForm<Form902_13.Form> => ({ name: "dateOfBirth", label: "Date of birth" as TranslatedString, pattern: "dd/MM/yyyy", - help: "format 'dd/MM/yyyy'" as TranslatedString, + // help: "format 'dd/MM/yyyy'" as TranslatedString, }, }, { @@ -198,7 +199,8 @@ export const v1 = (current: State): FlexibleForm<Form902_13.Form> => ({ name: "dateOfDeath", label: "Date of death" as TranslatedString, pattern: "dd/MM/yyyy", - help: "if deceased. format 'dd/MM/yyyy'" as TranslatedString, + help: "if deceased." as TranslatedString, + // help: "if deceased. format 'dd/MM/yyyy'" as TranslatedString, }, }, ], @@ -241,7 +243,7 @@ export const v1 = (current: State): FlexibleForm<Form902_13.Form> => ({ name: "dateOfBirth", label: "Date of birth" as TranslatedString, pattern: "dd/MM/yyyy", - help: "format 'dd/MM/yyyy'" as TranslatedString, + // help: "format 'dd/MM/yyyy'" as TranslatedString, }, }, { @@ -424,15 +426,6 @@ export const v1 = (current: State): FlexibleForm<Form902_13.Form> => ({ }, }, { - type: "date", - props: { - name: "when", - label: "Date" as TranslatedString, - pattern: "dd/MM/yyyy", - help: "format 'dd/MM/yyyy'" as TranslatedString, - }, - }, - { type: "text", props: { name: "signature", @@ -474,9 +467,6 @@ export const v1 = (current: State): FlexibleForm<Form902_13.Form> => ({ }; }), }, - when: { - disabled: true, - }, }; }, }); @@ -507,7 +497,7 @@ namespace Form902_13 { type Founder = WithRevoke<WithDeath<Person>>; type Beneficiary = WithClaim<Person>; - export interface Form extends Simplest.WithResolution { + export interface Form extends BaseForm { contractingPartner: string; knownAs: string; boardMember: string; diff --git a/packages/aml-backoffice-ui/src/forms/902_15e.ts b/packages/aml-backoffice-ui/src/forms/902_15e.ts index 502cee8e5..b9796add8 100644 --- a/packages/aml-backoffice-ui/src/forms/902_15e.ts +++ b/packages/aml-backoffice-ui/src/forms/902_15e.ts @@ -1,10 +1,10 @@ import { AbsoluteTime, TranslatedString } from "@gnu-taler/taler-util"; import { FormState } from "../handlers/FormProvider.js"; -import { State } from "../pages/AntiMoneyLaunderingForm.js"; +import { BaseForm } from "../pages/AntiMoneyLaunderingForm.js"; import { FlexibleForm } from "./index.js"; import { Simplest, resolutionSection } from "./simplest.js"; -export const v1 = (current: State): FlexibleForm<Form902_15.Form> => ({ +export const v1 = (current: BaseForm): FlexibleForm<Form902_15.Form> => ({ versionId: "2023-05-15", design: [ { @@ -74,7 +74,7 @@ export const v1 = (current: State): FlexibleForm<Form902_15.Form> => ({ name: "holder.dateOfBirth", label: "Date of birth" as TranslatedString, pattern: "dd/MM/yyyy", - help: "format 'dd/MM/yyyy'" as TranslatedString, + // help: "format 'dd/MM/yyyy'" as TranslatedString, }, }, { @@ -115,7 +115,7 @@ export const v1 = (current: State): FlexibleForm<Form902_15.Form> => ({ name: "premiumPayer.dateOfBirth", label: "Date of birth" as TranslatedString, pattern: "dd/MM/yyyy", - help: "format 'dd/MM/yyyy'" as TranslatedString, + // help: "format 'dd/MM/yyyy'" as TranslatedString, }, }, { @@ -136,15 +136,6 @@ export const v1 = (current: State): FlexibleForm<Form902_15.Form> => ({ }, }, { - type: "date", - props: { - name: "when", - pattern: "dd/MM/yyyy", - label: "Date" as TranslatedString, - help: "format 'dd/MM/yyyy'" as TranslatedString, - }, - }, - { type: "text", props: { name: "signature", @@ -166,9 +157,6 @@ export const v1 = (current: State): FlexibleForm<Form902_15.Form> => ({ v: Partial<Form902_15.Form>, ): FormState<Form902_15.Form> { return { - when: { - disabled: true, - }, }; }, }); @@ -181,7 +169,7 @@ namespace Form902_15 { nationality: string; } - export interface Form extends Simplest.WithResolution { + export interface Form extends BaseForm { contractingPartner: string; contractualRelationship: string; insurancePolicy: string; diff --git a/packages/aml-backoffice-ui/src/forms/902_1e.ts b/packages/aml-backoffice-ui/src/forms/902_1e.ts index c212efb1a..2cd16b840 100644 --- a/packages/aml-backoffice-ui/src/forms/902_1e.ts +++ b/packages/aml-backoffice-ui/src/forms/902_1e.ts @@ -1,36 +1,13 @@ import { AbsoluteTime, TranslatedString } from "@gnu-taler/taler-util"; import { FormState } from "../handlers/FormProvider.js"; -import { State } from "../pages/AntiMoneyLaunderingForm.js"; +import { BaseForm } from "../pages/AntiMoneyLaunderingForm.js"; import { FlexibleForm, languageList } from "./index.js"; -import { Simplest, resolutionSection } from "./simplest.js"; +import { resolutionSection } from "./simplest.js"; -export const v1 = (current: State): FlexibleForm<Form902_1.Form> => ({ +export const v1 = (current: BaseForm): FlexibleForm<Form902_1.Form> => ({ versionId: "2023-05-15", design: [ { - title: "This form was completed by" as TranslatedString, - description: - "The customer has to be identified on entering into a permanent business relationship or on concluding a cash transaction, which meets the according threshold." as TranslatedString, - fields: [ - { - type: "text", - props: { - name: "fullName", - label: "Full name" as TranslatedString, - }, - }, - { - type: "date", - props: { - name: "when", - pattern: "dd/MM/yyyy", - label: "Date" as TranslatedString, - help: "format 'dd/MM/yyyy'" as TranslatedString, - }, - }, - ], - }, - { 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, @@ -89,6 +66,7 @@ export const v1 = (current: State): FlexibleForm<Form902_1.Form> => ({ name: "naturalCustomer.dateOfBirth", label: "Date of birth" as TranslatedString, required: true, + // help: "format 'dd/MM/yyyy'" as TranslatedString, }, }, { @@ -244,7 +222,7 @@ export const v1 = (current: State): FlexibleForm<Form902_1.Form> => ({ name: "dateOfBirth", label: "Date of birth" as TranslatedString, required: true, - help: "format 'dd/MM/yyyy'" as TranslatedString, + // help: "format 'dd/MM/yyyy'" as TranslatedString, }, }, { @@ -321,7 +299,7 @@ export const v1 = (current: State): FlexibleForm<Form902_1.Form> => ({ name: "acceptance.when", pattern: "dd/MM/yyyy", label: "Date (conclusion of contract)" as TranslatedString, - help: "format 'dd/MM/yyyy'" as TranslatedString, + // help: "format 'dd/MM/yyyy'" as TranslatedString, }, }, { @@ -520,9 +498,6 @@ export const v1 = (current: State): FlexibleForm<Form902_1.Form> => ({ fullName: { disabled: true, }, - when: { - disabled: true, - }, businessEstablisher: { elements: (v.businessEstablisher ?? []).map((be) => { return { @@ -659,11 +634,11 @@ namespace Form902_1 { interface BeneficialOwner { establishment: - | "natural-person" - | "foundation" - | "trust" - | "insurance-wrapper" - | "other"; + | "natural-person" + | "foundation" + | "trust" + | "insurance-wrapper" + | "other"; } interface CashTransactions { @@ -672,7 +647,7 @@ namespace Form902_1 { purpose: string; } - export interface Form extends Simplest.WithResolution { + export interface Form extends BaseForm { fullName: string; customerType: "natural" | "legal"; naturalCustomer: NaturalCustomer; diff --git a/packages/aml-backoffice-ui/src/forms/902_4e.ts b/packages/aml-backoffice-ui/src/forms/902_4e.ts index 7c47a8746..041f08c98 100644 --- a/packages/aml-backoffice-ui/src/forms/902_4e.ts +++ b/packages/aml-backoffice-ui/src/forms/902_4e.ts @@ -1,12 +1,12 @@ import { AbsoluteTime, TranslatedString } from "@gnu-taler/taler-util"; import { h as create } from "preact"; import { FormState } from "../handlers/FormProvider.js"; -import { State } from "../pages/AntiMoneyLaunderingForm.js"; +import { BaseForm } from "../pages/AntiMoneyLaunderingForm.js"; import { FlexibleForm } from "./index.js"; import { Simplest, resolutionSection } from "./simplest.js"; import { ArrowRightIcon, ChevronRightIcon } from "../pages/Cases.js"; -export const v1 = (current: State): FlexibleForm<Form902_4.Form> => ({ +export const v1 = (current: BaseForm): FlexibleForm<Form902_4.Form> => ({ versionId: "2023-05-15", design: [ { @@ -33,27 +33,6 @@ export const v1 = (current: State): FlexibleForm<Form902_4.Form> => ({ ], }, { - title: "This form was completed by" as TranslatedString, - fields: [ - { - type: "text", - props: { - label: "Full name" as TranslatedString, - name: "fullName", - }, - }, - { - type: "date", - props: { - name: "when", - pattern: "dd/MM/yyyy", - label: "Date" as TranslatedString, - help: "format 'dd/MM/yyyy'" as TranslatedString, - }, - }, - ], - }, - { title: "Evaluation of politically exposed persons (PEP-Check)" as TranslatedString, fields: [ @@ -69,8 +48,8 @@ export const v1 = (current: State): FlexibleForm<Form902_4.Form> => ({ type: "choiceStacked", props: { label: "Foreign PEP" as TranslatedString, - tooltip: - "Definition see Art. 7 lit. g numeral 1 SRO Regulations" as TranslatedString, + // tooltip: + // "Definition see Art. 7 lit. g numeral 1 SRO Regulations" as TranslatedString, help: "Is the customer, the beneficial owner or the controlling person or authorized representative a foreign PEP or closely related to such a person?" as TranslatedString, name: "pep.foreign", choices: [ @@ -92,8 +71,8 @@ export const v1 = (current: State): FlexibleForm<Form902_4.Form> => ({ props: { label: "Domestic PEP and PEP of International Organizations" as TranslatedString, - tooltip: - "Definition see Art. 7 lit. g numeral 2 and 3 SRO Regulations " as TranslatedString, + // tooltip: + // "Definition see Art. 7 lit. g numeral 2 and 3 SRO Regulations " as TranslatedString, help: "Is the customer, the beneficial owner or the controlling person or authorized representative a domestic PEP or PEP in International Organizations or closely related to such a person?" as TranslatedString, name: "pep.domestic", choices: [ @@ -123,7 +102,7 @@ export const v1 = (current: State): FlexibleForm<Form902_4.Form> => ({ "The decision of the Senior executive body on the acceptance of a business relationship with a PEP was obtained on" as TranslatedString, name: "pep.when", pattern: "dd/MM/yyyy", - placeholder: "dd/MM/yyyy" as TranslatedString, + // placeholder: "dd/MM/yyyy" as TranslatedString, }, }, ], @@ -167,7 +146,7 @@ export const v1 = (current: State): FlexibleForm<Form902_4.Form> => ({ "The decision of the Senior executive body on the acceptance of a business relationship with a PEP was obtained on" as TranslatedString, name: "highRisk.when", pattern: "dd/MM/yyyy", - placeholder: "dd/MM/yyyy" as TranslatedString, + // placeholder: "dd/MM/yyyy" as TranslatedString, }, }, ], @@ -613,7 +592,7 @@ export const v1 = (current: State): FlexibleForm<Form902_4.Form> => ({ "The decision of the Senior executive body on the acceptance of a business relationship with a PEP was obtained on" as TranslatedString, name: "evaluation.when", pattern: "dd/MM/yyyy", - placeholder: "dd/MM/yyyy" as TranslatedString, + // placeholder: "dd/MM/yyyy" as TranslatedString, }, }, ], @@ -742,15 +721,12 @@ export const v1 = (current: State): FlexibleForm<Form902_4.Form> => ({ v: Partial<Form902_4.Form>, ): FormState<Form902_4.Form> { return { - when: { - disabled: true, - }, }; }, }); namespace Form902_4 { - export interface Form extends Simplest.WithResolution { + export interface Form extends BaseForm { customer: string; fullName: string; pep: { @@ -778,24 +754,24 @@ namespace Form902_4 { industry: { nature: "customer" | "owner"; risk: - | "low" - | "medium-cash" - | "medium-unknown" - | "high-restricted" - | "high-unknown"; + | "low" + | "medium-cash" + | "medium-unknown" + | "high-restricted" + | "high-unknown"; }; contact: { risk: "low" | "medium" | "high"; }; product: { risk: - | "low" - | "medium" - | "high-offshore" - | "high-structure" - | "high-accounts" - | "high-service" - | "high-freq-tx"; + | "low" + | "medium" + | "high-offshore" + | "high-structure" + | "high-accounts" + | "high-service" + | "high-freq-tx"; }; custom: { definition: string; @@ -805,7 +781,6 @@ namespace Form902_4 { justification: string; risk: "with" | "without"; }; - when: AbsoluteTime; }; criteria: { additional: string; diff --git a/packages/aml-backoffice-ui/src/forms/902_5e.ts b/packages/aml-backoffice-ui/src/forms/902_5e.ts index 501a3b23c..c3948e1c7 100644 --- a/packages/aml-backoffice-ui/src/forms/902_5e.ts +++ b/packages/aml-backoffice-ui/src/forms/902_5e.ts @@ -1,10 +1,10 @@ import { TranslatedString } from "@gnu-taler/taler-util"; import { FormState } from "../handlers/FormProvider.js"; -import { State } from "../pages/AntiMoneyLaunderingForm.js"; +import { BaseForm } from "../pages/AntiMoneyLaunderingForm.js"; import { FlexibleForm, currencyList } from "./index.js"; -import { Simplest, resolutionSection } from "./simplest.js"; +import { resolutionSection } from "./simplest.js"; -export const v1 = (current: State): FlexibleForm<Form902_5.Form> => ({ +export const v1 = (current: BaseForm): FlexibleForm<Form902_5.Form> => ({ versionId: "2023-05-15", design: [ { @@ -20,22 +20,6 @@ export const v1 = (current: State): FlexibleForm<Form902_5.Form> => ({ help: "Pursuant Identification Form (VQF doc. No. 902.1) numeral 1" as TranslatedString, }, }, - { - type: "text", - props: { - name: "fullName", - label: "Full name" as TranslatedString, - }, - }, - { - type: "date", - props: { - name: "when", - pattern: "dd/MM/yyyy", - label: "Date" as TranslatedString, - help: "format 'dd/MM/yyyy'" as TranslatedString, - }, - }, ], }, { @@ -232,9 +216,6 @@ export const v1 = (current: State): FlexibleForm<Form902_5.Form> => ({ v: Partial<Form902_5.Form>, ): FormState<Form902_5.Form> { return { - when: { - disabled: true, - }, originOfAssets: { categoryOther: { hidden: v.originOfAssets?.category !== "other", @@ -245,7 +226,7 @@ export const v1 = (current: State): FlexibleForm<Form902_5.Form> => ({ }); namespace Form902_5 { - export interface Form extends Simplest.WithResolution { + export interface Form extends BaseForm { customer: string; fullName: string; businessActivity: string; diff --git a/packages/aml-backoffice-ui/src/forms/902_9e.ts b/packages/aml-backoffice-ui/src/forms/902_9e.ts index 04f0a1572..a5753d5d0 100644 --- a/packages/aml-backoffice-ui/src/forms/902_9e.ts +++ b/packages/aml-backoffice-ui/src/forms/902_9e.ts @@ -1,10 +1,10 @@ import { AbsoluteTime, TranslatedString } from "@gnu-taler/taler-util"; import { FormState } from "../handlers/FormProvider.js"; -import { State } from "../pages/AntiMoneyLaunderingForm.js"; +import { BaseForm } from "../pages/AntiMoneyLaunderingForm.js"; import { FlexibleForm } from "./index.js"; -import { Simplest, resolutionSection } from "./simplest.js"; +import { resolutionSection } from "./simplest.js"; -export const v1 = (current: State): FlexibleForm<Form902_9.Form> => ({ +export const v1 = (current: BaseForm): FlexibleForm<Form902_9.Form> => ({ versionId: "2023-05-15", design: [ { @@ -19,15 +19,6 @@ export const v1 = (current: State): FlexibleForm<Form902_9.Form> => ({ }, }, { - type: "date", - props: { - name: "when", - pattern: "dd/MM/yyyy", - label: "Date" as TranslatedString, - help: "format 'dd/MM/yyyy'" as TranslatedString, - }, - }, - { type: "caption", props: { label: @@ -61,7 +52,7 @@ export const v1 = (current: State): FlexibleForm<Form902_9.Form> => ({ name: "dateOfBirth", label: "Date of birth" as TranslatedString, pattern: "dd/MM/yyyy", - help: "format 'dd/MM/yyyy'" as TranslatedString, + // help: "format 'dd/MM/yyyy'" as TranslatedString, }, }, { @@ -110,9 +101,6 @@ export const v1 = (current: State): FlexibleForm<Form902_9.Form> => ({ v: Partial<Form902_9.Form>, ): FormState<Form902_9.Form> { return { - when: { - disabled: true, - }, }; }, }); @@ -125,7 +113,7 @@ namespace Form902_9 { nationality: string; address: string; } - export interface Form extends Simplest.WithResolution { + export interface Form extends BaseForm { contractingPartner: string; persons: Person; signature: string; diff --git a/packages/aml-backoffice-ui/src/forms/simplest.ts b/packages/aml-backoffice-ui/src/forms/simplest.ts index 6497f3949..9b462e1c5 100644 --- a/packages/aml-backoffice-ui/src/forms/simplest.ts +++ b/packages/aml-backoffice-ui/src/forms/simplest.ts @@ -6,13 +6,13 @@ import { } from "@gnu-taler/taler-util"; import { FormState } from "../handlers/FormProvider.js"; import { DoubleColumnFormSection } from "../handlers/forms.js"; -import { State } from "../pages/AntiMoneyLaunderingForm.js"; +import { BaseForm } from "../pages/AntiMoneyLaunderingForm.js"; import { AmlExchangeBackend } from "../types.js"; import { FlexibleForm } from "./index.js"; import { amlStateConverter } from "../pages/ShowConsolidated.js"; -export const v1 = (current: State): FlexibleForm<Simplest.Form> => ({ +export const v1 = (current: BaseForm): FlexibleForm<Simplest.Form> => ({ versionId: "2023-05-25", design: [ { @@ -33,9 +33,6 @@ export const v1 = (current: State): FlexibleForm<Simplest.Form> => ({ v: Partial<Simplest.Form>, ): FormState<Simplest.Form> { return { - when: { - disabled: true, - }, threshold: { disabled: v.state === AmlExchangeBackend.AmlState.frozen, }, @@ -44,17 +41,12 @@ export const v1 = (current: State): FlexibleForm<Simplest.Form> => ({ }); export namespace Simplest { - export interface WithResolution { - when: AbsoluteTime; - threshold: AmountJson; - state: AmlExchangeBackend.AmlState; - } - export interface Form extends WithResolution { + export interface Form extends BaseForm { comment: string; } } -export function resolutionSection(current: State): DoubleColumnFormSection { +export function resolutionSection(current: BaseForm): DoubleColumnFormSection { return { title: "Resolution" as TranslatedString, description: `Current state is ${amlStateConverter.toStringUI( @@ -64,13 +56,6 @@ export function resolutionSection(current: State): DoubleColumnFormSection { )}` as TranslatedString, fields: [ { - type: "date", - props: { - name: "when", - label: "Decision Time" as TranslatedString, - }, - }, - { type: "choiceHorizontal", props: { name: "state", |