@adyen/kyc-components 4.13.0-beta.4 → 4.13.0-beta.6
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/{AcceptTermsOfServiceComponent-Bdb6OG0V.js → AcceptTermsOfServiceComponent-CV0tEsZ8.js} +1 -1
- package/dist/{AdaptiveWorkflow-D7JhKxhG.js → AdaptiveWorkflow-BRSkDC27.js} +6 -6
- package/dist/{AdaptiveWorkflowComponent-Dy_7JhR9.js → AdaptiveWorkflowComponent-436q2Z3Q.js} +2 -2
- package/dist/{BusinessFinancingDropin-Bxqli70j.js → BusinessFinancingDropin-DrABikQM.js} +1 -1
- package/dist/{BusinessFinancingPage-DlDZmgJ8.js → BusinessFinancingPage-CSwjPgIJ.js} +2 -2
- package/dist/{CompanyRegistrationNumberTypeSelector-BnoX2hCa.js → CompanyRegistrationNumberTypeSelector-DiImGTFe.js} +50 -14
- package/dist/{ConstitutionalDocument-B5MVwJbp.js → ConstitutionalDocument-CdpVRf0I.js} +12 -8
- package/dist/{CustomerSupport-twU8Nkth.js → CustomerSupport-BXin9crY.js} +1 -1
- package/dist/{DebugModal-B2Ju7JTl.js → DebugModal-DjXxE-RN.js} +2 -2
- package/dist/{DecisionMakerDetailsPage-CAq5na-Z.js → DecisionMakerDetailsPage-BaOxC2U6.js} +1 -1
- package/dist/{IndividualDropin-BdBMJkx4.js → IndividualDropin-BVMDPYDe.js} +22 -14
- package/dist/{InvitedDecisionMakerComponent-C1gqGJsQ.js → InvitedDecisionMakerComponent-B40Lk4i7.js} +2 -2
- package/dist/{LegalRepresentativeDetailsPage-3kuEatCa.js → LegalRepresentativeDetailsPage-Csvg_gjL.js} +1 -1
- package/dist/{PayoutDetailsDropinMultiForm-CFXh9XH3.js → PayoutDetailsDropinMultiForm-CiTh764I.js} +1 -1
- package/dist/{PayoutDetailsPage-Bmgebi3K.js → PayoutDetailsPage-CLt8LJCi.js} +2 -2
- package/dist/{RootBusinessDetailsPage-wB4sdeGV.js → RootBusinessDetailsPage-z94WN2fb.js} +1 -1
- package/dist/{RootBusinessLinesPage-B-zkaI6w.js → RootBusinessLinesPage-B1SNv9er.js} +2 -2
- package/dist/{RootIndividualDetailsPage-Bl622oSy.js → RootIndividualDetailsPage-DE704wL6.js} +1 -1
- package/dist/{SignPCIComponent-CPjxKwUt.js → SignPCIComponent-BPSj_yuH.js} +1 -1
- package/dist/{SoleProprietorshipPage-C_cNHIqc.js → SoleProprietorshipPage-C2gjJZcb.js} +1 -1
- package/dist/{SourceOfFundsPage-_sMwhidd.js → SourceOfFundsPage-DItR3-Hp.js} +1 -1
- package/dist/{TaxInformationField-hjyqzys0.js → TaxInformationField-DlmOFIDl.js} +2 -2
- package/dist/{TaxReportingDropin-Xjf5BXjR.js → TaxReportingDropin-LOUIhV-w.js} +1 -1
- package/dist/{TrustDetailsPage-DDxllsNB.js → TrustDetailsPage-B9sH2X7l.js} +6 -8
- package/dist/{TrustMemberCompanyPage-DlMQRx0x.js → TrustMemberCompanyPage-BnY9tVG7.js} +1 -1
- package/dist/{TrustMemberIndividualPage-B5hPWglh.js → TrustMemberIndividualPage-B4Iqm4MI.js} +1 -1
- package/dist/{UnincorporatedPartnershipIndividualPage-Bfxq3XJj.js → UnincorporatedPartnershipIndividualPage-CUrCUB2E.js} +1 -1
- package/dist/{UnincorporatedPartnershipMemberCompanyPage-UiOIbfiu.js → UnincorporatedPartnershipMemberCompanyPage-Uzsm5Zo2.js} +1 -1
- package/dist/adyen-business-financing.js +3 -3
- package/dist/adyen-individual-configuration.js +3 -3
- package/dist/adyen-individual-status.js +2 -2
- package/dist/adyen-invited-decision-maker.js +2 -2
- package/dist/adyen-onboarding.js +22 -22
- package/dist/adyen-terms-of-service-management.js +2 -2
- package/dist/adyen-terms-of-service-status.js +1 -1
- package/dist/adyen-transfer-instrument-configuration.js +3 -3
- package/dist/adyen-transfer-instrument-management.js +2 -2
- package/dist/adyen-verification-status.js +1 -1
- package/dist/en-US-BqoUncE4.js +7 -0
- package/dist/{resolveEnvironment-BbdLeYP1.js → resolveEnvironment-BI384OW7.js} +6 -6
- package/dist/types/components/Business/forms/CompanyStructure/CompanyStructure.d.ts +1 -1
- package/dist/types/components/Business/forms/rules.constants.d.ts +23 -0
- package/dist/types/components/Business/utils/getAvailableCompanyStructures.d.ts +2 -1
- package/dist/types/components/Individual/forms/IdVerificationMethod/IdVerificationMethod.types.d.ts +1 -0
- package/dist/types/components/Individual/helpers/shouldShowMotionCapture.d.ts +2 -1
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/BusinessRegistrationNumberField.d.ts +1 -1
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/types.d.ts +1 -1
- package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
- package/dist/types/utils/entityStatusUtil.d.ts +1 -1
- package/dist/{useBusinessDetailsData-DPNww87e.js → useBusinessDetailsData-Dw8VtZkI.js} +44 -26
- package/dist/{useMultiForm-BZBzYZ-3.js → useMultiForm-DOQ6_HoL.js} +65 -3
- package/dist/{useNavigate-OMOxhDbP.js → useNavigate-zhguGWRa.js} +20 -20
- package/dist/{utils-DQEnWBYq.js → utils-Cd8I9QM7.js} +48 -23
- package/package.json +1 -1
- package/dist/en-US-Cq6Cl6Yl.js +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
try {
|
|
2
2
|
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
3
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
3
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "08636ddf-7e71-419b-9721-d2dd3298e2f4", e._sentryDebugIdIdentifier = "sentry-dbid-08636ddf-7e71-419b-9721-d2dd3298e2f4");
|
|
4
4
|
} catch (e) {}
|
|
5
5
|
import { i as Typography, o as createLogger, r as useTranslation } from "./translation-BHUZ_WP7.js";
|
|
6
6
|
import { r as Loader, t as Button } from "./Button-BxfzWsRl.js";
|
|
@@ -46,7 +46,7 @@ import { t as StructuredList } from "./StructuredList-S4LIZQiJ.js";
|
|
|
46
46
|
import { t as ErrorPanel } from "./ErrorPanel-CzX5ev6p.js";
|
|
47
47
|
import { n as mergeFieldMetadataIntoProps, t as createFormUtils } from "./formUtils-C7vlzCV-.js";
|
|
48
48
|
import { n as summaryStep, r as Summary_module_default } from "./Summary-DESUnetK.js";
|
|
49
|
-
import { t as useMultiForm } from "./useMultiForm-
|
|
49
|
+
import { t as useMultiForm } from "./useMultiForm-DOQ6_HoL.js";
|
|
50
50
|
import { i as useScenarioConfiguration, r as getPageName, t as mapExistingFile } from "./mapExistingFile-AUOevYJs.js";
|
|
51
51
|
import { t as useTaskLandedEvent } from "./useTaskLandedEvent-BdO8qSBg.js";
|
|
52
52
|
import { a as alphanumericInputs, i as alphaInputs, l as numericInputs, s as makeMask, t as MaskedInput } from "./MaskedInput-WaAdSNPN.js";
|
|
@@ -55,11 +55,11 @@ import { a as mapAddressLabelsNewSummary, c as COUNTRIES_WITH_STATES_DATASET, n
|
|
|
55
55
|
import { i as isValidationError, n as isBusinessSelectionLegalArrangementError, o as processValidationErrors, s as isMaintenanceModeError } from "./validationError-CD5jY1NM.js";
|
|
56
56
|
import { c as getDocument, l as getDocuments, o as createDocumentRequest, p as mergeProofOfOwnershipAttachments, s as documentApiUtils, u as getFileExtention } from "./validate-J6U_ulFs.js";
|
|
57
57
|
import { r as formatObject } from "./utils--gwzjjeS.js";
|
|
58
|
-
import { a as getFieldsWithExistingData, n as TaxInformationField, r as MemoizedDocumentUpload, t as TAX_INFORMATION_FIELD } from "./TaxInformationField-
|
|
58
|
+
import { a as getFieldsWithExistingData, n as TaxInformationField, r as MemoizedDocumentUpload, t as TAX_INFORMATION_FIELD } from "./TaxInformationField-DlmOFIDl.js";
|
|
59
59
|
import { t as isJapanLocalizationEnabled } from "./japanSupportUtils-DqvGrGbm.js";
|
|
60
60
|
import { t as uppercase } from "./uppercase-DKruhEuk.js";
|
|
61
61
|
import { a as validateNotEmptyOnBlur, n as validateJaKanaLegalCompanyName, o as validatePatternOnBlur, t as validateJaHaniLegalCompanyName } from "./patternValidators-DMnU4iGe.js";
|
|
62
|
-
import {
|
|
62
|
+
import { C as taxInformationDefaultFieldConfig, S as getTaxInformationPlaceholderText, _ as getTaxIdNumberOptions, c as isUsingCompanySearch, d as isRegistrationExemptionAllowed, f as countryToTaxInfoTypeMap, h as requestingIssuing, i as COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT, l as rules, m as requestingBanking, o as COUNTRY_OF_GOVERNING_LAW_POSSIBLE, p as getCountryOfGoverningLaw, s as isRegistrationNumberAbsentStateV4Scenario, u as REGISTRATION_NUMBER_EXEMPTION_RULES, v as getValidCompanyTypesForTaxIdNumberType, w as taxInformationDefaultFieldMetadata } from "./utils-Cd8I9QM7.js";
|
|
63
63
|
import { c as useAddressCleanse, s as formatAddressForCleanse } from "./validate-CaRbtwlX.js";
|
|
64
64
|
import { t as resolveFieldMetadata } from "./fieldConfigurations-B3oqm4GC.js";
|
|
65
65
|
import { t as Field } from "./Field-Vzlyifk5.js";
|
|
@@ -84,10 +84,10 @@ import { a as LegalFormField, i as InputCurrency, n as Currency, o as mapFinanci
|
|
|
84
84
|
import { n as SummarySection, t as NewSummary } from "./NewSummary-Cf1CesDB.js";
|
|
85
85
|
import { t as useTaskStatus } from "./useTaskStatus-DPyTD_Ko.js";
|
|
86
86
|
import { t as ListItem } from "./ListItem-BzSnYlO1.js";
|
|
87
|
-
import { a as getValidCompanyTypesForRegistrationNumberType, c as getRegistrationNumberHelperText, i as getCompanyRegistrationNumberOptions, l as registrationNumberDefaultFieldConfig, n as getDefaultRegistrationNumberType, r as inferCompanyRegistrationNumberType, s as exemptFromRegistrationNumberDefaultFieldMetadata, u as registrationNumberDefaultFieldMetadata } from "./CompanyRegistrationNumberTypeSelector-
|
|
87
|
+
import { a as getValidCompanyTypesForRegistrationNumberType, c as getRegistrationNumberHelperText, i as getCompanyRegistrationNumberOptions, l as registrationNumberDefaultFieldConfig, n as getDefaultRegistrationNumberType, r as inferCompanyRegistrationNumberType, s as exemptFromRegistrationNumberDefaultFieldMetadata, u as registrationNumberDefaultFieldMetadata } from "./CompanyRegistrationNumberTypeSelector-DiImGTFe.js";
|
|
88
88
|
import { n as useCreateBusinessLine, r as useIndustryCodes, t as useUpdateBusinessLine } from "./useUpdateBusinessLines-CaT_-l9v.js";
|
|
89
89
|
import { n as formatCurrency } from "./formatCurrency-D-m2ri-x.js";
|
|
90
|
-
import { a as VAT_NUMBER_FIELD, c as defaultFieldConfig$1, d as doingBusinessAsAbsentFieldMetadata, f as doingBusinessAsFieldMetadata, g as BusinessRegistrationNumberField, h as BUSINESS_REGISTRATION_NUMBER_FIELD, l as defaultFieldMetadata$1, m as DBA_NAME_FIELD, n as registrationAddressFields, o as VatNumberField, p as DBANameField, r as operationalAddressIsSameIds, s as getDefaultVatNumberType, t as MemoizedConstitutionalDocument, u as vatAbsenceReasonMetadata } from "./ConstitutionalDocument-
|
|
90
|
+
import { a as VAT_NUMBER_FIELD, c as defaultFieldConfig$1, d as doingBusinessAsAbsentFieldMetadata, f as doingBusinessAsFieldMetadata, g as BusinessRegistrationNumberField, h as BUSINESS_REGISTRATION_NUMBER_FIELD, l as defaultFieldMetadata$1, m as DBA_NAME_FIELD, n as registrationAddressFields, o as VatNumberField, p as DBANameField, r as operationalAddressIsSameIds, s as getDefaultVatNumberType, t as MemoizedConstitutionalDocument, u as vatAbsenceReasonMetadata } from "./ConstitutionalDocument-CdpVRf0I.js";
|
|
91
91
|
import { f as industryCodeFieldMetadata, l as IndustryCodeField, t as INDUSTRY_CODE_FIELD } from "./constants-Cuqk72uG.js";
|
|
92
92
|
import { a as defaultFieldMetadata$2, i as defaultFieldConfigV4, o as defaultFieldMetadataV4, r as defaultFieldConfig$2, s as getLegalCompanyNameGuidanceText, t as LEGAL_COMPANY_NAME_FIELD } from "./LegalCompanyNameField-CQUbvS77.js";
|
|
93
93
|
import { s as organizationTypesToSkipCompanyStructureForm } from "./utils-TlcnGMeG.js";
|
|
@@ -463,10 +463,6 @@ function BasicInformation({ id, country, shouldValidate, fieldValidationErrors =
|
|
|
463
463
|
taxIdNumberType: currentCountryTaxInformation?.type,
|
|
464
464
|
companyType
|
|
465
465
|
}, taxInformationDefaultFieldMetadata), acc);
|
|
466
|
-
case "registrationNumber": return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(registrationNumberDefaultFieldConfig[country], {
|
|
467
|
-
registrationNumberType: form.data.basicInformation?.registrationNumberType,
|
|
468
|
-
state
|
|
469
|
-
}, registrationNumberDefaultFieldMetadata), acc);
|
|
470
466
|
case "jaHaniLegalCompanyName": return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(localizedLegalCompanyNameFieldConfig.jaHaniLegalCompanyName.config, {}, localizedLegalCompanyNameFieldConfig.jaHaniLegalCompanyName.metadata), acc);
|
|
471
467
|
case "jaKanaLegalCompanyName": return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(localizedLegalCompanyNameFieldConfig.jaKanaLegalCompanyName.config, {}, localizedLegalCompanyNameFieldConfig.jaKanaLegalCompanyName.metadata), acc);
|
|
472
468
|
default: return acc;
|
|
@@ -487,7 +483,6 @@ function BasicInformation({ id, country, shouldValidate, fieldValidationErrors =
|
|
|
487
483
|
form.valid.basicInformation,
|
|
488
484
|
handleChangeFor,
|
|
489
485
|
isFeatureEnabled,
|
|
490
|
-
state,
|
|
491
486
|
t,
|
|
492
487
|
fieldValidationErrors,
|
|
493
488
|
formVerificationErrors
|
|
@@ -603,8 +598,6 @@ function BasicInformation({ id, country, shouldValidate, fieldValidationErrors =
|
|
|
603
598
|
data: formUtils.getFieldData(form.data.basicInformation ?? {}, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
604
599
|
valid: formUtils.getFieldValid(form.valid.basicInformation ?? {}, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
605
600
|
errors: formUtils.getFieldErrors(form.errors.basicInformation ?? {}, fieldValidationErrors, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
606
|
-
labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, { exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber" }),
|
|
607
|
-
mask: formUtils.getMask("registrationNumber"),
|
|
608
601
|
helperText: getRegistrationNumberHelperText(businessT, {
|
|
609
602
|
country,
|
|
610
603
|
companyType
|
|
@@ -1187,7 +1180,7 @@ var companyTypeMetadata = {
|
|
|
1187
1180
|
var companyTypeOptions = Object.keys(companyTypeMetadata);
|
|
1188
1181
|
//#endregion
|
|
1189
1182
|
//#region src/components/Business/utils/getAvailableCompanyStructures.ts
|
|
1190
|
-
function getAvailableCompanyStructures({ country, registrationNumberType, taxIdNumberType, legalEntity, accountHolder, isSettingEnabled }) {
|
|
1183
|
+
function getAvailableCompanyStructures({ country, registrationNumberType, registrationNumberExempt, taxIdNumberType, legalEntity, accountHolder, isSettingEnabled }) {
|
|
1191
1184
|
const isRootOrganization = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange) && accountHolder !== "aTrust" && accountHolder !== "anUnincorporatedPartnership";
|
|
1192
1185
|
const excludedTypes = !!legalEntity.capabilities?.issueBankAccount?.requested ? [
|
|
1193
1186
|
CompanyTypesValues.INCORPORATED_PARTNERSHIP,
|
|
@@ -1195,14 +1188,15 @@ function getAvailableCompanyStructures({ country, registrationNumberType, taxIdN
|
|
|
1195
1188
|
CompanyTypesValues.GOVERNMENTAL_ORGANIZATION
|
|
1196
1189
|
] : [CompanyTypesValues.INCORPORATED_PARTNERSHIP, CompanyTypesValues.INCORPORATED_ASSOCIATION];
|
|
1197
1190
|
const companyTypeRadioOptions = isRootOrganization ? companyTypeOptions.filter((companyType) => !excludedTypes.includes(companyType)) : companyTypeOptions;
|
|
1198
|
-
const
|
|
1191
|
+
const validCompanyTypesByRegistrationNumber = registrationNumberExempt && isRegistrationExemptionAllowed(country) ? REGISTRATION_NUMBER_EXEMPTION_RULES[country] : getValidCompanyTypesForRegistrationNumberType(country, registrationNumberType);
|
|
1192
|
+
const validCompanyTypesForRegistrationNumber = new Set(validCompanyTypesByRegistrationNumber);
|
|
1199
1193
|
const validCompanyTypesForTaxId = new Set(getValidCompanyTypesForTaxIdNumberType(country, taxIdNumberType));
|
|
1200
1194
|
const constrainedCompanyTypeRadioOptions = companyTypeRadioOptions.filter((companyType) => (!validCompanyTypesForRegistrationNumber.size || validCompanyTypesForRegistrationNumber.has(companyType)) && (!validCompanyTypesForTaxId.size || validCompanyTypesForTaxId.has(companyType)));
|
|
1201
1195
|
return constrainedCompanyTypeRadioOptions.length > 0 ? constrainedCompanyTypeRadioOptions : companyTypeRadioOptions;
|
|
1202
1196
|
}
|
|
1203
1197
|
//#endregion
|
|
1204
1198
|
//#region src/components/Business/forms/CompanyStructure/CompanyStructure.tsx
|
|
1205
|
-
var
|
|
1199
|
+
var COMPANY_STRUCTURE_FIELDS = ["entityType"];
|
|
1206
1200
|
var EMPTY_OBJ$3 = {};
|
|
1207
1201
|
function CompanyStructure({ id, country, fieldValidationErrors = EMPTY_OBJ$3, formVerificationErrors = EMPTY_OBJ$3 }) {
|
|
1208
1202
|
const { t } = useTranslation([
|
|
@@ -1219,9 +1213,11 @@ function CompanyStructure({ id, country, fieldValidationErrors = EMPTY_OBJ$3, fo
|
|
|
1219
1213
|
const formUtils = createFormUtils({ requiredFields: form.requiredFields?.companyStructure ?? [] }, t);
|
|
1220
1214
|
const registrationNumberType = form.data.basicInformation?.registrationNumberType;
|
|
1221
1215
|
const taxIdNumberType = form.data.basicInformation?.taxInformation?.find((taxInformation) => taxInformation.country === country)?.type;
|
|
1216
|
+
const registrationNumberExempt = form.data.basicInformation?.exemptedFromRegistrationNumber;
|
|
1222
1217
|
const availableCompanyTypeRadioOptions = getAvailableCompanyStructures({
|
|
1223
1218
|
country,
|
|
1224
1219
|
registrationNumberType: isFeatureEnabled("EnableUnifiedCompanySearch") ? registrationNumberType : void 0,
|
|
1220
|
+
registrationNumberExempt: isFeatureEnabled("EnableUnifiedCompanySearch") ? registrationNumberExempt : void 0,
|
|
1225
1221
|
taxIdNumberType: isFeatureEnabled("EnableUnifiedCompanySearch") ? taxIdNumberType : void 0,
|
|
1226
1222
|
legalEntity,
|
|
1227
1223
|
accountHolder,
|
|
@@ -2553,13 +2549,19 @@ var mapApiDocumentToBusinessDetailsDocuments = (entityId) => {
|
|
|
2553
2549
|
companyConstitutionalDocument: constitutionalDocument ? { constitutionalDocument: [mapExistingFile(getPageName(constitutionalDocument))] } : void 0
|
|
2554
2550
|
};
|
|
2555
2551
|
};
|
|
2556
|
-
var mapBasicInformation = (data, taskType, isFeatureEnabled) => {
|
|
2552
|
+
var mapBasicInformation = ({ data, legalEntity, taskType, isFeatureEnabled }) => {
|
|
2557
2553
|
if (!data || !data.country) return;
|
|
2554
|
+
const companyType = legalEntity?.type === "organization" ? legalEntity.organization?.type : void 0;
|
|
2558
2555
|
const isUen = mapIsUen(data.taxInformation, data.registrationNumber, data.country);
|
|
2559
2556
|
const registrationNumberType = getDefaultRegistrationNumberType(data.registrationNumber, data.country, void 0, isFeatureEnabled("EnableUnifiedCompanySearch"));
|
|
2557
|
+
const registrationNumberExemption = !data.registrationNumber && !!companyType && isRegistrationExemptionAllowed(data.country) && (() => {
|
|
2558
|
+
const allowedEntityTypes = REGISTRATION_NUMBER_EXEMPTION_RULES[data.country];
|
|
2559
|
+
return allowedEntityTypes.length === 0 || allowedEntityTypes.includes(companyType);
|
|
2560
|
+
})() ? { exemptedFromRegistrationNumber: true } : {};
|
|
2560
2561
|
if (isFeatureEnabled("EnableUnifiedCompanySearch")) return isUsingCompanySearch(data.country, taskType) ? {
|
|
2561
2562
|
...data,
|
|
2562
2563
|
registrationNumberType,
|
|
2564
|
+
...registrationNumberExemption,
|
|
2563
2565
|
...isUen
|
|
2564
2566
|
} : entriesOf(data).reduce((acc, [field]) => {
|
|
2565
2567
|
if (!["stateOrProvince"].includes(field)) return {
|
|
@@ -2569,6 +2571,7 @@ var mapBasicInformation = (data, taskType, isFeatureEnabled) => {
|
|
|
2569
2571
|
return acc;
|
|
2570
2572
|
}, {
|
|
2571
2573
|
registrationNumberType,
|
|
2574
|
+
...registrationNumberExemption,
|
|
2572
2575
|
...isUen
|
|
2573
2576
|
});
|
|
2574
2577
|
return isUsingCompanySearch(data.country, taskType) ? data : entriesOf(data).reduce((acc, [field]) => {
|
|
@@ -2596,7 +2599,7 @@ var mapIsUen = (taxInformation, registrationNumber, country) => {
|
|
|
2596
2599
|
isUen: currentCountryTaxInfo.type === "UEN"
|
|
2597
2600
|
};
|
|
2598
2601
|
};
|
|
2599
|
-
var mapAdditionalInformation = (data, legalEntity, taskType, isFeatureEnabled) => {
|
|
2602
|
+
var mapAdditionalInformation = ({ data, legalEntity, taskType, isFeatureEnabled }) => {
|
|
2600
2603
|
if (!data) return;
|
|
2601
2604
|
const entity = legalEntity.type === "organization" ? legalEntity.organization : legalEntity.soleProprietorship;
|
|
2602
2605
|
const currentCountry = entity?.registeredAddress.country;
|
|
@@ -2683,7 +2686,12 @@ var mapLegalEntityToBusinessDetailsSchema = ({ legalEntity, parentEntity, taskTy
|
|
|
2683
2686
|
case "basicInformation": return {
|
|
2684
2687
|
...componentData,
|
|
2685
2688
|
[key]: {
|
|
2686
|
-
...mapBasicInformation(
|
|
2689
|
+
...mapBasicInformation({
|
|
2690
|
+
data: businessDetailsSchema[key],
|
|
2691
|
+
legalEntity,
|
|
2692
|
+
taskType,
|
|
2693
|
+
isFeatureEnabled
|
|
2694
|
+
}),
|
|
2687
2695
|
...mapLegalNameLocalization(legalEntity)
|
|
2688
2696
|
}
|
|
2689
2697
|
};
|
|
@@ -2697,7 +2705,12 @@ var mapLegalEntityToBusinessDetailsSchema = ({ legalEntity, parentEntity, taskTy
|
|
|
2697
2705
|
};
|
|
2698
2706
|
case "additionalInformation": return {
|
|
2699
2707
|
...componentData,
|
|
2700
|
-
[key]: mapAdditionalInformation(
|
|
2708
|
+
[key]: mapAdditionalInformation({
|
|
2709
|
+
data: businessDetailsSchema[key],
|
|
2710
|
+
legalEntity,
|
|
2711
|
+
taskType,
|
|
2712
|
+
isFeatureEnabled
|
|
2713
|
+
})
|
|
2701
2714
|
};
|
|
2702
2715
|
case "companyRegistrationDocument": return {
|
|
2703
2716
|
...componentData,
|
|
@@ -3683,6 +3696,7 @@ function BusinessDetailsDropin({ taskType, country: propCountry, problems: propP
|
|
|
3683
3696
|
setPrevCountry(multiForm.data.basicInformation.country);
|
|
3684
3697
|
setTrustedFields(void 0);
|
|
3685
3698
|
companySearchStateModel.resetCompanySearchData();
|
|
3699
|
+
multiForm.handleChangeFor("entityType", "companyStructure")(null);
|
|
3686
3700
|
}
|
|
3687
3701
|
/**
|
|
3688
3702
|
* Infer the company structure based on the registration number type and tax ID number type
|
|
@@ -3690,12 +3704,15 @@ function BusinessDetailsDropin({ taskType, country: propCountry, problems: propP
|
|
|
3690
3704
|
* the necessary information to uniquely identify the company structure
|
|
3691
3705
|
*/
|
|
3692
3706
|
const inferredCompanyStructure = useMemo$1(() => {
|
|
3693
|
-
if (!isFeatureEnabled("EnableUnifiedCompanySearch")) return void 0;
|
|
3707
|
+
if (!isFeatureEnabled("EnableUnifiedCompanySearch") || taskType !== "BUSINESS_DETAILS") return void 0;
|
|
3708
|
+
if (multiForm.data.companyStructure?.entityType && multiForm.data.companyStructure?.entityType === "associationIncorporated" || multiForm.data.companyStructure?.entityType === "partnershipIncorporated") return;
|
|
3694
3709
|
const registrationNumberType = multiForm.data.basicInformation?.registrationNumberType;
|
|
3695
3710
|
const taxIdNumberType = multiForm.data.basicInformation?.taxInformation?.find((taxInformation) => taxInformation.country === country)?.type;
|
|
3711
|
+
const registrationNumberExempt = multiForm.data.basicInformation?.exemptedFromRegistrationNumber;
|
|
3696
3712
|
const availableCompanyStructures = getAvailableCompanyStructures({
|
|
3697
3713
|
country,
|
|
3698
3714
|
registrationNumberType,
|
|
3715
|
+
registrationNumberExempt,
|
|
3699
3716
|
taxIdNumberType,
|
|
3700
3717
|
legalEntity: legalEntityResponse,
|
|
3701
3718
|
accountHolder,
|
|
@@ -3708,8 +3725,11 @@ function BusinessDetailsDropin({ taskType, country: propCountry, problems: propP
|
|
|
3708
3725
|
isFeatureEnabled,
|
|
3709
3726
|
isSettingEnabled,
|
|
3710
3727
|
legalEntityResponse,
|
|
3728
|
+
multiForm.data.basicInformation?.exemptedFromRegistrationNumber,
|
|
3711
3729
|
multiForm.data.basicInformation?.registrationNumberType,
|
|
3712
|
-
multiForm.data.basicInformation?.taxInformation
|
|
3730
|
+
multiForm.data.basicInformation?.taxInformation,
|
|
3731
|
+
multiForm.data.companyStructure?.entityType,
|
|
3732
|
+
taskType
|
|
3713
3733
|
]);
|
|
3714
3734
|
const applyInferredCompanyStructure = () => {
|
|
3715
3735
|
if (!inferredCompanyStructure) return;
|
|
@@ -3821,10 +3841,10 @@ function BusinessDetailsDropin({ taskType, country: propCountry, problems: propP
|
|
|
3821
3841
|
});
|
|
3822
3842
|
const overrideNextClick = async () => {
|
|
3823
3843
|
if (!activeForm.isValid) return handleNextClick();
|
|
3844
|
+
if (activeForm.formId === "basicInformation") applyInferredCompanyStructure();
|
|
3824
3845
|
if (!isUsingCompanySearch(country, taskType)) return handleNextClick();
|
|
3825
3846
|
switch (activeForm.formId) {
|
|
3826
3847
|
case "basicInformation": {
|
|
3827
|
-
applyInferredCompanyStructure();
|
|
3828
3848
|
const currentForms = await attemptBusinessSearch();
|
|
3829
3849
|
if (currentForms === null) return;
|
|
3830
3850
|
return handleNextClick(currentForms);
|
|
@@ -4261,8 +4281,6 @@ function AdditionalInformation({ id, country, companyType, shouldValidate, field
|
|
|
4261
4281
|
data: formUtils.getFieldData(form.data.additionalInformation ?? {}, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
4262
4282
|
valid: formUtils.getFieldValid(form.valid.additionalInformation ?? {}, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
4263
4283
|
errors: formUtils.getFieldErrors(form.errors.additionalInformation ?? {}, fieldValidationErrors, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
4264
|
-
labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, { exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber" }),
|
|
4265
|
-
mask: formUtils.getMask("registrationNumber"),
|
|
4266
4284
|
helperText: getRegistrationNumberHelperText(businessT, {
|
|
4267
4285
|
country,
|
|
4268
4286
|
companyType
|
|
@@ -4506,7 +4524,7 @@ var staticBusinessDetailsForms = {
|
|
|
4506
4524
|
companyStructure: {
|
|
4507
4525
|
formId: "companyStructure",
|
|
4508
4526
|
formName: "companyStructureFormName",
|
|
4509
|
-
fields:
|
|
4527
|
+
fields: COMPANY_STRUCTURE_FIELDS
|
|
4510
4528
|
},
|
|
4511
4529
|
companyRegistrationDocument: {
|
|
4512
4530
|
formId: "companyRegistrationDocument",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
try {
|
|
2
2
|
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
3
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
3
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "408ab5ba-e93b-4ae0-9add-8c80188c117d", e._sentryDebugIdIdentifier = "sentry-dbid-408ab5ba-e93b-4ae0-9add-8c80188c117d");
|
|
4
4
|
} catch (e) {}
|
|
5
5
|
import { o as createLogger } from "./translation-BHUZ_WP7.js";
|
|
6
6
|
import { o as objectsDeepEqual } from "./AnalyticsContext-CbM5V7Nw.js";
|
|
@@ -261,9 +261,29 @@ function reducer({ staticValidate, obscuredFields, optionalFields, trustedFields
|
|
|
261
261
|
*/
|
|
262
262
|
const hasDefaultDataChanged = !objectsDeepEqual(defaultData, state.defaultData);
|
|
263
263
|
if (objectsDeepEqual(requiredFields, clonedState.requiredFields) && objectsDeepEqual(newOptionalFields, clonedState.optionalFields) && !hasDefaultDataChanged) return state;
|
|
264
|
-
|
|
264
|
+
const updatedData = hasDefaultDataChanged ? defaultData : structuredClone(clonedState.data);
|
|
265
|
+
/**
|
|
266
|
+
* When schema changes without a defaultData refresh, re-add any fields that were
|
|
267
|
+
* previously removed and are now reintroduced from the local stash.
|
|
268
|
+
*
|
|
269
|
+
* This preserves user-entered values across dynamic required/optional transitions,
|
|
270
|
+
* such as when rule-driven fields are temporarily hidden and then shown again.
|
|
271
|
+
*/
|
|
272
|
+
if (!hasDefaultDataChanged && updatedData) for (const formName in requiredFields) {
|
|
273
|
+
const form = formName;
|
|
274
|
+
const prevFields = [...clonedState.requiredFields?.[form] ?? [], ...clonedState.optionalFields?.[form] ?? []];
|
|
275
|
+
[...requiredFields?.[form] ?? [], ...newOptionalFields?.[form] ?? []].filter((field) => !prevFields.includes(field)).forEach((field) => {
|
|
276
|
+
const currentValue = updatedData?.[form]?.[field];
|
|
277
|
+
const localValue = clonedState.local?.[form]?.data?.[field];
|
|
278
|
+
if (typeof currentValue === "undefined" && typeof localValue !== "undefined") {
|
|
279
|
+
if (!updatedData[form]) return;
|
|
280
|
+
updatedData[form][field] = localValue;
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
const newState = init({
|
|
265
285
|
requiredFields,
|
|
266
|
-
data:
|
|
286
|
+
data: updatedData,
|
|
267
287
|
fieldProblems: clonedState.fieldProblems,
|
|
268
288
|
obscuredFields,
|
|
269
289
|
optionalFields: newOptionalFields,
|
|
@@ -271,6 +291,48 @@ function reducer({ staticValidate, obscuredFields, optionalFields, trustedFields
|
|
|
271
291
|
staticValidate,
|
|
272
292
|
defaultData
|
|
273
293
|
});
|
|
294
|
+
if (hasDefaultDataChanged) return newState;
|
|
295
|
+
/**
|
|
296
|
+
* Persist values of fields that are being removed from the active schema into local.
|
|
297
|
+
*
|
|
298
|
+
* These values are later used to restore data for reintroduced fields in subsequent
|
|
299
|
+
* schema transitions, avoiding silent data loss during dynamic form updates.
|
|
300
|
+
*/
|
|
301
|
+
const local = Object.keys(requiredFields ?? {}).reduce((acc, formName) => {
|
|
302
|
+
const form = formName;
|
|
303
|
+
const prevFields = [...clonedState.requiredFields?.[form] ?? [], ...clonedState.optionalFields?.[form] ?? []];
|
|
304
|
+
const nextFields = [...requiredFields?.[form] ?? [], ...newOptionalFields?.[form] ?? []];
|
|
305
|
+
const removedFields = prevFields.filter((field) => !nextFields.includes(field));
|
|
306
|
+
if (!removedFields.length) {
|
|
307
|
+
if (clonedState.local?.[form]) return {
|
|
308
|
+
...acc,
|
|
309
|
+
[form]: clonedState.local[form]
|
|
310
|
+
};
|
|
311
|
+
return acc;
|
|
312
|
+
}
|
|
313
|
+
const localFormData = {
|
|
314
|
+
...clonedState.local?.[form]?.data ?? {},
|
|
315
|
+
...removedFields.reduce((fieldAcc, field) => {
|
|
316
|
+
const value = clonedState.data?.[form]?.[field];
|
|
317
|
+
if (typeof value !== "undefined") return {
|
|
318
|
+
...fieldAcc,
|
|
319
|
+
[field]: value
|
|
320
|
+
};
|
|
321
|
+
return fieldAcc;
|
|
322
|
+
}, {})
|
|
323
|
+
};
|
|
324
|
+
return {
|
|
325
|
+
...acc,
|
|
326
|
+
[form]: {
|
|
327
|
+
...clonedState.local?.[form] ?? {},
|
|
328
|
+
data: localFormData
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
}, {});
|
|
332
|
+
return {
|
|
333
|
+
...newState,
|
|
334
|
+
local
|
|
335
|
+
};
|
|
274
336
|
}
|
|
275
337
|
case "setInnerFormRequiredFields": {
|
|
276
338
|
/**
|
|
@@ -26,35 +26,35 @@ var hasProgressedBeyondEntitySelection = (legalEntity) => {
|
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region src/router/routeConfig.ts
|
|
28
28
|
var Introduction = lazy(async () => (await import("./Introduction-p7SxkPvq.js")).Introduction);
|
|
29
|
-
var Adaptive = lazy(async () => (await import("./AdaptiveWorkflow-
|
|
29
|
+
var Adaptive = lazy(async () => (await import("./AdaptiveWorkflow-BRSkDC27.js")).AdaptiveWorkflow);
|
|
30
30
|
var BusinessTypeSelectionPage = lazy(async () => (await import("./BusinessTypeSelectionPage-D0jjyKgo.js")).BusinessTypeSelectionPage);
|
|
31
31
|
var SingpassSelection = lazy(async () => (await import("./SingpassSelection-c3hLW3jo.js")).SingpassSelection);
|
|
32
32
|
var AccountSetupRejected = lazy(async () => (await import("./AccountSetupRejected-MS5ucnkH.js")).AccountSetupRejected);
|
|
33
33
|
var DecisionMakers = lazy(async () => (await import("./DecisionMakers-Bm-L-q92.js").then((n) => n.n)).DecisionMakers);
|
|
34
|
-
var CustomerSupport = lazy(async () => (await import("./CustomerSupport-
|
|
34
|
+
var CustomerSupport = lazy(async () => (await import("./CustomerSupport-BXin9crY.js")).CustomerSupport);
|
|
35
35
|
var Review = lazy(async () => (await import("./Review-GGx4T5lx.js")).Review);
|
|
36
|
-
var SignPCIComponent = lazy(async () => (await import("./SignPCIComponent-
|
|
37
|
-
var AcceptTermsOfService = lazy(async () => (await import("./AcceptTermsOfServiceComponent-
|
|
38
|
-
var TaxReportingDropin = lazy(async () => (await import("./TaxReportingDropin-
|
|
39
|
-
var PayoutDetailsPage = lazy(async () => (await import("./PayoutDetailsPage-
|
|
40
|
-
var RootBusinessDetailsPage = lazy(async () => (await import("./RootBusinessDetailsPage-
|
|
41
|
-
var RootBusinessLinesPage = lazy(async () => (await import("./RootBusinessLinesPage-
|
|
42
|
-
var SoleProprietorshipPage = lazy(async () => (await import("./SoleProprietorshipPage-
|
|
43
|
-
var TrustMemberCompanyPage = lazy(async () => (await import("./TrustMemberCompanyPage-
|
|
44
|
-
var TrustMemberIndividualPage = lazy(async () => (await import("./TrustMemberIndividualPage-
|
|
36
|
+
var SignPCIComponent = lazy(async () => (await import("./SignPCIComponent-BPSj_yuH.js").then((n) => n.n)).SignPCIComponent);
|
|
37
|
+
var AcceptTermsOfService = lazy(async () => (await import("./AcceptTermsOfServiceComponent-CV0tEsZ8.js").then((n) => n.n)).AcceptTermsOfServiceComponent);
|
|
38
|
+
var TaxReportingDropin = lazy(async () => (await import("./TaxReportingDropin-LOUIhV-w.js").then((n) => n.n)).TaxReportingDropin);
|
|
39
|
+
var PayoutDetailsPage = lazy(async () => (await import("./PayoutDetailsPage-CLt8LJCi.js")).PayoutDetailsPage);
|
|
40
|
+
var RootBusinessDetailsPage = lazy(async () => (await import("./RootBusinessDetailsPage-z94WN2fb.js")).RootBusinessDetailsPage);
|
|
41
|
+
var RootBusinessLinesPage = lazy(async () => (await import("./RootBusinessLinesPage-B1SNv9er.js")).RootBusinessLinesPage);
|
|
42
|
+
var SoleProprietorshipPage = lazy(async () => (await import("./SoleProprietorshipPage-C2gjJZcb.js")).SoleProprietorshipPage);
|
|
43
|
+
var TrustMemberCompanyPage = lazy(async () => (await import("./TrustMemberCompanyPage-BnY9tVG7.js")).TrustMemberCompanyPage);
|
|
44
|
+
var TrustMemberIndividualPage = lazy(async () => (await import("./TrustMemberIndividualPage-B4Iqm4MI.js")).TrustMemberIndividualPage);
|
|
45
45
|
var TrustMemberRoleAndTypePage = lazy(async () => (await import("./TrustMemberRoleAndTypePage-LlBgvSwW.js")).TrustMemberRoleAndTypePage);
|
|
46
46
|
var TrustMembersOverview = lazy(async () => (await import("./TrustMembersOverview-BGzdiibd.js")).TrustMembersOverview);
|
|
47
|
-
var UnincorporatedPartnershipMemberCompanyPage = lazy(async () => (await import("./UnincorporatedPartnershipMemberCompanyPage-
|
|
48
|
-
var UnincorporatedPartnershipIndividualPage = lazy(async () => (await import("./UnincorporatedPartnershipIndividualPage-
|
|
47
|
+
var UnincorporatedPartnershipMemberCompanyPage = lazy(async () => (await import("./UnincorporatedPartnershipMemberCompanyPage-Uzsm5Zo2.js")).UnincorporatedPartnershipMemberCompanyPage);
|
|
48
|
+
var UnincorporatedPartnershipIndividualPage = lazy(async () => (await import("./UnincorporatedPartnershipIndividualPage-CUrCUB2E.js")).UnincorporatedPartnershipIndividualPage);
|
|
49
49
|
var UnincorporatedPartnershipMemberRoleAndTypePage = lazy(async () => (await import("./UnincorporatedPartnershipMemberRoleAndTypePage-BbQB-s2g.js")).UnincorporatedPartnershipMemberRoleAndTypePage);
|
|
50
50
|
var UnincorporatedPartnershipMembersOverview = lazy(async () => (await import("./UnincorporatedPartnershipMembersOverview-B-djUG0K.js")).UnincorporatedPartnershipMembersOverview);
|
|
51
|
-
var BusinessFinancingPage = lazy(async () => (await import("./BusinessFinancingPage-
|
|
52
|
-
var TrustDetailsPage = lazy(async () => (await import("./TrustDetailsPage-
|
|
53
|
-
var SourceOfFundsPage = lazy(async () => (await import("./SourceOfFundsPage-
|
|
54
|
-
var RootIndividualDetailsPage = lazy(async () => (await import("./RootIndividualDetailsPage-
|
|
55
|
-
var LegalRepresentativeDetailsPage = lazy(async () => (await import("./LegalRepresentativeDetailsPage-
|
|
56
|
-
var DecisionMakerDetailsPage = lazy(async () => (await import("./DecisionMakerDetailsPage-
|
|
57
|
-
lazy(async () => (await import("./InvitedDecisionMakerComponent-
|
|
51
|
+
var BusinessFinancingPage = lazy(async () => (await import("./BusinessFinancingPage-CSwjPgIJ.js")).BusinessFinancingPage);
|
|
52
|
+
var TrustDetailsPage = lazy(async () => (await import("./TrustDetailsPage-B9sH2X7l.js")).TrustDetailsPage);
|
|
53
|
+
var SourceOfFundsPage = lazy(async () => (await import("./SourceOfFundsPage-DItR3-Hp.js").then((n) => n.n)).SourceOfFundsPage);
|
|
54
|
+
var RootIndividualDetailsPage = lazy(async () => (await import("./RootIndividualDetailsPage-DE704wL6.js")).RootIndividualDetailsPage);
|
|
55
|
+
var LegalRepresentativeDetailsPage = lazy(async () => (await import("./LegalRepresentativeDetailsPage-Csvg_gjL.js")).LegalRepresentativeDetailsPage);
|
|
56
|
+
var DecisionMakerDetailsPage = lazy(async () => (await import("./DecisionMakerDetailsPage-BaOxC2U6.js")).DecisionMakerDetailsPage);
|
|
57
|
+
lazy(async () => (await import("./InvitedDecisionMakerComponent-B40Lk4i7.js").then((n) => n.n)).InvitedDecisionMakerComponent);
|
|
58
58
|
var ROUTE_CONFIG = {
|
|
59
59
|
[TaskTypes.ADAPTIVE]: {
|
|
60
60
|
path: "/adaptive",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
try {
|
|
2
2
|
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
3
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
3
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "838c1c21-fc36-4715-89e5-e46977d283a2", e._sentryDebugIdIdentifier = "sentry-dbid-838c1c21-fc36-4715-89e5-e46977d283a2");
|
|
4
4
|
} catch (e) {}
|
|
5
5
|
import { r as useTranslation } from "./translation-BHUZ_WP7.js";
|
|
6
6
|
import { t as LegalEntityTypes } from "./legal-entity-type-VIfNYnJP.js";
|
|
@@ -1679,7 +1679,7 @@ var taxInformationDefaultFieldConfig = {
|
|
|
1679
1679
|
},
|
|
1680
1680
|
[CountryCodes.Philippines]: { validators: mapValidators([validatePatternOnBlur(/^\d{12}$/)], CountryCodes.Philippines) }
|
|
1681
1681
|
};
|
|
1682
|
-
var exemptedFromTaxDefaultFieldConfig = { [CountryCodes.Australia]: { label: "
|
|
1682
|
+
var exemptedFromTaxDefaultFieldConfig = { [CountryCodes.Australia]: { label: "thisBusinessIsntRequiredToHaveAnABN" } };
|
|
1683
1683
|
var getTaxInformationPlaceholderText = ({ country, companyType, taxIdNumberType }) => {
|
|
1684
1684
|
switch (country) {
|
|
1685
1685
|
case CountryCodes.Austria: return "931736581";
|
|
@@ -2130,6 +2130,28 @@ var getCountryOfGoverningLaw = (isCountryOfGoverningLawEnabled, basicData) => {
|
|
|
2130
2130
|
return !basicData.countryOfGoverningLaw ? CountryCodes.UnitedKingdom : basicData.countryOfGoverningLaw;
|
|
2131
2131
|
};
|
|
2132
2132
|
//#endregion
|
|
2133
|
+
//#region src/components/Business/forms/rules.constants.ts
|
|
2134
|
+
var isRegistrationExemptionAllowed = (country) => country in REGISTRATION_NUMBER_EXEMPTION_RULES;
|
|
2135
|
+
/**
|
|
2136
|
+
* Source of truth for registration-number exemption eligibility in Business Details.
|
|
2137
|
+
*
|
|
2138
|
+
* This map defines which organization entity types can use
|
|
2139
|
+
* `exemptedFromRegistrationNumber`, grouped by country. All exemption checks should
|
|
2140
|
+
* be derived from this structure to keep behavior consistent across form rules.
|
|
2141
|
+
*
|
|
2142
|
+
* Interpretation:
|
|
2143
|
+
* - Non-empty array: exemption is allowed only for the listed entity types.
|
|
2144
|
+
* - Empty array: exemption is allowed for that country without entity-type restrictions.
|
|
2145
|
+
*
|
|
2146
|
+
*/
|
|
2147
|
+
var REGISTRATION_NUMBER_EXEMPTION_RULES = {
|
|
2148
|
+
[CountryCodes.Australia]: [CompanyTypesValues.GOVERNMENTAL_ORGANIZATION, CompanyTypesValues.INCORPORATED_PARTNERSHIP],
|
|
2149
|
+
[CountryCodes.Denmark]: [CompanyTypesValues.NON_PROFIT_OR_CHARITABLE],
|
|
2150
|
+
[CountryCodes.Germany]: [CompanyTypesValues.GOVERNMENTAL_ORGANIZATION, CompanyTypesValues.NON_PROFIT_OR_CHARITABLE],
|
|
2151
|
+
[CountryCodes.HongKong]: [],
|
|
2152
|
+
[CountryCodes.NewZealand]: []
|
|
2153
|
+
};
|
|
2154
|
+
//#endregion
|
|
2133
2155
|
//#region src/components/Business/forms/rules.ts
|
|
2134
2156
|
var COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION = [
|
|
2135
2157
|
CountryCodes.Australia,
|
|
@@ -2150,7 +2172,6 @@ var COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION = [
|
|
|
2150
2172
|
CountryCodes.PuertoRico,
|
|
2151
2173
|
CountryCodes.UnitedStates
|
|
2152
2174
|
];
|
|
2153
|
-
var COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_ORGANIZATIONS = [CountryCodes.HongKong];
|
|
2154
2175
|
var COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS = [
|
|
2155
2176
|
CountryCodes.Austria,
|
|
2156
2177
|
CountryCodes.Canada,
|
|
@@ -2299,25 +2320,29 @@ var rules = ({ data, defaultData, verifiedBusiness, country, taskType, isFeature
|
|
|
2299
2320
|
},
|
|
2300
2321
|
companyRegistrationNumberExemptionAllowed: () => {
|
|
2301
2322
|
const isExemptFromRegistrationNumber = Boolean(data.basicInformation?.exemptedFromRegistrationNumber ?? data.additionalInformation?.exemptedFromRegistrationNumber);
|
|
2302
|
-
if (
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2323
|
+
if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) {
|
|
2324
|
+
if (!COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS.includes(country)) return;
|
|
2325
|
+
return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
2326
|
+
}
|
|
2327
|
+
if (!isRegistrationExemptionAllowed(country)) return;
|
|
2328
|
+
const companyType = data.companyStructure?.entityType;
|
|
2329
|
+
const allowedTypes = REGISTRATION_NUMBER_EXEMPTION_RULES[country];
|
|
2330
|
+
if (allowedTypes.length > 0 && companyType && !allowedTypes.includes(companyType)) return;
|
|
2331
|
+
/**
|
|
2332
|
+
* Country-specific guard checks before applying the shared exemption rule result.
|
|
2333
|
+
*
|
|
2334
|
+
* - HK first enforces the legacy registration-number presence guard for existing entities.
|
|
2335
|
+
* - AU/NZ then enforce the absent-state V4 feature flag gate.
|
|
2336
|
+
*/
|
|
2337
|
+
switch (country) {
|
|
2338
|
+
case CountryCodes.HongKong:
|
|
2339
|
+
if (!defaultData?.basicInformation?.registrationNumber && !defaultData?.additionalInformation?.registrationNumber) return;
|
|
2306
2340
|
return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
if (data.companyStructure?.entityType === CompanyTypesValues.NON_PROFIT_OR_CHARITABLE) return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
2313
|
-
return;
|
|
2314
|
-
case CountryCodes.HongKong:
|
|
2315
|
-
if (country === CountryCodes.HongKong && !defaultData?.additionalInformation?.registrationNumber) return;
|
|
2316
|
-
return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
2317
|
-
default:
|
|
2318
|
-
if (!COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_ORGANIZATIONS.includes(country)) return;
|
|
2319
|
-
return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
2320
|
-
}
|
|
2341
|
+
case CountryCodes.Australia:
|
|
2342
|
+
case CountryCodes.NewZealand:
|
|
2343
|
+
if (!isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4")) return;
|
|
2344
|
+
return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
2345
|
+
default: return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
2321
2346
|
}
|
|
2322
2347
|
},
|
|
2323
2348
|
countryOfGoverningLawRequired: () => {
|
|
@@ -2336,7 +2361,7 @@ var rules = ({ data, defaultData, verifiedBusiness, country, taskType, isFeature
|
|
|
2336
2361
|
if (!defaultData?.additionalInformation?.registrationNumber) return;
|
|
2337
2362
|
return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
|
|
2338
2363
|
}
|
|
2339
|
-
if (!COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return isExemptFromRegistrationNumber ?
|
|
2364
|
+
if (!COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return isExemptFromRegistrationNumber ? void 0 : "REQUIRED";
|
|
2340
2365
|
}
|
|
2341
2366
|
},
|
|
2342
2367
|
registrationNumberType: () => {
|
|
@@ -2479,4 +2504,4 @@ function removeTaxInfoForCountry(taxInformation, country) {
|
|
|
2479
2504
|
return taxInformation?.filter((t) => t.country !== country);
|
|
2480
2505
|
}
|
|
2481
2506
|
//#endregion
|
|
2482
|
-
export {
|
|
2507
|
+
export { taxInformationDefaultFieldConfig as C, stateFormatGuidanceText as D, businessRegistrationNumberMasks as E, getTaxInformationPlaceholderText as S, businessRegistrationNumberPatterns as T, getTaxIdNumberOptions as _, COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4 as a, exemptedFromTaxDefaultFieldConfig as b, isUsingCompanySearch as c, isRegistrationExemptionAllowed as d, countryToTaxInfoTypeMap as f, getDefaultTaxIdNumberType as g, requestingIssuing as h, COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT as i, rules as l, requestingBanking as m, upsertTaxInfoForCountry as n, COUNTRY_OF_GOVERNING_LAW_POSSIBLE as o, getCountryOfGoverningLaw as p, TaxIdNumberTypeSelector as r, isRegistrationNumberAbsentStateV4Scenario as s, removeTaxInfoForCountry as t, REGISTRATION_NUMBER_EXEMPTION_RULES as u, getValidCompanyTypesForTaxIdNumberType as v, taxInformationDefaultFieldMetadata as w, exemptedFromTaxDefaultFieldMetadata as x, taxIdNumberOptions as y };
|