@zeniai/client-epic-state 5.0.83 → 5.0.84-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/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +1 -1
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +1 -0
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +1 -140
- package/lib/entity/aiCfo/aiCfoReducer.d.ts +2 -23
- package/lib/entity/aiCfo/aiCfoReducer.js +4 -332
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -13
- package/lib/entity/aiCfo/aiCfoSelector.js +1 -28
- package/lib/entity/aiCfo/aiCfoState.d.ts +4 -225
- package/lib/entity/aiCfo/aiCfoState.js +1 -30
- package/lib/entity/company/companyPayload.d.ts +2 -0
- package/lib/entity/company/companyPayload.js +2 -0
- package/lib/entity/company/companyStateTypes.d.ts +2 -0
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +1 -1
- package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +1 -0
- package/lib/entity/paymentAccount/paymentAccountSelector.js +4 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -3
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -6
- package/lib/entity/tenant/clearAllEpic.js +0 -8
- 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 +19 -0
- package/lib/entity/tenant/tenantReducer.d.ts +49 -28
- package/lib/entity/tenant/tenantReducer.js +111 -5
- package/lib/entity/tenant/tenantState.d.ts +21 -0
- package/lib/epic.d.ts +6 -11
- package/lib/epic.js +7 -11
- package/lib/esm/commonStateTypes/animations.js +1 -0
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +4 -332
- package/lib/esm/entity/aiCfo/aiCfoSelector.js +1 -26
- package/lib/esm/entity/aiCfo/aiCfoState.js +0 -27
- package/lib/esm/entity/company/companyPayload.js +2 -0
- package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +3 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +1 -3
- package/lib/esm/entity/tenant/clearAllEpic.js +0 -8
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +50 -0
- package/lib/esm/entity/tenant/tenantReducer.js +108 -3
- package/lib/esm/epic.js +7 -11
- package/lib/esm/index.js +16 -28
- package/lib/esm/reducer.js +0 -12
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +3 -6
- package/lib/esm/view/aiCfoView/epics/createSessionAndSubmitEpic.js +2 -5
- package/lib/esm/view/aiCfoView/epics/createSessionEpic.js +1 -2
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +2 -12
- package/lib/esm/view/companyView/companyViewReducer.js +45 -1
- package/lib/esm/view/companyView/epic/companyPassport/dismissCapitalizationOnboardingEpic.js +25 -0
- package/lib/esm/view/companyView/epic/companyPassport/updateCapitalizationThresholdEpic.js +79 -0
- package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
- package/lib/esm/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +45 -0
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +40 -0
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +168 -50
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +14 -0
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +13 -0
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -25
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +2 -2
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +4 -16
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +0 -38
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +49 -0
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +58 -0
- package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +12 -0
- package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +205 -0
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +71 -52
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +2 -0
- package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +28 -0
- package/lib/index.d.ts +19 -28
- package/lib/index.js +36 -136
- package/lib/reducer.d.ts +0 -12
- package/lib/reducer.js +0 -12
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +2 -11
- package/lib/view/aiCfoView/aiCfoViewReducer.js +3 -6
- package/lib/view/aiCfoView/epics/createSessionAndSubmitEpic.js +2 -5
- package/lib/view/aiCfoView/epics/createSessionEpic.js +1 -2
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +1 -8
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +2 -12
- package/lib/view/companyView/companyViewReducer.d.ts +11 -1
- package/lib/view/companyView/companyViewReducer.js +47 -3
- package/lib/view/companyView/epic/companyPassport/dismissCapitalizationOnboardingEpic.d.ts +9 -0
- package/lib/view/companyView/epic/companyPassport/dismissCapitalizationOnboardingEpic.js +29 -0
- package/lib/view/companyView/epic/companyPassport/updateCapitalizationThresholdEpic.d.ts +10 -0
- package/lib/view/companyView/epic/companyPassport/updateCapitalizationThresholdEpic.js +83 -0
- package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +1 -0
- package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.d.ts +7 -0
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +49 -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 +170 -51
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +7 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +21 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +37 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +14 -1
- package/lib/view/people/peopleTypes.d.ts +1 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +0 -14
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +1 -27
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +1 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +1 -5
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +5 -17
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +0 -27
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +1 -43
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +0 -2
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +8 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +53 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +8 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +62 -0
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +27 -0
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +15 -0
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +24 -0
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +213 -0
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +24 -2
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +72 -53
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +4 -0
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +2 -0
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +12 -0
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +125 -0
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +32 -0
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +1 -1
- package/package.json +1 -1
- package/lib/entity/cardPolicy/cardPolicyPayload.d.ts +0 -277
- package/lib/entity/cardPolicy/cardPolicyPayload.js +0 -143
- package/lib/entity/cardPolicy/cardPolicyReducer.d.ts +0 -19
- package/lib/entity/cardPolicy/cardPolicyReducer.js +0 -265
- package/lib/entity/cardPolicy/cardPolicySelector.d.ts +0 -32
- package/lib/entity/cardPolicy/cardPolicySelector.js +0 -103
- package/lib/entity/cardPolicy/cardPolicyState.d.ts +0 -205
- package/lib/entity/cardPolicy/cardPolicyState.js +0 -14
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.d.ts +0 -18
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.js +0 -68
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.d.ts +0 -26
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +0 -47
- package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.d.ts +0 -25
- package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +0 -39
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.d.ts +0 -23
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.js +0 -111
- package/lib/esm/entity/cardPolicy/cardPolicyPayload.js +0 -130
- package/lib/esm/entity/cardPolicy/cardPolicyReducer.js +0 -261
- package/lib/esm/entity/cardPolicy/cardPolicySelector.js +0 -79
- package/lib/esm/entity/cardPolicy/cardPolicyState.js +0 -9
- package/lib/esm/entity/cardPolicy/extractPolicyDocumentEpic.js +0 -64
- package/lib/esm/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +0 -43
- package/lib/esm/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +0 -35
- package/lib/esm/entity/cardPolicy/policyRecommendationFromUploadEpic.js +0 -107
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +0 -70
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +0 -22
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +0 -56
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +0 -49
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +0 -42
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +0 -72
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +0 -21
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +0 -56
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +0 -62
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +0 -39
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +0 -53
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +0 -25
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.d.ts +0 -14
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +0 -74
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.d.ts +0 -21
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +0 -28
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.d.ts +0 -25
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +0 -2
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.d.ts +0 -19
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +0 -60
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.d.ts +0 -18
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +0 -53
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.d.ts +0 -16
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +0 -46
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +0 -76
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.d.ts +0 -21
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +0 -27
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.d.ts +0 -19
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +0 -2
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.d.ts +0 -19
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +0 -60
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.d.ts +0 -13
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +0 -66
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.d.ts +0 -32
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +0 -46
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.d.ts +0 -45
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +0 -2
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.d.ts +0 -25
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +0 -57
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +0 -29
|
@@ -66,11 +66,8 @@ function waitForChannelSubscription(pusherInstance, channelName, timeoutMs = 500
|
|
|
66
66
|
}));
|
|
67
67
|
}
|
|
68
68
|
export const createSessionAndSubmitEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(createSessionAndSubmit.match), switchMap((action) => {
|
|
69
|
-
const { agentId, userId, questionAnswerId, questionId, createdAt, question, files,
|
|
70
|
-
const payload = {
|
|
71
|
-
agent_id: agentId,
|
|
72
|
-
...(pageContext != null && { page_context: pageContext }),
|
|
73
|
-
};
|
|
69
|
+
const { agentId, userId, questionAnswerId, questionId, createdAt, question, files, } = action.payload;
|
|
70
|
+
const payload = { agent_id: agentId };
|
|
74
71
|
return zeniAPI
|
|
75
72
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/sessions`, payload)
|
|
76
73
|
.pipe(mergeMap((response) => {
|
|
@@ -5,12 +5,11 @@ import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload
|
|
|
5
5
|
import { date as zeniDate } from '../../../zeniDayJS';
|
|
6
6
|
import { createSession, createSessionFailure, createSessionSuccess, } from '../aiCfoViewReducer';
|
|
7
7
|
export const createSessionEpic = (actions$, _, zeniAPI) => actions$.pipe(filter(createSession.match), switchMap((action) => {
|
|
8
|
-
const { agentId, contextRefId, contextType,
|
|
8
|
+
const { agentId, contextRefId, contextType, userId } = action.payload;
|
|
9
9
|
const payload = {
|
|
10
10
|
agent_id: agentId,
|
|
11
11
|
...(contextRefId != null && { context_ref_id: contextRefId }),
|
|
12
12
|
...(contextType != null && { context_type: contextType }),
|
|
13
|
-
...(pageContext != null && { page_context: pageContext }),
|
|
14
13
|
};
|
|
15
14
|
return zeniAPI
|
|
16
15
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/sessions`, payload)
|
|
@@ -2,23 +2,13 @@ import { of } from 'rxjs';
|
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
4
|
import { fetchSuggestedQuestions, fetchSuggestedQuestionsFailure, fetchSuggestedQuestionsSuccess, } from '../aiCfoViewReducer';
|
|
5
|
-
/**
|
|
6
|
-
* GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=...
|
|
7
|
-
*
|
|
8
|
-
* Appends `&no_card_created=true` when the action payload sets
|
|
9
|
-
* `noCardCreated: true` (AI Card Creation flow on the cards list — the tenant
|
|
10
|
-
* has not yet created any card). Any other value omits the flag entirely so
|
|
11
|
-
* the existing call sites continue to issue the unchanged request.
|
|
12
|
-
*/
|
|
5
|
+
/** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
|
|
13
6
|
export const fetchSuggestedQuestionsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchSuggestedQuestions.match),
|
|
14
7
|
// mergeMap (not switchMap): each page_context is keyed separately in Redux; switchMap
|
|
15
8
|
// would cancel in-flight HTTP for context A when B is requested, leaving A stuck In-Progress.
|
|
16
9
|
mergeMap((action) => {
|
|
17
|
-
const { pageContext
|
|
10
|
+
const { pageContext } = action.payload;
|
|
18
11
|
const query = new URLSearchParams({ page_context: pageContext });
|
|
19
|
-
if (noCardCreated === true) {
|
|
20
|
-
query.set('no_card_created', 'true');
|
|
21
|
-
}
|
|
22
12
|
const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?${query.toString()}`;
|
|
23
13
|
return zeniAPI.getJSON(url).pipe(mergeMap((response) => {
|
|
24
14
|
if (isSuccessResponse(response) && response.data != null) {
|
|
@@ -309,6 +309,50 @@ const companyView = createSlice({
|
|
|
309
309
|
error: action.payload.status,
|
|
310
310
|
};
|
|
311
311
|
},
|
|
312
|
+
updateCapitalizationThreshold: {
|
|
313
|
+
prepare(companyId, capitalizationThreshold, capitalizationThresholdMaxCeiling, dismissOnboardingForPopupType) {
|
|
314
|
+
return {
|
|
315
|
+
payload: {
|
|
316
|
+
companyId,
|
|
317
|
+
capitalizationThreshold,
|
|
318
|
+
capitalizationThresholdMaxCeiling,
|
|
319
|
+
dismissOnboardingForPopupType,
|
|
320
|
+
},
|
|
321
|
+
};
|
|
322
|
+
},
|
|
323
|
+
reducer(draft,
|
|
324
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
325
|
+
_action) {
|
|
326
|
+
draft.passportView.capitalizationThresholdUpdateStatus = {
|
|
327
|
+
fetchState: 'In-Progress',
|
|
328
|
+
error: undefined,
|
|
329
|
+
};
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
updateCapitalizationThresholdSuccess(draft) {
|
|
333
|
+
draft.passportView.capitalizationThresholdUpdateStatus = {
|
|
334
|
+
fetchState: 'Completed',
|
|
335
|
+
error: undefined,
|
|
336
|
+
};
|
|
337
|
+
},
|
|
338
|
+
updateCapitalizationThresholdFailure(draft, action) {
|
|
339
|
+
draft.passportView.capitalizationThresholdUpdateStatus = {
|
|
340
|
+
fetchState: 'Error',
|
|
341
|
+
error: action.payload.status,
|
|
342
|
+
};
|
|
343
|
+
},
|
|
344
|
+
dismissCapitalizationOnboarding: {
|
|
345
|
+
prepare(companyId, popupType) {
|
|
346
|
+
return { payload: { companyId, popupType } };
|
|
347
|
+
},
|
|
348
|
+
reducer(
|
|
349
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
350
|
+
_draft,
|
|
351
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
352
|
+
_action) {
|
|
353
|
+
// No loading state needed — fire-and-forget
|
|
354
|
+
},
|
|
355
|
+
},
|
|
312
356
|
companyPassportUpdatePrimaryContact: {
|
|
313
357
|
reducer(draft, action) {
|
|
314
358
|
const { primaryContact } = action.payload;
|
|
@@ -582,5 +626,5 @@ const companyView = createSlice({
|
|
|
582
626
|
},
|
|
583
627
|
},
|
|
584
628
|
});
|
|
585
|
-
export const { fetchCompanyPassportView, fetchAllCockpitViews, fetchOnboardingView, fetchManagementView, fetchSubscriptionView, fetchPortfolioView, fetchCompanyManagementView, companyManagementSaveUpdates, companyManagementSavePendingUpdates, companyManagementDiscardUpdates, companyManagementSaveUpdatesSuccess, companyManagementSaveUpdatesFailure, updateCompanyViewOnSuccess, updateCompanyViewOnFailure, fetchCompanyPortfolioView, fetchZeniUsers, updateZeniUsersOnSuccess, updateZeniUsersOnFailure, clearCompanyView, updateCompanyPortfolioUIState, updateCompanyManagementUIState, companyPassportSaveDataInLocalStore, deleteCompanyOfficerInLocalStore, companyPassportClearDataInLocalStore, companyPassportUpdateCompanyDetails, companyPassportUpdateCompanyDetailsSuccess, companyPassportUpdateCompanyDetailsFailure, updateAccountingClassesEnabled, updateAccountingClassesEnabledSuccess, updateAccountingClassesEnabledFailure, companyPassportUpdatePrimaryContact, companyPassportUpdatePrimaryContactSuccess, companyPassportUpdatePrimaryContactFailure, companyPassportUpdateCompanyOfficer, companyPassportUpdateCompanyOfficerSuccess, companyPassportUpdateCompanyOfficerFailure, companyPassportCreateCompanyOfficers, companyPassportCreateCompanyOfficersSuccess, companyPassportCreateCompanyOfficersFailure, updateCompanyPassportLocalStoreData, saveIndustryAndIncDateInCompanyPassportLocalStore, saveCompanyPassportDetails, fetchParentSubsidiaryManagementView, updateParentSubsidiaryView, updateParentSubsidiaryViewOnFailure, updateCompanyDownloadState, fetchCompanyMetaData, updateCompanyMetaDataOnSuccess, updateCompanyMetaDataOnFailure, updateMetaDataOnSendMonthEndReport, } = companyView.actions;
|
|
629
|
+
export const { fetchCompanyPassportView, fetchAllCockpitViews, fetchOnboardingView, fetchManagementView, fetchSubscriptionView, fetchPortfolioView, fetchCompanyManagementView, companyManagementSaveUpdates, companyManagementSavePendingUpdates, companyManagementDiscardUpdates, companyManagementSaveUpdatesSuccess, companyManagementSaveUpdatesFailure, updateCompanyViewOnSuccess, updateCompanyViewOnFailure, fetchCompanyPortfolioView, fetchZeniUsers, updateZeniUsersOnSuccess, updateZeniUsersOnFailure, clearCompanyView, updateCompanyPortfolioUIState, updateCompanyManagementUIState, companyPassportSaveDataInLocalStore, deleteCompanyOfficerInLocalStore, companyPassportClearDataInLocalStore, companyPassportUpdateCompanyDetails, companyPassportUpdateCompanyDetailsSuccess, companyPassportUpdateCompanyDetailsFailure, updateAccountingClassesEnabled, updateAccountingClassesEnabledSuccess, updateAccountingClassesEnabledFailure, updateCapitalizationThreshold, updateCapitalizationThresholdSuccess, updateCapitalizationThresholdFailure, dismissCapitalizationOnboarding, companyPassportUpdatePrimaryContact, companyPassportUpdatePrimaryContactSuccess, companyPassportUpdatePrimaryContactFailure, companyPassportUpdateCompanyOfficer, companyPassportUpdateCompanyOfficerSuccess, companyPassportUpdateCompanyOfficerFailure, companyPassportCreateCompanyOfficers, companyPassportCreateCompanyOfficersSuccess, companyPassportCreateCompanyOfficersFailure, updateCompanyPassportLocalStoreData, saveIndustryAndIncDateInCompanyPassportLocalStore, saveCompanyPassportDetails, fetchParentSubsidiaryManagementView, updateParentSubsidiaryView, updateParentSubsidiaryViewOnFailure, updateCompanyDownloadState, fetchCompanyMetaData, updateCompanyMetaDataOnSuccess, updateCompanyMetaDataOnFailure, updateMetaDataOnSendMonthEndReport, } = companyView.actions;
|
|
586
630
|
export default companyView.reducer;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
+
import { updateTenantCapitalizationOnboardingDismissed } from '../../../../entity/tenant/tenantReducer';
|
|
4
|
+
import { isSuccessResponse } from '../../../../responsePayload';
|
|
5
|
+
import { dismissCapitalizationOnboarding } from '../../companyViewReducer';
|
|
6
|
+
export const dismissCapitalizationOnboardingEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(dismissCapitalizationOnboarding.match), switchMap((action) => {
|
|
7
|
+
const { companyId, popupType } = action.payload;
|
|
8
|
+
const tenantId = Object.values(state$.value.tenantState.tenantsById).find((t) => t.companyId === companyId)?.tenantId;
|
|
9
|
+
const body = popupType === 'prepaid'
|
|
10
|
+
? { capitalization_onboarding_shown_for_prepaid: true }
|
|
11
|
+
: { capitalization_onboarding_shown_for_fixed_asset: true };
|
|
12
|
+
return zeniAPI
|
|
13
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, body)
|
|
14
|
+
.pipe(mergeMap((response) => {
|
|
15
|
+
if (isSuccessResponse(response) && tenantId != null) {
|
|
16
|
+
return from([
|
|
17
|
+
updateTenantCapitalizationOnboardingDismissed({
|
|
18
|
+
tenantId,
|
|
19
|
+
popupType,
|
|
20
|
+
}),
|
|
21
|
+
]);
|
|
22
|
+
}
|
|
23
|
+
return from([]);
|
|
24
|
+
}), catchError(() => from([])));
|
|
25
|
+
}));
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
+
import { updateCompanies } from '../../../../entity/company/companyReducer';
|
|
4
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
5
|
+
import { updateTenantCapitalizationOnboardingDismissed, updateTenantCapitalizationThreshold, } from '../../../../entity/tenant/tenantReducer';
|
|
6
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
7
|
+
import { updateCapitalizationThreshold, updateCapitalizationThresholdFailure, updateCapitalizationThresholdSuccess, } from '../../companyViewReducer';
|
|
8
|
+
export const updateCapitalizationThresholdEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(updateCapitalizationThreshold.match), switchMap((action) => {
|
|
9
|
+
const { companyId, capitalizationThreshold, capitalizationThresholdMaxCeiling, dismissOnboardingForPopupType, } = action.payload;
|
|
10
|
+
const tenantId = Object.values(state$.value.tenantState.tenantsById).find((t) => t.companyId === companyId)?.tenantId;
|
|
11
|
+
const body = {
|
|
12
|
+
capitalization_threshold: capitalizationThreshold,
|
|
13
|
+
capitalization_threshold_max_ceiling: capitalizationThresholdMaxCeiling,
|
|
14
|
+
};
|
|
15
|
+
if (dismissOnboardingForPopupType === 'prepaid') {
|
|
16
|
+
body.capitalization_onboarding_shown_for_prepaid = true;
|
|
17
|
+
}
|
|
18
|
+
else if (dismissOnboardingForPopupType === 'fixed_asset') {
|
|
19
|
+
body.capitalization_onboarding_shown_for_fixed_asset = true;
|
|
20
|
+
}
|
|
21
|
+
return zeniAPI
|
|
22
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, body)
|
|
23
|
+
.pipe(mergeMap((response) => {
|
|
24
|
+
if (isSuccessResponse(response)) {
|
|
25
|
+
const companies = response.data?.companies ?? [];
|
|
26
|
+
const actions = [];
|
|
27
|
+
if (companies.length > 0) {
|
|
28
|
+
actions.push(updateCompanies({
|
|
29
|
+
payload: companies,
|
|
30
|
+
schema: {},
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
if (tenantId != null) {
|
|
34
|
+
actions.push(updateTenantCapitalizationThreshold({
|
|
35
|
+
tenantId,
|
|
36
|
+
capitalizationThreshold,
|
|
37
|
+
capitalizationThresholdMaxCeiling,
|
|
38
|
+
}));
|
|
39
|
+
if (dismissOnboardingForPopupType != null) {
|
|
40
|
+
actions.push(updateTenantCapitalizationOnboardingDismissed({
|
|
41
|
+
tenantId,
|
|
42
|
+
popupType: dismissOnboardingForPopupType,
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
actions.push(updateCapitalizationThresholdSuccess());
|
|
47
|
+
actions.push(openSnackbar({
|
|
48
|
+
messageSection: 'capitalization_threshold_update',
|
|
49
|
+
messageText: 'success',
|
|
50
|
+
type: 'success',
|
|
51
|
+
}));
|
|
52
|
+
return from(actions);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return from([
|
|
56
|
+
updateCapitalizationThresholdFailure({
|
|
57
|
+
status: response.status,
|
|
58
|
+
}),
|
|
59
|
+
openSnackbar({
|
|
60
|
+
messageSection: 'capitalization_threshold_update',
|
|
61
|
+
messageText: 'failed',
|
|
62
|
+
type: 'error',
|
|
63
|
+
}),
|
|
64
|
+
]);
|
|
65
|
+
}
|
|
66
|
+
}), catchError((error) => from([
|
|
67
|
+
updateCapitalizationThresholdFailure({
|
|
68
|
+
status: createZeniAPIStatus('Unexpected error', 'Update Capitalization Threshold errored out' +
|
|
69
|
+
(error instanceof Error
|
|
70
|
+
? error.message
|
|
71
|
+
: JSON.stringify(error))),
|
|
72
|
+
}),
|
|
73
|
+
openSnackbar({
|
|
74
|
+
messageSection: 'capitalization_threshold_update',
|
|
75
|
+
messageText: 'failed',
|
|
76
|
+
type: 'error',
|
|
77
|
+
}),
|
|
78
|
+
])));
|
|
79
|
+
}));
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
4
|
+
import { fetchAiAgentsActivationStatus, fetchAiAgentsActivationStatusFailure, fetchAiAgentsActivationStatusSuccess, } from '../../onboardingCustomerViewReducer';
|
|
5
|
+
const toPhaseStatus = (raw) => {
|
|
6
|
+
if (raw === 'idle' ||
|
|
7
|
+
raw === 'starting' ||
|
|
8
|
+
raw === 'building' ||
|
|
9
|
+
raw === 'ready') {
|
|
10
|
+
return raw;
|
|
11
|
+
}
|
|
12
|
+
return 'idle';
|
|
13
|
+
};
|
|
14
|
+
const toPhase = (section, row) => ({
|
|
15
|
+
key: row.key,
|
|
16
|
+
section,
|
|
17
|
+
status: toPhaseStatus(row.status),
|
|
18
|
+
startedAt: row.started_at,
|
|
19
|
+
completedAt: row.completed_at,
|
|
20
|
+
});
|
|
21
|
+
const toCounts = (payload) => ({
|
|
22
|
+
customerCount: payload?.customer_count ?? 0,
|
|
23
|
+
glAccountCount: payload?.gl_account_count ?? 0,
|
|
24
|
+
targetTransactionCount: payload?.target_transaction_count ?? 0,
|
|
25
|
+
transactionCount: payload?.transaction_count ?? 0,
|
|
26
|
+
vendorCount: payload?.vendor_count ?? 0,
|
|
27
|
+
});
|
|
28
|
+
export const fetchAiAgentsActivationStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchAiAgentsActivationStatus.match), mergeMap(() => {
|
|
29
|
+
const url = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/ai-agents-activation/status`;
|
|
30
|
+
return zeniAPI
|
|
31
|
+
.getJSON(url)
|
|
32
|
+
.pipe(mergeMap((response) => {
|
|
33
|
+
if (isSuccessResponse(response) && response.data != null) {
|
|
34
|
+
const ledgerPhases = (response.data.ledger_section ?? []).map((row) => toPhase('ledger', row));
|
|
35
|
+
const backgroundPhases = (response.data.background_section ?? []).map((row) => toPhase('background', row));
|
|
36
|
+
return of(fetchAiAgentsActivationStatusSuccess({
|
|
37
|
+
ledgerPhases,
|
|
38
|
+
backgroundPhases,
|
|
39
|
+
counts: toCounts(response.data.counts),
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
return of(fetchAiAgentsActivationStatusFailure(response.status));
|
|
43
|
+
}), catchError((error) => of(fetchAiAgentsActivationStatusFailure(createZeniAPIStatus('Unexpected Error', 'fetchAiAgentsActivationStatus errored out ' +
|
|
44
|
+
JSON.stringify(error))))));
|
|
45
|
+
}));
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { from, of } from 'rxjs';
|
|
2
|
+
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { updateCompanies } from '../../../../../entity/company/companyReducer';
|
|
4
|
+
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
5
|
+
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
|
|
6
|
+
import { acknowledgeOnboardingAiFinanceTeam, acknowledgeOnboardingAiFinanceTeamFailure, acknowledgeOnboardingAiFinanceTeamSuccess, } from '../../onboardingCustomerViewReducer';
|
|
7
|
+
export const acknowledgeOnboardingAiFinanceTeamEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(acknowledgeOnboardingAiFinanceTeam.match), mergeMap((action) => {
|
|
8
|
+
const { companyId } = action.payload;
|
|
9
|
+
const payload = {
|
|
10
|
+
is_onboarding_ai_finance_team_acknowledged: true,
|
|
11
|
+
};
|
|
12
|
+
return zeniAPI
|
|
13
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, payload)
|
|
14
|
+
.pipe(mergeMap((response) => {
|
|
15
|
+
if (isSuccessResponse(response) && response.data != null) {
|
|
16
|
+
const actions = [
|
|
17
|
+
updateCompanies({
|
|
18
|
+
payload: response.data.companies,
|
|
19
|
+
schema: {},
|
|
20
|
+
}),
|
|
21
|
+
acknowledgeOnboardingAiFinanceTeamSuccess(),
|
|
22
|
+
];
|
|
23
|
+
return from(actions);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return of(openSnackbar({
|
|
27
|
+
messageSection: 'onboarding_customer_view_complete',
|
|
28
|
+
messageText: 'failed',
|
|
29
|
+
type: 'error',
|
|
30
|
+
variables: [
|
|
31
|
+
{
|
|
32
|
+
variableName: '_api-error_',
|
|
33
|
+
variableValue: response.status.message,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
}), acknowledgeOnboardingAiFinanceTeamFailure(response.status));
|
|
37
|
+
}
|
|
38
|
+
}), catchError((error) => of(acknowledgeOnboardingAiFinanceTeamFailure(createZeniAPIStatus('Unexpected Error', 'Acknowledge - Onboarding AI Finance Team errored out' +
|
|
39
|
+
JSON.stringify(error))))));
|
|
40
|
+
}));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createSlice } from '@reduxjs/toolkit';
|
|
2
2
|
import { date } from '../../../zeniDayJS';
|
|
3
|
+
import { emptyAiAgentsActivationSubview, } from './onboardingCustomerViewState';
|
|
3
4
|
const initialStatus = {
|
|
4
5
|
fetchState: 'Not-Started',
|
|
5
6
|
error: undefined,
|
|
@@ -10,60 +11,29 @@ export const initialState = {
|
|
|
10
11
|
dashboardLoadedStatus: initialStatus,
|
|
11
12
|
currentStep: 'link_payment_account',
|
|
12
13
|
companyDetails: {
|
|
14
|
+
autoFilledFields: [],
|
|
13
15
|
localData: undefined,
|
|
14
16
|
},
|
|
15
|
-
companyOfficerUpdateStatus: {
|
|
16
|
-
|
|
17
|
+
companyOfficerUpdateStatus: (() => {
|
|
18
|
+
const emptyOfficerSlot = {
|
|
19
|
+
autoFilledFields: [],
|
|
17
20
|
localData: undefined,
|
|
18
21
|
sendOtpStatus: initialStatus,
|
|
19
22
|
otpverificationStatus: initialStatus,
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
otpverificationStatus: initialStatus,
|
|
35
|
-
},
|
|
36
|
-
Officer_5: {
|
|
37
|
-
localData: undefined,
|
|
38
|
-
sendOtpStatus: initialStatus,
|
|
39
|
-
otpverificationStatus: initialStatus,
|
|
40
|
-
},
|
|
41
|
-
Officer_6: {
|
|
42
|
-
localData: undefined,
|
|
43
|
-
sendOtpStatus: initialStatus,
|
|
44
|
-
otpverificationStatus: initialStatus,
|
|
45
|
-
},
|
|
46
|
-
Officer_7: {
|
|
47
|
-
localData: undefined,
|
|
48
|
-
sendOtpStatus: initialStatus,
|
|
49
|
-
otpverificationStatus: initialStatus,
|
|
50
|
-
},
|
|
51
|
-
Officer_8: {
|
|
52
|
-
localData: undefined,
|
|
53
|
-
sendOtpStatus: initialStatus,
|
|
54
|
-
otpverificationStatus: initialStatus,
|
|
55
|
-
},
|
|
56
|
-
Officer_9: {
|
|
57
|
-
localData: undefined,
|
|
58
|
-
sendOtpStatus: initialStatus,
|
|
59
|
-
otpverificationStatus: initialStatus,
|
|
60
|
-
},
|
|
61
|
-
Officer_10: {
|
|
62
|
-
localData: undefined,
|
|
63
|
-
sendOtpStatus: initialStatus,
|
|
64
|
-
otpverificationStatus: initialStatus,
|
|
65
|
-
},
|
|
66
|
-
},
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
Officer_1: { ...emptyOfficerSlot },
|
|
26
|
+
Officer_2: { ...emptyOfficerSlot },
|
|
27
|
+
Officer_3: { ...emptyOfficerSlot },
|
|
28
|
+
Officer_4: { ...emptyOfficerSlot },
|
|
29
|
+
Officer_5: { ...emptyOfficerSlot },
|
|
30
|
+
Officer_6: { ...emptyOfficerSlot },
|
|
31
|
+
Officer_7: { ...emptyOfficerSlot },
|
|
32
|
+
Officer_8: { ...emptyOfficerSlot },
|
|
33
|
+
Officer_9: { ...emptyOfficerSlot },
|
|
34
|
+
Officer_10: { ...emptyOfficerSlot },
|
|
35
|
+
};
|
|
36
|
+
})(),
|
|
67
37
|
primaryContactDetails: {},
|
|
68
38
|
paymentAccountDetails: {
|
|
69
39
|
fetchStatus: initialStatus,
|
|
@@ -91,6 +61,7 @@ export const initialState = {
|
|
|
91
61
|
},
|
|
92
62
|
fetchState: 'Not-Started',
|
|
93
63
|
error: undefined,
|
|
64
|
+
aiAgentsActivation: { ...emptyAiAgentsActivationSubview },
|
|
94
65
|
uiState: {
|
|
95
66
|
isQBOPopupOpen: false,
|
|
96
67
|
isCardPaymentPopupOpen: false,
|
|
@@ -180,6 +151,111 @@ const onboardingCustomerView = createSlice({
|
|
|
180
151
|
};
|
|
181
152
|
},
|
|
182
153
|
},
|
|
154
|
+
acknowledgeOnboardingAiFinanceTeam: {
|
|
155
|
+
reducer(draft) {
|
|
156
|
+
draft.aiFinanceTeamAcknowledgementStatus = {
|
|
157
|
+
fetchState: 'In-Progress',
|
|
158
|
+
error: undefined,
|
|
159
|
+
};
|
|
160
|
+
},
|
|
161
|
+
prepare(companyId) {
|
|
162
|
+
return {
|
|
163
|
+
payload: { companyId },
|
|
164
|
+
};
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
acknowledgeOnboardingAiFinanceTeamSuccess(draft) {
|
|
168
|
+
draft.aiFinanceTeamAcknowledgementStatus = {
|
|
169
|
+
fetchState: 'Completed',
|
|
170
|
+
error: undefined,
|
|
171
|
+
};
|
|
172
|
+
},
|
|
173
|
+
acknowledgeOnboardingAiFinanceTeamFailure: {
|
|
174
|
+
reducer(draft, action) {
|
|
175
|
+
draft.aiFinanceTeamAcknowledgementStatus = {
|
|
176
|
+
fetchState: 'Error',
|
|
177
|
+
error: action.payload,
|
|
178
|
+
};
|
|
179
|
+
},
|
|
180
|
+
prepare(error) {
|
|
181
|
+
return {
|
|
182
|
+
payload: error,
|
|
183
|
+
};
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
fetchAiAgentsActivationStatus(draft) {
|
|
187
|
+
draft.aiAgentsActivation.fetchStatus = {
|
|
188
|
+
fetchState: 'In-Progress',
|
|
189
|
+
error: undefined,
|
|
190
|
+
};
|
|
191
|
+
},
|
|
192
|
+
fetchAiAgentsActivationStatusSuccess: {
|
|
193
|
+
reducer(draft, action) {
|
|
194
|
+
draft.aiAgentsActivation.fetchStatus = {
|
|
195
|
+
fetchState: 'Completed',
|
|
196
|
+
error: undefined,
|
|
197
|
+
};
|
|
198
|
+
draft.aiAgentsActivation.ledgerPhases = action.payload.ledgerPhases;
|
|
199
|
+
draft.aiAgentsActivation.backgroundPhases =
|
|
200
|
+
action.payload.backgroundPhases;
|
|
201
|
+
draft.aiAgentsActivation.counts = action.payload.counts;
|
|
202
|
+
},
|
|
203
|
+
prepare(payload) {
|
|
204
|
+
return { payload };
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
fetchAiAgentsActivationStatusFailure: {
|
|
208
|
+
reducer(draft, action) {
|
|
209
|
+
draft.aiAgentsActivation.fetchStatus = {
|
|
210
|
+
fetchState: 'Error',
|
|
211
|
+
error: action.payload,
|
|
212
|
+
};
|
|
213
|
+
},
|
|
214
|
+
prepare(error) {
|
|
215
|
+
return { payload: error };
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
aiAgentsActivationCountsUpdated: {
|
|
219
|
+
reducer(draft, action) {
|
|
220
|
+
draft.aiAgentsActivation.counts = {
|
|
221
|
+
...draft.aiAgentsActivation.counts,
|
|
222
|
+
...action.payload,
|
|
223
|
+
};
|
|
224
|
+
},
|
|
225
|
+
prepare(payload) {
|
|
226
|
+
return { payload };
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
aiAgentsActivationPhaseChanged: {
|
|
230
|
+
reducer(draft, action) {
|
|
231
|
+
const target = action.payload.section === 'ledger'
|
|
232
|
+
? draft.aiAgentsActivation.ledgerPhases
|
|
233
|
+
: draft.aiAgentsActivation.backgroundPhases;
|
|
234
|
+
const index = target.findIndex((phase) => phase.key === action.payload.key);
|
|
235
|
+
if (index === -1) {
|
|
236
|
+
target.push(action.payload);
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
target[index] = { ...target[index], ...action.payload };
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
prepare(payload) {
|
|
243
|
+
return { payload };
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
aiAgentsActivationSectionReady: {
|
|
247
|
+
reducer(draft, action) {
|
|
248
|
+
const target = action.payload.section === 'ledger'
|
|
249
|
+
? draft.aiAgentsActivation.ledgerPhases
|
|
250
|
+
: draft.aiAgentsActivation.backgroundPhases;
|
|
251
|
+
target.forEach((phase) => {
|
|
252
|
+
phase.status = 'ready';
|
|
253
|
+
});
|
|
254
|
+
},
|
|
255
|
+
prepare(payload) {
|
|
256
|
+
return { payload };
|
|
257
|
+
},
|
|
258
|
+
},
|
|
183
259
|
updateOnboardingCustomerViewDashboardLoaded: {
|
|
184
260
|
reducer(draft) {
|
|
185
261
|
draft.dashboardLoadedStatus = {
|
|
@@ -592,7 +668,49 @@ const onboardingCustomerView = createSlice({
|
|
|
592
668
|
clearOnboardingCustomerView(draft) {
|
|
593
669
|
Object.assign(draft, initialState);
|
|
594
670
|
},
|
|
671
|
+
/** Merge AI-parsed officer fields into the officer's onboarding localData. */
|
|
672
|
+
applyKycDocumentAutofillForOnboarding: {
|
|
673
|
+
reducer(draft, action) {
|
|
674
|
+
const { officerType, values, autoFilledFieldNames } = action.payload;
|
|
675
|
+
const slot = draft.companyOfficerUpdateStatus[officerType];
|
|
676
|
+
slot.localData = Object.assign({}, slot.localData, values);
|
|
677
|
+
slot.autoFilledFields = Array.from(new Set([...slot.autoFilledFields, ...autoFilledFieldNames]));
|
|
678
|
+
},
|
|
679
|
+
prepare(payload) {
|
|
680
|
+
return { payload };
|
|
681
|
+
},
|
|
682
|
+
},
|
|
683
|
+
/** Merge AI-parsed company fields into companyDetails onboarding localData. */
|
|
684
|
+
applyKybDocumentAutofillForOnboarding: {
|
|
685
|
+
reducer(draft, action) {
|
|
686
|
+
const { values, autoFilledFieldNames } = action.payload;
|
|
687
|
+
draft.companyDetails.localData = Object.assign({}, draft.companyDetails.localData, values);
|
|
688
|
+
const prev = draft.companyDetails.autoFilledFields ?? [];
|
|
689
|
+
draft.companyDetails.autoFilledFields = Array.from(new Set([...prev, ...autoFilledFieldNames]));
|
|
690
|
+
},
|
|
691
|
+
prepare(payload) {
|
|
692
|
+
return { payload };
|
|
693
|
+
},
|
|
694
|
+
},
|
|
695
|
+
/** Wipe AI-autofill badges during onboarding. */
|
|
696
|
+
clearKycKybAutofillForOnboarding: {
|
|
697
|
+
reducer(draft, action) {
|
|
698
|
+
const { officerType } = action.payload;
|
|
699
|
+
if (officerType != null) {
|
|
700
|
+
draft.companyOfficerUpdateStatus[officerType].autoFilledFields = [];
|
|
701
|
+
}
|
|
702
|
+
else {
|
|
703
|
+
draft.companyDetails.autoFilledFields = [];
|
|
704
|
+
Object.keys(draft.companyOfficerUpdateStatus).forEach((key) => {
|
|
705
|
+
draft.companyOfficerUpdateStatus[key].autoFilledFields = [];
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
},
|
|
709
|
+
prepare(payload = {}) {
|
|
710
|
+
return { payload };
|
|
711
|
+
},
|
|
712
|
+
},
|
|
595
713
|
},
|
|
596
714
|
});
|
|
597
|
-
export const { fetchOnboardingCustomerView, fetchOnboardingCustomerSetupView, fetchOnboardingCustomerSetupViewSuccess, fetchOnboardingCustomerSetupViewFailure, updateOnboardingCustomerViewCompleteStatus, updateOnboardingCustomerViewCompleteStatusSuccess, updateOnboardingCustomerViewCompleteStatusFailure, updateOnboardingCustomerViewDashboardLoaded, updateOnboardingCustomerViewDashboardLoadedSuccess, updateOnboardingCustomerViewDashboardLoadedFailure, updateOnboardingCustomerView, updateOnboardingCustomerViewSuccess, updateOnboardingCustomerViewFailure, updateOnboardingPaymentAccountStatus, updateOnboardingPaymentAccountStatusSuccess, updateOnboardingPaymentAccountStatusFailure, updateOnboardingPaymentAccountLoginStatus, updateOnboardingPaymentAccountLoginStatusSuccess, updateOnboardingPaymentAccountLoginStatusFailure, establishOnboardingPlaidConnection, establishOnboardingPlaidConnectionSuccess, establishOnboardingPlaidConnectionFailure, getOnboardingPlaidLinkToken, getOnboardingPlaidLinkTokenSuccess, getOnboardingPlaidLinkTokenFailure, updateCurrentStep, updateOnboardingCustomerViewAccountDetails, updateOnboardingCustomerViewLocalStoreData, saveOnboardingCustomerViewDataInLocalStore, saveOnboardingCompnayOfficerPhoneInLocalStore, updateOnboardingCustomerViewUIState, sendOnboardingOfficerOtp, sendOnboardingOfficerOtpSuccess, sendOnboardingOfficerOtpFailure, resendOnboardingOfficerOtp, verifyOnboardingOfficerOtp, verifyOnboardingOfficerOtpSuccess, verifyOnboardingOfficerOtpFailure, clearOnboardingCustomerViewDataInLocalStore, clearOnboardingCustomerView, } = onboardingCustomerView.actions;
|
|
715
|
+
export const { fetchOnboardingCustomerView, fetchOnboardingCustomerSetupView, fetchOnboardingCustomerSetupViewSuccess, fetchOnboardingCustomerSetupViewFailure, updateOnboardingCustomerViewCompleteStatus, updateOnboardingCustomerViewCompleteStatusSuccess, updateOnboardingCustomerViewCompleteStatusFailure, acknowledgeOnboardingAiFinanceTeam, acknowledgeOnboardingAiFinanceTeamSuccess, acknowledgeOnboardingAiFinanceTeamFailure, fetchAiAgentsActivationStatus, fetchAiAgentsActivationStatusSuccess, fetchAiAgentsActivationStatusFailure, aiAgentsActivationCountsUpdated, aiAgentsActivationPhaseChanged, aiAgentsActivationSectionReady, updateOnboardingCustomerViewDashboardLoaded, updateOnboardingCustomerViewDashboardLoadedSuccess, updateOnboardingCustomerViewDashboardLoadedFailure, updateOnboardingCustomerView, updateOnboardingCustomerViewSuccess, updateOnboardingCustomerViewFailure, updateOnboardingPaymentAccountStatus, updateOnboardingPaymentAccountStatusSuccess, updateOnboardingPaymentAccountStatusFailure, updateOnboardingPaymentAccountLoginStatus, updateOnboardingPaymentAccountLoginStatusSuccess, updateOnboardingPaymentAccountLoginStatusFailure, establishOnboardingPlaidConnection, establishOnboardingPlaidConnectionSuccess, establishOnboardingPlaidConnectionFailure, getOnboardingPlaidLinkToken, getOnboardingPlaidLinkTokenSuccess, getOnboardingPlaidLinkTokenFailure, updateCurrentStep, updateOnboardingCustomerViewAccountDetails, updateOnboardingCustomerViewLocalStoreData, saveOnboardingCustomerViewDataInLocalStore, saveOnboardingCompnayOfficerPhoneInLocalStore, updateOnboardingCustomerViewUIState, sendOnboardingOfficerOtp, sendOnboardingOfficerOtpSuccess, sendOnboardingOfficerOtpFailure, resendOnboardingOfficerOtp, verifyOnboardingOfficerOtp, verifyOnboardingOfficerOtpSuccess, verifyOnboardingOfficerOtpFailure, clearOnboardingCustomerViewDataInLocalStore, clearOnboardingCustomerView, applyKycDocumentAutofillForOnboarding, applyKybDocumentAutofillForOnboarding, clearKycKybAutofillForOnboarding, } = onboardingCustomerView.actions;
|
|
598
716
|
export default onboardingCustomerView.reducer;
|
|
@@ -323,3 +323,17 @@ export const getProductSettingsString = (productSettings) => {
|
|
|
323
323
|
.map((key) => productKeyMap[key])
|
|
324
324
|
.join(',');
|
|
325
325
|
};
|
|
326
|
+
const fromActivationView = (state) => state.onboardingCustomerViewState.aiAgentsActivation;
|
|
327
|
+
export const getAiAgentsActivationSubview = (state) => fromActivationView(state);
|
|
328
|
+
export const getAiAgentsActivationLedgerPhases = (state) => fromActivationView(state).ledgerPhases;
|
|
329
|
+
export const getAiAgentsActivationBackgroundPhases = (state) => fromActivationView(state).backgroundPhases;
|
|
330
|
+
export const getAiAgentsActivationCounts = (state) => fromActivationView(state).counts;
|
|
331
|
+
const SECTION_ROW_STATUS_FALLBACK = 'idle';
|
|
332
|
+
const phaseStatusToRowStatus = (status) => {
|
|
333
|
+
if (status === 'ready') {
|
|
334
|
+
return 'building';
|
|
335
|
+
}
|
|
336
|
+
return status;
|
|
337
|
+
};
|
|
338
|
+
export const getAiAgentsActivationLedgerRowStatuses = (state) => fromActivationView(state).ledgerPhases.map((phase) => phaseStatusToRowStatus(phase.status ?? SECTION_ROW_STATUS_FALLBACK));
|
|
339
|
+
export const getAiAgentsActivationBackgroundRowStatuses = (state) => fromActivationView(state).backgroundPhases.map((phase) => phaseStatusToRowStatus(phase.status ?? SECTION_ROW_STATUS_FALLBACK));
|
|
@@ -26,3 +26,16 @@ export const ALL_ONBOARDING_STEPS = [
|
|
|
26
26
|
...ALL_ZENI_USER_ONBOARDING_STEPS_WITHOUT_ACCOUNT,
|
|
27
27
|
];
|
|
28
28
|
export const toOnboardingStepType = (v) => stringToUnion(v, ALL_ONBOARDING_STEPS);
|
|
29
|
+
export const emptyAiAgentsActivationCounts = {
|
|
30
|
+
customerCount: 0,
|
|
31
|
+
glAccountCount: 0,
|
|
32
|
+
targetTransactionCount: 0,
|
|
33
|
+
transactionCount: 0,
|
|
34
|
+
vendorCount: 0,
|
|
35
|
+
};
|
|
36
|
+
export const emptyAiAgentsActivationSubview = {
|
|
37
|
+
backgroundPhases: [],
|
|
38
|
+
counts: emptyAiAgentsActivationCounts,
|
|
39
|
+
fetchStatus: { fetchState: 'Not-Started', error: undefined },
|
|
40
|
+
ledgerPhases: [],
|
|
41
|
+
};
|
|
@@ -87,31 +87,6 @@ export const getChargeCardListView = (state, includeCreditAccountDebitSummaryAnd
|
|
|
87
87
|
hasDebitCard,
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
|
-
/**
|
|
91
|
-
* Returns every enriched `ChargeCardWithUser` for the tenant, without
|
|
92
|
-
* applying the cards-list screen's `searchText` filter or its column
|
|
93
|
-
* `sortKey/sortOrder`. Used by surfaces that need the raw card universe
|
|
94
|
-
* decoupled from whatever the user has typed/sorted on the cards list
|
|
95
|
-
* (e.g. the Card Policy "Apply to Cards" picker, which owns its own
|
|
96
|
-
* search + sort UI). The list-screen's filter/sort state is intentionally
|
|
97
|
-
* left untouched so revisits to the cards list still restore the user's
|
|
98
|
-
* search.
|
|
99
|
-
*/
|
|
100
|
-
export const getAllChargeCardsWithUser = (state) => {
|
|
101
|
-
const { chargeCardListState, chargeCardState, chargeCardConfigState } = state;
|
|
102
|
-
const cards = getChargeCardsByIds(chargeCardState, chargeCardListState.cardIds);
|
|
103
|
-
const chargeCardsWithUser = getChargeCardsWithUser(cards, state);
|
|
104
|
-
const fetchState = reduceFetchState([
|
|
105
|
-
chargeCardListState,
|
|
106
|
-
chargeCardConfigState,
|
|
107
|
-
]).fetchState;
|
|
108
|
-
return {
|
|
109
|
-
fetchState,
|
|
110
|
-
error: chargeCardListState.error,
|
|
111
|
-
cards: chargeCardsWithUser,
|
|
112
|
-
version: '1.0',
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
90
|
export const getMyPendingActivationChargeCardListView = (state) => {
|
|
116
91
|
const { tenantState, chargeCardListState, chargeCardState } = state;
|
|
117
92
|
const cards = getChargeCardsByIds(chargeCardState, chargeCardListState.cardIds);
|