@zeniai/client-epic-state 5.1.3 → 5.1.4-beta1ND
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 +4 -0
- package/lib/entity/company/companyPayload.js +6 -0
- package/lib/entity/company/companyStateTypes.d.ts +7 -0
- package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +1 -0
- package/lib/entity/paymentAccount/paymentAccountSelector.js +9 -0
- package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +21 -0
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +54 -0
- 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 +1 -0
- package/lib/entity/tenant/tenantReducer.d.ts +38 -25
- package/lib/entity/tenant/tenantReducer.js +65 -5
- package/lib/entity/tenant/tenantState.d.ts +1 -0
- package/lib/epic.d.ts +6 -1
- package/lib/epic.js +7 -1
- package/lib/esm/entity/company/companyPayload.js +6 -0
- package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +8 -0
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +50 -0
- package/lib/esm/entity/tenant/tenantReducer.js +63 -3
- package/lib/esm/epic.js +7 -1
- package/lib/esm/index.js +9 -6
- package/lib/esm/view/fileView/epic/deleteFileEpic.js +2 -2
- package/lib/esm/view/fileView/epic/deleteFileListEpic.js +2 -2
- package/lib/esm/view/fileView/epic/updateFileNameEpic.js +2 -2
- package/lib/esm/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +40 -0
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +29 -0
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +40 -0
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +218 -50
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +12 -2
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +12 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +2 -2
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +58 -0
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +77 -0
- package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +14 -0
- package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +207 -0
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +106 -52
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +6 -1
- package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +41 -0
- package/lib/index.d.ts +13 -9
- package/lib/index.js +55 -35
- package/lib/view/fileView/epic/deleteFileEpic.js +1 -1
- package/lib/view/fileView/epic/deleteFileListEpic.js +1 -1
- package/lib/view/fileView/epic/updateFileNameEpic.js +1 -1
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.d.ts +7 -0
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +44 -0
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.d.ts +8 -0
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +33 -0
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.d.ts +9 -0
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +44 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewPayload.d.ts +3 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +41 -4
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +220 -51
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +5 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +15 -2
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +40 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +13 -1
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.d.ts +1 -1
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +2 -2
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +28 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +62 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +9 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +81 -0
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +24 -0
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +17 -0
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +29 -0
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +215 -0
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +28 -2
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +107 -53
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +7 -2
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +6 -1
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +19 -0
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +154 -0
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +46 -0
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.acknowledgeOnboardingAiActivationViewedEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const companyReducer_1 = require("../../../../../entity/company/companyReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
8
|
+
const onboardingCustomerViewReducer_1 = require("../../onboardingCustomerViewReducer");
|
|
9
|
+
const acknowledgeOnboardingAiActivationViewedEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(onboardingCustomerViewReducer_1.acknowledgeOnboardingAiActivationViewed.match), (0, operators_1.mergeMap)((action) => {
|
|
10
|
+
const { companyId } = action.payload;
|
|
11
|
+
const payload = {
|
|
12
|
+
is_onboarding_ai_activation_viewed: true,
|
|
13
|
+
};
|
|
14
|
+
return zeniAPI
|
|
15
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, payload)
|
|
16
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
17
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
18
|
+
const actions = [
|
|
19
|
+
(0, companyReducer_1.updateCompanies)({
|
|
20
|
+
payload: response.data.companies,
|
|
21
|
+
schema: {},
|
|
22
|
+
}),
|
|
23
|
+
(0, onboardingCustomerViewReducer_1.acknowledgeOnboardingAiActivationViewedSuccess)(),
|
|
24
|
+
];
|
|
25
|
+
return (0, rxjs_1.from)(actions);
|
|
26
|
+
}
|
|
27
|
+
return (0, rxjs_1.of)((0, onboardingCustomerViewReducer_1.acknowledgeOnboardingAiActivationViewedFailure)(response.status));
|
|
28
|
+
}),
|
|
29
|
+
// Best-effort — failure is silent; cascade just runs again next visit.
|
|
30
|
+
(0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, onboardingCustomerViewReducer_1.acknowledgeOnboardingAiActivationViewedFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Acknowledge - Onboarding AI Activation Viewed errored out' +
|
|
31
|
+
JSON.stringify(error))))));
|
|
32
|
+
}));
|
|
33
|
+
exports.acknowledgeOnboardingAiActivationViewedEpic = acknowledgeOnboardingAiActivationViewedEpic;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateCompanies } from '../../../../../entity/company/companyReducer';
|
|
4
|
+
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
5
|
+
import { RootState } from '../../../../../reducer';
|
|
6
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
7
|
+
import { acknowledgeOnboardingAiFinanceTeam, acknowledgeOnboardingAiFinanceTeamFailure, acknowledgeOnboardingAiFinanceTeamSuccess } from '../../onboardingCustomerViewReducer';
|
|
8
|
+
export type ActionType = ReturnType<typeof acknowledgeOnboardingAiFinanceTeam> | ReturnType<typeof updateCompanies> | ReturnType<typeof openSnackbar> | ReturnType<typeof acknowledgeOnboardingAiFinanceTeamSuccess> | ReturnType<typeof acknowledgeOnboardingAiFinanceTeamFailure>;
|
|
9
|
+
export declare const acknowledgeOnboardingAiFinanceTeamEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.acknowledgeOnboardingAiFinanceTeamEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const companyReducer_1 = require("../../../../../entity/company/companyReducer");
|
|
7
|
+
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
8
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
9
|
+
const onboardingCustomerViewReducer_1 = require("../../onboardingCustomerViewReducer");
|
|
10
|
+
const acknowledgeOnboardingAiFinanceTeamEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(onboardingCustomerViewReducer_1.acknowledgeOnboardingAiFinanceTeam.match), (0, operators_1.mergeMap)((action) => {
|
|
11
|
+
const { companyId } = action.payload;
|
|
12
|
+
const payload = {
|
|
13
|
+
is_onboarding_ai_finance_team_acknowledged: true,
|
|
14
|
+
};
|
|
15
|
+
return zeniAPI
|
|
16
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, payload)
|
|
17
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
18
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
19
|
+
const actions = [
|
|
20
|
+
(0, companyReducer_1.updateCompanies)({
|
|
21
|
+
payload: response.data.companies,
|
|
22
|
+
schema: {},
|
|
23
|
+
}),
|
|
24
|
+
(0, onboardingCustomerViewReducer_1.acknowledgeOnboardingAiFinanceTeamSuccess)(),
|
|
25
|
+
];
|
|
26
|
+
return (0, rxjs_1.from)(actions);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
30
|
+
messageSection: 'onboarding_customer_view_complete',
|
|
31
|
+
messageText: 'failed',
|
|
32
|
+
type: 'error',
|
|
33
|
+
variables: [
|
|
34
|
+
{
|
|
35
|
+
variableName: '_api-error_',
|
|
36
|
+
variableValue: response.status.message,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
}), (0, onboardingCustomerViewReducer_1.acknowledgeOnboardingAiFinanceTeamFailure)(response.status));
|
|
40
|
+
}
|
|
41
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, onboardingCustomerViewReducer_1.acknowledgeOnboardingAiFinanceTeamFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Acknowledge - Onboarding AI Finance Team errored out' +
|
|
42
|
+
JSON.stringify(error))))));
|
|
43
|
+
}));
|
|
44
|
+
exports.acknowledgeOnboardingAiFinanceTeamEpic = acknowledgeOnboardingAiFinanceTeamEpic;
|
|
@@ -15,6 +15,9 @@ export interface OnboardingStatusPayload {
|
|
|
15
15
|
is_user_landed_to_interim_page: boolean;
|
|
16
16
|
should_complete_onboarding: boolean;
|
|
17
17
|
}
|
|
18
|
+
export interface AiFinanceTeamAcknowledgementPayload {
|
|
19
|
+
is_onboarding_ai_finance_team_acknowledged: boolean;
|
|
20
|
+
}
|
|
18
21
|
interface CompaniesData {
|
|
19
22
|
companies: CompanyPayload[];
|
|
20
23
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
3
3
|
import { CompanyOfficerType } from '../../companyView/types/companyPassport/companyUsersLocalData';
|
|
4
|
+
import { CompanyDetailsLocalData, CompanyOfficerLocalData } from '../../spendManagement/commonSetup/setupViewState';
|
|
4
5
|
import { PlaidLinkTokenType } from '../../spendManagement/plaidAccount/plaidAccountViewState';
|
|
5
|
-
import { OnboardingCustomerViewState, OnboardingCustomerViewUIState, OnboardingStep } from './onboardingCustomerViewState';
|
|
6
|
+
import { AiAgentsActivationCounts, AiAgentsActivationPhase, OnboardingCustomerViewState, OnboardingCustomerViewUIState, OnboardingStep } from './onboardingCustomerViewState';
|
|
6
7
|
export declare const initialState: OnboardingCustomerViewState;
|
|
7
8
|
export declare const fetchOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, cacheOverride?: any, reCalculateCurrentStep?: any], {
|
|
8
9
|
companyId: string;
|
|
@@ -16,7 +17,17 @@ export declare const fetchOnboardingCustomerView: import("@reduxjs/toolkit").Act
|
|
|
16
17
|
companyId: string;
|
|
17
18
|
checkOnboardingComplete: boolean;
|
|
18
19
|
productSuitePage: boolean;
|
|
19
|
-
}, "onboardingCustomerView/updateOnboardingCustomerViewCompleteStatus", never, never>, updateOnboardingCustomerViewCompleteStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/updateOnboardingCustomerViewCompleteStatusSuccess">, updateOnboardingCustomerViewCompleteStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/updateOnboardingCustomerViewCompleteStatusFailure", never, never>,
|
|
20
|
+
}, "onboardingCustomerView/updateOnboardingCustomerViewCompleteStatus", never, never>, updateOnboardingCustomerViewCompleteStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/updateOnboardingCustomerViewCompleteStatusSuccess">, updateOnboardingCustomerViewCompleteStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/updateOnboardingCustomerViewCompleteStatusFailure", never, never>, acknowledgeOnboardingAiFinanceTeam: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
|
|
21
|
+
companyId: string;
|
|
22
|
+
}, "onboardingCustomerView/acknowledgeOnboardingAiFinanceTeam", never, never>, acknowledgeOnboardingAiFinanceTeamSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/acknowledgeOnboardingAiFinanceTeamSuccess">, acknowledgeOnboardingAiFinanceTeamFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/acknowledgeOnboardingAiFinanceTeamFailure", never, never>, acknowledgeOnboardingAiActivationViewed: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
|
|
23
|
+
companyId: string;
|
|
24
|
+
}, "onboardingCustomerView/acknowledgeOnboardingAiActivationViewed", never, never>, acknowledgeOnboardingAiActivationViewedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/acknowledgeOnboardingAiActivationViewedSuccess">, acknowledgeOnboardingAiActivationViewedFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/acknowledgeOnboardingAiActivationViewedFailure", never, never>, fetchAiAgentsActivationStatus: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/fetchAiAgentsActivationStatus">, fetchAiAgentsActivationStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
25
|
+
counts: AiAgentsActivationCounts;
|
|
26
|
+
phases: AiAgentsActivationPhase[];
|
|
27
|
+
}], {
|
|
28
|
+
counts: AiAgentsActivationCounts;
|
|
29
|
+
phases: AiAgentsActivationPhase[];
|
|
30
|
+
}, "onboardingCustomerView/fetchAiAgentsActivationStatusSuccess", never, never>, fetchAiAgentsActivationStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/fetchAiAgentsActivationStatusFailure", never, never>, aiAgentsActivationCountsUpdated: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: Partial<AiAgentsActivationCounts>], Partial<AiAgentsActivationCounts>, "onboardingCustomerView/aiAgentsActivationCountsUpdated", never, never>, aiAgentsActivationPhaseChanged: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: AiAgentsActivationPhase], AiAgentsActivationPhase, "onboardingCustomerView/aiAgentsActivationPhaseChanged", never, never>, updateOnboardingCustomerViewDashboardLoaded: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
|
|
20
31
|
companyId: string;
|
|
21
32
|
}, "onboardingCustomerView/updateOnboardingCustomerViewDashboardLoaded", never, never>, updateOnboardingCustomerViewDashboardLoadedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/updateOnboardingCustomerViewDashboardLoadedSuccess">, updateOnboardingCustomerViewDashboardLoadedFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/updateOnboardingCustomerViewDashboardLoadedFailure", never, never>, updateOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, sendForVerification: boolean, reCalculateCurrentStep?: boolean | undefined, isBillingAddressUpdate?: boolean | undefined, officerType?: "Officer_1" | "Officer_3" | "Officer_2" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10" | undefined], {
|
|
22
33
|
companyId: string;
|
|
@@ -72,11 +83,37 @@ export declare const fetchOnboardingCustomerView: import("@reduxjs/toolkit").Act
|
|
|
72
83
|
companyId: ID;
|
|
73
84
|
currentStep?: OnboardingStep;
|
|
74
85
|
reCalculateCurrentStep?: boolean;
|
|
75
|
-
}, "onboardingCustomerView/updateOnboardingCustomerViewLocalStoreData">, saveOnboardingCustomerViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<import("
|
|
86
|
+
}, "onboardingCustomerView/updateOnboardingCustomerViewLocalStoreData">, saveOnboardingCustomerViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<import("../../spendManagement/commonSetup/setupViewState").SetupViewLocalData>, "onboardingCustomerView/saveOnboardingCustomerViewDataInLocalStore">, saveOnboardingCompnayOfficerPhoneInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
76
87
|
officerType: CompanyOfficerType;
|
|
77
88
|
phone: string | number;
|
|
78
89
|
}, "onboardingCustomerView/saveOnboardingCompnayOfficerPhoneInLocalStore">, updateOnboardingCustomerViewUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<OnboardingCustomerViewUIState>, "onboardingCustomerView/updateOnboardingCustomerViewUIState">, sendOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/sendOnboardingOfficerOtp">, sendOnboardingOfficerOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
79
90
|
otpChallenge: string;
|
|
80
|
-
}, "onboardingCustomerView/sendOnboardingOfficerOtpSuccess">, sendOnboardingOfficerOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/sendOnboardingOfficerOtpFailure">, resendOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/resendOnboardingOfficerOtp">, verifyOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/verifyOnboardingOfficerOtp">, verifyOnboardingOfficerOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/verifyOnboardingOfficerOtpSuccess">, verifyOnboardingOfficerOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/verifyOnboardingOfficerOtpFailure">, clearOnboardingCustomerViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/clearOnboardingCustomerViewDataInLocalStore">, clearOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/clearOnboardingCustomerView"
|
|
91
|
+
}, "onboardingCustomerView/sendOnboardingOfficerOtpSuccess">, sendOnboardingOfficerOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/sendOnboardingOfficerOtpFailure">, resendOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/resendOnboardingOfficerOtp">, verifyOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/verifyOnboardingOfficerOtp">, verifyOnboardingOfficerOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/verifyOnboardingOfficerOtpSuccess">, verifyOnboardingOfficerOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/verifyOnboardingOfficerOtpFailure">, clearOnboardingCustomerViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/clearOnboardingCustomerViewDataInLocalStore">, clearOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/clearOnboardingCustomerView">, applyKycDocumentAutofillForOnboarding: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
92
|
+
autoFilledFieldNames: string[];
|
|
93
|
+
companyId: ID;
|
|
94
|
+
fileId: ID;
|
|
95
|
+
officerType: CompanyOfficerType;
|
|
96
|
+
values: Partial<CompanyOfficerLocalData>;
|
|
97
|
+
}], {
|
|
98
|
+
autoFilledFieldNames: string[];
|
|
99
|
+
companyId: ID;
|
|
100
|
+
fileId: ID;
|
|
101
|
+
officerType: CompanyOfficerType;
|
|
102
|
+
values: Partial<CompanyOfficerLocalData>;
|
|
103
|
+
}, "onboardingCustomerView/applyKycDocumentAutofillForOnboarding", never, never>, applyKybDocumentAutofillForOnboarding: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
104
|
+
autoFilledFieldNames: string[];
|
|
105
|
+
companyId: ID;
|
|
106
|
+
fileId: ID;
|
|
107
|
+
values: Partial<CompanyDetailsLocalData>;
|
|
108
|
+
}], {
|
|
109
|
+
autoFilledFieldNames: string[];
|
|
110
|
+
companyId: ID;
|
|
111
|
+
fileId: ID;
|
|
112
|
+
values: Partial<CompanyDetailsLocalData>;
|
|
113
|
+
}, "onboardingCustomerView/applyKybDocumentAutofillForOnboarding", never, never>, clearKycKybAutofillForOnboarding: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload?: {
|
|
114
|
+
officerType?: CompanyOfficerType;
|
|
115
|
+
} | undefined], {
|
|
116
|
+
officerType?: CompanyOfficerType;
|
|
117
|
+
}, "onboardingCustomerView/clearKycKybAutofillForOnboarding", never, never>;
|
|
81
118
|
declare const _default: import("redux").Reducer<OnboardingCustomerViewState>;
|
|
82
119
|
export default _default;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.verifyOnboardingOfficerOtpFailure = exports.verifyOnboardingOfficerOtpSuccess = exports.verifyOnboardingOfficerOtp = exports.resendOnboardingOfficerOtp = exports.sendOnboardingOfficerOtpFailure = exports.sendOnboardingOfficerOtpSuccess = exports.sendOnboardingOfficerOtp = exports.updateOnboardingCustomerViewUIState = exports.saveOnboardingCompnayOfficerPhoneInLocalStore = exports.saveOnboardingCustomerViewDataInLocalStore = exports.updateOnboardingCustomerViewLocalStoreData = exports.updateOnboardingCustomerViewAccountDetails = exports.updateCurrentStep = exports.getOnboardingPlaidLinkTokenFailure = exports.getOnboardingPlaidLinkTokenSuccess = exports.getOnboardingPlaidLinkToken = exports.establishOnboardingPlaidConnectionFailure = exports.establishOnboardingPlaidConnectionSuccess = exports.establishOnboardingPlaidConnection = exports.updateOnboardingPaymentAccountLoginStatusFailure = exports.updateOnboardingPaymentAccountLoginStatusSuccess = exports.updateOnboardingPaymentAccountLoginStatus = exports.updateOnboardingPaymentAccountStatusFailure = exports.updateOnboardingPaymentAccountStatusSuccess = exports.updateOnboardingPaymentAccountStatus = exports.updateOnboardingCustomerViewFailure = exports.updateOnboardingCustomerViewSuccess = exports.updateOnboardingCustomerView = exports.updateOnboardingCustomerViewDashboardLoadedFailure = exports.updateOnboardingCustomerViewDashboardLoadedSuccess = exports.updateOnboardingCustomerViewDashboardLoaded = exports.aiAgentsActivationPhaseChanged = exports.aiAgentsActivationCountsUpdated = exports.fetchAiAgentsActivationStatusFailure = exports.fetchAiAgentsActivationStatusSuccess = exports.fetchAiAgentsActivationStatus = exports.acknowledgeOnboardingAiActivationViewedFailure = exports.acknowledgeOnboardingAiActivationViewedSuccess = exports.acknowledgeOnboardingAiActivationViewed = exports.acknowledgeOnboardingAiFinanceTeamFailure = exports.acknowledgeOnboardingAiFinanceTeamSuccess = exports.acknowledgeOnboardingAiFinanceTeam = exports.updateOnboardingCustomerViewCompleteStatusFailure = exports.updateOnboardingCustomerViewCompleteStatusSuccess = exports.updateOnboardingCustomerViewCompleteStatus = exports.fetchOnboardingCustomerSetupViewFailure = exports.fetchOnboardingCustomerSetupViewSuccess = exports.fetchOnboardingCustomerSetupView = exports.fetchOnboardingCustomerView = exports.initialState = void 0;
|
|
5
|
+
exports.clearKycKybAutofillForOnboarding = exports.applyKybDocumentAutofillForOnboarding = exports.applyKycDocumentAutofillForOnboarding = exports.clearOnboardingCustomerView = exports.clearOnboardingCustomerViewDataInLocalStore = void 0;
|
|
5
6
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
7
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
8
|
+
const kycKybAutofillActions_1 = require("../../spendManagement/commonSetup/kycKybAutofillActions");
|
|
9
|
+
const onboardingCustomerViewState_1 = require("./onboardingCustomerViewState");
|
|
7
10
|
const initialStatus = {
|
|
8
11
|
fetchState: 'Not-Started',
|
|
9
12
|
error: undefined,
|
|
@@ -13,61 +16,31 @@ exports.initialState = {
|
|
|
13
16
|
saveStatus: initialStatus,
|
|
14
17
|
dashboardLoadedStatus: initialStatus,
|
|
15
18
|
currentStep: 'link_payment_account',
|
|
19
|
+
parsingDocumentFileIds: [],
|
|
16
20
|
companyDetails: {
|
|
21
|
+
autoFilledFields: [],
|
|
17
22
|
localData: undefined,
|
|
18
23
|
},
|
|
19
|
-
companyOfficerUpdateStatus: {
|
|
20
|
-
|
|
24
|
+
companyOfficerUpdateStatus: (() => {
|
|
25
|
+
const emptyOfficerSlot = {
|
|
26
|
+
autoFilledFields: [],
|
|
21
27
|
localData: undefined,
|
|
22
28
|
sendOtpStatus: initialStatus,
|
|
23
29
|
otpverificationStatus: initialStatus,
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
otpverificationStatus: initialStatus,
|
|
39
|
-
},
|
|
40
|
-
Officer_5: {
|
|
41
|
-
localData: undefined,
|
|
42
|
-
sendOtpStatus: initialStatus,
|
|
43
|
-
otpverificationStatus: initialStatus,
|
|
44
|
-
},
|
|
45
|
-
Officer_6: {
|
|
46
|
-
localData: undefined,
|
|
47
|
-
sendOtpStatus: initialStatus,
|
|
48
|
-
otpverificationStatus: initialStatus,
|
|
49
|
-
},
|
|
50
|
-
Officer_7: {
|
|
51
|
-
localData: undefined,
|
|
52
|
-
sendOtpStatus: initialStatus,
|
|
53
|
-
otpverificationStatus: initialStatus,
|
|
54
|
-
},
|
|
55
|
-
Officer_8: {
|
|
56
|
-
localData: undefined,
|
|
57
|
-
sendOtpStatus: initialStatus,
|
|
58
|
-
otpverificationStatus: initialStatus,
|
|
59
|
-
},
|
|
60
|
-
Officer_9: {
|
|
61
|
-
localData: undefined,
|
|
62
|
-
sendOtpStatus: initialStatus,
|
|
63
|
-
otpverificationStatus: initialStatus,
|
|
64
|
-
},
|
|
65
|
-
Officer_10: {
|
|
66
|
-
localData: undefined,
|
|
67
|
-
sendOtpStatus: initialStatus,
|
|
68
|
-
otpverificationStatus: initialStatus,
|
|
69
|
-
},
|
|
70
|
-
},
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
Officer_1: { ...emptyOfficerSlot },
|
|
33
|
+
Officer_2: { ...emptyOfficerSlot },
|
|
34
|
+
Officer_3: { ...emptyOfficerSlot },
|
|
35
|
+
Officer_4: { ...emptyOfficerSlot },
|
|
36
|
+
Officer_5: { ...emptyOfficerSlot },
|
|
37
|
+
Officer_6: { ...emptyOfficerSlot },
|
|
38
|
+
Officer_7: { ...emptyOfficerSlot },
|
|
39
|
+
Officer_8: { ...emptyOfficerSlot },
|
|
40
|
+
Officer_9: { ...emptyOfficerSlot },
|
|
41
|
+
Officer_10: { ...emptyOfficerSlot },
|
|
42
|
+
};
|
|
43
|
+
})(),
|
|
71
44
|
primaryContactDetails: {},
|
|
72
45
|
paymentAccountDetails: {
|
|
73
46
|
fetchStatus: initialStatus,
|
|
@@ -95,6 +68,7 @@ exports.initialState = {
|
|
|
95
68
|
},
|
|
96
69
|
fetchState: 'Not-Started',
|
|
97
70
|
error: undefined,
|
|
71
|
+
aiAgentsActivation: { ...onboardingCustomerViewState_1.emptyAiAgentsActivationSubview },
|
|
98
72
|
uiState: {
|
|
99
73
|
isQBOPopupOpen: false,
|
|
100
74
|
isCardPaymentPopupOpen: false,
|
|
@@ -184,6 +158,126 @@ const onboardingCustomerView = (0, toolkit_1.createSlice)({
|
|
|
184
158
|
};
|
|
185
159
|
},
|
|
186
160
|
},
|
|
161
|
+
acknowledgeOnboardingAiFinanceTeam: {
|
|
162
|
+
reducer(draft) {
|
|
163
|
+
draft.aiFinanceTeamAcknowledgementStatus = {
|
|
164
|
+
fetchState: 'In-Progress',
|
|
165
|
+
error: undefined,
|
|
166
|
+
};
|
|
167
|
+
},
|
|
168
|
+
prepare(companyId) {
|
|
169
|
+
return {
|
|
170
|
+
payload: { companyId },
|
|
171
|
+
};
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
acknowledgeOnboardingAiFinanceTeamSuccess(draft) {
|
|
175
|
+
draft.aiFinanceTeamAcknowledgementStatus = {
|
|
176
|
+
fetchState: 'Completed',
|
|
177
|
+
error: undefined,
|
|
178
|
+
};
|
|
179
|
+
},
|
|
180
|
+
acknowledgeOnboardingAiFinanceTeamFailure: {
|
|
181
|
+
reducer(draft, action) {
|
|
182
|
+
draft.aiFinanceTeamAcknowledgementStatus = {
|
|
183
|
+
fetchState: 'Error',
|
|
184
|
+
error: action.payload,
|
|
185
|
+
};
|
|
186
|
+
},
|
|
187
|
+
prepare(error) {
|
|
188
|
+
return {
|
|
189
|
+
payload: error,
|
|
190
|
+
};
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
acknowledgeOnboardingAiActivationViewed: {
|
|
194
|
+
reducer(draft) {
|
|
195
|
+
draft.aiActivationViewedAcknowledgementStatus = {
|
|
196
|
+
fetchState: 'In-Progress',
|
|
197
|
+
error: undefined,
|
|
198
|
+
};
|
|
199
|
+
},
|
|
200
|
+
prepare(companyId) {
|
|
201
|
+
return {
|
|
202
|
+
payload: { companyId },
|
|
203
|
+
};
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
acknowledgeOnboardingAiActivationViewedSuccess(draft) {
|
|
207
|
+
draft.aiActivationViewedAcknowledgementStatus = {
|
|
208
|
+
fetchState: 'Completed',
|
|
209
|
+
error: undefined,
|
|
210
|
+
};
|
|
211
|
+
},
|
|
212
|
+
acknowledgeOnboardingAiActivationViewedFailure: {
|
|
213
|
+
reducer(draft, action) {
|
|
214
|
+
draft.aiActivationViewedAcknowledgementStatus = {
|
|
215
|
+
fetchState: 'Error',
|
|
216
|
+
error: action.payload,
|
|
217
|
+
};
|
|
218
|
+
},
|
|
219
|
+
prepare(error) {
|
|
220
|
+
return {
|
|
221
|
+
payload: error,
|
|
222
|
+
};
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
fetchAiAgentsActivationStatus(draft) {
|
|
226
|
+
draft.aiAgentsActivation.fetchStatus = {
|
|
227
|
+
fetchState: 'In-Progress',
|
|
228
|
+
error: undefined,
|
|
229
|
+
};
|
|
230
|
+
},
|
|
231
|
+
fetchAiAgentsActivationStatusSuccess: {
|
|
232
|
+
reducer(draft, action) {
|
|
233
|
+
draft.aiAgentsActivation.fetchStatus = {
|
|
234
|
+
fetchState: 'Completed',
|
|
235
|
+
error: undefined,
|
|
236
|
+
};
|
|
237
|
+
draft.aiAgentsActivation.phases = action.payload.phases;
|
|
238
|
+
draft.aiAgentsActivation.counts = action.payload.counts;
|
|
239
|
+
},
|
|
240
|
+
prepare(payload) {
|
|
241
|
+
return { payload };
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
fetchAiAgentsActivationStatusFailure: {
|
|
245
|
+
reducer(draft, action) {
|
|
246
|
+
draft.aiAgentsActivation.fetchStatus = {
|
|
247
|
+
fetchState: 'Error',
|
|
248
|
+
error: action.payload,
|
|
249
|
+
};
|
|
250
|
+
},
|
|
251
|
+
prepare(error) {
|
|
252
|
+
return { payload: error };
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
aiAgentsActivationCountsUpdated: {
|
|
256
|
+
reducer(draft, action) {
|
|
257
|
+
draft.aiAgentsActivation.counts = {
|
|
258
|
+
...draft.aiAgentsActivation.counts,
|
|
259
|
+
...action.payload,
|
|
260
|
+
};
|
|
261
|
+
},
|
|
262
|
+
prepare(payload) {
|
|
263
|
+
return { payload };
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
aiAgentsActivationPhaseChanged: {
|
|
267
|
+
reducer(draft, action) {
|
|
268
|
+
const target = draft.aiAgentsActivation.phases;
|
|
269
|
+
const index = target.findIndex((phase) => phase.key === action.payload.key);
|
|
270
|
+
if (index === -1) {
|
|
271
|
+
target.push(action.payload);
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
target[index] = { ...target[index], ...action.payload };
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
prepare(payload) {
|
|
278
|
+
return { payload };
|
|
279
|
+
},
|
|
280
|
+
},
|
|
187
281
|
updateOnboardingCustomerViewDashboardLoaded: {
|
|
188
282
|
reducer(draft) {
|
|
189
283
|
draft.dashboardLoadedStatus = {
|
|
@@ -596,7 +690,82 @@ const onboardingCustomerView = (0, toolkit_1.createSlice)({
|
|
|
596
690
|
clearOnboardingCustomerView(draft) {
|
|
597
691
|
Object.assign(draft, exports.initialState);
|
|
598
692
|
},
|
|
693
|
+
/** Merge AI-parsed officer fields into the officer's onboarding localData. */
|
|
694
|
+
applyKycDocumentAutofillForOnboarding: {
|
|
695
|
+
reducer(draft, action) {
|
|
696
|
+
const { officerType, values, autoFilledFieldNames, fileId } = action.payload;
|
|
697
|
+
const slot = draft.companyOfficerUpdateStatus[officerType];
|
|
698
|
+
slot.localData = Object.assign({}, slot.localData, values);
|
|
699
|
+
slot.autoFilledFields = Array.from(new Set([...(slot.autoFilledFields ?? []), ...autoFilledFieldNames]));
|
|
700
|
+
draft.parsingDocumentFileIds = (draft.parsingDocumentFileIds ?? []).filter((id) => id !== fileId);
|
|
701
|
+
},
|
|
702
|
+
prepare(payload) {
|
|
703
|
+
return { payload };
|
|
704
|
+
},
|
|
705
|
+
},
|
|
706
|
+
/** Merge AI-parsed company fields into companyDetails onboarding localData. */
|
|
707
|
+
applyKybDocumentAutofillForOnboarding: {
|
|
708
|
+
reducer(draft, action) {
|
|
709
|
+
const { values, autoFilledFieldNames, fileId } = action.payload;
|
|
710
|
+
draft.companyDetails.localData = Object.assign({}, draft.companyDetails.localData, values);
|
|
711
|
+
const prev = draft.companyDetails.autoFilledFields ?? [];
|
|
712
|
+
draft.companyDetails.autoFilledFields = Array.from(new Set([...prev, ...autoFilledFieldNames]));
|
|
713
|
+
draft.parsingDocumentFileIds = (draft.parsingDocumentFileIds ?? []).filter((id) => id !== fileId);
|
|
714
|
+
},
|
|
715
|
+
prepare(payload) {
|
|
716
|
+
return { payload };
|
|
717
|
+
},
|
|
718
|
+
},
|
|
719
|
+
/** Wipe AI-autofill badges during onboarding. */
|
|
720
|
+
clearKycKybAutofillForOnboarding: {
|
|
721
|
+
reducer(draft, action) {
|
|
722
|
+
const { officerType } = action.payload;
|
|
723
|
+
if (officerType != null) {
|
|
724
|
+
draft.companyOfficerUpdateStatus[officerType].autoFilledFields = [];
|
|
725
|
+
}
|
|
726
|
+
else {
|
|
727
|
+
draft.companyDetails.autoFilledFields = [];
|
|
728
|
+
Object.keys(draft.companyOfficerUpdateStatus).forEach((key) => {
|
|
729
|
+
draft.companyOfficerUpdateStatus[key].autoFilledFields = [];
|
|
730
|
+
});
|
|
731
|
+
}
|
|
732
|
+
},
|
|
733
|
+
prepare(payload = {}) {
|
|
734
|
+
return { payload };
|
|
735
|
+
},
|
|
736
|
+
},
|
|
737
|
+
},
|
|
738
|
+
extraReducers: (builder) => {
|
|
739
|
+
const addParsingFileId = (draft, fileId) => {
|
|
740
|
+
draft.parsingDocumentFileIds = draft.parsingDocumentFileIds ?? [];
|
|
741
|
+
if (!draft.parsingDocumentFileIds.includes(fileId)) {
|
|
742
|
+
draft.parsingDocumentFileIds.push(fileId);
|
|
743
|
+
}
|
|
744
|
+
};
|
|
745
|
+
const removeParsingFileId = (draft, fileId) => {
|
|
746
|
+
draft.parsingDocumentFileIds = (draft.parsingDocumentFileIds ?? []).filter((id) => id !== fileId);
|
|
747
|
+
};
|
|
748
|
+
builder.addCase(kycKybAutofillActions_1.parseUploadedKycDocument, (draft, action) => {
|
|
749
|
+
if (action.payload.target === 'onboarding') {
|
|
750
|
+
addParsingFileId(draft, action.payload.fileId);
|
|
751
|
+
}
|
|
752
|
+
});
|
|
753
|
+
builder.addCase(kycKybAutofillActions_1.parseUploadedKybDocument, (draft, action) => {
|
|
754
|
+
if (action.payload.target === 'onboarding') {
|
|
755
|
+
addParsingFileId(draft, action.payload.fileId);
|
|
756
|
+
}
|
|
757
|
+
});
|
|
758
|
+
builder.addCase(kycKybAutofillActions_1.parseUploadedKycDocumentFailure, (draft, action) => {
|
|
759
|
+
if (action.payload.target === 'onboarding') {
|
|
760
|
+
removeParsingFileId(draft, action.payload.fileId);
|
|
761
|
+
}
|
|
762
|
+
});
|
|
763
|
+
builder.addCase(kycKybAutofillActions_1.parseUploadedKybDocumentFailure, (draft, action) => {
|
|
764
|
+
if (action.payload.target === 'onboarding') {
|
|
765
|
+
removeParsingFileId(draft, action.payload.fileId);
|
|
766
|
+
}
|
|
767
|
+
});
|
|
599
768
|
},
|
|
600
769
|
});
|
|
601
|
-
_a = onboardingCustomerView.actions, exports.fetchOnboardingCustomerView = _a.fetchOnboardingCustomerView, exports.fetchOnboardingCustomerSetupView = _a.fetchOnboardingCustomerSetupView, exports.fetchOnboardingCustomerSetupViewSuccess = _a.fetchOnboardingCustomerSetupViewSuccess, exports.fetchOnboardingCustomerSetupViewFailure = _a.fetchOnboardingCustomerSetupViewFailure, exports.updateOnboardingCustomerViewCompleteStatus = _a.updateOnboardingCustomerViewCompleteStatus, exports.updateOnboardingCustomerViewCompleteStatusSuccess = _a.updateOnboardingCustomerViewCompleteStatusSuccess, exports.updateOnboardingCustomerViewCompleteStatusFailure = _a.updateOnboardingCustomerViewCompleteStatusFailure, exports.updateOnboardingCustomerViewDashboardLoaded = _a.updateOnboardingCustomerViewDashboardLoaded, exports.updateOnboardingCustomerViewDashboardLoadedSuccess = _a.updateOnboardingCustomerViewDashboardLoadedSuccess, exports.updateOnboardingCustomerViewDashboardLoadedFailure = _a.updateOnboardingCustomerViewDashboardLoadedFailure, exports.updateOnboardingCustomerView = _a.updateOnboardingCustomerView, exports.updateOnboardingCustomerViewSuccess = _a.updateOnboardingCustomerViewSuccess, exports.updateOnboardingCustomerViewFailure = _a.updateOnboardingCustomerViewFailure, exports.updateOnboardingPaymentAccountStatus = _a.updateOnboardingPaymentAccountStatus, exports.updateOnboardingPaymentAccountStatusSuccess = _a.updateOnboardingPaymentAccountStatusSuccess, exports.updateOnboardingPaymentAccountStatusFailure = _a.updateOnboardingPaymentAccountStatusFailure, exports.updateOnboardingPaymentAccountLoginStatus = _a.updateOnboardingPaymentAccountLoginStatus, exports.updateOnboardingPaymentAccountLoginStatusSuccess = _a.updateOnboardingPaymentAccountLoginStatusSuccess, exports.updateOnboardingPaymentAccountLoginStatusFailure = _a.updateOnboardingPaymentAccountLoginStatusFailure, exports.establishOnboardingPlaidConnection = _a.establishOnboardingPlaidConnection, exports.establishOnboardingPlaidConnectionSuccess = _a.establishOnboardingPlaidConnectionSuccess, exports.establishOnboardingPlaidConnectionFailure = _a.establishOnboardingPlaidConnectionFailure, exports.getOnboardingPlaidLinkToken = _a.getOnboardingPlaidLinkToken, exports.getOnboardingPlaidLinkTokenSuccess = _a.getOnboardingPlaidLinkTokenSuccess, exports.getOnboardingPlaidLinkTokenFailure = _a.getOnboardingPlaidLinkTokenFailure, exports.updateCurrentStep = _a.updateCurrentStep, exports.updateOnboardingCustomerViewAccountDetails = _a.updateOnboardingCustomerViewAccountDetails, exports.updateOnboardingCustomerViewLocalStoreData = _a.updateOnboardingCustomerViewLocalStoreData, exports.saveOnboardingCustomerViewDataInLocalStore = _a.saveOnboardingCustomerViewDataInLocalStore, exports.saveOnboardingCompnayOfficerPhoneInLocalStore = _a.saveOnboardingCompnayOfficerPhoneInLocalStore, exports.updateOnboardingCustomerViewUIState = _a.updateOnboardingCustomerViewUIState, exports.sendOnboardingOfficerOtp = _a.sendOnboardingOfficerOtp, exports.sendOnboardingOfficerOtpSuccess = _a.sendOnboardingOfficerOtpSuccess, exports.sendOnboardingOfficerOtpFailure = _a.sendOnboardingOfficerOtpFailure, exports.resendOnboardingOfficerOtp = _a.resendOnboardingOfficerOtp, exports.verifyOnboardingOfficerOtp = _a.verifyOnboardingOfficerOtp, exports.verifyOnboardingOfficerOtpSuccess = _a.verifyOnboardingOfficerOtpSuccess, exports.verifyOnboardingOfficerOtpFailure = _a.verifyOnboardingOfficerOtpFailure, exports.clearOnboardingCustomerViewDataInLocalStore = _a.clearOnboardingCustomerViewDataInLocalStore, exports.clearOnboardingCustomerView = _a.clearOnboardingCustomerView;
|
|
770
|
+
_a = onboardingCustomerView.actions, exports.fetchOnboardingCustomerView = _a.fetchOnboardingCustomerView, exports.fetchOnboardingCustomerSetupView = _a.fetchOnboardingCustomerSetupView, exports.fetchOnboardingCustomerSetupViewSuccess = _a.fetchOnboardingCustomerSetupViewSuccess, exports.fetchOnboardingCustomerSetupViewFailure = _a.fetchOnboardingCustomerSetupViewFailure, exports.updateOnboardingCustomerViewCompleteStatus = _a.updateOnboardingCustomerViewCompleteStatus, exports.updateOnboardingCustomerViewCompleteStatusSuccess = _a.updateOnboardingCustomerViewCompleteStatusSuccess, exports.updateOnboardingCustomerViewCompleteStatusFailure = _a.updateOnboardingCustomerViewCompleteStatusFailure, exports.acknowledgeOnboardingAiFinanceTeam = _a.acknowledgeOnboardingAiFinanceTeam, exports.acknowledgeOnboardingAiFinanceTeamSuccess = _a.acknowledgeOnboardingAiFinanceTeamSuccess, exports.acknowledgeOnboardingAiFinanceTeamFailure = _a.acknowledgeOnboardingAiFinanceTeamFailure, exports.acknowledgeOnboardingAiActivationViewed = _a.acknowledgeOnboardingAiActivationViewed, exports.acknowledgeOnboardingAiActivationViewedSuccess = _a.acknowledgeOnboardingAiActivationViewedSuccess, exports.acknowledgeOnboardingAiActivationViewedFailure = _a.acknowledgeOnboardingAiActivationViewedFailure, exports.fetchAiAgentsActivationStatus = _a.fetchAiAgentsActivationStatus, exports.fetchAiAgentsActivationStatusSuccess = _a.fetchAiAgentsActivationStatusSuccess, exports.fetchAiAgentsActivationStatusFailure = _a.fetchAiAgentsActivationStatusFailure, exports.aiAgentsActivationCountsUpdated = _a.aiAgentsActivationCountsUpdated, exports.aiAgentsActivationPhaseChanged = _a.aiAgentsActivationPhaseChanged, exports.updateOnboardingCustomerViewDashboardLoaded = _a.updateOnboardingCustomerViewDashboardLoaded, exports.updateOnboardingCustomerViewDashboardLoadedSuccess = _a.updateOnboardingCustomerViewDashboardLoadedSuccess, exports.updateOnboardingCustomerViewDashboardLoadedFailure = _a.updateOnboardingCustomerViewDashboardLoadedFailure, exports.updateOnboardingCustomerView = _a.updateOnboardingCustomerView, exports.updateOnboardingCustomerViewSuccess = _a.updateOnboardingCustomerViewSuccess, exports.updateOnboardingCustomerViewFailure = _a.updateOnboardingCustomerViewFailure, exports.updateOnboardingPaymentAccountStatus = _a.updateOnboardingPaymentAccountStatus, exports.updateOnboardingPaymentAccountStatusSuccess = _a.updateOnboardingPaymentAccountStatusSuccess, exports.updateOnboardingPaymentAccountStatusFailure = _a.updateOnboardingPaymentAccountStatusFailure, exports.updateOnboardingPaymentAccountLoginStatus = _a.updateOnboardingPaymentAccountLoginStatus, exports.updateOnboardingPaymentAccountLoginStatusSuccess = _a.updateOnboardingPaymentAccountLoginStatusSuccess, exports.updateOnboardingPaymentAccountLoginStatusFailure = _a.updateOnboardingPaymentAccountLoginStatusFailure, exports.establishOnboardingPlaidConnection = _a.establishOnboardingPlaidConnection, exports.establishOnboardingPlaidConnectionSuccess = _a.establishOnboardingPlaidConnectionSuccess, exports.establishOnboardingPlaidConnectionFailure = _a.establishOnboardingPlaidConnectionFailure, exports.getOnboardingPlaidLinkToken = _a.getOnboardingPlaidLinkToken, exports.getOnboardingPlaidLinkTokenSuccess = _a.getOnboardingPlaidLinkTokenSuccess, exports.getOnboardingPlaidLinkTokenFailure = _a.getOnboardingPlaidLinkTokenFailure, exports.updateCurrentStep = _a.updateCurrentStep, exports.updateOnboardingCustomerViewAccountDetails = _a.updateOnboardingCustomerViewAccountDetails, exports.updateOnboardingCustomerViewLocalStoreData = _a.updateOnboardingCustomerViewLocalStoreData, exports.saveOnboardingCustomerViewDataInLocalStore = _a.saveOnboardingCustomerViewDataInLocalStore, exports.saveOnboardingCompnayOfficerPhoneInLocalStore = _a.saveOnboardingCompnayOfficerPhoneInLocalStore, exports.updateOnboardingCustomerViewUIState = _a.updateOnboardingCustomerViewUIState, exports.sendOnboardingOfficerOtp = _a.sendOnboardingOfficerOtp, exports.sendOnboardingOfficerOtpSuccess = _a.sendOnboardingOfficerOtpSuccess, exports.sendOnboardingOfficerOtpFailure = _a.sendOnboardingOfficerOtpFailure, exports.resendOnboardingOfficerOtp = _a.resendOnboardingOfficerOtp, exports.verifyOnboardingOfficerOtp = _a.verifyOnboardingOfficerOtp, exports.verifyOnboardingOfficerOtpSuccess = _a.verifyOnboardingOfficerOtpSuccess, exports.verifyOnboardingOfficerOtpFailure = _a.verifyOnboardingOfficerOtpFailure, exports.clearOnboardingCustomerViewDataInLocalStore = _a.clearOnboardingCustomerViewDataInLocalStore, exports.clearOnboardingCustomerView = _a.clearOnboardingCustomerView, exports.applyKycDocumentAutofillForOnboarding = _a.applyKycDocumentAutofillForOnboarding, exports.applyKybDocumentAutofillForOnboarding = _a.applyKybDocumentAutofillForOnboarding, exports.clearKycKybAutofillForOnboarding = _a.clearKycKybAutofillForOnboarding;
|
|
602
771
|
exports.default = onboardingCustomerView.reducer;
|
|
@@ -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 { OnboardingCustomerViewUIState, OnboardingStep } from './onboardingCustomerViewState';
|
|
18
|
+
import { AiAgentsActivationCounts, AiAgentsActivationPhase, AiAgentsActivationSubview, OnboardingCustomerViewUIState, OnboardingStep } from './onboardingCustomerViewState';
|
|
19
19
|
export interface OnboardingCustomerView {
|
|
20
20
|
allNationalityCountries: Country[];
|
|
21
21
|
allRequiredStepsCompleted: boolean;
|
|
@@ -28,6 +28,7 @@ export interface OnboardingCustomerView {
|
|
|
28
28
|
fetchStatus: FetchStateAndError;
|
|
29
29
|
halfCompletedSteps: OnboardingStep[];
|
|
30
30
|
isInterimEmailSent: boolean;
|
|
31
|
+
parsingDocumentFileIds: ID[];
|
|
31
32
|
paymentAccountFetchStatus: FetchStateAndError;
|
|
32
33
|
paymentAccountUpdateStatus: FetchStateAndError;
|
|
33
34
|
pendingSaveDetails: {
|
|
@@ -55,3 +56,6 @@ export declare const onboardingStepsData: (isValidConnection: boolean, productSe
|
|
|
55
56
|
};
|
|
56
57
|
export declare function isCompanyDetailsSavePending(fileState: FileState, company?: CompanyView, primaryContact?: User, companyDetailsLocalData?: CompanyDetails): boolean;
|
|
57
58
|
export declare const getProductSettingsString: (productSettings: TenantProductSettings | undefined) => string;
|
|
59
|
+
export declare const getAiAgentsActivationSubview: (state: RootState) => AiAgentsActivationSubview;
|
|
60
|
+
export declare const getAiAgentsActivationPhases: (state: RootState) => AiAgentsActivationPhase[];
|
|
61
|
+
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.getProductSettingsString = exports.onboardingStepsData = void 0;
|
|
3
|
+
exports.getAiAgentsActivationCounts = exports.getAiAgentsActivationPhases = exports.getAiAgentsActivationSubview = 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, updateStatus, saveStatus, currentStep, uiState, fetchState, error, } = onboardingCustomerViewState;
|
|
20
|
+
const { companyDetails, companyOfficerUpdateStatus, primaryContactDetails, subscriptionPaymentAccountIds, paymentAccountDetails, plaidConnectionDetails, parsingDocumentFileIds, updateStatus, saveStatus, currentStep, uiState, fetchState, error, } = onboardingCustomerViewState;
|
|
21
21
|
const { paymentAccountIds } = paymentAccountDetails;
|
|
22
22
|
let subscriptionPaymentAccount;
|
|
23
23
|
let paymentAccount;
|
|
@@ -60,6 +60,7 @@ function getOnboardingCustomerView(state, companyId) {
|
|
|
60
60
|
companyDetails,
|
|
61
61
|
companyOfficerUpdateStatus,
|
|
62
62
|
primaryContactDetails,
|
|
63
|
+
parsingDocumentFileIds,
|
|
63
64
|
});
|
|
64
65
|
const companyAddress = addressViewState.newAddressState?.company_address;
|
|
65
66
|
if (companyAddress == null &&
|
|
@@ -125,6 +126,7 @@ function getOnboardingCustomerView(state, companyId) {
|
|
|
125
126
|
return {
|
|
126
127
|
companyDetailsLocalData,
|
|
127
128
|
companyOfficerLocalData,
|
|
129
|
+
parsingDocumentFileIds,
|
|
128
130
|
subscriptionBillingAddress: subscriptionBillingAddress?.addressToCreate,
|
|
129
131
|
companyView,
|
|
130
132
|
allNationalityCountries,
|
|
@@ -331,3 +333,14 @@ const getProductSettingsString = (productSettings) => {
|
|
|
331
333
|
.join(',');
|
|
332
334
|
};
|
|
333
335
|
exports.getProductSettingsString = getProductSettingsString;
|
|
336
|
+
const fromActivationView = (state) =>
|
|
337
|
+
// Fall back to the empty subview so state hydrated from an older persisted
|
|
338
|
+
// version (before aiAgentsActivation existed) doesn't crash on .phases/.counts.
|
|
339
|
+
state.onboardingCustomerViewState.aiAgentsActivation ??
|
|
340
|
+
onboardingCustomerViewState_1.emptyAiAgentsActivationSubview;
|
|
341
|
+
const getAiAgentsActivationSubview = (state) => fromActivationView(state);
|
|
342
|
+
exports.getAiAgentsActivationSubview = getAiAgentsActivationSubview;
|
|
343
|
+
const getAiAgentsActivationPhases = (state) => fromActivationView(state).phases;
|
|
344
|
+
exports.getAiAgentsActivationPhases = getAiAgentsActivationPhases;
|
|
345
|
+
const getAiAgentsActivationCounts = (state) => fromActivationView(state).counts;
|
|
346
|
+
exports.getAiAgentsActivationCounts = getAiAgentsActivationCounts;
|