@zeniai/client-epic-state 5.1.0 → 5.1.1-beta0ND
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/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +1 -0
- package/lib/entity/company/companyPayload.d.ts +4 -0
- package/lib/entity/company/companyPayload.js +4 -0
- package/lib/entity/company/companyStateTypes.d.ts +4 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +18 -6
- package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +1 -0
- package/lib/entity/paymentAccount/paymentAccountSelector.js +9 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -2
- package/lib/entity/tenant/clearAllEpic.js +2 -2
- 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 +70 -10
- package/lib/entity/tenant/tenantState.d.ts +1 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +4 -2
- package/lib/epic.d.ts +8 -3
- package/lib/epic.js +9 -3
- package/lib/esm/commonStateTypes/animations.js +1 -0
- package/lib/esm/entity/cardPolicy/extractPolicyDocumentEpic.js +1 -1
- package/lib/esm/entity/company/companyPayload.js +4 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +18 -6
- package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +8 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +2 -2
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +50 -0
- package/lib/esm/entity/tenant/tenantReducer.js +68 -8
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +4 -2
- package/lib/esm/epic.js +9 -3
- package/lib/esm/index.js +12 -9
- package/lib/esm/reducer.js +3 -3
- package/lib/esm/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.js +3 -3
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -1
- 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/autotransferRules/autoTransferRulesSelector.js +1 -1
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +1 -1
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +1 -3
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +1 -2
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +1 -1
- 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 +15 -11
- package/lib/index.js +64 -44
- package/lib/reducer.d.ts +3 -3
- package/lib/reducer.js +3 -3
- package/lib/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.d.ts +1 -1
- package/lib/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.js +2 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -1
- 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/autotransferRules/autoTransferRulesSelector.js +1 -1
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +1 -1
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +1 -3
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.d.ts +1 -1
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +1 -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
|
@@ -13,8 +13,8 @@ import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
|
13
13
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
14
14
|
import { UncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
15
15
|
import { UpdateTransactionCategorizationResponsePayload } from '../payload/transactionCategorizationPayload';
|
|
16
|
-
import { SupportedTransactionCategorization, TransactionSaveUpdates, TransactionsTab, TransactionsTabViewState, TransactionsViewState, TransactionsViewUIState } from '../types/transactionsViewState';
|
|
17
16
|
import { TransactionFilters } from '../transactionFilterHelpers';
|
|
17
|
+
import { SupportedTransactionCategorization, TransactionSaveUpdates, TransactionsTab, TransactionsTabViewState, TransactionsViewState, TransactionsViewUIState } from '../types/transactionsViewState';
|
|
18
18
|
export declare const initialTransactionTabViewState: TransactionsTabViewState;
|
|
19
19
|
export declare const initialState: TransactionsViewState;
|
|
20
20
|
export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", period: TimePeriod, cacheOverride?: any, keepExistingListItems?: any, searchString?: string | undefined, pageToken?: PageToken | undefined, refreshViewInBackground?: any, resetListItems?: boolean | undefined, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { TransactionWithCOT } from '../../../entity/transaction/stateTypes/transaction';
|
|
3
3
|
import { RootState } from '../../../reducer';
|
|
4
|
-
import { TransactionView } from '../transactionFilterHelpers';
|
|
5
4
|
import { ExpenseAutomationTransactionViewSelector, TransactionReviewLocalDataSelectorView } from '../selectorTypes/transactionsViewSelectorTypes';
|
|
5
|
+
import { TransactionView } from '../transactionFilterHelpers';
|
|
6
6
|
export declare const getCategorizationInFlightRecommendationsByTransactionId: (state: RootState) => Record<ID, boolean>;
|
|
7
7
|
export declare const getCategorizationHasInFlightRecommendations: (state: RootState) => boolean;
|
|
8
8
|
export declare const toTransactionView: (transaction: TransactionWithCOT, transactionLocalData?: TransactionReviewLocalDataSelectorView) => TransactionView;
|
|
@@ -12,12 +12,12 @@ const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
|
12
12
|
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
13
13
|
const transactionHelper_1 = require("../../../entity/transaction/transactionHelper");
|
|
14
14
|
const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
|
|
15
|
-
const transactionFilterHelpers_1 = require("../transactionFilterHelpers");
|
|
16
15
|
const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
17
16
|
const classListSelector_1 = require("../../classList/classListSelector");
|
|
18
17
|
const createTransferEntrySelector_1 = require("../../createTransferEntry/createTransferEntrySelector");
|
|
19
18
|
const projectListSelector_1 = require("../../projectList/projectListSelector");
|
|
20
19
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
20
|
+
const transactionFilterHelpers_1 = require("../transactionFilterHelpers");
|
|
21
21
|
// Walks the tab's transactionReviewLocalDataById map and returns
|
|
22
22
|
// `{ [transactionId]: true }` for every transaction that has at least
|
|
23
23
|
// one line whose targeted-fetch is In-Progress. Pulled out as a plain
|
|
@@ -16,8 +16,8 @@ import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
|
16
16
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
17
17
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
18
18
|
import { EntityRecommendationKey } from '../../recommendation/recommendationState';
|
|
19
|
-
import { TransactionFilters } from '../transactionFilterHelpers';
|
|
20
19
|
import { TransactionDetailKey } from '../../transactionDetail/transactionDetailState';
|
|
20
|
+
import { TransactionFilters } from '../transactionFilterHelpers';
|
|
21
21
|
import { CompletedSubTab } from './completedSubTab';
|
|
22
22
|
export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "project" | "category" | "class" | "payment_account" | "transaction_type" | "memo_and_receipt";
|
|
23
23
|
export type TransactionsSortKey = ReturnType<typeof toTransactionsSortKey>;
|
|
@@ -6,7 +6,7 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const fileReducer_1 = require("../../../entity/file/fileReducer");
|
|
7
7
|
const responsePayload_1 = require("../../../responsePayload");
|
|
8
8
|
const fileViewReducer_1 = require("../fileViewReducer");
|
|
9
|
-
const deleteFileEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(fileViewReducer_1.deleteFile.match), (0, operators_1.
|
|
9
|
+
const deleteFileEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(fileViewReducer_1.deleteFile.match), (0, operators_1.mergeMap)((action) => {
|
|
10
10
|
/**
|
|
11
11
|
* tenantId is required for deleting onboarding files.
|
|
12
12
|
*/
|
|
@@ -6,7 +6,7 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const fileReducer_1 = require("../../../entity/file/fileReducer");
|
|
7
7
|
const responsePayload_1 = require("../../../responsePayload");
|
|
8
8
|
const fileViewReducer_1 = require("../fileViewReducer");
|
|
9
|
-
const deleteFileListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(fileViewReducer_1.deleteFileList.match), (0, operators_1.
|
|
9
|
+
const deleteFileListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(fileViewReducer_1.deleteFileList.match), (0, operators_1.mergeMap)((action) => {
|
|
10
10
|
const { fileIds } = action.payload;
|
|
11
11
|
return zeniAPI
|
|
12
12
|
.deleteAndGetJSON(`${zeniAPI.apiEndPoints.fileMicroServiceBaseUrl}/1.0/files?query=${encodeURIComponent(JSON.stringify({ file_ids: fileIds }))}`)
|
|
@@ -6,7 +6,7 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const fileReducer_1 = require("../../../entity/file/fileReducer");
|
|
7
7
|
const responsePayload_1 = require("../../../responsePayload");
|
|
8
8
|
const fileViewReducer_1 = require("../fileViewReducer");
|
|
9
|
-
const updateFileNameEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(fileViewReducer_1.updateFileName.match), (0, operators_1.
|
|
9
|
+
const updateFileNameEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(fileViewReducer_1.updateFileName.match), (0, operators_1.mergeMap)((action) => {
|
|
10
10
|
/**
|
|
11
11
|
* tenantId is required for updating onboarding file names.
|
|
12
12
|
*/
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
5
|
+
import { fetchAiAgentsActivationStatus, fetchAiAgentsActivationStatusFailure, fetchAiAgentsActivationStatusSuccess } from '../../onboardingCustomerViewReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof fetchAiAgentsActivationStatus> | ReturnType<typeof fetchAiAgentsActivationStatusSuccess> | ReturnType<typeof fetchAiAgentsActivationStatusFailure>;
|
|
7
|
+
export declare const fetchAiAgentsActivationStatusEpic: (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.fetchAiAgentsActivationStatusEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
+
const onboardingCustomerViewReducer_1 = require("../../onboardingCustomerViewReducer");
|
|
8
|
+
const toPhaseStatus = (raw) => {
|
|
9
|
+
if (raw === 'idle' ||
|
|
10
|
+
raw === 'starting' ||
|
|
11
|
+
raw === 'building' ||
|
|
12
|
+
raw === 'ready') {
|
|
13
|
+
return raw;
|
|
14
|
+
}
|
|
15
|
+
return 'idle';
|
|
16
|
+
};
|
|
17
|
+
const toPhase = (row) => ({
|
|
18
|
+
key: row.key,
|
|
19
|
+
status: toPhaseStatus(row.status),
|
|
20
|
+
startedAt: row.started_at,
|
|
21
|
+
completedAt: row.completed_at,
|
|
22
|
+
});
|
|
23
|
+
const toCounts = (payload) => ({
|
|
24
|
+
customerCount: payload?.customer_count ?? 0,
|
|
25
|
+
glAccountCount: payload?.gl_account_count ?? 0,
|
|
26
|
+
targetTransactionCount: payload?.target_transaction_count ?? 0,
|
|
27
|
+
transactionCount: payload?.transaction_count ?? 0,
|
|
28
|
+
vendorCount: payload?.vendor_count ?? 0,
|
|
29
|
+
});
|
|
30
|
+
const fetchAiAgentsActivationStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(onboardingCustomerViewReducer_1.fetchAiAgentsActivationStatus.match), (0, operators_1.mergeMap)(() => {
|
|
31
|
+
const url = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/ai-agents-activation/status`;
|
|
32
|
+
return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
|
|
33
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
34
|
+
const phases = (response.data.phases ?? []).map(toPhase);
|
|
35
|
+
return (0, rxjs_1.of)((0, onboardingCustomerViewReducer_1.fetchAiAgentsActivationStatusSuccess)({
|
|
36
|
+
phases,
|
|
37
|
+
counts: toCounts(response.data.counts),
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
return (0, rxjs_1.of)((0, onboardingCustomerViewReducer_1.fetchAiAgentsActivationStatusFailure)(response.status));
|
|
41
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, onboardingCustomerViewReducer_1.fetchAiAgentsActivationStatusFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'fetchAiAgentsActivationStatus errored out ' +
|
|
42
|
+
JSON.stringify(error))))));
|
|
43
|
+
}));
|
|
44
|
+
exports.fetchAiAgentsActivationStatusEpic = fetchAiAgentsActivationStatusEpic;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateCompanies } from '../../../../../entity/company/companyReducer';
|
|
4
|
+
import { RootState } from '../../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
6
|
+
import { acknowledgeOnboardingAiActivationViewed, acknowledgeOnboardingAiActivationViewedFailure, acknowledgeOnboardingAiActivationViewedSuccess } from '../../onboardingCustomerViewReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof acknowledgeOnboardingAiActivationViewed> | ReturnType<typeof updateCompanies> | ReturnType<typeof acknowledgeOnboardingAiActivationViewedSuccess> | ReturnType<typeof acknowledgeOnboardingAiActivationViewedFailure>;
|
|
8
|
+
export declare const acknowledgeOnboardingAiActivationViewedEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -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;
|