@adyen/kyc-components 3.91.0 → 3.92.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/{4-people-BzyXLUF9.js → 4-people-BtDi7O9A.js} +2 -2
- package/dist/{AcceptTermsOfServiceComponent-Bl8Skw0p.js → AcceptTermsOfServiceComponent-T7eWi57Z.js} +17 -14
- package/dist/{Accordion-BxBwztLx.js → Accordion-Boa_Vira.js} +2 -2
- package/dist/{AccountSetupRejected-DWnI467S.js → AccountSetupRejected-LAVhMMBt.js} +4 -4
- package/dist/{ActionBar-BI8EL50o.js → ActionBar-CK8dwgSJ.js} +1 -1
- package/dist/{Address-BUrDDnmR.js → Address-ki-bCjUJ.js} +23 -289
- package/dist/{Alert-B83aFhFn.js → Alert-TCEgDc2-.js} +3 -3
- package/dist/{Avatar-CWGv3_UH.js → Avatar-AC-D1DKh.js} +2 -2
- package/dist/{BusinessFinancingComponent-Dp9pkrSs.js → BusinessFinancingComponent-Cf-EEnyR.js} +6 -6
- package/dist/{BusinessFinancingDropin-CxDQONVa.js → BusinessFinancingDropin-DeLlYaOF.js} +30 -22
- package/dist/{BusinessFinancingPage-CK4iko3V.js → BusinessFinancingPage-DtX8x3Zp.js} +4 -4
- package/dist/{BusinessTypeSelectionPage-BbCt3hSM.js → BusinessTypeSelectionPage-6Ltt53Mu.js} +58 -33
- package/dist/{Card-CQrP0PXC.js → Card-Det7uTiv.js} +2 -2
- package/dist/{debouncedInputEvent-CFFx_oML.js → Checkbox-D8rB6_HN.js} +3 -38
- package/dist/Confirm-Ctfqp-1b.js +64 -0
- package/dist/ConstitutionalDocument-TJAc9nDQ.js +2358 -0
- package/dist/ContextGuidance-CCknw_Y1.js +34 -0
- package/dist/CountryField-DzmOWqiE.js +66 -0
- package/dist/{CreateIndividualComponent-B6ecxCd8.js → CreateIndividualComponent-_H34wdze.js} +6 -6
- package/dist/{CreateTransferInstrumentComponent-Chqddjgy.js → CreateTransferInstrumentComponent-CmnVEFaB.js} +5 -12
- package/dist/{Currency-CkQVLmOQ.js → Currency-C2egEHMF.js} +64 -8
- package/dist/{CustomerSupport-BDynvVnl.js → CustomerSupport-DLfbNC-J.js} +12 -10
- package/dist/{DebugModal-DAu7rz8a.js → DebugModal-C0uG_A8N.js} +8 -7
- package/dist/{DecisionMakerDetailsPage-BBqNmh_M.js → DecisionMakerDetailsPage-BTR-hRwO.js} +6 -6
- package/dist/{DecisionMakers-Ddvw0N__.js → DecisionMakers-B4qQ3M6Y.js} +27 -21
- package/dist/Dropzone-CKT3THCY.js +218 -0
- package/dist/{EmbeddedStatus-BSK268B-.js → EmbeddedStatus-Bst5MPzi.js} +3 -3
- package/dist/{EndStateLayout-B8KmFejY.js → EndStateLayout-Ck_Lvgng.js} +2 -2
- package/dist/{EntityAssociation-DBPiXzNF.js → EntityAssociation-bcF_I_DK.js} +8 -8
- package/dist/{EntityGuidanceStatus-QEzHcb28.js → EntityGuidanceStatus-D6VoRE_0.js} +4 -3
- package/dist/ErrorPanel-CFN2G9Vz.js +190 -0
- package/dist/Field-B3Vy1-QZ.js +142 -0
- package/dist/{FormNavigation-DLJbUsy3.js → FormNavigation-Brw-75s0.js} +3 -3
- package/dist/{FormWrapper-41qnDF4W.js → FormWrapper-BcNyCMkD.js} +10 -10
- package/dist/Header-YafgG5Nz.js +83 -0
- package/dist/Image-Cvb4hnru.js +44 -0
- package/dist/{IndividualOnfido-pGSPtITh.js → IndividualOnfidoDropin-Dy5obHs1.js} +3833 -5548
- package/dist/InputDate-UCHQ3zOB.js +43 -0
- package/dist/InputGroup-WBfGDV5F.js +32 -0
- package/dist/InputText-DGKAS6ZI.js +134 -0
- package/dist/{Introduction-DaRfsN8P.js → Introduction-DOxSVZ6X.js} +4 -4
- package/dist/{JpAddress-BrtEV6zM.js → JpAddress-DClXaVjy.js} +22 -10
- package/dist/LandingLayout-co7NR2te.js +60 -0
- package/dist/{LegalRepresentativeDetailsPage-XcmRRT7P.js → LegalRepresentativeDetailsPage-DOP3L2r9.js} +4 -4
- package/dist/Link-DWTJ55UO.js +35 -0
- package/dist/List-BAzyC6sw.js +83 -0
- package/dist/{ListItem-DlRGqcSA.js → ListItem-B8D-kUHN.js} +3 -3
- package/dist/LoaderWrapper-CUz5NRFr.js +42 -0
- package/dist/{ManageIndividualComponent-BpzsaZ1O.js → ManageIndividualComponent-DND7vuna.js} +5 -5
- package/dist/{ManageTermsOfServiceComponent-D9i2HO5I.js → ManageTermsOfServiceComponent-ylDupO1E.js} +5 -5
- package/dist/{ManageTransferInstrumentComponent-C6LYppym.js → ManageTransferInstrumentComponent-CgUfGP5E.js} +16 -13
- package/dist/{Spacer-w89ksCbG.js → MaskedInput-Cn0VAuEp.js} +17 -631
- package/dist/{MaybeModal-DW5SxNsJ.js → MaybeModal-CWCEHeOg.js} +3 -3
- package/dist/{Modal-B4wxf7HK.js → Modal-pyBUluei.js} +2 -2
- package/dist/OnboardingDropinComponent-DwKImil4.js +2306 -0
- package/dist/{PayoutDetailsDropin-BKXxBApD.js → PayoutDetailsDropin-lYVb5WCQ.js} +105 -76
- package/dist/Radio-BMtxBpnn.js +39 -0
- package/dist/RadioGroup-DPc8nUuk.js +98 -0
- package/dist/RadioGroupCard-Pj9qq4uW.js +150 -0
- package/dist/{Review-DSdM3vGX.js → Review-gkTjl3a8.js} +7 -7
- package/dist/{RootBusinessDetailsPage-CqpiMFn9.js → RootBusinessDetailsPage-DjwEzuLA.js} +5 -5
- package/dist/{RootBusinessLinesPage-DUIp_zfH.js → RootBusinessLinesPage-2-U3mf6i.js} +104 -50
- package/dist/{RootIndividualDetailsPage-BpTbnRMJ.js → RootIndividualDetailsPage-BFYP63_i.js} +6 -6
- package/dist/{useForm-_Kjd_HFb.js → Select-D1rFT3T8.js} +10 -775
- package/dist/{SignPCIComponent-B-nJZ1cD.js → SignPCIComponent-DqElmjjG.js} +13 -11
- package/dist/{SingpassSelection-D7wRmaLb.js → SingpassSelection-eruroIiQ.js} +9 -7
- package/dist/{SoleProprietorshipPage-DUVjo6fc.js → SoleProprietorshipPage-7YdzA7iH.js} +4 -4
- package/dist/{SourceOfFundsPage-CFDBqD8v.js → SourceOfFundsPage-C_wiSoc4.js} +39 -26
- package/dist/Spacer-BK3jDget.js +18 -0
- package/dist/{StepProgressIndicator-BvU4jA3I.js → StepProgressIndicator-DLoEzGro.js} +1 -1
- package/dist/{StoreProvider-CyzNf7KK.js → StoreProvider-D9IR5HNN.js} +331 -222
- package/dist/StructuredList-9dnJRdx_.js +61 -0
- package/dist/{Summary-QyNHKBjO.js → Summary-Bq94iVfc.js} +10 -5
- package/dist/{InputText-DLAmX8CW.js → TaskVerificationStatus-BLCkXEn6.js} +3 -123
- package/dist/TaxInformationField-c-ZWfhUk.js +3134 -0
- package/dist/{TaxReportingDropin-Bn2xYbVw.js → TaxReportingDropin-ajO0q4eZ.js} +20 -17
- package/dist/TextArea-D9eJloeE.js +103 -0
- package/dist/TileGroup-CaY3i_T7.js +203 -0
- package/dist/{TrustDetailsPage-D0sr6zMt.js → TrustDetailsPage-BWXZX4-u.js} +40 -27
- package/dist/{TrustMemberCompanyPage-4sIP-M16.js → TrustMemberCompanyPage-CJj2BpXu.js} +5 -5
- package/dist/{TrustMemberIndividualPage-CelIjIAw.js → TrustMemberIndividualPage-BXp9RXDw.js} +4 -4
- package/dist/{TrustMemberRoleAndTypePage-C3CRy717.js → TrustMemberRoleAndTypePage-gYJ5U6RH.js} +24 -14
- package/dist/{TrustMembersOverview-HrRgAsno.js → TrustMembersOverview-Chmnt5jS.js} +13 -12
- package/dist/{UnincorporatedPartnershipIndividualPage-Dre5_Nuk.js → UnincorporatedPartnershipIndividualPage-DckUiPPY.js} +4 -4
- package/dist/{UnincorporatedPartnershipMemberCompanyPage-woQiy94h.js → UnincorporatedPartnershipMemberCompanyPage-Bx0A5Bit.js} +5 -5
- package/dist/{UnincorporatedPartnershipMemberRoleAndTypePage-DrirgJXY.js → UnincorporatedPartnershipMemberRoleAndTypePage-CEE1hzIn.js} +23 -16
- package/dist/{UnincorporatedPartnershipMembersOverview-BBiRqJkR.js → UnincorporatedPartnershipMembersOverview-wB8K9r6g.js} +10 -9
- package/dist/{VerificationErrorAlert-B_ovSmUS.js → VerificationErrorAlert-DZ5OOTBN.js} +4 -4
- package/dist/{ViewVerificationStatusComponent-CDQk4Nxa.js → ViewVerificationStatusComponent-BVY4YUJf.js} +4 -4
- package/dist/adyen-business-financing.js +3 -3
- package/dist/adyen-individual-configuration.js +3 -3
- package/dist/adyen-individual-status.js +3 -3
- package/dist/adyen-kyc-components.js +21 -20
- package/dist/adyen-onboarding.js +3 -3
- package/dist/adyen-terms-of-service-management.js +3 -3
- package/dist/adyen-terms-of-service-status.js +3 -3
- package/dist/adyen-transfer-instrument-configuration.js +3 -3
- package/dist/adyen-transfer-instrument-management.js +3 -3
- package/dist/adyen-verification-status.js +3 -3
- package/dist/{arrow-right-KxA3SvQj.js → arrow-right-BoqwUH_d.js} +2 -2
- package/dist/bafinUtils-Wct4TWLH.js +149 -0
- package/dist/{bag-BPumznWh.js → bag-BXVWLrwo.js} +2 -2
- package/dist/{bank-D6FiNBhs.js → bank-1GvaHPAZ.js} +2 -2
- package/dist/{bin-Bz6KOIeE.js → bin-Ba-3ll8T.js} +2 -2
- package/dist/{business-lines-DboUCbXw.js → business-lines-BAqTbnBw.js} +2 -2
- package/dist/{capital-GVQ3svwN.js → capital-9TKHySO7.js} +2 -2
- package/dist/{cash-stack-D9AoDDwt.js → cash-stack-DwYu4xNy.js} +2 -2
- package/dist/{certificate-CdEWgHQf.js → certificate-N2YFedpI.js} +2 -2
- package/dist/{checkmark-Q7x6tGhy.js → checkmark-D9dGhGpG.js} +2 -2
- package/dist/{checkmark-circle-x7dzbp3I.js → checkmark-circle-CFWClLQ6.js} +2 -2
- package/dist/{checkmark-circle-fill-CsvN5_PL.js → checkmark-circle-fill-DEB-tuGl.js} +2 -2
- package/dist/{checkmark-small-D35myntq.js → checkmark-small-D3VNx2lo.js} +2 -2
- package/dist/{chevron-down-C2iDorpW.js → chevron-down-C7SUSYfl.js} +2 -2
- package/dist/{chevron-left-ztPO84q-.js → chevron-left-BXmd-S46.js} +2 -2
- package/dist/{chevron-right-C_JN0oDt.js → chevron-right-jE6RwM2B.js} +2 -2
- package/dist/{chevron-up-CgG8n25g.js → chevron-up-BdfNcqzq.js} +2 -2
- package/dist/{circle-Bt3Nlr3q.js → circle-BJPTMCWB.js} +2 -2
- package/dist/{circle-small-filled-YMzP6yQU.js → circle-small-filled-BuO8Vg8j.js} +2 -2
- package/dist/{clock-BZHremOA.js → clock-DAzaBRWk.js} +2 -2
- package/dist/{coins-fkAk6dCo.js → coins-DYdzG5e_.js} +2 -2
- package/dist/commonValidators-DcFd5CHs.js +24 -0
- package/dist/{contract-BTa4HltT.js → contract-BfJb1t6M.js} +2 -2
- package/dist/{cross-Cn09MtQ_.js → cross-CDS_eot4.js} +2 -2
- package/dist/{cross-circle-fill-maan7Z5S.js → cross-circle-fill-C-EJ57Yn.js} +2 -2
- package/dist/{cross-circle-fill-small-DCz52AuN.js → cross-circle-fill-small-DkPjsuBH.js} +2 -2
- package/dist/currency-CrdnaaDu.js +35 -0
- package/dist/datasetUtil-BHQp0-xL.js +58 -0
- package/dist/debouncedInputEvent-Cv2S512Y.js +46 -0
- package/dist/{decision-makers-group-CgddXgrx.js → decision-makers-group-DrvpnEqj.js} +2 -2
- package/dist/{digital-wallet-D_IpxnkN.js → digital-wallet-Bx5YM1LY.js} +2 -2
- package/dist/{document-1-C08ut-Dt.js → document-1-qlSTF558.js} +2 -2
- package/dist/{document-blurred-2Zpodj3_.js → document-blurred-BiWap0xs.js} +2 -2
- package/dist/{document-cut-off-ClS7RiOp.js → document-cut-off-aQezqOif.js} +2 -2
- package/dist/{document-expired-CjksBq-N.js → document-expired-BhBXaWWQ.js} +2 -2
- package/dist/{document-front-DiAairT3.js → document-front-DYuhZGeQ.js} +2 -2
- package/dist/{document-person-vxlA6C5f.js → document-person-CDbnTOdV.js} +2 -2
- package/dist/{download-Drhk9k1f.js → download-BZQB1WkZ.js} +2 -2
- package/dist/{dropinUtils-DCWhMKpQ.js → dropinUtils-BpJn607e.js} +4 -4
- package/dist/{edit-1-CFoDTMvQ.js → edit-1-DAqtnOIx.js} +2 -2
- package/dist/{en-US-BzrLvydZ.js → en-US-CjjPhkB5.js} +2 -2
- package/dist/{external-link-DCMYUMfW.js → external-link-Cg6pJaSJ.js} +2 -2
- package/dist/fieldConfig-BPwb1GHc.js +134 -0
- package/dist/fieldConfigurations-BUT9DTUH.js +21 -0
- package/dist/form-rules-DhbF2mY4.js +13 -0
- package/dist/formUtils-BlVlgetw.js +137 -0
- package/dist/{funds-in-D8bj0aoE.js → funds-in-CInoUdmG.js} +2 -2
- package/dist/{getName-l7X1ZGKx.js → getName-CzpJ9tV7.js} +2 -2
- package/dist/getProps-CLJfvUMb.js +156 -0
- package/dist/{gift-CQ_DEma7.js → gift-omNInZeB.js} +2 -2
- package/dist/{graph-BJmqglH2.js → graph-DunG_uu1.js} +2 -2
- package/dist/{graph-up-Bq6adtlX.js → graph-up-BZze4i6m.js} +2 -2
- package/dist/{hasDataChanged-BXawTZla.js → hasDataChanged-8e8x8zjz.js} +2 -2
- package/dist/{headquarter-DNYyuuFq.js → headquarter-BhpSibFO.js} +2 -2
- package/dist/{hotel-BuNql78Z.js → hotel-Cp7VgGCJ.js} +2 -2
- package/dist/{house-B6sNRj-B.js → house-BhyBQdR3.js} +2 -2
- package/dist/{id-blurred-9dzBOWCE.js → id-blurred-B5lHEP8M.js} +2 -2
- package/dist/{id-cut-off-CohJCI2h.js → id-cut-off-Ba1FRzKO.js} +2 -2
- package/dist/{id-front-CSZfvdRg.js → id-front-CpNWN6nG.js} +2 -2
- package/dist/{id-glare-Q2JWo5ts.js → id-glare-DgCQON8k.js} +2 -2
- package/dist/{id-verification-instant-BUVBO4R3.js → id-verification-instant-Byt4Oul6.js} +2 -2
- package/dist/{id-verification-manual-B3YZALYU.js → id-verification-manual-CvcTkOSY.js} +2 -2
- package/dist/{iframeWidget-CbtmWmoO.js → iframeWidget-D6BlBF0m.js} +4 -4
- package/dist/{image-BSihO8lR.js → image-CmB0ioUM.js} +2 -2
- package/dist/{info-vHTZWoJ7.js → info-Bb_-xIEK.js} +2 -2
- package/dist/{info-filled-SQotHmT9.js → info-filled-CK8LB339.js} +2 -2
- package/dist/{instant-verification-Dvvkyfmp.js → instant-verification-UrnuHTYn.js} +2 -2
- package/dist/isEmpty-CsYVgjoD.js +23 -0
- package/dist/japanSupportUtils-iATUjnbf.js +17 -0
- package/dist/jpAddressSchema-De6ix57p.js +28 -0
- package/dist/{localizeDateString-BX5t59Ip.js → localizeDateString-BHDr1NID.js} +2 -2
- package/dist/{location-Q4oKvnkl.js → location-itJfxrDQ.js} +2 -2
- package/dist/{mail-BOdyoVqB.js → mail-VHTlAusn.js} +2 -2
- package/dist/makeSelectItemForRole-Bm2NwBxD.js +133 -0
- package/dist/{manual-verification-BvZWqA00.js → manual-verification-BO8zgAYT.js} +2 -2
- package/dist/{mapExistingFile-Bd7nsoK8.js → mapExistingFile-DNBa6Ekj.js} +80 -5
- package/dist/mapJpAddressSchemaToAddressLocalizations-BNb8d51F.js +147 -0
- package/dist/{mapLegalEntityToIndividualOnfidoSchema-CQF6zsO7.js → mapLegalEntityToIndividualOnfidoSchema-DREgz5Ms.js} +63 -3
- package/dist/{mapTransferInstrumentToPayoutAccount-CacHlKHM.js → mapTransferInstrumentToPayoutAccount-C5NqOfNW.js} +2 -2
- package/dist/{minus-circle-filled-kC2IUvKz.js → minus-circle-filled-ZhtJ0GD3.js} +2 -2
- package/dist/{onfido-logo-BWSv__sQ.js → onfido-logo-BSkKPH10.js} +2 -2
- package/dist/{options-horizontal-CBmbNv7R.js → options-horizontal-GuXvLvV3.js} +2 -2
- package/dist/{partner-CPjsrePY.js → partner-QD27Vy4w.js} +2 -2
- package/dist/{passport-blurred-B4UDQfmc.js → passport-blurred-CVG493IJ.js} +2 -2
- package/dist/{passport-cut-off-C0N2mgLk.js → passport-cut-off-COzA_TmB.js} +2 -2
- package/dist/{passport-front-BwA7wR91.js → passport-front-WJleLixT.js} +2 -2
- package/dist/{passport-front-green-BL4HmtsB.js → passport-front-green-CZVkCa1n.js} +2 -2
- package/dist/{passport-glare-Mg2ixsYA.js → passport-glare-BP5WnJZj.js} +2 -2
- package/dist/patternValidators-BXduwLbz.js +83 -0
- package/dist/{pay-by-link-plane-BVZndh67.js → pay-by-link-plane-BpY8Q6-B.js} +2 -2
- package/dist/{payout-ChUEoLjt.js → payout-DtB68BcZ.js} +2 -2
- package/dist/{payout-verification-instant-5u-wvFKv.js → payout-verification-instant-BzpfOQLD.js} +2 -2
- package/dist/{payout-verification-manual-BH2mu0UW.js → payout-verification-manual-gNEoeZkV.js} +2 -2
- package/dist/{person-DGjUU4S4.js → person-IVZG3t3_.js} +2 -2
- package/dist/{plaid-logo-CtActXTN.js → plaid-logo-FsZ7kfL-.js} +2 -2
- package/dist/{plus-CWXA5wdX.js → plus-DiALAL8-.js} +2 -2
- package/dist/{plus-circle-filled-CbC0u2Y1.js → plus-circle-filled-BzHtTqEN.js} +2 -2
- package/dist/{process-field-configurations-BZQqH4-M.js → process-field-configurations-B26ehyAw.js} +3 -3
- package/dist/{recurring-CkL4cCM2.js → recurring-DKNs9K3x.js} +2 -2
- package/dist/{reporting-DerosUNm.js → reporting-D5ABpLO_.js} +2 -2
- package/dist/{resolveEnvironment-C6JtHmZc.js → resolveEnvironment-B5Yrsa4J.js} +3 -3
- package/dist/{revenue-accelerate-Dp4Ns_5c.js → revenue-accelerate-D7Sp0V4a.js} +2 -2
- package/dist/{review-CxIN9azU.js → review-D4TUjcWF.js} +2 -2
- package/dist/roleMetadata-DmgqzhZJ.js +66 -0
- package/dist/{rules-ClDW_ZSK.js → rules-B_6RrE9T.js} +6 -5
- package/dist/{save-Fgy7EDid.js → save-BfqO2JBI.js} +2 -2
- package/dist/{search-C4GZ-Rc1.js → search-Cmzbf5zI.js} +2 -2
- package/dist/{show-yPjPmEf8.js → show-IdbU1C6P.js} +2 -2
- package/dist/{singpass-logo-BkMSwiGY.js → singpass-logo-wY4xsmTX.js} +2 -2
- package/dist/{singpass-verification-instant-hY4eGFwl.js → singpass-verification-instant-JCqTr7Mv.js} +2 -2
- package/dist/{singpass-verification-manual-DwhRpy5Q.js → singpass-verification-manual-DQ7XW6R3.js} +2 -2
- package/dist/{solution-payments-CNAat9h7.js → solution-payments-DpyE_sdS.js} +2 -2
- package/dist/{store-IuAkDRAp.js → store-Btc4GcmU.js} +2 -2
- package/dist/style.css +965 -993
- package/dist/styles-CLV89_hH.js +965 -993
- package/dist/summaryItem-CAQCQSkt.js +18 -0
- package/dist/{tax-reporting-graph-DjzwRgE6.js → tax-reporting-graph-hgoilCHZ.js} +2 -2
- package/dist/{terminal-1-_me9J9h0.js → terminal-1-D1pwXCoi.js} +2 -2
- package/dist/{tink-logo-BcIv93ND.js → tink-logo-DDyjz5eJ.js} +2 -2
- package/dist/types/api/businessLines/useCreateBusinessLine.d.ts +1 -1
- package/dist/types/api/businessLines/useDeleteBusinessLine.d.ts +1 -1
- package/dist/types/api/businessLines/useUpdateBusinessLines.d.ts +1 -1
- package/dist/types/api/businessLines/useUpdateSourceOfFunds.d.ts +1 -1
- package/dist/types/api/companyDataSet/useClearCompanyData.d.ts +1 -1
- package/dist/types/api/createLegalEntity/useCreateLegalEntity.d.ts +1 -1
- package/dist/types/api/documentValidation/useDocumentValidate.d.ts +1 -1
- package/dist/types/api/documents/useCreateDocument.d.ts +1 -1
- package/dist/types/api/documents/useDeleteDocument.d.ts +1 -1
- package/dist/types/api/documents/useDocument.d.ts +1 -1
- package/dist/types/api/documents/useUpdateDocument.d.ts +1 -1
- package/dist/types/api/entityVerifications/useVerifyIdNumber.d.ts +2 -2
- package/dist/types/api/idVerificationProviders/idVerificationStartCheck.d.ts +1 -1
- package/dist/types/api/idVerificationProviders/useExtractDocumentInformation.d.ts +1 -1
- package/dist/types/api/idVerificationProviders/useIdVerificationToken.d.ts +1 -1
- package/dist/types/api/legalEntity/useConfirmReview.d.ts +1 -1
- package/dist/types/api/legalEntity/useUpdateLegalEntity.d.ts +1 -1
- package/dist/types/api/onboardingStatus/useGenerateOnboardingLink.d.ts +1 -1
- package/dist/types/api/pci/useSignPci.d.ts +1 -2
- package/dist/types/api/taskStatus/useTaskStatus.d.ts +2 -2
- package/dist/types/api/termsOfService/useAcceptTermsOfService.d.ts +1 -1
- package/dist/types/api/types.d.ts +2 -1
- package/dist/types/api/uiAnalytics/useAnalyticsSession.d.ts +1 -1
- package/dist/types/api/uiAnalytics/usePushAnalyticEvent.d.ts +1 -1
- package/dist/types/api/validation/useValidateAccountIdentification.d.ts +1 -1
- package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +0 -1
- package/dist/types/components/BankAccount/forms/BankVerification/types.d.ts +1 -0
- package/dist/types/components/BankAccount/forms/BankVerification/verification/overlay/BankVerificationOverlay.d.ts +1 -1
- package/dist/types/components/BankAccount/forms/PayoutDetails/types.d.ts +0 -1
- package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +439 -439
- package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/PayoutDetailsDropin.d.ts +1 -1
- package/dist/types/components/BankAccount/utils/payoutAccountUtil.d.ts +1 -1
- package/dist/types/components/Business/forms/BusinessDetails/form-ids.d.ts +2 -0
- package/dist/types/components/Business/forms/BusinessDetails/types.d.ts +1 -0
- package/dist/types/components/Business/forms/CompanyStructure/CompanyStructure.d.ts +0 -1
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +1 -1
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +1 -1
- package/dist/types/components/BusinessLines/tasks/BusinessLines/BusinessLinesDropin.d.ts +1 -1
- package/dist/types/components/BusinessLines/tasks/types.d.ts +2 -0
- package/dist/types/components/BusinessLines/tasks/utils.d.ts +4 -2
- package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +475 -475
- package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +1 -2
- package/dist/types/components/EFP/tasks/TaxReportingDropin/utils.d.ts +1 -2
- package/dist/types/components/EmbeddedDropins/BusinessFinancingComponent/utils.d.ts +1 -1
- package/dist/types/components/Individual/forms/Individual/Individual.d.ts +41 -3
- package/dist/types/components/Individual/forms/Individual/form-ids.d.ts +2 -0
- package/dist/types/components/Individual/forms/Individual/types.d.ts +1 -2
- package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.types.d.ts +1 -0
- package/dist/types/components/Individual/forms/IndividualOnfido/form-ids.d.ts +2 -0
- package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/utils.d.ts +1 -1
- package/dist/types/components/Individual/tasks/DecisionMakers/utils.d.ts +1 -1
- package/dist/types/components/Shared/Introduction/copy.d.ts +1 -1
- package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
- package/dist/types/components/Shared/forms/BusinessTypeSelection/utils.d.ts +1 -1
- package/dist/types/components/Trust/tasks/RoleAndTypeDropin/formatRoleAndEntityTypeSummary.d.ts +1 -1
- package/dist/types/components/ui/molecules/EmbeddedStatus/statusToTag.d.ts +1 -1
- package/dist/types/core/user-events.d.ts +1 -0
- package/dist/types/language/types.d.ts +7 -2
- package/dist/types/language/utils.d.ts +1 -2
- package/dist/types/types/assert.d.ts +1 -0
- package/dist/types/utils/analytics/debouncedInputEvent.d.ts +1 -0
- package/dist/types/utils/analytics/getPrefilledDetails.d.ts +28 -0
- package/dist/types/utils/api/processCapabilitites.d.ts +13 -0
- package/dist/types/utils/entityStatusUtil.d.ts +1 -1
- package/dist/types/utils/formUtils.d.ts +1 -2
- package/dist/types/utils/getDisplayErrorMessage.d.ts +1 -2
- package/dist/types/utils/getName.d.ts +1 -1
- package/dist/types/utils/makeSelectItemForRole.d.ts +1 -1
- package/dist/types/utils/translation.d.ts +3 -2
- package/dist/{types-DDnAZYTj.js → types-C6ntGMCy.js} +3 -26
- package/dist/{types-DE1uuPfP.js → types-CpAtsPmJ.js} +1 -1
- package/dist/{types-hGeLq0SR.js → types-c9nG7Dev.js} +1 -1
- package/dist/unincorporated-partnership-MeN1dp53.js +97 -0
- package/dist/{upload-BF65P4KM.js → upload-BmUXjsaU.js} +2 -2
- package/dist/{us-check-CYY6Crhr.js → us-check-C1rTBsCY.js} +2 -2
- package/dist/{us-check-account-number-C7KE5YzX.js → us-check-account-number-9lI1dXNC.js} +2 -2
- package/dist/{us-check-routing-number-DUbhsYAR.js → us-check-routing-number-s_KaAGSM.js} +2 -2
- package/dist/{useAssociatedLegalEntity-D_Nk_obe.js → useAssociatedLegalEntity-ahBb64MW.js} +2 -2
- package/dist/useBusinessDetailsData-qQ2HRnKK.js +5161 -0
- package/dist/{useCreateLegalEntity-DT7ue23d.js → useCreateLegalEntity-Kc8_ZlAe.js} +2 -2
- package/dist/useDataset-DfKmlbQd.js +74 -0
- package/dist/useForm-9uKM-XKf.js +582 -0
- package/dist/{FormFlow-BrgeP70A.js → useFormContext-CvQfKDA3.js} +26 -31
- package/dist/{useGlobalData-C7tjZfC0.js → useGlobalData-BVQ2OrIi.js} +3 -3
- package/dist/useId-BZ0PA7jP.js +24 -0
- package/dist/{useMultiForm-DWozxGN4.js → useMultiForm-pAiPIh7X.js} +4 -4
- package/dist/{useOnboardingStatus-DBLS6PUq.js → useOnboardingStatus-BhDBSLB6.js} +1 -1
- package/dist/{useScenarios-DD06bWNN.js → useScenarios-DFW21Vhf.js} +2 -2
- package/dist/{useTermsOfServiceStatus-D2lYSqHn.js → useTermsOfServiceStatus-BnO0rXiL.js} +1 -1
- package/dist/{useToastContext-Cbw29cqc.js → useToastContext-D6Lbxqj9.js} +5 -17
- package/dist/{useUnincorporatedPartnershipMembers-Dbb2VjkF.js → useUnincorporatedPartnershipMembers-CIC7xPbD.js} +5 -5
- package/dist/useUpdateBusinessLines-WlwUOtSU.js +337 -0
- package/dist/{useUpdateLegalEntity-Aubxhgvv.js → useUpdateLegalEntity-CStkUt4I.js} +3 -3
- package/dist/utils-7_xBiPO_.js +58 -0
- package/dist/utils-BmxzrkCX.js +165 -0
- package/dist/{utils-D1-D6fui.js → utils-CB39nVjj.js} +6 -6
- package/dist/{utils-DenrGsUh.js → utils-CDAwsXQa.js} +4 -4
- package/dist/utils-DOiFhaKn.js +29 -0
- package/dist/{documentUtils-Be5wlCwo.js → validate-Bsx2oHT1.js} +170 -6
- package/dist/{validate-BxVes1el.js → validate-D-l23QLG.js} +2 -2
- package/dist/validate-D4iK6FUk.js +385 -0
- package/dist/{validationError-DPP91cM3.js → validationError-DYYlX-5X.js} +2 -2
- package/dist/{warning-circle-fill-CEN1WL7A.js → warning-circle-fill-DBvt921B.js} +2 -2
- package/dist/{warning-diamond-filled-BfXMlVrG.js → warning-diamond-filled-Lb2od2ry.js} +2 -2
- package/dist/{webinar-DqjqrNEv.js → webinar-m9nuFZBt.js} +2 -2
- package/dist/{yapily-logo-CZ4ywjwA.js → yapily-logo-BduxhNRA.js} +2 -2
- package/package.json +6 -6
- package/dist/ConstitutionalDocument-DM6M40MP.js +0 -143
- package/dist/CountryField-CsKJAI53.js +0 -843
- package/dist/IndividualOnfidoDropin-DZEn2Tf8.js +0 -2575
- package/dist/OnboardingDropinComponent-Cx-c_p0i.js +0 -7623
- package/dist/getFieldsWithExistingData-CfckMyJ1.js +0 -22
- package/dist/mapFinancialReportsToFinancialInformation-Bfvt2G87.js +0 -67
- package/dist/mapJpAddressSchemaToAddressLocalizations-CWY2lZGD.js +0 -63
- package/dist/types/components/Shared/forms/BusinessTypeSelection/EntityTypeRadioGroupCard.d.ts +0 -11
- package/dist/useBusinessDetailsData-DG9EJBH_.js +0 -2441
- package/dist/useDataset-DCCxYOjr.js +0 -220
- package/dist/useUpdateBusinessLines-8bDYsLav.js +0 -46
- package/dist/validate-BgMFLdKI.js +0 -41
|
@@ -1,2441 +0,0 @@
|
|
|
1
|
-
;
|
|
2
|
-
{
|
|
3
|
-
try {
|
|
4
|
-
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "1a257d6a-01e8-41bb-9504-99ba1fe86766", e._sentryDebugIdIdentifier = "sentry-dbid-1a257d6a-01e8-41bb-9504-99ba1fe86766");
|
|
6
|
-
} catch (e) {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
;
|
|
10
|
-
import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
|
|
11
|
-
import { u as useTranslation, B as Button, G as Typography, C as CountryCodes, O as TaskTypes, r as LegalEntityTypes, W as isEmpty, a1 as entriesOf, bC as businessDetailsComponentsKeyMapping, bD as solePropBusinessDetailsKeyMapping, ak as objectsDeepEqual, aq as keysOf, i as isUndefinedOrNull, bE as solePropBusinessDetailsApiKeyMapping, bp as businessDetailsApiKeyMapping, P as createLogger, b8 as filterOutUnwantedAssociationsIfRootLE, b6 as drop, ag as getOwnEntityAssociations, aV as doArraysMatch, b as useApiContext, a3 as useAnalyticsContext, a2 as useQueryClient, X as useExperimentsContext, $ as useVersionConfiguration, o as useSettingsContext, K as useAccountHolder, bF as solePropBusinessDetailsDocumentMapping, bG as businessDetailsDocumentMapping, j as useQuery, c as useLegalEntity, R as ROOT_LE } from "./StoreProvider-CyzNf7KK.js";
|
|
12
|
-
import { useState, useEffect, useMemo, useCallback } from "preact/hooks";
|
|
13
|
-
import { u as useCreateBusinessLine, a as useUpdateBusinessLine } from "./useUpdateBusinessLines-8bDYsLav.js";
|
|
14
|
-
import { F as FinancialInformation, A as AdditionalInformation, C as CompanyStructure, B as BusinessSelection, h as BasicInformation, i as getDefaultRegistrationNumberType, j as getDefaultVatNumberType, o as operationalAddressIsSameIds, k as FIELDS_NEEDED_FOR_COMPANY_SEARCH, v as verifiedBusiness, l as isVerifiedSingleCompanySearchResult, m as companyTypeMetadata, p as documentFormsIds, r as registrationNumberDefaultFieldMetadata, q as inferCompanyRegistrationNumberType, s as registrationNumberDefaultFieldConfig, t as stockTickerSymbolFieldMetadata, w as stockISINFieldMetadata, x as stockExchangeMICFieldMetadata, y as dateOfIncorporationFieldMetadata, z as industryCodeFieldMetadata, D as eInvoicingCodeFieldMetadata, G as vatAbsenceReasonMetadata, H as exemptFromRegistrationNumberDefaultFieldMetadata, I as doingBusinessAsFieldMetadata, J as doingBusinessAsAbsentFieldMetadata, K as defaultFieldMetadata, L as defaultFieldConfig, M as defaultFieldMetadata$1, N as defaultFieldConfig$1, P as defaultFieldMetadataV4, Q as defaultFieldMetadata$2, R as defaultFieldConfigV4, S as defaultFieldConfig$2, g as getForms, T as financialInfoValidationWithEmployeesRules, U as tinMatched, V as businessMismatchModalOpen, W as useCompanySearch, X as useVerifyTin, Y as handleCompanySelection, Z as applyVerifiedBusinessData, _ as useBusinessLines } from "./OnboardingDropinComponent-Cx-c_p0i.js";
|
|
15
|
-
import { u as useCreateLegalEntity } from "./useCreateLegalEntity-DT7ue23d.js";
|
|
16
|
-
import { u as useUpdateLegalEntity } from "./useUpdateLegalEntity-Aubxhgvv.js";
|
|
17
|
-
import { F as FormContextProvider, a as FormFlow } from "./FormFlow-BrgeP70A.js";
|
|
18
|
-
import { a as useToastContext } from "./useToastContext-Cbw29cqc.js";
|
|
19
|
-
import { _ as MemoizedDocumentUpload, C as CompanyTypesValues, m as COUNTRIES_USING_COMPANY_SEARCH, $ as isRegistrationNumberAbsentStateV4Scenario, D as isEmpty$1, a0 as COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT, r as requestingBanking, e as requestingIssuing, a as getCompanyRegistrationNumberOptions, t as taxInformationDefaultFieldMetadata, a1 as countryToTaxInfoTypeMap, f as taxInformationDefaultFieldConfig, a2 as rules } from "./IndividualOnfido-pGSPtITh.js";
|
|
20
|
-
import { c as composePerScenarioFormConfigurations, g as getPropsFromConfigurations } from "./process-field-configurations-BZQqH4-M.js";
|
|
21
|
-
import { a as addValidityToForms, u as useFormComposer } from "./dropinUtils-DCWhMKpQ.js";
|
|
22
|
-
import { u as useMultiForm } from "./useMultiForm-DWozxGN4.js";
|
|
23
|
-
import { m as mapExistingFile, g as getPageName, u as useScenarioConfiguration } from "./mapExistingFile-Bd7nsoK8.js";
|
|
24
|
-
import { a as datasetUtilities, C as Confirm } from "./useDataset-DCCxYOjr.js";
|
|
25
|
-
import { a as getDocument, e as getDocuments, c as createDocumentRequest, h as mergeProofOfOwnershipAttachments, b as getFileExtention, d as documentApiUtils } from "./documentUtils-Be5wlCwo.js";
|
|
26
|
-
import { g as getFieldsWithExistingData } from "./getFieldsWithExistingData-CfckMyJ1.js";
|
|
27
|
-
import { u as useFormContext, i as isDateOlderThanAYear, o as mapAddressLabels, p as getKeyForField } from "./Address-BUrDDnmR.js";
|
|
28
|
-
import { M as MemoizedConstitutionalDocument } from "./ConstitutionalDocument-DM6M40MP.js";
|
|
29
|
-
import { M as Modal, a as ModalContent } from "./Modal-B4wxf7HK.js";
|
|
30
|
-
import { S as SettingNames } from "./InputText-DLAmX8CW.js";
|
|
31
|
-
import { m as mapJpAddressSchemaToAddressLocalizations, a as mapJpAddressSummary } from "./mapJpAddressSchemaToAddressLocalizations-CWY2lZGD.js";
|
|
32
|
-
import { o as organizationTypesToSkipCompanyStructureForm } from "./utils-D1-D6fui.js";
|
|
33
|
-
import { f as formatCurrency, A as ALLOWED_SOF_SERVICES } from "./utils-DenrGsUh.js";
|
|
34
|
-
import { s as summaryItem } from "./CountryField-CsKJAI53.js";
|
|
35
|
-
import { s as summaryStep } from "./Summary-QyNHKBjO.js";
|
|
36
|
-
import { i as isValidationError, p as processValidationErrors, a as isMaintenanceModeError } from "./validationError-DPP91cM3.js";
|
|
37
|
-
import { r as resolveFieldMetadata } from "./Spacer-w89ksCbG.js";
|
|
38
|
-
import { m as mapFinancialReportsToFinancialInformation, a as mapFinancialInformationToFinancialReport } from "./mapFinancialReportsToFinancialInformation-Bfvt2G87.js";
|
|
39
|
-
import { f as formatObject } from "./utils-DNSfZiio.js";
|
|
40
|
-
import { b as mapAddressLocalizationToJpAddressSchema, a as mapApiScriptLocalizationToSchemaFields, m as mapSchemaFieldsToApiScriptLocalization } from "./mapAddressLocalizationToJpAddressSchema-vJWbpAyq.js";
|
|
41
|
-
const stripWhitespace = (str) => str.replace(/\s/g, "");
|
|
42
|
-
const toNormalizedString = (s) => stripWhitespace(s.toLowerCase());
|
|
43
|
-
const isNormalizedStringMatch = (s1, s2) => toNormalizedString(s1) === toNormalizedString(s2);
|
|
44
|
-
const documentTypes$2 = [
|
|
45
|
-
{ id: "Internal company document", name: "internalCompanyDocument" },
|
|
46
|
-
{ id: "Business registry statement", name: "businessRegistryStatement" }
|
|
47
|
-
];
|
|
48
|
-
const GuidanceContent$4 = ({ t }) => {
|
|
49
|
-
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-upload-field__guidance", children: /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-u-margin-bottom-24", children: [
|
|
50
|
-
/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }),
|
|
51
|
-
/* @__PURE__ */ jsxs("ul", { children: [
|
|
52
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["includesTheDirectorsFullName"], { ns: "business" }) }),
|
|
53
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["includesEvidenceOfTheIndividualsRole"], { ns: "business" }) }),
|
|
54
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["issuedOrSignedByALegalRepresentative"], { ns: "business" }) })
|
|
55
|
-
] })
|
|
56
|
-
] }) });
|
|
57
|
-
};
|
|
58
|
-
function ProofOfDirectorDocument({ id, country, ...props }) {
|
|
59
|
-
const { t } = useTranslation(["common", "business"]);
|
|
60
|
-
const [selectedDocumentName, setSelectedDocumentName] = useState(documentTypes$2[0].id);
|
|
61
|
-
return /* @__PURE__ */ jsx(
|
|
62
|
-
MemoizedDocumentUpload,
|
|
63
|
-
{
|
|
64
|
-
...props,
|
|
65
|
-
id,
|
|
66
|
-
heading: t(($) => $["uploadYourOrganizationProofOfDirector"], { ns: "business" }),
|
|
67
|
-
description: t(($) => $["weNeedAnOfficialDocument"], { ns: "business" }),
|
|
68
|
-
documentField: "proofOfDirector",
|
|
69
|
-
documentType: "proofOfDirector",
|
|
70
|
-
guidanceContent: /* @__PURE__ */ jsx(GuidanceContent$4, { t }),
|
|
71
|
-
country,
|
|
72
|
-
hidePageCount: true,
|
|
73
|
-
documentTypeSelect: {
|
|
74
|
-
selectedType: selectedDocumentName,
|
|
75
|
-
setSelectedType: setSelectedDocumentName,
|
|
76
|
-
options: documentTypes$2
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
const DOC_TYPE_FOR_MULTI_UPLOAD = "Organizational chart and supporting document";
|
|
82
|
-
const documentTypes$1 = [
|
|
83
|
-
{ id: "Certified Organizational chart", name: "certifiedOrganizationalChart" },
|
|
84
|
-
{
|
|
85
|
-
id: "Organizational chart and supporting document",
|
|
86
|
-
name: "organizationalChartAndSupportingDocument"
|
|
87
|
-
}
|
|
88
|
-
];
|
|
89
|
-
const GuidanceContent$3 = ({
|
|
90
|
-
selectedDocumentName,
|
|
91
|
-
t
|
|
92
|
-
}) => {
|
|
93
|
-
const [showGuidanceModal, setShowGuidanceModal] = useState(false);
|
|
94
|
-
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-upload-field__guidance", children: /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-u-margin-bottom-24", children: [
|
|
95
|
-
/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }),
|
|
96
|
-
selectedDocumentName === "Certified Organizational chart" ? /* @__PURE__ */ jsxs("ul", { children: [
|
|
97
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["showsOwnershipAndControllingRelations"], { ns: "business" }) }),
|
|
98
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["entitiesMustIncludeANameLegalStructureAndCountryRegionOfRegistration"], {
|
|
99
|
-
ns: "business"
|
|
100
|
-
}) }),
|
|
101
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["signedByALawyerAccountantAuditorWithinTheLast6Months"], {
|
|
102
|
-
ns: "business"
|
|
103
|
-
}) })
|
|
104
|
-
] }) : /* @__PURE__ */ jsxs("ul", { children: [
|
|
105
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["oneOrganizationalChartShowingOwnershipAndControllingRelations"], {
|
|
106
|
-
ns: "business"
|
|
107
|
-
}) }),
|
|
108
|
-
/* @__PURE__ */ jsxs("ul", { children: [
|
|
109
|
-
/* @__PURE__ */ jsx("li", { children: t(
|
|
110
|
-
($) => $["entitiesMustIncludeANameLegalStructureAndCountryRegionOfRegistration"],
|
|
111
|
-
{
|
|
112
|
-
ns: "business"
|
|
113
|
-
}
|
|
114
|
-
) }),
|
|
115
|
-
/* @__PURE__ */ jsxs("li", { children: [
|
|
116
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
117
|
-
t(($) => $["one"], { ns: "common" }),
|
|
118
|
-
" "
|
|
119
|
-
] }),
|
|
120
|
-
/* @__PURE__ */ jsx(Button, { onClick: () => setShowGuidanceModal(true), variant: "link", children: t(($) => $["supportingDocument"], { ns: "common" }) }),
|
|
121
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
122
|
-
" ",
|
|
123
|
-
t(($) => $["describingTheOrganizationAndItsUBOSignedWithinTheLast6Months"], {
|
|
124
|
-
ns: "business"
|
|
125
|
-
})
|
|
126
|
-
] })
|
|
127
|
-
] })
|
|
128
|
-
] })
|
|
129
|
-
] }),
|
|
130
|
-
showGuidanceModal && /* @__PURE__ */ jsx(
|
|
131
|
-
Modal,
|
|
132
|
-
{
|
|
133
|
-
size: "small",
|
|
134
|
-
onClose: () => setShowGuidanceModal(false),
|
|
135
|
-
ariaLabel: t(($) => $["whichDocumentsQualifyToProveOwnership"], { ns: "business" }),
|
|
136
|
-
children: /* @__PURE__ */ jsxs(ModalContent, { children: [
|
|
137
|
-
/* @__PURE__ */ jsx(
|
|
138
|
-
Typography,
|
|
139
|
-
{
|
|
140
|
-
el: "h1",
|
|
141
|
-
variant: "title-l",
|
|
142
|
-
className: "adyen-kyc-u-margin-bottom-32 adyen-kyc-u-margin-top-32",
|
|
143
|
-
children: t(($) => $["whichDocumentsQualifyToProveOwnership"], { ns: "business" })
|
|
144
|
-
}
|
|
145
|
-
),
|
|
146
|
-
/* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: t(($) => $["theDocumentsWeCanAcceptToProveOwnershipAre"], { ns: "business" }) }),
|
|
147
|
-
/* @__PURE__ */ jsxs("ul", { children: [
|
|
148
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["securitiesRegister"], { ns: "business" }) }),
|
|
149
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["shareholderRegister"], { ns: "business" }) }),
|
|
150
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["ultimateBeneficialOwnerRegister"], { ns: "business" }) }),
|
|
151
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["articlesOfIncorporation"], { ns: "business" }) }),
|
|
152
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["annualReports"], { ns: "business" }) }),
|
|
153
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["annualReturns"], { ns: "business" }) }),
|
|
154
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["certificateOfCorporateStatus"], { ns: "business" }) }),
|
|
155
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["shareholderAgreements"], { ns: "business" }) }),
|
|
156
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["assignmentAgreements"], { ns: "business" }) }),
|
|
157
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["partnershipAgreements"], { ns: "business" }) }),
|
|
158
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["boardOfDirectorsMeetingRecords"], { ns: "business" }) }),
|
|
159
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["registrationDocument"], { ns: "business" }) }),
|
|
160
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["certificateOfIncumbency"], { ns: "business" }) })
|
|
161
|
-
] })
|
|
162
|
-
] })
|
|
163
|
-
}
|
|
164
|
-
)
|
|
165
|
-
] }) });
|
|
166
|
-
};
|
|
167
|
-
function ProofOfOwnershipDocument({ id, country, ...props }) {
|
|
168
|
-
const { t } = useTranslation(["common", "business"]);
|
|
169
|
-
const [selectedDocumentName, setSelectedDocumentName] = useState(documentTypes$1[0].id);
|
|
170
|
-
const supportsMultiple = selectedDocumentName === DOC_TYPE_FOR_MULTI_UPLOAD;
|
|
171
|
-
useEffect(() => {
|
|
172
|
-
if (props.data?.proofOfOwnership?.length === 2) {
|
|
173
|
-
setSelectedDocumentName(DOC_TYPE_FOR_MULTI_UPLOAD);
|
|
174
|
-
}
|
|
175
|
-
}, [props.data?.proofOfOwnership]);
|
|
176
|
-
return /* @__PURE__ */ jsx(
|
|
177
|
-
MemoizedDocumentUpload,
|
|
178
|
-
{
|
|
179
|
-
...props,
|
|
180
|
-
id,
|
|
181
|
-
heading: t(($) => $["uploadYourOrganizationProofOfOwnership"], { ns: "business" }),
|
|
182
|
-
description: t(($) => $["weNeedAnOfficialDocumentForOwnership"], { ns: "business" }),
|
|
183
|
-
documentField: "proofOfOwnership",
|
|
184
|
-
documentType: "proofOfOwnership",
|
|
185
|
-
guidanceContent: /* @__PURE__ */ jsx(GuidanceContent$3, { selectedDocumentName, t }),
|
|
186
|
-
country,
|
|
187
|
-
label: t(($) => $["uploadYourDocuments"], { ns: "business" }),
|
|
188
|
-
documentTypeSelect: {
|
|
189
|
-
selectedType: selectedDocumentName,
|
|
190
|
-
setSelectedType: setSelectedDocumentName,
|
|
191
|
-
options: documentTypes$1
|
|
192
|
-
},
|
|
193
|
-
hidePageCount: true,
|
|
194
|
-
supportsMultipleUploads: supportsMultiple,
|
|
195
|
-
maxNumberOfFiles: supportsMultiple ? 2 : 1,
|
|
196
|
-
extraDropzoneDescription: supportsMultiple ? t(($) => $["oneOrganizationalChartAndOneSupportingDocument"], { ns: "business" }) : void 0
|
|
197
|
-
}
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
const documentTypes = [
|
|
201
|
-
{ id: "Trade registry document", name: "tradeRegistryDocument" },
|
|
202
|
-
{ id: "Internal company document", name: "internalCompanyDocument" }
|
|
203
|
-
];
|
|
204
|
-
const GuidanceContent$2 = ({ t }) => {
|
|
205
|
-
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-upload-field__guidance", children: /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-u-margin-bottom-24", children: [
|
|
206
|
-
/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }),
|
|
207
|
-
/* @__PURE__ */ jsxs("ul", { children: [
|
|
208
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["includesTheSignatorysFullName"], { ns: "business" }) }),
|
|
209
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["includesEvidenceOfTheIndividualsRoleSignatory"], { ns: "business" }) }),
|
|
210
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["issuedOrSignedByALegalRepresentative"], { ns: "business" }) })
|
|
211
|
-
] })
|
|
212
|
-
] }) });
|
|
213
|
-
};
|
|
214
|
-
function ProofOfSignatoryDocument({ id, country, ...props }) {
|
|
215
|
-
const { t } = useTranslation(["common", "business"]);
|
|
216
|
-
const [selectedDocumentName, setSelectedDocumentName] = useState(documentTypes[0].id);
|
|
217
|
-
return /* @__PURE__ */ jsx(
|
|
218
|
-
MemoizedDocumentUpload,
|
|
219
|
-
{
|
|
220
|
-
...props,
|
|
221
|
-
id,
|
|
222
|
-
heading: t(($) => $["uploadYourOrganizationProofOfSignatory"], { ns: "business" }),
|
|
223
|
-
description: t(($) => $["weNeedAnOfficialDocumentSignatory"], { ns: "business" }),
|
|
224
|
-
documentField: "proofOfSignatory",
|
|
225
|
-
documentType: "proofOfSignatory",
|
|
226
|
-
guidanceContent: /* @__PURE__ */ jsx(GuidanceContent$2, { t }),
|
|
227
|
-
country,
|
|
228
|
-
hidePageCount: true,
|
|
229
|
-
documentTypeSelect: {
|
|
230
|
-
selectedType: selectedDocumentName,
|
|
231
|
-
setSelectedType: setSelectedDocumentName,
|
|
232
|
-
options: documentTypes
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
);
|
|
236
|
-
}
|
|
237
|
-
const ACCEPTED_DOCUMENTS_MAP$1 = {
|
|
238
|
-
[CountryCodes.PuertoRico]: {
|
|
239
|
-
// should exactly match CountryCodes.UnitedStates
|
|
240
|
-
[CompanyTypesValues.PRIVATE_COMPANY]: {
|
|
241
|
-
header: "acceptedDocumentsForPrivateCompanies",
|
|
242
|
-
documents: [
|
|
243
|
-
"certificateOfIncorporation",
|
|
244
|
-
"certificateOfFormation",
|
|
245
|
-
"secretaryOfStateFiling__PR"
|
|
246
|
-
]
|
|
247
|
-
},
|
|
248
|
-
[CompanyTypesValues.PUBLIC_COMPANY]: {
|
|
249
|
-
header: "acceptedDocumentsForPublicCompanies",
|
|
250
|
-
documents: ["certificateOfIncorporation", "certificateOfFormation"]
|
|
251
|
-
},
|
|
252
|
-
[CompanyTypesValues.UNLISTED_PUBLIC_COMPANY]: {
|
|
253
|
-
header: "acceptedDocumentsForPublicCompanies",
|
|
254
|
-
documents: ["certificateOfIncorporation", "certificateOfFormation"]
|
|
255
|
-
},
|
|
256
|
-
[CompanyTypesValues.GOVERNMENTAL_ORGANIZATION]: {
|
|
257
|
-
header: "acceptedDocumentsForGovernment",
|
|
258
|
-
documents: ["charter"]
|
|
259
|
-
},
|
|
260
|
-
[CompanyTypesValues.NON_PROFIT_OR_CHARITABLE]: {
|
|
261
|
-
header: "acceptedDocumentsForNonProfit",
|
|
262
|
-
documents: [
|
|
263
|
-
"articlesOfIncorporation",
|
|
264
|
-
"meetingRecords",
|
|
265
|
-
"secretaryOfStateRegDoc__PR",
|
|
266
|
-
"certificateOfIncumbency"
|
|
267
|
-
]
|
|
268
|
-
},
|
|
269
|
-
[CompanyTypesValues.INCORPORATED_PARTNERSHIP]: {
|
|
270
|
-
header: "acceptedDocumentsForPartnerships",
|
|
271
|
-
documents: ["partnerShipAgreement", "secretaryOfStateFiling__PR"]
|
|
272
|
-
}
|
|
273
|
-
},
|
|
274
|
-
[CountryCodes.UnitedStates]: {
|
|
275
|
-
[CompanyTypesValues.PRIVATE_COMPANY]: {
|
|
276
|
-
header: "acceptedDocumentsForPrivateCompanies",
|
|
277
|
-
documents: ["certificateOfIncorporation", "certificateOfFormation", "secretaryOfStateFiling"]
|
|
278
|
-
},
|
|
279
|
-
[CompanyTypesValues.PUBLIC_COMPANY]: {
|
|
280
|
-
header: "acceptedDocumentsForPublicCompanies",
|
|
281
|
-
documents: ["certificateOfIncorporation", "certificateOfFormation"]
|
|
282
|
-
},
|
|
283
|
-
[CompanyTypesValues.UNLISTED_PUBLIC_COMPANY]: {
|
|
284
|
-
header: "acceptedDocumentsForPublicCompanies",
|
|
285
|
-
documents: ["certificateOfIncorporation", "certificateOfFormation"]
|
|
286
|
-
},
|
|
287
|
-
[CompanyTypesValues.GOVERNMENTAL_ORGANIZATION]: {
|
|
288
|
-
header: "acceptedDocumentsForGovernment",
|
|
289
|
-
documents: ["charter"]
|
|
290
|
-
},
|
|
291
|
-
[CompanyTypesValues.NON_PROFIT_OR_CHARITABLE]: {
|
|
292
|
-
header: "acceptedDocumentsForNonProfit",
|
|
293
|
-
documents: [
|
|
294
|
-
"articlesOfIncorporation",
|
|
295
|
-
"meetingRecords",
|
|
296
|
-
"secretaryOfStateRegDoc",
|
|
297
|
-
"certificateOfIncumbency"
|
|
298
|
-
]
|
|
299
|
-
},
|
|
300
|
-
[CompanyTypesValues.INCORPORATED_PARTNERSHIP]: {
|
|
301
|
-
header: "acceptedDocumentsForPartnerships",
|
|
302
|
-
documents: ["partnerShipAgreement", "secretaryOfStateFiling"]
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
const GuidanceContent$1 = ({
|
|
307
|
-
country,
|
|
308
|
-
companyType,
|
|
309
|
-
t
|
|
310
|
-
}) => {
|
|
311
|
-
const acceptedDocGuidance = ACCEPTED_DOCUMENTS_MAP$1[country]?.[companyType];
|
|
312
|
-
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-upload-field__guidance", children: country === "US" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
313
|
-
acceptedDocGuidance && /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-u-margin-bottom-24", children: [
|
|
314
|
-
/* @__PURE__ */ jsx("strong", { children: t(($) => $[acceptedDocGuidance.header], { ns: "business" }) }),
|
|
315
|
-
/* @__PURE__ */ jsx("ul", { children: acceptedDocGuidance.documents.map((document, i) => /* @__PURE__ */ jsx("li", { children: t(($) => $[document], { ns: "business" }) }, i)) })
|
|
316
|
-
] }),
|
|
317
|
-
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-u-margin-bottom-24", children: [
|
|
318
|
-
/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }),
|
|
319
|
-
/* @__PURE__ */ jsx("ul", { children: /* @__PURE__ */ jsx("li", { children: t(($) => $["includesLegalCompanyName"], { ns: "business" }) }) })
|
|
320
|
-
] })
|
|
321
|
-
] }) : /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-u-margin-bottom-24", children: [
|
|
322
|
-
/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }),
|
|
323
|
-
/* @__PURE__ */ jsx("ul", { children: /* @__PURE__ */ jsx("li", { children: t(($) => $["documentIssuedByGovernmentAuthority"], { ns: "business" }) }) })
|
|
324
|
-
] }) });
|
|
325
|
-
};
|
|
326
|
-
function RegistrationDocument({
|
|
327
|
-
id,
|
|
328
|
-
country,
|
|
329
|
-
companyType = CompanyTypesValues.PRIVATE_COMPANY,
|
|
330
|
-
...props
|
|
331
|
-
}) {
|
|
332
|
-
const { t } = useTranslation(["common", "business"]);
|
|
333
|
-
return /* @__PURE__ */ jsx(
|
|
334
|
-
MemoizedDocumentUpload,
|
|
335
|
-
{
|
|
336
|
-
...props,
|
|
337
|
-
id,
|
|
338
|
-
heading: t(($) => $["companyRegistrationDocumentFormHeading"], { ns: "business" }),
|
|
339
|
-
description: t(($) => $["companyRegistrationDocumentFormDescription"], { ns: "business" }),
|
|
340
|
-
documentField: "registrationDocument",
|
|
341
|
-
documentType: "registrationDocument",
|
|
342
|
-
guidanceContent: /* @__PURE__ */ jsx(GuidanceContent$1, { country, companyType, t }),
|
|
343
|
-
companyType,
|
|
344
|
-
country,
|
|
345
|
-
hidePageCount: true
|
|
346
|
-
}
|
|
347
|
-
);
|
|
348
|
-
}
|
|
349
|
-
const ACCEPTED_DOCUMENTS_MAP = {
|
|
350
|
-
[CountryCodes.PuertoRico]: {
|
|
351
|
-
// should exactly match CountryCodes.UnitedStates
|
|
352
|
-
[CompanyTypesValues.PRIVATE_COMPANY]: {
|
|
353
|
-
header: "acceptedDocumentsForPrivateCompanies",
|
|
354
|
-
documents: ["irsCP575"]
|
|
355
|
-
},
|
|
356
|
-
[CompanyTypesValues.PUBLIC_COMPANY]: {
|
|
357
|
-
header: "acceptedDocumentsForPublicCompanies",
|
|
358
|
-
documents: ["annualReport", "secForm10k"]
|
|
359
|
-
},
|
|
360
|
-
[CompanyTypesValues.UNLISTED_PUBLIC_COMPANY]: {
|
|
361
|
-
header: "acceptedDocumentsForPublicCompanies",
|
|
362
|
-
documents: ["annualReport", "secForm10k"]
|
|
363
|
-
},
|
|
364
|
-
[CompanyTypesValues.NON_PROFIT_OR_CHARITABLE]: {
|
|
365
|
-
header: "acceptedDocumentsForNonProfit",
|
|
366
|
-
documents: ["annualReport"]
|
|
367
|
-
},
|
|
368
|
-
[CompanyTypesValues.INCORPORATED_PARTNERSHIP]: {
|
|
369
|
-
header: "acceptedDocumentsForPartnerships",
|
|
370
|
-
documents: ["irsScheduleK1"]
|
|
371
|
-
}
|
|
372
|
-
},
|
|
373
|
-
[CountryCodes.UnitedStates]: {
|
|
374
|
-
[CompanyTypesValues.PRIVATE_COMPANY]: {
|
|
375
|
-
header: "acceptedDocumentsForPrivateCompanies",
|
|
376
|
-
documents: ["irsCP575"]
|
|
377
|
-
},
|
|
378
|
-
[CompanyTypesValues.PUBLIC_COMPANY]: {
|
|
379
|
-
header: "acceptedDocumentsForPublicCompanies",
|
|
380
|
-
documents: ["annualReport", "secForm10k"]
|
|
381
|
-
},
|
|
382
|
-
[CompanyTypesValues.UNLISTED_PUBLIC_COMPANY]: {
|
|
383
|
-
header: "acceptedDocumentsForPublicCompanies",
|
|
384
|
-
documents: ["annualReport", "secForm10k"]
|
|
385
|
-
},
|
|
386
|
-
[CompanyTypesValues.NON_PROFIT_OR_CHARITABLE]: {
|
|
387
|
-
header: "acceptedDocumentsForNonProfit",
|
|
388
|
-
documents: ["annualReport"]
|
|
389
|
-
},
|
|
390
|
-
[CompanyTypesValues.INCORPORATED_PARTNERSHIP]: {
|
|
391
|
-
header: "acceptedDocumentsForPartnerships",
|
|
392
|
-
documents: ["irsScheduleK1"]
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
};
|
|
396
|
-
const GuidanceContent = ({
|
|
397
|
-
country,
|
|
398
|
-
companyType
|
|
399
|
-
}) => {
|
|
400
|
-
const { t } = useTranslation(["common", "business"]);
|
|
401
|
-
const acceptedDocGuidance = ACCEPTED_DOCUMENTS_MAP[country]?.[companyType];
|
|
402
|
-
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-upload-field__guidance", children: country === "US" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
403
|
-
acceptedDocGuidance && /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-u-margin-bottom-24", children: [
|
|
404
|
-
/* @__PURE__ */ jsx("strong", { children: t(($) => $[acceptedDocGuidance.header], { ns: "business" }) }),
|
|
405
|
-
/* @__PURE__ */ jsx("ul", { children: acceptedDocGuidance.documents.map((document, i) => /* @__PURE__ */ jsx("li", { children: t(($) => $[document], { ns: "business" }) }, i)) })
|
|
406
|
-
] }),
|
|
407
|
-
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-u-margin-bottom-24", children: [
|
|
408
|
-
/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }),
|
|
409
|
-
/* @__PURE__ */ jsxs("ul", { children: [
|
|
410
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["includesLegalCompanyName"], { ns: "business" }) }),
|
|
411
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["includesEIN"], { ns: "business" }) })
|
|
412
|
-
] })
|
|
413
|
-
] })
|
|
414
|
-
] }) : /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-u-margin-bottom-24", children: [
|
|
415
|
-
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-upload-field__subtitle", children: t(($) => $["documentRequirements"], { ns: "common" }) }),
|
|
416
|
-
/* @__PURE__ */ jsxs("ul", { children: [
|
|
417
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["containsNameOfCompany"], { ns: "business" }) }),
|
|
418
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["documentShowsTaxIdOfCompany"], { ns: "business" }) }),
|
|
419
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["issuedByTheTaxAuthority"], { ns: "business" }) })
|
|
420
|
-
] })
|
|
421
|
-
] }) });
|
|
422
|
-
};
|
|
423
|
-
function TaxDocument({
|
|
424
|
-
id,
|
|
425
|
-
country,
|
|
426
|
-
companyType = CompanyTypesValues.PRIVATE_COMPANY,
|
|
427
|
-
...props
|
|
428
|
-
}) {
|
|
429
|
-
const { t } = useTranslation("business");
|
|
430
|
-
return /* @__PURE__ */ jsx(
|
|
431
|
-
MemoizedDocumentUpload,
|
|
432
|
-
{
|
|
433
|
-
...props,
|
|
434
|
-
id,
|
|
435
|
-
heading: t(($) => $["companyTaxDocumentFormHeading"]),
|
|
436
|
-
description: t(($) => $["companyTaxDocumentFormDescription"]),
|
|
437
|
-
documentField: "taxDocument",
|
|
438
|
-
documentType: "proofOfOrganizationTaxInfo",
|
|
439
|
-
guidanceContent: /* @__PURE__ */ jsx(GuidanceContent, { country, companyType }),
|
|
440
|
-
companyType,
|
|
441
|
-
country,
|
|
442
|
-
hidePageCount: true
|
|
443
|
-
}
|
|
444
|
-
);
|
|
445
|
-
}
|
|
446
|
-
function BusinessDetailsMultiform({
|
|
447
|
-
taskType,
|
|
448
|
-
country,
|
|
449
|
-
activeForm,
|
|
450
|
-
shouldValidate,
|
|
451
|
-
problems = {},
|
|
452
|
-
handleNextClick,
|
|
453
|
-
handleBackClick,
|
|
454
|
-
setLoadingStatus,
|
|
455
|
-
isTopLevelEntity
|
|
456
|
-
}) {
|
|
457
|
-
const { t } = useTranslation(["common", "business"]);
|
|
458
|
-
const { form } = useFormContext();
|
|
459
|
-
const companyType = taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY ? CompanyTypesValues.SOLE_PROPRIETORSHIP : form.data.companyStructure?.entityType;
|
|
460
|
-
function handleChange(formName, fieldName, mode) {
|
|
461
|
-
return form.handleChangeFor(fieldName, formName, mode);
|
|
462
|
-
}
|
|
463
|
-
const renderActiveForm = (activeForm2) => {
|
|
464
|
-
switch (activeForm2.formId) {
|
|
465
|
-
case "basicInformation":
|
|
466
|
-
return /* @__PURE__ */ jsx(
|
|
467
|
-
BasicInformation,
|
|
468
|
-
{
|
|
469
|
-
id: activeForm2.formId,
|
|
470
|
-
country,
|
|
471
|
-
shouldValidate,
|
|
472
|
-
validationErrors: problems.validationErrors?.[activeForm2.formId],
|
|
473
|
-
verificationErrors: problems.verificationErrors?.[activeForm2.formId],
|
|
474
|
-
companyType,
|
|
475
|
-
isTopLevelEntity,
|
|
476
|
-
disableCountry: taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY
|
|
477
|
-
}
|
|
478
|
-
);
|
|
479
|
-
case "businessSelection":
|
|
480
|
-
return /* @__PURE__ */ jsx(
|
|
481
|
-
BusinessSelection,
|
|
482
|
-
{
|
|
483
|
-
id: activeForm2.formId,
|
|
484
|
-
country,
|
|
485
|
-
shouldValidate,
|
|
486
|
-
validationErrors: problems.validationErrors?.[activeForm2.formId],
|
|
487
|
-
verificationErrors: problems.verificationErrors?.[activeForm2.formId],
|
|
488
|
-
handleNextClick,
|
|
489
|
-
handleBackClick,
|
|
490
|
-
setLoadingStatus
|
|
491
|
-
}
|
|
492
|
-
);
|
|
493
|
-
case "companyStructure":
|
|
494
|
-
return /* @__PURE__ */ jsx(
|
|
495
|
-
CompanyStructure,
|
|
496
|
-
{
|
|
497
|
-
id: activeForm2.formId,
|
|
498
|
-
country,
|
|
499
|
-
shouldValidate,
|
|
500
|
-
validationErrors: problems.validationErrors?.[activeForm2.formId],
|
|
501
|
-
verificationErrors: problems.verificationErrors?.[activeForm2.formId]
|
|
502
|
-
}
|
|
503
|
-
);
|
|
504
|
-
case "additionalInformation":
|
|
505
|
-
return /* @__PURE__ */ jsx(
|
|
506
|
-
AdditionalInformation,
|
|
507
|
-
{
|
|
508
|
-
id: activeForm2.formId,
|
|
509
|
-
country,
|
|
510
|
-
companyType,
|
|
511
|
-
shouldValidate,
|
|
512
|
-
validationErrors: problems.validationErrors?.[activeForm2.formId],
|
|
513
|
-
verificationErrors: problems.verificationErrors?.[activeForm2.formId]
|
|
514
|
-
}
|
|
515
|
-
);
|
|
516
|
-
case "companyTaxDocument":
|
|
517
|
-
return country === "US" ? /* @__PURE__ */ jsx(
|
|
518
|
-
TaxDocument,
|
|
519
|
-
{
|
|
520
|
-
id: activeForm2.formId,
|
|
521
|
-
country,
|
|
522
|
-
companyType,
|
|
523
|
-
shouldValidate,
|
|
524
|
-
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
525
|
-
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {},
|
|
526
|
-
data: form.data.companyTaxDocument,
|
|
527
|
-
errors: form.errors.companyTaxDocument,
|
|
528
|
-
valid: form.valid.companyTaxDocument,
|
|
529
|
-
allFields: form.allFields?.companyTaxDocument,
|
|
530
|
-
requiredFields: form.requiredFields?.companyTaxDocument,
|
|
531
|
-
optionalFields: form.optionalFields?.companyTaxDocument,
|
|
532
|
-
trustedFields: form.trustedFields?.companyTaxDocument,
|
|
533
|
-
handleFieldChange: () => handleChange("companyTaxDocument", "taxDocument")
|
|
534
|
-
}
|
|
535
|
-
) : /* @__PURE__ */ jsx(
|
|
536
|
-
MemoizedDocumentUpload,
|
|
537
|
-
{
|
|
538
|
-
id: activeForm2.formId,
|
|
539
|
-
country,
|
|
540
|
-
companyType,
|
|
541
|
-
shouldValidate,
|
|
542
|
-
heading: t(($) => $["companyTaxDocumentFormHeading"], { ns: "business" }),
|
|
543
|
-
description: t(($) => $["companyTaxDocumentFormDescription"], { ns: "business" }),
|
|
544
|
-
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
545
|
-
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {},
|
|
546
|
-
data: form.data.companyTaxDocument,
|
|
547
|
-
errors: form.errors.companyTaxDocument,
|
|
548
|
-
valid: form.valid.companyTaxDocument,
|
|
549
|
-
allFields: form.allFields?.companyTaxDocument,
|
|
550
|
-
requiredFields: form.requiredFields?.companyTaxDocument,
|
|
551
|
-
optionalFields: form.optionalFields?.companyTaxDocument,
|
|
552
|
-
trustedFields: form.trustedFields?.companyTaxDocument,
|
|
553
|
-
handleFieldChange: (fieldName) => handleChange("companyTaxDocument", fieldName),
|
|
554
|
-
documentField: "taxDocument",
|
|
555
|
-
documentType: "vatDocument",
|
|
556
|
-
hidePageCount: true,
|
|
557
|
-
guidanceContent: /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-u-margin-bottom-24", children: [
|
|
558
|
-
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-upload-field__subtitle", children: [
|
|
559
|
-
" ",
|
|
560
|
-
t(($) => $["requirements"], { ns: "common" })
|
|
561
|
-
] }),
|
|
562
|
-
/* @__PURE__ */ jsxs("ul", { children: [
|
|
563
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["containsNameOfCompany"], { ns: "business" }) }),
|
|
564
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["documentShowsTaxIdOfCompany"], { ns: "business" }) }),
|
|
565
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["issuedByTheTaxAuthority"], { ns: "business" }) })
|
|
566
|
-
] })
|
|
567
|
-
] })
|
|
568
|
-
}
|
|
569
|
-
);
|
|
570
|
-
case "companyRegistrationDocument":
|
|
571
|
-
return /* @__PURE__ */ jsx(
|
|
572
|
-
RegistrationDocument,
|
|
573
|
-
{
|
|
574
|
-
id: activeForm2.formId,
|
|
575
|
-
country,
|
|
576
|
-
companyType,
|
|
577
|
-
data: form.data.companyRegistrationDocument,
|
|
578
|
-
errors: form.errors.companyRegistrationDocument,
|
|
579
|
-
valid: form.valid.companyRegistrationDocument,
|
|
580
|
-
allFields: form.allFields?.companyRegistrationDocument,
|
|
581
|
-
requiredFields: form.requiredFields?.companyRegistrationDocument,
|
|
582
|
-
optionalFields: form.optionalFields?.companyRegistrationDocument,
|
|
583
|
-
trustedFields: form.trustedFields?.companyRegistrationDocument,
|
|
584
|
-
handleFieldChange: (fieldName) => handleChange("companyRegistrationDocument", fieldName),
|
|
585
|
-
shouldValidate,
|
|
586
|
-
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
587
|
-
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {}
|
|
588
|
-
}
|
|
589
|
-
);
|
|
590
|
-
case "companyProofOfDirectorDocument":
|
|
591
|
-
return /* @__PURE__ */ jsx(
|
|
592
|
-
ProofOfDirectorDocument,
|
|
593
|
-
{
|
|
594
|
-
id: activeForm2.formId,
|
|
595
|
-
country,
|
|
596
|
-
data: form.data?.companyProofOfDirectorDocument,
|
|
597
|
-
errors: form.errors.companyProofOfDirectorDocument,
|
|
598
|
-
valid: form.valid.companyProofOfDirectorDocument,
|
|
599
|
-
allFields: form.allFields?.companyProofOfDirectorDocument,
|
|
600
|
-
requiredFields: form.requiredFields?.companyProofOfDirectorDocument,
|
|
601
|
-
optionalFields: form.optionalFields?.companyProofOfDirectorDocument,
|
|
602
|
-
trustedFields: form.trustedFields?.companyProofOfDirectorDocument,
|
|
603
|
-
handleFieldChange: (fieldName) => handleChange("companyProofOfDirectorDocument", fieldName),
|
|
604
|
-
shouldValidate,
|
|
605
|
-
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
606
|
-
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {}
|
|
607
|
-
}
|
|
608
|
-
);
|
|
609
|
-
case "companyProofOfSignatoryDocument":
|
|
610
|
-
return /* @__PURE__ */ jsx(
|
|
611
|
-
ProofOfSignatoryDocument,
|
|
612
|
-
{
|
|
613
|
-
id: activeForm2.formId,
|
|
614
|
-
country,
|
|
615
|
-
data: form.data?.companyProofOfSignatoryDocument,
|
|
616
|
-
errors: form.errors.companyProofOfSignatoryDocument,
|
|
617
|
-
valid: form.valid.companyProofOfSignatoryDocument,
|
|
618
|
-
allFields: form.allFields?.companyProofOfSignatoryDocument,
|
|
619
|
-
requiredFields: form.requiredFields?.companyProofOfSignatoryDocument,
|
|
620
|
-
optionalFields: form.optionalFields?.companyProofOfSignatoryDocument,
|
|
621
|
-
trustedFields: form.trustedFields?.companyProofOfSignatoryDocument,
|
|
622
|
-
handleFieldChange: (fieldName) => handleChange("companyProofOfSignatoryDocument", fieldName),
|
|
623
|
-
shouldValidate,
|
|
624
|
-
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
625
|
-
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {}
|
|
626
|
-
}
|
|
627
|
-
);
|
|
628
|
-
case "companyProofOfOwnershipDocument":
|
|
629
|
-
return /* @__PURE__ */ jsx(
|
|
630
|
-
ProofOfOwnershipDocument,
|
|
631
|
-
{
|
|
632
|
-
id: activeForm2.formId,
|
|
633
|
-
country,
|
|
634
|
-
data: form.data?.companyProofOfOwnershipDocument,
|
|
635
|
-
errors: form.errors.companyProofOfOwnershipDocument,
|
|
636
|
-
valid: form.valid.companyProofOfOwnershipDocument,
|
|
637
|
-
allFields: form.allFields?.companyProofOfOwnershipDocument,
|
|
638
|
-
requiredFields: form.requiredFields?.companyProofOfOwnershipDocument,
|
|
639
|
-
optionalFields: form.optionalFields?.companyProofOfOwnershipDocument,
|
|
640
|
-
trustedFields: form.trustedFields?.companyProofOfOwnershipDocument,
|
|
641
|
-
handleFieldChange: (fieldName) => handleChange("companyProofOfOwnershipDocument", fieldName),
|
|
642
|
-
shouldValidate,
|
|
643
|
-
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
644
|
-
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {}
|
|
645
|
-
}
|
|
646
|
-
);
|
|
647
|
-
case "companyConstitutionalDocument":
|
|
648
|
-
return /* @__PURE__ */ jsx(
|
|
649
|
-
MemoizedConstitutionalDocument,
|
|
650
|
-
{
|
|
651
|
-
id: activeForm2.formId,
|
|
652
|
-
legalEntityType: LegalEntityTypes.SOLE_PROPRIETORSHIP,
|
|
653
|
-
country,
|
|
654
|
-
data: form.data?.companyConstitutionalDocument,
|
|
655
|
-
errors: form.errors.companyConstitutionalDocument,
|
|
656
|
-
valid: form.valid.companyConstitutionalDocument,
|
|
657
|
-
allFields: form.allFields?.companyConstitutionalDocument,
|
|
658
|
-
requiredFields: form.requiredFields?.companyConstitutionalDocument,
|
|
659
|
-
optionalFields: form.optionalFields?.companyConstitutionalDocument,
|
|
660
|
-
trustedFields: form.trustedFields?.companyConstitutionalDocument,
|
|
661
|
-
handleFieldChange: (fieldName) => handleChange("companyConstitutionalDocument", fieldName),
|
|
662
|
-
shouldValidate,
|
|
663
|
-
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
664
|
-
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {}
|
|
665
|
-
}
|
|
666
|
-
);
|
|
667
|
-
case "companyFinancialInformation":
|
|
668
|
-
return /* @__PURE__ */ jsx(
|
|
669
|
-
FinancialInformation,
|
|
670
|
-
{
|
|
671
|
-
multiForm: form,
|
|
672
|
-
id: activeForm2.formId,
|
|
673
|
-
country,
|
|
674
|
-
data: form.data?.companyFinancialInformation,
|
|
675
|
-
allFields: form.allFields?.companyFinancialInformation,
|
|
676
|
-
requiredFields: form.requiredFields?.companyFinancialInformation,
|
|
677
|
-
optionalFields: form.optionalFields?.companyFinancialInformation,
|
|
678
|
-
trustedFields: form.trustedFields?.companyFinancialInformation,
|
|
679
|
-
shouldValidate
|
|
680
|
-
}
|
|
681
|
-
);
|
|
682
|
-
default:
|
|
683
|
-
return null;
|
|
684
|
-
}
|
|
685
|
-
};
|
|
686
|
-
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-business-details", children: /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: renderActiveForm(activeForm) }) });
|
|
687
|
-
}
|
|
688
|
-
const CompanyStructureValidation = {
|
|
689
|
-
entityType: {
|
|
690
|
-
modes: ["blur"],
|
|
691
|
-
validate: (entityType) => !isEmpty(entityType),
|
|
692
|
-
errorMessage: "fieldIsRequired"
|
|
693
|
-
}
|
|
694
|
-
};
|
|
695
|
-
const mapApiDocumentToBusinessDetailsDocuments = (entityId) => {
|
|
696
|
-
const registrationDocument = getDocument(entityId, "registrationDocument") ?? null;
|
|
697
|
-
const taxDocument = getDocument(entityId, "vatDocument") ?? getDocument(entityId, "proofOfOrganizationTaxInfo") ?? null;
|
|
698
|
-
const proofOfDirector = getDocument(entityId, "proofOfDirector") ?? null;
|
|
699
|
-
const proofOfSignatory = getDocument(entityId, "proofOfSignatory") ?? null;
|
|
700
|
-
const proofOfOwnership = getDocuments(entityId, "proofOfOwnership") ?? null;
|
|
701
|
-
const constitutionalDocument = getDocument(entityId, "constitutionalDocument") ?? null;
|
|
702
|
-
const mergedProofOfOwnershipAttachments = proofOfOwnership?.flatMap((doc) => doc.attachments ?? []) ?? [];
|
|
703
|
-
return {
|
|
704
|
-
companyRegistrationDocument: registrationDocument ? { registrationDocument: [mapExistingFile(getPageName(registrationDocument))] } : void 0,
|
|
705
|
-
companyTaxDocument: taxDocument ? { taxDocument: [mapExistingFile(getPageName(taxDocument))] } : void 0,
|
|
706
|
-
companyProofOfDirectorDocument: proofOfDirector ? { proofOfDirector: [mapExistingFile(getPageName(proofOfDirector))] } : void 0,
|
|
707
|
-
companyProofOfSignatoryDocument: proofOfSignatory ? { proofOfSignatory: [mapExistingFile(getPageName(proofOfSignatory))] } : void 0,
|
|
708
|
-
companyProofOfOwnershipDocument: mergedProofOfOwnershipAttachments.length > 0 ? {
|
|
709
|
-
proofOfOwnership: mergedProofOfOwnershipAttachments.map(
|
|
710
|
-
(attachment) => mapExistingFile(attachment.pageName ?? "")
|
|
711
|
-
)
|
|
712
|
-
} : void 0,
|
|
713
|
-
companyConstitutionalDocument: constitutionalDocument ? {
|
|
714
|
-
constitutionalDocument: [mapExistingFile(getPageName(constitutionalDocument))]
|
|
715
|
-
} : void 0
|
|
716
|
-
};
|
|
717
|
-
};
|
|
718
|
-
const mapBasicInformation = (data) => {
|
|
719
|
-
if (!data) return;
|
|
720
|
-
return !!data.country && COUNTRIES_USING_COMPANY_SEARCH.includes(data.country) ? data : entriesOf(data).reduce((acc, [field]) => {
|
|
721
|
-
if (!FIELDS_NEEDED_FOR_COMPANY_SEARCH.includes(field)) {
|
|
722
|
-
return {
|
|
723
|
-
...acc,
|
|
724
|
-
[field]: data[field]
|
|
725
|
-
};
|
|
726
|
-
}
|
|
727
|
-
return acc;
|
|
728
|
-
}, {});
|
|
729
|
-
};
|
|
730
|
-
const mapDbaName = (legalEntity) => {
|
|
731
|
-
const entity = legalEntity.type === "organization" ? legalEntity.organization : legalEntity.soleProprietorship;
|
|
732
|
-
const dbaName = {};
|
|
733
|
-
if (typeof entity?.doingBusinessAsAbsent !== "undefined") {
|
|
734
|
-
dbaName.hasDoingBusinessAs = !entity.doingBusinessAsAbsent;
|
|
735
|
-
} else {
|
|
736
|
-
if (entity?.doingBusinessAs) {
|
|
737
|
-
dbaName.hasDoingBusinessAs = entity?.doingBusinessAs !== (legalEntity.type === "organization" ? legalEntity.organization?.legalName : legalEntity.soleProprietorship?.name);
|
|
738
|
-
} else {
|
|
739
|
-
dbaName.hasDoingBusinessAs = void 0;
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
if (legalEntity.organization?.doingBusinessAs) {
|
|
743
|
-
dbaName.doingBusinessAs = legalEntity.organization?.doingBusinessAs;
|
|
744
|
-
}
|
|
745
|
-
return dbaName;
|
|
746
|
-
};
|
|
747
|
-
const mapIsUen = (taxInformation, registrationNumber, country) => {
|
|
748
|
-
const currentCountryTaxInfo = taxInformation?.find((taxInfo) => taxInfo.country === country);
|
|
749
|
-
if (!currentCountryTaxInfo || country !== "SG") return {};
|
|
750
|
-
return {
|
|
751
|
-
registrationNumber: currentCountryTaxInfo.type === "UEN" ? currentCountryTaxInfo.number : registrationNumber,
|
|
752
|
-
isUen: currentCountryTaxInfo.type === "UEN"
|
|
753
|
-
};
|
|
754
|
-
};
|
|
755
|
-
const mapAdditionalInformation = (data, legalEntity) => {
|
|
756
|
-
if (!data) return;
|
|
757
|
-
const entity = legalEntity.type === "organization" ? legalEntity.organization : legalEntity.soleProprietorship;
|
|
758
|
-
const currentCountry = entity?.registeredAddress.country;
|
|
759
|
-
const dbaNameFields = mapDbaName(legalEntity);
|
|
760
|
-
const isUen = mapIsUen(
|
|
761
|
-
data.taxInformation,
|
|
762
|
-
data.registrationNumber,
|
|
763
|
-
currentCountry
|
|
764
|
-
);
|
|
765
|
-
const companyType = legalEntity.type === "organization" ? legalEntity.organization?.type : CompanyTypesValues.SOLE_PROPRIETORSHIP;
|
|
766
|
-
const registrationNumberType = getDefaultRegistrationNumberType(
|
|
767
|
-
entity?.registrationNumber,
|
|
768
|
-
currentCountry,
|
|
769
|
-
companyType
|
|
770
|
-
);
|
|
771
|
-
const vatNumberType = getDefaultVatNumberType(entity?.vatNumber, currentCountry);
|
|
772
|
-
const operationalAddressIsSame = entity?.principalPlaceOfBusiness && !objectsDeepEqual(entity?.principalPlaceOfBusiness, entity?.registeredAddress) ? operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME : operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME;
|
|
773
|
-
if (entity?.registeredAddress?.localization) {
|
|
774
|
-
data.registrationAddress = {
|
|
775
|
-
...data.registrationAddress,
|
|
776
|
-
...mapAddressLocalizationToJpAddressSchema(entity.registeredAddress.localization)
|
|
777
|
-
};
|
|
778
|
-
}
|
|
779
|
-
if (entity?.principalPlaceOfBusiness?.localization) {
|
|
780
|
-
data.operationalAddress = {
|
|
781
|
-
...data.operationalAddress,
|
|
782
|
-
...mapAddressLocalizationToJpAddressSchema(entity.principalPlaceOfBusiness.localization)
|
|
783
|
-
};
|
|
784
|
-
}
|
|
785
|
-
const result = entriesOf(data).reduce(
|
|
786
|
-
(acc, [field]) => {
|
|
787
|
-
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) {
|
|
788
|
-
return {
|
|
789
|
-
...acc,
|
|
790
|
-
[field]: data[field]
|
|
791
|
-
};
|
|
792
|
-
}
|
|
793
|
-
if (!FIELDS_NEEDED_FOR_COMPANY_SEARCH.includes(field)) {
|
|
794
|
-
return {
|
|
795
|
-
...acc,
|
|
796
|
-
[field]: data[field]
|
|
797
|
-
};
|
|
798
|
-
}
|
|
799
|
-
return acc;
|
|
800
|
-
},
|
|
801
|
-
{ operationalAddressIsSame, registrationNumberType, vatNumberType }
|
|
802
|
-
);
|
|
803
|
-
return { ...result, ...dbaNameFields, ...isUen };
|
|
804
|
-
};
|
|
805
|
-
const mapLegalNameLocalization = (data) => {
|
|
806
|
-
const localization = data.organization?.localization;
|
|
807
|
-
if (!localization) return {};
|
|
808
|
-
let result = {};
|
|
809
|
-
for (const { script, fields } of localization) {
|
|
810
|
-
const schemaFieldsFromLocalization = mapApiScriptLocalizationToSchemaFields({
|
|
811
|
-
script,
|
|
812
|
-
fields: {
|
|
813
|
-
// mismatch between API `legalName` and schema `legalCompanyName`
|
|
814
|
-
legalCompanyName: fields.legalName
|
|
815
|
-
}
|
|
816
|
-
});
|
|
817
|
-
result = {
|
|
818
|
-
...result,
|
|
819
|
-
...schemaFieldsFromLocalization
|
|
820
|
-
};
|
|
821
|
-
}
|
|
822
|
-
return result;
|
|
823
|
-
};
|
|
824
|
-
const mapLegalEntityToBusinessDetailsSchema = (legalEntity, parentEntity) => {
|
|
825
|
-
if (!legalEntity) return {};
|
|
826
|
-
const {
|
|
827
|
-
companyRegistrationDocument,
|
|
828
|
-
companyTaxDocument,
|
|
829
|
-
companyProofOfDirectorDocument,
|
|
830
|
-
companyProofOfSignatoryDocument,
|
|
831
|
-
companyProofOfOwnershipDocument,
|
|
832
|
-
companyConstitutionalDocument
|
|
833
|
-
} = mapApiDocumentToBusinessDetailsDocuments(legalEntity.id);
|
|
834
|
-
const buildSolePropSchema = () => {
|
|
835
|
-
const solePropData = formatObject(
|
|
836
|
-
legalEntity,
|
|
837
|
-
solePropBusinessDetailsKeyMapping
|
|
838
|
-
);
|
|
839
|
-
const country = solePropData?.additionalInformation?.registrationAddress?.country ?? parentEntity?.individual?.residentialAddress.country;
|
|
840
|
-
if (legalEntity?.soleProprietorship?.financialReports && solePropData) {
|
|
841
|
-
solePropData.companyFinancialInformation = mapFinancialReportsToFinancialInformation(
|
|
842
|
-
legalEntity.soleProprietorship.financialReports
|
|
843
|
-
);
|
|
844
|
-
}
|
|
845
|
-
return {
|
|
846
|
-
...solePropData,
|
|
847
|
-
basicInformation: {
|
|
848
|
-
...solePropData?.basicInformation,
|
|
849
|
-
country
|
|
850
|
-
},
|
|
851
|
-
companyConstitutionalDocument
|
|
852
|
-
};
|
|
853
|
-
};
|
|
854
|
-
const orgSchema = {
|
|
855
|
-
...formatObject(legalEntity, businessDetailsComponentsKeyMapping),
|
|
856
|
-
businessSelection: {},
|
|
857
|
-
companyRegistrationDocument,
|
|
858
|
-
companyTaxDocument,
|
|
859
|
-
companyProofOfDirectorDocument,
|
|
860
|
-
companyProofOfSignatoryDocument,
|
|
861
|
-
companyProofOfOwnershipDocument,
|
|
862
|
-
companyFinancialInformation: {}
|
|
863
|
-
};
|
|
864
|
-
const businessDetailsSchema = legalEntity.type === "organization" ? orgSchema : buildSolePropSchema();
|
|
865
|
-
return entriesOf(businessDetailsSchema).reduce((componentData, [key]) => {
|
|
866
|
-
switch (key) {
|
|
867
|
-
case "basicInformation": {
|
|
868
|
-
return {
|
|
869
|
-
...componentData,
|
|
870
|
-
[key]: {
|
|
871
|
-
...mapBasicInformation(businessDetailsSchema[key]),
|
|
872
|
-
...mapLegalNameLocalization(legalEntity)
|
|
873
|
-
}
|
|
874
|
-
};
|
|
875
|
-
}
|
|
876
|
-
case "businessSelection": {
|
|
877
|
-
return {
|
|
878
|
-
...componentData,
|
|
879
|
-
[key]: {
|
|
880
|
-
hasSelectedBusiness: false
|
|
881
|
-
}
|
|
882
|
-
};
|
|
883
|
-
}
|
|
884
|
-
case "companyStructure": {
|
|
885
|
-
return {
|
|
886
|
-
...componentData,
|
|
887
|
-
[key]: {
|
|
888
|
-
...businessDetailsSchema[key]
|
|
889
|
-
}
|
|
890
|
-
};
|
|
891
|
-
}
|
|
892
|
-
case "additionalInformation": {
|
|
893
|
-
return {
|
|
894
|
-
...componentData,
|
|
895
|
-
[key]: mapAdditionalInformation(businessDetailsSchema[key], legalEntity)
|
|
896
|
-
};
|
|
897
|
-
}
|
|
898
|
-
case "companyRegistrationDocument": {
|
|
899
|
-
return {
|
|
900
|
-
...componentData,
|
|
901
|
-
[key]: businessDetailsSchema[key]
|
|
902
|
-
};
|
|
903
|
-
}
|
|
904
|
-
case "companyTaxDocument": {
|
|
905
|
-
return {
|
|
906
|
-
...componentData,
|
|
907
|
-
[key]: businessDetailsSchema[key]
|
|
908
|
-
};
|
|
909
|
-
}
|
|
910
|
-
case "companyProofOfDirectorDocument": {
|
|
911
|
-
return {
|
|
912
|
-
...componentData,
|
|
913
|
-
[key]: businessDetailsSchema[key]
|
|
914
|
-
};
|
|
915
|
-
}
|
|
916
|
-
case "companyProofOfSignatoryDocument": {
|
|
917
|
-
return {
|
|
918
|
-
...componentData,
|
|
919
|
-
[key]: businessDetailsSchema[key]
|
|
920
|
-
};
|
|
921
|
-
}
|
|
922
|
-
case "companyProofOfOwnershipDocument": {
|
|
923
|
-
return {
|
|
924
|
-
...componentData,
|
|
925
|
-
[key]: businessDetailsSchema[key]
|
|
926
|
-
};
|
|
927
|
-
}
|
|
928
|
-
case "companyConstitutionalDocument": {
|
|
929
|
-
return {
|
|
930
|
-
...componentData,
|
|
931
|
-
[key]: businessDetailsSchema[key]
|
|
932
|
-
};
|
|
933
|
-
}
|
|
934
|
-
case "companyFinancialInformation": {
|
|
935
|
-
const financialReports = legalEntity.type === "organization" ? legalEntity?.organization?.financialReports : legalEntity?.soleProprietorship?.financialReports;
|
|
936
|
-
return financialReports?.length ? {
|
|
937
|
-
...componentData,
|
|
938
|
-
[key]: mapFinancialReportsToFinancialInformation(financialReports)
|
|
939
|
-
} : componentData;
|
|
940
|
-
}
|
|
941
|
-
default:
|
|
942
|
-
return componentData;
|
|
943
|
-
}
|
|
944
|
-
}, {});
|
|
945
|
-
};
|
|
946
|
-
const businessDetailsBase = {
|
|
947
|
-
/* Base required fields */
|
|
948
|
-
country: { rule: "REQUIRED" },
|
|
949
|
-
entityType: { rule: "businessRequiresCompanyType" },
|
|
950
|
-
legalCompanyName: { rule: "REQUIRED" },
|
|
951
|
-
jaHaniLegalCompanyName: { rule: "japaneseLegalCompanyName" },
|
|
952
|
-
jaKanaLegalCompanyName: { rule: "japaneseLegalCompanyName" },
|
|
953
|
-
hasDoingBusinessAs: { rule: "REQUIRED" },
|
|
954
|
-
doingBusinessAs: { rule: "requireDoingBusinessAsName" },
|
|
955
|
-
registrationAddress: { rule: "REQUIRED" },
|
|
956
|
-
operationalAddressIsSame: { rule: "REQUIRED" },
|
|
957
|
-
/* Base optional fields */
|
|
958
|
-
operationalAddress: { rule: "OPTIONAL" },
|
|
959
|
-
/* Fields with custom country specific rules */
|
|
960
|
-
hasSelectedBusiness: { rule: "requireBusinessSelection" },
|
|
961
|
-
stockExchangeMIC: { rule: "ifPubliclyTradedCompany" },
|
|
962
|
-
stockISIN: { rule: "ifPubliclyTradedCompany" },
|
|
963
|
-
stockTickerSymbol: { rule: "ifPubliclyTradedCompany" },
|
|
964
|
-
dateOfIncorporation: { rule: "isDateOfIncorporationRequired" },
|
|
965
|
-
stateOrProvince: { rule: "countryUsingCompanySearch" },
|
|
966
|
-
registrationNumber: { rule: "countryRequiresRegistrationNumber" },
|
|
967
|
-
registrationNumberType: { rule: "registrationNumberType" },
|
|
968
|
-
exemptedFromRegistrationNumber: { rule: "companyRegistrationNumberExemptionAllowed" },
|
|
969
|
-
eInvoicingCode: { rule: "isEInvoicingCodeEnabled" },
|
|
970
|
-
countryOfGoverningLaw: { rule: "countryOfGoverningLawRequired" },
|
|
971
|
-
taxDocument: { rule: "ifCountryUsAndTinFailed" },
|
|
972
|
-
/* Fields derived from capabilities */
|
|
973
|
-
industryCodes: { rule: "isIndustryCodeRequired" }
|
|
974
|
-
};
|
|
975
|
-
const taxInformationBase = {
|
|
976
|
-
vatNumber: { rule: "countryUsesVat" },
|
|
977
|
-
vatNumberType: { rule: "vatNumberType" },
|
|
978
|
-
exemptedFromVat: { rule: "isVatExempt" },
|
|
979
|
-
vatAbsenceReason: { rule: "isVatExempt" },
|
|
980
|
-
taxInformation: { rule: "countryUsesTaxId" },
|
|
981
|
-
exemptedFromTax: { rule: "countryHasTaxExemptions" },
|
|
982
|
-
isUen: { rule: "countryUsesUenOrGst" }
|
|
983
|
-
};
|
|
984
|
-
const financialInformationBase = {
|
|
985
|
-
numberOfEmployees: { rule: "countryRequiresFinancialInformation" },
|
|
986
|
-
financialReportingDate: { rule: "isFinancialReportingFieldsRequired" },
|
|
987
|
-
currency: { rule: "isFinancialReportingFieldsRequired" },
|
|
988
|
-
reportedValueOption: { rule: "isFinancialReportingFieldsRequired" },
|
|
989
|
-
annualTurnover: { rule: "annualTurnoverRequired" },
|
|
990
|
-
netAssets: { rule: "netAssetsRequired" },
|
|
991
|
-
balanceSheetTotal: { rule: "balanceSheetTotalRequired" }
|
|
992
|
-
};
|
|
993
|
-
const businessDetailsFieldsPerScenario = {
|
|
994
|
-
L0: {
|
|
995
|
-
country: { rule: "REQUIRED" },
|
|
996
|
-
legalCompanyName: { rule: "REQUIRED" },
|
|
997
|
-
stateOrProvince: { rule: "countryUsingCompanySearch" },
|
|
998
|
-
...financialInformationBase
|
|
999
|
-
},
|
|
1000
|
-
L1: {
|
|
1001
|
-
...businessDetailsBase,
|
|
1002
|
-
...financialInformationBase
|
|
1003
|
-
},
|
|
1004
|
-
L: {
|
|
1005
|
-
...businessDetailsBase,
|
|
1006
|
-
...taxInformationBase,
|
|
1007
|
-
...financialInformationBase
|
|
1008
|
-
},
|
|
1009
|
-
L_PROOFOFADDRESS: {
|
|
1010
|
-
// TODO this field does not exist
|
|
1011
|
-
// proofOfAddressDocument: { rule: 'REQUIRED' },
|
|
1012
|
-
},
|
|
1013
|
-
L_REGDOC: {
|
|
1014
|
-
registrationDocument: { rule: "REQUIRED" }
|
|
1015
|
-
},
|
|
1016
|
-
L_TAXDOC: {
|
|
1017
|
-
taxDocument: { rule: "REQUIRED" }
|
|
1018
|
-
},
|
|
1019
|
-
L_BAFIN: {
|
|
1020
|
-
legalForm: { rule: "REQUIRED" }
|
|
1021
|
-
}
|
|
1022
|
-
};
|
|
1023
|
-
const adjustFormData = (oldFormData, newFormData) => {
|
|
1024
|
-
const schema = Array.from((/* @__PURE__ */ new Set([...keysOf(oldFormData), ...keysOf(newFormData)])).keys());
|
|
1025
|
-
return schema.reduce((acc, key) => {
|
|
1026
|
-
const oldValue = oldFormData[key];
|
|
1027
|
-
const newValue = newFormData[key];
|
|
1028
|
-
if (!isUndefinedOrNull(newValue)) return { ...acc, [key]: newValue };
|
|
1029
|
-
if (Array.isArray(oldValue)) return { ...acc, [key]: [] };
|
|
1030
|
-
if (typeof oldValue === "number") return { ...acc, [key]: null };
|
|
1031
|
-
if (typeof oldValue === "string") return { ...acc, [key]: "" };
|
|
1032
|
-
return { ...acc, [key]: "" };
|
|
1033
|
-
}, {});
|
|
1034
|
-
};
|
|
1035
|
-
const setRemovedFieldsOnSchemaToDeletedValue = (newData, existingData) => {
|
|
1036
|
-
const formIds = Array.from((/* @__PURE__ */ new Set([...keysOf(existingData), ...keysOf(newData)])).keys());
|
|
1037
|
-
return formIds.reduce((adjusted, formId) => {
|
|
1038
|
-
const oldFormData = existingData[formId];
|
|
1039
|
-
const newFormData = newData[formId];
|
|
1040
|
-
if (isUndefinedOrNull(oldFormData)) return { ...adjusted, [formId]: newFormData };
|
|
1041
|
-
if (isUndefinedOrNull(newFormData)) return adjusted;
|
|
1042
|
-
return { ...adjusted, [formId]: adjustFormData(oldFormData, newFormData) };
|
|
1043
|
-
}, {});
|
|
1044
|
-
};
|
|
1045
|
-
const formatFinancialInformationSummary = (data, language, country, dateOfIncorporation) => {
|
|
1046
|
-
let summary;
|
|
1047
|
-
if (!data) return void 0;
|
|
1048
|
-
if (dateOfIncorporation && !isDateOlderThanAYear(dateOfIncorporation)) {
|
|
1049
|
-
if (country === CountryCodes.UnitedKingdom) {
|
|
1050
|
-
summary = { numberOfEmployees: `${data.numberOfEmployees}` };
|
|
1051
|
-
return summary;
|
|
1052
|
-
}
|
|
1053
|
-
return void 0;
|
|
1054
|
-
}
|
|
1055
|
-
summary = {
|
|
1056
|
-
currency: data.currency,
|
|
1057
|
-
financialReportingDate: data.financialReportingDate
|
|
1058
|
-
};
|
|
1059
|
-
if (country === CountryCodes.UnitedKingdom) {
|
|
1060
|
-
summary.numberOfEmployees = `${data.numberOfEmployees}`;
|
|
1061
|
-
}
|
|
1062
|
-
if (data.balanceSheetTotal) {
|
|
1063
|
-
summary.balanceSheetTotal = summaryItem(
|
|
1064
|
-
"balanceSheetTotal",
|
|
1065
|
-
formatCurrency(data.balanceSheetTotal, data.currency, language)
|
|
1066
|
-
);
|
|
1067
|
-
}
|
|
1068
|
-
if (data.annualTurnover) {
|
|
1069
|
-
summary.annualTurnover = formatCurrency(data.annualTurnover, data.currency, language);
|
|
1070
|
-
}
|
|
1071
|
-
return summary;
|
|
1072
|
-
};
|
|
1073
|
-
const mapBusinessDetailsDocumentToApiDocument = async (data, entityId) => {
|
|
1074
|
-
const {
|
|
1075
|
-
companyRegistrationDocument,
|
|
1076
|
-
companyTaxDocument,
|
|
1077
|
-
companyProofOfDirectorDocument,
|
|
1078
|
-
companyConstitutionalDocument,
|
|
1079
|
-
companyProofOfSignatoryDocument,
|
|
1080
|
-
companyProofOfOwnershipDocument,
|
|
1081
|
-
basicInformation
|
|
1082
|
-
} = data;
|
|
1083
|
-
const taxDocumentType = COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(
|
|
1084
|
-
basicInformation?.country
|
|
1085
|
-
) ? "proofOfOrganizationTaxInfo" : "vatDocument";
|
|
1086
|
-
const documents = await Promise.all([
|
|
1087
|
-
createDocumentRequest({
|
|
1088
|
-
entityId,
|
|
1089
|
-
entityType: "legalEntity",
|
|
1090
|
-
documentType: "registrationDocument",
|
|
1091
|
-
description: companyRegistrationDocument?.description,
|
|
1092
|
-
page1: companyRegistrationDocument?.registrationDocument?.[0]
|
|
1093
|
-
}),
|
|
1094
|
-
createDocumentRequest({
|
|
1095
|
-
entityId,
|
|
1096
|
-
entityType: "legalEntity",
|
|
1097
|
-
documentType: taxDocumentType,
|
|
1098
|
-
description: companyTaxDocument?.description,
|
|
1099
|
-
page1: companyTaxDocument?.taxDocument?.[0]
|
|
1100
|
-
}),
|
|
1101
|
-
createDocumentRequest({
|
|
1102
|
-
entityId,
|
|
1103
|
-
entityType: "legalEntity",
|
|
1104
|
-
documentType: "proofOfDirector",
|
|
1105
|
-
description: companyProofOfDirectorDocument?.description,
|
|
1106
|
-
page1: companyProofOfDirectorDocument?.proofOfDirector?.[0]
|
|
1107
|
-
}),
|
|
1108
|
-
createDocumentRequest({
|
|
1109
|
-
entityId,
|
|
1110
|
-
entityType: "legalEntity",
|
|
1111
|
-
documentType: "constitutionalDocument",
|
|
1112
|
-
description: companyConstitutionalDocument?.description,
|
|
1113
|
-
page1: companyConstitutionalDocument?.constitutionalDocument?.[0]
|
|
1114
|
-
}),
|
|
1115
|
-
createDocumentRequest({
|
|
1116
|
-
entityId,
|
|
1117
|
-
entityType: "legalEntity",
|
|
1118
|
-
documentType: "proofOfSignatory",
|
|
1119
|
-
description: companyProofOfSignatoryDocument?.description,
|
|
1120
|
-
page1: companyProofOfSignatoryDocument?.proofOfSignatory?.[0]
|
|
1121
|
-
}),
|
|
1122
|
-
createDocumentRequest({
|
|
1123
|
-
entityId,
|
|
1124
|
-
entityType: "legalEntity",
|
|
1125
|
-
documentType: "proofOfOwnership",
|
|
1126
|
-
description: companyProofOfOwnershipDocument?.description,
|
|
1127
|
-
page1: companyProofOfOwnershipDocument?.proofOfOwnership?.[0],
|
|
1128
|
-
page2: companyProofOfOwnershipDocument?.proofOfOwnership?.[1]
|
|
1129
|
-
})
|
|
1130
|
-
]);
|
|
1131
|
-
return documents.filter(Boolean);
|
|
1132
|
-
};
|
|
1133
|
-
const mapBusinessDetailsSchemaToLegalEntity = (data, accountHolder, isExperimentEnabled) => {
|
|
1134
|
-
const requestObj = {
|
|
1135
|
-
...formatObject(
|
|
1136
|
-
data,
|
|
1137
|
-
accountHolder === "mySoleProprietorName" ? solePropBusinessDetailsApiKeyMapping : businessDetailsApiKeyMapping
|
|
1138
|
-
)
|
|
1139
|
-
};
|
|
1140
|
-
delete requestObj.organization?.legalFormDescription;
|
|
1141
|
-
const canSaveRegNumberAbsentState = isExperimentEnabled("EnableRegistrationAndTaxAbsentStatesV4") && isRegistrationNumberAbsentStateV4Scenario(
|
|
1142
|
-
data.basicInformation?.country,
|
|
1143
|
-
data.companyStructure?.entityType
|
|
1144
|
-
);
|
|
1145
|
-
const taxData = COUNTRIES_USING_COMPANY_SEARCH.includes(
|
|
1146
|
-
data.basicInformation?.country
|
|
1147
|
-
) ? data.basicInformation?.taxInformation : data.additionalInformation?.taxInformation;
|
|
1148
|
-
const registrationNumber = COUNTRIES_USING_COMPANY_SEARCH.includes(
|
|
1149
|
-
data.basicInformation?.country
|
|
1150
|
-
) ? data.basicInformation?.registrationNumber : data.additionalInformation?.registrationNumber;
|
|
1151
|
-
const localization = [
|
|
1152
|
-
mapSchemaFieldsToApiScriptLocalization(data.basicInformation ?? {}, "jaHani"),
|
|
1153
|
-
mapSchemaFieldsToApiScriptLocalization(data.basicInformation ?? {}, "jaKana")
|
|
1154
|
-
].filter(({ fields }) => !isEmpty$1(fields)).map(({ script, fields }) => ({
|
|
1155
|
-
script,
|
|
1156
|
-
// mismatch between API `legalName` and schema `legalCompanyName`
|
|
1157
|
-
fields: { legalName: fields.legalCompanyName }
|
|
1158
|
-
}));
|
|
1159
|
-
const doingBusinessAs = data.additionalInformation?.doingBusinessAs ?? "";
|
|
1160
|
-
const entityObject = isEmpty$1(data.companyStructure) ? requestObj.soleProprietorship : requestObj.organization;
|
|
1161
|
-
if (entityObject) {
|
|
1162
|
-
if (taxData) {
|
|
1163
|
-
entityObject.taxInformation = taxData;
|
|
1164
|
-
}
|
|
1165
|
-
if (!!requestObj.soleProprietorship && !requestObj.soleProprietorship?.countryOfGoverningLaw && !!data.basicInformation?.country) {
|
|
1166
|
-
requestObj.soleProprietorship.countryOfGoverningLaw = data.basicInformation.country;
|
|
1167
|
-
}
|
|
1168
|
-
if (registrationNumber) {
|
|
1169
|
-
entityObject.registrationNumber = registrationNumber;
|
|
1170
|
-
if (canSaveRegNumberAbsentState && requestObj.organization) {
|
|
1171
|
-
requestObj.organization.registrationNumberAbsent = false;
|
|
1172
|
-
}
|
|
1173
|
-
}
|
|
1174
|
-
if (requestObj.organization && entityObject && localization.length > 0) {
|
|
1175
|
-
entityObject.localization = localization;
|
|
1176
|
-
}
|
|
1177
|
-
if (data.additionalInformation?.exemptedFromRegistrationNumber && canSaveRegNumberAbsentState && requestObj.organization) {
|
|
1178
|
-
requestObj.organization.registrationNumberAbsent = data.additionalInformation?.exemptedFromRegistrationNumber;
|
|
1179
|
-
}
|
|
1180
|
-
if (data.additionalInformation?.vatAbsenceReason) {
|
|
1181
|
-
entityObject.vatNumber = "";
|
|
1182
|
-
}
|
|
1183
|
-
if (isExperimentEnabled("EnableDoingBusinessAsNameV4")) {
|
|
1184
|
-
if (typeof data.additionalInformation?.hasDoingBusinessAs !== "undefined") {
|
|
1185
|
-
entityObject.doingBusinessAsAbsent = !data.additionalInformation?.hasDoingBusinessAs;
|
|
1186
|
-
}
|
|
1187
|
-
} else {
|
|
1188
|
-
entityObject.doingBusinessAs = doingBusinessAs || data.basicInformation?.legalCompanyName;
|
|
1189
|
-
delete entityObject.doingBusinessAsAbsent;
|
|
1190
|
-
}
|
|
1191
|
-
if (data.additionalInformation?.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME && entityObject.principalPlaceOfBusiness) {
|
|
1192
|
-
entityObject.principalPlaceOfBusiness = entityObject.registeredAddress;
|
|
1193
|
-
}
|
|
1194
|
-
if (entityObject.registeredAddress) {
|
|
1195
|
-
const addressLocalizations = mapJpAddressSchemaToAddressLocalizations(
|
|
1196
|
-
data.additionalInformation?.registrationAddress
|
|
1197
|
-
);
|
|
1198
|
-
if (addressLocalizations.length > 0)
|
|
1199
|
-
entityObject.registeredAddress.localization = addressLocalizations;
|
|
1200
|
-
}
|
|
1201
|
-
if (!isEmpty$1(data.companyFinancialInformation)) {
|
|
1202
|
-
const isIncorporationDateDependencyEnabled = isExperimentEnabled(
|
|
1203
|
-
"EnableIncorporationDateBasedFinancialValidationForHO"
|
|
1204
|
-
);
|
|
1205
|
-
entityObject.financialReports = [
|
|
1206
|
-
mapFinancialInformationToFinancialReport(
|
|
1207
|
-
data.companyFinancialInformation,
|
|
1208
|
-
isIncorporationDateDependencyEnabled ? data?.additionalInformation?.dateOfIncorporation : void 0
|
|
1209
|
-
)
|
|
1210
|
-
];
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
requestObj.type = requestObj.organization ? LegalEntityTypes.ORGANIZATION : LegalEntityTypes.SOLE_PROPRIETORSHIP;
|
|
1214
|
-
if (entityObject?.registeredAddress.country === "US") {
|
|
1215
|
-
delete entityObject.registrationNumber;
|
|
1216
|
-
}
|
|
1217
|
-
if (!canSaveRegNumberAbsentState) {
|
|
1218
|
-
delete requestObj.organization?.registrationNumberAbsent;
|
|
1219
|
-
}
|
|
1220
|
-
return requestObj;
|
|
1221
|
-
};
|
|
1222
|
-
function buildRequiredForms({
|
|
1223
|
-
config: {
|
|
1224
|
-
forms,
|
|
1225
|
-
requiredFields,
|
|
1226
|
-
optionalFields,
|
|
1227
|
-
isValid,
|
|
1228
|
-
problems,
|
|
1229
|
-
isSettingEnabled,
|
|
1230
|
-
accountHolder,
|
|
1231
|
-
legalEntityResponse
|
|
1232
|
-
},
|
|
1233
|
-
options
|
|
1234
|
-
}) {
|
|
1235
|
-
const skipCompanyStructure = !!verifiedBusiness.value?.legalForm || isSettingEnabled(SettingNames.AllowLegalEntityTypeChange) && organizationTypesToSkipCompanyStructureForm.includes(
|
|
1236
|
-
legalEntityResponse?.organization?.type ?? ""
|
|
1237
|
-
) && accountHolder !== "aTrust" && accountHolder !== "anUnincorporatedPartnership";
|
|
1238
|
-
const filteredForms = Object.values(forms).filter(({ formId }) => {
|
|
1239
|
-
if (formId === "businessSelection") {
|
|
1240
|
-
if (options?.hasNoSearchResults || isVerifiedSingleCompanySearchResult.value) return false;
|
|
1241
|
-
}
|
|
1242
|
-
if (formId === "companyStructure") {
|
|
1243
|
-
if (skipCompanyStructure) return false;
|
|
1244
|
-
}
|
|
1245
|
-
if (requiredFields || optionalFields) {
|
|
1246
|
-
return Boolean(requiredFields?.[formId]) || Boolean(optionalFields?.[formId]);
|
|
1247
|
-
}
|
|
1248
|
-
return true;
|
|
1249
|
-
});
|
|
1250
|
-
const requiredForms = options?.skipSummary ? filteredForms : [...filteredForms, summaryStep];
|
|
1251
|
-
return addValidityToForms(requiredForms, isValid, problems);
|
|
1252
|
-
}
|
|
1253
|
-
const isDocumentsRequired = (forms) => forms.some((form) => documentFormsIds.includes(form.formId));
|
|
1254
|
-
const formatBasicInformation = (data, datasetUtils, companyType, isCountryOfGoverningLawEnabled) => {
|
|
1255
|
-
const country = data?.country;
|
|
1256
|
-
const registrationNumberLabel = resolveFieldMetadata(
|
|
1257
|
-
registrationNumberDefaultFieldConfig[country],
|
|
1258
|
-
{
|
|
1259
|
-
companyType,
|
|
1260
|
-
registrationNumberType: data.registrationNumber ? inferCompanyRegistrationNumberType(data?.registrationNumber, country, companyType) : getCompanyRegistrationNumberOptions(country, companyType)?.[0]?.id
|
|
1261
|
-
},
|
|
1262
|
-
registrationNumberDefaultFieldMetadata
|
|
1263
|
-
).label;
|
|
1264
|
-
const taxIdLabel = resolveFieldMetadata(
|
|
1265
|
-
taxInformationDefaultFieldConfig[country],
|
|
1266
|
-
{
|
|
1267
|
-
taxIdNumberType: countryToTaxInfoTypeMap[country] ?? void 0,
|
|
1268
|
-
// TODO use type selector
|
|
1269
|
-
companyType: void 0
|
|
1270
|
-
},
|
|
1271
|
-
taxInformationDefaultFieldMetadata
|
|
1272
|
-
).label;
|
|
1273
|
-
const countryOfGoverningLaw = getCountryOfGoverningLaw(isCountryOfGoverningLawEnabled, data);
|
|
1274
|
-
return {
|
|
1275
|
-
["legalCompanyName"]: data.legalCompanyName,
|
|
1276
|
-
country: datasetUtils.getCountryName(data.country),
|
|
1277
|
-
[getKeyForField("stateOrProvince", data.country)]: datasetUtils.getStateName(
|
|
1278
|
-
data.stateOrProvince,
|
|
1279
|
-
data.country
|
|
1280
|
-
),
|
|
1281
|
-
[taxIdLabel]: data.taxInformation?.find((taxId) => data.country === taxId.country)?.number,
|
|
1282
|
-
[registrationNumberLabel]: data.registrationNumber,
|
|
1283
|
-
countryOfGoverningLaw: datasetUtils.getCountryName(countryOfGoverningLaw)
|
|
1284
|
-
};
|
|
1285
|
-
};
|
|
1286
|
-
const formatAdditionalInformation = (data, country, companyType, t) => {
|
|
1287
|
-
const registrationNumberLabel = resolveFieldMetadata(
|
|
1288
|
-
registrationNumberDefaultFieldConfig[country],
|
|
1289
|
-
{
|
|
1290
|
-
companyType,
|
|
1291
|
-
registrationNumberType: data.registrationNumber ? inferCompanyRegistrationNumberType(data?.registrationNumber, country, companyType) : getCompanyRegistrationNumberOptions(country, companyType)?.[0]?.id
|
|
1292
|
-
},
|
|
1293
|
-
registrationNumberDefaultFieldMetadata
|
|
1294
|
-
).label;
|
|
1295
|
-
const taxIdLabel = resolveFieldMetadata(
|
|
1296
|
-
taxInformationDefaultFieldConfig[country],
|
|
1297
|
-
{
|
|
1298
|
-
taxIdNumberType: countryToTaxInfoTypeMap[country] ?? void 0,
|
|
1299
|
-
// TODO use type selector
|
|
1300
|
-
companyType: void 0
|
|
1301
|
-
},
|
|
1302
|
-
taxInformationDefaultFieldMetadata
|
|
1303
|
-
).label;
|
|
1304
|
-
return {
|
|
1305
|
-
["businessStructure"]: data.legalFormLabel,
|
|
1306
|
-
["doingBusinessAs"]: data.doingBusinessAs,
|
|
1307
|
-
["industry"]: data.industryCodes?.[0].name,
|
|
1308
|
-
[registrationNumberLabel]: data.registrationNumber,
|
|
1309
|
-
[taxIdLabel]: data.isUen ? void 0 : data.taxInformation?.find((taxId) => country === taxId.country)?.number,
|
|
1310
|
-
["vatNumber"]: data.vatNumber,
|
|
1311
|
-
["vatAbsenceReason"]: data.vatAbsenceReason ? t(($) => $[data.vatAbsenceReason], { ns: "common" }) : void 0,
|
|
1312
|
-
["dateOfIncorporation"]: data.dateOfIncorporation,
|
|
1313
|
-
["stockExchangeMIC"]: data.stockExchangeMIC,
|
|
1314
|
-
["stockISIN"]: data.stockISIN,
|
|
1315
|
-
["stockTickerSymbol"]: data.stockTickerSymbol,
|
|
1316
|
-
["eInvoicingCode"]: data.eInvoicingCode
|
|
1317
|
-
};
|
|
1318
|
-
};
|
|
1319
|
-
const formatDataForSummary = (data, forms, t, language, isExperimentEnabled, version) => {
|
|
1320
|
-
const datasetUtils = datasetUtilities(language);
|
|
1321
|
-
return entriesOf(data).reduce((summaryData, [form]) => {
|
|
1322
|
-
if (!form || !data[form]) return summaryData;
|
|
1323
|
-
const isCountryOfGoverningLawEnabled = isExperimentEnabled(
|
|
1324
|
-
"EnableCountryOfGoverningLawForUKCompanies"
|
|
1325
|
-
);
|
|
1326
|
-
switch (form) {
|
|
1327
|
-
case "basicInformation":
|
|
1328
|
-
return {
|
|
1329
|
-
...summaryData,
|
|
1330
|
-
[form]: formatBasicInformation(
|
|
1331
|
-
data[form],
|
|
1332
|
-
datasetUtils,
|
|
1333
|
-
data.companyStructure?.entityType,
|
|
1334
|
-
isCountryOfGoverningLawEnabled
|
|
1335
|
-
)
|
|
1336
|
-
};
|
|
1337
|
-
case "companyStructure":
|
|
1338
|
-
return {
|
|
1339
|
-
...summaryData,
|
|
1340
|
-
[form]: {
|
|
1341
|
-
entityType: t(
|
|
1342
|
-
($) => $[companyTypeMetadata[data["companyStructure"]?.entityType]?.name],
|
|
1343
|
-
{
|
|
1344
|
-
ns: "business"
|
|
1345
|
-
}
|
|
1346
|
-
)
|
|
1347
|
-
}
|
|
1348
|
-
};
|
|
1349
|
-
case "additionalInformation":
|
|
1350
|
-
return {
|
|
1351
|
-
...summaryData,
|
|
1352
|
-
[form]: {
|
|
1353
|
-
hasInnerForms: true,
|
|
1354
|
-
additionalInformationFormName: formatAdditionalInformation(
|
|
1355
|
-
data[form],
|
|
1356
|
-
data.basicInformation?.country,
|
|
1357
|
-
data.companyStructure?.entityType,
|
|
1358
|
-
t
|
|
1359
|
-
),
|
|
1360
|
-
registrationAddress: data.basicInformation?.country === CountryCodes.Japan && version === 4 ? mapJpAddressSummary(data[form].registrationAddress, datasetUtils) : mapAddressLabels(data[form].registrationAddress, datasetUtils),
|
|
1361
|
-
operationalAddress: data[form].operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME ? data.basicInformation?.country === CountryCodes.Japan && version === 4 ? mapJpAddressSummary(data[form].operationalAddress, datasetUtils) : mapAddressLabels(data[form].operationalAddress, datasetUtils) : void 0
|
|
1362
|
-
}
|
|
1363
|
-
};
|
|
1364
|
-
case "companyRegistrationDocument":
|
|
1365
|
-
if (!isDocumentsRequired(forms)) return summaryData;
|
|
1366
|
-
return {
|
|
1367
|
-
...summaryData,
|
|
1368
|
-
[form]: {
|
|
1369
|
-
companyRegistrationDocument: {
|
|
1370
|
-
fileName: data[form].registrationDocument?.[0]?.name,
|
|
1371
|
-
description: data[form]?.description
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
};
|
|
1375
|
-
case "companyTaxDocument":
|
|
1376
|
-
if (!isDocumentsRequired(forms)) return summaryData;
|
|
1377
|
-
return {
|
|
1378
|
-
...summaryData,
|
|
1379
|
-
[form]: {
|
|
1380
|
-
companyTaxDocument: {
|
|
1381
|
-
fileName: data[form].taxDocument?.[0]?.name,
|
|
1382
|
-
description: data[form]?.description
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
};
|
|
1386
|
-
case "companyProofOfDirectorDocument":
|
|
1387
|
-
if (!isDocumentsRequired(forms)) return summaryData;
|
|
1388
|
-
return {
|
|
1389
|
-
...summaryData,
|
|
1390
|
-
[form]: {
|
|
1391
|
-
companyProofOfDirectorDocument: {
|
|
1392
|
-
fileName: data[form].proofOfDirector?.[0]?.name,
|
|
1393
|
-
description: data[form]?.description
|
|
1394
|
-
}
|
|
1395
|
-
}
|
|
1396
|
-
};
|
|
1397
|
-
case "companyProofOfSignatoryDocument":
|
|
1398
|
-
if (!isDocumentsRequired(forms)) return summaryData;
|
|
1399
|
-
return {
|
|
1400
|
-
...summaryData,
|
|
1401
|
-
[form]: {
|
|
1402
|
-
companyProofOfSignatoryDocument: {
|
|
1403
|
-
fileName: data[form].proofOfSignatory?.[0]?.name,
|
|
1404
|
-
description: data[form]?.description
|
|
1405
|
-
}
|
|
1406
|
-
}
|
|
1407
|
-
};
|
|
1408
|
-
case "companyProofOfOwnershipDocument":
|
|
1409
|
-
if (!isDocumentsRequired(forms)) return summaryData;
|
|
1410
|
-
return {
|
|
1411
|
-
...summaryData,
|
|
1412
|
-
[form]: {
|
|
1413
|
-
companyProofOfOwnershipDocument: {
|
|
1414
|
-
fileName: data[form].proofOfOwnership?.map((doc) => doc.name).join("\n"),
|
|
1415
|
-
description: data[form]?.description
|
|
1416
|
-
}
|
|
1417
|
-
}
|
|
1418
|
-
};
|
|
1419
|
-
case "companyFinancialInformation": {
|
|
1420
|
-
const isIncorporationDateDependencyEnabled = isExperimentEnabled(
|
|
1421
|
-
"EnableIncorporationDateBasedFinancialValidationForHO"
|
|
1422
|
-
);
|
|
1423
|
-
return {
|
|
1424
|
-
...summaryData,
|
|
1425
|
-
[form]: formatFinancialInformationSummary(
|
|
1426
|
-
data[form],
|
|
1427
|
-
language,
|
|
1428
|
-
data?.basicInformation?.country,
|
|
1429
|
-
isIncorporationDateDependencyEnabled ? data?.additionalInformation?.dateOfIncorporation : void 0
|
|
1430
|
-
)
|
|
1431
|
-
};
|
|
1432
|
-
}
|
|
1433
|
-
default:
|
|
1434
|
-
return summaryData;
|
|
1435
|
-
}
|
|
1436
|
-
}, {});
|
|
1437
|
-
};
|
|
1438
|
-
async function submitDocuments({
|
|
1439
|
-
data,
|
|
1440
|
-
legalEntity,
|
|
1441
|
-
forms,
|
|
1442
|
-
documentUtils,
|
|
1443
|
-
userEvents
|
|
1444
|
-
}) {
|
|
1445
|
-
if (!isDocumentsRequired(forms)) return;
|
|
1446
|
-
const logger = createLogger();
|
|
1447
|
-
const formattedDocument = await mapBusinessDetailsDocumentToApiDocument(data, legalEntity.id);
|
|
1448
|
-
formattedDocument.forEach((doc) => {
|
|
1449
|
-
const existingDoc = getDocument(legalEntity.id, doc.type);
|
|
1450
|
-
if (doc.type === "proofOfOwnership" && existingDoc && doc.attachments?.length) {
|
|
1451
|
-
doc.attachments = mergeProofOfOwnershipAttachments(
|
|
1452
|
-
existingDoc.attachments ?? [],
|
|
1453
|
-
doc.attachments
|
|
1454
|
-
).filter((attachment) => attachment.pageName);
|
|
1455
|
-
}
|
|
1456
|
-
});
|
|
1457
|
-
try {
|
|
1458
|
-
if (formattedDocument) {
|
|
1459
|
-
await documentUtils.uploadDocuments(formattedDocument, legalEntity.id);
|
|
1460
|
-
formattedDocument.forEach((doc) => {
|
|
1461
|
-
userEvents?.addTaskEvent("Success", {
|
|
1462
|
-
actionType: "upload",
|
|
1463
|
-
documentType: doc.type,
|
|
1464
|
-
fileExtention: doc.attachments?.map((item) => getFileExtention(item.pageName)).filter((item) => item !== void 0) ?? []
|
|
1465
|
-
});
|
|
1466
|
-
});
|
|
1467
|
-
}
|
|
1468
|
-
} catch (err) {
|
|
1469
|
-
logger.error(err);
|
|
1470
|
-
userEvents.addTaskEvent("Encountered error", {
|
|
1471
|
-
actionType: "upload",
|
|
1472
|
-
returnType: err.errorCode,
|
|
1473
|
-
returnValue: err.title ?? err.message
|
|
1474
|
-
});
|
|
1475
|
-
}
|
|
1476
|
-
}
|
|
1477
|
-
async function submit({
|
|
1478
|
-
data,
|
|
1479
|
-
legalEntityResponse,
|
|
1480
|
-
associatedLegalArrangement,
|
|
1481
|
-
nestedLegalEntity,
|
|
1482
|
-
nestedLegalEntityDetails,
|
|
1483
|
-
problems,
|
|
1484
|
-
taskType,
|
|
1485
|
-
accountHolder,
|
|
1486
|
-
forms,
|
|
1487
|
-
documentUtils,
|
|
1488
|
-
t,
|
|
1489
|
-
showToast,
|
|
1490
|
-
setLoadingStatus,
|
|
1491
|
-
setProblems,
|
|
1492
|
-
handleUpdateLegalEntity,
|
|
1493
|
-
createLegalEntity,
|
|
1494
|
-
onExternalSubmit,
|
|
1495
|
-
isExperimentEnabled,
|
|
1496
|
-
userEvents,
|
|
1497
|
-
efpBusinessLines,
|
|
1498
|
-
createBusinessLine,
|
|
1499
|
-
updateBusinessLine
|
|
1500
|
-
}) {
|
|
1501
|
-
const logger = createLogger();
|
|
1502
|
-
setLoadingStatus("loading");
|
|
1503
|
-
let trackingPayload = {
|
|
1504
|
-
actionType: "submit",
|
|
1505
|
-
companyStructure: data.companyStructure?.entityType,
|
|
1506
|
-
countryOfRegistration: data.basicInformation?.country,
|
|
1507
|
-
legalEntityName: accountHolder === "theCompanyIWorkFor" ? data.basicInformation?.legalCompanyName : void 0,
|
|
1508
|
-
// Only send legalCompanyName for organizations
|
|
1509
|
-
usedAdditionalAddress: data.additionalInformation?.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME
|
|
1510
|
-
};
|
|
1511
|
-
const entityToUpdate = (() => {
|
|
1512
|
-
switch (taskType) {
|
|
1513
|
-
case TaskTypes.SOLE_PROPRIETOR_COMPANY:
|
|
1514
|
-
return associatedLegalArrangement;
|
|
1515
|
-
case TaskTypes.TRUST_MEMBER_COMPANY:
|
|
1516
|
-
case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY:
|
|
1517
|
-
return nestedLegalEntity;
|
|
1518
|
-
case TaskTypes.BUSINESS_DETAILS:
|
|
1519
|
-
default:
|
|
1520
|
-
return legalEntityResponse;
|
|
1521
|
-
}
|
|
1522
|
-
})();
|
|
1523
|
-
const handleSubmitLegalEntity = async (legalEntity) => {
|
|
1524
|
-
if (taskType === TaskTypes.TRUST_MEMBER_COMPANY && !nestedLegalEntity?.id || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY && !nestedLegalEntity?.id || taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY && !associatedLegalArrangement?.id) {
|
|
1525
|
-
return await createLegalEntity(legalEntity);
|
|
1526
|
-
} else {
|
|
1527
|
-
return handleUpdateLegalEntity({
|
|
1528
|
-
...drop("type").from(legalEntity),
|
|
1529
|
-
id: entityToUpdate?.id ?? legalEntityResponse.id
|
|
1530
|
-
});
|
|
1531
|
-
}
|
|
1532
|
-
};
|
|
1533
|
-
const associateLegalEntityWithParent = async ({
|
|
1534
|
-
legalEntity,
|
|
1535
|
-
associatedLegalArrangement: associatedLegalArrangement2,
|
|
1536
|
-
nestedLegalEntityDetails: nestedLegalEntityDetails2
|
|
1537
|
-
}) => {
|
|
1538
|
-
if (nestedLegalEntityDetails2 && associatedLegalArrangement2) {
|
|
1539
|
-
const existingEntityAssociations = getOwnEntityAssociations(associatedLegalArrangement2);
|
|
1540
|
-
const existingRoles = existingEntityAssociations.filter((ea) => ea.legalEntityId === associatedLegalArrangement2.id).map(({ type }) => type);
|
|
1541
|
-
const newRoles = nestedLegalEntityDetails2?.roles ?? [];
|
|
1542
|
-
const rolesChanged = !doArraysMatch(existingRoles, newRoles);
|
|
1543
|
-
if (rolesChanged) {
|
|
1544
|
-
const updatedAssociations = {
|
|
1545
|
-
entityAssociations: [
|
|
1546
|
-
...newRoles.map((role) => ({
|
|
1547
|
-
type: role,
|
|
1548
|
-
legalEntityId: legalEntity.id
|
|
1549
|
-
})) || [],
|
|
1550
|
-
...existingEntityAssociations.filter((ea) => ea.legalEntityId !== legalEntity.id) || []
|
|
1551
|
-
]
|
|
1552
|
-
};
|
|
1553
|
-
await handleUpdateLegalEntity({
|
|
1554
|
-
...updatedAssociations,
|
|
1555
|
-
id: associatedLegalArrangement2.id
|
|
1556
|
-
});
|
|
1557
|
-
}
|
|
1558
|
-
return;
|
|
1559
|
-
} else {
|
|
1560
|
-
const updatedAssociations = {
|
|
1561
|
-
entityAssociations: [
|
|
1562
|
-
{
|
|
1563
|
-
type: LegalEntityTypes.SOLE_PROPRIETORSHIP,
|
|
1564
|
-
legalEntityId: legalEntity.id
|
|
1565
|
-
}
|
|
1566
|
-
]
|
|
1567
|
-
};
|
|
1568
|
-
await handleUpdateLegalEntity({ ...updatedAssociations, id: legalEntityResponse.id });
|
|
1569
|
-
}
|
|
1570
|
-
};
|
|
1571
|
-
const savedLegalEntityData = legalEntityResponse ? mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, void 0) : null;
|
|
1572
|
-
const filteredData = savedLegalEntityData ? setRemovedFieldsOnSchemaToDeletedValue(data, savedLegalEntityData) : data;
|
|
1573
|
-
if (filteredData?.additionalInformation && !filteredData?.additionalInformation?.taxInformation) {
|
|
1574
|
-
filteredData.additionalInformation.taxInformation = void 0;
|
|
1575
|
-
}
|
|
1576
|
-
const isCountryOfGoverningLawEnabled = isExperimentEnabled(
|
|
1577
|
-
"EnableCountryOfGoverningLawForUKCompanies"
|
|
1578
|
-
);
|
|
1579
|
-
const countryOfGoverningLaw = getCountryOfGoverningLaw(
|
|
1580
|
-
isCountryOfGoverningLawEnabled,
|
|
1581
|
-
filteredData?.basicInformation
|
|
1582
|
-
);
|
|
1583
|
-
if (filteredData?.basicInformation) {
|
|
1584
|
-
if (countryOfGoverningLaw) {
|
|
1585
|
-
filteredData.basicInformation.countryOfGoverningLaw = countryOfGoverningLaw;
|
|
1586
|
-
} else {
|
|
1587
|
-
delete filteredData.basicInformation.countryOfGoverningLaw;
|
|
1588
|
-
}
|
|
1589
|
-
}
|
|
1590
|
-
const primaryIndustryCode = data.additionalInformation?.industryCodes && data.additionalInformation.industryCodes[0].id;
|
|
1591
|
-
if (createBusinessLine && updateBusinessLine && primaryIndustryCode) {
|
|
1592
|
-
const bankingBusinessLines = [];
|
|
1593
|
-
const issuingBusinessLines = [];
|
|
1594
|
-
if (efpBusinessLines) {
|
|
1595
|
-
for (const bl of efpBusinessLines) {
|
|
1596
|
-
if (bl.service === "banking") bankingBusinessLines.push(bl);
|
|
1597
|
-
else issuingBusinessLines.push(bl);
|
|
1598
|
-
}
|
|
1599
|
-
}
|
|
1600
|
-
const promises = [];
|
|
1601
|
-
const operations = [];
|
|
1602
|
-
const updateOrCreateBusinessLinesIfNeeded = (businessLines, requestedCapability, service) => {
|
|
1603
|
-
if (businessLines.length) {
|
|
1604
|
-
for (const bl of businessLines) {
|
|
1605
|
-
if (bl.industryCode === primaryIndustryCode) continue;
|
|
1606
|
-
const payload = {
|
|
1607
|
-
id: bl.id,
|
|
1608
|
-
legalEntityId: legalEntityResponse.id,
|
|
1609
|
-
industryCode: primaryIndustryCode,
|
|
1610
|
-
service
|
|
1611
|
-
};
|
|
1612
|
-
promises.push(updateBusinessLine(payload));
|
|
1613
|
-
operations.push(payload);
|
|
1614
|
-
}
|
|
1615
|
-
} else if (requestedCapability) {
|
|
1616
|
-
const payload = {
|
|
1617
|
-
legalEntityId: legalEntityResponse.id,
|
|
1618
|
-
industryCode: primaryIndustryCode,
|
|
1619
|
-
service
|
|
1620
|
-
};
|
|
1621
|
-
promises.push(createBusinessLine(payload));
|
|
1622
|
-
operations.push(payload);
|
|
1623
|
-
}
|
|
1624
|
-
};
|
|
1625
|
-
updateOrCreateBusinessLinesIfNeeded(
|
|
1626
|
-
bankingBusinessLines,
|
|
1627
|
-
requestingBanking(legalEntityResponse),
|
|
1628
|
-
"banking"
|
|
1629
|
-
);
|
|
1630
|
-
updateOrCreateBusinessLinesIfNeeded(
|
|
1631
|
-
issuingBusinessLines,
|
|
1632
|
-
requestingIssuing(legalEntityResponse),
|
|
1633
|
-
"issuing"
|
|
1634
|
-
);
|
|
1635
|
-
let hadRejection = false;
|
|
1636
|
-
(await Promise.allSettled(promises)).forEach((result, idx) => {
|
|
1637
|
-
if (result.status !== "rejected") return;
|
|
1638
|
-
const op = operations[idx];
|
|
1639
|
-
logger.log(
|
|
1640
|
-
`Failed to ${op.id ? "update" : "create"} business line with payload: ${JSON.stringify(op)}`
|
|
1641
|
-
);
|
|
1642
|
-
hadRejection = true;
|
|
1643
|
-
});
|
|
1644
|
-
const eventPayload = {
|
|
1645
|
-
actionType: trackingPayload.actionType,
|
|
1646
|
-
legalEntityName: trackingPayload.legalEntityName
|
|
1647
|
-
};
|
|
1648
|
-
if (!hadRejection) {
|
|
1649
|
-
userEvents?.addTaskEvent("Success", eventPayload);
|
|
1650
|
-
} else {
|
|
1651
|
-
userEvents?.addTaskEvent("Encountered error", {
|
|
1652
|
-
...eventPayload,
|
|
1653
|
-
returnType: "businessLines",
|
|
1654
|
-
returnValue: "couldNotCreateOrUpdateBusinessLine"
|
|
1655
|
-
});
|
|
1656
|
-
showToast({
|
|
1657
|
-
label: t(($) => $["failedToUpdateEfpBusinessLines"], { ns: "business" }),
|
|
1658
|
-
variant: "error"
|
|
1659
|
-
});
|
|
1660
|
-
return setLoadingStatus("success");
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
try {
|
|
1664
|
-
const mappedLegalEntity = {
|
|
1665
|
-
...mapBusinessDetailsSchemaToLegalEntity(filteredData, accountHolder, isExperimentEnabled),
|
|
1666
|
-
entityAssociations: filterOutUnwantedAssociationsIfRootLE(
|
|
1667
|
-
taskType,
|
|
1668
|
-
entityToUpdate,
|
|
1669
|
-
accountHolder
|
|
1670
|
-
)
|
|
1671
|
-
};
|
|
1672
|
-
if (mappedLegalEntity.type === LegalEntityTypes.ORGANIZATION && legalEntityResponse.organization?.countryOfGoverningLaw !== mappedLegalEntity.organization?.countryOfGoverningLaw && legalEntityResponse.organization?.support) {
|
|
1673
|
-
mappedLegalEntity.organization.support = determineCustomerSupport(
|
|
1674
|
-
legalEntityResponse.organization.support,
|
|
1675
|
-
mappedLegalEntity.organization?.countryOfGoverningLaw
|
|
1676
|
-
);
|
|
1677
|
-
}
|
|
1678
|
-
const legalEntity = await handleSubmitLegalEntity(mappedLegalEntity);
|
|
1679
|
-
if (taskType === TaskTypes.TRUST_MEMBER_COMPANY || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY || taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY && !associatedLegalArrangement?.id) {
|
|
1680
|
-
await associateLegalEntityWithParent({
|
|
1681
|
-
legalEntity,
|
|
1682
|
-
associatedLegalArrangement,
|
|
1683
|
-
nestedLegalEntityDetails
|
|
1684
|
-
});
|
|
1685
|
-
}
|
|
1686
|
-
await submitDocuments({
|
|
1687
|
-
data,
|
|
1688
|
-
legalEntity,
|
|
1689
|
-
documentUtils,
|
|
1690
|
-
forms,
|
|
1691
|
-
userEvents
|
|
1692
|
-
});
|
|
1693
|
-
userEvents?.addTaskEvent("Success", trackingPayload);
|
|
1694
|
-
showToast({
|
|
1695
|
-
label: t(($) => $["successfullyUpdatedDetails"], { ns: "common" }),
|
|
1696
|
-
variant: "success"
|
|
1697
|
-
});
|
|
1698
|
-
onExternalSubmit?.(data);
|
|
1699
|
-
} catch (err) {
|
|
1700
|
-
if (isValidationError(err)) {
|
|
1701
|
-
const getErrors = processValidationErrors(err, TaskTypes.BUSINESS_DETAILS);
|
|
1702
|
-
if (getErrors && !Object.keys(getErrors).length) {
|
|
1703
|
-
showToast({
|
|
1704
|
-
label: t(($) => $["failedToUpdateDetails"], { ns: "common" }),
|
|
1705
|
-
variant: "error"
|
|
1706
|
-
});
|
|
1707
|
-
const unmappedErrorNames = err.invalidFields?.map((field) => field.name).filter(Boolean) ?? [];
|
|
1708
|
-
if (unmappedErrorNames.length) {
|
|
1709
|
-
trackingPayload = {
|
|
1710
|
-
...trackingPayload,
|
|
1711
|
-
additionalData: { unmappedErrorNames }
|
|
1712
|
-
};
|
|
1713
|
-
}
|
|
1714
|
-
} else {
|
|
1715
|
-
setProblems({
|
|
1716
|
-
...problems,
|
|
1717
|
-
validationErrors: getErrors
|
|
1718
|
-
});
|
|
1719
|
-
}
|
|
1720
|
-
}
|
|
1721
|
-
if (isMaintenanceModeError(err)) {
|
|
1722
|
-
showToast({
|
|
1723
|
-
label: t(($) => $["maintenanceModeMessage"], { ns: "common" }),
|
|
1724
|
-
variant: "error",
|
|
1725
|
-
duration: "indefinite"
|
|
1726
|
-
});
|
|
1727
|
-
}
|
|
1728
|
-
if (!isValidationError(err) && !isMaintenanceModeError(err)) {
|
|
1729
|
-
showToast({
|
|
1730
|
-
label: t(($) => $["failedToUpdateDetails"], { ns: "common" }),
|
|
1731
|
-
variant: "error"
|
|
1732
|
-
});
|
|
1733
|
-
}
|
|
1734
|
-
logger.error(err);
|
|
1735
|
-
userEvents?.addTaskEvent("Encountered error", {
|
|
1736
|
-
...trackingPayload,
|
|
1737
|
-
returnType: err?.errorCode,
|
|
1738
|
-
returnValue: err?.title || "backend"
|
|
1739
|
-
});
|
|
1740
|
-
} finally {
|
|
1741
|
-
setLoadingStatus("success");
|
|
1742
|
-
}
|
|
1743
|
-
}
|
|
1744
|
-
const getCountryOfGoverningLaw = (isCountryOfGoverningLawEnabled, basicData) => {
|
|
1745
|
-
if (!isCountryOfGoverningLawEnabled || basicData?.country !== CountryCodes.UnitedKingdom) {
|
|
1746
|
-
return void 0;
|
|
1747
|
-
}
|
|
1748
|
-
if (isCountryOfGoverningLawEnabled && basicData?.country === CountryCodes.UnitedKingdom && !basicData?.countryOfGoverningLaw) {
|
|
1749
|
-
return CountryCodes.UnitedKingdom;
|
|
1750
|
-
}
|
|
1751
|
-
return basicData?.countryOfGoverningLaw;
|
|
1752
|
-
};
|
|
1753
|
-
const determineCustomerSupport = (customerSupport, country) => {
|
|
1754
|
-
switch (country) {
|
|
1755
|
-
case CountryCodes.Japan:
|
|
1756
|
-
return unsetCustomerSupportNumber(customerSupport);
|
|
1757
|
-
default:
|
|
1758
|
-
return customerSupport;
|
|
1759
|
-
}
|
|
1760
|
-
};
|
|
1761
|
-
const unsetCustomerSupportNumber = (customerSupport) => {
|
|
1762
|
-
return customerSupport ? {
|
|
1763
|
-
email: customerSupport.email,
|
|
1764
|
-
phone: { number: "", type: "mobile" }
|
|
1765
|
-
} : void 0;
|
|
1766
|
-
};
|
|
1767
|
-
const CountryFieldValidation = () => ({
|
|
1768
|
-
country: {
|
|
1769
|
-
modes: ["blur"],
|
|
1770
|
-
validate: (country) => !isEmpty(country),
|
|
1771
|
-
errorMessage: "fieldIsRequired"
|
|
1772
|
-
}
|
|
1773
|
-
});
|
|
1774
|
-
const CountryOfGoverningLawFieldValidation = () => ({
|
|
1775
|
-
countryOfGoverningLaw: {
|
|
1776
|
-
modes: ["blur"],
|
|
1777
|
-
validate: (countryOfGoverningLaw) => !isEmpty(countryOfGoverningLaw),
|
|
1778
|
-
errorMessage: "fieldIsRequired"
|
|
1779
|
-
}
|
|
1780
|
-
});
|
|
1781
|
-
function basicInformationValidators({
|
|
1782
|
-
country,
|
|
1783
|
-
taxIdNumberType,
|
|
1784
|
-
companyType,
|
|
1785
|
-
registrationNumberType,
|
|
1786
|
-
state,
|
|
1787
|
-
isExperimentEnabled
|
|
1788
|
-
}) {
|
|
1789
|
-
return {
|
|
1790
|
-
country: CountryFieldValidation().country,
|
|
1791
|
-
countryOfGoverningLaw: CountryOfGoverningLawFieldValidation().countryOfGoverningLaw,
|
|
1792
|
-
legalCompanyName: resolveFieldMetadata(
|
|
1793
|
-
isExperimentEnabled("StrictNameAndAddressValidationV4") ? defaultFieldConfigV4[country] : defaultFieldConfig$2[country],
|
|
1794
|
-
{ isBusiness: true },
|
|
1795
|
-
isExperimentEnabled("StrictNameAndAddressValidationV4") ? defaultFieldMetadataV4 : defaultFieldMetadata$2
|
|
1796
|
-
)?.validators,
|
|
1797
|
-
taxInformation: resolveFieldMetadata(
|
|
1798
|
-
taxInformationDefaultFieldConfig[country],
|
|
1799
|
-
{
|
|
1800
|
-
taxIdNumberType,
|
|
1801
|
-
companyType
|
|
1802
|
-
},
|
|
1803
|
-
taxInformationDefaultFieldMetadata
|
|
1804
|
-
)?.validators,
|
|
1805
|
-
stateOrProvince: resolveFieldMetadata(
|
|
1806
|
-
defaultFieldConfig$1[country],
|
|
1807
|
-
{ isBusiness: true },
|
|
1808
|
-
defaultFieldMetadata$1
|
|
1809
|
-
)?.validators,
|
|
1810
|
-
registrationNumber: resolveFieldMetadata(
|
|
1811
|
-
registrationNumberDefaultFieldConfig[country],
|
|
1812
|
-
{
|
|
1813
|
-
companyType,
|
|
1814
|
-
registrationNumberType,
|
|
1815
|
-
state,
|
|
1816
|
-
isExperimentEnabled
|
|
1817
|
-
},
|
|
1818
|
-
registrationNumberDefaultFieldMetadata
|
|
1819
|
-
)?.validators
|
|
1820
|
-
};
|
|
1821
|
-
}
|
|
1822
|
-
function businessSelectionValidators() {
|
|
1823
|
-
return {
|
|
1824
|
-
hasSelectedBusiness: {
|
|
1825
|
-
modes: ["blur", "input"],
|
|
1826
|
-
validate: (value) => typeof value === "boolean",
|
|
1827
|
-
// indicates a selection was made
|
|
1828
|
-
errorMessage: "fieldIsRequired"
|
|
1829
|
-
}
|
|
1830
|
-
};
|
|
1831
|
-
}
|
|
1832
|
-
function additionalInformationValidators({
|
|
1833
|
-
country,
|
|
1834
|
-
taxIdNumberType,
|
|
1835
|
-
companyType,
|
|
1836
|
-
registrationNumberType,
|
|
1837
|
-
vatNumberType,
|
|
1838
|
-
isExperimentEnabled
|
|
1839
|
-
}) {
|
|
1840
|
-
return {
|
|
1841
|
-
hasDoingBusinessAs: doingBusinessAsAbsentFieldMetadata.validators,
|
|
1842
|
-
doingBusinessAs: doingBusinessAsFieldMetadata.validators,
|
|
1843
|
-
registrationNumber: resolveFieldMetadata(
|
|
1844
|
-
registrationNumberDefaultFieldConfig[country],
|
|
1845
|
-
{
|
|
1846
|
-
companyType,
|
|
1847
|
-
registrationNumberType,
|
|
1848
|
-
isExperimentEnabled
|
|
1849
|
-
},
|
|
1850
|
-
registrationNumberDefaultFieldMetadata
|
|
1851
|
-
)?.validators,
|
|
1852
|
-
exemptedFromRegistrationNumber: exemptFromRegistrationNumberDefaultFieldMetadata.validators,
|
|
1853
|
-
taxInformation: resolveFieldMetadata(
|
|
1854
|
-
taxInformationDefaultFieldConfig[country],
|
|
1855
|
-
{
|
|
1856
|
-
taxIdNumberType,
|
|
1857
|
-
companyType
|
|
1858
|
-
},
|
|
1859
|
-
taxInformationDefaultFieldMetadata
|
|
1860
|
-
).validators,
|
|
1861
|
-
vatNumber: resolveFieldMetadata(
|
|
1862
|
-
defaultFieldConfig[country],
|
|
1863
|
-
{ vatNumberType },
|
|
1864
|
-
defaultFieldMetadata
|
|
1865
|
-
).validators,
|
|
1866
|
-
vatAbsenceReason: vatAbsenceReasonMetadata.validators,
|
|
1867
|
-
eInvoicingCode: eInvoicingCodeFieldMetadata.validators,
|
|
1868
|
-
industryCodes: industryCodeFieldMetadata.validators,
|
|
1869
|
-
dateOfIncorporation: dateOfIncorporationFieldMetadata.validators,
|
|
1870
|
-
stockExchangeMIC: stockExchangeMICFieldMetadata.validators,
|
|
1871
|
-
stockISIN: stockISINFieldMetadata.validators,
|
|
1872
|
-
stockTickerSymbol: stockTickerSymbolFieldMetadata.validators
|
|
1873
|
-
};
|
|
1874
|
-
}
|
|
1875
|
-
function BusinessDetailsDropin({
|
|
1876
|
-
taskType,
|
|
1877
|
-
country: propCountry,
|
|
1878
|
-
problems: propProblems,
|
|
1879
|
-
legalEntityResponse,
|
|
1880
|
-
efpBusinessLines,
|
|
1881
|
-
documents,
|
|
1882
|
-
associatedLegalArrangement,
|
|
1883
|
-
// initially undefined when creating entity
|
|
1884
|
-
nestedLegalEntity,
|
|
1885
|
-
// initially undefined when creating entity
|
|
1886
|
-
nestedLegalEntityDetails,
|
|
1887
|
-
// has entity roles for association logic
|
|
1888
|
-
onSubmit: onExternalSubmit,
|
|
1889
|
-
handleHomeClick,
|
|
1890
|
-
asModal = false
|
|
1891
|
-
}) {
|
|
1892
|
-
const { t, i18n } = useTranslation(["common", "business"]);
|
|
1893
|
-
const { baseUrl, rootLegalEntityId } = useApiContext();
|
|
1894
|
-
const userEvents = useAnalyticsContext();
|
|
1895
|
-
const { showToast } = useToastContext();
|
|
1896
|
-
const queryClient = useQueryClient();
|
|
1897
|
-
const { isExperimentEnabled } = useExperimentsContext();
|
|
1898
|
-
const { data: versionData } = useVersionConfiguration();
|
|
1899
|
-
const { isSettingEnabled } = useSettingsContext();
|
|
1900
|
-
const { accountHolder, setAccountHolder } = useAccountHolder();
|
|
1901
|
-
const { mutateAsync: createLegalEntity } = useCreateLegalEntity();
|
|
1902
|
-
const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
|
|
1903
|
-
const logger = createLogger();
|
|
1904
|
-
const isSoleProp = accountHolder === "mySoleProprietorName";
|
|
1905
|
-
const isAssociationTaskType = taskType !== TaskTypes.BUSINESS_DETAILS;
|
|
1906
|
-
const legalEntityType = !isSoleProp ? LegalEntityTypes.ORGANIZATION : LegalEntityTypes.SOLE_PROPRIETORSHIP;
|
|
1907
|
-
const subjectEntity = !isAssociationTaskType ? legalEntityResponse : isSoleProp ? associatedLegalArrangement : nestedLegalEntity;
|
|
1908
|
-
const [country, setCountry] = useState(propCountry);
|
|
1909
|
-
const [problems, setProblems] = useState(propProblems ?? {});
|
|
1910
|
-
const [loadingStatus, setLoadingStatus] = useState("success");
|
|
1911
|
-
const [derivedProps, setDerivedProps] = useState();
|
|
1912
|
-
const [trustedFields, setTrustedFields] = useState(subjectEntity?.trustedFields ?? void 0);
|
|
1913
|
-
const defaultForms = useMemo(() => getForms(country), [country]);
|
|
1914
|
-
const documentUtils = documentApiUtils({
|
|
1915
|
-
baseUrl: baseUrl.value,
|
|
1916
|
-
rootLegalEntityId: rootLegalEntityId.value
|
|
1917
|
-
});
|
|
1918
|
-
useEffect(() => {
|
|
1919
|
-
userEvents.updateBaseTrackingPayload({ task: taskType });
|
|
1920
|
-
userEvents.addTaskEvent("Landed on page", {
|
|
1921
|
-
actionType: "start"
|
|
1922
|
-
});
|
|
1923
|
-
}, []);
|
|
1924
|
-
const parseConfiguration = useCallback(
|
|
1925
|
-
({ scenarios }) => composePerScenarioFormConfigurations(scenarios, businessDetailsFieldsPerScenario),
|
|
1926
|
-
[]
|
|
1927
|
-
);
|
|
1928
|
-
const { fieldConfigurations } = useScenarioConfiguration({
|
|
1929
|
-
legalEntityType,
|
|
1930
|
-
parseConfiguration,
|
|
1931
|
-
setLoadingStatus,
|
|
1932
|
-
country
|
|
1933
|
-
});
|
|
1934
|
-
const defaultData = useMemo(() => {
|
|
1935
|
-
const mapped = mapLegalEntityToBusinessDetailsSchema(
|
|
1936
|
-
!isAssociationTaskType ? legalEntityResponse : isSoleProp ? associatedLegalArrangement ?? legalEntityResponse : nestedLegalEntity,
|
|
1937
|
-
isSoleProp ? legalEntityResponse : void 0
|
|
1938
|
-
);
|
|
1939
|
-
const initialEfpBusinessLineData = isSettingEnabled("allowBusinessLines") && efpBusinessLines && efpBusinessLines.length > 0 ? {
|
|
1940
|
-
additionalInformation: {
|
|
1941
|
-
...mapped.additionalInformation,
|
|
1942
|
-
industryCodes: [
|
|
1943
|
-
{
|
|
1944
|
-
id: efpBusinessLines[0].industryCode,
|
|
1945
|
-
name: `${efpBusinessLines[0].industryCode} - ${efpBusinessLines[0].industryCodeDescription}`
|
|
1946
|
-
}
|
|
1947
|
-
]
|
|
1948
|
-
}
|
|
1949
|
-
} : {};
|
|
1950
|
-
return {
|
|
1951
|
-
...mapped,
|
|
1952
|
-
...documents,
|
|
1953
|
-
...initialEfpBusinessLineData
|
|
1954
|
-
};
|
|
1955
|
-
}, [
|
|
1956
|
-
isAssociationTaskType,
|
|
1957
|
-
legalEntityResponse,
|
|
1958
|
-
isSoleProp,
|
|
1959
|
-
associatedLegalArrangement,
|
|
1960
|
-
nestedLegalEntity,
|
|
1961
|
-
documents,
|
|
1962
|
-
efpBusinessLines,
|
|
1963
|
-
isSettingEnabled
|
|
1964
|
-
]);
|
|
1965
|
-
const buildFieldValidations = useCallback(
|
|
1966
|
-
(data) => {
|
|
1967
|
-
const taxInfo = data?.basicInformation?.taxInformation ?? data?.additionalInformation?.taxInformation;
|
|
1968
|
-
const taxIdType = taxInfo?.length ? taxInfo.find((taxId) => taxId.country === country)?.type : void 0;
|
|
1969
|
-
const regNumberType = data?.basicInformation?.registrationNumberType ?? data?.additionalInformation?.registrationNumberType;
|
|
1970
|
-
const companyType = taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY ? CompanyTypesValues.SOLE_PROPRIETORSHIP : data?.companyStructure?.entityType;
|
|
1971
|
-
return {
|
|
1972
|
-
basicInformation: basicInformationValidators({
|
|
1973
|
-
country,
|
|
1974
|
-
state: data?.basicInformation?.stateOrProvince,
|
|
1975
|
-
companyType,
|
|
1976
|
-
taxIdNumberType: taxIdType,
|
|
1977
|
-
registrationNumberType: regNumberType,
|
|
1978
|
-
isExperimentEnabled
|
|
1979
|
-
}),
|
|
1980
|
-
businessSelection: businessSelectionValidators(),
|
|
1981
|
-
companyStructure: CompanyStructureValidation,
|
|
1982
|
-
additionalInformation: additionalInformationValidators({
|
|
1983
|
-
country,
|
|
1984
|
-
taxIdNumberType: taxIdType,
|
|
1985
|
-
companyType,
|
|
1986
|
-
registrationNumberType: regNumberType,
|
|
1987
|
-
vatNumberType: data?.additionalInformation?.vatNumberType,
|
|
1988
|
-
isExperimentEnabled
|
|
1989
|
-
}),
|
|
1990
|
-
financialInformation: financialInfoValidationWithEmployeesRules
|
|
1991
|
-
};
|
|
1992
|
-
},
|
|
1993
|
-
[country, isExperimentEnabled, taskType]
|
|
1994
|
-
);
|
|
1995
|
-
const multiForm = useMultiForm({
|
|
1996
|
-
defaultData,
|
|
1997
|
-
allFields: derivedProps?.allFields,
|
|
1998
|
-
requiredFields: derivedProps?.requiredFields,
|
|
1999
|
-
optionalFields: derivedProps?.optionalFields,
|
|
2000
|
-
obscuredFields: derivedProps?.obscuredFields,
|
|
2001
|
-
trustedFields: derivedProps?.trustedFields,
|
|
2002
|
-
rules: buildFieldValidations
|
|
2003
|
-
});
|
|
2004
|
-
const isTinMatched = tinMatched.value;
|
|
2005
|
-
const customRules = useMemo(
|
|
2006
|
-
() => rules({
|
|
2007
|
-
data: multiForm.data,
|
|
2008
|
-
country,
|
|
2009
|
-
taskType,
|
|
2010
|
-
isExperimentEnabled,
|
|
2011
|
-
isSettingEnabled,
|
|
2012
|
-
accountHolder,
|
|
2013
|
-
tinMatched: isTinMatched,
|
|
2014
|
-
rootLegalEntity: legalEntityResponse,
|
|
2015
|
-
version: versionData?.version
|
|
2016
|
-
}),
|
|
2017
|
-
[
|
|
2018
|
-
multiForm.data,
|
|
2019
|
-
country,
|
|
2020
|
-
taskType,
|
|
2021
|
-
isExperimentEnabled,
|
|
2022
|
-
isSettingEnabled,
|
|
2023
|
-
accountHolder,
|
|
2024
|
-
isTinMatched,
|
|
2025
|
-
legalEntityResponse,
|
|
2026
|
-
versionData?.version
|
|
2027
|
-
]
|
|
2028
|
-
);
|
|
2029
|
-
useEffect(() => {
|
|
2030
|
-
const props = getPropsFromConfigurations({
|
|
2031
|
-
scenarioConfiguration: fieldConfigurations,
|
|
2032
|
-
forms: defaultForms,
|
|
2033
|
-
remediationActions: problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
|
|
2034
|
-
dataMissingErrors: problems?.missingData ?? [],
|
|
2035
|
-
fieldsWithExistingData: subjectEntity ? subjectEntity.type === LegalEntityTypes.SOLE_PROPRIETORSHIP ? getFieldsWithExistingData(
|
|
2036
|
-
subjectEntity,
|
|
2037
|
-
solePropBusinessDetailsApiKeyMapping,
|
|
2038
|
-
solePropBusinessDetailsDocumentMapping
|
|
2039
|
-
) : getFieldsWithExistingData(
|
|
2040
|
-
subjectEntity,
|
|
2041
|
-
businessDetailsApiKeyMapping,
|
|
2042
|
-
businessDetailsDocumentMapping
|
|
2043
|
-
) : [],
|
|
2044
|
-
customRules,
|
|
2045
|
-
legalEntityType: subjectEntity?.type,
|
|
2046
|
-
legalEntityTrustedFields: trustedFields
|
|
2047
|
-
});
|
|
2048
|
-
setDerivedProps(props);
|
|
2049
|
-
}, [
|
|
2050
|
-
customRules,
|
|
2051
|
-
defaultForms,
|
|
2052
|
-
subjectEntity,
|
|
2053
|
-
problems?.missingData,
|
|
2054
|
-
problems?.remediationActions,
|
|
2055
|
-
trustedFields,
|
|
2056
|
-
fieldConfigurations
|
|
2057
|
-
]);
|
|
2058
|
-
const [prevCountry, setPrevCountry] = useState(multiForm.data.basicInformation?.country);
|
|
2059
|
-
if (multiForm.data.basicInformation?.country && prevCountry !== multiForm.data.basicInformation?.country) {
|
|
2060
|
-
setCountry(multiForm.data?.basicInformation?.country);
|
|
2061
|
-
setPrevCountry(multiForm.data.basicInformation?.country);
|
|
2062
|
-
setTrustedFields(void 0);
|
|
2063
|
-
verifiedBusiness.value = void 0;
|
|
2064
|
-
tinMatched.value = void 0;
|
|
2065
|
-
businessMismatchModalOpen.value = false;
|
|
2066
|
-
}
|
|
2067
|
-
const [forms, setForms] = useState(
|
|
2068
|
-
buildRequiredForms({
|
|
2069
|
-
config: {
|
|
2070
|
-
forms: defaultForms,
|
|
2071
|
-
requiredFields: derivedProps?.requiredFields,
|
|
2072
|
-
optionalFields: derivedProps?.optionalFields,
|
|
2073
|
-
isValid: multiForm.isValid ?? {},
|
|
2074
|
-
problems,
|
|
2075
|
-
isSettingEnabled,
|
|
2076
|
-
accountHolder,
|
|
2077
|
-
legalEntityResponse
|
|
2078
|
-
},
|
|
2079
|
-
options: {
|
|
2080
|
-
hasNoSearchResults: false
|
|
2081
|
-
}
|
|
2082
|
-
})
|
|
2083
|
-
);
|
|
2084
|
-
const updateForms = useCallback(
|
|
2085
|
-
({ searchResults }) => {
|
|
2086
|
-
const updatedForms = buildRequiredForms({
|
|
2087
|
-
config: {
|
|
2088
|
-
forms: defaultForms,
|
|
2089
|
-
requiredFields: derivedProps?.requiredFields,
|
|
2090
|
-
optionalFields: derivedProps?.optionalFields,
|
|
2091
|
-
isValid: multiForm.isValid ?? {},
|
|
2092
|
-
problems,
|
|
2093
|
-
isSettingEnabled,
|
|
2094
|
-
accountHolder,
|
|
2095
|
-
legalEntityResponse
|
|
2096
|
-
},
|
|
2097
|
-
options: {
|
|
2098
|
-
hasNoSearchResults: searchResults && !searchResults.length
|
|
2099
|
-
}
|
|
2100
|
-
});
|
|
2101
|
-
setForms(updatedForms);
|
|
2102
|
-
return updatedForms;
|
|
2103
|
-
},
|
|
2104
|
-
[
|
|
2105
|
-
defaultForms,
|
|
2106
|
-
derivedProps?.optionalFields,
|
|
2107
|
-
derivedProps?.requiredFields,
|
|
2108
|
-
multiForm.isValid,
|
|
2109
|
-
problems,
|
|
2110
|
-
isSettingEnabled,
|
|
2111
|
-
accountHolder,
|
|
2112
|
-
legalEntityResponse
|
|
2113
|
-
]
|
|
2114
|
-
);
|
|
2115
|
-
const summaryData = useMemo(
|
|
2116
|
-
() => formatDataForSummary(multiForm.data, forms, t, i18n.language, isExperimentEnabled),
|
|
2117
|
-
[multiForm.data, forms, t, i18n.language, isExperimentEnabled]
|
|
2118
|
-
);
|
|
2119
|
-
const { mutateAsync: createBusinessLine } = useCreateBusinessLine();
|
|
2120
|
-
const { mutateAsync: updateBusinessLine } = useUpdateBusinessLine();
|
|
2121
|
-
const submitTask = useCallback(() => {
|
|
2122
|
-
setAccountHolder(accountHolder);
|
|
2123
|
-
return submit({
|
|
2124
|
-
data: multiForm.data,
|
|
2125
|
-
legalEntityResponse,
|
|
2126
|
-
associatedLegalArrangement,
|
|
2127
|
-
nestedLegalEntity,
|
|
2128
|
-
nestedLegalEntityDetails,
|
|
2129
|
-
problems,
|
|
2130
|
-
taskType,
|
|
2131
|
-
accountHolder: accountHolder ?? "theCompanyIWorkFor",
|
|
2132
|
-
forms,
|
|
2133
|
-
documentUtils,
|
|
2134
|
-
t,
|
|
2135
|
-
showToast,
|
|
2136
|
-
setLoadingStatus,
|
|
2137
|
-
setProblems,
|
|
2138
|
-
handleUpdateLegalEntity: updateLegalEntity,
|
|
2139
|
-
createLegalEntity,
|
|
2140
|
-
onExternalSubmit,
|
|
2141
|
-
isExperimentEnabled,
|
|
2142
|
-
userEvents,
|
|
2143
|
-
efpBusinessLines,
|
|
2144
|
-
createBusinessLine,
|
|
2145
|
-
updateBusinessLine
|
|
2146
|
-
});
|
|
2147
|
-
}, [
|
|
2148
|
-
setAccountHolder,
|
|
2149
|
-
accountHolder,
|
|
2150
|
-
multiForm.data,
|
|
2151
|
-
legalEntityResponse,
|
|
2152
|
-
associatedLegalArrangement,
|
|
2153
|
-
nestedLegalEntity,
|
|
2154
|
-
nestedLegalEntityDetails,
|
|
2155
|
-
problems,
|
|
2156
|
-
taskType,
|
|
2157
|
-
forms,
|
|
2158
|
-
documentUtils,
|
|
2159
|
-
t,
|
|
2160
|
-
showToast,
|
|
2161
|
-
updateLegalEntity,
|
|
2162
|
-
createLegalEntity,
|
|
2163
|
-
onExternalSubmit,
|
|
2164
|
-
isExperimentEnabled,
|
|
2165
|
-
userEvents,
|
|
2166
|
-
efpBusinessLines,
|
|
2167
|
-
createBusinessLine,
|
|
2168
|
-
updateBusinessLine
|
|
2169
|
-
]);
|
|
2170
|
-
const {
|
|
2171
|
-
handleNextClick,
|
|
2172
|
-
handleBackClick,
|
|
2173
|
-
activeForm,
|
|
2174
|
-
shouldValidate,
|
|
2175
|
-
gotoFormByFormIndex,
|
|
2176
|
-
steps
|
|
2177
|
-
} = useFormComposer({
|
|
2178
|
-
problems,
|
|
2179
|
-
forms,
|
|
2180
|
-
onSubmit: submitTask,
|
|
2181
|
-
triggerValidation: multiForm.triggerValidation
|
|
2182
|
-
});
|
|
2183
|
-
const handleBusinessMismatchContinue = () => {
|
|
2184
|
-
setTrustedFields([]);
|
|
2185
|
-
businessMismatchModalOpen.value = false;
|
|
2186
|
-
handleNextClick();
|
|
2187
|
-
};
|
|
2188
|
-
const handleBusinessMismatchCancel = () => {
|
|
2189
|
-
handleBackClick?.();
|
|
2190
|
-
businessMismatchModalOpen.value = false;
|
|
2191
|
-
tinMatched.value = false;
|
|
2192
|
-
};
|
|
2193
|
-
const companySearchQueryInput = {
|
|
2194
|
-
name: multiForm.data?.basicInformation?.legalCompanyName ?? "",
|
|
2195
|
-
country: multiForm.data?.basicInformation?.country,
|
|
2196
|
-
state: multiForm.data?.basicInformation?.stateOrProvince,
|
|
2197
|
-
registrationNumber: multiForm.data?.basicInformation?.registrationNumber
|
|
2198
|
-
};
|
|
2199
|
-
const verifyTinQueryInput = {
|
|
2200
|
-
name: multiForm.data.basicInformation?.legalCompanyName ?? "",
|
|
2201
|
-
tin: multiForm.data?.basicInformation?.taxInformation?.find((taxId) => taxId.country === country)?.number ?? ""
|
|
2202
|
-
};
|
|
2203
|
-
const {
|
|
2204
|
-
data: companySearchResponse,
|
|
2205
|
-
isLoading: searchingCompanies,
|
|
2206
|
-
isError: searchingError
|
|
2207
|
-
} = useCompanySearch(companySearchQueryInput, {
|
|
2208
|
-
enabled: false
|
|
2209
|
-
});
|
|
2210
|
-
useEffect(() => {
|
|
2211
|
-
if (!searchingCompanies && companySearchResponse?.results) {
|
|
2212
|
-
userEvents.addPageEvent("Success", {
|
|
2213
|
-
actionType: "submit",
|
|
2214
|
-
returnValue: "companySearch",
|
|
2215
|
-
additionalData: {
|
|
2216
|
-
numberOfResults: companySearchResponse?.results.length
|
|
2217
|
-
}
|
|
2218
|
-
});
|
|
2219
|
-
}
|
|
2220
|
-
}, [searchingCompanies, userEvents, subjectEntity, companySearchResponse?.results]);
|
|
2221
|
-
const companySelectionInput = {
|
|
2222
|
-
company: companySearchResponse?.results[0],
|
|
2223
|
-
state: multiForm.data.basicInformation?.stateOrProvince,
|
|
2224
|
-
name: multiForm.data?.basicInformation?.legalCompanyName ?? "",
|
|
2225
|
-
tin: multiForm.data?.basicInformation?.taxInformation?.find((taxId) => taxId.country === country)?.number ?? ""
|
|
2226
|
-
};
|
|
2227
|
-
useVerifyTin(verifyTinQueryInput, { enabled: false });
|
|
2228
|
-
const attemptBusinessSearch = async () => {
|
|
2229
|
-
if (customRules.countryUsingCompanySearch() !== "REQUIRED") {
|
|
2230
|
-
const currentForms = updateForms({ searchResults: [] });
|
|
2231
|
-
return handleNextClick(currentForms);
|
|
2232
|
-
}
|
|
2233
|
-
try {
|
|
2234
|
-
setLoadingStatus("loading");
|
|
2235
|
-
tinMatched.value = void 0;
|
|
2236
|
-
verifiedBusiness.value = void 0;
|
|
2237
|
-
isVerifiedSingleCompanySearchResult.value = false;
|
|
2238
|
-
const searchResponse = await queryClient.fetchQuery({
|
|
2239
|
-
queryKey: ["companySearch", companySearchQueryInput]
|
|
2240
|
-
});
|
|
2241
|
-
let currentForms = updateForms({ searchResults: searchResponse.results });
|
|
2242
|
-
const handleTinResponse = (matched) => {
|
|
2243
|
-
if (matched) {
|
|
2244
|
-
tinMatched.value = true;
|
|
2245
|
-
} else {
|
|
2246
|
-
businessMismatchModalOpen.value = true;
|
|
2247
|
-
tinMatched.value = false;
|
|
2248
|
-
}
|
|
2249
|
-
return tinMatched.value;
|
|
2250
|
-
};
|
|
2251
|
-
if (searchResponse?.results.length === 1 && isNormalizedStringMatch(
|
|
2252
|
-
multiForm.data?.basicInformation?.legalCompanyName ?? "",
|
|
2253
|
-
searchResponse.results[0].name
|
|
2254
|
-
)) {
|
|
2255
|
-
const companySelectionResponse = await handleCompanySelection(
|
|
2256
|
-
rootLegalEntityId.value,
|
|
2257
|
-
baseUrl.value,
|
|
2258
|
-
{ ...companySelectionInput, company: searchResponse.results[0] }
|
|
2259
|
-
);
|
|
2260
|
-
if (handleTinResponse(!!companySelectionResponse.tinMatched)) {
|
|
2261
|
-
verifiedBusiness.value = companySelectionResponse;
|
|
2262
|
-
isVerifiedSingleCompanySearchResult.value = true;
|
|
2263
|
-
applyVerifiedBusinessData(multiForm, country, verifiedBusiness.value);
|
|
2264
|
-
currentForms = updateForms({ searchResults: searchResponse.results });
|
|
2265
|
-
} else {
|
|
2266
|
-
return setLoadingStatus("success");
|
|
2267
|
-
}
|
|
2268
|
-
}
|
|
2269
|
-
if (!searchResponse.results.length) {
|
|
2270
|
-
const tinVerificationResponse = await queryClient.fetchQuery({
|
|
2271
|
-
queryKey: ["verifyTin", verifyTinQueryInput]
|
|
2272
|
-
});
|
|
2273
|
-
if (!handleTinResponse(!!tinVerificationResponse?.matched)) {
|
|
2274
|
-
return setLoadingStatus("success");
|
|
2275
|
-
}
|
|
2276
|
-
}
|
|
2277
|
-
setLoadingStatus("success");
|
|
2278
|
-
return handleNextClick(currentForms);
|
|
2279
|
-
} catch (e) {
|
|
2280
|
-
logger.error(e);
|
|
2281
|
-
setLoadingStatus("error");
|
|
2282
|
-
const currentForms = updateForms({ searchResults: [] });
|
|
2283
|
-
return handleNextClick(currentForms);
|
|
2284
|
-
}
|
|
2285
|
-
};
|
|
2286
|
-
const overrideNextClick = async () => {
|
|
2287
|
-
if (!activeForm.isValid) return handleNextClick();
|
|
2288
|
-
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(country) || isSoleProp) {
|
|
2289
|
-
return handleNextClick();
|
|
2290
|
-
}
|
|
2291
|
-
switch (activeForm.formId) {
|
|
2292
|
-
case "basicInformation": {
|
|
2293
|
-
return await attemptBusinessSearch();
|
|
2294
|
-
}
|
|
2295
|
-
case "businessSelection": {
|
|
2296
|
-
const currentForms = updateForms({
|
|
2297
|
-
searchResults: companySearchResponse?.results
|
|
2298
|
-
});
|
|
2299
|
-
return handleNextClick(currentForms);
|
|
2300
|
-
}
|
|
2301
|
-
default:
|
|
2302
|
-
return handleNextClick();
|
|
2303
|
-
}
|
|
2304
|
-
};
|
|
2305
|
-
useEffect(() => {
|
|
2306
|
-
updateForms({
|
|
2307
|
-
searchResults: searchingError ? [] : companySearchResponse?.results
|
|
2308
|
-
});
|
|
2309
|
-
}, [updateForms, companySearchResponse?.results, searchingError]);
|
|
2310
|
-
return /* @__PURE__ */ jsx(FormContextProvider, { form: multiForm, children: /* @__PURE__ */ jsxs(
|
|
2311
|
-
FormFlow,
|
|
2312
|
-
{
|
|
2313
|
-
summary: {
|
|
2314
|
-
data: summaryData,
|
|
2315
|
-
omitted: {
|
|
2316
|
-
keys: ["operationalAddressIsSame"],
|
|
2317
|
-
forms: ["businessSelection"]
|
|
2318
|
-
},
|
|
2319
|
-
problems,
|
|
2320
|
-
showLegalCaption: true
|
|
2321
|
-
},
|
|
2322
|
-
asModal,
|
|
2323
|
-
currentStep: steps.current,
|
|
2324
|
-
totalSteps: steps.total,
|
|
2325
|
-
forms,
|
|
2326
|
-
activeForm,
|
|
2327
|
-
disableNextButton: activeForm.formId === "businessSelection",
|
|
2328
|
-
gotoFormByFormIndex,
|
|
2329
|
-
handleNextClick: overrideNextClick,
|
|
2330
|
-
handleBackClick,
|
|
2331
|
-
handleCancelClick: handleHomeClick,
|
|
2332
|
-
loadingStatus,
|
|
2333
|
-
children: [
|
|
2334
|
-
/* @__PURE__ */ jsx(
|
|
2335
|
-
BusinessDetailsMultiform,
|
|
2336
|
-
{
|
|
2337
|
-
taskType,
|
|
2338
|
-
activeForm,
|
|
2339
|
-
country,
|
|
2340
|
-
shouldValidate,
|
|
2341
|
-
problems,
|
|
2342
|
-
handleNextClick: overrideNextClick,
|
|
2343
|
-
handleBackClick,
|
|
2344
|
-
setLoadingStatus,
|
|
2345
|
-
isTopLevelEntity: taskType === TaskTypes.BUSINESS_DETAILS
|
|
2346
|
-
}
|
|
2347
|
-
),
|
|
2348
|
-
businessMismatchModalOpen.value && /* @__PURE__ */ jsx(
|
|
2349
|
-
Confirm,
|
|
2350
|
-
{
|
|
2351
|
-
title: t(($) => $["businessSelection__tinVerificationFailureModalHeader"], {
|
|
2352
|
-
ns: "business"
|
|
2353
|
-
}),
|
|
2354
|
-
description: t(($) => $["businessSelection__tinVerificationFailureModalContent"], {
|
|
2355
|
-
ns: "business"
|
|
2356
|
-
}),
|
|
2357
|
-
cancelText: t(
|
|
2358
|
-
($) => $["businessSelection__tinVerificationFailureModalSecondaryButton"],
|
|
2359
|
-
{ ns: "business" }
|
|
2360
|
-
),
|
|
2361
|
-
confirmText: t(
|
|
2362
|
-
($) => $["businessSelection__tinVerificationFailureModalPrimaryButton"],
|
|
2363
|
-
{ ns: "business" }
|
|
2364
|
-
),
|
|
2365
|
-
onCancel: handleBusinessMismatchCancel,
|
|
2366
|
-
onConfirm: handleBusinessMismatchContinue,
|
|
2367
|
-
analyticsEventLabel: "tinVerificationFailureModal"
|
|
2368
|
-
}
|
|
2369
|
-
)
|
|
2370
|
-
]
|
|
2371
|
-
}
|
|
2372
|
-
) });
|
|
2373
|
-
}
|
|
2374
|
-
const useDocuments = (documentDetails, entityId, options) => {
|
|
2375
|
-
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
2376
|
-
const documentUtils = documentApiUtils({
|
|
2377
|
-
baseUrl: baseUrl.value,
|
|
2378
|
-
rootLegalEntityId: rootLegalEntityId.value
|
|
2379
|
-
});
|
|
2380
|
-
const documentDetailsKey = (documentDetails || []).map((details) => details.id).sort((a, b) => a.localeCompare(b)).join(",");
|
|
2381
|
-
return useQuery({
|
|
2382
|
-
queryKey: ["documents", documentDetailsKey, entityId + ""],
|
|
2383
|
-
queryFn: () => documentUtils.fetchDocuments(documentDetails, entityId),
|
|
2384
|
-
retry: 0,
|
|
2385
|
-
...options
|
|
2386
|
-
});
|
|
2387
|
-
};
|
|
2388
|
-
function useBusinessDetailsData(taskType, associatedLegalArrangement, nestedLegalEntity) {
|
|
2389
|
-
const { t } = useTranslation(["common"]);
|
|
2390
|
-
const { data: rootLe } = useLegalEntity(ROOT_LE);
|
|
2391
|
-
const { accountHolder } = useAccountHolder();
|
|
2392
|
-
const { showToast } = useToastContext();
|
|
2393
|
-
const { isSettingEnabled } = useSettingsContext();
|
|
2394
|
-
const { data: efpBusinessLines, isLoading: fetchingEfpBusinessLines } = useBusinessLines(
|
|
2395
|
-
ALLOWED_SOF_SERVICES,
|
|
2396
|
-
{
|
|
2397
|
-
enabled: isSettingEnabled("allowBusinessLines")
|
|
2398
|
-
}
|
|
2399
|
-
);
|
|
2400
|
-
const isSoleProp = accountHolder === "mySoleProprietorName";
|
|
2401
|
-
const isAssociationTaskType = taskType !== TaskTypes.BUSINESS_DETAILS;
|
|
2402
|
-
const subjectEntity = !isAssociationTaskType ? rootLe : isSoleProp ? associatedLegalArrangement : nestedLegalEntity;
|
|
2403
|
-
const { isLoading: fetchingDocuments, isError } = useDocuments(
|
|
2404
|
-
subjectEntity?.documentDetails || [],
|
|
2405
|
-
subjectEntity?.id || "",
|
|
2406
|
-
{
|
|
2407
|
-
enabled: subjectEntity?.documentDetails && subjectEntity?.documentDetails.length > 0
|
|
2408
|
-
}
|
|
2409
|
-
);
|
|
2410
|
-
useEffect(() => {
|
|
2411
|
-
if (isError) {
|
|
2412
|
-
showToast({
|
|
2413
|
-
label: t(($) => $["failedToFetchRelevantDocuments"], { ns: "common" }),
|
|
2414
|
-
variant: "error"
|
|
2415
|
-
});
|
|
2416
|
-
}
|
|
2417
|
-
}, [isError, showToast, t]);
|
|
2418
|
-
let mappedDocs;
|
|
2419
|
-
if (subjectEntity?.id) {
|
|
2420
|
-
mappedDocs = mapApiDocumentToBusinessDetailsDocuments(subjectEntity.id);
|
|
2421
|
-
}
|
|
2422
|
-
return rootLe && !fetchingEfpBusinessLines && !fetchingDocuments ? {
|
|
2423
|
-
data: {
|
|
2424
|
-
rootLe,
|
|
2425
|
-
efpBusinessLines,
|
|
2426
|
-
documents: mappedDocs
|
|
2427
|
-
},
|
|
2428
|
-
isLoading: false
|
|
2429
|
-
} : {
|
|
2430
|
-
data: {
|
|
2431
|
-
rootLe,
|
|
2432
|
-
efpBusinessLines,
|
|
2433
|
-
documents: mappedDocs
|
|
2434
|
-
},
|
|
2435
|
-
isLoading: true
|
|
2436
|
-
};
|
|
2437
|
-
}
|
|
2438
|
-
export {
|
|
2439
|
-
BusinessDetailsDropin as B,
|
|
2440
|
-
useBusinessDetailsData as u
|
|
2441
|
-
};
|