@adyen/kyc-components 2.54.0 → 2.54.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/adyen-kyc-components.es.js +136 -114
- package/dist/types/components/BasicInformation/component/BasicInformationComponent.d.ts +1 -1
- package/dist/types/components/BasicInformation/types.d.ts +4 -4
- package/dist/types/components/BusinessDetails/types.d.ts +4 -4
- package/dist/types/components/BusinessSelection/BusinessInformationCard.d.ts +4 -3
- package/dist/types/components/BusinessSelection/component/BusinessSelectionComponent.d.ts +1 -1
- package/dist/types/components/BusinessSelection/types.d.ts +4 -4
- package/dist/types/components/Dropins/BusinessDetailsDropin/components/BusinessDetailsDropinComponent.d.ts +1 -1
- package/dist/types/components/Dropins/BusinessDetailsDropin/types.d.ts +2 -2
- package/dist/types/components/Dropins/BusinessDetailsDropin/utils.d.ts +1 -1
- package/dist/types/components/Dropins/CompanySearchDropin/components/CompanySearchDropinComponent.d.ts +1 -1
- package/dist/types/components/Dropins/CompanySearchDropin/types.d.ts +0 -2
- package/dist/types/core/hooks/useBusinessData/types.d.ts +4 -4
- package/dist/types/core/hooks/useCompanySearchTaskSubmit.d.ts +3 -1
- package/package.json +1 -1
|
@@ -204,6 +204,7 @@ const defaultTrans = {
|
|
|
204
204
|
businessSelection__footerButton: "Add details manually",
|
|
205
205
|
businessSelection__heading: "Select your business",
|
|
206
206
|
businessSelection__invalidTin: "This company's TIN doesn't match yours",
|
|
207
|
+
businessSelection__tinVerificationFailure: "Sorry, something went wrong. Try again or continue by pressing Add details manually",
|
|
207
208
|
businessStructure: "Business structure",
|
|
208
209
|
businessTrust: "Business trust",
|
|
209
210
|
businessTrusteeDetails: "Business trustee details",
|
|
@@ -1654,6 +1655,12 @@ function useToastContext() {
|
|
|
1654
1655
|
}
|
|
1655
1656
|
return context;
|
|
1656
1657
|
}
|
|
1658
|
+
const CoreContext = createContext(void 0);
|
|
1659
|
+
const useCoreContext = () => {
|
|
1660
|
+
const context = useContext(CoreContext);
|
|
1661
|
+
if (!context) throw Error("You need a <CoreProvider> to use core context");
|
|
1662
|
+
return context;
|
|
1663
|
+
};
|
|
1657
1664
|
let suppressed = false;
|
|
1658
1665
|
const consoleMethodsPrefixable = Object.freeze(["debug", "info", "log", "warn", "error", "trace"]);
|
|
1659
1666
|
const stringSubstitutionRegex = /%([soOc]|(\.\d)?[dif])/;
|
|
@@ -2008,10 +2015,10 @@ function useBusinessData({
|
|
|
2008
2015
|
handleVerifyTin,
|
|
2009
2016
|
handleClearCompanyData
|
|
2010
2017
|
}) {
|
|
2011
|
-
const [
|
|
2012
|
-
const [
|
|
2013
|
-
const [
|
|
2014
|
-
const [
|
|
2018
|
+
const [searching, setSearching] = useState("idle");
|
|
2019
|
+
const [fetching, setFetching] = useState("idle");
|
|
2020
|
+
const [verifying, setVerifying] = useState("idle");
|
|
2021
|
+
const [resettingTrustedData, setResettingTrustedData] = useState("idle");
|
|
2015
2022
|
const [searchResults, setSearchResults] = useState();
|
|
2016
2023
|
const [cachedSearch, setCachedSearch] = useState();
|
|
2017
2024
|
const [cachedBusiness, setCachedBusiness] = useState();
|
|
@@ -2024,7 +2031,7 @@ function useBusinessData({
|
|
|
2024
2031
|
}
|
|
2025
2032
|
if (searchResults && objectsDeepEqual(cachedSearch, data)) return;
|
|
2026
2033
|
try {
|
|
2027
|
-
|
|
2034
|
+
setSearching("loading");
|
|
2028
2035
|
const {
|
|
2029
2036
|
results
|
|
2030
2037
|
} = KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS.includes(data.state) ? await handleCompanyIndexSearch({
|
|
@@ -2037,11 +2044,11 @@ function useBusinessData({
|
|
|
2037
2044
|
setSearchResults(results);
|
|
2038
2045
|
return results;
|
|
2039
2046
|
} catch (e) {
|
|
2040
|
-
|
|
2047
|
+
setSearching("error");
|
|
2041
2048
|
logger$E.error(e);
|
|
2042
2049
|
} finally {
|
|
2043
2050
|
setCachedSearch(data);
|
|
2044
|
-
|
|
2051
|
+
setSearching((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2045
2052
|
}
|
|
2046
2053
|
}, [handleCompanyDeepSearch, handleCompanyIndexSearch, searchResults, cachedSearch]);
|
|
2047
2054
|
const fetchBusinessData = useCallback(async (company) => {
|
|
@@ -2059,7 +2066,8 @@ function useBusinessData({
|
|
|
2059
2066
|
const date = (/* @__PURE__ */ new Date()).toDateString();
|
|
2060
2067
|
const isDataCompliant = company.lastUpdate ? Date.parse(date) - Date.parse(company.lastUpdate) < LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW : false;
|
|
2061
2068
|
try {
|
|
2062
|
-
|
|
2069
|
+
setFetching("loading");
|
|
2070
|
+
setVerifying("idle");
|
|
2063
2071
|
setInvalidTin(false);
|
|
2064
2072
|
const businessData = isDataCompliant ? await handleGetCompanyDataset({
|
|
2065
2073
|
companyId: company.id,
|
|
@@ -2071,11 +2079,11 @@ function useBusinessData({
|
|
|
2071
2079
|
setCachedBusiness(businessData);
|
|
2072
2080
|
return businessData;
|
|
2073
2081
|
} catch (e) {
|
|
2074
|
-
|
|
2082
|
+
setFetching("error");
|
|
2075
2083
|
setCachedBusiness(void 0);
|
|
2076
2084
|
logger$E.error(e);
|
|
2077
2085
|
} finally {
|
|
2078
|
-
|
|
2086
|
+
setFetching((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2079
2087
|
}
|
|
2080
2088
|
}, [cachedBusiness, handleGetCompanyDataset, handleRefreshCompanyDataset]);
|
|
2081
2089
|
const verifyBusinessData = useCallback(async (data, tin) => {
|
|
@@ -2084,7 +2092,7 @@ function useBusinessData({
|
|
|
2084
2092
|
return;
|
|
2085
2093
|
}
|
|
2086
2094
|
try {
|
|
2087
|
-
|
|
2095
|
+
setVerifying("loading");
|
|
2088
2096
|
setVerifiedBusiness(void 0);
|
|
2089
2097
|
setInvalidTin(false);
|
|
2090
2098
|
const {
|
|
@@ -2100,21 +2108,21 @@ function useBusinessData({
|
|
|
2100
2108
|
}
|
|
2101
2109
|
return matched;
|
|
2102
2110
|
} catch (e) {
|
|
2103
|
-
|
|
2111
|
+
setVerifying("error");
|
|
2104
2112
|
logger$E.error(e);
|
|
2105
2113
|
} finally {
|
|
2106
|
-
|
|
2114
|
+
setVerifying((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2107
2115
|
}
|
|
2108
2116
|
}, [handleVerifyTin]);
|
|
2109
2117
|
const clearTrustedBusinessData = useCallback(async () => {
|
|
2110
2118
|
try {
|
|
2111
|
-
|
|
2119
|
+
setResettingTrustedData("loading");
|
|
2112
2120
|
await (handleClearCompanyData == null ? void 0 : handleClearCompanyData());
|
|
2113
2121
|
} catch (e) {
|
|
2114
|
-
|
|
2122
|
+
setResettingTrustedData("error");
|
|
2115
2123
|
logger$E.error(e);
|
|
2116
2124
|
} finally {
|
|
2117
|
-
|
|
2125
|
+
setResettingTrustedData((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2118
2126
|
}
|
|
2119
2127
|
}, [handleClearCompanyData]);
|
|
2120
2128
|
const resetBusinessData = () => {
|
|
@@ -2133,10 +2141,10 @@ function useBusinessData({
|
|
|
2133
2141
|
resetBusinessData,
|
|
2134
2142
|
resetTinVerification,
|
|
2135
2143
|
// Data
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2144
|
+
searching,
|
|
2145
|
+
fetching,
|
|
2146
|
+
verifying,
|
|
2147
|
+
resettingTrustedData,
|
|
2140
2148
|
currentSearchName: cachedSearch == null ? void 0 : cachedSearch.text,
|
|
2141
2149
|
searchResults,
|
|
2142
2150
|
verifiedBusiness,
|
|
@@ -19608,12 +19616,6 @@ function BankVerification(props) {
|
|
|
19608
19616
|
});
|
|
19609
19617
|
}
|
|
19610
19618
|
const BankVerification$1 = memo(BankVerification);
|
|
19611
|
-
const CoreContext = createContext(void 0);
|
|
19612
|
-
const useCoreContext = () => {
|
|
19613
|
-
const context = useContext(CoreContext);
|
|
19614
|
-
if (!context) throw Error("You need a <CoreProvider> to use core context");
|
|
19615
|
-
return context;
|
|
19616
|
-
};
|
|
19617
19619
|
const countriesWithMultipleCurrencies = /* @__PURE__ */ new Set([CountryCodes.Bulgaria, CountryCodes.Canada, CountryCodes.Croatia, CountryCodes.CzechRepublic, CountryCodes.Hungary, CountryCodes.Romania, CountryCodes.Switzerland]);
|
|
19618
19620
|
const countriesWithLocalFormat = /* @__PURE__ */ new Set([CountryCodes.Denmark, CountryCodes.Norway, CountryCodes.Poland, CountryCodes.Sweden, CountryCodes.UnitedKingdom]);
|
|
19619
19621
|
const payoutCurrencySupport = {
|
|
@@ -24679,8 +24681,8 @@ function BusinessInformationCard({
|
|
|
24679
24681
|
result,
|
|
24680
24682
|
selectedBusinessId,
|
|
24681
24683
|
currentBusinessSelection,
|
|
24682
|
-
|
|
24683
|
-
|
|
24684
|
+
fetchStatus,
|
|
24685
|
+
verifyStatus,
|
|
24684
24686
|
invalidTin,
|
|
24685
24687
|
resetTinVerification,
|
|
24686
24688
|
setIsBusinessSelection,
|
|
@@ -24690,9 +24692,9 @@ function BusinessInformationCard({
|
|
|
24690
24692
|
const {
|
|
24691
24693
|
i18n
|
|
24692
24694
|
} = useI18nContext();
|
|
24693
|
-
const showSelectButton =
|
|
24695
|
+
const showSelectButton = fetchStatus !== "loading" && fetchStatus !== "error" && currentBusinessSelection;
|
|
24694
24696
|
const selectBusiness = (searchResult) => {
|
|
24695
|
-
if (
|
|
24697
|
+
if (fetchStatus === "error" && selectedBusinessId === searchResult.id) return;
|
|
24696
24698
|
return handleSelectBusiness(searchResult);
|
|
24697
24699
|
};
|
|
24698
24700
|
const handleGoBack = () => {
|
|
@@ -24705,7 +24707,7 @@ function BusinessInformationCard({
|
|
|
24705
24707
|
title: result.name,
|
|
24706
24708
|
subTitle: result.registrationNumber,
|
|
24707
24709
|
stateful: true,
|
|
24708
|
-
fetching:
|
|
24710
|
+
fetching: fetchStatus === "loading" && selectedBusinessId === result.id,
|
|
24709
24711
|
active: selectedBusinessId === result.id,
|
|
24710
24712
|
headerButton: selectedBusinessId === result.id && showSelectButton ? jsx(Button, {
|
|
24711
24713
|
label: i18n.get("thisIsMyBusiness"),
|
|
@@ -24727,7 +24729,11 @@ function BusinessInformationCard({
|
|
|
24727
24729
|
showAsLink: true
|
|
24728
24730
|
}),
|
|
24729
24731
|
testId: "invalidTin"
|
|
24730
|
-
}),
|
|
24732
|
+
}), verifyStatus === "error" && jsx(Alert, {
|
|
24733
|
+
variant: "error",
|
|
24734
|
+
title: i18n.get("businessSelection__tinVerificationFailure"),
|
|
24735
|
+
testId: "tinVerificationFailure"
|
|
24736
|
+
}), fetchStatus === "error" && jsx(Alert, {
|
|
24731
24737
|
variant: "info",
|
|
24732
24738
|
type: "callToAction",
|
|
24733
24739
|
title: i18n.get("businessSelection__failedToLoad"),
|
|
@@ -24738,8 +24744,8 @@ function BusinessInformationCard({
|
|
|
24738
24744
|
showAsLink: true
|
|
24739
24745
|
}),
|
|
24740
24746
|
testId: "failedToLoad"
|
|
24741
|
-
}),
|
|
24742
|
-
fetching,
|
|
24747
|
+
}), fetchStatus !== "error" && jsx(BusinessInformation, {
|
|
24748
|
+
fetching: fetchStatus === "loading",
|
|
24743
24749
|
selectedBusiness: currentBusinessSelection
|
|
24744
24750
|
})]
|
|
24745
24751
|
})
|
|
@@ -24748,10 +24754,10 @@ function BusinessInformationCard({
|
|
|
24748
24754
|
const logger$n = createLogger("BusinessSelection");
|
|
24749
24755
|
function BusinessSelectionComponent({
|
|
24750
24756
|
showCompanyStructure,
|
|
24751
|
-
|
|
24752
|
-
|
|
24753
|
-
|
|
24754
|
-
|
|
24757
|
+
searching,
|
|
24758
|
+
fetching,
|
|
24759
|
+
verifying,
|
|
24760
|
+
resettingTrustedData,
|
|
24755
24761
|
searchResults,
|
|
24756
24762
|
invalidTin,
|
|
24757
24763
|
fetchBusinessData,
|
|
@@ -24779,19 +24785,19 @@ function BusinessSelectionComponent({
|
|
|
24779
24785
|
}, [setShowCompanyStructure, verifyBusinessData]);
|
|
24780
24786
|
const handleSelectBusiness = useCallback(async (result) => {
|
|
24781
24787
|
try {
|
|
24782
|
-
if (
|
|
24788
|
+
if (fetching === "loading") return;
|
|
24783
24789
|
if (!selectedBusinessId || selectedBusinessId !== result.id) {
|
|
24784
24790
|
setSelectedBusinessId(result.id);
|
|
24785
24791
|
const businessData = await fetchBusinessData(result);
|
|
24786
24792
|
setCurrentBusinessSelection(businessData);
|
|
24787
|
-
} else if (
|
|
24793
|
+
} else if (fetching === "error") {
|
|
24788
24794
|
const businessData = await fetchBusinessData(result);
|
|
24789
24795
|
setCurrentBusinessSelection(businessData);
|
|
24790
24796
|
}
|
|
24791
24797
|
} catch (e) {
|
|
24792
24798
|
logger$n.error(e);
|
|
24793
24799
|
}
|
|
24794
|
-
}, [fetchBusinessData,
|
|
24800
|
+
}, [fetchBusinessData, fetching, selectedBusinessId]);
|
|
24795
24801
|
const handleConfirmSelection = useCallback(async (data) => {
|
|
24796
24802
|
if (!currentTin) return;
|
|
24797
24803
|
try {
|
|
@@ -24803,7 +24809,7 @@ function BusinessSelectionComponent({
|
|
|
24803
24809
|
logger$n.error(e);
|
|
24804
24810
|
}
|
|
24805
24811
|
}, [currentTin, handleNextClick, handleBusinessVerification]);
|
|
24806
|
-
const showLoader =
|
|
24812
|
+
const showLoader = searching === "loading" || verifying === "loading" || resettingTrustedData === "loading" || fetching === "loading" && (searchResults == null ? void 0 : searchResults.length) === 1;
|
|
24807
24813
|
const businessSelectionClasses = cx("adyen-kyc-business-selection", {
|
|
24808
24814
|
"adyen-kyc-business-selection--loading": showLoader
|
|
24809
24815
|
});
|
|
@@ -24828,8 +24834,8 @@ function BusinessSelectionComponent({
|
|
|
24828
24834
|
result,
|
|
24829
24835
|
selectedBusinessId,
|
|
24830
24836
|
currentBusinessSelection,
|
|
24831
|
-
|
|
24832
|
-
|
|
24837
|
+
fetchStatus: fetching,
|
|
24838
|
+
verifyStatus: verifying,
|
|
24833
24839
|
invalidTin,
|
|
24834
24840
|
resetTinVerification,
|
|
24835
24841
|
handleSelectBusiness,
|
|
@@ -24951,10 +24957,10 @@ function BasicInformationComponent({
|
|
|
24951
24957
|
showBusinessSelection,
|
|
24952
24958
|
showCompanyStructure,
|
|
24953
24959
|
isActiveForm,
|
|
24954
|
-
|
|
24955
|
-
|
|
24956
|
-
|
|
24957
|
-
|
|
24960
|
+
searching,
|
|
24961
|
+
fetching,
|
|
24962
|
+
verifying,
|
|
24963
|
+
resettingTrustedData,
|
|
24958
24964
|
searchResults,
|
|
24959
24965
|
invalidTin,
|
|
24960
24966
|
verifiedBusiness,
|
|
@@ -25079,10 +25085,10 @@ function BasicInformationComponent({
|
|
|
25079
25085
|
if (showBusinessSelection) {
|
|
25080
25086
|
return jsx(BusinessSelectionComponent, {
|
|
25081
25087
|
showCompanyStructure,
|
|
25082
|
-
|
|
25083
|
-
|
|
25084
|
-
|
|
25085
|
-
|
|
25088
|
+
searching,
|
|
25089
|
+
fetching,
|
|
25090
|
+
verifying,
|
|
25091
|
+
resettingTrustedData,
|
|
25086
25092
|
searchResults,
|
|
25087
25093
|
invalidTin,
|
|
25088
25094
|
fetchBusinessData,
|
|
@@ -25669,10 +25675,10 @@ function BusinessDetailsComponent(props) {
|
|
|
25669
25675
|
showBusinessSelection,
|
|
25670
25676
|
setShowBusinessSelection,
|
|
25671
25677
|
setShowCompanyStructure,
|
|
25672
|
-
|
|
25673
|
-
|
|
25674
|
-
|
|
25675
|
-
|
|
25678
|
+
searching,
|
|
25679
|
+
fetching,
|
|
25680
|
+
verifying,
|
|
25681
|
+
resettingTrustedData,
|
|
25676
25682
|
searchResults,
|
|
25677
25683
|
invalidTin,
|
|
25678
25684
|
verifiedBusiness,
|
|
@@ -25713,10 +25719,10 @@ function BusinessDetailsComponent(props) {
|
|
|
25713
25719
|
showBusinessSelection,
|
|
25714
25720
|
showCompanyStructure,
|
|
25715
25721
|
isActiveForm: (activeForm == null ? void 0 : activeForm.formId) === forms2.basicInformation.formId,
|
|
25716
|
-
|
|
25717
|
-
|
|
25718
|
-
|
|
25719
|
-
|
|
25722
|
+
searching,
|
|
25723
|
+
fetching,
|
|
25724
|
+
verifying,
|
|
25725
|
+
resettingTrustedData,
|
|
25720
25726
|
fetchBusinessData,
|
|
25721
25727
|
verifyBusinessData,
|
|
25722
25728
|
proceedToManualDataEntry,
|
|
@@ -26890,9 +26896,10 @@ async function submit({
|
|
|
26890
26896
|
showToast,
|
|
26891
26897
|
clearToasts,
|
|
26892
26898
|
handleUpdateLegalEntity,
|
|
26893
|
-
onExternalSubmit
|
|
26899
|
+
onExternalSubmit,
|
|
26900
|
+
accountHolder
|
|
26894
26901
|
}) {
|
|
26895
|
-
var _a, _b, _c, _d;
|
|
26902
|
+
var _a, _b, _c, _d, _e;
|
|
26896
26903
|
const logger2 = createLogger("submitBusinessDetails");
|
|
26897
26904
|
setLoadingStatus("loading");
|
|
26898
26905
|
const trackingPayload = {
|
|
@@ -26905,7 +26912,7 @@ async function submit({
|
|
|
26905
26912
|
const filteredData = removeOldDataBySchema(data, savedLegalEntityData);
|
|
26906
26913
|
const legalEntity = {
|
|
26907
26914
|
...mapBusinessDetailsSchemaToLegalEntity(filteredData),
|
|
26908
|
-
entityAssociations: filterOutUnwantedAssociationsIfRootLE(TaskTypes.BUSINESS_DETAILS, legalEntityResponse,
|
|
26915
|
+
entityAssociations: filterOutUnwantedAssociationsIfRootLE(TaskTypes.BUSINESS_DETAILS, legalEntityResponse, ((_e = data.companyStructure) == null ? void 0 : _e.accountHolder) || accountHolder)
|
|
26909
26916
|
};
|
|
26910
26917
|
try {
|
|
26911
26918
|
userEvents.addEvent(BusinessDetailsEvents.TASK_SUBMIT, {
|
|
@@ -26977,7 +26984,6 @@ function BusinessDetailsDropinComponent({
|
|
|
26977
26984
|
parentLegalEntity,
|
|
26978
26985
|
trackingConfig,
|
|
26979
26986
|
capabilities,
|
|
26980
|
-
accountHolder,
|
|
26981
26987
|
taskName,
|
|
26982
26988
|
hideDropinLayout,
|
|
26983
26989
|
homeButtonLabel,
|
|
@@ -27020,6 +27026,10 @@ function BusinessDetailsDropinComponent({
|
|
|
27020
27026
|
});
|
|
27021
27027
|
}, []);
|
|
27022
27028
|
const formRef = useRef(null);
|
|
27029
|
+
const {
|
|
27030
|
+
accountHolder,
|
|
27031
|
+
setAccountHolder
|
|
27032
|
+
} = useCoreContext();
|
|
27023
27033
|
const {
|
|
27024
27034
|
showToast,
|
|
27025
27035
|
clearToasts
|
|
@@ -27038,7 +27048,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27038
27048
|
var _a2;
|
|
27039
27049
|
return ((_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.country) ?? country;
|
|
27040
27050
|
}, [(_a = currentState.data.basicInformation) == null ? void 0 : _a.country, country]);
|
|
27041
|
-
const [initialData, setInitialData] = useState(mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled ? accountHolder : void 0));
|
|
27051
|
+
const [initialData, setInitialData] = useState(mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled && accountHolder ? accountHolder : void 0));
|
|
27042
27052
|
const [trustedFields, setTrustedFields] = useState(legalEntityResponse.trustedFields);
|
|
27043
27053
|
const documentUtils = documentApiUtils(handleCreateDocument, handleGetDocument, handleUpdateDocument);
|
|
27044
27054
|
useEffect(() => {
|
|
@@ -27096,22 +27106,26 @@ function BusinessDetailsDropinComponent({
|
|
|
27096
27106
|
data: formatDataForSummary$1(currentState.data, forms2, derivedProps == null ? void 0 : derivedProps.labels, i18n),
|
|
27097
27107
|
omittedKeys: ["operationalAddressIsSame"]
|
|
27098
27108
|
}), [currentState.data, derivedProps == null ? void 0 : derivedProps.labels, forms2, i18n]);
|
|
27099
|
-
const submitTask = useCallback(() =>
|
|
27100
|
-
|
|
27101
|
-
|
|
27102
|
-
|
|
27103
|
-
|
|
27104
|
-
|
|
27105
|
-
|
|
27106
|
-
|
|
27107
|
-
|
|
27108
|
-
|
|
27109
|
-
|
|
27110
|
-
|
|
27111
|
-
|
|
27112
|
-
|
|
27113
|
-
|
|
27114
|
-
|
|
27109
|
+
const submitTask = useCallback(() => {
|
|
27110
|
+
var _a2;
|
|
27111
|
+
setAccountHolder(((_a2 = currentState.data.companyStructure) == null ? void 0 : _a2.accountHolder) || accountHolder);
|
|
27112
|
+
return submit({
|
|
27113
|
+
data: currentState.data,
|
|
27114
|
+
legalEntityResponse,
|
|
27115
|
+
isTargetLegalEntityType: Boolean(isTargetLegalEntityType),
|
|
27116
|
+
baseTrackingPayload,
|
|
27117
|
+
problems: currentProblems,
|
|
27118
|
+
forms: forms2,
|
|
27119
|
+
documentUtils,
|
|
27120
|
+
i18n,
|
|
27121
|
+
setLoadingStatus,
|
|
27122
|
+
setProblems: setCurrentProblems,
|
|
27123
|
+
showToast,
|
|
27124
|
+
clearToasts,
|
|
27125
|
+
handleUpdateLegalEntity,
|
|
27126
|
+
onExternalSubmit
|
|
27127
|
+
});
|
|
27128
|
+
}, [baseTrackingPayload, clearToasts, currentState.data, documentUtils, forms2, handleUpdateLegalEntity, i18n, isTargetLegalEntityType, legalEntityResponse, onExternalSubmit, currentProblems, showToast]);
|
|
27115
27129
|
const {
|
|
27116
27130
|
handleNextClick,
|
|
27117
27131
|
handleBackClick,
|
|
@@ -27136,10 +27150,10 @@ function BusinessDetailsDropinComponent({
|
|
|
27136
27150
|
clearTrustedBusinessData,
|
|
27137
27151
|
resetBusinessData,
|
|
27138
27152
|
resetTinVerification,
|
|
27139
|
-
|
|
27140
|
-
|
|
27141
|
-
|
|
27142
|
-
|
|
27153
|
+
searching,
|
|
27154
|
+
fetching,
|
|
27155
|
+
verifying,
|
|
27156
|
+
resettingTrustedData,
|
|
27143
27157
|
currentSearchName,
|
|
27144
27158
|
searchResults,
|
|
27145
27159
|
invalidTin,
|
|
@@ -27170,10 +27184,10 @@ function BusinessDetailsDropinComponent({
|
|
|
27170
27184
|
}
|
|
27171
27185
|
}, [currentCountry, (_e = currentState.data.basicInformation) == null ? void 0 : _e.taxInformation, fetchBusinessData, handleNextClick, searchForBusiness, handleVerifyBusinessData]);
|
|
27172
27186
|
useEffect(() => {
|
|
27173
|
-
if (searchResults && !searchResults.length ||
|
|
27187
|
+
if (searchResults && !searchResults.length || searching === "error") {
|
|
27174
27188
|
setShowCompanyStructure(true);
|
|
27175
27189
|
}
|
|
27176
|
-
}, [searchResults,
|
|
27190
|
+
}, [searchResults, searching]);
|
|
27177
27191
|
useEffect(() => {
|
|
27178
27192
|
var _a2;
|
|
27179
27193
|
if (((_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.businessName) !== currentSearchName) {
|
|
@@ -27186,16 +27200,16 @@ function BusinessDetailsDropinComponent({
|
|
|
27186
27200
|
const hideBack = useMemo(() => {
|
|
27187
27201
|
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return hideBackButton;
|
|
27188
27202
|
if (isBusinessSelection) {
|
|
27189
|
-
return
|
|
27203
|
+
return searching === "loading" || fetching === "loading" || verifying === "loading" || resettingTrustedData === "loading" ? hideBackButton : false;
|
|
27190
27204
|
}
|
|
27191
27205
|
return hideBackButton;
|
|
27192
|
-
}, [currentCountry, hideBackButton, isBusinessSelection,
|
|
27206
|
+
}, [currentCountry, hideBackButton, isBusinessSelection, searching, fetching, verifying, resettingTrustedData]);
|
|
27193
27207
|
const hideHome = useMemo(() => {
|
|
27194
27208
|
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return hideHomeButton;
|
|
27195
27209
|
if (isBusinessSelection) {
|
|
27196
|
-
return
|
|
27210
|
+
return searching === "loading" || fetching === "loading" || verifying === "loading" || resettingTrustedData === "loading" ? true : hideHomeButton;
|
|
27197
27211
|
}
|
|
27198
|
-
}, [currentCountry, hideHomeButton, isBusinessSelection,
|
|
27212
|
+
}, [currentCountry, hideHomeButton, isBusinessSelection, searching, fetching, verifying, resettingTrustedData]);
|
|
27199
27213
|
const goToForm = useCallback((index) => {
|
|
27200
27214
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
27201
27215
|
const form = forms2[index].formId;
|
|
@@ -27258,12 +27272,12 @@ function BusinessDetailsDropinComponent({
|
|
|
27258
27272
|
return showBusinessSelection ? setShowBusinessSelection(false) : void 0;
|
|
27259
27273
|
}
|
|
27260
27274
|
case "companyStructure": {
|
|
27261
|
-
if (
|
|
27275
|
+
if (searching === "error") {
|
|
27262
27276
|
setShowBusinessSelection(false);
|
|
27263
27277
|
setShowCompanyStructure(false);
|
|
27264
27278
|
return handleBackClick == null ? void 0 : handleBackClick();
|
|
27265
27279
|
}
|
|
27266
|
-
if (
|
|
27280
|
+
if (searching !== "loading" && searchResults && !searchResults.length) {
|
|
27267
27281
|
setShowBusinessSelection(false);
|
|
27268
27282
|
} else if (!verifiedBusiness) setShowCompanyStructure(false);
|
|
27269
27283
|
return handleBackClick == null ? void 0 : handleBackClick();
|
|
@@ -27277,7 +27291,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27277
27291
|
default:
|
|
27278
27292
|
return handleBackClick == null ? void 0 : handleBackClick();
|
|
27279
27293
|
}
|
|
27280
|
-
}, [activeForm.formId, country, handleBackClick, handleNextClick,
|
|
27294
|
+
}, [activeForm.formId, country, handleBackClick, handleNextClick, searching, searchResults, showBusinessSelection, verifiedBusiness]);
|
|
27281
27295
|
const proceedToManualDataEntry = useCallback(async () => {
|
|
27282
27296
|
await clearTrustedBusinessData().then(() => setShowCompanyStructure(true));
|
|
27283
27297
|
}, [clearTrustedBusinessData]);
|
|
@@ -27328,10 +27342,10 @@ function BusinessDetailsDropinComponent({
|
|
|
27328
27342
|
invalidTin,
|
|
27329
27343
|
resetTinVerification,
|
|
27330
27344
|
verifiedBusiness,
|
|
27331
|
-
|
|
27332
|
-
|
|
27333
|
-
|
|
27334
|
-
|
|
27345
|
+
searching,
|
|
27346
|
+
fetching,
|
|
27347
|
+
verifying,
|
|
27348
|
+
resettingTrustedData,
|
|
27335
27349
|
searchForBusiness,
|
|
27336
27350
|
fetchBusinessData,
|
|
27337
27351
|
verifyBusinessData,
|
|
@@ -28745,7 +28759,8 @@ function useCompanySearchTaskSubmit({
|
|
|
28745
28759
|
setProblems,
|
|
28746
28760
|
setLoadingStatus,
|
|
28747
28761
|
onExternalSubmit,
|
|
28748
|
-
handleUpdateLegalEntity
|
|
28762
|
+
handleUpdateLegalEntity,
|
|
28763
|
+
accountHolder
|
|
28749
28764
|
}) {
|
|
28750
28765
|
const {
|
|
28751
28766
|
showToast,
|
|
@@ -28790,7 +28805,7 @@ function useCompanySearchTaskSubmit({
|
|
|
28790
28805
|
const submit2 = useCallback(async ({
|
|
28791
28806
|
data
|
|
28792
28807
|
}) => {
|
|
28793
|
-
var _a, _b, _c, _d;
|
|
28808
|
+
var _a, _b, _c, _d, _e;
|
|
28794
28809
|
setLoadingStatus("loading");
|
|
28795
28810
|
const trackingPayload = {
|
|
28796
28811
|
companyStructure: ((_a = data.companyStructure) == null ? void 0 : _a.entityType) ?? null,
|
|
@@ -28802,7 +28817,7 @@ function useCompanySearchTaskSubmit({
|
|
|
28802
28817
|
const filteredData = removeOldDataBySchema(data, savedLegalEntityData);
|
|
28803
28818
|
const legalEntity = {
|
|
28804
28819
|
...mapCompanySearchSchemaToLegalEntity(filteredData),
|
|
28805
|
-
entityAssociations: filterOutUnwantedAssociationsIfRootLE(task, legalEntityResponse,
|
|
28820
|
+
entityAssociations: filterOutUnwantedAssociationsIfRootLE(task, legalEntityResponse, (((_e = data.companyStructure) == null ? void 0 : _e.accountHolder) || accountHolder) ?? void 0)
|
|
28806
28821
|
};
|
|
28807
28822
|
try {
|
|
28808
28823
|
userEvents.addEvent(CompanySearchEvents.TASK_SUBMIT, {
|
|
@@ -29009,7 +29024,6 @@ function CompanySearchDropinComponent({
|
|
|
29009
29024
|
taskName,
|
|
29010
29025
|
hideDropinLayout,
|
|
29011
29026
|
homeButtonLabel,
|
|
29012
|
-
accountHolder,
|
|
29013
29027
|
onChange,
|
|
29014
29028
|
onSubmit: onExternalSubmit,
|
|
29015
29029
|
handleHomeClick,
|
|
@@ -29036,6 +29050,10 @@ function CompanySearchDropinComponent({
|
|
|
29036
29050
|
useEffect(() => {
|
|
29037
29051
|
onChange == null ? void 0 : onChange(currentState);
|
|
29038
29052
|
}, [currentState, onChange]);
|
|
29053
|
+
const {
|
|
29054
|
+
accountHolder,
|
|
29055
|
+
setAccountHolder
|
|
29056
|
+
} = useCoreContext();
|
|
29039
29057
|
const formRef = useRef(null);
|
|
29040
29058
|
const {
|
|
29041
29059
|
showToast
|
|
@@ -29051,7 +29069,7 @@ function CompanySearchDropinComponent({
|
|
|
29051
29069
|
} = useExperimentsContext();
|
|
29052
29070
|
const isNewEntryFlowEnabled = useEnableNewEntryFlow();
|
|
29053
29071
|
const [loadingStatus, setLoadingStatus] = useState("success");
|
|
29054
|
-
const [initialData, setInitialData] = useState(mapLegalEntityToCompanySearchSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled ? accountHolder : void 0));
|
|
29072
|
+
const [initialData, setInitialData] = useState(mapLegalEntityToCompanySearchSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled && accountHolder ? accountHolder : void 0));
|
|
29055
29073
|
const country = useMemo(() => {
|
|
29056
29074
|
var _a2;
|
|
29057
29075
|
return ((_a2 = currentState.data.companyBasics) == null ? void 0 : _a2.country) ?? parentCountry;
|
|
@@ -29141,7 +29159,8 @@ function CompanySearchDropinComponent({
|
|
|
29141
29159
|
setProblems,
|
|
29142
29160
|
setLoadingStatus,
|
|
29143
29161
|
onExternalSubmit,
|
|
29144
|
-
handleUpdateLegalEntity
|
|
29162
|
+
handleUpdateLegalEntity,
|
|
29163
|
+
accountHolder
|
|
29145
29164
|
});
|
|
29146
29165
|
const {
|
|
29147
29166
|
handleNextClick,
|
|
@@ -29179,9 +29198,13 @@ function CompanySearchDropinComponent({
|
|
|
29179
29198
|
activeForm,
|
|
29180
29199
|
validateForm: () => setShouldValidate(true),
|
|
29181
29200
|
baseTrackingPayload,
|
|
29182
|
-
onSubmit: () =>
|
|
29183
|
-
|
|
29184
|
-
|
|
29201
|
+
onSubmit: () => {
|
|
29202
|
+
var _a2;
|
|
29203
|
+
setAccountHolder(((_a2 = currentState.data.companyStructure) == null ? void 0 : _a2.accountHolder) || accountHolder);
|
|
29204
|
+
return submit2({
|
|
29205
|
+
data: currentState.data
|
|
29206
|
+
});
|
|
29207
|
+
},
|
|
29185
29208
|
problems,
|
|
29186
29209
|
canSubmit: canSubmitForm,
|
|
29187
29210
|
summary: summaryData,
|
|
@@ -32744,7 +32767,8 @@ function IndividualDropinComponent({
|
|
|
32744
32767
|
}
|
|
32745
32768
|
});
|
|
32746
32769
|
const accountHolderToEvaluated = ((_c2 = dataSubmitted.personalDetails) == null ? void 0 : _c2.accountHolder) || accountHolder;
|
|
32747
|
-
|
|
32770
|
+
const filteredEntityAssociation = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, accountHolderToEvaluated || void 0);
|
|
32771
|
+
legalEntity.entityAssociations = filteredEntityAssociation;
|
|
32748
32772
|
const createdLegalEntity = await submitLegalEntity({
|
|
32749
32773
|
dataSubmitted,
|
|
32750
32774
|
legalEntity,
|
|
@@ -36428,7 +36452,6 @@ function DropinComposerComponent({
|
|
|
36428
36452
|
handleVerifyTin: args.handleVerifyTin,
|
|
36429
36453
|
onTypeSwitch: navigateToTypeSwitcher,
|
|
36430
36454
|
isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION,
|
|
36431
|
-
accountHolder,
|
|
36432
36455
|
trustedFields: singpassTrustedFields,
|
|
36433
36456
|
trustedFieldsProvider: isEligibleForSingpass && TrustedFieldsProvider.SINGPASS
|
|
36434
36457
|
});
|
|
@@ -36468,8 +36491,7 @@ function DropinComposerComponent({
|
|
|
36468
36491
|
handleVerifyTin: args.handleVerifyTin,
|
|
36469
36492
|
handleClearCompanyData: args.handleClearCompanyData,
|
|
36470
36493
|
onTypeSwitch: navigateToTypeSwitcher,
|
|
36471
|
-
isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION
|
|
36472
|
-
accountHolder
|
|
36494
|
+
isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION
|
|
36473
36495
|
})
|
|
36474
36496
|
});
|
|
36475
36497
|
case TaskTypes.TRUST_MEMBER_COMPANY:
|
|
@@ -39436,7 +39458,7 @@ const ConfigurationApiProvider = ({
|
|
|
39436
39458
|
isEmbeddedDropin,
|
|
39437
39459
|
loadingContext
|
|
39438
39460
|
} = authContext;
|
|
39439
|
-
const sdkVersion = "2.54.
|
|
39461
|
+
const sdkVersion = "2.54.1";
|
|
39440
39462
|
useAnalytics({
|
|
39441
39463
|
onUserEvent,
|
|
39442
39464
|
legalEntityId: rootLegalEntityId,
|
|
@@ -40114,7 +40136,7 @@ const DebugModal = ({
|
|
|
40114
40136
|
};
|
|
40115
40137
|
const copyToClipboard = async () => {
|
|
40116
40138
|
const toCopy = {
|
|
40117
|
-
sdkVersion: "2.54.
|
|
40139
|
+
sdkVersion: "2.54.1",
|
|
40118
40140
|
experiments: Object.fromEntries(allExperimentsWithValues),
|
|
40119
40141
|
settings: Object.fromEntries(allSettingsWithValues)
|
|
40120
40142
|
};
|
|
@@ -40153,7 +40175,7 @@ const DebugModal = ({
|
|
|
40153
40175
|
children: [jsxs("div", {
|
|
40154
40176
|
className: "adyen-kyc-debug-modal__meta",
|
|
40155
40177
|
children: [jsxs("span", {
|
|
40156
|
-
children: ["SDK version: ", "2.54.
|
|
40178
|
+
children: ["SDK version: ", "2.54.1"]
|
|
40157
40179
|
}), jsxs("span", {
|
|
40158
40180
|
children: ["rootLegalEntityId: ", rootLegalEntityId]
|
|
40159
40181
|
})]
|
|
@@ -3,4 +3,4 @@ import type { BusinessDetailsSchema } from '../../BusinessDetails/types';
|
|
|
3
3
|
import type { BasicInformationProps, BasicInformationSchema } from '../types';
|
|
4
4
|
export declare const BASIC_INFORMATION_FORM_ID: keyof BusinessDetailsSchema;
|
|
5
5
|
export declare const BASIC_INFORMATION_FIELDS: Array<keyof BasicInformationSchema>;
|
|
6
|
-
export declare function BasicInformationComponent({ data, labels, placeholders, helperText, heading, description, readOnly, shouldValidate, formVerificationErrors, fieldValidationErrors, allFields, requiredFields, obscuredFields, optionalFields, readOnlyFields, trustedFields, country, companyType, isTopLevelEntity, className, showBusinessSelection, showCompanyStructure, isActiveForm,
|
|
6
|
+
export declare function BasicInformationComponent({ data, labels, placeholders, helperText, heading, description, readOnly, shouldValidate, formVerificationErrors, fieldValidationErrors, allFields, requiredFields, obscuredFields, optionalFields, readOnlyFields, trustedFields, country, companyType, isTopLevelEntity, className, showBusinessSelection, showCompanyStructure, isActiveForm, searching, fetching, verifying, resettingTrustedData, searchResults, invalidTin, verifiedBusiness, fetchBusinessData, verifyBusinessData, proceedToManualDataEntry, handleNextClick, setShowBusinessSelection, setShowCompanyStructure, resetTinVerification, }: BasicInformationProps): import("preact").JSX.Element;
|
|
@@ -19,10 +19,10 @@ export interface BasicInformationProps extends BaseInnerFormProps<BasicInformati
|
|
|
19
19
|
showBusinessSelection: boolean;
|
|
20
20
|
showCompanyStructure: boolean;
|
|
21
21
|
isActiveForm: boolean;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
searching: HookStatus;
|
|
23
|
+
fetching: HookStatus;
|
|
24
|
+
verifying: HookStatus;
|
|
25
|
+
resettingTrustedData: HookStatus;
|
|
26
26
|
searchResults: CompanySearchResult[] | undefined;
|
|
27
27
|
invalidTin: boolean;
|
|
28
28
|
verifiedBusiness: CompanyDatasetResponse | undefined;
|
|
@@ -24,10 +24,10 @@ export interface BusinessDetailsProps extends BaseOuterFormProps<BusinessDetails
|
|
|
24
24
|
baseTrackingPayload: BaseTrackingPayload;
|
|
25
25
|
showCompanyStructure: boolean;
|
|
26
26
|
showBusinessSelection: boolean;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
searching: HookStatus;
|
|
28
|
+
fetching: HookStatus;
|
|
29
|
+
verifying: HookStatus;
|
|
30
|
+
resettingTrustedData: HookStatus;
|
|
31
31
|
searchResults: Array<CompanySearchResult> | undefined;
|
|
32
32
|
invalidTin: boolean;
|
|
33
33
|
verifiedBusiness: CompanyDatasetResponse | undefined;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import './BusinessInformationCard.scss';
|
|
2
2
|
import { type Dispatch, type StateUpdater } from 'preact/hooks';
|
|
3
|
+
import type { HookStatus } from '../../core/hooks/types';
|
|
3
4
|
import type { CompanyDatasetResponse, CompanySearchResult } from '../../core/models/api/company-search';
|
|
4
5
|
interface BusinessInformationCardProps {
|
|
5
6
|
result: CompanySearchResult;
|
|
6
7
|
selectedBusinessId: string | undefined;
|
|
7
8
|
currentBusinessSelection: CompanyDatasetResponse | undefined;
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
fetchStatus: HookStatus;
|
|
10
|
+
verifyStatus: HookStatus;
|
|
10
11
|
invalidTin: boolean;
|
|
11
12
|
setIsBusinessSelection: Dispatch<StateUpdater<boolean>>;
|
|
12
13
|
resetTinVerification: () => void;
|
|
13
14
|
handleSelectBusiness: (result: CompanySearchResult) => Promise<void>;
|
|
14
15
|
handleConfirmSelection: (data: CompanyDatasetResponse) => Promise<void>;
|
|
15
16
|
}
|
|
16
|
-
export declare function BusinessInformationCard({ result, selectedBusinessId, currentBusinessSelection,
|
|
17
|
+
export declare function BusinessInformationCard({ result, selectedBusinessId, currentBusinessSelection, fetchStatus, verifyStatus, invalidTin, resetTinVerification, setIsBusinessSelection, handleSelectBusiness, handleConfirmSelection, }: BusinessInformationCardProps): import("preact").JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './BusinessSelectionComponent.scss';
|
|
2
2
|
import type { BusinessSelectionProps } from '../types';
|
|
3
|
-
export declare function BusinessSelectionComponent({ showCompanyStructure,
|
|
3
|
+
export declare function BusinessSelectionComponent({ showCompanyStructure, searching, fetching, verifying, resettingTrustedData, searchResults, invalidTin, fetchBusinessData, verifyBusinessData, resetTinVerification, proceedToManualDataEntry, handleNextClick, setIsBusinessSelection, setShowCompanyStructure, }: BusinessSelectionProps): import("preact").JSX.Element;
|
|
@@ -3,10 +3,10 @@ import type { HookStatus } from '../../core/hooks/types';
|
|
|
3
3
|
import type { CompanyDatasetResponse, CompanySearchResult } from '../../core/models/api/company-search';
|
|
4
4
|
export interface BusinessSelectionProps {
|
|
5
5
|
showCompanyStructure: boolean;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
searching: HookStatus;
|
|
7
|
+
fetching: HookStatus;
|
|
8
|
+
verifying: HookStatus;
|
|
9
|
+
resettingTrustedData: HookStatus;
|
|
10
10
|
searchResults: CompanySearchResult[] | undefined;
|
|
11
11
|
invalidTin: boolean;
|
|
12
12
|
fetchBusinessData: (company: CompanySearchResult) => Promise<CompanyDatasetResponse | undefined>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type BusinessDetailsDropinProps } from '../types';
|
|
2
|
-
export declare function BusinessDetailsDropinComponent({ country, problems, legalEntityResponse, isTargetLegalEntityType, parentLegalEntity, trackingConfig, capabilities,
|
|
2
|
+
export declare function BusinessDetailsDropinComponent({ country, problems, legalEntityResponse, isTargetLegalEntityType, parentLegalEntity, trackingConfig, capabilities, taskName, hideDropinLayout, homeButtonLabel, taskType, onChange, onSubmit: onExternalSubmit, handleHomeClick, handleCreateDocument, handleGetDocument, handleUpdateDocument, handleAddressSearch, handleFindAddress, handleUpdateLegalEntity, handleCompanyIndexSearch, handleCompanyDeepSearch, handleGetCompanyDataset, handleRefreshCompanyDataset, handleVerifyTin, handleClearCompanyData, onTypeSwitch, }: BusinessDetailsDropinProps): import("preact").JSX.Element;
|
|
@@ -32,13 +32,12 @@ export type BusinessDetailsDropinApihandler = Required<Pick<DropinAPIHandlers, '
|
|
|
32
32
|
handleVerifyTin?: DropinAPIHandlers['handleVerifyTin'];
|
|
33
33
|
handleClearCompanyData?: DropinAPIHandlers['handleClearCompanyData'];
|
|
34
34
|
};
|
|
35
|
-
export type BusinessDetailsDropin = Omit<BusinessDetailsProps, 'isTopLevelEntity' | 'baseTrackingPayload' | 'handleNextClick' | 'showCompanyStructure' | 'showBusinessSelection' | '
|
|
35
|
+
export type BusinessDetailsDropin = Omit<BusinessDetailsProps, 'isTopLevelEntity' | 'baseTrackingPayload' | 'handleNextClick' | 'showCompanyStructure' | 'showBusinessSelection' | 'searching' | 'fetching' | 'verifying' | 'resettingTrustedData' | 'searchResults' | 'invalidTin' | 'resetTinVerification' | 'verifiedBusiness' | 'searchForBusiness' | 'fetchBusinessData' | 'verifyBusinessData' | 'proceedToManualDataEntry' | 'setShowBusinessSelection' | 'setShowCompanyStructure'>;
|
|
36
36
|
export interface BusinessDetailsDropinProps extends BusinessDetailsDropin, BusinessDetailsDropinApihandler, DropinProps {
|
|
37
37
|
legalEntityResponse: ExistingLegalEntity;
|
|
38
38
|
isTargetLegalEntityType?: boolean;
|
|
39
39
|
parentLegalEntity?: LegalEntity;
|
|
40
40
|
associationDetail?: TrustMember;
|
|
41
|
-
accountHolder?: AccountHolderOption;
|
|
42
41
|
}
|
|
43
42
|
export interface SubmitDocumentsProps {
|
|
44
43
|
data: BusinessDetailsSchema;
|
|
@@ -62,4 +61,5 @@ export interface SubmitProps {
|
|
|
62
61
|
clearToasts: () => void;
|
|
63
62
|
handleUpdateLegalEntity: Required<DropinAPIHandlers>['handleUpdateLegalEntity'];
|
|
64
63
|
onExternalSubmit: ((data: BusinessDetailsSchema) => void) | undefined;
|
|
64
|
+
accountHolder?: AccountHolderOption;
|
|
65
65
|
}
|
|
@@ -10,4 +10,4 @@ export declare const isDocumentsRequired: (forms: FormModelWithValidity[]) => bo
|
|
|
10
10
|
export declare const removeConditionalForms: (forms: FormModelWithValidity[], isSkippingCompanyStructure: boolean) => FormModelWithValidity[];
|
|
11
11
|
export declare const formatDataForSummary: (data: BusinessDetailsSchema, forms: FormModelWithValidity[], labels: OuterFormLabels<BusinessDetailsSchema>, i18n: Language) => {};
|
|
12
12
|
export declare function submitDocuments({ data, legalEntity, forms, documentUtils, baseTrackingPayload, }: SubmitDocumentsProps): Promise<void>;
|
|
13
|
-
export declare function submit({ data, legalEntityResponse, isTargetLegalEntityType, baseTrackingPayload, forms, problems, documentUtils, i18n, setLoadingStatus, setProblems, showToast, clearToasts, handleUpdateLegalEntity, onExternalSubmit, }: SubmitProps): Promise<void>;
|
|
13
|
+
export declare function submit({ data, legalEntityResponse, isTargetLegalEntityType, baseTrackingPayload, forms, problems, documentUtils, i18n, setLoadingStatus, setProblems, showToast, clearToasts, handleUpdateLegalEntity, onExternalSubmit, accountHolder, }: SubmitProps): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { CompanySearchDropinProps } from '../types';
|
|
2
|
-
export declare function CompanySearchDropinComponent({ country: parentCountry, problems: propProblems, legalEntityResponse, isTargetLegalEntityType, parentLegalEntity, trackingConfig, taskType, capabilities, taskName, hideDropinLayout, homeButtonLabel,
|
|
2
|
+
export declare function CompanySearchDropinComponent({ country: parentCountry, problems: propProblems, legalEntityResponse, isTargetLegalEntityType, parentLegalEntity, trackingConfig, taskType, capabilities, taskName, hideDropinLayout, homeButtonLabel, onChange, onSubmit: onExternalSubmit, handleHomeClick, handleCreateDocument, handleGetDocument, handleUpdateDocument, handleAddressSearch, handleFindAddress, handleUpdateLegalEntity, handleCompanyIndexSearch, handleCompanyDeepSearch, handleGetCompanyDataset, handleRefreshCompanyDataset, handleVerifyTin, onTypeSwitch, trustedFields, }: CompanySearchDropinProps): import("preact").JSX.Element;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExistingLegalEntity, LegalEntity } from '../../../core/models/api/legal-entity';
|
|
2
2
|
import type { CompanySearchProps } from '../../CompanySearch/types';
|
|
3
|
-
import type { AccountHolderOption } from '../../internal/AccountHolder/types';
|
|
4
3
|
import type { TrustMember } from '../../TrustMembers/types';
|
|
5
4
|
import type { DropinAPIHandlers, DropinProps } from '../types';
|
|
6
5
|
export declare enum CompanySearchEvents {
|
|
@@ -22,5 +21,4 @@ export interface CompanySearchDropinProps extends Omit<CompanySearchProps, 'isTo
|
|
|
22
21
|
isTargetLegalEntityType?: boolean;
|
|
23
22
|
parentLegalEntity?: LegalEntity;
|
|
24
23
|
associationDetail?: TrustMember;
|
|
25
|
-
accountHolder?: AccountHolderOption;
|
|
26
24
|
}
|
|
@@ -16,10 +16,10 @@ export type UseBusinessData = {
|
|
|
16
16
|
clearTrustedBusinessData: () => Promise<void>;
|
|
17
17
|
resetBusinessData: () => void;
|
|
18
18
|
resetTinVerification: () => void;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
searching: HookStatus;
|
|
20
|
+
fetching: HookStatus;
|
|
21
|
+
verifying: HookStatus;
|
|
22
|
+
resettingTrustedData: HookStatus;
|
|
23
23
|
currentSearchName: string | undefined;
|
|
24
24
|
searchResults: CompanySearchResult[] | undefined;
|
|
25
25
|
verifiedBusiness: CompanyDatasetResponse | undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Dispatch, StateUpdater } from 'preact/hooks';
|
|
2
2
|
import type { CompanySearchSchema } from '../../components/CompanySearch/types';
|
|
3
3
|
import type { DropinAPIHandlers } from '../../components/Dropins/types';
|
|
4
|
+
import type { AccountHolderOption } from '../../components/internal/AccountHolder/types';
|
|
4
5
|
import type { LoadingStatus } from '../../components/internal/LoaderWrapper/constants';
|
|
5
6
|
import { TaskTypes } from '../../components/TaskList/types';
|
|
6
7
|
import type { DocumentApiUtils } from '../../utils/api/documentUtils';
|
|
@@ -27,8 +28,9 @@ export interface FormTaskSubmitOptions {
|
|
|
27
28
|
setLoadingStatus: Dispatch<StateUpdater<LoadingStatus>>;
|
|
28
29
|
onExternalSubmit?: (company: CompanySearchSchema) => void;
|
|
29
30
|
handleUpdateLegalEntity: Required<DropinAPIHandlers>['handleUpdateLegalEntity'];
|
|
31
|
+
accountHolder: AccountHolderOption | null;
|
|
30
32
|
}
|
|
31
33
|
export type FormTaskSubmit<FormTaskSchema> = {
|
|
32
34
|
submit: (options: SubmitOptions<FormTaskSchema>) => Promise<void>;
|
|
33
35
|
};
|
|
34
|
-
export declare function useCompanySearchTaskSubmit<FormTaskSchema extends CompanySearchSchema>({ task, forms, legalEntityResponse, problems, baseTrackingPayload, isTargetLegalEntityType, documentUtils, setProblems, setLoadingStatus, onExternalSubmit, handleUpdateLegalEntity, }: FormTaskSubmitOptions): FormTaskSubmit<FormTaskSchema>;
|
|
36
|
+
export declare function useCompanySearchTaskSubmit<FormTaskSchema extends CompanySearchSchema>({ task, forms, legalEntityResponse, problems, baseTrackingPayload, isTargetLegalEntityType, documentUtils, setProblems, setLoadingStatus, onExternalSubmit, handleUpdateLegalEntity, accountHolder, }: FormTaskSubmitOptions): FormTaskSubmit<FormTaskSchema>;
|