@zeniai/client-epic-state 5.2.13 → 5.2.14-betaRD0

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 (126) hide show
  1. package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +1 -0
  2. package/lib/entity/jeSchedules/jeScheduleHelper.js +7 -0
  3. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +78 -1
  4. package/lib/entity/jeSchedules/jeSchedulesPayload.js +183 -4
  5. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +4 -2
  6. package/lib/entity/jeSchedules/jeSchedulesReducer.js +30 -2
  7. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +11 -2
  8. package/lib/entity/jeSchedules/jeSchedulesSelector.js +38 -3
  9. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +123 -1
  10. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +24 -1
  11. package/lib/entity/jeSchedules/jeSchedulesTypes.js +96 -1
  12. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  13. package/lib/entity/snackbar/snackbarTypes.js +3 -0
  14. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +2 -0
  15. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  16. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +2 -0
  17. package/lib/epic.d.ts +9 -1
  18. package/lib/epic.js +16 -0
  19. package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +6 -0
  20. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +183 -5
  21. package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +30 -2
  22. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +36 -2
  23. package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +86 -0
  24. package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
  25. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  26. package/lib/esm/epic.js +16 -0
  27. package/lib/esm/index.js +17 -11
  28. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
  29. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +9 -1
  30. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +41 -5
  31. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +45 -0
  32. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
  33. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +104 -0
  34. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +25 -0
  35. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +138 -0
  36. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +79 -0
  37. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +180 -0
  38. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +111 -0
  39. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +28 -0
  40. package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +140 -0
  41. package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +55 -0
  42. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +319 -29
  43. package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +1 -0
  44. package/lib/esm/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +1 -0
  45. package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +106 -0
  46. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +327 -22
  47. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +5 -6
  48. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +24 -7
  49. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +1 -1
  50. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.js +8 -1
  51. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +42 -8
  52. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogSubFamilyEpics.js +8 -2
  53. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +19 -10
  54. package/lib/esm/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js +2 -0
  55. package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingAccountingPickersEpic.js +0 -1
  56. package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +15 -36
  57. package/lib/esm/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
  58. package/lib/esm/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
  59. package/lib/esm/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
  60. package/lib/index.d.ts +24 -18
  61. package/lib/index.js +93 -48
  62. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
  63. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +9 -1
  64. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +3 -2
  65. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +39 -3
  66. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.d.ts +21 -0
  67. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +49 -0
  68. package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
  69. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +9 -0
  70. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +108 -0
  71. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +8 -0
  72. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +29 -0
  73. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +9 -0
  74. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +142 -0
  75. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +8 -0
  76. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +83 -0
  77. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +13 -0
  78. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +187 -0
  79. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +65 -0
  80. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +115 -0
  81. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +6 -0
  82. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +32 -0
  83. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +36 -0
  84. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +145 -0
  85. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  86. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +86 -3
  87. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +58 -1
  88. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +93 -12
  89. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +321 -29
  90. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
  91. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
  92. package/lib/view/expenseAutomationView/selectorTypes/jeAccountSettingsViewSelectorTypes.d.ts +1 -0
  93. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +42 -0
  94. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +2 -0
  95. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +41 -7
  96. package/lib/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +1 -0
  97. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +21 -0
  98. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +112 -0
  99. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +34 -0
  100. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +335 -21
  101. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
  102. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +83 -8
  103. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -8
  104. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
  105. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.d.ts +13 -21
  106. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +24 -7
  107. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +7 -0
  108. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +4 -3
  109. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.d.ts +18 -9
  110. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.js +9 -2
  111. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +15 -5
  112. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +43 -8
  113. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewState.d.ts +24 -0
  114. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogSubFamilyEpics.d.ts +1 -1
  115. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogSubFamilyEpics.js +8 -2
  116. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +18 -9
  117. package/lib/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.d.ts +6 -0
  118. package/lib/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js +2 -0
  119. package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingAccountingPickersEpic.js +0 -1
  120. package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +13 -13
  121. package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +17 -38
  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
@@ -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,31 @@ 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] = [];
181
+ // Cleared with the rest: leaving it behind kept the previous fetch's resolve rows on an
182
+ // otherwise empty errored tab, which reads as "these are all the schedules there are".
183
+ draft.failedJeScheduleTransactionKeysByPeriodAndTab[periodTabKey] = [];
129
184
  }
130
- draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = [];
131
185
  },
132
186
  retryJeSchedule(draft, action) {
133
187
  const { scheduledJournalEntryID } = action.payload;
@@ -163,11 +217,13 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
163
217
  };
164
218
  },
165
219
  ignoreRecommendedJeSchedule: {
166
- prepare(jeScheduleTransactionKey, scheduleType) {
220
+ prepare(jeScheduleTransactionKey, scheduleType, reason, note) {
167
221
  return {
168
222
  payload: {
169
223
  jeScheduleTransactionKey,
170
224
  scheduleType,
225
+ reason,
226
+ note,
171
227
  },
172
228
  };
173
229
  },
@@ -183,6 +239,41 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
183
239
  };
184
240
  },
185
241
  },
242
+ revertJeSchedule: {
243
+ // jeScheduleTransactionKey is a JEScheduleKey for an accrued schedule, which has no base
244
+ // transaction to derive a transaction key from. It is only ever used as an opaque row
245
+ // identifier here -- for the row's spinner and for dropping the row from the list -- so one
246
+ // action serves both shapes rather than two near-identical ones.
247
+ prepare(jeScheduleId, jeScheduleTransactionKey, scheduleType, reason, note) {
248
+ return {
249
+ payload: {
250
+ jeScheduleId,
251
+ jeScheduleTransactionKey,
252
+ scheduleType,
253
+ reason,
254
+ note,
255
+ },
256
+ };
257
+ },
258
+ reducer(draft, action) {
259
+ draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
260
+ fetchState: 'In-Progress',
261
+ error: undefined,
262
+ };
263
+ },
264
+ },
265
+ revertJeScheduleSuccess(draft, action) {
266
+ draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
267
+ fetchState: 'Completed',
268
+ error: undefined,
269
+ };
270
+ },
271
+ revertJeScheduleFailure(draft, action) {
272
+ draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
273
+ fetchState: 'Error',
274
+ error: action.payload.status,
275
+ };
276
+ },
186
277
  ignoreRecommendedJeScheduleSuccess: {
187
278
  reducer(draft, action) {
188
279
  const { jeScheduleTransactionKey } = action.payload;
@@ -215,17 +306,18 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
215
306
  };
216
307
  },
217
308
  updateJeScheduleTransactionKeys: {
218
- prepare(jeScheduleKeys, selectedPeriod) {
309
+ prepare(jeScheduleKeys, selectedPeriod, selectedPageTab) {
219
310
  return {
220
311
  payload: {
221
312
  jeScheduleKeys: jeScheduleKeys,
222
313
  selectedPeriod: selectedPeriod,
314
+ selectedPageTab: selectedPageTab,
223
315
  },
224
316
  };
225
317
  },
226
318
  reducer(draft, action) {
227
- const { selectedPeriod, jeScheduleKeys } = action.payload;
228
- draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = jeScheduleKeys;
319
+ const { selectedPeriod, selectedPageTab, jeScheduleKeys } = action.payload;
320
+ draft.jeScheduleTransactionKeysByPeriodAndTab[(0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod))] = jeScheduleKeys;
229
321
  },
230
322
  },
231
323
  removeJeScheduleTransactionKey: {
@@ -238,12 +330,20 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
238
330
  };
239
331
  },
240
332
  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;
333
+ const { jeScheduleKey } = action.payload;
334
+ // Dropped from every tab's slot, not just the visible one: once a schedule is ignored or
335
+ // resolved it must not reappear when the user switches tabs and hits a cached list.
336
+ removeKeyFromEveryTabSlot(draft.jeScheduleTransactionKeysByPeriodAndTab, jeScheduleKey);
337
+ },
338
+ },
339
+ removeJeAccruedScheduleKey: {
340
+ prepare(jeAccruedScheduleKey) {
341
+ return { payload: { jeAccruedScheduleKey } };
342
+ },
343
+ reducer(draft, action) {
344
+ // Accrued keys live in their own per-tab map, so removeJeScheduleTransactionKey cannot drop
345
+ // them -- a reverted accrued schedule stayed on the list until the next fetch.
346
+ removeKeyFromEveryTabSlot(draft.jeScheduleAccruedKeysByPeriodAndTab, action.payload.jeAccruedScheduleKey);
247
347
  },
248
348
  },
249
349
  removeFailedJeScheduleTransactionKey: {
@@ -256,12 +356,8 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
256
356
  };
257
357
  },
258
358
  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;
359
+ const { failedJeScheduleKey } = action.payload;
360
+ removeKeyFromEveryTabSlot(draft.failedJeScheduleTransactionKeysByPeriodAndTab, failedJeScheduleKey);
265
361
  },
266
362
  },
267
363
  initializeJeScheduleLocalData: {
@@ -340,6 +436,9 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
340
436
  error: status,
341
437
  fetchState: 'Error',
342
438
  };
439
+ // Set on failure too: a tenant whose account list errors must still reach the page rather
440
+ // than sit under a skeleton forever.
441
+ draft.accountSettings.hasLoadedAccountSettings = true;
343
442
  },
344
443
  updateAccountSettingsListForAccountTypes(draft, action) {
345
444
  doUpdateAccountSettingsListForAccountTypes(draft.accountSettings, action.payload.accountPayload);
@@ -373,6 +472,187 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
373
472
  clearJeAccountSettingsLocalData(draft) {
374
473
  draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
375
474
  },
475
+ initializeNewSchedule: {
476
+ prepare({ scheduleType, shouldResetEnteredData = true, }) {
477
+ return { payload: { scheduleType, shouldResetEnteredData } };
478
+ },
479
+ reducer() {
480
+ // Purely an epic-trigger action — the epic fans out the account/class
481
+ // list fetches, and clears entered data only when asked to.
482
+ },
483
+ },
484
+ resetNewScheduleLocalData: {
485
+ prepare({ scheduleType, }) {
486
+ return { payload: { scheduleType } };
487
+ },
488
+ reducer(draft, action) {
489
+ const { scheduleType } = action.payload;
490
+ draft.newSchedule.newScheduleState[scheduleType] =
491
+ (0, exports.getBaseNewScheduleLocalData)(scheduleType);
492
+ },
493
+ },
494
+ updateNewScheduleLocalData(draft, action) {
495
+ const { scheduleType, localData } = action.payload;
496
+ draft.newSchedule.newScheduleState[scheduleType] = {
497
+ ...draft.newSchedule.newScheduleState[scheduleType],
498
+ ...localData,
499
+ };
500
+ },
501
+ searchTransactionsForNewSchedule: {
502
+ prepare({ query, scheduleType, }) {
503
+ return { payload: { query, scheduleType } };
504
+ },
505
+ reducer(draft, action) {
506
+ const trimmed = action.payload.query.trim();
507
+ // Cleared or too-short query: no API (see epic) — reset immediately.
508
+ if (trimmed.length < jeSchedulesViewState_1.MIN_NEW_SCHEDULE_SEARCH_LENGTH) {
509
+ draft.newSchedule.searchTransactions = exports.searchTransactionsInitialState;
510
+ return;
511
+ }
512
+ draft.newSchedule.searchTransactions = {
513
+ ...draft.newSchedule.searchTransactions,
514
+ searchString: action.payload.query,
515
+ fetchState: 'In-Progress',
516
+ };
517
+ },
518
+ },
519
+ searchTransactionsForNewScheduleSuccess(draft, action) {
520
+ draft.newSchedule.searchTransactions = {
521
+ ...draft.newSchedule.searchTransactions,
522
+ searchResults: action.payload.searchResults,
523
+ fetchState: 'Completed',
524
+ error: undefined,
525
+ };
526
+ },
527
+ searchTransactionsForNewScheduleFailure(draft, action) {
528
+ draft.newSchedule.searchTransactions = {
529
+ ...draft.newSchedule.searchTransactions,
530
+ fetchState: 'Error',
531
+ error: action.payload.status,
532
+ };
533
+ },
534
+ clearSearchTransactionsForNewSchedule(draft) {
535
+ draft.newSchedule.searchTransactions = exports.searchTransactionsInitialState;
536
+ },
537
+ saveNewSchedule: {
538
+ prepare({ scheduleType, }) {
539
+ return { payload: { scheduleType } };
540
+ },
541
+ reducer(draft) {
542
+ draft.newSchedule.saveStatus = {
543
+ fetchState: 'In-Progress',
544
+ error: undefined,
545
+ };
546
+ },
547
+ },
548
+ saveNewScheduleSuccess(draft) {
549
+ draft.newSchedule.saveStatus = {
550
+ fetchState: 'Completed',
551
+ error: undefined,
552
+ };
553
+ },
554
+ saveNewScheduleFailure(draft, action) {
555
+ draft.newSchedule.saveStatus = {
556
+ fetchState: 'Error',
557
+ error: action.payload.status,
558
+ };
559
+ },
560
+ createOneTimeAccrual: {
561
+ prepare(localData) {
562
+ return { payload: { localData } };
563
+ },
564
+ reducer(draft) {
565
+ draft.newSchedule.createOneTimeAccrualStatus = {
566
+ fetchState: 'In-Progress',
567
+ error: undefined,
568
+ };
569
+ },
570
+ },
571
+ createOneTimeAccrualSuccess(draft) {
572
+ draft.newSchedule.createOneTimeAccrualStatus = {
573
+ fetchState: 'Completed',
574
+ error: undefined,
575
+ };
576
+ },
577
+ createOneTimeAccrualFailure(draft, action) {
578
+ draft.newSchedule.createOneTimeAccrualStatus = {
579
+ fetchState: 'Error',
580
+ error: action.payload.status,
581
+ };
582
+ },
583
+ /**
584
+ * Promote applies the body and posts in one step, so it carries whatever the user edited on the
585
+ * detail page. `edits` is absent when nothing was changed -- the epic then falls back to the
586
+ * stored accrual, which is what the list's inline Post does.
587
+ */
588
+ promoteOneTimeAccrual: {
589
+ prepare(accrualId, amount, edits) {
590
+ return { payload: { accrualId, amount, edits } };
591
+ },
592
+ reducer(draft, action) {
593
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
594
+ fetchState: 'In-Progress',
595
+ error: undefined,
596
+ };
597
+ },
598
+ },
599
+ revertOneTimeAccrual: {
600
+ prepare(accrualId, reason, note) {
601
+ return { payload: { accrualId, reason, note } };
602
+ },
603
+ reducer(draft, action) {
604
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
605
+ fetchState: 'In-Progress',
606
+ error: undefined,
607
+ };
608
+ },
609
+ },
610
+ ignoreOneTimeAccrual: {
611
+ prepare(accrualId, reason, note) {
612
+ return { payload: { accrualId, reason, note } };
613
+ },
614
+ reducer(draft, action) {
615
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
616
+ fetchState: 'In-Progress',
617
+ error: undefined,
618
+ };
619
+ },
620
+ },
621
+ fetchOneTimeAccrual: {
622
+ prepare(accrualId) {
623
+ return { payload: { accrualId } };
624
+ },
625
+ reducer(draft, action) {
626
+ draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
627
+ fetchState: 'In-Progress',
628
+ error: undefined,
629
+ };
630
+ },
631
+ },
632
+ fetchOneTimeAccrualSuccess(draft, action) {
633
+ draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
634
+ fetchState: 'Completed',
635
+ error: undefined,
636
+ };
637
+ },
638
+ fetchOneTimeAccrualFailure(draft, action) {
639
+ draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
640
+ fetchState: 'Error',
641
+ error: action.payload.status,
642
+ };
643
+ },
644
+ oneTimeAccrualActionSuccess(draft, action) {
645
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
646
+ fetchState: 'Completed',
647
+ error: undefined,
648
+ };
649
+ },
650
+ oneTimeAccrualActionFailure(draft, action) {
651
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
652
+ fetchState: 'Error',
653
+ error: action.payload.status,
654
+ };
655
+ },
376
656
  updateJESchedulesUIState(draft, action) {
377
657
  if (action.payload.sortKey != null) {
378
658
  draft.uiState.sortKey = action.payload.sortKey;
@@ -386,10 +666,21 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
386
666
  if (action.payload.scrollPosition != null) {
387
667
  draft.uiState.scrollPosition = action.payload.scrollPosition;
388
668
  }
389
- if (action.payload.selectedMainTab != null) {
390
- draft.uiState.selectedMainTab = action.payload.selectedMainTab;
669
+ if (action.payload.selectedPageTab != null) {
670
+ draft.uiState.selectedPageTab = action.payload.selectedPageTab;
391
671
  }
392
672
  },
673
+ updateJEScheduleTypeFilter(draft, action) {
674
+ draft.uiState.selectedJETypeFilter = action.payload;
675
+ },
676
+ toggleJEPendingGroupCollapsed(draft) {
677
+ draft.uiState.pendingGroupCollapsed =
678
+ !draft.uiState.pendingGroupCollapsed;
679
+ },
680
+ toggleJECreatedGroupCollapsed(draft) {
681
+ draft.uiState.createdGroupCollapsed =
682
+ !draft.uiState.createdGroupCollapsed;
683
+ },
393
684
  clearExpenseAutomationJESchedulesView(draft) {
394
685
  Object.assign(draft, exports.initialState);
395
686
  },
@@ -400,7 +691,7 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
400
691
  });
401
692
  },
402
693
  });
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;
694
+ _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
695
  exports.default = expenseAutomationJESchedulesView.reducer;
405
696
  const doUpdateRecommendationForAccountSettings = (draft, payload) => {
406
697
  const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
@@ -468,4 +759,5 @@ const doUpdateAccountSettingsListForAccountTypes = (draft, accountPayloadList) =
468
759
  error: undefined,
469
760
  fetchState: 'Completed',
470
761
  };
762
+ draft.hasLoadedAccountSettings = true;
471
763
  };
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });