@zeniai/client-epic-state 5.2.11-beta0ND → 5.2.11-betaRD2

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 (150) hide show
  1. package/lib/entity/invoicing/invoicingCommonPayload.d.ts +29 -27
  2. package/lib/entity/invoicing/invoicingCommonPayload.js +75 -37
  3. package/lib/entity/invoicing/product/productPayload.d.ts +0 -10
  4. package/lib/entity/invoicing/product/productPayload.js +2 -14
  5. package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +1 -0
  6. package/lib/entity/jeSchedules/jeScheduleHelper.js +7 -0
  7. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +66 -1
  8. package/lib/entity/jeSchedules/jeSchedulesPayload.js +135 -0
  9. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +4 -2
  10. package/lib/entity/jeSchedules/jeSchedulesReducer.js +30 -2
  11. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +11 -2
  12. package/lib/entity/jeSchedules/jeSchedulesSelector.js +38 -3
  13. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +79 -1
  14. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +24 -1
  15. package/lib/entity/jeSchedules/jeSchedulesTypes.js +88 -1
  16. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  17. package/lib/entity/snackbar/snackbarTypes.js +3 -0
  18. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +2 -0
  19. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  20. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +2 -0
  21. package/lib/epic.d.ts +10 -3
  22. package/lib/epic.js +21 -12
  23. package/lib/esm/entity/invoicing/invoicingCommonPayload.js +73 -33
  24. package/lib/esm/entity/invoicing/product/productPayload.js +2 -14
  25. package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +6 -0
  26. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +135 -1
  27. package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +30 -2
  28. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +36 -2
  29. package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +78 -0
  30. package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
  31. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  32. package/lib/esm/epic.js +17 -8
  33. package/lib/esm/index.js +20 -15
  34. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
  35. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +9 -1
  36. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +41 -5
  37. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +45 -0
  38. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
  39. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +99 -0
  40. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +25 -0
  41. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +110 -0
  42. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +79 -0
  43. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +139 -0
  44. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +106 -0
  45. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +22 -0
  46. package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +140 -0
  47. package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +55 -0
  48. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +311 -29
  49. package/lib/esm/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +1 -0
  50. package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +106 -0
  51. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +294 -22
  52. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +5 -6
  53. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +9 -25
  54. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +1 -6
  55. package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +0 -40
  56. package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +92 -0
  57. package/lib/esm/view/invoicing/settingsView/settingsViewReducer.js +1 -25
  58. package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +0 -41
  59. package/lib/esm/view/recommendation/recommendationReducer.js +1 -16
  60. package/lib/esm/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
  61. package/lib/esm/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
  62. package/lib/esm/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
  63. package/lib/index.d.ts +24 -22
  64. package/lib/index.js +96 -60
  65. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
  66. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +9 -1
  67. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +3 -2
  68. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +39 -3
  69. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.d.ts +20 -0
  70. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +49 -0
  71. package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
  72. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +8 -0
  73. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +103 -0
  74. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +8 -0
  75. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +29 -0
  76. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +45 -0
  77. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +114 -0
  78. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +8 -0
  79. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +83 -0
  80. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +12 -0
  81. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +146 -0
  82. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +64 -0
  83. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +110 -0
  84. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +6 -0
  85. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +26 -0
  86. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +36 -0
  87. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +145 -0
  88. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  89. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +72 -3
  90. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +58 -1
  91. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +91 -12
  92. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +313 -29
  93. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
  94. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
  95. package/lib/view/expenseAutomationView/selectorTypes/jeAccountSettingsViewSelectorTypes.d.ts +1 -0
  96. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +42 -0
  97. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +36 -7
  98. package/lib/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +1 -0
  99. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +21 -0
  100. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +112 -0
  101. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +34 -0
  102. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +302 -21
  103. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
  104. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +83 -8
  105. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -8
  106. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +2 -2
  107. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +1 -12
  108. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +9 -25
  109. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +1 -6
  110. package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +1 -10
  111. package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +1 -43
  112. package/lib/view/invoicing/settingsView/settingsViewEpics.d.ts +12 -0
  113. package/lib/view/invoicing/settingsView/settingsViewEpics.js +99 -0
  114. package/lib/view/invoicing/settingsView/settingsViewReducer.d.ts +1 -4
  115. package/lib/view/invoicing/settingsView/settingsViewReducer.js +2 -26
  116. package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +0 -35
  117. package/lib/view/invoicing/settingsView/settingsViewSelector.js +1 -43
  118. package/lib/view/invoicing/settingsView/settingsViewState.d.ts +0 -8
  119. package/lib/view/recommendation/recommendationPayload.d.ts +0 -34
  120. package/lib/view/recommendation/recommendationReducer.d.ts +1 -2
  121. package/lib/view/recommendation/recommendationReducer.js +2 -17
  122. package/lib/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
  123. package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
  124. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +4 -2
  125. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
  126. package/package.json +1 -1
  127. package/lib/esm/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.js +0 -27
  128. package/lib/esm/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.js +0 -19
  129. package/lib/esm/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.js +0 -19
  130. package/lib/esm/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.js +0 -39
  131. package/lib/esm/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.js +0 -25
  132. package/lib/esm/view/invoicing/settingsView/invoicingQboSettingsFormConfig.js +0 -48
  133. package/lib/esm/view/recommendation/submitRecommendationFeedbackEpic.js +0 -52
  134. package/lib/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.d.ts +0 -6
  135. package/lib/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.js +0 -31
  136. package/lib/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.d.ts +0 -6
  137. package/lib/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.js +0 -23
  138. package/lib/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.d.ts +0 -6
  139. package/lib/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.js +0 -23
  140. package/lib/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.d.ts +0 -6
  141. package/lib/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.js +0 -43
  142. package/lib/view/invoicing/settingsView/epics/settingsViewActionType.d.ts +0 -5
  143. package/lib/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.d.ts +0 -11
  144. package/lib/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.js +0 -29
  145. package/lib/view/invoicing/settingsView/invoicingQboSettingsFormConfig.d.ts +0 -34
  146. package/lib/view/invoicing/settingsView/invoicingQboSettingsFormConfig.js +0 -53
  147. package/lib/view/recommendation/submitRecommendationFeedbackEpic.d.ts +0 -7
  148. package/lib/view/recommendation/submitRecommendationFeedbackEpic.js +0 -56
  149. /package/lib/esm/view/{invoicing/settingsView/epics/settingsViewActionType.js → expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js} +0 -0
  150. /package/lib/view/{invoicing/settingsView/epics/settingsViewActionType.js → expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js} +0 -0
@@ -1,14 +1,22 @@
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.saveNewScheduleSuccess = exports.saveNewScheduleFailure = exports.saveNewSchedule = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.resetNewScheduleLocalData = exports.removeJeScheduleTransactionKey = exports.removeJeAccruedScheduleKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeNewSchedule = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchOneTimeAccrualSuccess = exports.fetchOneTimeAccrualFailure = exports.fetchOneTimeAccrual = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.revertOneTimeAccrual = exports.revertJeScheduleSuccess = exports.revertJeScheduleFailure = exports.revertJeSchedule = exports.promoteOneTimeAccrual = exports.oneTimeAccrualActionSuccess = exports.oneTimeAccrualActionFailure = exports.ignoreOneTimeAccrual = exports.createOneTimeAccrualSuccess = exports.createOneTimeAccrualFailure = exports.createOneTimeAccrual = exports.clearSearchTransactionsForNewSchedule = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.searchTransactionsInitialState = exports.newScheduleInitialState = exports.getBaseNewScheduleLocalData = exports.accountSettingsInitialState = void 0;
5
+ exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateNewScheduleLocalData = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = exports.toggleJECreatedGroupCollapsed = exports.searchTransactionsForNewScheduleSuccess = exports.searchTransactionsForNewScheduleFailure = exports.searchTransactionsForNewSchedule = void 0;
5
6
  const toolkit_1 = require("@reduxjs/toolkit");
6
7
  const getNestedAccountIDHierarchyForReport_1 = require("../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
7
8
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
8
9
  const accountPayload_1 = require("../../../entity/account/accountPayload");
10
+ const jeScheduleHelper_1 = require("../../../entity/jeSchedules/jeScheduleHelper");
9
11
  const jeSchedulesPayload_1 = require("../../../entity/jeSchedules/jeSchedulesPayload");
10
12
  const rootActions_1 = require("../../../rootActions");
11
13
  const accountTypeRecommendationPayload_1 = require("../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload");
14
+ const jeSchedulesViewState_1 = require("../types/jeSchedulesViewState");
15
+ function removeKeyFromEveryTabSlot(keysByPeriodAndTab, keyToRemove) {
16
+ for (const periodTabKey of Object.keys(keysByPeriodAndTab)) {
17
+ keysByPeriodAndTab[periodTabKey] = keysByPeriodAndTab[periodTabKey].filter((jeScheduleKey) => jeScheduleKey !== keyToRemove);
18
+ }
19
+ }
12
20
  exports.accountSettingsInitialState = {
13
21
  localData: {
14
22
  selectedPrepaidExpensesAccountIds: [],
@@ -22,6 +30,7 @@ exports.accountSettingsInitialState = {
22
30
  error: undefined,
23
31
  fetchState: 'Not-Started',
24
32
  },
33
+ hasLoadedAccountSettings: false,
25
34
  recommendationFetchState: {
26
35
  error: undefined,
27
36
  fetchState: 'Not-Started',
@@ -40,16 +49,38 @@ exports.accountSettingsInitialState = {
40
49
  accruedExpensesNestedAccountListHierarchy: [],
41
50
  accruedExpensesRecommendations: [],
42
51
  };
52
+ const getBaseNewScheduleLocalData = (scheduleType) => ({
53
+ scheduleType,
54
+ jeScheduleDetails: [],
55
+ });
56
+ exports.getBaseNewScheduleLocalData = getBaseNewScheduleLocalData;
57
+ exports.newScheduleInitialState = {
58
+ fixed_assets: (0, exports.getBaseNewScheduleLocalData)('fixed_assets'),
59
+ prepaid_expenses: (0, exports.getBaseNewScheduleLocalData)('prepaid_expenses'),
60
+ };
61
+ exports.searchTransactionsInitialState = {
62
+ searchResults: [],
63
+ fetchState: 'Not-Started',
64
+ error: undefined,
65
+ };
43
66
  exports.initialState = {
44
- jeScheduleTransactionKeysByPeriod: {},
45
- failedJeScheduleTransactionKeysByPeriod: {},
67
+ jeScheduleTransactionKeysByPeriodAndTab: {},
68
+ jeScheduleAccruedKeysByPeriodAndTab: {},
69
+ jeScheduleOneTimeAccrualKeysByPeriodAndTab: {},
70
+ failedJeScheduleTransactionKeysByPeriodAndTab: {},
46
71
  postStatusById: {},
47
72
  ignoreStatusById: {},
73
+ revertStatusById: {},
48
74
  jeScheduleLocalDataById: {},
75
+ oneTimeAccrualActionStatusById: {},
76
+ oneTimeAccrualFetchStatusById: {},
49
77
  uiState: {
50
- searchString: '',
78
+ createdGroupCollapsed: false,
79
+ pendingGroupCollapsed: false,
51
80
  scrollPosition: { scrollTop: 0, scrollLeft: undefined },
52
- selectedMainTab: 'pending_review',
81
+ searchString: '',
82
+ selectedJETypeFilter: null,
83
+ selectedPageTab: 'schedules',
53
84
  sortKey: 'transactionDate',
54
85
  sortOrder: 'descending',
55
86
  totalCount: 0,
@@ -60,6 +91,14 @@ exports.initialState = {
60
91
  error: undefined,
61
92
  },
62
93
  accountSettings: exports.accountSettingsInitialState,
94
+ newSchedule: {
95
+ createOneTimeAccrualStatus: { fetchState: 'Not-Started', error: undefined },
96
+ newScheduleState: exports.newScheduleInitialState,
97
+ saveStatus: { fetchState: 'Not-Started', error: undefined },
98
+ searchTransactions: exports.searchTransactionsInitialState,
99
+ fetchState: 'Not-Started',
100
+ error: undefined,
101
+ },
63
102
  fetchState: 'Not-Started',
64
103
  error: undefined,
65
104
  hasValidState() {
@@ -104,9 +143,12 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
104
143
  },
105
144
  },
106
145
  fetchJeSchedulesSuccess(draft, action) {
107
- const { jeSchedules, selectedPeriod, failedJeSchedules, refreshViewInBackground, } = action.payload;
146
+ const { jeSchedules, selectedPeriod, selectedPageTab, failedJeSchedules, accruedJeSchedules, oneTimeAccruals, refreshViewInBackground, } = action.payload;
147
+ const periodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
108
148
  const jeScheduleTransactionKeys = jeSchedules.map((schedules) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedules.base_transaction));
109
149
  const failedJeScheduleTransactionKeys = failedJeSchedules.map((schedules) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedules.base_transaction));
150
+ const jeScheduleAccruedKeys = accruedJeSchedules.map((schedule) => (0, jeSchedulesPayload_1.getJEScheduleKey)(schedule));
151
+ const jeScheduleOneTimeAccrualKeys = oneTimeAccruals.map((accrual) => (0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrual._id));
110
152
  if (refreshViewInBackground === true &&
111
153
  draft.refreshStatus.fetchState === 'In-Progress') {
112
154
  draft.refreshStatus = { fetchState: 'Completed', error: undefined };
@@ -115,19 +157,28 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
115
157
  draft.fetchState = 'Completed';
116
158
  draft.error = undefined;
117
159
  }
118
- draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = jeScheduleTransactionKeys;
119
- draft.failedJeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = failedJeScheduleTransactionKeys;
160
+ draft.jeScheduleTransactionKeysByPeriodAndTab[periodTabKey] =
161
+ jeScheduleTransactionKeys;
162
+ draft.jeScheduleAccruedKeysByPeriodAndTab[periodTabKey] =
163
+ jeScheduleAccruedKeys;
164
+ draft.jeScheduleOneTimeAccrualKeysByPeriodAndTab[periodTabKey] =
165
+ jeScheduleOneTimeAccrualKeys;
166
+ draft.failedJeScheduleTransactionKeysByPeriodAndTab[periodTabKey] =
167
+ failedJeScheduleTransactionKeys;
120
168
  },
121
169
  fetchJeSchedulesFailure(draft, action) {
122
- const { status, selectedPeriod } = action.payload;
170
+ const { status, selectedPeriod, selectedPageTab } = action.payload;
171
+ const periodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
123
172
  if (draft.refreshStatus.fetchState === 'In-Progress') {
124
173
  draft.refreshStatus = { fetchState: 'Error', error: status };
125
174
  }
126
175
  else {
127
176
  draft.fetchState = 'Error';
128
177
  draft.error = status;
178
+ draft.jeScheduleTransactionKeysByPeriodAndTab[periodTabKey] = [];
179
+ draft.jeScheduleAccruedKeysByPeriodAndTab[periodTabKey] = [];
180
+ draft.jeScheduleOneTimeAccrualKeysByPeriodAndTab[periodTabKey] = [];
129
181
  }
130
- draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = [];
131
182
  },
132
183
  retryJeSchedule(draft, action) {
133
184
  const { scheduledJournalEntryID } = action.payload;
@@ -163,11 +214,13 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
163
214
  };
164
215
  },
165
216
  ignoreRecommendedJeSchedule: {
166
- prepare(jeScheduleTransactionKey, scheduleType) {
217
+ prepare(jeScheduleTransactionKey, scheduleType, reason, note) {
167
218
  return {
168
219
  payload: {
169
220
  jeScheduleTransactionKey,
170
221
  scheduleType,
222
+ reason,
223
+ note,
171
224
  },
172
225
  };
173
226
  },
@@ -183,6 +236,41 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
183
236
  };
184
237
  },
185
238
  },
239
+ revertJeSchedule: {
240
+ // jeScheduleTransactionKey is a JEScheduleKey for an accrued schedule, which has no base
241
+ // transaction to derive a transaction key from. It is only ever used as an opaque row
242
+ // identifier here -- for the row's spinner and for dropping the row from the list -- so one
243
+ // action serves both shapes rather than two near-identical ones.
244
+ prepare(jeScheduleId, jeScheduleTransactionKey, scheduleType, reason, note) {
245
+ return {
246
+ payload: {
247
+ jeScheduleId,
248
+ jeScheduleTransactionKey,
249
+ scheduleType,
250
+ reason,
251
+ note,
252
+ },
253
+ };
254
+ },
255
+ reducer(draft, action) {
256
+ draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
257
+ fetchState: 'In-Progress',
258
+ error: undefined,
259
+ };
260
+ },
261
+ },
262
+ revertJeScheduleSuccess(draft, action) {
263
+ draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
264
+ fetchState: 'Completed',
265
+ error: undefined,
266
+ };
267
+ },
268
+ revertJeScheduleFailure(draft, action) {
269
+ draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
270
+ fetchState: 'Error',
271
+ error: action.payload.status,
272
+ };
273
+ },
186
274
  ignoreRecommendedJeScheduleSuccess: {
187
275
  reducer(draft, action) {
188
276
  const { jeScheduleTransactionKey } = action.payload;
@@ -215,17 +303,18 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
215
303
  };
216
304
  },
217
305
  updateJeScheduleTransactionKeys: {
218
- prepare(jeScheduleKeys, selectedPeriod) {
306
+ prepare(jeScheduleKeys, selectedPeriod, selectedPageTab) {
219
307
  return {
220
308
  payload: {
221
309
  jeScheduleKeys: jeScheduleKeys,
222
310
  selectedPeriod: selectedPeriod,
311
+ selectedPageTab: selectedPageTab,
223
312
  },
224
313
  };
225
314
  },
226
315
  reducer(draft, action) {
227
- const { selectedPeriod, jeScheduleKeys } = action.payload;
228
- draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = jeScheduleKeys;
316
+ const { selectedPeriod, selectedPageTab, jeScheduleKeys } = action.payload;
317
+ draft.jeScheduleTransactionKeysByPeriodAndTab[(0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod))] = jeScheduleKeys;
229
318
  },
230
319
  },
231
320
  removeJeScheduleTransactionKey: {
@@ -238,12 +327,20 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
238
327
  };
239
328
  },
240
329
  reducer(draft, action) {
241
- const { selectedPeriod, jeScheduleKey } = action.payload;
242
- const prevData = [
243
- ...(draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] ?? []),
244
- ];
245
- const filteredKeys = prevData.filter((jeKey) => jeKey !== jeScheduleKey);
246
- draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = filteredKeys;
330
+ const { jeScheduleKey } = action.payload;
331
+ // Dropped from every tab's slot, not just the visible one: once a schedule is ignored or
332
+ // resolved it must not reappear when the user switches tabs and hits a cached list.
333
+ removeKeyFromEveryTabSlot(draft.jeScheduleTransactionKeysByPeriodAndTab, jeScheduleKey);
334
+ },
335
+ },
336
+ removeJeAccruedScheduleKey: {
337
+ prepare(jeAccruedScheduleKey) {
338
+ return { payload: { jeAccruedScheduleKey } };
339
+ },
340
+ reducer(draft, action) {
341
+ // Accrued keys live in their own per-tab map, so removeJeScheduleTransactionKey cannot drop
342
+ // them -- a reverted accrued schedule stayed on the list until the next fetch.
343
+ removeKeyFromEveryTabSlot(draft.jeScheduleAccruedKeysByPeriodAndTab, action.payload.jeAccruedScheduleKey);
247
344
  },
248
345
  },
249
346
  removeFailedJeScheduleTransactionKey: {
@@ -256,12 +353,8 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
256
353
  };
257
354
  },
258
355
  reducer(draft, action) {
259
- const { selectedPeriod, failedJeScheduleKey } = action.payload;
260
- const prevData = [
261
- ...(draft.failedJeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] ?? []),
262
- ];
263
- const filteredKeys = prevData.filter((jeKey) => jeKey !== failedJeScheduleKey);
264
- draft.failedJeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = filteredKeys;
356
+ const { failedJeScheduleKey } = action.payload;
357
+ removeKeyFromEveryTabSlot(draft.failedJeScheduleTransactionKeysByPeriodAndTab, failedJeScheduleKey);
265
358
  },
266
359
  },
267
360
  initializeJeScheduleLocalData: {
@@ -340,6 +433,9 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
340
433
  error: status,
341
434
  fetchState: 'Error',
342
435
  };
436
+ // Set on failure too: a tenant whose account list errors must still reach the page rather
437
+ // than sit under a skeleton forever.
438
+ draft.accountSettings.hasLoadedAccountSettings = true;
343
439
  },
344
440
  updateAccountSettingsListForAccountTypes(draft, action) {
345
441
  doUpdateAccountSettingsListForAccountTypes(draft.accountSettings, action.payload.accountPayload);
@@ -373,6 +469,182 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
373
469
  clearJeAccountSettingsLocalData(draft) {
374
470
  draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
375
471
  },
472
+ initializeNewSchedule: {
473
+ prepare({ scheduleType, shouldResetEnteredData = true, }) {
474
+ return { payload: { scheduleType, shouldResetEnteredData } };
475
+ },
476
+ reducer() {
477
+ // Purely an epic-trigger action — the epic fans out the account/class
478
+ // list fetches, and clears entered data only when asked to.
479
+ },
480
+ },
481
+ resetNewScheduleLocalData: {
482
+ prepare({ scheduleType, }) {
483
+ return { payload: { scheduleType } };
484
+ },
485
+ reducer(draft, action) {
486
+ const { scheduleType } = action.payload;
487
+ draft.newSchedule.newScheduleState[scheduleType] =
488
+ (0, exports.getBaseNewScheduleLocalData)(scheduleType);
489
+ },
490
+ },
491
+ updateNewScheduleLocalData(draft, action) {
492
+ const { scheduleType, localData } = action.payload;
493
+ draft.newSchedule.newScheduleState[scheduleType] = {
494
+ ...draft.newSchedule.newScheduleState[scheduleType],
495
+ ...localData,
496
+ };
497
+ },
498
+ searchTransactionsForNewSchedule: {
499
+ prepare({ query, scheduleType, }) {
500
+ return { payload: { query, scheduleType } };
501
+ },
502
+ reducer(draft, action) {
503
+ const trimmed = action.payload.query.trim();
504
+ // Cleared or too-short query: no API (see epic) — reset immediately.
505
+ if (trimmed.length < jeSchedulesViewState_1.MIN_NEW_SCHEDULE_SEARCH_LENGTH) {
506
+ draft.newSchedule.searchTransactions = exports.searchTransactionsInitialState;
507
+ return;
508
+ }
509
+ draft.newSchedule.searchTransactions = {
510
+ ...draft.newSchedule.searchTransactions,
511
+ searchString: action.payload.query,
512
+ fetchState: 'In-Progress',
513
+ };
514
+ },
515
+ },
516
+ searchTransactionsForNewScheduleSuccess(draft, action) {
517
+ draft.newSchedule.searchTransactions = {
518
+ ...draft.newSchedule.searchTransactions,
519
+ searchResults: action.payload.searchResults,
520
+ fetchState: 'Completed',
521
+ error: undefined,
522
+ };
523
+ },
524
+ searchTransactionsForNewScheduleFailure(draft, action) {
525
+ draft.newSchedule.searchTransactions = {
526
+ ...draft.newSchedule.searchTransactions,
527
+ fetchState: 'Error',
528
+ error: action.payload.status,
529
+ };
530
+ },
531
+ clearSearchTransactionsForNewSchedule(draft) {
532
+ draft.newSchedule.searchTransactions = exports.searchTransactionsInitialState;
533
+ },
534
+ saveNewSchedule: {
535
+ prepare({ scheduleType, }) {
536
+ return { payload: { scheduleType } };
537
+ },
538
+ reducer(draft) {
539
+ draft.newSchedule.saveStatus = {
540
+ fetchState: 'In-Progress',
541
+ error: undefined,
542
+ };
543
+ },
544
+ },
545
+ saveNewScheduleSuccess(draft) {
546
+ draft.newSchedule.saveStatus = {
547
+ fetchState: 'Completed',
548
+ error: undefined,
549
+ };
550
+ },
551
+ saveNewScheduleFailure(draft, action) {
552
+ draft.newSchedule.saveStatus = {
553
+ fetchState: 'Error',
554
+ error: action.payload.status,
555
+ };
556
+ },
557
+ createOneTimeAccrual: {
558
+ prepare(localData) {
559
+ return { payload: { localData } };
560
+ },
561
+ reducer(draft) {
562
+ draft.newSchedule.createOneTimeAccrualStatus = {
563
+ fetchState: 'In-Progress',
564
+ error: undefined,
565
+ };
566
+ },
567
+ },
568
+ createOneTimeAccrualSuccess(draft) {
569
+ draft.newSchedule.createOneTimeAccrualStatus = {
570
+ fetchState: 'Completed',
571
+ error: undefined,
572
+ };
573
+ },
574
+ createOneTimeAccrualFailure(draft, action) {
575
+ draft.newSchedule.createOneTimeAccrualStatus = {
576
+ fetchState: 'Error',
577
+ error: action.payload.status,
578
+ };
579
+ },
580
+ promoteOneTimeAccrual: {
581
+ prepare(accrualId, amount) {
582
+ return { payload: { accrualId, amount } };
583
+ },
584
+ reducer(draft, action) {
585
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
586
+ fetchState: 'In-Progress',
587
+ error: undefined,
588
+ };
589
+ },
590
+ },
591
+ revertOneTimeAccrual: {
592
+ prepare(accrualId, reason, note) {
593
+ return { payload: { accrualId, reason, note } };
594
+ },
595
+ reducer(draft, action) {
596
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
597
+ fetchState: 'In-Progress',
598
+ error: undefined,
599
+ };
600
+ },
601
+ },
602
+ ignoreOneTimeAccrual: {
603
+ prepare(accrualId, reason, note) {
604
+ return { payload: { accrualId, reason, note } };
605
+ },
606
+ reducer(draft, action) {
607
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
608
+ fetchState: 'In-Progress',
609
+ error: undefined,
610
+ };
611
+ },
612
+ },
613
+ fetchOneTimeAccrual: {
614
+ prepare(accrualId) {
615
+ return { payload: { accrualId } };
616
+ },
617
+ reducer(draft, action) {
618
+ draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
619
+ fetchState: 'In-Progress',
620
+ error: undefined,
621
+ };
622
+ },
623
+ },
624
+ fetchOneTimeAccrualSuccess(draft, action) {
625
+ draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
626
+ fetchState: 'Completed',
627
+ error: undefined,
628
+ };
629
+ },
630
+ fetchOneTimeAccrualFailure(draft, action) {
631
+ draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
632
+ fetchState: 'Error',
633
+ error: action.payload.status,
634
+ };
635
+ },
636
+ oneTimeAccrualActionSuccess(draft, action) {
637
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
638
+ fetchState: 'Completed',
639
+ error: undefined,
640
+ };
641
+ },
642
+ oneTimeAccrualActionFailure(draft, action) {
643
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
644
+ fetchState: 'Error',
645
+ error: action.payload.status,
646
+ };
647
+ },
376
648
  updateJESchedulesUIState(draft, action) {
377
649
  if (action.payload.sortKey != null) {
378
650
  draft.uiState.sortKey = action.payload.sortKey;
@@ -386,10 +658,21 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
386
658
  if (action.payload.scrollPosition != null) {
387
659
  draft.uiState.scrollPosition = action.payload.scrollPosition;
388
660
  }
389
- if (action.payload.selectedMainTab != null) {
390
- draft.uiState.selectedMainTab = action.payload.selectedMainTab;
661
+ if (action.payload.selectedPageTab != null) {
662
+ draft.uiState.selectedPageTab = action.payload.selectedPageTab;
391
663
  }
392
664
  },
665
+ updateJEScheduleTypeFilter(draft, action) {
666
+ draft.uiState.selectedJETypeFilter = action.payload;
667
+ },
668
+ toggleJEPendingGroupCollapsed(draft) {
669
+ draft.uiState.pendingGroupCollapsed =
670
+ !draft.uiState.pendingGroupCollapsed;
671
+ },
672
+ toggleJECreatedGroupCollapsed(draft) {
673
+ draft.uiState.createdGroupCollapsed =
674
+ !draft.uiState.createdGroupCollapsed;
675
+ },
393
676
  clearExpenseAutomationJESchedulesView(draft) {
394
677
  Object.assign(draft, exports.initialState);
395
678
  },
@@ -400,7 +683,7 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
400
683
  });
401
684
  },
402
685
  });
403
- _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;
686
+ _a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.clearSearchTransactionsForNewSchedule = _a.clearSearchTransactionsForNewSchedule, exports.createOneTimeAccrual = _a.createOneTimeAccrual, exports.createOneTimeAccrualFailure = _a.createOneTimeAccrualFailure, exports.createOneTimeAccrualSuccess = _a.createOneTimeAccrualSuccess, exports.ignoreOneTimeAccrual = _a.ignoreOneTimeAccrual, exports.oneTimeAccrualActionFailure = _a.oneTimeAccrualActionFailure, exports.oneTimeAccrualActionSuccess = _a.oneTimeAccrualActionSuccess, exports.promoteOneTimeAccrual = _a.promoteOneTimeAccrual, exports.revertJeSchedule = _a.revertJeSchedule, exports.revertJeScheduleFailure = _a.revertJeScheduleFailure, exports.revertJeScheduleSuccess = _a.revertJeScheduleSuccess, exports.revertOneTimeAccrual = _a.revertOneTimeAccrual, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchOneTimeAccrual = _a.fetchOneTimeAccrual, exports.fetchOneTimeAccrualFailure = _a.fetchOneTimeAccrualFailure, exports.fetchOneTimeAccrualSuccess = _a.fetchOneTimeAccrualSuccess, 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.initializeNewSchedule = _a.initializeNewSchedule, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeAccruedScheduleKey = _a.removeJeAccruedScheduleKey, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.resetNewScheduleLocalData = _a.resetNewScheduleLocalData, 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.saveNewSchedule = _a.saveNewSchedule, exports.saveNewScheduleFailure = _a.saveNewScheduleFailure, exports.saveNewScheduleSuccess = _a.saveNewScheduleSuccess, exports.searchTransactionsForNewSchedule = _a.searchTransactionsForNewSchedule, exports.searchTransactionsForNewScheduleFailure = _a.searchTransactionsForNewScheduleFailure, exports.searchTransactionsForNewScheduleSuccess = _a.searchTransactionsForNewScheduleSuccess, exports.toggleJECreatedGroupCollapsed = _a.toggleJECreatedGroupCollapsed, exports.toggleJEPendingGroupCollapsed = _a.toggleJEPendingGroupCollapsed, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJEScheduleTypeFilter = _a.updateJEScheduleTypeFilter, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateNewScheduleLocalData = _a.updateNewScheduleLocalData, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
404
687
  exports.default = expenseAutomationJESchedulesView.reducer;
405
688
  const doUpdateRecommendationForAccountSettings = (draft, payload) => {
406
689
  const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
@@ -468,4 +751,5 @@ const doUpdateAccountSettingsListForAccountTypes = (draft, accountPayloadList) =
468
751
  error: undefined,
469
752
  fetchState: 'Completed',
470
753
  };
754
+ draft.hasLoadedAccountSettings = true;
471
755
  };
@@ -97,7 +97,7 @@ export declare const fetchMissingReceipts: import("@reduxjs/toolkit").ActionCrea
97
97
  transactionId: ID;
98
98
  }, "expenseAutomationMissingReceiptsView/confirmBulkUploadMatchSuccess">, confirmBulkUploadMatchFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
99
99
  error: ZeniAPIStatus;
100
- }, "expenseAutomationMissingReceiptsView/confirmBulkUploadMatchFailure">, setBulkUploadResultsTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"completed" | "unmatched", "expenseAutomationMissingReceiptsView/setBulkUploadResultsTab">, setBulkUploadCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"all" | "ai_accountant" | "manual", "expenseAutomationMissingReceiptsView/setBulkUploadCompletedSubTab">, setBulkUploadSortConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
100
+ }, "expenseAutomationMissingReceiptsView/confirmBulkUploadMatchFailure">, setBulkUploadResultsTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"completed" | "unmatched", "expenseAutomationMissingReceiptsView/setBulkUploadResultsTab">, setBulkUploadCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"manual" | "all" | "ai_accountant", "expenseAutomationMissingReceiptsView/setBulkUploadCompletedSubTab">, setBulkUploadSortConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
101
101
  sortKey: BulkUploadSortKey | undefined;
102
102
  sortOrder: SortOrder | undefined;
103
103
  }, "expenseAutomationMissingReceiptsView/setBulkUploadSortConfig">, clearBulkUpload: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/clearBulkUpload">, searchTransactionsForManualMatch: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[query: string, pageToken?: string | null | undefined], {
@@ -68,8 +68,8 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
68
68
  cotTrackingByTransactionId: COTTransactionTrackingByTransactionId;
69
69
  }, "expenseAutomationTransactionsView/updateTransactionCategorization", never, never>, updateCurrentSelectedTransactionCategorizationTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSelectedTab: "review" | "autoCategorized"], {
70
70
  newSelectedTab: "review" | "autoCategorized";
71
- }, "expenseAutomationTransactionsView/updateCurrentSelectedTransactionCategorizationTab", never, never>, updateTransactionCategorizationCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSubTab: "all" | "ai_accountant" | "manual"], {
72
- newSubTab: "all" | "ai_accountant" | "manual";
71
+ }, "expenseAutomationTransactionsView/updateCurrentSelectedTransactionCategorizationTab", never, never>, updateTransactionCategorizationCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSubTab: "manual" | "all" | "ai_accountant"], {
72
+ newSubTab: "manual" | "all" | "ai_accountant";
73
73
  }, "expenseAutomationTransactionsView/updateTransactionCategorizationCompletedSubTab", never, never>, updateTransactionGroup: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newGroup: "income" | "expense" | "all"], {
74
74
  newGroup: "income" | "expense" | "all";
75
75
  }, "expenseAutomationTransactionsView/updateTransactionGroup", never, never>, updateTransactionCategorizationSaveStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
@@ -12,6 +12,7 @@ export interface JEAccountSettingsView extends SelectorView {
12
12
  fixedAssetsAccountHierarchy: NestedAccountHierarchyForReport[];
13
13
  fixedAssetsAccountList: AccountBase[];
14
14
  fixedAssetsRecommendations: Recommendation[];
15
+ hasLoaded: boolean;
15
16
  prepaidExpensesAccountHierarchy: NestedAccountHierarchyForReport[];
16
17
  prepaidExpensesAccountList: AccountBase[];
17
18
  prepaidExpensesRecommendations: Recommendation[];
@@ -0,0 +1,42 @@
1
+ import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
2
+ import { NestedClassHierarchyForReport } from '../../../commonStateTypes/classesView/nestedClassID';
3
+ import { FetchStateAndError } from '../../../commonStateTypes/common';
4
+ import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
5
+ import { AccountBase } from '../../../entity/account/accountState';
6
+ import { ClassBase } from '../../../entity/class/classState';
7
+ import { ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
8
+ import { ScheduleTransaction } from '../../../entity/transaction/stateTypes/scheduleTransaction';
9
+ import { NewScheduleLocalData, NewScheduleLocalDataFixedAssets } from '../types/jeSchedulesViewState';
10
+ export interface NewScheduleSearchTransactionsView {
11
+ searchTransactionsFetchState: FetchStateAndError;
12
+ searchTransactionsResults: ScheduleTransaction[];
13
+ searchTransactionsString?: string;
14
+ }
15
+ /**
16
+ * Accounts and request status for both accrual creation forms — the one-time accrual and the
17
+ * recurring accrued schedule. Deliberately not NewScheduleView: neither has a base transaction to
18
+ * search, and both need a second account hierarchy (the accrued liability) that no schedule type
19
+ * has. A one-time accrual additionally has no local-data slot in newScheduleState, since it is not
20
+ * a schedule type at all.
21
+ */
22
+ export interface NewAccrualAccountsView {
23
+ accountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
24
+ accruedAccountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
25
+ accruedScheduleSaveStatus: FetchStateAndError;
26
+ allAccountList: AccountBase[];
27
+ allAccruedExpenseList: AccountBase[];
28
+ allClassList: ClassBase[];
29
+ classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
30
+ createStatus: FetchStateAndError;
31
+ }
32
+ export interface NewScheduleView extends SelectorView, NewScheduleSearchTransactionsView {
33
+ accountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
34
+ allAccountList: AccountBase[];
35
+ allClassList: ClassBase[];
36
+ classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
37
+ newScheduleLocalData: NewScheduleLocalData | NewScheduleLocalDataFixedAssets;
38
+ saveStatus: FetchStateAndError;
39
+ scheduleType: ScheduleTypes;
40
+ allDepreciationAccountList?: AccountBase[];
41
+ allDepreciationAccountListNestedAccountHierarchy?: NestedAccountHierarchyForReport[];
42
+ }
@@ -4,12 +4,31 @@ import { CompletionStatusType, FetchStateAndError, ID } from '../../../commonSta
4
4
  import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
5
5
  import { AccountBase } from '../../../entity/account/accountState';
6
6
  import { ClassBase } from '../../../entity/class/classState';
7
- import { JEScheduledTransaction } from '../../../entity/jeSchedules/jeSchedulesSelector';
8
- import { JEScheduleTransactionKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
7
+ import { JEScheduleKey, JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
9
8
  import { UncategorizedAccounts } from '../../accountList/accountListSelector';
10
9
  import { JEAccountSettingsView } from '../selectorTypes/jeAccountSettingsViewSelectorTypes';
11
10
  import { JEScheduledTransactionWithFailedEntries } from '../selectors/jeScheduledTransactionWithFailedEntries';
12
- import { JEScheduleLocalData, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
11
+ import { NewScheduleView } from '../selectorTypes/jeNewScheduleViewSelectorTypes';
12
+ import { JEScheduleRow } from '../selectors/jeSchedulesViewSelector';
13
+ import { JEPageTab, JEScheduleLocalData, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
14
+ export interface JEKpiSummary {
15
+ aiAccountant: {
16
+ amount: number;
17
+ count: number;
18
+ };
19
+ manual: {
20
+ amount: number;
21
+ count: number;
22
+ };
23
+ needsReview: {
24
+ amount: number;
25
+ count: number;
26
+ };
27
+ total: {
28
+ amount: number;
29
+ count: number;
30
+ };
31
+ }
13
32
  export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
14
33
  accountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
15
34
  accountSettingsView: JEAccountSettingsView;
@@ -18,16 +37,26 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
18
37
  allDepreciationAccountList: AccountBase[];
19
38
  allDepreciationAccountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
20
39
  classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
21
- completedSchedules: JEScheduledTransaction[];
22
40
  completionStatus: CompletionStatusType;
23
- draftSchedules: JEScheduledTransaction[];
41
+ createdSchedules: JEScheduleRow[];
42
+ createdTotal: number;
43
+ hasLoadedForSelectedTab: boolean;
24
44
  ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
25
45
  jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
26
- ongoingSchedules: JEScheduledTransaction[];
27
- pendingReviewSchedules: (JEScheduledTransaction | JEScheduledTransactionWithFailedEntries)[];
46
+ jeScheduleTypeCounts: {
47
+ active: Record<ScheduleTypes, number>;
48
+ ongoing: Record<ScheduleTypes, number>;
49
+ };
50
+ kpiSummary: JEKpiSummary;
51
+ newScheduleView: NewScheduleView | undefined;
52
+ oneTimeAccrualActionStatusById: Record<ID, FetchStateAndError>;
53
+ pendingReviewSchedules: JEScheduleRow[];
54
+ pendingReviewTotal: number;
28
55
  postStatusById: Record<ID, FetchStateAndError>;
29
56
  refreshStatus: FetchStateAndError;
30
57
  resolveSchedules: JEScheduledTransactionWithFailedEntries[];
58
+ revertStatusById: Record<JEScheduleKey | JEScheduleTransactionKey, FetchStateAndError>;
59
+ scheduleCountsByTab: Partial<Record<JEPageTab, number>>;
31
60
  uiState: JESchedulesViewUIState;
32
61
  uncategorizedAccounts: UncategorizedAccounts;
33
62
  }
@@ -25,6 +25,7 @@ exports.getJEAccountSettingsView = (0, toolkit_1.createSelector)((state) => stat
25
25
  fixedAssetsAccountHierarchy: jeAccountMappingState.fixedAssetsNestedAccountListHierarchy,
26
26
  accruedExpensesAccountHierarchy: jeAccountMappingState.accruedExpensesNestedAccountListHierarchy,
27
27
  fetchState: fetchState.fetchState,
28
+ hasLoaded: jeAccountMappingState.hasLoadedAccountSettings,
28
29
  saveState,
29
30
  };
30
31
  });