@adyen/kyc-components 2.15.0 → 2.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/adyen-kyc-components.es.js +195 -46
- package/dist/types/components/Dropins/RoleAndTypeDropin/components/RoleAndTypeDropinComponent.d.ts +1 -1
- package/dist/types/components/Dropins/RoleAndTypeDropin/types.d.ts +3 -0
- package/dist/types/components/TrustMembers/types.d.ts +6 -2
- package/dist/types/components/TrustRoleAndEntityType/types.d.ts +9 -0
- package/dist/types/components/internal/Address/utils.d.ts +1 -1
- package/dist/types/components/internal/Button/types.d.ts +2 -2
- package/dist/types/core/Context/ExperimentContext/types.d.ts +2 -1
- package/dist/types/language/config.d.ts +1 -1
- package/dist/types/utils/decision-maker-roles.d.ts +1 -1
- package/dist/types/utils/entity-status-util.d.ts +2 -2
- package/dist/types/utils/trust-util.d.ts +1 -1
- package/dist/types/utils/trustMembers/handlers/createExemptSettlor.d.ts +4 -0
- package/dist/types/utils/trustMembers/handlers/updateExemptSettlorName.d.ts +4 -0
- package/package.json +1 -1
|
@@ -453,7 +453,7 @@ const ICO = "IČO (Identifikační číslo)";
|
|
|
453
453
|
const handelsregisternummer = "Handelsregisternummer";
|
|
454
454
|
const NumeroDeTVA = "Numéro de TVA";
|
|
455
455
|
const organisasjonsnummer = "Organisasjonsnummer";
|
|
456
|
-
const
|
|
456
|
+
const mvanummer = "MVA nummer";
|
|
457
457
|
const verificationErrorMessage = "Some information couldn’t be verified. Click to see what needs to be adjusted.";
|
|
458
458
|
const remediationFormErrorMessage = "Some information couldn’t be verified. Information in this form may need to be adjusted.";
|
|
459
459
|
const youHaveUnsavedChanges = "You have unsaved changes";
|
|
@@ -1515,7 +1515,7 @@ const defaultTrans = {
|
|
|
1515
1515
|
handelsregisternummer,
|
|
1516
1516
|
NumeroDeTVA,
|
|
1517
1517
|
organisasjonsnummer,
|
|
1518
|
-
|
|
1518
|
+
mvanummer,
|
|
1519
1519
|
verificationErrorMessage,
|
|
1520
1520
|
remediationFormErrorMessage,
|
|
1521
1521
|
youHaveUnsavedChanges,
|
|
@@ -8324,7 +8324,7 @@ const countryConfig$4 = {
|
|
|
8324
8324
|
label: "vatNumberAbsenceReason"
|
|
8325
8325
|
},
|
|
8326
8326
|
vatNumber: {
|
|
8327
|
-
label: "
|
|
8327
|
+
label: "mvanummer"
|
|
8328
8328
|
}
|
|
8329
8329
|
},
|
|
8330
8330
|
[CountryCodes.Poland]: {
|
|
@@ -12481,13 +12481,23 @@ const mapExistingFile = (name) => ({
|
|
|
12481
12481
|
existing: true
|
|
12482
12482
|
});
|
|
12483
12483
|
const mapApiIdDocumentToSchema = (idDocument2) => {
|
|
12484
|
+
const {
|
|
12485
|
+
type,
|
|
12486
|
+
attachments
|
|
12487
|
+
} = idDocument2;
|
|
12484
12488
|
const {
|
|
12485
12489
|
hasBackPage
|
|
12486
12490
|
} = idDocumentTypeOptions.find(({
|
|
12487
12491
|
id: id2
|
|
12488
|
-
}) => id2 ===
|
|
12489
|
-
|
|
12490
|
-
|
|
12492
|
+
}) => id2 === type);
|
|
12493
|
+
let frontPage2;
|
|
12494
|
+
let backPage2;
|
|
12495
|
+
if ((attachments == null ? void 0 : attachments.length) === 1) {
|
|
12496
|
+
frontPage2 = getPage(idDocument2);
|
|
12497
|
+
} else {
|
|
12498
|
+
frontPage2 = hasBackPage ? getPage(idDocument2, "front") : getPage(idDocument2);
|
|
12499
|
+
backPage2 = hasBackPage ? getPage(idDocument2, "back") : void 0;
|
|
12500
|
+
}
|
|
12491
12501
|
return {
|
|
12492
12502
|
...frontPage2 ? {
|
|
12493
12503
|
idFrontPage: [mapExistingFile(frontPage2.pageName)]
|
|
@@ -12495,7 +12505,7 @@ const mapApiIdDocumentToSchema = (idDocument2) => {
|
|
|
12495
12505
|
...backPage2 ? {
|
|
12496
12506
|
idBackPage: [mapExistingFile(backPage2.pageName)]
|
|
12497
12507
|
} : {},
|
|
12498
|
-
idDocumentType:
|
|
12508
|
+
idDocumentType: type
|
|
12499
12509
|
};
|
|
12500
12510
|
};
|
|
12501
12511
|
const mapApiDocumentToIndividualDocuments = (entityId) => {
|
|
@@ -17096,6 +17106,7 @@ function BankAccountFormat(props) {
|
|
|
17096
17106
|
var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
|
|
17097
17107
|
ExperimentNames2["EnableTrustFlow"] = "EnableTrustFlow";
|
|
17098
17108
|
ExperimentNames2["OnlyAllowAlphanumericBankAccountNumbers"] = "OnlyAllowAlphanumericBankAccountNumbers";
|
|
17109
|
+
ExperimentNames2["OrganizationSettlorWithExemptionReason"] = "OrganizationSettlorWithExemptionReason";
|
|
17099
17110
|
return ExperimentNames2;
|
|
17100
17111
|
})(ExperimentNames || {});
|
|
17101
17112
|
const stripNonAlphanumeric = (value) => value.replaceAll(/[^0-9a-zA-Z]/g, "");
|
|
@@ -21565,15 +21576,17 @@ const getFallbackName = (exemptSettlorAssociation) => {
|
|
|
21565
21576
|
};
|
|
21566
21577
|
const convertEntityAssociationIntoTrustMember = (association, associations, exemptSettlorLE) => {
|
|
21567
21578
|
var _a;
|
|
21568
|
-
if (association.settlorExemptionReason)
|
|
21579
|
+
if (association.settlorExemptionReason) {
|
|
21569
21580
|
return {
|
|
21570
21581
|
trustMemberType: "exemptSettlor",
|
|
21571
21582
|
roles: [TrustMemberTypes.SETTLOR],
|
|
21572
|
-
legalEntityType:
|
|
21583
|
+
legalEntityType: association.entityType,
|
|
21573
21584
|
legalEntityId: association.legalEntityId,
|
|
21574
21585
|
settlorExemptionReason: association.settlorExemptionReason,
|
|
21575
|
-
exemptSettlorName: ((_a = exemptSettlorLE == null ? void 0 : exemptSettlorLE.individual) == null ? void 0 : _a.name) ?? getFallbackName(association)
|
|
21586
|
+
exemptSettlorName: association.entityType === LegalEntityType.INDIVIDUAL ? ((_a = exemptSettlorLE == null ? void 0 : exemptSettlorLE.individual) == null ? void 0 : _a.name) ?? getFallbackName(association) : void 0,
|
|
21587
|
+
name: association.name
|
|
21576
21588
|
};
|
|
21589
|
+
}
|
|
21577
21590
|
if (association.entityType === LegalEntityType.ORGANIZATION)
|
|
21578
21591
|
return {
|
|
21579
21592
|
trustMemberType: "company",
|
|
@@ -21629,6 +21642,7 @@ const getTrustMembers = (trustLE, rootLegalEntity, exemptSettlorLE) => {
|
|
|
21629
21642
|
return [mapRootLegalEntityToTrustMember(rootLegalEntity), ...mapEntityAssociationsToTrustMembers(trustLE.id, trustLE.entityAssociations ?? [], exemptSettlorLE), ...mapUndefinedBeneficiaryInfoToTrustMembers(((_a = trustLE.trust) == null ? void 0 : _a.undefinedBeneficiaryInfo) ?? [])];
|
|
21630
21643
|
};
|
|
21631
21644
|
const mapTrustMemberToEntityAssociations = (trustMember) => {
|
|
21645
|
+
var _a, _b;
|
|
21632
21646
|
if (trustMember.legalEntityId === isNewEntity) {
|
|
21633
21647
|
throw Error("Cannot map a new trust member, you must create it first");
|
|
21634
21648
|
}
|
|
@@ -21638,7 +21652,7 @@ const mapTrustMemberToEntityAssociations = (trustMember) => {
|
|
|
21638
21652
|
entityType: trustMember.legalEntityType,
|
|
21639
21653
|
type: TrustMemberTypes.SETTLOR,
|
|
21640
21654
|
settlorExemptionReason: trustMember.settlorExemptionReason,
|
|
21641
|
-
name: `${trustMember.exemptSettlorName.firstName} ${trustMember.exemptSettlorName.lastName}`
|
|
21655
|
+
name: trustMember.legalEntityType === LegalEntityType.INDIVIDUAL ? `${(_a = trustMember.exemptSettlorName) == null ? void 0 : _a.firstName} ${(_b = trustMember.exemptSettlorName) == null ? void 0 : _b.lastName}` : trustMember.name ?? ""
|
|
21642
21656
|
}];
|
|
21643
21657
|
return trustMember.roles.map((role2) => ({
|
|
21644
21658
|
legalEntityId: trustMember.legalEntityId,
|
|
@@ -21681,12 +21695,13 @@ const createExemptSettlor = async ({
|
|
|
21681
21695
|
trust,
|
|
21682
21696
|
handleCreateLegalEntity
|
|
21683
21697
|
}) => {
|
|
21698
|
+
var _a, _b;
|
|
21684
21699
|
const exemptSettlorLE = {
|
|
21685
21700
|
type: LegalEntityType.INDIVIDUAL,
|
|
21686
21701
|
individual: {
|
|
21687
21702
|
name: {
|
|
21688
|
-
firstName: exemptSettlor.exemptSettlorName.firstName,
|
|
21689
|
-
lastName: exemptSettlor.exemptSettlorName.lastName
|
|
21703
|
+
firstName: ((_a = exemptSettlor.exemptSettlorName) == null ? void 0 : _a.firstName) ?? "",
|
|
21704
|
+
lastName: ((_b = exemptSettlor.exemptSettlorName) == null ? void 0 : _b.lastName) ?? ""
|
|
21690
21705
|
},
|
|
21691
21706
|
residentialAddress: {
|
|
21692
21707
|
country: trust.trust.registeredAddress.country
|
|
@@ -21695,6 +21710,21 @@ const createExemptSettlor = async ({
|
|
|
21695
21710
|
};
|
|
21696
21711
|
return handleCreateLegalEntity(exemptSettlorLE);
|
|
21697
21712
|
};
|
|
21713
|
+
const createOrganizationExemptSettlor = async ({
|
|
21714
|
+
exemptSettlor,
|
|
21715
|
+
handleCreateLegalEntity
|
|
21716
|
+
}) => {
|
|
21717
|
+
const exemptSettlorLE = {
|
|
21718
|
+
type: LegalEntityType.ORGANIZATION,
|
|
21719
|
+
organization: {
|
|
21720
|
+
legalName: exemptSettlor.name ?? "",
|
|
21721
|
+
registeredAddress: {
|
|
21722
|
+
country: exemptSettlor.country
|
|
21723
|
+
}
|
|
21724
|
+
}
|
|
21725
|
+
};
|
|
21726
|
+
return handleCreateLegalEntity(exemptSettlorLE);
|
|
21727
|
+
};
|
|
21698
21728
|
const deleteAssociatedTrustMember = async ({
|
|
21699
21729
|
associatedTrustMember,
|
|
21700
21730
|
trust,
|
|
@@ -21725,11 +21755,26 @@ const updateExemptSettlorName = async ({
|
|
|
21725
21755
|
exemptSettlor,
|
|
21726
21756
|
handleUpdateLegalEntity
|
|
21727
21757
|
}) => {
|
|
21758
|
+
var _a, _b;
|
|
21728
21759
|
const exemptSettlorPatch = {
|
|
21729
21760
|
individual: {
|
|
21730
21761
|
name: {
|
|
21731
|
-
firstName: exemptSettlor.exemptSettlorName.firstName,
|
|
21732
|
-
lastName: exemptSettlor.exemptSettlorName.lastName
|
|
21762
|
+
firstName: (_a = exemptSettlor.exemptSettlorName) == null ? void 0 : _a.firstName,
|
|
21763
|
+
lastName: (_b = exemptSettlor.exemptSettlorName) == null ? void 0 : _b.lastName
|
|
21764
|
+
}
|
|
21765
|
+
}
|
|
21766
|
+
};
|
|
21767
|
+
return handleUpdateLegalEntity(exemptSettlorPatch, exemptSettlor.legalEntityId);
|
|
21768
|
+
};
|
|
21769
|
+
const updateOrganizationExemptSettlorName = async ({
|
|
21770
|
+
exemptSettlor,
|
|
21771
|
+
handleUpdateLegalEntity
|
|
21772
|
+
}) => {
|
|
21773
|
+
const exemptSettlorPatch = {
|
|
21774
|
+
organization: {
|
|
21775
|
+
legalName: exemptSettlor.name,
|
|
21776
|
+
registeredAddress: {
|
|
21777
|
+
country: exemptSettlor.country
|
|
21733
21778
|
}
|
|
21734
21779
|
}
|
|
21735
21780
|
};
|
|
@@ -23182,10 +23227,11 @@ const ExemptSettlorTaskItem = ({
|
|
|
23182
23227
|
onEdit,
|
|
23183
23228
|
onDelete
|
|
23184
23229
|
}) => {
|
|
23230
|
+
var _a, _b;
|
|
23185
23231
|
const {
|
|
23186
23232
|
i18n
|
|
23187
23233
|
} = useI18nContext();
|
|
23188
|
-
const settlorName = `${exemptSettlor.exemptSettlorName.firstName} ${exemptSettlor.exemptSettlorName.lastName}
|
|
23234
|
+
const settlorName = exemptSettlor.legalEntityType === LegalEntityType.INDIVIDUAL ? `${(_a = exemptSettlor.exemptSettlorName) == null ? void 0 : _a.firstName} ${(_b = exemptSettlor.exemptSettlorName) == null ? void 0 : _b.lastName}` : exemptSettlor.name ?? "";
|
|
23189
23235
|
const actions = [{
|
|
23190
23236
|
icon: "edit",
|
|
23191
23237
|
onSelect: onEdit,
|
|
@@ -24940,6 +24986,7 @@ const convertExistingSettlorExemptionReasons = (existingReasons) => {
|
|
|
24940
24986
|
return existingReasons;
|
|
24941
24987
|
};
|
|
24942
24988
|
const convertExistingTrustMember = (trustMember) => {
|
|
24989
|
+
var _a, _b;
|
|
24943
24990
|
switch (trustMember.trustMemberType) {
|
|
24944
24991
|
case "undefinedBeneficiary":
|
|
24945
24992
|
return {
|
|
@@ -24949,6 +24996,13 @@ const convertExistingTrustMember = (trustMember) => {
|
|
|
24949
24996
|
};
|
|
24950
24997
|
case "regular":
|
|
24951
24998
|
case "company":
|
|
24999
|
+
return {
|
|
25000
|
+
entityType: trustMember.legalEntityType,
|
|
25001
|
+
role: trustMember.roles,
|
|
25002
|
+
settlorExemptionReason: ["noneOfTheAbove"],
|
|
25003
|
+
country: trustMember.trustMemberType === "company" ? trustMember.country : void 0,
|
|
25004
|
+
legalCompanyName: trustMember.trustMemberType === "company" ? trustMember.name : void 0
|
|
25005
|
+
};
|
|
24952
25006
|
case "rootTrustee":
|
|
24953
25007
|
return {
|
|
24954
25008
|
entityType: trustMember.legalEntityType,
|
|
@@ -24957,11 +25011,13 @@ const convertExistingTrustMember = (trustMember) => {
|
|
|
24957
25011
|
};
|
|
24958
25012
|
case "exemptSettlor":
|
|
24959
25013
|
return {
|
|
24960
|
-
entityType:
|
|
25014
|
+
entityType: trustMember.legalEntityType,
|
|
24961
25015
|
role: ["settlor"],
|
|
24962
25016
|
settlorExemptionReason: convertExistingSettlorExemptionReasons(trustMember.settlorExemptionReason),
|
|
24963
|
-
firstName: trustMember.exemptSettlorName.firstName,
|
|
24964
|
-
lastName: trustMember.exemptSettlorName.lastName
|
|
25017
|
+
firstName: (_a = trustMember.exemptSettlorName) == null ? void 0 : _a.firstName,
|
|
25018
|
+
lastName: (_b = trustMember.exemptSettlorName) == null ? void 0 : _b.lastName,
|
|
25019
|
+
legalCompanyName: trustMember.name,
|
|
25020
|
+
country: trustMember.country
|
|
24965
25021
|
};
|
|
24966
25022
|
}
|
|
24967
25023
|
};
|
|
@@ -24985,6 +25041,10 @@ const isExemptSettlor = (data) => {
|
|
|
24985
25041
|
var _a;
|
|
24986
25042
|
return ((_a = data.settlorExemptionReason) == null ? void 0 : _a.some((reason) => reason !== "noneOfTheAbove")) ?? false;
|
|
24987
25043
|
};
|
|
25044
|
+
const isOrganizationAndSettlor = (data) => {
|
|
25045
|
+
var _a;
|
|
25046
|
+
return data.entityType === LegalEntityType.ORGANIZATION && ((_a = data.role) == null ? void 0 : _a.length) === 1 && data.role[0] === "settlor";
|
|
25047
|
+
};
|
|
24988
25048
|
const roleAndTypeValidationRules = {
|
|
24989
25049
|
entityType: {
|
|
24990
25050
|
modes: ["blur"],
|
|
@@ -25005,6 +25065,16 @@ const roleAndTypeValidationRules = {
|
|
|
25005
25065
|
modes: ["blur"],
|
|
25006
25066
|
validate: (reasons) => Boolean(reasons == null ? void 0 : reasons.length),
|
|
25007
25067
|
errorMessage: "fieldIsRequired"
|
|
25068
|
+
},
|
|
25069
|
+
country: {
|
|
25070
|
+
modes: ["blur"],
|
|
25071
|
+
validate: (country2) => !!country2,
|
|
25072
|
+
errorMessage: "fieldIsRequired"
|
|
25073
|
+
},
|
|
25074
|
+
legalCompanyName: {
|
|
25075
|
+
modes: ["blur"],
|
|
25076
|
+
validate: (name) => !!name,
|
|
25077
|
+
errorMessage: "fieldIsRequired"
|
|
25008
25078
|
}
|
|
25009
25079
|
};
|
|
25010
25080
|
const CHARACTERS_LIMIT = 256;
|
|
@@ -25020,29 +25090,34 @@ const leTypeCardDetails = {
|
|
|
25020
25090
|
description: "businessEntityDescription"
|
|
25021
25091
|
}
|
|
25022
25092
|
};
|
|
25023
|
-
const decideFields = (data) => {
|
|
25024
|
-
var _a, _b;
|
|
25025
|
-
if ((_a = data.role) == null ? void 0 : _a.includes("undefinedBeneficiary")) {
|
|
25026
|
-
return ["role", "descriptionUndefinedBeneficiary"];
|
|
25027
|
-
}
|
|
25028
|
-
if ((_b = data.role) == null ? void 0 : _b.length) {
|
|
25029
|
-
if (couldBeExemptSettlor(data)) {
|
|
25030
|
-
return isExemptSettlor(data) ? ["role", "entityType", "settlorExemptionReason", "firstName", "lastName"] : ["role", "entityType", "settlorExemptionReason"];
|
|
25031
|
-
}
|
|
25032
|
-
return ["role", "entityType"];
|
|
25033
|
-
}
|
|
25034
|
-
return ["role"];
|
|
25035
|
-
};
|
|
25036
25093
|
const TrustRoleAndEntityType = (props) => {
|
|
25037
25094
|
const {
|
|
25038
25095
|
existingTrustMember,
|
|
25039
|
-
id: id2
|
|
25096
|
+
id: id2,
|
|
25097
|
+
getLegalEntityHandler,
|
|
25098
|
+
isOrganizationSettlorWithExemptionEnabled
|
|
25040
25099
|
} = props;
|
|
25041
25100
|
const {
|
|
25042
25101
|
i18n
|
|
25043
25102
|
} = useI18nContext();
|
|
25044
25103
|
const defaultData = existingTrustMember ? convertExistingTrustMember(existingTrustMember) : {};
|
|
25045
25104
|
const formUtils = formUtilities(props, i18n);
|
|
25105
|
+
const decideFields = (data2) => {
|
|
25106
|
+
var _a, _b;
|
|
25107
|
+
if ((_a = data2.role) == null ? void 0 : _a.includes("undefinedBeneficiary")) {
|
|
25108
|
+
return ["role", "descriptionUndefinedBeneficiary"];
|
|
25109
|
+
}
|
|
25110
|
+
if ((_b = data2.role) == null ? void 0 : _b.length) {
|
|
25111
|
+
if (isOrganizationSettlorWithExemptionEnabled && isOrganizationAndSettlor(data2)) {
|
|
25112
|
+
return ["role", "entityType", "settlorExemptionReason", "country", "legalCompanyName"];
|
|
25113
|
+
}
|
|
25114
|
+
if (couldBeExemptSettlor(data2)) {
|
|
25115
|
+
return isExemptSettlor(data2) ? ["role", "entityType", "settlorExemptionReason", "firstName", "lastName"] : ["role", "entityType", "settlorExemptionReason"];
|
|
25116
|
+
}
|
|
25117
|
+
return ["role", "entityType"];
|
|
25118
|
+
}
|
|
25119
|
+
return ["role"];
|
|
25120
|
+
};
|
|
25046
25121
|
const {
|
|
25047
25122
|
data,
|
|
25048
25123
|
valid,
|
|
@@ -25062,6 +25137,18 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
25062
25137
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
25063
25138
|
});
|
|
25064
25139
|
const availableRoles = getAvailableRoles(data.role);
|
|
25140
|
+
useEffect(() => {
|
|
25141
|
+
(async () => {
|
|
25142
|
+
var _a;
|
|
25143
|
+
if (isOrganizationSettlorWithExemptionEnabled && existingTrustMember && existingTrustMember.trustMemberType === "exemptSettlor" && existingTrustMember.legalEntityId !== "isNewEntry" && existingTrustMember.roles !== void 0 && existingTrustMember.roles.length === 1 && existingTrustMember.roles[0] === "settlor" && getLegalEntityHandler) {
|
|
25144
|
+
const response = await getLegalEntityHandler(existingTrustMember.legalEntityId);
|
|
25145
|
+
const country2 = (_a = response == null ? void 0 : response.organization) == null ? void 0 : _a.registeredAddress.country;
|
|
25146
|
+
if (response && response.organization) {
|
|
25147
|
+
handleChangeFor("country")(country2);
|
|
25148
|
+
}
|
|
25149
|
+
}
|
|
25150
|
+
})();
|
|
25151
|
+
}, []);
|
|
25065
25152
|
useEffect(() => {
|
|
25066
25153
|
var _a;
|
|
25067
25154
|
(_a = props.onChange) == null ? void 0 : _a.call(props, {
|
|
@@ -25109,6 +25196,13 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
25109
25196
|
setValid("lastName", valid2.lastName);
|
|
25110
25197
|
setErrors("lastName", errors2.lastName);
|
|
25111
25198
|
};
|
|
25199
|
+
const onEntityTypeChange = (value) => {
|
|
25200
|
+
var _a;
|
|
25201
|
+
if (isOrganizationSettlorWithExemptionEnabled && value === LegalEntityType.ORGANIZATION && ((_a = data.role) == null ? void 0 : _a.length) === 1 && data.role[0] === "settlor") {
|
|
25202
|
+
changeSettlorExemptionReasons(["professionalServiceProvider"]);
|
|
25203
|
+
}
|
|
25204
|
+
handleChangeFor("entityType")(value);
|
|
25205
|
+
};
|
|
25112
25206
|
return jsxs("form", {
|
|
25113
25207
|
className: "adyen-kyc-trust__role-and-entity-type adl-u-width-full",
|
|
25114
25208
|
children: [jsx(FormHeader, {
|
|
@@ -25146,7 +25240,7 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
25146
25240
|
children: (childProps) => jsx(RadioCardSelect, {
|
|
25147
25241
|
...childProps,
|
|
25148
25242
|
options: trustMemberLegalEntityTypes,
|
|
25149
|
-
onSelect:
|
|
25243
|
+
onSelect: onEntityTypeChange,
|
|
25150
25244
|
selected: data.entityType,
|
|
25151
25245
|
optionId: (option) => leTypeCardDetails[option].id,
|
|
25152
25246
|
optionName: (option) => leTypeCardDetails[option].name,
|
|
@@ -25172,7 +25266,7 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
25172
25266
|
"aria-label": formUtils.getLabel("descriptionUndefinedBeneficiary"),
|
|
25173
25267
|
"aria-invalid": !valid.descriptionUndefinedBeneficiary
|
|
25174
25268
|
})
|
|
25175
|
-
}), (schema == null ? void 0 : schema.includes("settlorExemptionReason")) && jsx(Field, {
|
|
25269
|
+
}), (schema == null ? void 0 : schema.includes("settlorExemptionReason")) && !isOrganizationAndSettlor(data) && jsx(Field, {
|
|
25176
25270
|
name: "settlorExemptionReason",
|
|
25177
25271
|
label: formUtils.getLabel("settlorExemptionReason", "whichOfTheseApplyToTheSettlor"),
|
|
25178
25272
|
isValid: valid.settlorExemptionReason,
|
|
@@ -25203,6 +25297,27 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
25203
25297
|
},
|
|
25204
25298
|
onChange: onNameChange,
|
|
25205
25299
|
dataStoreId: id2
|
|
25300
|
+
}) : void 0, isOrganizationSettlorWithExemptionEnabled && (schema == null ? void 0 : schema.includes("country")) && (schema == null ? void 0 : schema.includes("legalCompanyName")) ? jsxs(Fragment, {
|
|
25301
|
+
children: [jsx(CountryField, {
|
|
25302
|
+
data: formUtils.getFieldData(data, COUNTRY_FIELD),
|
|
25303
|
+
valid: formUtils.getFieldValid(valid, COUNTRY_FIELD),
|
|
25304
|
+
errors: formUtils.getFieldErrors(errors, fieldProblems, COUNTRY_FIELD),
|
|
25305
|
+
labels: formUtils.getFieldLabels(COUNTRY_FIELD),
|
|
25306
|
+
readonly: false,
|
|
25307
|
+
classNameModifiers: COUNTRY_FIELD,
|
|
25308
|
+
allowedCountries: [],
|
|
25309
|
+
handleChangeFor
|
|
25310
|
+
}), jsx(LegalCompanyNameField, {
|
|
25311
|
+
data: formUtils.getFieldData(data, LEGAL_COMPANY_NAME_FIELD),
|
|
25312
|
+
valid: formUtils.getFieldValid(valid, LEGAL_COMPANY_NAME_FIELD),
|
|
25313
|
+
errors: formUtils.getFieldErrors(errors, fieldProblems, LEGAL_COMPANY_NAME_FIELD),
|
|
25314
|
+
labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
|
|
25315
|
+
helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
|
|
25316
|
+
legalCompanyName: "legalCompanyName__helperText"
|
|
25317
|
+
}),
|
|
25318
|
+
readonly: false,
|
|
25319
|
+
handleChangeFor
|
|
25320
|
+
})]
|
|
25206
25321
|
}) : void 0]
|
|
25207
25322
|
});
|
|
25208
25323
|
};
|
|
@@ -25252,11 +25367,22 @@ const decideForms = (trustMember) => {
|
|
|
25252
25367
|
return regularForms;
|
|
25253
25368
|
}
|
|
25254
25369
|
};
|
|
25255
|
-
const convertDataToTrustMember = (data, existingTrustMember) => {
|
|
25370
|
+
const convertDataToTrustMember = (data, existingTrustMember, isOrganizationSettlorWithExemptionReasonEnabled2 = false) => {
|
|
25256
25371
|
var _a;
|
|
25257
25372
|
const existingId = existingTrustMember ? existingTrustMember.trustMemberType === "undefinedBeneficiary" ? existingTrustMember.reference : existingTrustMember.legalEntityId : void 0;
|
|
25258
25373
|
if ((_a = data.role) == null ? void 0 : _a.length) {
|
|
25259
|
-
if (isExemptSettlor(data))
|
|
25374
|
+
if (isExemptSettlor(data)) {
|
|
25375
|
+
if (isOrganizationSettlorWithExemptionReasonEnabled2 && data.entityType === LegalEntityType.ORGANIZATION) {
|
|
25376
|
+
return {
|
|
25377
|
+
trustMemberType: "exemptSettlor",
|
|
25378
|
+
roles: [TrustMemberTypes.SETTLOR],
|
|
25379
|
+
legalEntityType: LegalEntityType.ORGANIZATION,
|
|
25380
|
+
legalEntityId: existingId ?? isNewEntity,
|
|
25381
|
+
name: data.legalCompanyName ?? "",
|
|
25382
|
+
settlorExemptionReason: ["professionalServiceProvider"],
|
|
25383
|
+
country: data.country
|
|
25384
|
+
};
|
|
25385
|
+
}
|
|
25260
25386
|
return {
|
|
25261
25387
|
trustMemberType: "exemptSettlor",
|
|
25262
25388
|
roles: [TrustMemberTypes.SETTLOR],
|
|
@@ -25268,6 +25394,7 @@ const convertDataToTrustMember = (data, existingTrustMember) => {
|
|
|
25268
25394
|
},
|
|
25269
25395
|
legalEntityId: existingId ?? isNewEntity
|
|
25270
25396
|
};
|
|
25397
|
+
}
|
|
25271
25398
|
if (data.role.includes("undefinedBeneficiary"))
|
|
25272
25399
|
return {
|
|
25273
25400
|
trustMemberType: "undefinedBeneficiary",
|
|
@@ -25275,14 +25402,16 @@ const convertDataToTrustMember = (data, existingTrustMember) => {
|
|
|
25275
25402
|
description: data.descriptionUndefinedBeneficiary ?? "",
|
|
25276
25403
|
reference: existingId ?? isNewEntity
|
|
25277
25404
|
};
|
|
25278
|
-
if (data.entityType === LegalEntityType.ORGANIZATION)
|
|
25405
|
+
if (data.entityType === LegalEntityType.ORGANIZATION) {
|
|
25279
25406
|
return {
|
|
25280
25407
|
trustMemberType: "company",
|
|
25281
25408
|
roles: data.role,
|
|
25282
25409
|
legalEntityType: LegalEntityType.ORGANIZATION,
|
|
25283
25410
|
legalEntityId: existingId ?? isNewEntity,
|
|
25284
|
-
name: ""
|
|
25411
|
+
name: data.legalCompanyName ?? "",
|
|
25412
|
+
country: data.country
|
|
25285
25413
|
};
|
|
25414
|
+
}
|
|
25286
25415
|
if (data.entityType === LegalEntityType.INDIVIDUAL)
|
|
25287
25416
|
return {
|
|
25288
25417
|
trustMemberType: "regular",
|
|
@@ -25298,8 +25427,11 @@ function RoleAndTypeDropinComponent({
|
|
|
25298
25427
|
existingTrustMember,
|
|
25299
25428
|
navigateToFullDropinFor,
|
|
25300
25429
|
navigateBack,
|
|
25301
|
-
addOrUpdateTrustMember
|
|
25430
|
+
addOrUpdateTrustMember,
|
|
25431
|
+
getLegalEntityHandler,
|
|
25432
|
+
isOrganizationSettlorWithExemptionEnabled
|
|
25302
25433
|
}) {
|
|
25434
|
+
var _a, _b;
|
|
25303
25435
|
const {
|
|
25304
25436
|
i18n
|
|
25305
25437
|
} = useI18nContext();
|
|
@@ -25320,8 +25452,10 @@ function RoleAndTypeDropinComponent({
|
|
|
25320
25452
|
entityType: trustMember.trustMemberType !== "undefinedBeneficiary" ? i18n.get(trustMember.legalEntityType) : void 0,
|
|
25321
25453
|
descriptionUndefinedBeneficiary: trustMember.trustMemberType === "undefinedBeneficiary" ? trustMember.description : void 0,
|
|
25322
25454
|
otherInformation: trustMember.trustMemberType === "exemptSettlor" ? formatSettlorExemptionReasonsForSummary(trustMember.settlorExemptionReason ?? []) : void 0,
|
|
25323
|
-
firstName: trustMember.trustMemberType === "exemptSettlor" ? trustMember.exemptSettlorName.firstName : void 0,
|
|
25324
|
-
lastName: trustMember.trustMemberType === "exemptSettlor" ? trustMember.exemptSettlorName.lastName : void 0
|
|
25455
|
+
firstName: trustMember.trustMemberType === "exemptSettlor" ? (_a = trustMember.exemptSettlorName) == null ? void 0 : _a.firstName : void 0,
|
|
25456
|
+
lastName: trustMember.trustMemberType === "exemptSettlor" ? (_b = trustMember.exemptSettlorName) == null ? void 0 : _b.lastName : void 0,
|
|
25457
|
+
country: isOrganizationSettlorWithExemptionEnabled && trustMember.trustMemberType === "exemptSettlor" ? trustMember.country : void 0,
|
|
25458
|
+
legalCompanyName: isOrganizationSettlorWithExemptionEnabled && trustMember.trustMemberType === "exemptSettlor" ? trustMember.name : void 0
|
|
25325
25459
|
}
|
|
25326
25460
|
};
|
|
25327
25461
|
const onNavigateToNextStep = () => {
|
|
@@ -25342,7 +25476,7 @@ function RoleAndTypeDropinComponent({
|
|
|
25342
25476
|
[dataStoreId]: isValid
|
|
25343
25477
|
});
|
|
25344
25478
|
}
|
|
25345
|
-
setTrustMember(convertDataToTrustMember(data, existingTrustMember));
|
|
25479
|
+
setTrustMember(convertDataToTrustMember(data, existingTrustMember, isOrganizationSettlorWithExemptionEnabled));
|
|
25346
25480
|
};
|
|
25347
25481
|
const saveRolesAndNavigate = async () => {
|
|
25348
25482
|
if (trustMember === "incomplete")
|
|
@@ -25388,7 +25522,9 @@ function RoleAndTypeDropinComponent({
|
|
|
25388
25522
|
id: "roleAndEntityType",
|
|
25389
25523
|
existingTrustMember,
|
|
25390
25524
|
onChange: onTrustMemberChange,
|
|
25391
|
-
shouldValidate
|
|
25525
|
+
shouldValidate,
|
|
25526
|
+
getLegalEntityHandler,
|
|
25527
|
+
isOrganizationSettlorWithExemptionEnabled
|
|
25392
25528
|
})
|
|
25393
25529
|
}), isSummaryStep && jsx("div", {
|
|
25394
25530
|
className: "adyen-kyc-form-wrapper",
|
|
@@ -26807,6 +26943,7 @@ function TrustDropinComponent(props) {
|
|
|
26807
26943
|
const PAGES_WITH_STATUS = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
|
|
26808
26944
|
const POLLING_INTERVAL = 3e3;
|
|
26809
26945
|
const logger$5 = createLogger("DropinComposerComponent");
|
|
26946
|
+
const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country2) => country2 === CountryCodes.Australia && enabled;
|
|
26810
26947
|
function DropinComposerComponent({
|
|
26811
26948
|
capabilities,
|
|
26812
26949
|
legalEntityResponse,
|
|
@@ -26865,6 +27002,7 @@ function DropinComposerComponent({
|
|
|
26865
27002
|
const hasTrust = isExperimentEnabled("EnableTrustFlow") && (accountHolder2 === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse));
|
|
26866
27003
|
const reviewRequired = (legalEntity == null ? void 0 : legalEntity.id) && ((_d = (_c = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _c[legalEntity.id]) == null ? void 0 : _d.isReviewRequired);
|
|
26867
27004
|
const additionalSalesChannels = useSalesChannelsSettings();
|
|
27005
|
+
const isOrganizationSettlorWithExemptionEnabled = isOrganizationSettlorWithExemptionReasonEnabled(isExperimentEnabled("OrganizationSettlorWithExemptionReason"), trust == null ? void 0 : trust.trust.countryOfGoverningLaw);
|
|
26868
27006
|
const getLegalEntityProblems = (le) => {
|
|
26869
27007
|
var _a2;
|
|
26870
27008
|
if (le == null ? void 0 : le.id) {
|
|
@@ -27054,7 +27192,10 @@ function DropinComposerComponent({
|
|
|
27054
27192
|
break;
|
|
27055
27193
|
case "exemptSettlor":
|
|
27056
27194
|
if (!existing) {
|
|
27057
|
-
const newSettlorLE = await
|
|
27195
|
+
const newSettlorLE = isOrganizationSettlorWithExemptionEnabled && updated.legalEntityType === "organization" ? await createOrganizationExemptSettlor({
|
|
27196
|
+
exemptSettlor: updated,
|
|
27197
|
+
handleCreateLegalEntity: args.handleCreateLegalEntity
|
|
27198
|
+
}) : await createExemptSettlor({
|
|
27058
27199
|
exemptSettlor: updated,
|
|
27059
27200
|
trust,
|
|
27060
27201
|
handleCreateLegalEntity: args.handleCreateLegalEntity
|
|
@@ -27067,6 +27208,12 @@ function DropinComposerComponent({
|
|
|
27067
27208
|
handleUpdateLegalEntity: args.handleUpdateLegalEntity
|
|
27068
27209
|
});
|
|
27069
27210
|
}
|
|
27211
|
+
if (existing && isOrganizationSettlorWithExemptionEnabled && updated.legalEntityType === "organization") {
|
|
27212
|
+
await updateOrganizationExemptSettlorName({
|
|
27213
|
+
exemptSettlor: updated,
|
|
27214
|
+
handleUpdateLegalEntity: args.handleUpdateLegalEntity
|
|
27215
|
+
});
|
|
27216
|
+
}
|
|
27070
27217
|
await addOrUpdateAssociatedTrustMember({
|
|
27071
27218
|
newOrUpdated: updated,
|
|
27072
27219
|
trust,
|
|
@@ -27599,7 +27746,9 @@ function DropinComposerComponent({
|
|
|
27599
27746
|
navigateBack();
|
|
27600
27747
|
},
|
|
27601
27748
|
existingTrustMember: trustMember,
|
|
27602
|
-
addOrUpdateTrustMember: (newOrUpdated) => addOrUpdateTrustMember(newOrUpdated, trustMember)
|
|
27749
|
+
addOrUpdateTrustMember: (newOrUpdated) => addOrUpdateTrustMember(newOrUpdated, trustMember),
|
|
27750
|
+
getLegalEntityHandler: args == null ? void 0 : args.handleGetLegalEntity,
|
|
27751
|
+
isOrganizationSettlorWithExemptionEnabled
|
|
27603
27752
|
});
|
|
27604
27753
|
case TaskTypes.PCI_DSS:
|
|
27605
27754
|
return jsx(PciDropinComponent, {
|
package/dist/types/components/Dropins/RoleAndTypeDropin/components/RoleAndTypeDropinComponent.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { RoleAndTypeDropinProps } from '../types';
|
|
2
|
-
export declare function RoleAndTypeDropinComponent({ existingTrustMember, navigateToFullDropinFor, navigateBack, addOrUpdateTrustMember, }: RoleAndTypeDropinProps): import("preact").JSX.Element;
|
|
2
|
+
export declare function RoleAndTypeDropinComponent({ existingTrustMember, navigateToFullDropinFor, navigateBack, addOrUpdateTrustMember, getLegalEntityHandler, isOrganizationSettlorWithExemptionEnabled, }: RoleAndTypeDropinProps): import("preact").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ExistingLegalEntity } from '../../../core/models/api/legal-entity';
|
|
1
2
|
import { CompanyTrustMember, RegularTrustMember, TrustMember } from '../../TrustMembers/types';
|
|
2
3
|
import { TrustRoleAndEntityTypeSchema } from '../../TrustRoleAndEntityType/types';
|
|
3
4
|
export interface RoleAndTypeDropinProps {
|
|
@@ -5,6 +6,8 @@ export interface RoleAndTypeDropinProps {
|
|
|
5
6
|
navigateToFullDropinFor(trustMember: RegularTrustMember | CompanyTrustMember): void;
|
|
6
7
|
navigateBack(): void;
|
|
7
8
|
addOrUpdateTrustMember: (newOrUpdated: TrustMember) => void;
|
|
9
|
+
getLegalEntityHandler?(legalEntityId: string): Promise<ExistingLegalEntity>;
|
|
10
|
+
isOrganizationSettlorWithExemptionEnabled?: boolean;
|
|
8
11
|
}
|
|
9
12
|
export interface TrustMemberSchema {
|
|
10
13
|
roleAndEntityType: TrustRoleAndEntityTypeSchema;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LegalEntityType } from '../../core/models/api/legal-entity-type';
|
|
2
2
|
import { TrustMemberType, TrustMemberTypes } from '../../core/models/api/trust-member-type';
|
|
3
|
+
import { CountryCode } from '../../core/models/country-code';
|
|
3
4
|
import { IsNewEntity } from '../../utils/isNewEntity';
|
|
4
5
|
import { SettlorExemptionReason, TrustMemberLegalEntityType } from '../TrustRoleAndEntityType/types';
|
|
5
6
|
/**
|
|
@@ -35,6 +36,7 @@ export interface CompanyTrustMember {
|
|
|
35
36
|
legalEntityId: string | IsNewEntity;
|
|
36
37
|
name: string;
|
|
37
38
|
ownerId?: string;
|
|
39
|
+
country?: CountryCode;
|
|
38
40
|
}
|
|
39
41
|
/**
|
|
40
42
|
* Exempt settlors are bare-bones individual LEs also linked via {@link LegalEntity.entityAssociations}, but their association contains some special fields.
|
|
@@ -43,13 +45,15 @@ export interface CompanyTrustMember {
|
|
|
43
45
|
export interface ExemptSettlor {
|
|
44
46
|
trustMemberType: 'exemptSettlor';
|
|
45
47
|
roles: [TrustMemberTypes.SETTLOR];
|
|
46
|
-
legalEntityType: LegalEntityType.INDIVIDUAL;
|
|
48
|
+
legalEntityType: LegalEntityType.INDIVIDUAL | LegalEntityType.ORGANIZATION;
|
|
47
49
|
legalEntityId: string | IsNewEntity;
|
|
48
50
|
settlorExemptionReason: SettlorExemptionReason[];
|
|
49
|
-
exemptSettlorName
|
|
51
|
+
exemptSettlorName?: {
|
|
50
52
|
firstName: string;
|
|
51
53
|
lastName: string;
|
|
52
54
|
};
|
|
55
|
+
country?: CountryCode;
|
|
56
|
+
name?: string;
|
|
53
57
|
}
|
|
54
58
|
/**
|
|
55
59
|
* Undefined beneficiaries are not LEs, and are instead found in {@link LegalEntity.trust.undefinedBeneficiaryInfo}, *not* in {@link LegalEntity.entityAssociations}.
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { BaseInnerFormProps } from '../../core/hooks/useForm';
|
|
2
|
+
import { ExistingLegalEntity } from '../../core/models/api/legal-entity';
|
|
2
3
|
import { LegalEntityType } from '../../core/models/api/legal-entity-type';
|
|
3
4
|
import { TrustMemberType } from '../../core/models/api/trust-member-type';
|
|
5
|
+
import { CountryCode } from '../../core/models/country-code';
|
|
6
|
+
import { CompanyNameAndCountrySchema } from '../CompanyNameAndCountry/types';
|
|
4
7
|
import { NameSchema } from '../internal/Name/types';
|
|
5
8
|
import { TrustMember } from '../TrustMembers/types';
|
|
6
9
|
export declare const trustMemberLegalEntityTypes: readonly [LegalEntityType.INDIVIDUAL, LegalEntityType.ORGANIZATION];
|
|
@@ -14,11 +17,17 @@ export interface TrustRoleAndEntityTypeSchema extends NameSchema {
|
|
|
14
17
|
entityType?: TrustMemberLegalEntityType;
|
|
15
18
|
descriptionUndefinedBeneficiary?: string;
|
|
16
19
|
settlorExemptionReason?: SettlorExemptionReasonWithNoneOfTheAbove[];
|
|
20
|
+
companyDetails?: CompanyNameAndCountrySchema;
|
|
21
|
+
country?: CountryCode;
|
|
22
|
+
legalCompanyName?: string;
|
|
17
23
|
}
|
|
18
24
|
export interface TrustRoleAndEntityTypeProps extends BaseInnerFormProps<TrustRoleAndEntityTypeSchema> {
|
|
19
25
|
existingTrustMember?: TrustMember;
|
|
26
|
+
getLegalEntityHandler?(legalEntityId: string): Promise<ExistingLegalEntity>;
|
|
27
|
+
isOrganizationSettlorWithExemptionEnabled?: boolean;
|
|
20
28
|
}
|
|
21
29
|
export declare const couldBeExemptSettlor: (data: TrustRoleAndEntityTypeSchema) => boolean;
|
|
22
30
|
export declare const isExemptSettlor: (data: TrustRoleAndEntityTypeSchema) => data is TrustRoleAndEntityTypeSchema & {
|
|
23
31
|
settlorExemptionReason: SettlorExemptionReason[];
|
|
24
32
|
};
|
|
33
|
+
export declare const isOrganizationAndSettlor: (data: TrustRoleAndEntityTypeSchema) => boolean;
|