@adyen/kyc-components 2.15.0 → 2.16.0
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 +181 -42
- 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]: {
|
|
@@ -17096,6 +17096,7 @@ function BankAccountFormat(props) {
|
|
|
17096
17096
|
var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
|
|
17097
17097
|
ExperimentNames2["EnableTrustFlow"] = "EnableTrustFlow";
|
|
17098
17098
|
ExperimentNames2["OnlyAllowAlphanumericBankAccountNumbers"] = "OnlyAllowAlphanumericBankAccountNumbers";
|
|
17099
|
+
ExperimentNames2["OrganizationSettlorWithExemptionReason"] = "OrganizationSettlorWithExemptionReason";
|
|
17099
17100
|
return ExperimentNames2;
|
|
17100
17101
|
})(ExperimentNames || {});
|
|
17101
17102
|
const stripNonAlphanumeric = (value) => value.replaceAll(/[^0-9a-zA-Z]/g, "");
|
|
@@ -21565,15 +21566,17 @@ const getFallbackName = (exemptSettlorAssociation) => {
|
|
|
21565
21566
|
};
|
|
21566
21567
|
const convertEntityAssociationIntoTrustMember = (association, associations, exemptSettlorLE) => {
|
|
21567
21568
|
var _a;
|
|
21568
|
-
if (association.settlorExemptionReason)
|
|
21569
|
+
if (association.settlorExemptionReason) {
|
|
21569
21570
|
return {
|
|
21570
21571
|
trustMemberType: "exemptSettlor",
|
|
21571
21572
|
roles: [TrustMemberTypes.SETTLOR],
|
|
21572
|
-
legalEntityType:
|
|
21573
|
+
legalEntityType: association.entityType,
|
|
21573
21574
|
legalEntityId: association.legalEntityId,
|
|
21574
21575
|
settlorExemptionReason: association.settlorExemptionReason,
|
|
21575
|
-
exemptSettlorName: ((_a = exemptSettlorLE == null ? void 0 : exemptSettlorLE.individual) == null ? void 0 : _a.name) ?? getFallbackName(association)
|
|
21576
|
+
exemptSettlorName: association.entityType === LegalEntityType.INDIVIDUAL ? ((_a = exemptSettlorLE == null ? void 0 : exemptSettlorLE.individual) == null ? void 0 : _a.name) ?? getFallbackName(association) : void 0,
|
|
21577
|
+
name: association.name
|
|
21576
21578
|
};
|
|
21579
|
+
}
|
|
21577
21580
|
if (association.entityType === LegalEntityType.ORGANIZATION)
|
|
21578
21581
|
return {
|
|
21579
21582
|
trustMemberType: "company",
|
|
@@ -21629,6 +21632,7 @@ const getTrustMembers = (trustLE, rootLegalEntity, exemptSettlorLE) => {
|
|
|
21629
21632
|
return [mapRootLegalEntityToTrustMember(rootLegalEntity), ...mapEntityAssociationsToTrustMembers(trustLE.id, trustLE.entityAssociations ?? [], exemptSettlorLE), ...mapUndefinedBeneficiaryInfoToTrustMembers(((_a = trustLE.trust) == null ? void 0 : _a.undefinedBeneficiaryInfo) ?? [])];
|
|
21630
21633
|
};
|
|
21631
21634
|
const mapTrustMemberToEntityAssociations = (trustMember) => {
|
|
21635
|
+
var _a, _b;
|
|
21632
21636
|
if (trustMember.legalEntityId === isNewEntity) {
|
|
21633
21637
|
throw Error("Cannot map a new trust member, you must create it first");
|
|
21634
21638
|
}
|
|
@@ -21638,7 +21642,7 @@ const mapTrustMemberToEntityAssociations = (trustMember) => {
|
|
|
21638
21642
|
entityType: trustMember.legalEntityType,
|
|
21639
21643
|
type: TrustMemberTypes.SETTLOR,
|
|
21640
21644
|
settlorExemptionReason: trustMember.settlorExemptionReason,
|
|
21641
|
-
name: `${trustMember.exemptSettlorName.firstName} ${trustMember.exemptSettlorName.lastName}`
|
|
21645
|
+
name: trustMember.legalEntityType === LegalEntityType.INDIVIDUAL ? `${(_a = trustMember.exemptSettlorName) == null ? void 0 : _a.firstName} ${(_b = trustMember.exemptSettlorName) == null ? void 0 : _b.lastName}` : trustMember.name ?? ""
|
|
21642
21646
|
}];
|
|
21643
21647
|
return trustMember.roles.map((role2) => ({
|
|
21644
21648
|
legalEntityId: trustMember.legalEntityId,
|
|
@@ -21681,12 +21685,13 @@ const createExemptSettlor = async ({
|
|
|
21681
21685
|
trust,
|
|
21682
21686
|
handleCreateLegalEntity
|
|
21683
21687
|
}) => {
|
|
21688
|
+
var _a, _b;
|
|
21684
21689
|
const exemptSettlorLE = {
|
|
21685
21690
|
type: LegalEntityType.INDIVIDUAL,
|
|
21686
21691
|
individual: {
|
|
21687
21692
|
name: {
|
|
21688
|
-
firstName: exemptSettlor.exemptSettlorName.firstName,
|
|
21689
|
-
lastName: exemptSettlor.exemptSettlorName.lastName
|
|
21693
|
+
firstName: ((_a = exemptSettlor.exemptSettlorName) == null ? void 0 : _a.firstName) ?? "",
|
|
21694
|
+
lastName: ((_b = exemptSettlor.exemptSettlorName) == null ? void 0 : _b.lastName) ?? ""
|
|
21690
21695
|
},
|
|
21691
21696
|
residentialAddress: {
|
|
21692
21697
|
country: trust.trust.registeredAddress.country
|
|
@@ -21695,6 +21700,21 @@ const createExemptSettlor = async ({
|
|
|
21695
21700
|
};
|
|
21696
21701
|
return handleCreateLegalEntity(exemptSettlorLE);
|
|
21697
21702
|
};
|
|
21703
|
+
const createOrganizationExemptSettlor = async ({
|
|
21704
|
+
exemptSettlor,
|
|
21705
|
+
handleCreateLegalEntity
|
|
21706
|
+
}) => {
|
|
21707
|
+
const exemptSettlorLE = {
|
|
21708
|
+
type: LegalEntityType.ORGANIZATION,
|
|
21709
|
+
organization: {
|
|
21710
|
+
legalName: exemptSettlor.name ?? "",
|
|
21711
|
+
registeredAddress: {
|
|
21712
|
+
country: exemptSettlor.country
|
|
21713
|
+
}
|
|
21714
|
+
}
|
|
21715
|
+
};
|
|
21716
|
+
return handleCreateLegalEntity(exemptSettlorLE);
|
|
21717
|
+
};
|
|
21698
21718
|
const deleteAssociatedTrustMember = async ({
|
|
21699
21719
|
associatedTrustMember,
|
|
21700
21720
|
trust,
|
|
@@ -21725,11 +21745,26 @@ const updateExemptSettlorName = async ({
|
|
|
21725
21745
|
exemptSettlor,
|
|
21726
21746
|
handleUpdateLegalEntity
|
|
21727
21747
|
}) => {
|
|
21748
|
+
var _a, _b;
|
|
21728
21749
|
const exemptSettlorPatch = {
|
|
21729
21750
|
individual: {
|
|
21730
21751
|
name: {
|
|
21731
|
-
firstName: exemptSettlor.exemptSettlorName.firstName,
|
|
21732
|
-
lastName: exemptSettlor.exemptSettlorName.lastName
|
|
21752
|
+
firstName: (_a = exemptSettlor.exemptSettlorName) == null ? void 0 : _a.firstName,
|
|
21753
|
+
lastName: (_b = exemptSettlor.exemptSettlorName) == null ? void 0 : _b.lastName
|
|
21754
|
+
}
|
|
21755
|
+
}
|
|
21756
|
+
};
|
|
21757
|
+
return handleUpdateLegalEntity(exemptSettlorPatch, exemptSettlor.legalEntityId);
|
|
21758
|
+
};
|
|
21759
|
+
const updateOrganizationExemptSettlorName = async ({
|
|
21760
|
+
exemptSettlor,
|
|
21761
|
+
handleUpdateLegalEntity
|
|
21762
|
+
}) => {
|
|
21763
|
+
const exemptSettlorPatch = {
|
|
21764
|
+
organization: {
|
|
21765
|
+
legalName: exemptSettlor.name,
|
|
21766
|
+
registeredAddress: {
|
|
21767
|
+
country: exemptSettlor.country
|
|
21733
21768
|
}
|
|
21734
21769
|
}
|
|
21735
21770
|
};
|
|
@@ -23182,10 +23217,11 @@ const ExemptSettlorTaskItem = ({
|
|
|
23182
23217
|
onEdit,
|
|
23183
23218
|
onDelete
|
|
23184
23219
|
}) => {
|
|
23220
|
+
var _a, _b;
|
|
23185
23221
|
const {
|
|
23186
23222
|
i18n
|
|
23187
23223
|
} = useI18nContext();
|
|
23188
|
-
const settlorName = `${exemptSettlor.exemptSettlorName.firstName} ${exemptSettlor.exemptSettlorName.lastName}
|
|
23224
|
+
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
23225
|
const actions = [{
|
|
23190
23226
|
icon: "edit",
|
|
23191
23227
|
onSelect: onEdit,
|
|
@@ -24940,6 +24976,7 @@ const convertExistingSettlorExemptionReasons = (existingReasons) => {
|
|
|
24940
24976
|
return existingReasons;
|
|
24941
24977
|
};
|
|
24942
24978
|
const convertExistingTrustMember = (trustMember) => {
|
|
24979
|
+
var _a, _b;
|
|
24943
24980
|
switch (trustMember.trustMemberType) {
|
|
24944
24981
|
case "undefinedBeneficiary":
|
|
24945
24982
|
return {
|
|
@@ -24949,6 +24986,13 @@ const convertExistingTrustMember = (trustMember) => {
|
|
|
24949
24986
|
};
|
|
24950
24987
|
case "regular":
|
|
24951
24988
|
case "company":
|
|
24989
|
+
return {
|
|
24990
|
+
entityType: trustMember.legalEntityType,
|
|
24991
|
+
role: trustMember.roles,
|
|
24992
|
+
settlorExemptionReason: ["noneOfTheAbove"],
|
|
24993
|
+
country: trustMember.trustMemberType === "company" ? trustMember.country : void 0,
|
|
24994
|
+
legalCompanyName: trustMember.trustMemberType === "company" ? trustMember.name : void 0
|
|
24995
|
+
};
|
|
24952
24996
|
case "rootTrustee":
|
|
24953
24997
|
return {
|
|
24954
24998
|
entityType: trustMember.legalEntityType,
|
|
@@ -24957,11 +25001,13 @@ const convertExistingTrustMember = (trustMember) => {
|
|
|
24957
25001
|
};
|
|
24958
25002
|
case "exemptSettlor":
|
|
24959
25003
|
return {
|
|
24960
|
-
entityType:
|
|
25004
|
+
entityType: trustMember.legalEntityType,
|
|
24961
25005
|
role: ["settlor"],
|
|
24962
25006
|
settlorExemptionReason: convertExistingSettlorExemptionReasons(trustMember.settlorExemptionReason),
|
|
24963
|
-
firstName: trustMember.exemptSettlorName.firstName,
|
|
24964
|
-
lastName: trustMember.exemptSettlorName.lastName
|
|
25007
|
+
firstName: (_a = trustMember.exemptSettlorName) == null ? void 0 : _a.firstName,
|
|
25008
|
+
lastName: (_b = trustMember.exemptSettlorName) == null ? void 0 : _b.lastName,
|
|
25009
|
+
legalCompanyName: trustMember.name,
|
|
25010
|
+
country: trustMember.country
|
|
24965
25011
|
};
|
|
24966
25012
|
}
|
|
24967
25013
|
};
|
|
@@ -24985,6 +25031,10 @@ const isExemptSettlor = (data) => {
|
|
|
24985
25031
|
var _a;
|
|
24986
25032
|
return ((_a = data.settlorExemptionReason) == null ? void 0 : _a.some((reason) => reason !== "noneOfTheAbove")) ?? false;
|
|
24987
25033
|
};
|
|
25034
|
+
const isOrganizationAndSettlor = (data) => {
|
|
25035
|
+
var _a;
|
|
25036
|
+
return data.entityType === LegalEntityType.ORGANIZATION && ((_a = data.role) == null ? void 0 : _a.length) === 1 && data.role[0] === "settlor";
|
|
25037
|
+
};
|
|
24988
25038
|
const roleAndTypeValidationRules = {
|
|
24989
25039
|
entityType: {
|
|
24990
25040
|
modes: ["blur"],
|
|
@@ -25005,6 +25055,16 @@ const roleAndTypeValidationRules = {
|
|
|
25005
25055
|
modes: ["blur"],
|
|
25006
25056
|
validate: (reasons) => Boolean(reasons == null ? void 0 : reasons.length),
|
|
25007
25057
|
errorMessage: "fieldIsRequired"
|
|
25058
|
+
},
|
|
25059
|
+
country: {
|
|
25060
|
+
modes: ["blur"],
|
|
25061
|
+
validate: (country2) => !!country2,
|
|
25062
|
+
errorMessage: "fieldIsRequired"
|
|
25063
|
+
},
|
|
25064
|
+
legalCompanyName: {
|
|
25065
|
+
modes: ["blur"],
|
|
25066
|
+
validate: (name) => !!name,
|
|
25067
|
+
errorMessage: "fieldIsRequired"
|
|
25008
25068
|
}
|
|
25009
25069
|
};
|
|
25010
25070
|
const CHARACTERS_LIMIT = 256;
|
|
@@ -25020,29 +25080,34 @@ const leTypeCardDetails = {
|
|
|
25020
25080
|
description: "businessEntityDescription"
|
|
25021
25081
|
}
|
|
25022
25082
|
};
|
|
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
25083
|
const TrustRoleAndEntityType = (props) => {
|
|
25037
25084
|
const {
|
|
25038
25085
|
existingTrustMember,
|
|
25039
|
-
id: id2
|
|
25086
|
+
id: id2,
|
|
25087
|
+
getLegalEntityHandler,
|
|
25088
|
+
isOrganizationSettlorWithExemptionEnabled
|
|
25040
25089
|
} = props;
|
|
25041
25090
|
const {
|
|
25042
25091
|
i18n
|
|
25043
25092
|
} = useI18nContext();
|
|
25044
25093
|
const defaultData = existingTrustMember ? convertExistingTrustMember(existingTrustMember) : {};
|
|
25045
25094
|
const formUtils = formUtilities(props, i18n);
|
|
25095
|
+
const decideFields = (data2) => {
|
|
25096
|
+
var _a, _b;
|
|
25097
|
+
if ((_a = data2.role) == null ? void 0 : _a.includes("undefinedBeneficiary")) {
|
|
25098
|
+
return ["role", "descriptionUndefinedBeneficiary"];
|
|
25099
|
+
}
|
|
25100
|
+
if ((_b = data2.role) == null ? void 0 : _b.length) {
|
|
25101
|
+
if (isOrganizationSettlorWithExemptionEnabled && isOrganizationAndSettlor(data2)) {
|
|
25102
|
+
return ["role", "entityType", "settlorExemptionReason", "country", "legalCompanyName"];
|
|
25103
|
+
}
|
|
25104
|
+
if (couldBeExemptSettlor(data2)) {
|
|
25105
|
+
return isExemptSettlor(data2) ? ["role", "entityType", "settlorExemptionReason", "firstName", "lastName"] : ["role", "entityType", "settlorExemptionReason"];
|
|
25106
|
+
}
|
|
25107
|
+
return ["role", "entityType"];
|
|
25108
|
+
}
|
|
25109
|
+
return ["role"];
|
|
25110
|
+
};
|
|
25046
25111
|
const {
|
|
25047
25112
|
data,
|
|
25048
25113
|
valid,
|
|
@@ -25062,6 +25127,18 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
25062
25127
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
25063
25128
|
});
|
|
25064
25129
|
const availableRoles = getAvailableRoles(data.role);
|
|
25130
|
+
useEffect(() => {
|
|
25131
|
+
(async () => {
|
|
25132
|
+
var _a;
|
|
25133
|
+
if (isOrganizationSettlorWithExemptionEnabled && existingTrustMember && existingTrustMember.trustMemberType === "exemptSettlor" && existingTrustMember.legalEntityId !== "isNewEntry" && existingTrustMember.roles !== void 0 && existingTrustMember.roles.length === 1 && existingTrustMember.roles[0] === "settlor" && getLegalEntityHandler) {
|
|
25134
|
+
const response = await getLegalEntityHandler(existingTrustMember.legalEntityId);
|
|
25135
|
+
const country2 = (_a = response == null ? void 0 : response.organization) == null ? void 0 : _a.registeredAddress.country;
|
|
25136
|
+
if (response && response.organization) {
|
|
25137
|
+
handleChangeFor("country")(country2);
|
|
25138
|
+
}
|
|
25139
|
+
}
|
|
25140
|
+
})();
|
|
25141
|
+
}, []);
|
|
25065
25142
|
useEffect(() => {
|
|
25066
25143
|
var _a;
|
|
25067
25144
|
(_a = props.onChange) == null ? void 0 : _a.call(props, {
|
|
@@ -25109,6 +25186,13 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
25109
25186
|
setValid("lastName", valid2.lastName);
|
|
25110
25187
|
setErrors("lastName", errors2.lastName);
|
|
25111
25188
|
};
|
|
25189
|
+
const onEntityTypeChange = (value) => {
|
|
25190
|
+
var _a;
|
|
25191
|
+
if (isOrganizationSettlorWithExemptionEnabled && value === LegalEntityType.ORGANIZATION && ((_a = data.role) == null ? void 0 : _a.length) === 1 && data.role[0] === "settlor") {
|
|
25192
|
+
changeSettlorExemptionReasons(["professionalServiceProvider"]);
|
|
25193
|
+
}
|
|
25194
|
+
handleChangeFor("entityType")(value);
|
|
25195
|
+
};
|
|
25112
25196
|
return jsxs("form", {
|
|
25113
25197
|
className: "adyen-kyc-trust__role-and-entity-type adl-u-width-full",
|
|
25114
25198
|
children: [jsx(FormHeader, {
|
|
@@ -25146,7 +25230,7 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
25146
25230
|
children: (childProps) => jsx(RadioCardSelect, {
|
|
25147
25231
|
...childProps,
|
|
25148
25232
|
options: trustMemberLegalEntityTypes,
|
|
25149
|
-
onSelect:
|
|
25233
|
+
onSelect: onEntityTypeChange,
|
|
25150
25234
|
selected: data.entityType,
|
|
25151
25235
|
optionId: (option) => leTypeCardDetails[option].id,
|
|
25152
25236
|
optionName: (option) => leTypeCardDetails[option].name,
|
|
@@ -25172,7 +25256,7 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
25172
25256
|
"aria-label": formUtils.getLabel("descriptionUndefinedBeneficiary"),
|
|
25173
25257
|
"aria-invalid": !valid.descriptionUndefinedBeneficiary
|
|
25174
25258
|
})
|
|
25175
|
-
}), (schema == null ? void 0 : schema.includes("settlorExemptionReason")) && jsx(Field, {
|
|
25259
|
+
}), (schema == null ? void 0 : schema.includes("settlorExemptionReason")) && !isOrganizationAndSettlor(data) && jsx(Field, {
|
|
25176
25260
|
name: "settlorExemptionReason",
|
|
25177
25261
|
label: formUtils.getLabel("settlorExemptionReason", "whichOfTheseApplyToTheSettlor"),
|
|
25178
25262
|
isValid: valid.settlorExemptionReason,
|
|
@@ -25203,6 +25287,27 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
25203
25287
|
},
|
|
25204
25288
|
onChange: onNameChange,
|
|
25205
25289
|
dataStoreId: id2
|
|
25290
|
+
}) : void 0, isOrganizationSettlorWithExemptionEnabled && (schema == null ? void 0 : schema.includes("country")) && (schema == null ? void 0 : schema.includes("legalCompanyName")) ? jsxs(Fragment, {
|
|
25291
|
+
children: [jsx(CountryField, {
|
|
25292
|
+
data: formUtils.getFieldData(data, COUNTRY_FIELD),
|
|
25293
|
+
valid: formUtils.getFieldValid(valid, COUNTRY_FIELD),
|
|
25294
|
+
errors: formUtils.getFieldErrors(errors, fieldProblems, COUNTRY_FIELD),
|
|
25295
|
+
labels: formUtils.getFieldLabels(COUNTRY_FIELD),
|
|
25296
|
+
readonly: false,
|
|
25297
|
+
classNameModifiers: COUNTRY_FIELD,
|
|
25298
|
+
allowedCountries: [],
|
|
25299
|
+
handleChangeFor
|
|
25300
|
+
}), jsx(LegalCompanyNameField, {
|
|
25301
|
+
data: formUtils.getFieldData(data, LEGAL_COMPANY_NAME_FIELD),
|
|
25302
|
+
valid: formUtils.getFieldValid(valid, LEGAL_COMPANY_NAME_FIELD),
|
|
25303
|
+
errors: formUtils.getFieldErrors(errors, fieldProblems, LEGAL_COMPANY_NAME_FIELD),
|
|
25304
|
+
labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
|
|
25305
|
+
helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
|
|
25306
|
+
legalCompanyName: "legalCompanyName__helperText"
|
|
25307
|
+
}),
|
|
25308
|
+
readonly: false,
|
|
25309
|
+
handleChangeFor
|
|
25310
|
+
})]
|
|
25206
25311
|
}) : void 0]
|
|
25207
25312
|
});
|
|
25208
25313
|
};
|
|
@@ -25252,11 +25357,22 @@ const decideForms = (trustMember) => {
|
|
|
25252
25357
|
return regularForms;
|
|
25253
25358
|
}
|
|
25254
25359
|
};
|
|
25255
|
-
const convertDataToTrustMember = (data, existingTrustMember) => {
|
|
25360
|
+
const convertDataToTrustMember = (data, existingTrustMember, isOrganizationSettlorWithExemptionReasonEnabled2 = false) => {
|
|
25256
25361
|
var _a;
|
|
25257
25362
|
const existingId = existingTrustMember ? existingTrustMember.trustMemberType === "undefinedBeneficiary" ? existingTrustMember.reference : existingTrustMember.legalEntityId : void 0;
|
|
25258
25363
|
if ((_a = data.role) == null ? void 0 : _a.length) {
|
|
25259
|
-
if (isExemptSettlor(data))
|
|
25364
|
+
if (isExemptSettlor(data)) {
|
|
25365
|
+
if (isOrganizationSettlorWithExemptionReasonEnabled2 && data.entityType === LegalEntityType.ORGANIZATION) {
|
|
25366
|
+
return {
|
|
25367
|
+
trustMemberType: "exemptSettlor",
|
|
25368
|
+
roles: [TrustMemberTypes.SETTLOR],
|
|
25369
|
+
legalEntityType: LegalEntityType.ORGANIZATION,
|
|
25370
|
+
legalEntityId: existingId ?? isNewEntity,
|
|
25371
|
+
name: data.legalCompanyName ?? "",
|
|
25372
|
+
settlorExemptionReason: ["professionalServiceProvider"],
|
|
25373
|
+
country: data.country
|
|
25374
|
+
};
|
|
25375
|
+
}
|
|
25260
25376
|
return {
|
|
25261
25377
|
trustMemberType: "exemptSettlor",
|
|
25262
25378
|
roles: [TrustMemberTypes.SETTLOR],
|
|
@@ -25268,6 +25384,7 @@ const convertDataToTrustMember = (data, existingTrustMember) => {
|
|
|
25268
25384
|
},
|
|
25269
25385
|
legalEntityId: existingId ?? isNewEntity
|
|
25270
25386
|
};
|
|
25387
|
+
}
|
|
25271
25388
|
if (data.role.includes("undefinedBeneficiary"))
|
|
25272
25389
|
return {
|
|
25273
25390
|
trustMemberType: "undefinedBeneficiary",
|
|
@@ -25275,14 +25392,16 @@ const convertDataToTrustMember = (data, existingTrustMember) => {
|
|
|
25275
25392
|
description: data.descriptionUndefinedBeneficiary ?? "",
|
|
25276
25393
|
reference: existingId ?? isNewEntity
|
|
25277
25394
|
};
|
|
25278
|
-
if (data.entityType === LegalEntityType.ORGANIZATION)
|
|
25395
|
+
if (data.entityType === LegalEntityType.ORGANIZATION) {
|
|
25279
25396
|
return {
|
|
25280
25397
|
trustMemberType: "company",
|
|
25281
25398
|
roles: data.role,
|
|
25282
25399
|
legalEntityType: LegalEntityType.ORGANIZATION,
|
|
25283
25400
|
legalEntityId: existingId ?? isNewEntity,
|
|
25284
|
-
name: ""
|
|
25401
|
+
name: data.legalCompanyName ?? "",
|
|
25402
|
+
country: data.country
|
|
25285
25403
|
};
|
|
25404
|
+
}
|
|
25286
25405
|
if (data.entityType === LegalEntityType.INDIVIDUAL)
|
|
25287
25406
|
return {
|
|
25288
25407
|
trustMemberType: "regular",
|
|
@@ -25298,8 +25417,11 @@ function RoleAndTypeDropinComponent({
|
|
|
25298
25417
|
existingTrustMember,
|
|
25299
25418
|
navigateToFullDropinFor,
|
|
25300
25419
|
navigateBack,
|
|
25301
|
-
addOrUpdateTrustMember
|
|
25420
|
+
addOrUpdateTrustMember,
|
|
25421
|
+
getLegalEntityHandler,
|
|
25422
|
+
isOrganizationSettlorWithExemptionEnabled
|
|
25302
25423
|
}) {
|
|
25424
|
+
var _a, _b;
|
|
25303
25425
|
const {
|
|
25304
25426
|
i18n
|
|
25305
25427
|
} = useI18nContext();
|
|
@@ -25320,8 +25442,10 @@ function RoleAndTypeDropinComponent({
|
|
|
25320
25442
|
entityType: trustMember.trustMemberType !== "undefinedBeneficiary" ? i18n.get(trustMember.legalEntityType) : void 0,
|
|
25321
25443
|
descriptionUndefinedBeneficiary: trustMember.trustMemberType === "undefinedBeneficiary" ? trustMember.description : void 0,
|
|
25322
25444
|
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
|
|
25445
|
+
firstName: trustMember.trustMemberType === "exemptSettlor" ? (_a = trustMember.exemptSettlorName) == null ? void 0 : _a.firstName : void 0,
|
|
25446
|
+
lastName: trustMember.trustMemberType === "exemptSettlor" ? (_b = trustMember.exemptSettlorName) == null ? void 0 : _b.lastName : void 0,
|
|
25447
|
+
country: isOrganizationSettlorWithExemptionEnabled && trustMember.trustMemberType === "exemptSettlor" ? trustMember.country : void 0,
|
|
25448
|
+
legalCompanyName: isOrganizationSettlorWithExemptionEnabled && trustMember.trustMemberType === "exemptSettlor" ? trustMember.name : void 0
|
|
25325
25449
|
}
|
|
25326
25450
|
};
|
|
25327
25451
|
const onNavigateToNextStep = () => {
|
|
@@ -25342,7 +25466,7 @@ function RoleAndTypeDropinComponent({
|
|
|
25342
25466
|
[dataStoreId]: isValid
|
|
25343
25467
|
});
|
|
25344
25468
|
}
|
|
25345
|
-
setTrustMember(convertDataToTrustMember(data, existingTrustMember));
|
|
25469
|
+
setTrustMember(convertDataToTrustMember(data, existingTrustMember, isOrganizationSettlorWithExemptionEnabled));
|
|
25346
25470
|
};
|
|
25347
25471
|
const saveRolesAndNavigate = async () => {
|
|
25348
25472
|
if (trustMember === "incomplete")
|
|
@@ -25388,7 +25512,9 @@ function RoleAndTypeDropinComponent({
|
|
|
25388
25512
|
id: "roleAndEntityType",
|
|
25389
25513
|
existingTrustMember,
|
|
25390
25514
|
onChange: onTrustMemberChange,
|
|
25391
|
-
shouldValidate
|
|
25515
|
+
shouldValidate,
|
|
25516
|
+
getLegalEntityHandler,
|
|
25517
|
+
isOrganizationSettlorWithExemptionEnabled
|
|
25392
25518
|
})
|
|
25393
25519
|
}), isSummaryStep && jsx("div", {
|
|
25394
25520
|
className: "adyen-kyc-form-wrapper",
|
|
@@ -26807,6 +26933,7 @@ function TrustDropinComponent(props) {
|
|
|
26807
26933
|
const PAGES_WITH_STATUS = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
|
|
26808
26934
|
const POLLING_INTERVAL = 3e3;
|
|
26809
26935
|
const logger$5 = createLogger("DropinComposerComponent");
|
|
26936
|
+
const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country2) => country2 === CountryCodes.Australia && enabled;
|
|
26810
26937
|
function DropinComposerComponent({
|
|
26811
26938
|
capabilities,
|
|
26812
26939
|
legalEntityResponse,
|
|
@@ -26865,6 +26992,7 @@ function DropinComposerComponent({
|
|
|
26865
26992
|
const hasTrust = isExperimentEnabled("EnableTrustFlow") && (accountHolder2 === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse));
|
|
26866
26993
|
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
26994
|
const additionalSalesChannels = useSalesChannelsSettings();
|
|
26995
|
+
const isOrganizationSettlorWithExemptionEnabled = isOrganizationSettlorWithExemptionReasonEnabled(isExperimentEnabled("OrganizationSettlorWithExemptionReason"), trust == null ? void 0 : trust.trust.countryOfGoverningLaw);
|
|
26868
26996
|
const getLegalEntityProblems = (le) => {
|
|
26869
26997
|
var _a2;
|
|
26870
26998
|
if (le == null ? void 0 : le.id) {
|
|
@@ -27054,7 +27182,10 @@ function DropinComposerComponent({
|
|
|
27054
27182
|
break;
|
|
27055
27183
|
case "exemptSettlor":
|
|
27056
27184
|
if (!existing) {
|
|
27057
|
-
const newSettlorLE = await
|
|
27185
|
+
const newSettlorLE = isOrganizationSettlorWithExemptionEnabled && updated.legalEntityType === "organization" ? await createOrganizationExemptSettlor({
|
|
27186
|
+
exemptSettlor: updated,
|
|
27187
|
+
handleCreateLegalEntity: args.handleCreateLegalEntity
|
|
27188
|
+
}) : await createExemptSettlor({
|
|
27058
27189
|
exemptSettlor: updated,
|
|
27059
27190
|
trust,
|
|
27060
27191
|
handleCreateLegalEntity: args.handleCreateLegalEntity
|
|
@@ -27067,6 +27198,12 @@ function DropinComposerComponent({
|
|
|
27067
27198
|
handleUpdateLegalEntity: args.handleUpdateLegalEntity
|
|
27068
27199
|
});
|
|
27069
27200
|
}
|
|
27201
|
+
if (existing && isOrganizationSettlorWithExemptionEnabled && updated.legalEntityType === "organization") {
|
|
27202
|
+
await updateOrganizationExemptSettlorName({
|
|
27203
|
+
exemptSettlor: updated,
|
|
27204
|
+
handleUpdateLegalEntity: args.handleUpdateLegalEntity
|
|
27205
|
+
});
|
|
27206
|
+
}
|
|
27070
27207
|
await addOrUpdateAssociatedTrustMember({
|
|
27071
27208
|
newOrUpdated: updated,
|
|
27072
27209
|
trust,
|
|
@@ -27599,7 +27736,9 @@ function DropinComposerComponent({
|
|
|
27599
27736
|
navigateBack();
|
|
27600
27737
|
},
|
|
27601
27738
|
existingTrustMember: trustMember,
|
|
27602
|
-
addOrUpdateTrustMember: (newOrUpdated) => addOrUpdateTrustMember(newOrUpdated, trustMember)
|
|
27739
|
+
addOrUpdateTrustMember: (newOrUpdated) => addOrUpdateTrustMember(newOrUpdated, trustMember),
|
|
27740
|
+
getLegalEntityHandler: args == null ? void 0 : args.handleGetLegalEntity,
|
|
27741
|
+
isOrganizationSettlorWithExemptionEnabled
|
|
27603
27742
|
});
|
|
27604
27743
|
case TaskTypes.PCI_DSS:
|
|
27605
27744
|
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;
|