@zeniai/client-epic-state 4.19.99-betaSS4 → 4.19.99
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/entity/aiCfo/aiCfoSelector.d.ts +2 -1
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +0 -38
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -78
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +1 -4
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +1 -5
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -37
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.js +0 -1
- package/lib/entity/tenant/tenantSelector.d.ts +0 -1
- package/lib/entity/tenant/tenantSelector.js +1 -9
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +1 -4
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -1
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -3
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +1 -17
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +0 -1
- package/lib/entity/transaction/stateTypes/transaction.d.ts +0 -5
- package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
- package/lib/epic.d.ts +1 -2
- package/lib/epic.js +1 -2
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -78
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +1 -5
- package/lib/esm/entity/tenant/tenantReducer.js +0 -1
- package/lib/esm/entity/tenant/tenantSelector.js +0 -7
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -1
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +1 -17
- package/lib/esm/epic.js +1 -2
- package/lib/esm/index.js +7 -8
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +1 -82
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +2 -8
- package/lib/esm/view/classList/fetchClassListEpic.js +2 -9
- package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +5 -18
- package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +2 -6
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +3 -4
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +1 -0
- package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -17
- package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -10
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +6 -63
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +4 -12
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +9 -22
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +6 -12
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -18
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +8 -3
- package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +63 -144
- package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +0 -10
- package/lib/esm/view/spendManagement/billPay/billList/billListState.js +0 -1
- package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -7
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +2 -7
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +6 -13
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
- package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +4 -7
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +14 -16
- package/lib/index.d.ts +10 -13
- package/lib/index.js +32 -42
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
- package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +0 -7
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +1 -15
- package/lib/view/aiCfoView/aiCfoViewReducer.js +2 -83
- package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +1 -4
- package/lib/view/aiCfoView/aiCfoViewSelector.js +2 -9
- package/lib/view/aiCfoView/aiCfoViewState.d.ts +1 -18
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.js +1 -8
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +0 -1
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +5 -18
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +0 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +2 -6
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +3 -4
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +1 -0
- package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -18
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -10
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +6 -63
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +4 -12
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +9 -22
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +5 -11
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +0 -5
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +0 -20
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +8 -3
- package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +63 -144
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +0 -10
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListState.js +0 -1
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -7
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +2 -7
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +6 -13
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +3 -6
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +0 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +14 -16
- package/package.json +1 -1
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -29
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +0 -8
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -33
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AiCfoAnswerPayload, ChatSessionPayload } from '../../entity/aiCfo/aiCfoPayload';
|
|
2
2
|
import { UserRolePayload } from '../../entity/userRole/userRolePayload';
|
|
3
3
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
4
|
-
import { AiCfoSuggestedQuestionsPageContext } from './aiCfoViewState';
|
|
5
4
|
export type ContextStatus = 'NONE' | 'NOT_FOUND' | 'PERMISSION_DENIED' | 'SUCCESS';
|
|
6
5
|
export interface CreateSessionResponseData {
|
|
7
6
|
chat_session_id: string;
|
|
@@ -24,10 +23,4 @@ interface AcceptMasterTOSPayload {
|
|
|
24
23
|
user_roles: UserRolePayload[];
|
|
25
24
|
}
|
|
26
25
|
export type AcceptMasterTOSResponse = ZeniAPIResponse<AcceptMasterTOSPayload>;
|
|
27
|
-
export interface SuggestedQuestionsDataPayload {
|
|
28
|
-
generated_at: string;
|
|
29
|
-
page_context: AiCfoSuggestedQuestionsPageContext;
|
|
30
|
-
suggested_questions: string[];
|
|
31
|
-
}
|
|
32
|
-
export type FetchSuggestedQuestionsResponse = ZeniAPIResponse<SuggestedQuestionsDataPayload>;
|
|
33
26
|
export {};
|
|
@@ -4,7 +4,6 @@ import { ChatSessionPayload } from '../../entity/aiCfo/aiCfoPayload';
|
|
|
4
4
|
import { AiCfoAnswerResponseType } from '../../entity/aiCfo/aiCfoState';
|
|
5
5
|
import { ZeniAPIStatus } from '../../responsePayload';
|
|
6
6
|
import { ContextStatus } from './aiCfoViewPayload';
|
|
7
|
-
import { AiCfoSuggestedQuestionsPageContext } from './aiCfoViewState';
|
|
8
7
|
import { AiCfoViewState } from './aiCfoViewState';
|
|
9
8
|
export declare const initialAiCfoViewState: AiCfoViewState;
|
|
10
9
|
export declare const submitQuestion: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[sessionId: string, questionAnswerId: string, userId: string, questionId: string, createdAt: import("dayjs").Dayjs, question: string, files?: File[] | undefined], {
|
|
@@ -90,19 +89,6 @@ export declare const submitQuestion: import("@reduxjs/toolkit").ActionCreatorWit
|
|
|
90
89
|
}, "aiCfoView/clearDeleteChatSessionStatus">, clearAiCfoView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"aiCfoView/clearAiCfoView">, updateCotCollapsedState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
91
90
|
isCollapsed: boolean;
|
|
92
91
|
questionAnswerId: ID;
|
|
93
|
-
}, "aiCfoView/updateCotCollapsedState"
|
|
94
|
-
pageContext: AiCfoSuggestedQuestionsPageContext;
|
|
95
|
-
}, "aiCfoView/fetchSuggestedQuestions">, fetchSuggestedQuestionsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
96
|
-
generatedAt: string;
|
|
97
|
-
pageContext: AiCfoSuggestedQuestionsPageContext;
|
|
98
|
-
suggestedQuestions: string[];
|
|
99
|
-
}, "aiCfoView/fetchSuggestedQuestionsSuccess">, fetchSuggestedQuestionsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
100
|
-
error: ZeniAPIStatus;
|
|
101
|
-
pageContext: AiCfoSuggestedQuestionsPageContext;
|
|
102
|
-
}, "aiCfoView/fetchSuggestedQuestionsFailure">, applyAiCfoSidePanelHostPageTransition: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
103
|
-
newAiCfoSidePanelHostPageKey: string;
|
|
104
|
-
/** When omitted or null, clears the active session (empty / suggested questions). */
|
|
105
|
-
nextCurrentChatSessionId?: ID | null;
|
|
106
|
-
}, "aiCfoView/applyAiCfoSidePanelHostPageTransition">, clearAiCfoSidePanelHostPageContext: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"aiCfoView/clearAiCfoSidePanelHostPageContext">;
|
|
92
|
+
}, "aiCfoView/updateCotCollapsedState">;
|
|
107
93
|
declare const _default: import("redux").Reducer<AiCfoViewState>;
|
|
108
94
|
export default _default;
|
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.updateCotCollapsedState = exports.clearAiCfoView = exports.clearDeleteChatSessionStatus = exports.deleteChatSessionFailure = exports.deleteChatSessionSuccess = exports.deleteChatSession = exports.acceptMasterTOSFailure = exports.acceptMasterTOSSuccess = exports.acceptMasterTOS = exports.stopSubmitQuestionFailure = exports.stopSubmitQuestionSuccess = exports.stopSubmitQuestion = exports.stopSubmitFailure = exports.stopSubmitSuccess = exports.stopSubmit = exports.clearLastContextMessage = exports.clearCurrentSessionId = exports.fetchChatHistoryFailure = exports.fetchChatHistorySuccess = exports.fetchChatHistory = exports.fetchChatSessionsForUserFailure = exports.fetchChatSessionsForUserSuccess = exports.fetchChatSessionsForUser = exports.createSessionAndSubmitFailure = exports.createSessionAndSubmitSuccess = exports.initializeNewSessionState = exports.createSessionAndSubmit = exports.createSessionFailure = exports.createSessionSuccess = exports.createSession = exports.setSession = exports.clearInput = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.updateResponseState = exports.submitQuestionFailure = exports.submitQuestionSuccess = exports.submitQuestion = exports.initialAiCfoViewState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
function removeSessionIdFromPageKeyMap(draft, sessionId) {
|
|
7
|
-
const map = draft.uiState.chatSessionIdByPageKey;
|
|
8
|
-
for (const key of Object.keys(map)) {
|
|
9
|
-
if (map[key] === sessionId) {
|
|
10
|
-
delete map[key];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
function mirrorCurrentSessionToPageKeyMapIfActive(draft) {
|
|
15
|
-
const key = draft.uiState.aiCfoSidePanelHostPageKey;
|
|
16
|
-
const sessionId = draft.uiState.currentChatSessionId;
|
|
17
|
-
if (key != null && sessionId != null) {
|
|
18
|
-
draft.uiState.chatSessionIdByPageKey[key] = sessionId;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
6
|
exports.initialAiCfoViewState = {
|
|
22
7
|
fetchState: 'Not-Started',
|
|
23
8
|
error: undefined,
|
|
@@ -25,8 +10,6 @@ exports.initialAiCfoViewState = {
|
|
|
25
10
|
currentInput: '',
|
|
26
11
|
scrollPositionByChatSessionId: {},
|
|
27
12
|
currentChatSessionId: undefined,
|
|
28
|
-
aiCfoSidePanelHostPageKey: undefined,
|
|
29
|
-
chatSessionIdByPageKey: {},
|
|
30
13
|
agentId: undefined,
|
|
31
14
|
chatHistoryNextPageToken: {},
|
|
32
15
|
chatSessionsNextPageToken: { nextPageToken: null, hasMore: false },
|
|
@@ -50,7 +33,6 @@ exports.initialAiCfoViewState = {
|
|
|
50
33
|
fetchChatSessionHistoryByChatSessionId: {},
|
|
51
34
|
responseStateByChatSessionId: {},
|
|
52
35
|
stopSubmitStateByChatSessionId: {},
|
|
53
|
-
suggestedQuestionsByPageContext: {},
|
|
54
36
|
};
|
|
55
37
|
const aiCfoView = (0, toolkit_1.createSlice)({
|
|
56
38
|
name: 'aiCfoView',
|
|
@@ -184,7 +166,6 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
184
166
|
setSession(draft, action) {
|
|
185
167
|
draft.uiState.currentChatSessionId = action.payload.sessionId;
|
|
186
168
|
draft.uiState.agentId = action.payload.agentId;
|
|
187
|
-
mirrorCurrentSessionToPageKeyMapIfActive(draft);
|
|
188
169
|
},
|
|
189
170
|
createSession: {
|
|
190
171
|
reducer(draft, action) {
|
|
@@ -208,7 +189,6 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
208
189
|
nextPageToken: null,
|
|
209
190
|
hasMore: false,
|
|
210
191
|
};
|
|
211
|
-
mirrorCurrentSessionToPageKeyMapIfActive(draft);
|
|
212
192
|
},
|
|
213
193
|
createSessionFailure(draft, action) {
|
|
214
194
|
draft.createSessionState.fetchState = 'Error';
|
|
@@ -246,7 +226,6 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
246
226
|
nextPageToken: null,
|
|
247
227
|
hasMore: false,
|
|
248
228
|
};
|
|
249
|
-
mirrorCurrentSessionToPageKeyMapIfActive(draft);
|
|
250
229
|
},
|
|
251
230
|
createSessionAndSubmitSuccess(draft) {
|
|
252
231
|
// Note: currentChatSessionId, agentId, and chatHistoryNextPageToken are set by initializeNewSessionState
|
|
@@ -363,7 +342,6 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
363
342
|
draft.uiState.currentChatSessionId = undefined;
|
|
364
343
|
draft.uiState.agentId = undefined;
|
|
365
344
|
}
|
|
366
|
-
removeSessionIdFromPageKeyMap(draft, chatSessionId);
|
|
367
345
|
delete draft.uiState.chatHistoryNextPageToken[chatSessionId];
|
|
368
346
|
delete draft.uiState.scrollPositionByChatSessionId[chatSessionId];
|
|
369
347
|
delete draft.fetchChatSessionHistoryByChatSessionId[chatSessionId];
|
|
@@ -386,65 +364,6 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
386
364
|
},
|
|
387
365
|
clearCurrentSessionId(draft) {
|
|
388
366
|
draft.uiState.currentChatSessionId = undefined;
|
|
389
|
-
const key = draft.uiState.aiCfoSidePanelHostPageKey;
|
|
390
|
-
if (key != null) {
|
|
391
|
-
delete draft.uiState.chatSessionIdByPageKey[key];
|
|
392
|
-
}
|
|
393
|
-
},
|
|
394
|
-
applyAiCfoSidePanelHostPageTransition(draft, action) {
|
|
395
|
-
const { newAiCfoSidePanelHostPageKey, nextCurrentChatSessionId } = action.payload;
|
|
396
|
-
const prevKey = draft.uiState.aiCfoSidePanelHostPageKey;
|
|
397
|
-
const curId = draft.uiState.currentChatSessionId;
|
|
398
|
-
if (prevKey != null &&
|
|
399
|
-
prevKey !== newAiCfoSidePanelHostPageKey &&
|
|
400
|
-
curId != null) {
|
|
401
|
-
draft.uiState.chatSessionIdByPageKey[prevKey] = curId;
|
|
402
|
-
}
|
|
403
|
-
draft.uiState.aiCfoSidePanelHostPageKey = newAiCfoSidePanelHostPageKey;
|
|
404
|
-
draft.uiState.currentChatSessionId =
|
|
405
|
-
nextCurrentChatSessionId != null ? nextCurrentChatSessionId : undefined;
|
|
406
|
-
draft.uiState.currentInput = '';
|
|
407
|
-
mirrorCurrentSessionToPageKeyMapIfActive(draft);
|
|
408
|
-
},
|
|
409
|
-
clearAiCfoSidePanelHostPageContext(draft) {
|
|
410
|
-
const key = draft.uiState.aiCfoSidePanelHostPageKey;
|
|
411
|
-
const curId = draft.uiState.currentChatSessionId;
|
|
412
|
-
if (key != null && curId != null) {
|
|
413
|
-
draft.uiState.chatSessionIdByPageKey[key] = curId;
|
|
414
|
-
}
|
|
415
|
-
draft.uiState.aiCfoSidePanelHostPageKey = undefined;
|
|
416
|
-
},
|
|
417
|
-
fetchSuggestedQuestions(draft, action) {
|
|
418
|
-
const { pageContext } = action.payload;
|
|
419
|
-
const prev = draft.suggestedQuestionsByPageContext[pageContext];
|
|
420
|
-
draft.suggestedQuestionsByPageContext[pageContext] = {
|
|
421
|
-
fetchState: 'In-Progress',
|
|
422
|
-
pageContext,
|
|
423
|
-
suggestedQuestions: prev?.suggestedQuestions ?? [],
|
|
424
|
-
generatedAt: prev?.generatedAt,
|
|
425
|
-
error: undefined,
|
|
426
|
-
};
|
|
427
|
-
},
|
|
428
|
-
fetchSuggestedQuestionsSuccess(draft, action) {
|
|
429
|
-
const { pageContext, generatedAt, suggestedQuestions } = action.payload;
|
|
430
|
-
draft.suggestedQuestionsByPageContext[pageContext] = {
|
|
431
|
-
fetchState: 'Completed',
|
|
432
|
-
pageContext,
|
|
433
|
-
generatedAt,
|
|
434
|
-
suggestedQuestions,
|
|
435
|
-
error: undefined,
|
|
436
|
-
};
|
|
437
|
-
},
|
|
438
|
-
fetchSuggestedQuestionsFailure(draft, action) {
|
|
439
|
-
const { pageContext, error } = action.payload;
|
|
440
|
-
const prev = draft.suggestedQuestionsByPageContext[pageContext];
|
|
441
|
-
draft.suggestedQuestionsByPageContext[pageContext] = {
|
|
442
|
-
fetchState: 'Error',
|
|
443
|
-
pageContext,
|
|
444
|
-
suggestedQuestions: prev?.suggestedQuestions ?? [],
|
|
445
|
-
generatedAt: prev?.generatedAt,
|
|
446
|
-
error,
|
|
447
|
-
};
|
|
448
367
|
},
|
|
449
368
|
clearAiCfoView(draft) {
|
|
450
369
|
Object.assign(draft, exports.initialAiCfoViewState);
|
|
@@ -456,5 +375,5 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
456
375
|
},
|
|
457
376
|
},
|
|
458
377
|
});
|
|
459
|
-
_a = aiCfoView.actions, exports.submitQuestion = _a.submitQuestion, exports.submitQuestionSuccess = _a.submitQuestionSuccess, exports.submitQuestionFailure = _a.submitQuestionFailure, exports.updateResponseState = _a.updateResponseState, exports.updateAiCfoViewScrollPosition = _a.updateAiCfoViewScrollPosition, exports.updateCurrentInput = _a.updateCurrentInput, exports.clearInput = _a.clearInput, exports.setSession = _a.setSession, exports.createSession = _a.createSession, exports.createSessionSuccess = _a.createSessionSuccess, exports.createSessionFailure = _a.createSessionFailure, exports.createSessionAndSubmit = _a.createSessionAndSubmit, exports.initializeNewSessionState = _a.initializeNewSessionState, exports.createSessionAndSubmitSuccess = _a.createSessionAndSubmitSuccess, exports.createSessionAndSubmitFailure = _a.createSessionAndSubmitFailure, exports.fetchChatSessionsForUser = _a.fetchChatSessionsForUser, exports.fetchChatSessionsForUserSuccess = _a.fetchChatSessionsForUserSuccess, exports.fetchChatSessionsForUserFailure = _a.fetchChatSessionsForUserFailure, exports.fetchChatHistory = _a.fetchChatHistory, exports.fetchChatHistorySuccess = _a.fetchChatHistorySuccess, exports.fetchChatHistoryFailure = _a.fetchChatHistoryFailure, exports.clearCurrentSessionId = _a.clearCurrentSessionId, exports.clearLastContextMessage = _a.clearLastContextMessage, exports.stopSubmit = _a.stopSubmit, exports.stopSubmitSuccess = _a.stopSubmitSuccess, exports.stopSubmitFailure = _a.stopSubmitFailure, exports.stopSubmitQuestion = _a.stopSubmitQuestion, exports.stopSubmitQuestionSuccess = _a.stopSubmitQuestionSuccess, exports.stopSubmitQuestionFailure = _a.stopSubmitQuestionFailure, exports.acceptMasterTOS = _a.acceptMasterTOS, exports.acceptMasterTOSSuccess = _a.acceptMasterTOSSuccess, exports.acceptMasterTOSFailure = _a.acceptMasterTOSFailure, exports.deleteChatSession = _a.deleteChatSession, exports.deleteChatSessionSuccess = _a.deleteChatSessionSuccess, exports.deleteChatSessionFailure = _a.deleteChatSessionFailure, exports.clearDeleteChatSessionStatus = _a.clearDeleteChatSessionStatus, exports.clearAiCfoView = _a.clearAiCfoView, exports.updateCotCollapsedState = _a.updateCotCollapsedState
|
|
378
|
+
_a = aiCfoView.actions, exports.submitQuestion = _a.submitQuestion, exports.submitQuestionSuccess = _a.submitQuestionSuccess, exports.submitQuestionFailure = _a.submitQuestionFailure, exports.updateResponseState = _a.updateResponseState, exports.updateAiCfoViewScrollPosition = _a.updateAiCfoViewScrollPosition, exports.updateCurrentInput = _a.updateCurrentInput, exports.clearInput = _a.clearInput, exports.setSession = _a.setSession, exports.createSession = _a.createSession, exports.createSessionSuccess = _a.createSessionSuccess, exports.createSessionFailure = _a.createSessionFailure, exports.createSessionAndSubmit = _a.createSessionAndSubmit, exports.initializeNewSessionState = _a.initializeNewSessionState, exports.createSessionAndSubmitSuccess = _a.createSessionAndSubmitSuccess, exports.createSessionAndSubmitFailure = _a.createSessionAndSubmitFailure, exports.fetchChatSessionsForUser = _a.fetchChatSessionsForUser, exports.fetchChatSessionsForUserSuccess = _a.fetchChatSessionsForUserSuccess, exports.fetchChatSessionsForUserFailure = _a.fetchChatSessionsForUserFailure, exports.fetchChatHistory = _a.fetchChatHistory, exports.fetchChatHistorySuccess = _a.fetchChatHistorySuccess, exports.fetchChatHistoryFailure = _a.fetchChatHistoryFailure, exports.clearCurrentSessionId = _a.clearCurrentSessionId, exports.clearLastContextMessage = _a.clearLastContextMessage, exports.stopSubmit = _a.stopSubmit, exports.stopSubmitSuccess = _a.stopSubmitSuccess, exports.stopSubmitFailure = _a.stopSubmitFailure, exports.stopSubmitQuestion = _a.stopSubmitQuestion, exports.stopSubmitQuestionSuccess = _a.stopSubmitQuestionSuccess, exports.stopSubmitQuestionFailure = _a.stopSubmitQuestionFailure, exports.acceptMasterTOS = _a.acceptMasterTOS, exports.acceptMasterTOSSuccess = _a.acceptMasterTOSSuccess, exports.acceptMasterTOSFailure = _a.acceptMasterTOSFailure, exports.deleteChatSession = _a.deleteChatSession, exports.deleteChatSessionSuccess = _a.deleteChatSessionSuccess, exports.deleteChatSessionFailure = _a.deleteChatSessionFailure, exports.clearDeleteChatSessionStatus = _a.clearDeleteChatSessionStatus, exports.clearAiCfoView = _a.clearAiCfoView, exports.updateCotCollapsedState = _a.updateCotCollapsedState;
|
|
460
379
|
exports.default = aiCfoView.reducer;
|
|
@@ -3,8 +3,7 @@ import { FetchStateAndError } from '../../commonStateTypes/common';
|
|
|
3
3
|
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
4
|
import { AiCfoSelectorView } from '../../entity/aiCfo/aiCfoSelector';
|
|
5
5
|
import { RootState } from '../../reducer';
|
|
6
|
-
import {
|
|
7
|
-
import { AiCfoViewUIState, SuggestedQuestionsForPageContext } from './aiCfoViewState';
|
|
6
|
+
import { AiCfoViewUIState } from './aiCfoViewState';
|
|
8
7
|
export interface AiCfoViewSelector extends SelectorView, AiCfoSelectorView {
|
|
9
8
|
createSessionAndSubmitState: FetchStateAndError;
|
|
10
9
|
createSessionState: FetchStateAndError;
|
|
@@ -18,8 +17,6 @@ export interface AiCfoViewSelector extends SelectorView, AiCfoSelectorView {
|
|
|
18
17
|
thought: FetchStateAndError;
|
|
19
18
|
}>;
|
|
20
19
|
stopSubmitStateByChatSessionId: Record<ID, FetchStateAndError>;
|
|
21
|
-
suggestedQuestionsByPageContext: Partial<Record<AiCfoSuggestedQuestionsPageContext, SuggestedQuestionsForPageContext>>;
|
|
22
20
|
uiState: AiCfoViewUIState;
|
|
23
21
|
}
|
|
24
22
|
export declare const getAiCfoView: (state: RootState) => AiCfoViewSelector;
|
|
25
|
-
export declare function getSuggestedQuestionsForPageContext(state: RootState, pageContext: AiCfoSuggestedQuestionsPageContext): SuggestedQuestionsForPageContext | undefined;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAiCfoView = void 0;
|
|
4
|
-
exports.getSuggestedQuestionsForPageContext = getSuggestedQuestionsForPageContext;
|
|
5
|
-
const aiCfoReducer_1 = require("../../entity/aiCfo/aiCfoReducer");
|
|
6
4
|
const aiCfoSelector_1 = require("../../entity/aiCfo/aiCfoSelector");
|
|
7
|
-
const aiCfoViewReducer_1 = require("./aiCfoViewReducer");
|
|
8
5
|
const getAiCfoView = (state) => {
|
|
9
|
-
const { fetchState, error, uiState, createSessionState, createSessionAndSubmitState, deleteChatSessionStateByChatSessionId, stopSubmitStateByChatSessionId, responseStateByChatSessionId, fetchChatSessionHistoryByChatSessionId, masterTOSAcceptanceState,
|
|
6
|
+
const { fetchState, error, uiState, createSessionState, createSessionAndSubmitState, deleteChatSessionStateByChatSessionId, stopSubmitStateByChatSessionId, responseStateByChatSessionId, fetchChatSessionHistoryByChatSessionId, masterTOSAcceptanceState, } = state.aiCfoViewState;
|
|
10
7
|
return {
|
|
11
8
|
fetchState,
|
|
12
9
|
error,
|
|
@@ -18,12 +15,8 @@ const getAiCfoView = (state) => {
|
|
|
18
15
|
uiState,
|
|
19
16
|
fetchChatSessionHistoryByChatSessionId,
|
|
20
17
|
masterTOSAcceptanceState,
|
|
21
|
-
|
|
22
|
-
...(0, aiCfoSelector_1.getAiCfoSelectorView)(state.aiCfoState ?? aiCfoReducer_1.initialAiCfoState),
|
|
18
|
+
...(0, aiCfoSelector_1.getAiCfoSelectorView)(state.aiCfoState),
|
|
23
19
|
version: 1,
|
|
24
20
|
};
|
|
25
21
|
};
|
|
26
22
|
exports.getAiCfoView = getAiCfoView;
|
|
27
|
-
function getSuggestedQuestionsForPageContext(state, pageContext) {
|
|
28
|
-
return state.aiCfoViewState?.suggestedQuestionsByPageContext?.[pageContext];
|
|
29
|
-
}
|
|
@@ -9,8 +9,6 @@ export interface AiCfoViewUIState {
|
|
|
9
9
|
chatHistoryNextPageToken: {
|
|
10
10
|
[chatSessionId: ID]: PageTokenState;
|
|
11
11
|
};
|
|
12
|
-
/** Last focused chat session id per side-panel host page key (e.g. `dashboard`, `reports:profit_loss`). */
|
|
13
|
-
chatSessionIdByPageKey: Partial<Record<string, ID>>;
|
|
14
12
|
chatSessionsFirstPageFetched: boolean;
|
|
15
13
|
chatSessionsNextPageToken: PageTokenState;
|
|
16
14
|
cotCollapsedByQuestionAnswerId: {
|
|
@@ -22,24 +20,11 @@ export interface AiCfoViewUIState {
|
|
|
22
20
|
scrollTop: number;
|
|
23
21
|
};
|
|
24
22
|
};
|
|
25
|
-
agentId?: ID;
|
|
26
|
-
* When set, the side panel on host routes (e.g. dashboard/reports) is scoped to this **page key**;
|
|
27
|
-
* session ids are mirrored into {@link chatSessionIdByPageKey}. Full `/ai-cfo/...` should clear this.
|
|
28
|
-
*/
|
|
29
|
-
aiCfoSidePanelHostPageKey?: string;
|
|
23
|
+
agentId?: ID;
|
|
30
24
|
currentChatSessionId?: ID;
|
|
31
25
|
lastContextMessage?: string;
|
|
32
26
|
lastContextStatus?: ContextStatus;
|
|
33
27
|
}
|
|
34
|
-
/**
|
|
35
|
-
* Supported `page_context` values for GET .../suggested-questions and related UI state.
|
|
36
|
-
*/
|
|
37
|
-
export type AiCfoSuggestedQuestionsPageContext = 'balance_sheet' | 'profit_loss' | 'vendors' | 'transactions' | 'cash_flow' | 'accounts_receivable' | 'accounts_payable' | 'transaction_details' | 'dashboard' | 'cash_balance' | 'card_balance' | 'command_centre' | 'je_schedules' | 'reconciliation' | 'flux_analysis' | 'receipts' | 'mei' | 'task_checklist' | 'performance' | 'bills_list' | 'bills_details' | 'reimbursement_list' | 'reimbursement_details' | 'vendors_summary' | 'opex_by_vendor' | 'prepaid_expenses' | 'fixed_assets' | 'form_1099' | 'accrued_expenses' | 'forecast' | 'checking' | 'checking_details' | 'treasury' | 'cards' | 'cards_detail' | 'people' | 'rewards' | 'notifications';
|
|
38
|
-
export interface SuggestedQuestionsForPageContext extends FetchStateAndError {
|
|
39
|
-
pageContext: AiCfoSuggestedQuestionsPageContext;
|
|
40
|
-
suggestedQuestions: string[];
|
|
41
|
-
generatedAt?: string;
|
|
42
|
-
}
|
|
43
28
|
export interface AiCfoViewState extends FetchStateAndError {
|
|
44
29
|
allChatSessionIds: ID[];
|
|
45
30
|
createSessionAndSubmitState: FetchStateAndError;
|
|
@@ -54,7 +39,5 @@ export interface AiCfoViewState extends FetchStateAndError {
|
|
|
54
39
|
thought: FetchStateAndError;
|
|
55
40
|
}>;
|
|
56
41
|
stopSubmitStateByChatSessionId: Record<ID, FetchStateAndError>;
|
|
57
|
-
/** Keyed by `page_context` query value (e.g. balance_sheet). */
|
|
58
|
-
suggestedQuestionsByPageContext: Partial<Record<AiCfoSuggestedQuestionsPageContext, SuggestedQuestionsForPageContext>>;
|
|
59
42
|
uiState: AiCfoViewUIState;
|
|
60
43
|
}
|
|
@@ -3,7 +3,7 @@ import { Status } from '../../commonStateTypes/status';
|
|
|
3
3
|
import { View } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
4
|
import { ZeniDate } from '../../zeniDayJS';
|
|
5
5
|
import { AuditSummary } from '../reviewCompanyView/reviewCompanyViewState';
|
|
6
|
-
export declare const toAuditRuleEntityType: (v: string) => "dashboard" | "
|
|
6
|
+
export declare const toAuditRuleEntityType: (v: string) => "dashboard" | "reports" | "transactions";
|
|
7
7
|
export type AuditRuleEntityType = ReturnType<typeof toAuditRuleEntityType>;
|
|
8
8
|
declare const toAuditRuleEntityIdType: (v: string) => "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "uncategorized-expense" | "uncategorized-income";
|
|
9
9
|
export type AuditRuleEntityIdType = ReturnType<typeof toAuditRuleEntityIdType>;
|
|
@@ -5,4 +5,4 @@ import { RootState } from '../../reducer';
|
|
|
5
5
|
import { ZeniAPI } from '../../zeniAPI';
|
|
6
6
|
import { fetchClassList, updateClassList, updateClassListFailure } from './classListReducer';
|
|
7
7
|
export type ActionType = ReturnType<typeof fetchClassList> | ReturnType<typeof updateClasses> | ReturnType<typeof updateClassList> | ReturnType<typeof updateClassListFailure>;
|
|
8
|
-
export declare const fetchClassListEpic: (actions$: ActionsObservable<ActionType>,
|
|
8
|
+
export declare const fetchClassListEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -4,16 +4,9 @@ exports.fetchClassListEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const classReducer_1 = require("../../entity/class/classReducer");
|
|
7
|
-
const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
|
|
8
7
|
const responsePayload_1 = require("../../responsePayload");
|
|
9
8
|
const classListReducer_1 = require("./classListReducer");
|
|
10
|
-
const fetchClassListEpic = (actions$,
|
|
11
|
-
if (!(0, tenantSelector_1.getIsAccountingClassesEnabled)(state)) {
|
|
12
|
-
return (0, rxjs_1.of)((0, classListReducer_1.updateClassList)({
|
|
13
|
-
status: (0, responsePayload_1.createZeniAPIStatus)('Success', ''),
|
|
14
|
-
data: { accounting_classes: [] },
|
|
15
|
-
}));
|
|
16
|
-
}
|
|
9
|
+
const fetchClassListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(classListReducer_1.fetchClassList.match), (0, operators_1.switchMap)((action) => {
|
|
17
10
|
const { isIncludeDeleted } = action.payload;
|
|
18
11
|
const queryParams = isIncludeDeleted === true
|
|
19
12
|
? `?query=${encodeURIComponent(JSON.stringify({ is_include_deleted: true }))}`
|
|
@@ -57,7 +57,6 @@ export interface VendorViewSelectorView extends BankAccountSelectorView, Selecto
|
|
|
57
57
|
deleteFileStatusById: Record<ID, FetchStateAndError | undefined>;
|
|
58
58
|
hasInternationalWireTransfer: boolean;
|
|
59
59
|
hasWireTransfer: boolean;
|
|
60
|
-
isAccountingClassesEnabled: boolean;
|
|
61
60
|
loggedInUserVerification: UserVerificationState;
|
|
62
61
|
ownerList: User[];
|
|
63
62
|
updateFileStatusById: Record<ID, FetchStateAndError | undefined>;
|
|
@@ -9,7 +9,6 @@ const contactSelector_1 = require("../../../entity/billPay/contact/contactSelect
|
|
|
9
9
|
const classSelector_1 = require("../../../entity/class/classSelector");
|
|
10
10
|
const fileSelector_1 = require("../../../entity/file/fileSelector");
|
|
11
11
|
const paymentInstrumentSelector_1 = require("../../../entity/paymentInstrument/paymentInstrumentSelector");
|
|
12
|
-
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
13
12
|
const userSelector_1 = require("../../../entity/user/userSelector");
|
|
14
13
|
const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
|
|
15
14
|
const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
@@ -64,17 +63,13 @@ const getVendorView = (state, vendorIdFromUrl) => {
|
|
|
64
63
|
?.vendorDetailLocalData,
|
|
65
64
|
supportedCountries: billPayConfigState.vendor.supportedCountries,
|
|
66
65
|
};
|
|
67
|
-
|
|
68
|
-
const editFetchStateList = [
|
|
66
|
+
fetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
69
67
|
accountList,
|
|
68
|
+
classList,
|
|
70
69
|
vendorTypeListState,
|
|
71
70
|
vendorViewState.editVendorStateById[vendorIdFromUrl]?.fetchStatus ??
|
|
72
71
|
vendorViewReducer_1.initialState.newVendorState.fetchStatus,
|
|
73
|
-
];
|
|
74
|
-
if (isAccountingClassesEnabled) {
|
|
75
|
-
editFetchStateList.push(classList);
|
|
76
|
-
}
|
|
77
|
-
fetchState = (0, reduceFetchState_1.reduceFetchState)(editFetchStateList);
|
|
72
|
+
]);
|
|
78
73
|
}
|
|
79
74
|
else {
|
|
80
75
|
const basicVendorDetails = getBasicVendorDetailsForNewVendor(state, vendorViewState.newVendorState);
|
|
@@ -103,17 +98,11 @@ const getVendorView = (state, vendorIdFromUrl) => {
|
|
|
103
98
|
if (tentativeName != null) {
|
|
104
99
|
entityRecommendations = (0, recommendationSelector_1.getRecommendationsForEntity)(state, tentativeName, 'vendor');
|
|
105
100
|
}
|
|
106
|
-
const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
|
|
107
101
|
const fetchStateList = [
|
|
108
102
|
{ fetchState: accountList.fetchState, error: accountList.error },
|
|
103
|
+
{ fetchState: classList.fetchState, error: classList.error },
|
|
109
104
|
vendorTypeListState,
|
|
110
105
|
];
|
|
111
|
-
if (isAccountingClassesEnabled) {
|
|
112
|
-
fetchStateList.push({
|
|
113
|
-
fetchState: classList.fetchState,
|
|
114
|
-
error: classList.error,
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
106
|
if (entityRecommendations != null &&
|
|
118
107
|
entityRecommendations.recommendations != null &&
|
|
119
108
|
entityRecommendations.recommendations.length > 0) {
|
|
@@ -158,7 +147,6 @@ const getVendorView = (state, vendorIdFromUrl) => {
|
|
|
158
147
|
fetchState: fetchState.fetchState,
|
|
159
148
|
hasWireTransfer,
|
|
160
149
|
hasInternationalWireTransfer,
|
|
161
|
-
isAccountingClassesEnabled: (0, tenantSelector_1.getIsAccountingClassesEnabled)(state),
|
|
162
150
|
deleteFileStatusById,
|
|
163
151
|
updateFileStatusById,
|
|
164
152
|
loggedInUserVerification,
|
|
@@ -235,10 +223,9 @@ const getBasicVendorDetailsForNewVendor = (state, newVendor) => {
|
|
|
235
223
|
};
|
|
236
224
|
const getVendorDetailPageView = (state, vendorId, entity) => {
|
|
237
225
|
const trendWithTransactions = (0, trendWithTransactionsSelector_1.getTrendWithTransactions)(state, entity, 'EntityDetail');
|
|
238
|
-
const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
|
|
239
226
|
const reducedFetchState = (0, reduceFetchState_1.reduceAnyFetchState)([
|
|
240
227
|
state.accountListState.byReportId.accountList,
|
|
241
|
-
|
|
228
|
+
state.classListState,
|
|
242
229
|
state.vendorTypeListState,
|
|
243
230
|
state.ownerListState,
|
|
244
231
|
state.vendorViewState.editVendorStateById[vendorId]?.fetchStatus ?? {
|
|
@@ -50,7 +50,6 @@ export interface VendorsTabVendorViewSelectorView extends SelectorView {
|
|
|
50
50
|
accountsHierarchyList: NestedAccountHierarchyForReport[];
|
|
51
51
|
classHierarchyList: NestedClassHierarchyForReport[];
|
|
52
52
|
classList: ClassListSelectorView;
|
|
53
|
-
isAccountingClassesEnabled: boolean;
|
|
54
53
|
ownerList: User[];
|
|
55
54
|
vendorTypeList: VendorType[];
|
|
56
55
|
vendorView?: VendorsTabVendorDetails;
|
|
@@ -9,7 +9,6 @@ const accountSelector_1 = require("../../../entity/account/accountSelector");
|
|
|
9
9
|
const addressSelector_1 = require("../../../entity/address/addressSelector");
|
|
10
10
|
const contactSelector_1 = require("../../../entity/billPay/contact/contactSelector");
|
|
11
11
|
const classSelector_1 = require("../../../entity/class/classSelector");
|
|
12
|
-
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
13
12
|
const userSelector_1 = require("../../../entity/user/userSelector");
|
|
14
13
|
const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
|
|
15
14
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
@@ -25,7 +24,6 @@ const toVendorDetailTabsType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_
|
|
|
25
24
|
exports.toVendorDetailTabsType = toVendorDetailTabsType;
|
|
26
25
|
const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
27
26
|
const { accountListState, accountState, classListState, classState, vendorState, userState, vendorsTabVendorViewState, vendorTypeListState, addressState, addressViewState, contactState, } = state;
|
|
28
|
-
const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
|
|
29
27
|
const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
|
|
30
28
|
const classList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
31
29
|
const ownerList = (0, userSelector_1.getUsersByUserIds)(state.userState, state.ownerListState.ownerIds);
|
|
@@ -57,7 +55,7 @@ const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
|
57
55
|
}
|
|
58
56
|
fetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
59
57
|
accountList,
|
|
60
|
-
|
|
58
|
+
classList,
|
|
61
59
|
vendorTypeListState,
|
|
62
60
|
vendorsTabVendorViewState.vendorStateById[vendorIdFromUrl]?.fetchStatus ?? {
|
|
63
61
|
fetchState: 'Not-Started',
|
|
@@ -68,7 +66,6 @@ const getVendorsTabVendorView = (state, vendorIdFromUrl) => {
|
|
|
68
66
|
return {
|
|
69
67
|
accountList: accountList,
|
|
70
68
|
classList: classList,
|
|
71
|
-
isAccountingClassesEnabled,
|
|
72
69
|
vendorTypeList: vendorTypeList,
|
|
73
70
|
accountsHierarchyList,
|
|
74
71
|
classHierarchyList,
|
|
@@ -110,10 +107,9 @@ const getVendorsTabDetailPageView = (state, vendorId, entity) => {
|
|
|
110
107
|
? (0, transactionListByEntitySelector_1.getTransactionListByEntityForSinglePeriod)(state, entity, state.vendorsTabVendorViewState.allTransactionsTabData
|
|
111
108
|
.numberOfQuartersFetched)
|
|
112
109
|
: undefined;
|
|
113
|
-
const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state);
|
|
114
110
|
const reducedFetchState = (0, reduceFetchState_1.reduceAnyFetchState)([
|
|
115
111
|
state.accountListState.byReportId.accountList,
|
|
116
|
-
|
|
112
|
+
state.classListState,
|
|
117
113
|
state.ownerListState,
|
|
118
114
|
state.vendorTypeListState,
|
|
119
115
|
state.vendorsTabVendorViewState.vendorStateById[vendorId]?.fetchStatus ?? {
|
|
@@ -24,13 +24,13 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
|
|
|
24
24
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
25
25
|
const updateActions = [];
|
|
26
26
|
updateActions.push((0, jeSchedulesReducer_1.updateJESchedules)([
|
|
27
|
-
...response.data.
|
|
27
|
+
...response.data.draft_je_schedules,
|
|
28
28
|
...response.data.failed_je_postings.je_schedules,
|
|
29
29
|
]), (0, jeSchedulesReducer_1.updateJESchedulesDetails)([...response.data.failed_je_postings.je_schedules], response.data.failed_je_postings.scheduled_journal_entries), (0, jeSchedulesViewReducer_1.initializeJeScheduleLocalData)([
|
|
30
30
|
...response.data.failed_je_postings.je_schedules,
|
|
31
31
|
]));
|
|
32
32
|
updateActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesSuccess)({
|
|
33
|
-
jeSchedules: [...response.data.
|
|
33
|
+
jeSchedules: [...response.data.draft_je_schedules],
|
|
34
34
|
failedJeSchedules: [
|
|
35
35
|
...response.data.failed_je_postings.je_schedules,
|
|
36
36
|
],
|
|
@@ -6,7 +6,7 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
7
|
const bulkUploadTiming_1 = require("../../bulkUploadTiming");
|
|
8
8
|
const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
|
|
9
|
-
const bulkUploadReceiptsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceipts.match), (0, operators_1.
|
|
9
|
+
const bulkUploadReceiptsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceipts.match), (0, operators_1.mergeMap)((action) => {
|
|
10
10
|
const { files } = action.payload;
|
|
11
11
|
const formData = new FormData();
|
|
12
12
|
for (const file of files) {
|
package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js
CHANGED
|
@@ -29,7 +29,7 @@ exports.pusherBatchStatusCompletionEpic = pusherBatchStatusCompletionEpic;
|
|
|
29
29
|
* force `phase` to `completed` (dismiss automatching banner) and refresh the batch list.
|
|
30
30
|
* Cancels when the batch completes normally, bulk state is cleared, or another upload supersedes.
|
|
31
31
|
*/
|
|
32
|
-
const bulkUploadAutomatchingTimeoutEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match), (0, operators_1.
|
|
32
|
+
const bulkUploadAutomatchingTimeoutEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match), (0, operators_1.mergeMap)((action) => {
|
|
33
33
|
const { batchId } = action.payload;
|
|
34
34
|
return (0, rxjs_1.timer)(bulkUploadTiming_1.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS).pipe((0, operators_1.mergeMap)(() => {
|
|
35
35
|
const bulk = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
|
|
@@ -49,11 +49,10 @@ exports.bulkUploadAutomatchingTimeoutEpic = bulkUploadAutomatchingTimeoutEpic;
|
|
|
49
49
|
* error snackbar per upload session (first failure only) so the user is not spammed every
|
|
50
50
|
* interval; Pusher or a later successful poll still completes the flow.
|
|
51
51
|
*/
|
|
52
|
-
const pollBulkUploadBatchStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match), (0, operators_1.
|
|
52
|
+
const pollBulkUploadBatchStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match), (0, operators_1.mergeMap)((action) => {
|
|
53
53
|
const { batchId } = action.payload;
|
|
54
54
|
let pollErrorNotified = false;
|
|
55
|
-
return (0, rxjs_1.timer)(FALLBACK_FIRST_DELAY_MS, FALLBACK_POLL_INTERVAL_MS).pipe((0, operators_1.takeUntil)((0, rxjs_1.merge)(actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.clearBulkUpload.match)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.pusherBatchStatusUpdate.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId
|
|
56
|
-
action.payload.status === 'completed')), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadAutomatchingTimedOut.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)))), (0, operators_1.switchMap)(() => zeniAPI
|
|
55
|
+
return (0, rxjs_1.timer)(FALLBACK_FIRST_DELAY_MS, FALLBACK_POLL_INTERVAL_MS).pipe((0, operators_1.takeUntil)((0, rxjs_1.merge)(actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.clearBulkUpload.match)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.pusherBatchStatusUpdate.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadAutomatchingTimedOut.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)))), (0, operators_1.switchMap)(() => zeniAPI
|
|
57
56
|
.getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${batchId}`)
|
|
58
57
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
59
58
|
/** Same batch-details URL; polls until `status` is completed (Pusher may win first). */
|
|
@@ -94,6 +94,7 @@ function getExpenseAutomationView(state) {
|
|
|
94
94
|
const fetchStateVariables = [
|
|
95
95
|
expenseAutomationMissingReceiptsViewState,
|
|
96
96
|
expenseAutomationJESchedulesViewState,
|
|
97
|
+
monthEndCloseChecksView,
|
|
97
98
|
expenseAutomationTransactionsView,
|
|
98
99
|
expenseAutomationReconciliationViewState,
|
|
99
100
|
];
|
|
@@ -67,8 +67,8 @@ const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionC
|
|
|
67
67
|
lineItem.account?.qboId !== accountLine.account.qboId &&
|
|
68
68
|
Boolean(lineItem.account?.qboId);
|
|
69
69
|
hasClassChanged =
|
|
70
|
-
(lineItem.class?.qboId
|
|
71
|
-
lineItem.class?.qboId !== accountLine.class
|
|
70
|
+
Boolean(lineItem.class?.qboId) &&
|
|
71
|
+
lineItem.class?.qboId !== accountLine.class.qboId;
|
|
72
72
|
const recommendedAccountBase = (0, saveTransactionHelper_1.toRecommendedAccountBase)(lineItem.amount.amount, lineItem.account);
|
|
73
73
|
const recommendedClassBase = (0, saveTransactionHelper_1.toRecommendedClassBase)(lineItem.amount.amount, lineItem.class);
|
|
74
74
|
if (entityDetails != null &&
|
|
@@ -241,7 +241,7 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
|
|
|
241
241
|
isPreFilled: true,
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
|
-
if (
|
|
244
|
+
if (accountLine.class.classId === '' &&
|
|
245
245
|
higherPreferenceRecommendation?.class != null) {
|
|
246
246
|
record.class = {
|
|
247
247
|
...higherPreferenceRecommendation.class,
|
|
@@ -472,7 +472,7 @@ const setEntityRecommendationForLineIdInLocalData = (draft, transaction, transac
|
|
|
472
472
|
}
|
|
473
473
|
: accountLine.account;
|
|
474
474
|
record.class =
|
|
475
|
-
|
|
475
|
+
accountLine.class.classId !== ''
|
|
476
476
|
? accountLine.class
|
|
477
477
|
: recommendations?.[0]?.class
|
|
478
478
|
? {
|
|
@@ -10,11 +10,11 @@ export interface ExpenseAutomationJESchedulesQueryPayload {
|
|
|
10
10
|
start_date: string;
|
|
11
11
|
}
|
|
12
12
|
interface ExpenseAutomationJESchedulesPayload {
|
|
13
|
+
draft_je_schedules: JEScheduledTransactionPayload[];
|
|
13
14
|
failed_je_postings: {
|
|
14
15
|
je_schedules: JEScheduledTransactionPayload[];
|
|
15
16
|
scheduled_journal_entries: ScheduledJournalEntryPayload[];
|
|
16
17
|
};
|
|
17
|
-
je_schedules: JEScheduledTransactionPayload[];
|
|
18
18
|
}
|
|
19
19
|
export type ExpenseAutomationJESchedulesResponse = ZeniAPIResponse<ExpenseAutomationJESchedulesPayload>;
|
|
20
20
|
export interface IgnoreDraftJESchedulePayload {
|
|
@@ -5,7 +5,7 @@ import { JEScheduledTransactionPayload } from '../../../entity/jeSchedules/jeSch
|
|
|
5
5
|
import { JEScheduleTransactionKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
6
6
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
7
7
|
import { AccountTypeRecommendationPayload } from '../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload';
|
|
8
|
-
import { AccountSettingsLocalData, AccountSettingsState, JEScheduleLocalData, JESchedulesViewState
|
|
8
|
+
import { AccountSettingsLocalData, AccountSettingsState, JEScheduleLocalData, JESchedulesViewState } from '../types/jeSchedulesViewState';
|
|
9
9
|
export declare const accountSettingsInitialState: AccountSettingsState;
|
|
10
10
|
export declare const initialState: JESchedulesViewState;
|
|
11
11
|
export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearExpenseAutomationJESchedulesView">, clearJeAccountSettingsLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeAccountSettingsLocalData">, clearJeScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeScheduleLocalData">, fetchAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/fetchAccountSettingsListForAccountTypes">, fetchJeSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
|
|
@@ -56,7 +56,7 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
56
56
|
accountPayload: AccountMetadataPayload[];
|
|
57
57
|
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypes">, updateAccountSettingsListForAccountTypesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
58
58
|
status: ZeniAPIStatus;
|
|
59
|
-
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">,
|
|
59
|
+
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
60
60
|
localData: Partial<JEScheduleLocalData>;
|
|
61
61
|
scheduledJournalEntryID: ID;
|
|
62
62
|
}, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[], selectedPeriod: MonthYearPeriod], {
|