@zeniai/client-epic-state 5.1.91 → 5.1.92-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/aiCfo/aiCfoState.d.ts +2 -2
  2. package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +2 -0
  3. package/lib/entity/jeSchedules/jeScheduleHelper.js +7 -0
  4. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +66 -1
  5. package/lib/entity/jeSchedules/jeSchedulesPayload.js +135 -0
  6. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +4 -2
  7. package/lib/entity/jeSchedules/jeSchedulesReducer.js +24 -2
  8. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +11 -2
  9. package/lib/entity/jeSchedules/jeSchedulesSelector.js +34 -3
  10. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +79 -1
  11. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +24 -1
  12. package/lib/entity/jeSchedules/jeSchedulesTypes.js +88 -1
  13. package/lib/entity/snackbar/snackbarApiError.d.ts +8 -0
  14. package/lib/entity/snackbar/snackbarApiError.js +15 -0
  15. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  16. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  17. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +2 -0
  18. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  19. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +2 -0
  20. package/lib/epic.d.ts +8 -1
  21. package/lib/epic.js +8 -1
  22. package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +6 -0
  23. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +135 -1
  24. package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +24 -2
  25. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +32 -2
  26. package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +78 -0
  27. package/lib/esm/entity/snackbar/snackbarApiError.js +11 -0
  28. package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
  29. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  30. package/lib/esm/epic.js +8 -1
  31. package/lib/esm/index.js +13 -7
  32. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
  33. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +41 -5
  34. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
  35. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +81 -0
  36. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +21 -0
  37. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +110 -0
  38. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +73 -0
  39. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +129 -0
  40. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +92 -0
  41. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +22 -0
  42. package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +140 -0
  43. package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +55 -0
  44. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +268 -29
  45. package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +1 -0
  46. package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +106 -0
  47. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +286 -22
  48. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +5 -6
  49. package/lib/esm/view/invoicing/createCreditNote/createCreditNoteEpic.js +2 -0
  50. package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +2 -0
  51. package/lib/esm/view/invoicing/discountAction/discountActionEpic.js +6 -3
  52. package/lib/esm/view/invoicing/dunningAction/dunningActionEpic.js +6 -3
  53. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +5 -4
  54. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +3 -0
  55. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +2 -0
  56. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +2 -0
  57. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +2 -0
  58. package/lib/esm/view/invoicing/invoiceAction/invoiceActionEpic.js +7 -3
  59. package/lib/esm/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +2 -0
  60. package/lib/esm/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +2 -0
  61. package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +2 -0
  62. package/lib/esm/view/invoicing/recordPayment/recordPaymentEpic.js +3 -0
  63. package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +6 -3
  64. package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +52 -0
  65. package/lib/esm/view/invoicing/subscriptionAction/subscriptionActionEpic.js +6 -3
  66. package/lib/esm/view/vendorTabView/vendorTabViewReducer.js +1 -1
  67. package/lib/index.d.ts +18 -14
  68. package/lib/index.js +92 -49
  69. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
  70. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +3 -2
  71. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +38 -2
  72. package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
  73. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +8 -0
  74. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +85 -0
  75. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +8 -0
  76. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +25 -0
  77. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +45 -0
  78. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +114 -0
  79. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +8 -0
  80. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +77 -0
  81. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +12 -0
  82. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +136 -0
  83. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +65 -0
  84. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +96 -0
  85. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +6 -0
  86. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +26 -0
  87. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +36 -0
  88. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +145 -0
  89. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  90. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +72 -3
  91. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +58 -1
  92. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +79 -11
  93. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +270 -29
  94. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
  95. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
  96. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +42 -0
  97. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +2 -0
  98. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +34 -8
  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 +31 -1
  102. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +294 -21
  103. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
  104. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +81 -8
  105. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -8
  106. package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.js +2 -0
  107. package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +2 -0
  108. package/lib/view/invoicing/discountAction/discountActionEpic.js +5 -2
  109. package/lib/view/invoicing/dunningAction/dunningActionEpic.js +5 -2
  110. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +5 -4
  111. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +3 -0
  112. package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +2 -0
  113. package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +2 -0
  114. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +2 -0
  115. package/lib/view/invoicing/invoiceAction/invoiceActionEpic.js +6 -2
  116. package/lib/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +2 -0
  117. package/lib/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +2 -0
  118. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewReducer.d.ts +1 -1
  119. package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +1 -1
  120. package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +2 -0
  121. package/lib/view/invoicing/recordPayment/recordPaymentEpic.js +3 -0
  122. package/lib/view/invoicing/settingsView/settingsViewEpics.js +5 -2
  123. package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +41 -1
  124. package/lib/view/invoicing/settingsView/settingsViewSelector.js +55 -1
  125. package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.js +5 -2
  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.toggleJECreatedGroupCollapsed = exports.searchTransactionsForNewScheduleSuccess = exports.searchTransactionsForNewScheduleFailure = exports.searchTransactionsForNewSchedule = 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.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeNewSchedule = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = 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 = 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: [],
@@ -40,16 +48,37 @@ exports.accountSettingsInitialState = {
40
48
  accruedExpensesNestedAccountListHierarchy: [],
41
49
  accruedExpensesRecommendations: [],
42
50
  };
51
+ const getBaseNewScheduleLocalData = (scheduleType) => ({
52
+ scheduleType,
53
+ jeScheduleDetails: [],
54
+ });
55
+ exports.getBaseNewScheduleLocalData = getBaseNewScheduleLocalData;
56
+ exports.newScheduleInitialState = {
57
+ fixed_assets: (0, exports.getBaseNewScheduleLocalData)('fixed_assets'),
58
+ prepaid_expenses: (0, exports.getBaseNewScheduleLocalData)('prepaid_expenses'),
59
+ };
60
+ exports.searchTransactionsInitialState = {
61
+ searchResults: [],
62
+ fetchState: 'Not-Started',
63
+ error: undefined,
64
+ };
43
65
  exports.initialState = {
44
- jeScheduleTransactionKeysByPeriod: {},
45
- failedJeScheduleTransactionKeysByPeriod: {},
66
+ jeScheduleTransactionKeysByPeriodAndTab: {},
67
+ jeScheduleAccruedKeysByPeriodAndTab: {},
68
+ jeScheduleOneTimeAccrualKeysByPeriodAndTab: {},
69
+ failedJeScheduleTransactionKeysByPeriodAndTab: {},
46
70
  postStatusById: {},
47
71
  ignoreStatusById: {},
72
+ revertStatusById: {},
48
73
  jeScheduleLocalDataById: {},
74
+ oneTimeAccrualActionStatusById: {},
49
75
  uiState: {
50
- searchString: '',
76
+ createdGroupCollapsed: false,
77
+ pendingGroupCollapsed: false,
51
78
  scrollPosition: { scrollTop: 0, scrollLeft: undefined },
52
- selectedMainTab: 'pending_review',
79
+ searchString: '',
80
+ selectedJETypeFilter: null,
81
+ selectedPageTab: 'schedules',
53
82
  sortKey: 'transactionDate',
54
83
  sortOrder: 'descending',
55
84
  totalCount: 0,
@@ -60,6 +89,14 @@ exports.initialState = {
60
89
  error: undefined,
61
90
  },
62
91
  accountSettings: exports.accountSettingsInitialState,
92
+ newSchedule: {
93
+ createOneTimeAccrualStatus: { fetchState: 'Not-Started', error: undefined },
94
+ newScheduleState: exports.newScheduleInitialState,
95
+ saveStatus: { fetchState: 'Not-Started', error: undefined },
96
+ searchTransactions: exports.searchTransactionsInitialState,
97
+ fetchState: 'Not-Started',
98
+ error: undefined,
99
+ },
63
100
  fetchState: 'Not-Started',
64
101
  error: undefined,
65
102
  hasValidState() {
@@ -104,9 +141,12 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
104
141
  },
105
142
  },
106
143
  fetchJeSchedulesSuccess(draft, action) {
107
- const { jeSchedules, selectedPeriod, failedJeSchedules, refreshViewInBackground, } = action.payload;
144
+ const { jeSchedules, selectedPeriod, selectedPageTab, failedJeSchedules, accruedJeSchedules, oneTimeAccruals, refreshViewInBackground, } = action.payload;
145
+ const periodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
108
146
  const jeScheduleTransactionKeys = jeSchedules.map((schedules) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedules.base_transaction));
109
147
  const failedJeScheduleTransactionKeys = failedJeSchedules.map((schedules) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedules.base_transaction));
148
+ const jeScheduleAccruedKeys = accruedJeSchedules.map((schedule) => (0, jeSchedulesPayload_1.getJEScheduleKey)(schedule));
149
+ const jeScheduleOneTimeAccrualKeys = oneTimeAccruals.map((accrual) => (0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrual._id));
110
150
  if (refreshViewInBackground === true &&
111
151
  draft.refreshStatus.fetchState === 'In-Progress') {
112
152
  draft.refreshStatus = { fetchState: 'Completed', error: undefined };
@@ -115,19 +155,28 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
115
155
  draft.fetchState = 'Completed';
116
156
  draft.error = undefined;
117
157
  }
118
- draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = jeScheduleTransactionKeys;
119
- draft.failedJeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = failedJeScheduleTransactionKeys;
158
+ draft.jeScheduleTransactionKeysByPeriodAndTab[periodTabKey] =
159
+ jeScheduleTransactionKeys;
160
+ draft.jeScheduleAccruedKeysByPeriodAndTab[periodTabKey] =
161
+ jeScheduleAccruedKeys;
162
+ draft.jeScheduleOneTimeAccrualKeysByPeriodAndTab[periodTabKey] =
163
+ jeScheduleOneTimeAccrualKeys;
164
+ draft.failedJeScheduleTransactionKeysByPeriodAndTab[periodTabKey] =
165
+ failedJeScheduleTransactionKeys;
120
166
  },
121
167
  fetchJeSchedulesFailure(draft, action) {
122
- const { status, selectedPeriod } = action.payload;
168
+ const { status, selectedPeriod, selectedPageTab } = action.payload;
169
+ const periodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
123
170
  if (draft.refreshStatus.fetchState === 'In-Progress') {
124
171
  draft.refreshStatus = { fetchState: 'Error', error: status };
125
172
  }
126
173
  else {
127
174
  draft.fetchState = 'Error';
128
175
  draft.error = status;
176
+ draft.jeScheduleTransactionKeysByPeriodAndTab[periodTabKey] = [];
177
+ draft.jeScheduleAccruedKeysByPeriodAndTab[periodTabKey] = [];
178
+ draft.jeScheduleOneTimeAccrualKeysByPeriodAndTab[periodTabKey] = [];
129
179
  }
130
- draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = [];
131
180
  },
132
181
  retryJeSchedule(draft, action) {
133
182
  const { scheduledJournalEntryID } = action.payload;
@@ -163,11 +212,13 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
163
212
  };
164
213
  },
165
214
  ignoreRecommendedJeSchedule: {
166
- prepare(jeScheduleTransactionKey, scheduleType) {
215
+ prepare(jeScheduleTransactionKey, scheduleType, reason, note) {
167
216
  return {
168
217
  payload: {
169
218
  jeScheduleTransactionKey,
170
219
  scheduleType,
220
+ reason,
221
+ note,
171
222
  },
172
223
  };
173
224
  },
@@ -183,6 +234,37 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
183
234
  };
184
235
  },
185
236
  },
237
+ revertJeSchedule: {
238
+ prepare(jeScheduleId, jeScheduleTransactionKey, scheduleType, reason, note) {
239
+ return {
240
+ payload: {
241
+ jeScheduleId,
242
+ jeScheduleTransactionKey,
243
+ scheduleType,
244
+ reason,
245
+ note,
246
+ },
247
+ };
248
+ },
249
+ reducer(draft, action) {
250
+ draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
251
+ fetchState: 'In-Progress',
252
+ error: undefined,
253
+ };
254
+ },
255
+ },
256
+ revertJeScheduleSuccess(draft, action) {
257
+ draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
258
+ fetchState: 'Completed',
259
+ error: undefined,
260
+ };
261
+ },
262
+ revertJeScheduleFailure(draft, action) {
263
+ draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
264
+ fetchState: 'Error',
265
+ error: action.payload.status,
266
+ };
267
+ },
186
268
  ignoreRecommendedJeScheduleSuccess: {
187
269
  reducer(draft, action) {
188
270
  const { jeScheduleTransactionKey } = action.payload;
@@ -215,17 +297,18 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
215
297
  };
216
298
  },
217
299
  updateJeScheduleTransactionKeys: {
218
- prepare(jeScheduleKeys, selectedPeriod) {
300
+ prepare(jeScheduleKeys, selectedPeriod, selectedPageTab) {
219
301
  return {
220
302
  payload: {
221
303
  jeScheduleKeys: jeScheduleKeys,
222
304
  selectedPeriod: selectedPeriod,
305
+ selectedPageTab: selectedPageTab,
223
306
  },
224
307
  };
225
308
  },
226
309
  reducer(draft, action) {
227
- const { selectedPeriod, jeScheduleKeys } = action.payload;
228
- draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = jeScheduleKeys;
310
+ const { selectedPeriod, selectedPageTab, jeScheduleKeys } = action.payload;
311
+ draft.jeScheduleTransactionKeysByPeriodAndTab[(0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod))] = jeScheduleKeys;
229
312
  },
230
313
  },
231
314
  removeJeScheduleTransactionKey: {
@@ -238,12 +321,10 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
238
321
  };
239
322
  },
240
323
  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;
324
+ const { jeScheduleKey } = action.payload;
325
+ // Dropped from every tab's slot, not just the visible one: once a schedule is ignored or
326
+ // resolved it must not reappear when the user switches tabs and hits a cached list.
327
+ removeKeyFromEveryTabSlot(draft.jeScheduleTransactionKeysByPeriodAndTab, jeScheduleKey);
247
328
  },
248
329
  },
249
330
  removeFailedJeScheduleTransactionKey: {
@@ -256,12 +337,8 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
256
337
  };
257
338
  },
258
339
  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;
340
+ const { failedJeScheduleKey } = action.payload;
341
+ removeKeyFromEveryTabSlot(draft.failedJeScheduleTransactionKeysByPeriodAndTab, failedJeScheduleKey);
265
342
  },
266
343
  },
267
344
  initializeJeScheduleLocalData: {
@@ -373,6 +450,159 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
373
450
  clearJeAccountSettingsLocalData(draft) {
374
451
  draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
375
452
  },
453
+ initializeNewSchedule: {
454
+ prepare({ scheduleType, }) {
455
+ return { payload: { scheduleType } };
456
+ },
457
+ reducer() {
458
+ // Purely an epic-trigger action — the epic fans out the account/class
459
+ // list fetches plus resetNewScheduleLocalData.
460
+ },
461
+ },
462
+ resetNewScheduleLocalData: {
463
+ prepare({ scheduleType, }) {
464
+ return { payload: { scheduleType } };
465
+ },
466
+ reducer(draft, action) {
467
+ const { scheduleType } = action.payload;
468
+ draft.newSchedule.newScheduleState[scheduleType] =
469
+ (0, exports.getBaseNewScheduleLocalData)(scheduleType);
470
+ },
471
+ },
472
+ updateNewScheduleLocalData(draft, action) {
473
+ const { scheduleType, localData } = action.payload;
474
+ draft.newSchedule.newScheduleState[scheduleType] = {
475
+ ...draft.newSchedule.newScheduleState[scheduleType],
476
+ ...localData,
477
+ };
478
+ },
479
+ searchTransactionsForNewSchedule: {
480
+ prepare({ query, scheduleType, }) {
481
+ return { payload: { query, scheduleType } };
482
+ },
483
+ reducer(draft, action) {
484
+ const trimmed = action.payload.query.trim();
485
+ // Cleared or too-short query: no API (see epic) — reset immediately.
486
+ if (trimmed.length < jeSchedulesViewState_1.MIN_NEW_SCHEDULE_SEARCH_LENGTH) {
487
+ draft.newSchedule.searchTransactions = exports.searchTransactionsInitialState;
488
+ return;
489
+ }
490
+ draft.newSchedule.searchTransactions = {
491
+ ...draft.newSchedule.searchTransactions,
492
+ searchString: action.payload.query,
493
+ fetchState: 'In-Progress',
494
+ };
495
+ },
496
+ },
497
+ searchTransactionsForNewScheduleSuccess(draft, action) {
498
+ draft.newSchedule.searchTransactions = {
499
+ ...draft.newSchedule.searchTransactions,
500
+ searchResults: action.payload.searchResults,
501
+ fetchState: 'Completed',
502
+ error: undefined,
503
+ };
504
+ },
505
+ searchTransactionsForNewScheduleFailure(draft, action) {
506
+ draft.newSchedule.searchTransactions = {
507
+ ...draft.newSchedule.searchTransactions,
508
+ fetchState: 'Error',
509
+ error: action.payload.status,
510
+ };
511
+ },
512
+ clearSearchTransactionsForNewSchedule(draft) {
513
+ draft.newSchedule.searchTransactions = exports.searchTransactionsInitialState;
514
+ },
515
+ saveNewSchedule: {
516
+ prepare({ scheduleType, }) {
517
+ return { payload: { scheduleType } };
518
+ },
519
+ reducer(draft) {
520
+ draft.newSchedule.saveStatus = {
521
+ fetchState: 'In-Progress',
522
+ error: undefined,
523
+ };
524
+ },
525
+ },
526
+ saveNewScheduleSuccess(draft) {
527
+ draft.newSchedule.saveStatus = {
528
+ fetchState: 'Completed',
529
+ error: undefined,
530
+ };
531
+ },
532
+ saveNewScheduleFailure(draft, action) {
533
+ draft.newSchedule.saveStatus = {
534
+ fetchState: 'Error',
535
+ error: action.payload.status,
536
+ };
537
+ },
538
+ createOneTimeAccrual: {
539
+ prepare(localData) {
540
+ return { payload: { localData } };
541
+ },
542
+ reducer(draft) {
543
+ draft.newSchedule.createOneTimeAccrualStatus = {
544
+ fetchState: 'In-Progress',
545
+ error: undefined,
546
+ };
547
+ },
548
+ },
549
+ createOneTimeAccrualSuccess(draft) {
550
+ draft.newSchedule.createOneTimeAccrualStatus = {
551
+ fetchState: 'Completed',
552
+ error: undefined,
553
+ };
554
+ },
555
+ createOneTimeAccrualFailure(draft, action) {
556
+ draft.newSchedule.createOneTimeAccrualStatus = {
557
+ fetchState: 'Error',
558
+ error: action.payload.status,
559
+ };
560
+ },
561
+ promoteOneTimeAccrual: {
562
+ prepare(accrualId, amount) {
563
+ return { payload: { accrualId, amount } };
564
+ },
565
+ reducer(draft, action) {
566
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
567
+ fetchState: 'In-Progress',
568
+ error: undefined,
569
+ };
570
+ },
571
+ },
572
+ revertOneTimeAccrual: {
573
+ prepare(accrualId, reason, note) {
574
+ return { payload: { accrualId, reason, note } };
575
+ },
576
+ reducer(draft, action) {
577
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
578
+ fetchState: 'In-Progress',
579
+ error: undefined,
580
+ };
581
+ },
582
+ },
583
+ ignoreOneTimeAccrual: {
584
+ prepare(accrualId, reason, note) {
585
+ return { payload: { accrualId, reason, note } };
586
+ },
587
+ reducer(draft, action) {
588
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
589
+ fetchState: 'In-Progress',
590
+ error: undefined,
591
+ };
592
+ },
593
+ },
594
+ oneTimeAccrualActionSuccess(draft, action) {
595
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
596
+ fetchState: 'Completed',
597
+ error: undefined,
598
+ };
599
+ },
600
+ oneTimeAccrualActionFailure(draft, action) {
601
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
602
+ fetchState: 'Error',
603
+ error: action.payload.status,
604
+ };
605
+ },
376
606
  updateJESchedulesUIState(draft, action) {
377
607
  if (action.payload.sortKey != null) {
378
608
  draft.uiState.sortKey = action.payload.sortKey;
@@ -386,10 +616,21 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
386
616
  if (action.payload.scrollPosition != null) {
387
617
  draft.uiState.scrollPosition = action.payload.scrollPosition;
388
618
  }
389
- if (action.payload.selectedMainTab != null) {
390
- draft.uiState.selectedMainTab = action.payload.selectedMainTab;
619
+ if (action.payload.selectedPageTab != null) {
620
+ draft.uiState.selectedPageTab = action.payload.selectedPageTab;
391
621
  }
392
622
  },
623
+ updateJEScheduleTypeFilter(draft, action) {
624
+ draft.uiState.selectedJETypeFilter = action.payload;
625
+ },
626
+ toggleJEPendingGroupCollapsed(draft) {
627
+ draft.uiState.pendingGroupCollapsed =
628
+ !draft.uiState.pendingGroupCollapsed;
629
+ },
630
+ toggleJECreatedGroupCollapsed(draft) {
631
+ draft.uiState.createdGroupCollapsed =
632
+ !draft.uiState.createdGroupCollapsed;
633
+ },
393
634
  clearExpenseAutomationJESchedulesView(draft) {
394
635
  Object.assign(draft, exports.initialState);
395
636
  },
@@ -400,7 +641,7 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
400
641
  });
401
642
  },
402
643
  });
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;
644
+ _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.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.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
645
  exports.default = expenseAutomationJESchedulesView.reducer;
405
646
  const doUpdateRecommendationForAccountSettings = (draft, payload) => {
406
647
  const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
@@ -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" | "manual" | "ai_accountant", "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], {
@@ -65,8 +65,8 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
65
65
  cotTrackingByTransactionId: COTTransactionTrackingByTransactionId;
66
66
  }, "expenseAutomationTransactionsView/updateTransactionCategorization", never, never>, updateCurrentSelectedTransactionCategorizationTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSelectedTab: "review" | "autoCategorized"], {
67
67
  newSelectedTab: "review" | "autoCategorized";
68
- }, "expenseAutomationTransactionsView/updateCurrentSelectedTransactionCategorizationTab", never, never>, updateTransactionCategorizationCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSubTab: "all" | "manual" | "ai_accountant"], {
69
- newSubTab: "all" | "manual" | "ai_accountant";
68
+ }, "expenseAutomationTransactionsView/updateCurrentSelectedTransactionCategorizationTab", never, never>, updateTransactionCategorizationCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSubTab: "manual" | "all" | "ai_accountant"], {
69
+ newSubTab: "manual" | "all" | "ai_accountant";
70
70
  }, "expenseAutomationTransactionsView/updateTransactionCategorizationCompletedSubTab", never, never>, updateTransactionCategorizationSaveStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
71
71
  selectedTab: "review" | "autoCategorized";
72
72
  fetchState: FetchState;
@@ -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 });
@@ -4,12 +4,30 @@ 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 { JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
9
8
  import { UncategorizedAccounts } from '../../accountList/accountListSelector';
10
9
  import { JEAccountSettingsView } from '../selectorTypes/jeAccountSettingsViewSelectorTypes';
11
- import { JEScheduledTransactionWithFailedEntries } from '../selectors/jeSchedulesViewSelector';
12
- import { JEScheduleLocalData, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
10
+ import { NewScheduleView } from '../selectorTypes/jeNewScheduleViewSelectorTypes';
11
+ import { JEScheduleRow, JEScheduledTransactionWithFailedEntries } from '../selectors/jeSchedulesViewSelector';
12
+ import { JEPageTab, JEScheduleLocalData, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
13
+ export interface JEKpiSummary {
14
+ aiAccountant: {
15
+ amount: number;
16
+ count: number;
17
+ };
18
+ manual: {
19
+ amount: number;
20
+ count: number;
21
+ };
22
+ needsReview: {
23
+ amount: number;
24
+ count: number;
25
+ };
26
+ total: {
27
+ amount: number;
28
+ count: number;
29
+ };
30
+ }
13
31
  export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
14
32
  accountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
15
33
  accountSettingsView: JEAccountSettingsView;
@@ -18,16 +36,24 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
18
36
  allDepreciationAccountList: AccountBase[];
19
37
  allDepreciationAccountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
20
38
  classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
21
- completedSchedules: JEScheduledTransaction[];
22
39
  completionStatus: CompletionStatusType;
23
- draftSchedules: JEScheduledTransaction[];
40
+ createdSchedules: JEScheduleRow[];
41
+ createdTotal: number;
42
+ hasLoadedForSelectedTab: boolean;
24
43
  ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
25
44
  jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
26
- ongoingSchedules: JEScheduledTransaction[];
27
- pendingReviewSchedules: (JEScheduledTransaction | JEScheduledTransactionWithFailedEntries)[];
45
+ jeScheduleTypeCounts: {
46
+ active: Record<ScheduleTypes, number>;
47
+ ongoing: Record<ScheduleTypes, number>;
48
+ };
49
+ kpiSummary: JEKpiSummary;
50
+ newScheduleView: NewScheduleView | undefined;
51
+ pendingReviewSchedules: JEScheduleRow[];
52
+ pendingReviewTotal: number;
28
53
  postStatusById: Record<ID, FetchStateAndError>;
29
54
  refreshStatus: FetchStateAndError;
30
55
  resolveSchedules: JEScheduledTransactionWithFailedEntries[];
56
+ scheduleCountsByTab: Partial<Record<JEPageTab, number>>;
31
57
  uiState: JESchedulesViewUIState;
32
58
  uncategorizedAccounts: UncategorizedAccounts;
33
59
  }
@@ -0,0 +1,21 @@
1
+ import { RootState } from '../../../reducer';
2
+ import { NewAccrualAccountsView, NewScheduleSearchTransactionsView, NewScheduleView } from '../selectorTypes/jeNewScheduleViewSelectorTypes';
3
+ /**
4
+ * The Base Transaction search is shared across schedule types (one search
5
+ * box, not one per prepaid_expenses/fixed_assets) — split out from
6
+ * getNewScheduleView so a consumer can read it without supplying an
7
+ * otherwise-irrelevant scheduleType.
8
+ */
9
+ export declare const getNewScheduleSearchTransactionsView: (state: RootState) => NewScheduleSearchTransactionsView;
10
+ /**
11
+ * Account + class options and request status shared by both accrual creation forms — the one-time
12
+ * accrual and the recurring accrued schedule.
13
+ *
14
+ * getAccountsTypesForScheduleDetails('accrued_expenses') deliberately includes
15
+ * other_current_liabilities, because the accrued liability accounts live there —
16
+ * so the debit list has to subtract them back out, and the credit list keeps only
17
+ * them. Mirrors getScheduleAccruedDetailView, which is the form this one is
18
+ * modelled on.
19
+ */
20
+ export declare const getNewAccrualAccountsView: (state: RootState) => NewAccrualAccountsView;
21
+ export declare const getNewScheduleView: (state: RootState, scheduleType: "fixed_assets" | "prepaid_expenses") => NewScheduleView;