@zeniai/client-epic-state 5.1.4-beta7ND → 5.1.4-betaML2
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/lib/entity/company/companyPayload.d.ts +0 -4
- package/lib/entity/company/companyPayload.js +0 -6
- package/lib/entity/company/companyStateTypes.d.ts +0 -7
- package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +0 -1
- package/lib/entity/paymentAccount/paymentAccountSelector.js +0 -9
- package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.d.ts +3 -3
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.d.ts +25 -38
- package/lib/entity/tenant/tenantReducer.js +5 -65
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +2 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +1 -0
- package/lib/entity/transaction/stateTypes/transaction.d.ts +2 -0
- package/lib/epic.d.ts +1 -6
- package/lib/epic.js +1 -7
- package/lib/esm/entity/company/companyPayload.js +0 -6
- package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +0 -8
- package/lib/esm/entity/tenant/tenantReducer.js +3 -63
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +1 -0
- package/lib/esm/epic.js +1 -7
- package/lib/esm/index.js +7 -11
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -1
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +1 -0
- package/lib/esm/view/fileView/epic/deleteFileEpic.js +2 -2
- package/lib/esm/view/fileView/epic/deleteFileListEpic.js +2 -2
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +18 -24
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +17 -29
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +51 -223
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +12 -24
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +6 -37
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +52 -106
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
- package/lib/index.d.ts +10 -14
- package/lib/index.js +35 -64
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +1 -0
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -0
- package/lib/view/fileView/epic/deleteFileEpic.js +1 -1
- package/lib/view/fileView/epic/deleteFileListEpic.js +1 -1
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +18 -24
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.d.ts +2 -2
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +15 -27
- package/lib/view/onboardingView/customerView/onboardingCustomerViewPayload.d.ts +0 -3
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +5 -44
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +52 -225
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +1 -6
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +12 -27
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +8 -52
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +7 -39
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +2 -28
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +53 -107
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +2 -7
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -19
- package/package.json +1 -1
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +0 -21
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -59
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -55
- package/lib/esm/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -40
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -29
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -40
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -58
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -77
- package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -14
- package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -207
- package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -41
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.d.ts +0 -7
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -44
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.d.ts +0 -8
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -33
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.d.ts +0 -9
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -44
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +0 -28
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -62
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +0 -9
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -81
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +0 -24
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -17
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +0 -29
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -215
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +0 -154
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -46
|
@@ -15,7 +15,7 @@ import { CompanyView } from '../../companyView/types/companyView';
|
|
|
15
15
|
import { CompanyDetails, CompanyOfficersDetails } from '../../spendManagement/commonSetup/setupViewSelector';
|
|
16
16
|
import { CompanyOfficerLocalData } from '../../spendManagement/commonSetup/setupViewState';
|
|
17
17
|
import { PlaidConnectionDetails } from '../../spendManagement/plaidAccount/plaidAccountViewState';
|
|
18
|
-
import {
|
|
18
|
+
import { OnboardingCustomerViewUIState, OnboardingStep } from './onboardingCustomerViewState';
|
|
19
19
|
export interface OnboardingCustomerView {
|
|
20
20
|
allNationalityCountries: Country[];
|
|
21
21
|
allRequiredStepsCompleted: boolean;
|
|
@@ -25,11 +25,9 @@ export interface OnboardingCustomerView {
|
|
|
25
25
|
companyOfficerLocalData: Record<CompanyOfficerType, CompanyOfficersDetails | undefined>;
|
|
26
26
|
completedSteps: OnboardingStep[];
|
|
27
27
|
currentStep: OnboardingStep;
|
|
28
|
-
currentSubStep: OnboardingSubStep;
|
|
29
28
|
fetchStatus: FetchStateAndError;
|
|
30
29
|
halfCompletedSteps: OnboardingStep[];
|
|
31
30
|
isInterimEmailSent: boolean;
|
|
32
|
-
parsingDocumentFileIds: ID[];
|
|
33
31
|
paymentAccountFetchStatus: FetchStateAndError;
|
|
34
32
|
paymentAccountUpdateStatus: FetchStateAndError;
|
|
35
33
|
pendingSaveDetails: {
|
|
@@ -57,6 +55,3 @@ export declare const onboardingStepsData: (isValidConnection: boolean, productSe
|
|
|
57
55
|
};
|
|
58
56
|
export declare function isCompanyDetailsSavePending(fileState: FileState, company?: CompanyView, primaryContact?: User, companyDetailsLocalData?: CompanyDetails): boolean;
|
|
59
57
|
export declare const getProductSettingsString: (productSettings: TenantProductSettings | undefined) => string;
|
|
60
|
-
export declare const getAiAgentsActivationSubview: (state: RootState) => AiAgentsActivationSubview;
|
|
61
|
-
export declare const getAiAgentsActivationPhases: (state: RootState) => AiAgentsActivationPhase[];
|
|
62
|
-
export declare const getAiAgentsActivationCounts: (state: RootState) => AiAgentsActivationCounts;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getProductSettingsString = exports.onboardingStepsData = void 0;
|
|
4
4
|
exports.getOnboardingCustomerView = getOnboardingCustomerView;
|
|
5
5
|
exports.isOfficerDetailsCompleted = isOfficerDetailsCompleted;
|
|
6
6
|
exports.isCompanyDetailsSavePending = isCompanyDetailsSavePending;
|
|
@@ -17,7 +17,7 @@ const setupViewSelector_1 = require("../../spendManagement/commonSetup/setupView
|
|
|
17
17
|
const onboardingCustomerViewState_1 = require("./onboardingCustomerViewState");
|
|
18
18
|
function getOnboardingCustomerView(state, companyId) {
|
|
19
19
|
const { fileState, paymentAccountState, onboardingCustomerViewState, userState, userRoleState, subscriptionPaymentAccountState, companyConfigState, cardPaymentViewState, countryListState, addressViewState, } = state;
|
|
20
|
-
const { companyDetails, companyOfficerUpdateStatus, primaryContactDetails, subscriptionPaymentAccountIds, paymentAccountDetails, plaidConnectionDetails,
|
|
20
|
+
const { companyDetails, companyOfficerUpdateStatus, primaryContactDetails, subscriptionPaymentAccountIds, paymentAccountDetails, plaidConnectionDetails, updateStatus, saveStatus, currentStep, uiState, fetchState, error, } = onboardingCustomerViewState;
|
|
21
21
|
const { paymentAccountIds } = paymentAccountDetails;
|
|
22
22
|
let subscriptionPaymentAccount;
|
|
23
23
|
let paymentAccount;
|
|
@@ -60,7 +60,6 @@ function getOnboardingCustomerView(state, companyId) {
|
|
|
60
60
|
companyDetails,
|
|
61
61
|
companyOfficerUpdateStatus,
|
|
62
62
|
primaryContactDetails,
|
|
63
|
-
parsingDocumentFileIds,
|
|
64
63
|
});
|
|
65
64
|
const companyAddress = addressViewState.newAddressState?.company_address;
|
|
66
65
|
if (companyAddress == null &&
|
|
@@ -80,7 +79,7 @@ function getOnboardingCustomerView(state, companyId) {
|
|
|
80
79
|
cardPaymentViewState.cardPaymentsIds.length > 0) &&
|
|
81
80
|
companyView?.company.company.companyOnboardingInfo
|
|
82
81
|
.subscriptionBillingAddressId != null) {
|
|
83
|
-
completedSteps.push('
|
|
82
|
+
completedSteps.push('link_payment_account');
|
|
84
83
|
}
|
|
85
84
|
const isPaymentVerified = (paymentAccount?.providerVerificationStatus?.code?.includes('verified') ===
|
|
86
85
|
true &&
|
|
@@ -91,25 +90,24 @@ function getOnboardingCustomerView(state, companyId) {
|
|
|
91
90
|
.subscriptionBillingAddressId != null;
|
|
92
91
|
if ((isPaymentVerified || hasSubscriptionBillingAddress) &&
|
|
93
92
|
!(isPaymentVerified && hasSubscriptionBillingAddress)) {
|
|
94
|
-
halfCompletedSteps.push('
|
|
93
|
+
halfCompletedSteps.push('link_payment_account');
|
|
95
94
|
}
|
|
96
95
|
const isValidConnection = externalConnections?.accounting[0]?.isValid ?? false;
|
|
97
96
|
if (isValidConnection) {
|
|
98
|
-
completedSteps.push('
|
|
97
|
+
completedSteps.push('qbo_connection');
|
|
99
98
|
}
|
|
100
|
-
|
|
99
|
+
if (companyDetails.localData != null &&
|
|
101
100
|
primaryContactDetails.localData != null &&
|
|
102
|
-
isCompanyDetailsCompleted(fileState, companyView, primaryContact)
|
|
101
|
+
isCompanyDetailsCompleted(fileState, companyView, primaryContact)) {
|
|
102
|
+
completedSteps.push('company_details');
|
|
103
|
+
}
|
|
103
104
|
const officerIndex = companyOfficers.length > 0
|
|
104
105
|
? Object.values(companyOfficerLocalData).findIndex((officer) => officer?.isSelectedForVerification === true)
|
|
105
106
|
: 0;
|
|
106
107
|
const selectedOfficerType = `Officer_${officerIndex < 0 ? 1 : officerIndex + 1}`;
|
|
107
|
-
|
|
108
|
-
isOfficerDetailsCompleted(companyOfficers, companyOfficerRoles, companyOfficerLocalData[selectedOfficerType], fileState)
|
|
109
|
-
|
|
110
|
-
// the company-officer and company-details sub-steps are fully filled in.
|
|
111
|
-
if (isCompanyDetailsDone && isOfficerDone) {
|
|
112
|
-
completedSteps.push('verification');
|
|
108
|
+
if (companyOfficerLocalData[selectedOfficerType] != null &&
|
|
109
|
+
isOfficerDetailsCompleted(companyOfficers, companyOfficerRoles, companyOfficerLocalData[selectedOfficerType], fileState)) {
|
|
110
|
+
completedSteps.push('company_officer');
|
|
113
111
|
}
|
|
114
112
|
const { allStepsData, requiredStepsData } = (0, exports.onboardingStepsData)(isValidConnection, currentTenant?.productSettings ?? [], accountingConnectionCreationMode);
|
|
115
113
|
const allRequiredStepsCompleted = requiredStepsData.every((step) => {
|
|
@@ -127,7 +125,6 @@ function getOnboardingCustomerView(state, companyId) {
|
|
|
127
125
|
return {
|
|
128
126
|
companyDetailsLocalData,
|
|
129
127
|
companyOfficerLocalData,
|
|
130
|
-
parsingDocumentFileIds,
|
|
131
128
|
subscriptionBillingAddress: subscriptionBillingAddress?.addressToCreate,
|
|
132
129
|
companyView,
|
|
133
130
|
allNationalityCountries,
|
|
@@ -136,7 +133,6 @@ function getOnboardingCustomerView(state, companyId) {
|
|
|
136
133
|
officer: isOfficerDetailsSavePending(companyOfficers, companyOfficerRoles, fileState, companyOfficerLocalData[selectedOfficerType]),
|
|
137
134
|
},
|
|
138
135
|
currentStep,
|
|
139
|
-
currentSubStep,
|
|
140
136
|
completedSteps,
|
|
141
137
|
halfCompletedSteps,
|
|
142
138
|
allRequiredStepsCompleted,
|
|
@@ -335,14 +331,3 @@ const getProductSettingsString = (productSettings) => {
|
|
|
335
331
|
.join(',');
|
|
336
332
|
};
|
|
337
333
|
exports.getProductSettingsString = getProductSettingsString;
|
|
338
|
-
const fromActivationView = (state) =>
|
|
339
|
-
// Fall back to the empty subview so state hydrated from an older persisted
|
|
340
|
-
// version (before aiAgentsActivation existed) doesn't crash on .phases/.counts.
|
|
341
|
-
state.onboardingCustomerViewState.aiAgentsActivation ??
|
|
342
|
-
onboardingCustomerViewState_1.emptyAiAgentsActivationSubview;
|
|
343
|
-
const getAiAgentsActivationSubview = (state) => fromActivationView(state);
|
|
344
|
-
exports.getAiAgentsActivationSubview = getAiAgentsActivationSubview;
|
|
345
|
-
const getAiAgentsActivationPhases = (state) => fromActivationView(state).phases;
|
|
346
|
-
exports.getAiAgentsActivationPhases = getAiAgentsActivationPhases;
|
|
347
|
-
const getAiAgentsActivationCounts = (state) => fromActivationView(state).counts;
|
|
348
|
-
exports.getAiAgentsActivationCounts = getAiAgentsActivationCounts;
|
|
@@ -3,18 +3,15 @@ import { Address } from '../../../entity/address/addressState';
|
|
|
3
3
|
import { CompanyOfficerType } from '../../companyView/types/companyPassport/companyUsersLocalData';
|
|
4
4
|
import { CompanyDetailsLocalData, CompanyOfficerLocalData, PrimaryContactLocalData, SetupViewLocalData } from '../../spendManagement/commonSetup/setupViewState';
|
|
5
5
|
import { PlaidConnectionDetails } from '../../spendManagement/plaidAccount/plaidAccountViewState';
|
|
6
|
-
export declare const ZENI_USER_REQUIRED_ONBOARDING_STEPS: readonly ["
|
|
7
|
-
export declare const CUSTOMER_REQUIRED_ONBOARDING_STEPS_WITH_QBO: readonly ["
|
|
8
|
-
export declare const REQUIRED_ONBOARDING_STEPS: readonly ["
|
|
9
|
-
export declare const ALL_ZENI_USER_ONBOARDING_STEPS_WITHOUT_ACCOUNT: readonly ["
|
|
10
|
-
export declare const ALL_ZENI_USER_ONBOARDING_STEPS: readonly ["
|
|
11
|
-
export declare const ALL_CUSTOMER_ONBOARDING_STEPS_WITH_QBO: readonly ["
|
|
12
|
-
export declare const ALL_ONBOARDING_STEPS: readonly ["
|
|
13
|
-
export declare const toOnboardingStepType: (v: string) => "
|
|
6
|
+
export declare const ZENI_USER_REQUIRED_ONBOARDING_STEPS: readonly ["link_payment_account"];
|
|
7
|
+
export declare const CUSTOMER_REQUIRED_ONBOARDING_STEPS_WITH_QBO: readonly ["qbo_connection"];
|
|
8
|
+
export declare const REQUIRED_ONBOARDING_STEPS: readonly ["link_payment_account", "qbo_connection"];
|
|
9
|
+
export declare const ALL_ZENI_USER_ONBOARDING_STEPS_WITHOUT_ACCOUNT: readonly ["company_officer", "company_details"];
|
|
10
|
+
export declare const ALL_ZENI_USER_ONBOARDING_STEPS: readonly ["link_payment_account", "company_officer", "company_details"];
|
|
11
|
+
export declare const ALL_CUSTOMER_ONBOARDING_STEPS_WITH_QBO: readonly ["qbo_connection", "company_officer", "company_details"];
|
|
12
|
+
export declare const ALL_ONBOARDING_STEPS: readonly ["link_payment_account", "qbo_connection", "company_officer", "company_details"];
|
|
13
|
+
export declare const toOnboardingStepType: (v: string) => "company_details" | "company_officer" | "link_payment_account" | "qbo_connection";
|
|
14
14
|
export type OnboardingStep = ReturnType<typeof toOnboardingStepType>;
|
|
15
|
-
export declare const ALL_ONBOARDING_SUB_STEPS: readonly ["default", "ai-activating", "unlock-stack", "company_officer", "company_details"];
|
|
16
|
-
export declare const toOnboardingSubStepType: (v: string) => "default" | "company_details" | "company_officer" | "ai-activating" | "unlock-stack";
|
|
17
|
-
export type OnboardingSubStep = ReturnType<typeof toOnboardingSubStepType>;
|
|
18
15
|
/**
|
|
19
16
|
* Onboarding Custiner View Local Data - Intefaces
|
|
20
17
|
*/
|
|
@@ -24,33 +21,16 @@ export interface OnboardingCustomerViewUIState {
|
|
|
24
21
|
isQBOPopupOpen: boolean;
|
|
25
22
|
}
|
|
26
23
|
export interface OnboardingCustomerViewState extends FetchedState {
|
|
27
|
-
aiAgentsActivation: AiAgentsActivationSubview;
|
|
28
24
|
companyDetails: {
|
|
29
|
-
/**
|
|
30
|
-
* Field names from {@link CompanyDetailsLocalData} populated by AI autofill
|
|
31
|
-
* from an uploaded KYB document during onboarding. Drives the ✦ sparkle.
|
|
32
|
-
*/
|
|
33
|
-
autoFilledFields: string[];
|
|
34
25
|
localData?: CompanyDetailsLocalData;
|
|
35
26
|
};
|
|
36
27
|
companyOfficerUpdateStatus: Record<CompanyOfficerType, {
|
|
37
|
-
/**
|
|
38
|
-
* Field names from {@link CompanyOfficerLocalData} populated by AI autofill
|
|
39
|
-
* from an uploaded KYC identity document during onboarding.
|
|
40
|
-
*/
|
|
41
|
-
autoFilledFields: string[];
|
|
42
28
|
otpverificationStatus: FetchStateAndError;
|
|
43
29
|
sendOtpStatus: FetchStateAndError;
|
|
44
30
|
localData?: CompanyOfficerLocalData;
|
|
45
31
|
}>;
|
|
46
32
|
currentStep: OnboardingStep;
|
|
47
|
-
currentSubStep: OnboardingSubStep;
|
|
48
33
|
dashboardLoadedStatus: FetchStateAndError;
|
|
49
|
-
/**
|
|
50
|
-
* File IDs currently being parsed by the AI autofill epic for onboarding.
|
|
51
|
-
* Drives the "AI is reading your document" overlay on the upload field.
|
|
52
|
-
*/
|
|
53
|
-
parsingDocumentFileIds: ID[];
|
|
54
34
|
paymentAccountDetails: {
|
|
55
35
|
fetchStatus: FetchStateAndError;
|
|
56
36
|
paymentAccountIds: ID[];
|
|
@@ -64,29 +44,5 @@ export interface OnboardingCustomerViewState extends FetchedState {
|
|
|
64
44
|
subscriptionPaymentAccountIds: ID[];
|
|
65
45
|
uiState: OnboardingCustomerViewUIState;
|
|
66
46
|
updateStatus: FetchStateAndError;
|
|
67
|
-
aiActivationViewedAcknowledgementStatus?: FetchStateAndError;
|
|
68
|
-
aiFinanceTeamAcknowledgementStatus?: FetchStateAndError;
|
|
69
47
|
subscriptionBillingAddress?: Address;
|
|
70
48
|
}
|
|
71
|
-
export type AiAgentsActivationPhaseStatus = 'idle' | 'starting' | 'building' | 'ready';
|
|
72
|
-
export interface AiAgentsActivationPhase {
|
|
73
|
-
key: string;
|
|
74
|
-
status: AiAgentsActivationPhaseStatus;
|
|
75
|
-
completedAt?: string;
|
|
76
|
-
startedAt?: string;
|
|
77
|
-
}
|
|
78
|
-
export interface AiAgentsActivationCounts {
|
|
79
|
-
customerCount: number;
|
|
80
|
-
glAccountCount: number;
|
|
81
|
-
targetTransactionCount: number;
|
|
82
|
-
transactionCount: number;
|
|
83
|
-
vendorCount: number;
|
|
84
|
-
asOf?: string;
|
|
85
|
-
}
|
|
86
|
-
export interface AiAgentsActivationSubview {
|
|
87
|
-
counts: AiAgentsActivationCounts;
|
|
88
|
-
fetchStatus: FetchStateAndError;
|
|
89
|
-
phases: AiAgentsActivationPhase[];
|
|
90
|
-
}
|
|
91
|
-
export declare const emptyAiAgentsActivationCounts: AiAgentsActivationCounts;
|
|
92
|
-
export declare const emptyAiAgentsActivationSubview: AiAgentsActivationSubview;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toOnboardingStepType = exports.ALL_ONBOARDING_STEPS = exports.ALL_CUSTOMER_ONBOARDING_STEPS_WITH_QBO = exports.ALL_ZENI_USER_ONBOARDING_STEPS = exports.ALL_ZENI_USER_ONBOARDING_STEPS_WITHOUT_ACCOUNT = exports.REQUIRED_ONBOARDING_STEPS = exports.CUSTOMER_REQUIRED_ONBOARDING_STEPS_WITH_QBO = exports.ZENI_USER_REQUIRED_ONBOARDING_STEPS = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// sub-step under the old `qbo_connection` no longer exists.
|
|
9
|
-
exports.ZENI_USER_REQUIRED_ONBOARDING_STEPS = ['setup_billing'];
|
|
5
|
+
exports.ZENI_USER_REQUIRED_ONBOARDING_STEPS = [
|
|
6
|
+
'link_payment_account',
|
|
7
|
+
];
|
|
10
8
|
exports.CUSTOMER_REQUIRED_ONBOARDING_STEPS_WITH_QBO = [
|
|
11
|
-
'
|
|
9
|
+
'qbo_connection',
|
|
12
10
|
];
|
|
13
11
|
exports.REQUIRED_ONBOARDING_STEPS = [
|
|
14
12
|
...exports.ZENI_USER_REQUIRED_ONBOARDING_STEPS,
|
|
15
13
|
...exports.CUSTOMER_REQUIRED_ONBOARDING_STEPS_WITH_QBO,
|
|
16
14
|
];
|
|
17
15
|
exports.ALL_ZENI_USER_ONBOARDING_STEPS_WITHOUT_ACCOUNT = [
|
|
18
|
-
'
|
|
16
|
+
'company_officer',
|
|
17
|
+
'company_details',
|
|
19
18
|
];
|
|
20
19
|
exports.ALL_ZENI_USER_ONBOARDING_STEPS = [
|
|
21
20
|
...exports.ZENI_USER_REQUIRED_ONBOARDING_STEPS,
|
|
@@ -23,42 +22,11 @@ exports.ALL_ZENI_USER_ONBOARDING_STEPS = [
|
|
|
23
22
|
];
|
|
24
23
|
exports.ALL_CUSTOMER_ONBOARDING_STEPS_WITH_QBO = [
|
|
25
24
|
...exports.CUSTOMER_REQUIRED_ONBOARDING_STEPS_WITH_QBO,
|
|
26
|
-
'connect_data_source',
|
|
27
25
|
...exports.ALL_ZENI_USER_ONBOARDING_STEPS_WITHOUT_ACCOUNT,
|
|
28
26
|
];
|
|
29
27
|
exports.ALL_ONBOARDING_STEPS = [
|
|
30
28
|
...exports.REQUIRED_ONBOARDING_STEPS,
|
|
31
|
-
'connect_data_source',
|
|
32
29
|
...exports.ALL_ZENI_USER_ONBOARDING_STEPS_WITHOUT_ACCOUNT,
|
|
33
30
|
];
|
|
34
31
|
const toOnboardingStepType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_ONBOARDING_STEPS);
|
|
35
32
|
exports.toOnboardingStepType = toOnboardingStepType;
|
|
36
|
-
// Per-step sub-state. Lives in Redux so the save epic can tell, for example,
|
|
37
|
-
// an officer-form save from a company-details save while both share
|
|
38
|
-
// currentStep = 'verification'.
|
|
39
|
-
// - 'default' generic landing sub-state.
|
|
40
|
-
// - 'ai-activating' connect_ledger interstitial during AI activation.
|
|
41
|
-
// - 'unlock-stack' verification landing — VerifyUnlockFinancialStackPage.
|
|
42
|
-
// - 'company_officer' verification → officer form.
|
|
43
|
-
// - 'company_details' verification → company details form.
|
|
44
|
-
exports.ALL_ONBOARDING_SUB_STEPS = [
|
|
45
|
-
'default',
|
|
46
|
-
'ai-activating',
|
|
47
|
-
'unlock-stack',
|
|
48
|
-
'company_officer',
|
|
49
|
-
'company_details',
|
|
50
|
-
];
|
|
51
|
-
const toOnboardingSubStepType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_ONBOARDING_SUB_STEPS);
|
|
52
|
-
exports.toOnboardingSubStepType = toOnboardingSubStepType;
|
|
53
|
-
exports.emptyAiAgentsActivationCounts = {
|
|
54
|
-
customerCount: 0,
|
|
55
|
-
glAccountCount: 0,
|
|
56
|
-
targetTransactionCount: 0,
|
|
57
|
-
transactionCount: 0,
|
|
58
|
-
vendorCount: 0,
|
|
59
|
-
};
|
|
60
|
-
exports.emptyAiAgentsActivationSubview = {
|
|
61
|
-
counts: exports.emptyAiAgentsActivationCounts,
|
|
62
|
-
fetchStatus: { fetchState: 'Not-Started', error: undefined },
|
|
63
|
-
phases: [],
|
|
64
|
-
};
|
|
@@ -2,7 +2,7 @@ import { ID } from '../../../commonStateTypes/common';
|
|
|
2
2
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
3
3
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
4
|
import { CompanyOfficerType } from '../../companyView/types/companyPassport/companyUsersLocalData';
|
|
5
|
-
import { CompanyDetailsLocalData,
|
|
5
|
+
import { CompanyDetailsLocalData, SetupViewLocalData, SetupViewState } from './setupViewState';
|
|
6
6
|
export declare const initialState: SetupViewState;
|
|
7
7
|
export declare const enableSetup: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "zeni_treasury" | "charge_cards" | "other_connection" | "billing" | "debit_cards" | "charge_cards__debit_cards"], {
|
|
8
8
|
companyId: string;
|
|
@@ -29,32 +29,6 @@ export declare const enableSetup: import("@reduxjs/toolkit").ActionCreatorWithPr
|
|
|
29
29
|
}, "setupView/sendOtpSuccess">, sendOtpFailureSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "setupView/sendOtpFailure">, verifyOtpSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"setupView/verifyOtp">, verifyOtpSuccessSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"setupView/verifyOtpSuccess">, verifyOtpFailureSpendManagementSetUp: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "setupView/verifyOtpFailure">, saveIndustryAndIncDateInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
30
30
|
incDate: ZeniDate;
|
|
31
31
|
industry: string;
|
|
32
|
-
}, "setupView/saveIndustryAndIncDateInLocalStore">, clearSetupViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"setupView/clearSetupViewDataInLocalStore">, clearSetupView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"setupView/clearSetupView"
|
|
33
|
-
autoFilledFieldNames: string[];
|
|
34
|
-
companyId: ID;
|
|
35
|
-
fileId: ID;
|
|
36
|
-
officerType: CompanyOfficerType;
|
|
37
|
-
values: Partial<CompanyOfficerLocalData>;
|
|
38
|
-
}], {
|
|
39
|
-
autoFilledFieldNames: string[];
|
|
40
|
-
companyId: ID;
|
|
41
|
-
fileId: ID;
|
|
42
|
-
officerType: CompanyOfficerType;
|
|
43
|
-
values: Partial<CompanyOfficerLocalData>;
|
|
44
|
-
}, "setupView/applyKycDocumentAutofillForSetup", never, never>, applyKybDocumentAutofillForSetup: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
45
|
-
autoFilledFieldNames: string[];
|
|
46
|
-
companyId: ID;
|
|
47
|
-
fileId: ID;
|
|
48
|
-
values: Partial<CompanyDetailsLocalData>;
|
|
49
|
-
}], {
|
|
50
|
-
autoFilledFieldNames: string[];
|
|
51
|
-
companyId: ID;
|
|
52
|
-
fileId: ID;
|
|
53
|
-
values: Partial<CompanyDetailsLocalData>;
|
|
54
|
-
}, "setupView/applyKybDocumentAutofillForSetup", never, never>, clearKycKybAutofillForSetup: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload?: {
|
|
55
|
-
officerType?: CompanyOfficerType;
|
|
56
|
-
} | undefined], {
|
|
57
|
-
officerType?: CompanyOfficerType;
|
|
58
|
-
}, "setupView/clearKycKybAutofillForSetup", never, never>;
|
|
32
|
+
}, "setupView/saveIndustryAndIncDateInLocalStore">, clearSetupViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"setupView/clearSetupViewDataInLocalStore">, clearSetupView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"setupView/clearSetupView">;
|
|
59
33
|
declare const _default: import("redux").Reducer<SetupViewState>;
|
|
60
34
|
export default _default;
|
|
@@ -1,34 +1,66 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.clearSetupView = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.verifyOtpFailureSpendManagementSetUp = exports.verifyOtpSuccessSpendManagementSetUp = exports.verifyOtpSpendManagementSetUp = exports.sendOtpFailureSpendManagementSetUp = exports.sendOtpSuccessSpendManagementSetUp = exports.resendOtpSpendManagementSetUp = exports.sendOtpSpendManagementSetUp = exports.saveTreasuryAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerPhoneInLocalStore = exports.saveSetupViewDataInLocalStore = exports.updateSetupViewLocalStoreData = exports.updateSelectedCompanyOfficer = exports.updateBusinessVerificationDetailsFailure = exports.updateBusinessVerificationDetailsSuccess = exports.updateBusinessVerificationDetails = exports.enableSetupFailure = exports.enableSetupSuccess = exports.enableSetup = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const kycKybAutofillActions_1 = require("./kycKybAutofillActions");
|
|
7
6
|
const initialFetchStatus = {
|
|
8
7
|
fetchState: 'Not-Started',
|
|
9
8
|
error: undefined,
|
|
10
9
|
};
|
|
11
|
-
const emptyOfficerSlot = {
|
|
12
|
-
autoFilledFields: [],
|
|
13
|
-
localData: undefined,
|
|
14
|
-
sendOtpStatus: initialFetchStatus,
|
|
15
|
-
otpverificationStatus: initialFetchStatus,
|
|
16
|
-
};
|
|
17
10
|
exports.initialState = {
|
|
18
11
|
updateStatus: { fetchState: 'Not-Started', error: undefined },
|
|
19
|
-
|
|
20
|
-
companyDetails: { autoFilledFields: [] },
|
|
12
|
+
companyDetails: {},
|
|
21
13
|
companyOfficerUpdateStatus: {
|
|
22
|
-
Officer_1: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
14
|
+
Officer_1: {
|
|
15
|
+
localData: undefined,
|
|
16
|
+
sendOtpStatus: initialFetchStatus,
|
|
17
|
+
otpverificationStatus: initialFetchStatus,
|
|
18
|
+
},
|
|
19
|
+
Officer_2: {
|
|
20
|
+
localData: undefined,
|
|
21
|
+
sendOtpStatus: initialFetchStatus,
|
|
22
|
+
otpverificationStatus: initialFetchStatus,
|
|
23
|
+
},
|
|
24
|
+
Officer_3: {
|
|
25
|
+
localData: undefined,
|
|
26
|
+
sendOtpStatus: initialFetchStatus,
|
|
27
|
+
otpverificationStatus: initialFetchStatus,
|
|
28
|
+
},
|
|
29
|
+
Officer_4: {
|
|
30
|
+
localData: undefined,
|
|
31
|
+
sendOtpStatus: initialFetchStatus,
|
|
32
|
+
otpverificationStatus: initialFetchStatus,
|
|
33
|
+
},
|
|
34
|
+
Officer_5: {
|
|
35
|
+
localData: undefined,
|
|
36
|
+
sendOtpStatus: initialFetchStatus,
|
|
37
|
+
otpverificationStatus: initialFetchStatus,
|
|
38
|
+
},
|
|
39
|
+
Officer_6: {
|
|
40
|
+
localData: undefined,
|
|
41
|
+
sendOtpStatus: initialFetchStatus,
|
|
42
|
+
otpverificationStatus: initialFetchStatus,
|
|
43
|
+
},
|
|
44
|
+
Officer_7: {
|
|
45
|
+
localData: undefined,
|
|
46
|
+
sendOtpStatus: initialFetchStatus,
|
|
47
|
+
otpverificationStatus: initialFetchStatus,
|
|
48
|
+
},
|
|
49
|
+
Officer_8: {
|
|
50
|
+
localData: undefined,
|
|
51
|
+
sendOtpStatus: initialFetchStatus,
|
|
52
|
+
otpverificationStatus: initialFetchStatus,
|
|
53
|
+
},
|
|
54
|
+
Officer_9: {
|
|
55
|
+
localData: undefined,
|
|
56
|
+
sendOtpStatus: initialFetchStatus,
|
|
57
|
+
otpverificationStatus: initialFetchStatus,
|
|
58
|
+
},
|
|
59
|
+
Officer_10: {
|
|
60
|
+
localData: undefined,
|
|
61
|
+
sendOtpStatus: initialFetchStatus,
|
|
62
|
+
otpverificationStatus: initialFetchStatus,
|
|
63
|
+
},
|
|
32
64
|
},
|
|
33
65
|
primaryContactDetails: {},
|
|
34
66
|
};
|
|
@@ -269,93 +301,7 @@ const setupView = (0, toolkit_1.createSlice)({
|
|
|
269
301
|
clearSetupView(draft) {
|
|
270
302
|
Object.assign(draft, exports.initialState);
|
|
271
303
|
},
|
|
272
|
-
/**
|
|
273
|
-
* Merge AI-parsed officer fields into the selected officer's localData and
|
|
274
|
-
* track which field names were autofilled so the form can show the ✦ badge.
|
|
275
|
-
*/
|
|
276
|
-
applyKycDocumentAutofillForSetup: {
|
|
277
|
-
reducer(draft, action) {
|
|
278
|
-
const { officerType, values, autoFilledFieldNames, fileId } = action.payload;
|
|
279
|
-
const slot = draft.companyOfficerUpdateStatus[officerType];
|
|
280
|
-
slot.localData = Object.assign({}, slot.localData, values);
|
|
281
|
-
slot.autoFilledFields = Array.from(new Set([...(slot.autoFilledFields ?? []), ...autoFilledFieldNames]));
|
|
282
|
-
draft.parsingDocumentFileIds = (draft.parsingDocumentFileIds ?? []).filter((id) => id !== fileId);
|
|
283
|
-
},
|
|
284
|
-
prepare(payload) {
|
|
285
|
-
return { payload };
|
|
286
|
-
},
|
|
287
|
-
},
|
|
288
|
-
/**
|
|
289
|
-
* Merge AI-parsed company fields into companyDetails.localData and track
|
|
290
|
-
* which field names were autofilled.
|
|
291
|
-
*/
|
|
292
|
-
applyKybDocumentAutofillForSetup: {
|
|
293
|
-
reducer(draft, action) {
|
|
294
|
-
const { values, autoFilledFieldNames, fileId } = action.payload;
|
|
295
|
-
draft.companyDetails.localData = Object.assign({}, draft.companyDetails.localData, values);
|
|
296
|
-
draft.companyDetails.autoFilledFields = Array.from(new Set([
|
|
297
|
-
...(draft.companyDetails.autoFilledFields ?? []),
|
|
298
|
-
...autoFilledFieldNames,
|
|
299
|
-
]));
|
|
300
|
-
draft.parsingDocumentFileIds = (draft.parsingDocumentFileIds ?? []).filter((id) => id !== fileId);
|
|
301
|
-
},
|
|
302
|
-
prepare(payload) {
|
|
303
|
-
return { payload };
|
|
304
|
-
},
|
|
305
|
-
},
|
|
306
|
-
/**
|
|
307
|
-
* Wipe AI-autofill badges. If `officerType` is provided, clears only that
|
|
308
|
-
* officer; otherwise clears company details too.
|
|
309
|
-
*/
|
|
310
|
-
clearKycKybAutofillForSetup: {
|
|
311
|
-
reducer(draft, action) {
|
|
312
|
-
const { officerType } = action.payload;
|
|
313
|
-
if (officerType != null) {
|
|
314
|
-
draft.companyOfficerUpdateStatus[officerType].autoFilledFields = [];
|
|
315
|
-
}
|
|
316
|
-
else {
|
|
317
|
-
draft.companyDetails.autoFilledFields = [];
|
|
318
|
-
Object.keys(draft.companyOfficerUpdateStatus).forEach((key) => {
|
|
319
|
-
draft.companyOfficerUpdateStatus[key].autoFilledFields = [];
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
},
|
|
323
|
-
prepare(payload = {}) {
|
|
324
|
-
return { payload };
|
|
325
|
-
},
|
|
326
|
-
},
|
|
327
|
-
},
|
|
328
|
-
extraReducers: (builder) => {
|
|
329
|
-
const addParsingFileId = (draft, fileId) => {
|
|
330
|
-
draft.parsingDocumentFileIds = draft.parsingDocumentFileIds ?? [];
|
|
331
|
-
if (!draft.parsingDocumentFileIds.includes(fileId)) {
|
|
332
|
-
draft.parsingDocumentFileIds.push(fileId);
|
|
333
|
-
}
|
|
334
|
-
};
|
|
335
|
-
const removeParsingFileId = (draft, fileId) => {
|
|
336
|
-
draft.parsingDocumentFileIds = (draft.parsingDocumentFileIds ?? []).filter((id) => id !== fileId);
|
|
337
|
-
};
|
|
338
|
-
builder.addCase(kycKybAutofillActions_1.parseUploadedKycDocument, (draft, action) => {
|
|
339
|
-
if (action.payload.target === 'setup') {
|
|
340
|
-
addParsingFileId(draft, action.payload.fileId);
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
builder.addCase(kycKybAutofillActions_1.parseUploadedKybDocument, (draft, action) => {
|
|
344
|
-
if (action.payload.target === 'setup') {
|
|
345
|
-
addParsingFileId(draft, action.payload.fileId);
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
builder.addCase(kycKybAutofillActions_1.parseUploadedKycDocumentFailure, (draft, action) => {
|
|
349
|
-
if (action.payload.target === 'setup') {
|
|
350
|
-
removeParsingFileId(draft, action.payload.fileId);
|
|
351
|
-
}
|
|
352
|
-
});
|
|
353
|
-
builder.addCase(kycKybAutofillActions_1.parseUploadedKybDocumentFailure, (draft, action) => {
|
|
354
|
-
if (action.payload.target === 'setup') {
|
|
355
|
-
removeParsingFileId(draft, action.payload.fileId);
|
|
356
|
-
}
|
|
357
|
-
});
|
|
358
304
|
},
|
|
359
305
|
});
|
|
360
|
-
_a = setupView.actions, exports.enableSetup = _a.enableSetup, exports.enableSetupSuccess = _a.enableSetupSuccess, exports.enableSetupFailure = _a.enableSetupFailure, exports.updateBusinessVerificationDetails = _a.updateBusinessVerificationDetails, exports.updateBusinessVerificationDetailsSuccess = _a.updateBusinessVerificationDetailsSuccess, exports.updateBusinessVerificationDetailsFailure = _a.updateBusinessVerificationDetailsFailure, exports.updateSelectedCompanyOfficer = _a.updateSelectedCompanyOfficer, exports.updateSetupViewLocalStoreData = _a.updateSetupViewLocalStoreData, exports.saveSetupViewDataInLocalStore = _a.saveSetupViewDataInLocalStore, exports.saveCompnayOfficerPhoneInLocalStore = _a.saveCompnayOfficerPhoneInLocalStore, exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = _a.saveCompnayOfficerAdditionalDocumentsInLocalStore, exports.saveTreasuryAdditionalDocumentsInLocalStore = _a.saveTreasuryAdditionalDocumentsInLocalStore, exports.sendOtpSpendManagementSetUp = _a.sendOtp, exports.resendOtpSpendManagementSetUp = _a.resendOtp, exports.sendOtpSuccessSpendManagementSetUp = _a.sendOtpSuccess, exports.sendOtpFailureSpendManagementSetUp = _a.sendOtpFailure, exports.verifyOtpSpendManagementSetUp = _a.verifyOtp, exports.verifyOtpSuccessSpendManagementSetUp = _a.verifyOtpSuccess, exports.verifyOtpFailureSpendManagementSetUp = _a.verifyOtpFailure, exports.saveIndustryAndIncDateInLocalStore = _a.saveIndustryAndIncDateInLocalStore, exports.clearSetupViewDataInLocalStore = _a.clearSetupViewDataInLocalStore, exports.clearSetupView = _a.clearSetupView
|
|
306
|
+
_a = setupView.actions, exports.enableSetup = _a.enableSetup, exports.enableSetupSuccess = _a.enableSetupSuccess, exports.enableSetupFailure = _a.enableSetupFailure, exports.updateBusinessVerificationDetails = _a.updateBusinessVerificationDetails, exports.updateBusinessVerificationDetailsSuccess = _a.updateBusinessVerificationDetailsSuccess, exports.updateBusinessVerificationDetailsFailure = _a.updateBusinessVerificationDetailsFailure, exports.updateSelectedCompanyOfficer = _a.updateSelectedCompanyOfficer, exports.updateSetupViewLocalStoreData = _a.updateSetupViewLocalStoreData, exports.saveSetupViewDataInLocalStore = _a.saveSetupViewDataInLocalStore, exports.saveCompnayOfficerPhoneInLocalStore = _a.saveCompnayOfficerPhoneInLocalStore, exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = _a.saveCompnayOfficerAdditionalDocumentsInLocalStore, exports.saveTreasuryAdditionalDocumentsInLocalStore = _a.saveTreasuryAdditionalDocumentsInLocalStore, exports.sendOtpSpendManagementSetUp = _a.sendOtp, exports.resendOtpSpendManagementSetUp = _a.resendOtp, exports.sendOtpSuccessSpendManagementSetUp = _a.sendOtpSuccess, exports.sendOtpFailureSpendManagementSetUp = _a.sendOtpFailure, exports.verifyOtpSpendManagementSetUp = _a.verifyOtp, exports.verifyOtpSuccessSpendManagementSetUp = _a.verifyOtpSuccess, exports.verifyOtpFailureSpendManagementSetUp = _a.verifyOtpFailure, exports.saveIndustryAndIncDateInLocalStore = _a.saveIndustryAndIncDateInLocalStore, exports.clearSetupViewDataInLocalStore = _a.clearSetupViewDataInLocalStore, exports.clearSetupView = _a.clearSetupView;
|
|
361
307
|
exports.default = setupView.reducer;
|
|
@@ -16,7 +16,7 @@ import { CompanyOfficerType } from '../../companyView/types/companyPassport/comp
|
|
|
16
16
|
import { CompanyView } from '../../companyView/types/companyView';
|
|
17
17
|
import { AccountTypeSubConfigCodeKeyType } from '../billPay/billPayConfig/billPayConfigState';
|
|
18
18
|
import { PlaidAccountKeyType, PlaidConnectionDetails } from '../plaidAccount/plaidAccountViewState';
|
|
19
|
-
import { CompanyAndIdentityDetails, CompanyOfficerLocalData, PrimaryContactLocalData,
|
|
19
|
+
import { CompanyAndIdentityDetails, CompanyOfficerLocalData, PrimaryContactLocalData, SetupViewType } from './setupViewState';
|
|
20
20
|
export interface SetupView {
|
|
21
21
|
accountFetchStatus: FetchStateAndError;
|
|
22
22
|
accountUpdateStatus: FetchStateAndError;
|
|
@@ -54,8 +54,6 @@ export interface FundingAccount {
|
|
|
54
54
|
}
|
|
55
55
|
export interface CompanyOfficersDetails extends CompanyOfficerLocalData {
|
|
56
56
|
additionalFiles: File[];
|
|
57
|
-
/** Field names in this officer's localData populated by AI doc autofill. */
|
|
58
|
-
autoFilledFields: string[];
|
|
59
57
|
deleteFileStatusById: Record<ID, FetchStateAndError | undefined>;
|
|
60
58
|
otpverificationStatus: FetchStateAndError;
|
|
61
59
|
sendOtpStatus: FetchStateAndError;
|
|
@@ -64,8 +62,6 @@ export interface CompanyOfficersDetails extends CompanyOfficerLocalData {
|
|
|
64
62
|
addressStatus?: NewAddressData;
|
|
65
63
|
}
|
|
66
64
|
export interface CompanyDetails {
|
|
67
|
-
/** Field names in companyDetails localData populated by AI doc autofill. */
|
|
68
|
-
autoFilledFields: string[];
|
|
69
65
|
companyFiles: File[];
|
|
70
66
|
companyId: ID;
|
|
71
67
|
deleteFileStatusById: Record<ID, FetchStateAndError | undefined>;
|
|
@@ -100,7 +96,6 @@ export interface CompanyDetails {
|
|
|
100
96
|
}
|
|
101
97
|
interface CompanyAndOfficerLocalData {
|
|
102
98
|
companyOfficerLocalData: Record<CompanyOfficerType, CompanyOfficersDetails | undefined>;
|
|
103
|
-
parsingDocumentFileIds: ID[];
|
|
104
99
|
companyDetailsLocalData?: CompanyDetails;
|
|
105
100
|
}
|
|
106
101
|
export interface BusinessVerificationDetails extends CompanyAndOfficerLocalData {
|
|
@@ -110,7 +105,7 @@ export interface BusinessVerificationDetails extends CompanyAndOfficerLocalData
|
|
|
110
105
|
}
|
|
111
106
|
export declare function getCommonSetupViewDetails(state: RootState, companyId: ID, setupViewType: SetupViewType, plaidAccountKeyType: PlaidAccountKeyType): SetupView;
|
|
112
107
|
export declare function getBusinessVerificationDetails(state: RootState, companyId: ID): BusinessVerificationDetails;
|
|
113
|
-
export declare const getCompanyAndIdentityDetails: (state: RootState, companyId: ID, companyAndIdentityDetails: CompanyAndIdentityDetails
|
|
108
|
+
export declare const getCompanyAndIdentityDetails: (state: RootState, companyId: ID, companyAndIdentityDetails: CompanyAndIdentityDetails) => CompanyAndOfficerLocalData;
|
|
114
109
|
export declare const getAllFundingAccounts: (depositAccounts: DepositAccount[], paymentAccounts: PaymentAccount[], paymentAccountBalanceFetchStatus: Record<ID, FetchStateAndError>, includeOnlyVerifiedAccounts?: boolean) => FundingAccount[];
|
|
115
110
|
export declare const mapDepositAccToFundingAccount: (depositAcc: DepositAccount) => FundingAccount;
|
|
116
111
|
export declare const mapDepositAccountWithLimitToFundingAccount: (depositAcc: DepositAccountWithLimit) => FundingAccount;
|
|
@@ -92,17 +92,15 @@ function getBusinessVerificationDetails(state, companyId) {
|
|
|
92
92
|
const { setupViewState, countryListState } = state;
|
|
93
93
|
const { companyDetails, companyOfficerUpdateStatus, primaryContactDetails, updateStatus, } = setupViewState;
|
|
94
94
|
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
95
|
-
const { companyDetailsLocalData, companyOfficerLocalData
|
|
95
|
+
const { companyDetailsLocalData, companyOfficerLocalData } = (0, exports.getCompanyAndIdentityDetails)(state, companyId, {
|
|
96
96
|
companyDetails,
|
|
97
97
|
companyOfficerUpdateStatus,
|
|
98
98
|
primaryContactDetails,
|
|
99
|
-
parsingDocumentFileIds: setupViewState.parsingDocumentFileIds,
|
|
100
99
|
});
|
|
101
100
|
const allNationalityCountries = countryListState.byCountryListCode.nationalityCountryList.countries;
|
|
102
101
|
return {
|
|
103
102
|
companyDetailsLocalData,
|
|
104
103
|
companyOfficerLocalData,
|
|
105
|
-
parsingDocumentFileIds,
|
|
106
104
|
companyView,
|
|
107
105
|
updateStatus,
|
|
108
106
|
allNationalityCountries,
|
|
@@ -126,7 +124,6 @@ const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentityDetail
|
|
|
126
124
|
const companyAddress = addressViewState.newAddressState?.company_address;
|
|
127
125
|
const registeredCompanyAddress = addressViewState.newAddressState?.company_registered_address;
|
|
128
126
|
companyDetailsLocalData = {
|
|
129
|
-
autoFilledFields: companyDetails.autoFilledFields,
|
|
130
127
|
companyId,
|
|
131
128
|
companyDescription,
|
|
132
129
|
companyLegalName,
|
|
@@ -199,7 +196,6 @@ const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentityDetail
|
|
|
199
196
|
const companyOfficerAddress = addressViewState.newAddressState?.[addressType];
|
|
200
197
|
companyOfficerLocalData[officerType] = {
|
|
201
198
|
...companyOfficer.localData,
|
|
202
|
-
autoFilledFields: companyOfficer.autoFilledFields,
|
|
203
199
|
userFiles: (0, fileSelector_1.getFilesByFileIds)(fileState, fileIds),
|
|
204
200
|
additionalFiles: (0, fileSelector_1.getFilesByFileIds)(fileState, additionalSubmittedDocumentsForVerificationFileIds),
|
|
205
201
|
deleteFileStatusById,
|
|
@@ -213,7 +209,6 @@ const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentityDetail
|
|
|
213
209
|
return {
|
|
214
210
|
companyDetailsLocalData,
|
|
215
211
|
companyOfficerLocalData,
|
|
216
|
-
parsingDocumentFileIds: companyAndIdentityDetails.parsingDocumentFileIds,
|
|
217
212
|
};
|
|
218
213
|
};
|
|
219
214
|
exports.getCompanyAndIdentityDetails = getCompanyAndIdentityDetails;
|
|
@@ -81,21 +81,9 @@ export interface SetupViewLocalData {
|
|
|
81
81
|
*/
|
|
82
82
|
export interface CompanyAndIdentityDetails {
|
|
83
83
|
companyDetails: {
|
|
84
|
-
/**
|
|
85
|
-
* Field names from {@link CompanyDetailsLocalData} that were populated by AI
|
|
86
|
-
* autofill from an uploaded KYB document. Drives the ✦ sparkle in the form.
|
|
87
|
-
* Always present (empty when no autofill has run yet).
|
|
88
|
-
*/
|
|
89
|
-
autoFilledFields: string[];
|
|
90
84
|
localData?: CompanyDetailsLocalData;
|
|
91
85
|
};
|
|
92
86
|
companyOfficerUpdateStatus: Record<CompanyOfficerType, {
|
|
93
|
-
/**
|
|
94
|
-
* Field names from {@link CompanyOfficerLocalData} populated by AI autofill
|
|
95
|
-
* from an uploaded KYC identity document. Drives the ✦ sparkle in the form.
|
|
96
|
-
* Always present (empty when no autofill has run yet).
|
|
97
|
-
*/
|
|
98
|
-
autoFilledFields: string[];
|
|
99
87
|
otpverificationStatus: FetchStateAndError;
|
|
100
88
|
sendOtpStatus: FetchStateAndError;
|
|
101
89
|
localData?: CompanyOfficerLocalData;
|
|
@@ -105,13 +93,6 @@ export interface CompanyAndIdentityDetails {
|
|
|
105
93
|
};
|
|
106
94
|
}
|
|
107
95
|
export interface SetupViewState extends CompanyAndIdentityDetails {
|
|
108
|
-
/**
|
|
109
|
-
* File IDs currently being parsed by the AI autofill epic. Populated when
|
|
110
|
-
* `parseUploadedKyc/KybDocument` dispatches and cleared when the
|
|
111
|
-
* corresponding apply / failure action fires. Drives the "AI is reading
|
|
112
|
-
* your document" overlay on the document upload field.
|
|
113
|
-
*/
|
|
114
|
-
parsingDocumentFileIds: ID[];
|
|
115
96
|
updateStatus: FetchStateAndError;
|
|
116
97
|
}
|
|
117
98
|
export {};
|