@zeniai/client-epic-state 4.19.90-betaSS6 → 4.19.90

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.
Files changed (79) hide show
  1. package/lib/entity/aiCfo/aiCfoSelector.d.ts +2 -1
  2. package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
  3. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +1 -36
  4. package/lib/entity/jeSchedules/jeSchedulesPayload.js +5 -54
  5. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +2 -2
  6. package/lib/entity/jeSchedules/jeSchedulesReducer.js +2 -2
  7. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +1 -2
  8. package/lib/entity/jeSchedules/jeSchedulesSelector.js +1 -2
  9. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +2 -14
  10. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +3 -7
  11. package/lib/entity/jeSchedules/jeSchedulesTypes.js +1 -3
  12. package/lib/entity/reimbursement/reimbursementPayload.d.ts +1 -1
  13. package/lib/entity/reimbursement/reimbursementPayload.js +1 -1
  14. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -3
  15. package/lib/entity/transaction/payloadTypes/transactionPayload.js +0 -11
  16. package/lib/entity/transaction/stateTypes/transaction.d.ts +0 -3
  17. package/lib/entity/transaction/transactionReducer.js +2 -3
  18. package/lib/entity/transaction/transactionSelector.d.ts +2 -2
  19. package/lib/entity/transaction/transactionState.d.ts +2 -3
  20. package/lib/epic.d.ts +1 -2
  21. package/lib/epic.js +1 -2
  22. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +5 -54
  23. package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +3 -3
  24. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +1 -2
  25. package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +0 -1
  26. package/lib/esm/entity/reimbursement/reimbursementPayload.js +1 -1
  27. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +0 -11
  28. package/lib/esm/entity/transaction/transactionReducer.js +2 -3
  29. package/lib/esm/epic.js +1 -2
  30. package/lib/esm/index.js +7 -8
  31. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +1 -82
  32. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +2 -8
  33. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +13 -21
  34. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +3 -50
  35. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -17
  36. package/lib/esm/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsEpic.js +7 -2
  37. package/lib/esm/view/scheduleView/scheduleListView/scheduleListReducer.js +7 -2
  38. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +0 -10
  39. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +0 -1
  40. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
  41. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
  42. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
  43. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
  44. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  45. package/lib/index.d.ts +9 -12
  46. package/lib/index.js +32 -42
  47. package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
  48. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +0 -7
  49. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +1 -15
  50. package/lib/view/aiCfoView/aiCfoViewReducer.js +2 -83
  51. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +1 -4
  52. package/lib/view/aiCfoView/aiCfoViewSelector.js +2 -9
  53. package/lib/view/aiCfoView/aiCfoViewState.d.ts +1 -18
  54. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  55. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +13 -13
  56. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +13 -21
  57. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +0 -2
  58. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +3 -50
  59. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +0 -5
  60. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +0 -19
  61. package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsEpic.js +7 -2
  62. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.d.ts +4 -4
  63. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +6 -1
  64. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  65. package/lib/view/spendManagement/billPay/billList/billListSelector.js +0 -10
  66. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  67. package/lib/view/spendManagement/billPay/billList/billListState.js +0 -1
  68. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  69. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
  70. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
  71. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +0 -1
  72. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
  73. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  74. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
  75. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  76. package/package.json +2 -2
  77. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -29
  78. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +0 -8
  79. 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">, fetchSuggestedQuestions: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
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.clearAiCfoSidePanelHostPageContext = exports.applyAiCfoSidePanelHostPageTransition = exports.fetchSuggestedQuestionsFailure = exports.fetchSuggestedQuestionsSuccess = exports.fetchSuggestedQuestions = 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;
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, exports.fetchSuggestedQuestions = _a.fetchSuggestedQuestions, exports.fetchSuggestedQuestionsSuccess = _a.fetchSuggestedQuestionsSuccess, exports.fetchSuggestedQuestionsFailure = _a.fetchSuggestedQuestionsFailure, exports.applyAiCfoSidePanelHostPageTransition = _a.applyAiCfoSidePanelHostPageTransition, exports.clearAiCfoSidePanelHostPageContext = _a.clearAiCfoSidePanelHostPageContext;
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 { AiCfoSuggestedQuestionsPageContext } from './aiCfoViewState';
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, suggestedQuestionsByPageContext, } = state.aiCfoViewState ?? aiCfoViewReducer_1.initialAiCfoViewState;
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
- suggestedQuestionsByPageContext,
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';
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" | "transactions" | "reports";
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,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, JESchedulesViewUIState } from '../types/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], {
@@ -22,23 +22,23 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
22
22
  jeSchedules: JEScheduledTransactionPayload[];
23
23
  refreshViewInBackground: boolean;
24
24
  selectedPeriod: MonthYearPeriod;
25
- }, "expenseAutomationJESchedulesView/fetchJeSchedulesSuccess">, fetchRecommendationForAccountSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/fetchRecommendationForAccountSettings">, ignoreRecommendedJeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleTransactionKey: `${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}`, scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue"], {
26
- jeScheduleTransactionKey: `${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}`;
25
+ }, "expenseAutomationJESchedulesView/fetchJeSchedulesSuccess">, fetchRecommendationForAccountSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/fetchRecommendationForAccountSettings">, ignoreRecommendedJeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleTransactionKey: `${string}_bill` | `${string}_expense` | `${string}_check` | `${string}_refund` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`, scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue"], {
26
+ jeScheduleTransactionKey: `${string}_bill` | `${string}_expense` | `${string}_check` | `${string}_refund` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`;
27
27
  scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
28
28
  }, "expenseAutomationJESchedulesView/ignoreRecommendedJeSchedule", never, never>, ignoreRecommendedJeScheduleFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
29
29
  jeScheduleTransactionKey: JEScheduleTransactionKey;
30
30
  status: ZeniAPIStatus;
31
- }, "expenseAutomationJESchedulesView/ignoreRecommendedJeScheduleFailure">, ignoreRecommendedJeScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleTransactionKey: `${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}`], {
32
- jeScheduleTransactionKey: `${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}`;
31
+ }, "expenseAutomationJESchedulesView/ignoreRecommendedJeScheduleFailure">, ignoreRecommendedJeScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleTransactionKey: `${string}_bill` | `${string}_expense` | `${string}_check` | `${string}_refund` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`], {
32
+ jeScheduleTransactionKey: `${string}_bill` | `${string}_expense` | `${string}_check` | `${string}_refund` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`;
33
33
  }, "expenseAutomationJESchedulesView/ignoreRecommendedJeScheduleSuccess", never, never>, initializeAccountSettingsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/initializeAccountSettingsView">, initializeJeScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeSchedules: JEScheduledTransactionPayload[]], {
34
- jeScheduleTransactionKeys: (`${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}`)[];
35
- }, "expenseAutomationJESchedulesView/initializeJeScheduleLocalData", never, never>, removeFailedJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[failedJeScheduleKey: `${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], {
36
- failedJeScheduleKey: `${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}`;
34
+ jeScheduleTransactionKeys: (`${string}_bill` | `${string}_expense` | `${string}_check` | `${string}_refund` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`)[];
35
+ }, "expenseAutomationJESchedulesView/initializeJeScheduleLocalData", never, never>, removeFailedJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[failedJeScheduleKey: `${string}_bill` | `${string}_expense` | `${string}_check` | `${string}_refund` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`, selectedPeriod: MonthYearPeriod], {
36
+ failedJeScheduleKey: `${string}_bill` | `${string}_expense` | `${string}_check` | `${string}_refund` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`;
37
37
  selectedPeriod: MonthYearPeriod;
38
38
  }, "expenseAutomationJESchedulesView/removeFailedJeScheduleTransactionKey", never, never>, removeJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
39
39
  scheduledJournalEntryID: ID;
40
- }, "expenseAutomationJESchedulesView/removeJeScheduleLocalDataById">, removeJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKey: `${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], {
41
- jeScheduleKey: `${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}`;
40
+ }, "expenseAutomationJESchedulesView/removeJeScheduleLocalDataById">, removeJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKey: `${string}_bill` | `${string}_expense` | `${string}_check` | `${string}_refund` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`, selectedPeriod: MonthYearPeriod], {
41
+ jeScheduleKey: `${string}_bill` | `${string}_expense` | `${string}_check` | `${string}_refund` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`;
42
42
  selectedPeriod: MonthYearPeriod;
43
43
  }, "expenseAutomationJESchedulesView/removeJeScheduleTransactionKey", never, never>, retryJeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
44
44
  jeScheduleTransactionKey: JEScheduleTransactionKey;
@@ -56,11 +56,11 @@ 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">, updateJESchedulesUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<JESchedulesViewUIState>, "expenseAutomationJESchedulesView/updateJESchedulesUIState">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
59
+ }, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
60
60
  localData: Partial<JEScheduleLocalData>;
61
61
  scheduledJournalEntryID: ID;
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], {
63
- 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}`)[];
62
+ }, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_bill` | `${string}_expense` | `${string}_check` | `${string}_refund` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`)[], selectedPeriod: MonthYearPeriod], {
63
+ jeScheduleKeys: (`${string}_bill` | `${string}_expense` | `${string}_check` | `${string}_refund` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`)[];
64
64
  selectedPeriod: MonthYearPeriod;
65
65
  }, "expenseAutomationJESchedulesView/updateJeScheduleTransactionKeys", never, never>, updateRecommendationForAccountSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<AccountTypeRecommendationPayload, "expenseAutomationJESchedulesView/updateRecommendationForAccountSettings">, updateRecommendationForAccountSettingsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
66
66
  status: ZeniAPIStatus;
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeJeScheduleTransactionKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.accountSettingsInitialState = void 0;
4
+ exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeJeScheduleTransactionKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.accountSettingsInitialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const getNestedAccountIDHierarchyForReport_1 = require("../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
7
7
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
8
8
  const accountPayload_1 = require("../../../entity/account/accountPayload");
9
9
  const jeSchedulesPayload_1 = require("../../../entity/jeSchedules/jeSchedulesPayload");
10
+ const transactionIDPayload_1 = require("../../../entity/transaction/payloadTypes/transactionIDPayload");
10
11
  const accountTypeRecommendationPayload_1 = require("../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload");
12
+ const transactionDetailState_1 = require("../../transactionDetail/transactionDetailState");
11
13
  exports.accountSettingsInitialState = {
12
14
  localData: {
13
15
  selectedPrepaidExpensesAccountIds: [],
@@ -48,8 +50,6 @@ exports.initialState = {
48
50
  uiState: {
49
51
  searchString: '',
50
52
  scrollPosition: { scrollTop: 0, scrollLeft: undefined },
51
- sortKey: 'startMonth',
52
- sortOrder: 'descending',
53
53
  totalCount: 0,
54
54
  limit: 10,
55
55
  },
@@ -103,8 +103,14 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
103
103
  },
104
104
  fetchJeSchedulesSuccess(draft, action) {
105
105
  const { jeSchedules, selectedPeriod, failedJeSchedules, refreshViewInBackground, } = action.payload;
106
- const jeScheduleTransactionKeys = jeSchedules.map((schedules) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedules.base_transaction));
107
- const failedJeScheduleTransactionKeys = failedJeSchedules.map((schedules) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedules.base_transaction));
106
+ const jeScheduleTransactionKeys = jeSchedules.map((schedules) => {
107
+ const transactionID = (0, transactionIDPayload_1.toTransactionID)(schedules.base_transaction);
108
+ return (0, transactionDetailState_1.getZeniTransactionDetailKey)(transactionID);
109
+ });
110
+ const failedJeScheduleTransactionKeys = failedJeSchedules.map((schedules) => {
111
+ const transactionID = (0, transactionIDPayload_1.toTransactionID)(schedules.base_transaction);
112
+ return (0, transactionDetailState_1.getZeniTransactionDetailKey)(transactionID);
113
+ });
108
114
  if (refreshViewInBackground === true &&
109
115
  draft.refreshStatus.fetchState === 'In-Progress') {
110
116
  draft.refreshStatus = { fetchState: 'Completed', error: undefined };
@@ -270,7 +276,7 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
270
276
  return {
271
277
  payload: {
272
278
  jeScheduleTransactionKeys: [
273
- ...jeSchedules.map((jeSchedule) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(jeSchedule.base_transaction)),
279
+ ...jeSchedules.map((jeSchedule) => (0, jeSchedulesPayload_1.getTransactionDetailKeyPayload)(jeSchedule.base_transaction)),
274
280
  ],
275
281
  },
276
282
  };
@@ -371,26 +377,12 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
371
377
  clearJeAccountSettingsLocalData(draft) {
372
378
  draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
373
379
  },
374
- updateJESchedulesUIState(draft, action) {
375
- if (action.payload.sortKey != null) {
376
- draft.uiState.sortKey = action.payload.sortKey;
377
- }
378
- if (action.payload.sortOrder != null) {
379
- draft.uiState.sortOrder = action.payload.sortOrder;
380
- }
381
- if (action.payload.searchString != null) {
382
- draft.uiState.searchString = action.payload.searchString;
383
- }
384
- if (action.payload.scrollPosition != null) {
385
- draft.uiState.scrollPosition = action.payload.scrollPosition;
386
- }
387
- },
388
380
  clearExpenseAutomationJESchedulesView(draft) {
389
381
  Object.assign(draft, exports.initialState);
390
382
  },
391
383
  },
392
384
  });
393
- _a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
385
+ _a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
394
386
  exports.default = expenseAutomationJESchedulesView.reducer;
395
387
  const doUpdateRecommendationForAccountSettings = (draft, payload) => {
396
388
  const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
@@ -18,12 +18,10 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
18
18
  allDepreciationAccountList: AccountBase[];
19
19
  allDepreciationAccountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
20
20
  classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
21
- completedSchedules: JEScheduledTransaction[];
22
21
  completionStatus: CompletionStatusType;
23
22
  draftSchedules: JEScheduledTransaction[];
24
23
  ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
25
24
  jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
26
- ongoingSchedules: JEScheduledTransaction[];
27
25
  postStatusById: Record<ID, FetchStateAndError>;
28
26
  refreshStatus: FetchStateAndError;
29
27
  resolveSchedules: JEScheduledTransactionWithFailedEntries[];
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getExpenseAutomationJESchedulesView = getExpenseAutomationJESchedulesView;
7
7
  const omit_1 = __importDefault(require("lodash/omit"));
8
- const orderBy_1 = __importDefault(require("lodash/orderBy"));
9
8
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
10
9
  const accountSelector_1 = require("../../../entity/account/accountSelector");
11
10
  const jeSchedulesSelector_1 = require("../../../entity/jeSchedules/jeSchedulesSelector");
@@ -17,42 +16,6 @@ const scheduleDetailSelector_1 = require("../../scheduleView/scheduleDetailView/
17
16
  const scheduleListHelper_1 = require("../../scheduleView/scheduleListView/scheduleListHelper");
18
17
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
19
18
  const jeAccountSettingsViewSelector_1 = require("./jeAccountSettingsViewSelector");
20
- function getJEScheduleSortAccessor(sortKey) {
21
- switch (sortKey) {
22
- case 'vendor':
23
- return (s) => s.vendor.name?.toLowerCase();
24
- case 'category':
25
- return (s) => s.jeDebit.account?.accountName?.toLowerCase();
26
- case 'class':
27
- return (s) => s.jeDebit.accountingClass?.className?.toLowerCase();
28
- case 'scheduleCategory':
29
- return (s) => s.jeScheduleType;
30
- case 'startMonth':
31
- return (s) => s.startDate?.valueOf();
32
- case 'type':
33
- return (s) => s.baseTransaction.typeOfTransaction;
34
- case 'amortizationPeriod':
35
- return (s) => s.period;
36
- case 'jePostingDate':
37
- return (s) => s.dayOfPostingDate;
38
- case 'remainingMonths':
39
- return (s) => s.period;
40
- case 'runningBalance':
41
- return (s) => s.balanceAsOfToday?.amount;
42
- case 'totalAmount':
43
- return (s) => s.baseTransaction.amount.amount;
44
- case 'transactionDate':
45
- return (s) => s.baseTransaction.date.valueOf();
46
- case 'memo':
47
- return (s) => s.baseTransaction.memo?.toLowerCase();
48
- default:
49
- return (s) => s.startDate?.valueOf();
50
- }
51
- }
52
- function sortJEScheduledTransactions(transactions, sortKey, sortOrder) {
53
- const accessor = getJEScheduleSortAccessor(sortKey);
54
- return (0, orderBy_1.default)(transactions, [accessor], [sortOrder === 'ascending' ? 'asc' : 'desc']);
55
- }
56
19
  function getExpenseAutomationJESchedulesView(state) {
57
20
  const jeScheduledTransaction = [];
58
21
  const failedJeScheduledTransaction = [];
@@ -102,21 +65,13 @@ function getExpenseAutomationJESchedulesView(state) {
102
65
  const jeScheduleDetails = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleKey, state);
103
66
  failedJeScheduledTransaction.push(jeScheduleDetails);
104
67
  });
105
- const { sortKey, sortOrder } = uiState;
106
- const draftSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft'), sortKey, sortOrder);
107
- const ongoingSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'ongoing'), sortKey, sortOrder);
108
- const completedSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'completed' ||
109
- schedule.status.code === 'marked_as_completed'), sortKey, sortOrder);
110
- const unsortedResolveSchedules = [];
68
+ const draftSchedules = jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft');
69
+ const resolveSchedules = [];
111
70
  failedJeScheduledTransaction.forEach((schedule) => {
112
71
  schedule.scheduledJournalEntry.forEach((journalEntry) => {
113
- unsortedResolveSchedules.push({
114
- ...schedule,
115
- scheduledJournalEntry: journalEntry,
116
- });
72
+ resolveSchedules.push({ ...schedule, scheduledJournalEntry: journalEntry });
117
73
  });
118
74
  });
119
- const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
120
75
  const allSteps = monthYearPeriodId != null
121
76
  ? (0, expenseAutomationViewSelectorTypes_1.getAllSteps)(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
122
77
  : [];
@@ -130,9 +85,7 @@ function getExpenseAutomationJESchedulesView(state) {
130
85
  allAccountList: filteredAccounts,
131
86
  accountListNestedAccountHierarchy,
132
87
  allClassList: allClasses,
133
- completedSchedules,
134
88
  draftSchedules,
135
- ongoingSchedules,
136
89
  resolveSchedules: resolveSchedules,
137
90
  accountSettingsView,
138
91
  postStatusById: postStatusById,