@zeniai/client-epic-state 5.1.86 → 5.1.88-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 (180) hide show
  1. package/lib/entity/aiCfo/aiCfoPayload.d.ts +7 -0
  2. package/lib/entity/aiCfo/aiCfoReducer.d.ts +3 -2
  3. package/lib/entity/aiCfo/aiCfoReducer.js +25 -2
  4. package/lib/entity/aiCfo/aiCfoState.d.ts +9 -2
  5. package/lib/entity/customerSatisfaction/customerSatisfactionReducer.d.ts +1 -1
  6. package/lib/entity/customerSatisfaction/customerSatisfactionReducer.js +6 -2
  7. package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +2 -0
  8. package/lib/entity/jeSchedules/jeScheduleHelper.js +7 -0
  9. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +34 -1
  10. package/lib/entity/jeSchedules/jeSchedulesPayload.js +68 -0
  11. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +4 -2
  12. package/lib/entity/jeSchedules/jeSchedulesReducer.js +24 -2
  13. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +10 -2
  14. package/lib/entity/jeSchedules/jeSchedulesSelector.js +28 -3
  15. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +41 -1
  16. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +12 -1
  17. package/lib/entity/jeSchedules/jeSchedulesTypes.js +40 -1
  18. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  19. package/lib/entity/snackbar/snackbarTypes.js +29 -0
  20. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +2 -0
  21. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  22. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +2 -0
  23. package/lib/epic.d.ts +6 -1
  24. package/lib/epic.js +8 -1
  25. package/lib/esm/entity/aiCfo/aiCfoReducer.js +23 -1
  26. package/lib/esm/entity/customerSatisfaction/customerSatisfactionReducer.js +4 -1
  27. package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +6 -0
  28. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +68 -1
  29. package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +24 -2
  30. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +26 -2
  31. package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +34 -0
  32. package/lib/esm/entity/snackbar/snackbarTypes.js +29 -0
  33. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  34. package/lib/esm/epic.js +8 -1
  35. package/lib/esm/index.js +14 -8
  36. package/lib/esm/view/companyHealthMetricView/companyHealthMetricConfigReducer.js +4 -1
  37. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
  38. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +34 -3
  39. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +81 -0
  40. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +21 -0
  41. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +110 -0
  42. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +73 -0
  43. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +22 -0
  44. package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +140 -0
  45. package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +55 -0
  46. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +187 -28
  47. package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +1 -0
  48. package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +102 -0
  49. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +260 -22
  50. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +5 -6
  51. package/lib/esm/view/invoicing/createCreditNote/createCreditNoteEpic.js +24 -4
  52. package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +24 -4
  53. package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +37 -10
  54. package/lib/esm/view/invoicing/discountAction/discountActionEpic.js +33 -9
  55. package/lib/esm/view/invoicing/dunningAction/dunningActionEpic.js +35 -9
  56. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +5 -1
  57. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +32 -5
  58. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +23 -3
  59. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +24 -4
  60. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +24 -4
  61. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +20 -3
  62. package/lib/esm/view/invoicing/invoiceAction/invoiceActionEpic.js +60 -17
  63. package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +30 -0
  64. package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +4 -29
  65. package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewEpic.js +26 -0
  66. package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewPageEpic.js +16 -0
  67. package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewPayload.js +9 -1
  68. package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewReducer.js +50 -1
  69. package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector.js +14 -1
  70. package/lib/esm/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +29 -10
  71. package/lib/esm/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +28 -5
  72. package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +24 -4
  73. package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +22 -14
  74. package/lib/esm/view/invoicing/recordPayment/recordPaymentEpic.js +46 -7
  75. package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +26 -8
  76. package/lib/esm/view/invoicing/settingsView/settingsViewReducer.js +1 -1
  77. package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +4 -1
  78. package/lib/esm/view/invoicing/subscriptionAction/subscriptionActionEpic.js +41 -9
  79. package/lib/esm/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +4 -1
  80. package/lib/esm/view/vendorTabView/vendorTabViewReducer.js +4 -1
  81. package/lib/index.d.ts +23 -17
  82. package/lib/index.js +84 -50
  83. package/lib/view/companyHealthMetricView/companyHealthMetricConfigReducer.d.ts +1 -1
  84. package/lib/view/companyHealthMetricView/companyHealthMetricConfigReducer.js +5 -2
  85. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
  86. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +2 -2
  87. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +32 -1
  88. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +8 -0
  89. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +85 -0
  90. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +8 -0
  91. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +25 -0
  92. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +45 -0
  93. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +114 -0
  94. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +8 -0
  95. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +77 -0
  96. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +6 -0
  97. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +26 -0
  98. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +36 -0
  99. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +145 -0
  100. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  101. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +44 -2
  102. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +58 -1
  103. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +49 -10
  104. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +189 -28
  105. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
  106. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
  107. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +40 -0
  108. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +2 -0
  109. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +34 -8
  110. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +20 -0
  111. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +108 -0
  112. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +10 -1
  113. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +266 -21
  114. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
  115. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +79 -8
  116. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -8
  117. package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.d.ts +2 -1
  118. package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.js +23 -3
  119. package/lib/view/invoicing/createInvoice/createInvoiceEpic.d.ts +2 -1
  120. package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +23 -3
  121. package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +22 -8
  122. package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +37 -10
  123. package/lib/view/invoicing/discountAction/discountActionEpic.d.ts +2 -1
  124. package/lib/view/invoicing/discountAction/discountActionEpic.js +32 -8
  125. package/lib/view/invoicing/dunningAction/dunningActionEpic.d.ts +2 -1
  126. package/lib/view/invoicing/dunningAction/dunningActionEpic.js +34 -8
  127. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.d.ts +3 -1
  128. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +5 -1
  129. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +2 -1
  130. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +31 -4
  131. package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.d.ts +2 -1
  132. package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +22 -2
  133. package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.d.ts +2 -1
  134. package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +23 -3
  135. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +2 -1
  136. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +23 -3
  137. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.d.ts +2 -1
  138. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +19 -2
  139. package/lib/view/invoicing/invoiceAction/invoiceActionEpic.d.ts +2 -1
  140. package/lib/view/invoicing/invoiceAction/invoiceActionEpic.js +59 -16
  141. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +13 -0
  142. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
  143. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +30 -0
  144. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +11 -31
  145. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +4 -29
  146. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +15 -0
  147. package/lib/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewEpic.d.ts +7 -0
  148. package/lib/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewEpic.js +30 -0
  149. package/lib/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewPageEpic.d.ts +6 -0
  150. package/lib/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewPageEpic.js +20 -0
  151. package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewEpics.d.ts +2 -2
  152. package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewPayload.d.ts +12 -0
  153. package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewPayload.js +11 -0
  154. package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewReducer.d.ts +21 -4
  155. package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewReducer.js +51 -2
  156. package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector.d.ts +3 -0
  157. package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector.js +16 -2
  158. package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewState.d.ts +13 -0
  159. package/lib/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.d.ts +2 -1
  160. package/lib/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +28 -9
  161. package/lib/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +27 -4
  162. package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.d.ts +2 -1
  163. package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +23 -3
  164. package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.d.ts +24 -7
  165. package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +23 -16
  166. package/lib/view/invoicing/recordPayment/recordPaymentEpic.d.ts +2 -1
  167. package/lib/view/invoicing/recordPayment/recordPaymentEpic.js +45 -6
  168. package/lib/view/invoicing/settingsView/settingsViewEpics.d.ts +2 -1
  169. package/lib/view/invoicing/settingsView/settingsViewEpics.js +25 -7
  170. package/lib/view/invoicing/settingsView/settingsViewReducer.d.ts +10 -1
  171. package/lib/view/invoicing/settingsView/settingsViewReducer.js +1 -1
  172. package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +4 -2
  173. package/lib/view/invoicing/settingsView/settingsViewSelector.js +4 -1
  174. package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.d.ts +2 -1
  175. package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.js +40 -8
  176. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.d.ts +1 -1
  177. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +5 -2
  178. package/lib/view/vendorTabView/vendorTabViewReducer.d.ts +1 -1
  179. package/lib/view/vendorTabView/vendorTabViewReducer.js +5 -2
  180. 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.updateNewScheduleLocalData = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = 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.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 = 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,35 @@ 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: {},
48
72
  jeScheduleLocalDataById: {},
49
73
  uiState: {
50
- searchString: '',
74
+ createdGroupCollapsed: false,
75
+ pendingGroupCollapsed: false,
51
76
  scrollPosition: { scrollTop: 0, scrollLeft: undefined },
52
- selectedMainTab: 'pending_review',
77
+ searchString: '',
78
+ selectedJETypeFilter: null,
79
+ selectedPageTab: 'schedules',
53
80
  sortKey: 'transactionDate',
54
81
  sortOrder: 'descending',
55
82
  totalCount: 0,
@@ -60,6 +87,14 @@ exports.initialState = {
60
87
  error: undefined,
61
88
  },
62
89
  accountSettings: exports.accountSettingsInitialState,
90
+ newSchedule: {
91
+ createOneTimeAccrualStatus: { fetchState: 'Not-Started', error: undefined },
92
+ newScheduleState: exports.newScheduleInitialState,
93
+ saveStatus: { fetchState: 'Not-Started', error: undefined },
94
+ searchTransactions: exports.searchTransactionsInitialState,
95
+ fetchState: 'Not-Started',
96
+ error: undefined,
97
+ },
63
98
  fetchState: 'Not-Started',
64
99
  error: undefined,
65
100
  hasValidState() {
@@ -104,9 +139,12 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
104
139
  },
105
140
  },
106
141
  fetchJeSchedulesSuccess(draft, action) {
107
- const { jeSchedules, selectedPeriod, failedJeSchedules, refreshViewInBackground, } = action.payload;
142
+ const { jeSchedules, selectedPeriod, selectedPageTab, failedJeSchedules, accruedJeSchedules, oneTimeAccruals, refreshViewInBackground, } = action.payload;
143
+ const periodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
108
144
  const jeScheduleTransactionKeys = jeSchedules.map((schedules) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedules.base_transaction));
109
145
  const failedJeScheduleTransactionKeys = failedJeSchedules.map((schedules) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedules.base_transaction));
146
+ const jeScheduleAccruedKeys = accruedJeSchedules.map((schedule) => (0, jeSchedulesPayload_1.getJEScheduleKey)(schedule));
147
+ const jeScheduleOneTimeAccrualKeys = oneTimeAccruals.map((accrual) => (0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrual._id));
110
148
  if (refreshViewInBackground === true &&
111
149
  draft.refreshStatus.fetchState === 'In-Progress') {
112
150
  draft.refreshStatus = { fetchState: 'Completed', error: undefined };
@@ -115,19 +153,28 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
115
153
  draft.fetchState = 'Completed';
116
154
  draft.error = undefined;
117
155
  }
118
- draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = jeScheduleTransactionKeys;
119
- draft.failedJeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = failedJeScheduleTransactionKeys;
156
+ draft.jeScheduleTransactionKeysByPeriodAndTab[periodTabKey] =
157
+ jeScheduleTransactionKeys;
158
+ draft.jeScheduleAccruedKeysByPeriodAndTab[periodTabKey] =
159
+ jeScheduleAccruedKeys;
160
+ draft.jeScheduleOneTimeAccrualKeysByPeriodAndTab[periodTabKey] =
161
+ jeScheduleOneTimeAccrualKeys;
162
+ draft.failedJeScheduleTransactionKeysByPeriodAndTab[periodTabKey] =
163
+ failedJeScheduleTransactionKeys;
120
164
  },
121
165
  fetchJeSchedulesFailure(draft, action) {
122
- const { status, selectedPeriod } = action.payload;
166
+ const { status, selectedPeriod, selectedPageTab } = action.payload;
167
+ const periodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
123
168
  if (draft.refreshStatus.fetchState === 'In-Progress') {
124
169
  draft.refreshStatus = { fetchState: 'Error', error: status };
125
170
  }
126
171
  else {
127
172
  draft.fetchState = 'Error';
128
173
  draft.error = status;
174
+ draft.jeScheduleTransactionKeysByPeriodAndTab[periodTabKey] = [];
175
+ draft.jeScheduleAccruedKeysByPeriodAndTab[periodTabKey] = [];
176
+ draft.jeScheduleOneTimeAccrualKeysByPeriodAndTab[periodTabKey] = [];
129
177
  }
130
- draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = [];
131
178
  },
132
179
  retryJeSchedule(draft, action) {
133
180
  const { scheduledJournalEntryID } = action.payload;
@@ -215,17 +262,18 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
215
262
  };
216
263
  },
217
264
  updateJeScheduleTransactionKeys: {
218
- prepare(jeScheduleKeys, selectedPeriod) {
265
+ prepare(jeScheduleKeys, selectedPeriod, selectedPageTab) {
219
266
  return {
220
267
  payload: {
221
268
  jeScheduleKeys: jeScheduleKeys,
222
269
  selectedPeriod: selectedPeriod,
270
+ selectedPageTab: selectedPageTab,
223
271
  },
224
272
  };
225
273
  },
226
274
  reducer(draft, action) {
227
- const { selectedPeriod, jeScheduleKeys } = action.payload;
228
- draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = jeScheduleKeys;
275
+ const { selectedPeriod, selectedPageTab, jeScheduleKeys } = action.payload;
276
+ draft.jeScheduleTransactionKeysByPeriodAndTab[(0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod))] = jeScheduleKeys;
229
277
  },
230
278
  },
231
279
  removeJeScheduleTransactionKey: {
@@ -238,12 +286,10 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
238
286
  };
239
287
  },
240
288
  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;
289
+ const { jeScheduleKey } = action.payload;
290
+ // Dropped from every tab's slot, not just the visible one: once a schedule is ignored or
291
+ // resolved it must not reappear when the user switches tabs and hits a cached list.
292
+ removeKeyFromEveryTabSlot(draft.jeScheduleTransactionKeysByPeriodAndTab, jeScheduleKey);
247
293
  },
248
294
  },
249
295
  removeFailedJeScheduleTransactionKey: {
@@ -256,12 +302,8 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
256
302
  };
257
303
  },
258
304
  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;
305
+ const { failedJeScheduleKey } = action.payload;
306
+ removeKeyFromEveryTabSlot(draft.failedJeScheduleTransactionKeysByPeriodAndTab, failedJeScheduleKey);
265
307
  },
266
308
  },
267
309
  initializeJeScheduleLocalData: {
@@ -373,6 +415,114 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
373
415
  clearJeAccountSettingsLocalData(draft) {
374
416
  draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
375
417
  },
418
+ initializeNewSchedule: {
419
+ prepare({ scheduleType, }) {
420
+ return { payload: { scheduleType } };
421
+ },
422
+ reducer() {
423
+ // Purely an epic-trigger action — the epic fans out the account/class
424
+ // list fetches plus resetNewScheduleLocalData.
425
+ },
426
+ },
427
+ resetNewScheduleLocalData: {
428
+ prepare({ scheduleType, }) {
429
+ return { payload: { scheduleType } };
430
+ },
431
+ reducer(draft, action) {
432
+ const { scheduleType } = action.payload;
433
+ draft.newSchedule.newScheduleState[scheduleType] =
434
+ (0, exports.getBaseNewScheduleLocalData)(scheduleType);
435
+ },
436
+ },
437
+ updateNewScheduleLocalData(draft, action) {
438
+ const { scheduleType, localData } = action.payload;
439
+ draft.newSchedule.newScheduleState[scheduleType] = {
440
+ ...draft.newSchedule.newScheduleState[scheduleType],
441
+ ...localData,
442
+ };
443
+ },
444
+ searchTransactionsForNewSchedule: {
445
+ prepare({ query, scheduleType, }) {
446
+ return { payload: { query, scheduleType } };
447
+ },
448
+ reducer(draft, action) {
449
+ const trimmed = action.payload.query.trim();
450
+ // Cleared or too-short query: no API (see epic) — reset immediately.
451
+ if (trimmed.length < jeSchedulesViewState_1.MIN_NEW_SCHEDULE_SEARCH_LENGTH) {
452
+ draft.newSchedule.searchTransactions = exports.searchTransactionsInitialState;
453
+ return;
454
+ }
455
+ draft.newSchedule.searchTransactions = {
456
+ ...draft.newSchedule.searchTransactions,
457
+ searchString: action.payload.query,
458
+ fetchState: 'In-Progress',
459
+ };
460
+ },
461
+ },
462
+ searchTransactionsForNewScheduleSuccess(draft, action) {
463
+ draft.newSchedule.searchTransactions = {
464
+ ...draft.newSchedule.searchTransactions,
465
+ searchResults: action.payload.searchResults,
466
+ fetchState: 'Completed',
467
+ error: undefined,
468
+ };
469
+ },
470
+ searchTransactionsForNewScheduleFailure(draft, action) {
471
+ draft.newSchedule.searchTransactions = {
472
+ ...draft.newSchedule.searchTransactions,
473
+ fetchState: 'Error',
474
+ error: action.payload.status,
475
+ };
476
+ },
477
+ clearSearchTransactionsForNewSchedule(draft) {
478
+ draft.newSchedule.searchTransactions = exports.searchTransactionsInitialState;
479
+ },
480
+ saveNewSchedule: {
481
+ prepare({ scheduleType, }) {
482
+ return { payload: { scheduleType } };
483
+ },
484
+ reducer(draft) {
485
+ draft.newSchedule.saveStatus = {
486
+ fetchState: 'In-Progress',
487
+ error: undefined,
488
+ };
489
+ },
490
+ },
491
+ saveNewScheduleSuccess(draft) {
492
+ draft.newSchedule.saveStatus = {
493
+ fetchState: 'Completed',
494
+ error: undefined,
495
+ };
496
+ },
497
+ saveNewScheduleFailure(draft, action) {
498
+ draft.newSchedule.saveStatus = {
499
+ fetchState: 'Error',
500
+ error: action.payload.status,
501
+ };
502
+ },
503
+ createOneTimeAccrual: {
504
+ prepare(localData) {
505
+ return { payload: { localData } };
506
+ },
507
+ reducer(draft) {
508
+ draft.newSchedule.createOneTimeAccrualStatus = {
509
+ fetchState: 'In-Progress',
510
+ error: undefined,
511
+ };
512
+ },
513
+ },
514
+ createOneTimeAccrualSuccess(draft) {
515
+ draft.newSchedule.createOneTimeAccrualStatus = {
516
+ fetchState: 'Completed',
517
+ error: undefined,
518
+ };
519
+ },
520
+ createOneTimeAccrualFailure(draft, action) {
521
+ draft.newSchedule.createOneTimeAccrualStatus = {
522
+ fetchState: 'Error',
523
+ error: action.payload.status,
524
+ };
525
+ },
376
526
  updateJESchedulesUIState(draft, action) {
377
527
  if (action.payload.sortKey != null) {
378
528
  draft.uiState.sortKey = action.payload.sortKey;
@@ -386,10 +536,21 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
386
536
  if (action.payload.scrollPosition != null) {
387
537
  draft.uiState.scrollPosition = action.payload.scrollPosition;
388
538
  }
389
- if (action.payload.selectedMainTab != null) {
390
- draft.uiState.selectedMainTab = action.payload.selectedMainTab;
539
+ if (action.payload.selectedPageTab != null) {
540
+ draft.uiState.selectedPageTab = action.payload.selectedPageTab;
391
541
  }
392
542
  },
543
+ updateJEScheduleTypeFilter(draft, action) {
544
+ draft.uiState.selectedJETypeFilter = action.payload;
545
+ },
546
+ toggleJEPendingGroupCollapsed(draft) {
547
+ draft.uiState.pendingGroupCollapsed =
548
+ !draft.uiState.pendingGroupCollapsed;
549
+ },
550
+ toggleJECreatedGroupCollapsed(draft) {
551
+ draft.uiState.createdGroupCollapsed =
552
+ !draft.uiState.createdGroupCollapsed;
553
+ },
393
554
  clearExpenseAutomationJESchedulesView(draft) {
394
555
  Object.assign(draft, exports.initialState);
395
556
  },
@@ -400,7 +561,7 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
400
561
  });
401
562
  },
402
563
  });
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;
564
+ _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.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
565
  exports.default = expenseAutomationJESchedulesView.reducer;
405
566
  const doUpdateRecommendationForAccountSettings = (draft, payload) => {
406
567
  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,40 @@
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
+ * A one-time accrual is not a schedule type, so it deliberately does not reuse
17
+ * NewScheduleView: there is no base transaction to search, no local-data slot in
18
+ * newScheduleState, and it needs a second account hierarchy (the accrued
19
+ * liability) that no schedule type has.
20
+ */
21
+ export interface NewOneTimeAccrualView {
22
+ accountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
23
+ accruedAccountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
24
+ allAccountList: AccountBase[];
25
+ allAccruedExpenseList: AccountBase[];
26
+ allClassList: ClassBase[];
27
+ classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
28
+ createStatus: FetchStateAndError;
29
+ }
30
+ export interface NewScheduleView extends SelectorView, NewScheduleSearchTransactionsView {
31
+ accountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
32
+ allAccountList: AccountBase[];
33
+ allClassList: ClassBase[];
34
+ classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
35
+ newScheduleLocalData: NewScheduleLocalData | NewScheduleLocalDataFixedAssets;
36
+ saveStatus: FetchStateAndError;
37
+ scheduleType: ScheduleTypes;
38
+ allDepreciationAccountList?: AccountBase[];
39
+ allDepreciationAccountListNestedAccountHierarchy?: NestedAccountHierarchyForReport[];
40
+ }
@@ -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,20 @@
1
+ import { RootState } from '../../../reducer';
2
+ import { NewOneTimeAccrualView, 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 for the one-time accrual creation form.
12
+ *
13
+ * getAccountsTypesForScheduleDetails('accrued_expenses') deliberately includes
14
+ * other_current_liabilities, because the accrued liability accounts live there —
15
+ * so the debit list has to subtract them back out, and the credit list keeps only
16
+ * them. Mirrors getScheduleAccruedDetailView, which is the form this one is
17
+ * modelled on.
18
+ */
19
+ export declare const getNewOneTimeAccrualView: (state: RootState) => NewOneTimeAccrualView;
20
+ export declare const getNewScheduleView: (state: RootState, scheduleType: "fixed_assets" | "prepaid_expenses") => NewScheduleView;
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getNewScheduleView = exports.getNewOneTimeAccrualView = exports.getNewScheduleSearchTransactionsView = void 0;
4
+ const accountSelector_1 = require("../../../entity/account/accountSelector");
5
+ const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
6
+ const accountListSelector_1 = require("../../accountList/accountListSelector");
7
+ const classListSelector_1 = require("../../classList/classListSelector");
8
+ const scheduleDetailLocalDataHelper_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper");
9
+ const scheduleDetailSelector_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailSelector");
10
+ const scheduleListHelper_1 = require("../../scheduleView/scheduleListView/scheduleListHelper");
11
+ /**
12
+ * The Base Transaction search is shared across schedule types (one search
13
+ * box, not one per prepaid_expenses/fixed_assets) — split out from
14
+ * getNewScheduleView so a consumer can read it without supplying an
15
+ * otherwise-irrelevant scheduleType.
16
+ */
17
+ const getNewScheduleSearchTransactionsView = (state) => {
18
+ const { searchTransactions } = state.expenseAutomationJESchedulesViewState.newSchedule;
19
+ const searchTransactionsResults = searchTransactions.searchResults
20
+ .map((key) => (0, transactionSelector_1.getScheduleTransactionById)(state.transactionState, key))
21
+ .filter((transaction) => transaction != null);
22
+ return {
23
+ searchTransactionsResults,
24
+ searchTransactionsFetchState: {
25
+ fetchState: searchTransactions.fetchState,
26
+ error: searchTransactions.error,
27
+ },
28
+ searchTransactionsString: searchTransactions.searchString,
29
+ };
30
+ };
31
+ exports.getNewScheduleSearchTransactionsView = getNewScheduleSearchTransactionsView;
32
+ const ACCRUED_EXPENSE_ACCOUNT_LABELS = ['accrued_expenses'];
33
+ /**
34
+ * Account + class options for the one-time accrual creation form.
35
+ *
36
+ * getAccountsTypesForScheduleDetails('accrued_expenses') deliberately includes
37
+ * other_current_liabilities, because the accrued liability accounts live there —
38
+ * so the debit list has to subtract them back out, and the credit list keeps only
39
+ * them. Mirrors getScheduleAccruedDetailView, which is the form this one is
40
+ * modelled on.
41
+ */
42
+ const getNewOneTimeAccrualView = (state) => {
43
+ const { accountState, accountListState, classState, classListState } = state;
44
+ const { newSchedule } = state.expenseAutomationJESchedulesViewState;
45
+ const accountType = (0, scheduleListHelper_1.getAccountsTypesForScheduleEpics)();
46
+ const accrualAccountIds = (0, accountSelector_1.getAccountIdsForTypes)(accountState, (0, scheduleDetailLocalDataHelper_1.getAccountsTypesForScheduleDetails)('accrued_expenses'));
47
+ const accruedCategoryIds = (0, accountSelector_1.getAccountIdsForLabels)(accountState, ACCRUED_EXPENSE_ACCOUNT_LABELS);
48
+ const allAccountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, accountType.accountListKey);
49
+ const nestedAccountHierarchy = (0, accountListSelector_1.getNestedAccountListHierarchy)(accountListState, accountType.accountListKey);
50
+ const debitAccounts = allAccountList.accounts.filter((account) => accrualAccountIds.includes(account.accountId) &&
51
+ !accruedCategoryIds.includes(account.accountId));
52
+ const creditAccounts = allAccountList.accounts.filter((account) => accruedCategoryIds.includes(account.accountId));
53
+ const allClassList = (0, classListSelector_1.getClassList)(classState, classListState);
54
+ return {
55
+ accountListNestedAccountHierarchy: (0, scheduleDetailSelector_1.filterNestedAccountHierarchyById)(nestedAccountHierarchy, debitAccounts.map((account) => account.accountId)),
56
+ accruedAccountListNestedAccountHierarchy: (0, scheduleDetailSelector_1.filterNestedAccountHierarchyById)(nestedAccountHierarchy, creditAccounts.map((account) => account.accountId)),
57
+ allAccountList: debitAccounts,
58
+ allAccruedExpenseList: creditAccounts,
59
+ allClassList: allClassList.classes,
60
+ classListNestedAccountHierarchy: (0, classListSelector_1.getNestedClassListHierarchy)(classListState),
61
+ createStatus: newSchedule.createOneTimeAccrualStatus,
62
+ };
63
+ };
64
+ exports.getNewOneTimeAccrualView = getNewOneTimeAccrualView;
65
+ const getNewScheduleView = (state, scheduleType) => {
66
+ const { accountState, accountListState, classState, classListState } = state;
67
+ const { newSchedule } = state.expenseAutomationJESchedulesViewState;
68
+ const searchTransactionsView = (0, exports.getNewScheduleSearchTransactionsView)(state);
69
+ const accountType = (0, scheduleListHelper_1.getAccountsTypesForScheduleEpics)();
70
+ const newScheduleAccountTypes = (0, scheduleDetailLocalDataHelper_1.getAccountsTypesForScheduleDetails)(scheduleType);
71
+ const newScheduleAccountIds = (0, accountSelector_1.getAccountIdsForTypes)(accountState, newScheduleAccountTypes);
72
+ const allAccountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, accountType.accountListKey);
73
+ const filteredAccounts = allAccountList.accounts.filter((account) => newScheduleAccountIds.includes(account.accountId));
74
+ const accountListNestedAccountHierarchy = (0, scheduleDetailSelector_1.filterNestedAccountHierarchyById)((0, accountListSelector_1.getNestedAccountListHierarchy)(accountListState, accountType.accountListKey), filteredAccounts.map((account) => account.accountId));
75
+ const allClassList = (0, classListSelector_1.getClassList)(classState, classListState);
76
+ const classListNestedAccountHierarchy = (0, classListSelector_1.getNestedClassListHierarchy)(classListState);
77
+ let allDepreciationAccountList;
78
+ let allDepreciationAccountListNestedAccountHierarchy;
79
+ if (scheduleType === 'fixed_assets') {
80
+ const depreciationCategoryIds = (0, accountSelector_1.getAccountIdsForTypes)(accountState, [
81
+ 'fixed_assets',
82
+ 'other_assets',
83
+ ]);
84
+ const accountLabel = (0, scheduleListHelper_1.getAccountLabelForScheduleType)('fixed_assets');
85
+ const fixedAssetLabelAccountIds = accountLabel != null
86
+ ? (0, accountListSelector_1.getAccountIdsForLabel)(accountListState, accountType.accountListKey, accountLabel)
87
+ : [];
88
+ allDepreciationAccountList = allAccountList.accounts.filter((account) => depreciationCategoryIds.includes(account.accountId) &&
89
+ !fixedAssetLabelAccountIds.includes(account.accountId));
90
+ allDepreciationAccountListNestedAccountHierarchy =
91
+ (0, scheduleDetailSelector_1.filterNestedAccountHierarchyById)((0, accountListSelector_1.getNestedAccountListHierarchy)(accountListState, accountType.accountListKey), allDepreciationAccountList.map((account) => account.accountId));
92
+ }
93
+ return {
94
+ scheduleType,
95
+ accountListNestedAccountHierarchy,
96
+ allAccountList: filteredAccounts,
97
+ allClassList: allClassList.classes,
98
+ allDepreciationAccountList,
99
+ allDepreciationAccountListNestedAccountHierarchy,
100
+ classListNestedAccountHierarchy,
101
+ newScheduleLocalData: newSchedule.newScheduleState[scheduleType],
102
+ saveStatus: newSchedule.saveStatus,
103
+ ...searchTransactionsView,
104
+ fetchState: newSchedule.fetchState,
105
+ error: newSchedule.error,
106
+ };
107
+ };
108
+ exports.getNewScheduleView = getNewScheduleView;
@@ -1,7 +1,16 @@
1
- import { JEScheduledTransaction, ScheduledJournalEntry } from '../../../entity/jeSchedules/jeSchedulesSelector';
1
+ import { JEAccruedSchedule, JEOneTimeAccrual, JEScheduledTransaction, ScheduledJournalEntry } from '../../../entity/jeSchedules/jeSchedulesSelector';
2
+ import { ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
2
3
  import { RootState } from '../../../reducer';
3
4
  import { ExpenseAutomationJESchedulesViewSelector } from '../selectorTypes/jeSchedulesSelectorTypes';
5
+ export declare function getJEScheduleRowType(schedule: JEScheduleRow): ScheduleTypes | undefined;
6
+ export declare function isPendingReviewRow(schedule: JEScheduleRow): boolean;
7
+ export declare function isExistingTabRow(schedule: JEScheduleRow): boolean;
8
+ export declare const isAiAccountantSchedule: (schedule: JEScheduleRow) => boolean;
9
+ export declare function isAccruedScheduleRow(schedule: JEScheduleRow): schedule is JEAccruedSchedule;
10
+ export declare function isOneTimeAccrualRow(schedule: JEScheduleRow): schedule is JEOneTimeAccrual;
4
11
  export declare function getExpenseAutomationJESchedulesView(state: RootState): ExpenseAutomationJESchedulesViewSelector;
5
12
  export interface JEScheduledTransactionWithFailedEntries extends Omit<JEScheduledTransaction, 'scheduledJournalEntry'> {
6
13
  scheduledJournalEntry: ScheduledJournalEntry;
7
14
  }
15
+ export type JEScheduleRow = JEAccruedSchedule | JEOneTimeAccrual | JEScheduledTransaction | JEScheduledTransactionWithFailedEntries;
16
+ export type JEScheduleRowWithoutOneTimeAccrual = Exclude<JEScheduleRow, JEOneTimeAccrual>;