@zeniai/client-epic-state 5.2.10 → 5.2.11-betaAM1

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 (155) hide show
  1. package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +1 -0
  2. package/lib/entity/jeSchedules/jeScheduleHelper.js +7 -0
  3. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +86 -1
  4. package/lib/entity/jeSchedules/jeSchedulesPayload.js +172 -0
  5. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +4 -2
  6. package/lib/entity/jeSchedules/jeSchedulesReducer.js +30 -2
  7. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +11 -2
  8. package/lib/entity/jeSchedules/jeSchedulesSelector.js +38 -3
  9. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +101 -1
  10. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +24 -1
  11. package/lib/entity/jeSchedules/jeSchedulesTypes.js +88 -1
  12. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  13. package/lib/entity/snackbar/snackbarTypes.js +3 -0
  14. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +2 -0
  15. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  16. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +2 -0
  17. package/lib/epic.d.ts +14 -1
  18. package/lib/epic.js +26 -0
  19. package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +6 -0
  20. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +172 -1
  21. package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +30 -2
  22. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +36 -2
  23. package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +78 -0
  24. package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
  25. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  26. package/lib/esm/epic.js +26 -0
  27. package/lib/esm/index.js +19 -9
  28. package/lib/esm/reducer.js +3 -0
  29. package/lib/esm/view/companyMonthEndReportView/companyMonthEndReportViewReducer.js +6 -2
  30. package/lib/esm/view/companyMonthEndReportView/companyMonthEndReportViewState.js +4 -0
  31. package/lib/esm/view/companyMonthEndReportView/epics/saveCompanyMonthEndReportEpic.js +10 -6
  32. package/lib/esm/view/companyMonthEndReportView/epics/sendCompanyMonthEndReportEpic.js +9 -5
  33. package/lib/esm/view/companyMonthEndReportView/monthEndTemplateData.js +32 -0
  34. package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +46 -0
  35. package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +7 -0
  36. package/lib/esm/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +50 -0
  37. package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +44 -0
  38. package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +44 -0
  39. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +30 -10
  40. package/lib/esm/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +9 -1
  41. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +9 -1
  42. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +41 -5
  43. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +45 -0
  44. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
  45. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +104 -0
  46. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +25 -0
  47. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +136 -0
  48. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +79 -0
  49. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +157 -0
  50. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +111 -0
  51. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +33 -0
  52. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +22 -7
  53. package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +140 -0
  54. package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +35 -0
  55. package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +55 -0
  56. package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +260 -0
  57. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +314 -29
  58. package/lib/esm/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +1 -0
  59. package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +1 -0
  60. package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +162 -0
  61. package/lib/esm/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +1 -0
  62. package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +106 -0
  63. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +297 -22
  64. package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +22 -0
  65. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -5
  66. package/lib/esm/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
  67. package/lib/esm/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
  68. package/lib/esm/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
  69. package/lib/index.d.ts +25 -14
  70. package/lib/index.js +119 -51
  71. package/lib/reducer.d.ts +1 -0
  72. package/lib/reducer.js +3 -0
  73. package/lib/rootStateTypes.d.ts +2 -0
  74. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewPayload.d.ts +8 -0
  75. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.d.ts +6 -2
  76. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.js +6 -2
  77. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewState.d.ts +2 -0
  78. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewState.js +4 -0
  79. package/lib/view/companyMonthEndReportView/epics/saveCompanyMonthEndReportEpic.js +10 -6
  80. package/lib/view/companyMonthEndReportView/epics/sendCompanyMonthEndReportEpic.js +9 -5
  81. package/lib/view/companyMonthEndReportView/monthEndTemplateData.d.ts +16 -0
  82. package/lib/view/companyMonthEndReportView/monthEndTemplateData.js +36 -0
  83. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.d.ts +9 -0
  84. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +50 -0
  85. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.d.ts +5 -0
  86. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +11 -0
  87. package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.d.ts +8 -0
  88. package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +54 -0
  89. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.d.ts +8 -0
  90. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +48 -0
  91. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.d.ts +8 -0
  92. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +48 -0
  93. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +2 -1
  94. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +30 -10
  95. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +2 -1
  96. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +9 -1
  97. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +9 -1
  98. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +3 -2
  99. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +39 -3
  100. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.d.ts +21 -0
  101. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +49 -0
  102. package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
  103. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +9 -0
  104. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +108 -0
  105. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +8 -0
  106. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +29 -0
  107. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +9 -0
  108. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +140 -0
  109. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +8 -0
  110. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +83 -0
  111. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +13 -0
  112. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +164 -0
  113. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +65 -0
  114. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +115 -0
  115. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +7 -0
  116. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +37 -0
  117. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +22 -7
  118. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +36 -0
  119. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +145 -0
  120. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  121. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +66 -0
  122. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +40 -0
  123. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +72 -3
  124. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +58 -1
  125. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +53 -0
  126. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +264 -0
  127. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +91 -12
  128. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +316 -29
  129. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
  130. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
  131. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +58 -0
  132. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +2 -0
  133. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +2 -0
  134. package/lib/view/expenseAutomationView/selectorTypes/jeAccountSettingsViewSelectorTypes.d.ts +1 -0
  135. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +42 -0
  136. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +2 -0
  137. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +36 -7
  138. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +9 -0
  139. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +172 -0
  140. package/lib/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +1 -0
  141. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +21 -0
  142. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +112 -0
  143. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +34 -0
  144. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +305 -21
  145. package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +76 -0
  146. package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +27 -0
  147. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
  148. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +83 -8
  149. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +11 -7
  150. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
  151. package/lib/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
  152. package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
  153. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +4 -2
  154. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
  155. package/package.json +1 -1
@@ -1,14 +1,22 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeJeScheduleTransactionKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.accountSettingsInitialState = void 0;
4
+ exports.saveNewScheduleSuccess = exports.saveNewScheduleFailure = exports.saveNewSchedule = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.resetNewScheduleLocalData = exports.removeJeScheduleTransactionKey = exports.removeJeAccruedScheduleKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeNewSchedule = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchOneTimeAccrualSuccess = exports.fetchOneTimeAccrualFailure = exports.fetchOneTimeAccrual = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.revertOneTimeAccrual = exports.revertJeScheduleSuccess = exports.revertJeScheduleFailure = exports.revertJeSchedule = exports.promoteOneTimeAccrual = exports.oneTimeAccrualActionSuccess = exports.oneTimeAccrualActionFailure = exports.ignoreOneTimeAccrual = exports.createOneTimeAccrualSuccess = exports.createOneTimeAccrualFailure = exports.createOneTimeAccrual = exports.clearSearchTransactionsForNewSchedule = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.searchTransactionsInitialState = exports.newScheduleInitialState = exports.getBaseNewScheduleLocalData = exports.accountSettingsInitialState = void 0;
5
+ exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateNewScheduleLocalData = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = exports.toggleJECreatedGroupCollapsed = exports.searchTransactionsForNewScheduleSuccess = exports.searchTransactionsForNewScheduleFailure = exports.searchTransactionsForNewSchedule = void 0;
5
6
  const toolkit_1 = require("@reduxjs/toolkit");
6
7
  const getNestedAccountIDHierarchyForReport_1 = require("../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
7
8
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
8
9
  const accountPayload_1 = require("../../../entity/account/accountPayload");
10
+ const jeScheduleHelper_1 = require("../../../entity/jeSchedules/jeScheduleHelper");
9
11
  const jeSchedulesPayload_1 = require("../../../entity/jeSchedules/jeSchedulesPayload");
10
12
  const rootActions_1 = require("../../../rootActions");
11
13
  const accountTypeRecommendationPayload_1 = require("../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload");
14
+ const jeSchedulesViewState_1 = require("../types/jeSchedulesViewState");
15
+ function removeKeyFromEveryTabSlot(keysByPeriodAndTab, keyToRemove) {
16
+ for (const periodTabKey of Object.keys(keysByPeriodAndTab)) {
17
+ keysByPeriodAndTab[periodTabKey] = keysByPeriodAndTab[periodTabKey].filter((jeScheduleKey) => jeScheduleKey !== keyToRemove);
18
+ }
19
+ }
12
20
  exports.accountSettingsInitialState = {
13
21
  localData: {
14
22
  selectedPrepaidExpensesAccountIds: [],
@@ -22,6 +30,7 @@ exports.accountSettingsInitialState = {
22
30
  error: undefined,
23
31
  fetchState: 'Not-Started',
24
32
  },
33
+ hasLoadedAccountSettings: false,
25
34
  recommendationFetchState: {
26
35
  error: undefined,
27
36
  fetchState: 'Not-Started',
@@ -40,16 +49,38 @@ exports.accountSettingsInitialState = {
40
49
  accruedExpensesNestedAccountListHierarchy: [],
41
50
  accruedExpensesRecommendations: [],
42
51
  };
52
+ const getBaseNewScheduleLocalData = (scheduleType) => ({
53
+ scheduleType,
54
+ jeScheduleDetails: [],
55
+ });
56
+ exports.getBaseNewScheduleLocalData = getBaseNewScheduleLocalData;
57
+ exports.newScheduleInitialState = {
58
+ fixed_assets: (0, exports.getBaseNewScheduleLocalData)('fixed_assets'),
59
+ prepaid_expenses: (0, exports.getBaseNewScheduleLocalData)('prepaid_expenses'),
60
+ };
61
+ exports.searchTransactionsInitialState = {
62
+ searchResults: [],
63
+ fetchState: 'Not-Started',
64
+ error: undefined,
65
+ };
43
66
  exports.initialState = {
44
- jeScheduleTransactionKeysByPeriod: {},
45
- failedJeScheduleTransactionKeysByPeriod: {},
67
+ jeScheduleTransactionKeysByPeriodAndTab: {},
68
+ jeScheduleAccruedKeysByPeriodAndTab: {},
69
+ jeScheduleOneTimeAccrualKeysByPeriodAndTab: {},
70
+ failedJeScheduleTransactionKeysByPeriodAndTab: {},
46
71
  postStatusById: {},
47
72
  ignoreStatusById: {},
73
+ revertStatusById: {},
48
74
  jeScheduleLocalDataById: {},
75
+ oneTimeAccrualActionStatusById: {},
76
+ oneTimeAccrualFetchStatusById: {},
49
77
  uiState: {
50
- searchString: '',
78
+ createdGroupCollapsed: false,
79
+ pendingGroupCollapsed: false,
51
80
  scrollPosition: { scrollTop: 0, scrollLeft: undefined },
52
- selectedMainTab: 'pending_review',
81
+ searchString: '',
82
+ selectedJETypeFilter: null,
83
+ selectedPageTab: 'schedules',
53
84
  sortKey: 'transactionDate',
54
85
  sortOrder: 'descending',
55
86
  totalCount: 0,
@@ -60,6 +91,14 @@ exports.initialState = {
60
91
  error: undefined,
61
92
  },
62
93
  accountSettings: exports.accountSettingsInitialState,
94
+ newSchedule: {
95
+ createOneTimeAccrualStatus: { fetchState: 'Not-Started', error: undefined },
96
+ newScheduleState: exports.newScheduleInitialState,
97
+ saveStatus: { fetchState: 'Not-Started', error: undefined },
98
+ searchTransactions: exports.searchTransactionsInitialState,
99
+ fetchState: 'Not-Started',
100
+ error: undefined,
101
+ },
63
102
  fetchState: 'Not-Started',
64
103
  error: undefined,
65
104
  hasValidState() {
@@ -104,9 +143,12 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
104
143
  },
105
144
  },
106
145
  fetchJeSchedulesSuccess(draft, action) {
107
- const { jeSchedules, selectedPeriod, failedJeSchedules, refreshViewInBackground, } = action.payload;
146
+ const { jeSchedules, selectedPeriod, selectedPageTab, failedJeSchedules, accruedJeSchedules, oneTimeAccruals, refreshViewInBackground, } = action.payload;
147
+ const periodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
108
148
  const jeScheduleTransactionKeys = jeSchedules.map((schedules) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedules.base_transaction));
109
149
  const failedJeScheduleTransactionKeys = failedJeSchedules.map((schedules) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedules.base_transaction));
150
+ const jeScheduleAccruedKeys = accruedJeSchedules.map((schedule) => (0, jeSchedulesPayload_1.getJEScheduleKey)(schedule));
151
+ const jeScheduleOneTimeAccrualKeys = oneTimeAccruals.map((accrual) => (0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrual._id));
110
152
  if (refreshViewInBackground === true &&
111
153
  draft.refreshStatus.fetchState === 'In-Progress') {
112
154
  draft.refreshStatus = { fetchState: 'Completed', error: undefined };
@@ -115,19 +157,31 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
115
157
  draft.fetchState = 'Completed';
116
158
  draft.error = undefined;
117
159
  }
118
- draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = jeScheduleTransactionKeys;
119
- draft.failedJeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = failedJeScheduleTransactionKeys;
160
+ draft.jeScheduleTransactionKeysByPeriodAndTab[periodTabKey] =
161
+ jeScheduleTransactionKeys;
162
+ draft.jeScheduleAccruedKeysByPeriodAndTab[periodTabKey] =
163
+ jeScheduleAccruedKeys;
164
+ draft.jeScheduleOneTimeAccrualKeysByPeriodAndTab[periodTabKey] =
165
+ jeScheduleOneTimeAccrualKeys;
166
+ draft.failedJeScheduleTransactionKeysByPeriodAndTab[periodTabKey] =
167
+ failedJeScheduleTransactionKeys;
120
168
  },
121
169
  fetchJeSchedulesFailure(draft, action) {
122
- const { status, selectedPeriod } = action.payload;
170
+ const { status, selectedPeriod, selectedPageTab } = action.payload;
171
+ const periodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
123
172
  if (draft.refreshStatus.fetchState === 'In-Progress') {
124
173
  draft.refreshStatus = { fetchState: 'Error', error: status };
125
174
  }
126
175
  else {
127
176
  draft.fetchState = 'Error';
128
177
  draft.error = status;
178
+ draft.jeScheduleTransactionKeysByPeriodAndTab[periodTabKey] = [];
179
+ draft.jeScheduleAccruedKeysByPeriodAndTab[periodTabKey] = [];
180
+ draft.jeScheduleOneTimeAccrualKeysByPeriodAndTab[periodTabKey] = [];
181
+ // Cleared with the rest: leaving it behind kept the previous fetch's resolve rows on an
182
+ // otherwise empty errored tab, which reads as "these are all the schedules there are".
183
+ draft.failedJeScheduleTransactionKeysByPeriodAndTab[periodTabKey] = [];
129
184
  }
130
- draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = [];
131
185
  },
132
186
  retryJeSchedule(draft, action) {
133
187
  const { scheduledJournalEntryID } = action.payload;
@@ -163,11 +217,13 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
163
217
  };
164
218
  },
165
219
  ignoreRecommendedJeSchedule: {
166
- prepare(jeScheduleTransactionKey, scheduleType) {
220
+ prepare(jeScheduleTransactionKey, scheduleType, reason, note) {
167
221
  return {
168
222
  payload: {
169
223
  jeScheduleTransactionKey,
170
224
  scheduleType,
225
+ reason,
226
+ note,
171
227
  },
172
228
  };
173
229
  },
@@ -183,6 +239,41 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
183
239
  };
184
240
  },
185
241
  },
242
+ revertJeSchedule: {
243
+ // jeScheduleTransactionKey is a JEScheduleKey for an accrued schedule, which has no base
244
+ // transaction to derive a transaction key from. It is only ever used as an opaque row
245
+ // identifier here -- for the row's spinner and for dropping the row from the list -- so one
246
+ // action serves both shapes rather than two near-identical ones.
247
+ prepare(jeScheduleId, jeScheduleTransactionKey, scheduleType, reason, note) {
248
+ return {
249
+ payload: {
250
+ jeScheduleId,
251
+ jeScheduleTransactionKey,
252
+ scheduleType,
253
+ reason,
254
+ note,
255
+ },
256
+ };
257
+ },
258
+ reducer(draft, action) {
259
+ draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
260
+ fetchState: 'In-Progress',
261
+ error: undefined,
262
+ };
263
+ },
264
+ },
265
+ revertJeScheduleSuccess(draft, action) {
266
+ draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
267
+ fetchState: 'Completed',
268
+ error: undefined,
269
+ };
270
+ },
271
+ revertJeScheduleFailure(draft, action) {
272
+ draft.revertStatusById[action.payload.jeScheduleTransactionKey] = {
273
+ fetchState: 'Error',
274
+ error: action.payload.status,
275
+ };
276
+ },
186
277
  ignoreRecommendedJeScheduleSuccess: {
187
278
  reducer(draft, action) {
188
279
  const { jeScheduleTransactionKey } = action.payload;
@@ -215,17 +306,18 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
215
306
  };
216
307
  },
217
308
  updateJeScheduleTransactionKeys: {
218
- prepare(jeScheduleKeys, selectedPeriod) {
309
+ prepare(jeScheduleKeys, selectedPeriod, selectedPageTab) {
219
310
  return {
220
311
  payload: {
221
312
  jeScheduleKeys: jeScheduleKeys,
222
313
  selectedPeriod: selectedPeriod,
314
+ selectedPageTab: selectedPageTab,
223
315
  },
224
316
  };
225
317
  },
226
318
  reducer(draft, action) {
227
- const { selectedPeriod, jeScheduleKeys } = action.payload;
228
- draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = jeScheduleKeys;
319
+ const { selectedPeriod, selectedPageTab, jeScheduleKeys } = action.payload;
320
+ draft.jeScheduleTransactionKeysByPeriodAndTab[(0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod))] = jeScheduleKeys;
229
321
  },
230
322
  },
231
323
  removeJeScheduleTransactionKey: {
@@ -238,12 +330,20 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
238
330
  };
239
331
  },
240
332
  reducer(draft, action) {
241
- const { selectedPeriod, jeScheduleKey } = action.payload;
242
- const prevData = [
243
- ...(draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] ?? []),
244
- ];
245
- const filteredKeys = prevData.filter((jeKey) => jeKey !== jeScheduleKey);
246
- draft.jeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = filteredKeys;
333
+ const { jeScheduleKey } = action.payload;
334
+ // Dropped from every tab's slot, not just the visible one: once a schedule is ignored or
335
+ // resolved it must not reappear when the user switches tabs and hits a cached list.
336
+ removeKeyFromEveryTabSlot(draft.jeScheduleTransactionKeysByPeriodAndTab, jeScheduleKey);
337
+ },
338
+ },
339
+ removeJeAccruedScheduleKey: {
340
+ prepare(jeAccruedScheduleKey) {
341
+ return { payload: { jeAccruedScheduleKey } };
342
+ },
343
+ reducer(draft, action) {
344
+ // Accrued keys live in their own per-tab map, so removeJeScheduleTransactionKey cannot drop
345
+ // them -- a reverted accrued schedule stayed on the list until the next fetch.
346
+ removeKeyFromEveryTabSlot(draft.jeScheduleAccruedKeysByPeriodAndTab, action.payload.jeAccruedScheduleKey);
247
347
  },
248
348
  },
249
349
  removeFailedJeScheduleTransactionKey: {
@@ -256,12 +356,8 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
256
356
  };
257
357
  },
258
358
  reducer(draft, action) {
259
- const { selectedPeriod, failedJeScheduleKey } = action.payload;
260
- const prevData = [
261
- ...(draft.failedJeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] ?? []),
262
- ];
263
- const filteredKeys = prevData.filter((jeKey) => jeKey !== failedJeScheduleKey);
264
- draft.failedJeScheduleTransactionKeysByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] = filteredKeys;
359
+ const { failedJeScheduleKey } = action.payload;
360
+ removeKeyFromEveryTabSlot(draft.failedJeScheduleTransactionKeysByPeriodAndTab, failedJeScheduleKey);
265
361
  },
266
362
  },
267
363
  initializeJeScheduleLocalData: {
@@ -340,6 +436,9 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
340
436
  error: status,
341
437
  fetchState: 'Error',
342
438
  };
439
+ // Set on failure too: a tenant whose account list errors must still reach the page rather
440
+ // than sit under a skeleton forever.
441
+ draft.accountSettings.hasLoadedAccountSettings = true;
343
442
  },
344
443
  updateAccountSettingsListForAccountTypes(draft, action) {
345
444
  doUpdateAccountSettingsListForAccountTypes(draft.accountSettings, action.payload.accountPayload);
@@ -373,6 +472,182 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
373
472
  clearJeAccountSettingsLocalData(draft) {
374
473
  draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
375
474
  },
475
+ initializeNewSchedule: {
476
+ prepare({ scheduleType, shouldResetEnteredData = true, }) {
477
+ return { payload: { scheduleType, shouldResetEnteredData } };
478
+ },
479
+ reducer() {
480
+ // Purely an epic-trigger action — the epic fans out the account/class
481
+ // list fetches, and clears entered data only when asked to.
482
+ },
483
+ },
484
+ resetNewScheduleLocalData: {
485
+ prepare({ scheduleType, }) {
486
+ return { payload: { scheduleType } };
487
+ },
488
+ reducer(draft, action) {
489
+ const { scheduleType } = action.payload;
490
+ draft.newSchedule.newScheduleState[scheduleType] =
491
+ (0, exports.getBaseNewScheduleLocalData)(scheduleType);
492
+ },
493
+ },
494
+ updateNewScheduleLocalData(draft, action) {
495
+ const { scheduleType, localData } = action.payload;
496
+ draft.newSchedule.newScheduleState[scheduleType] = {
497
+ ...draft.newSchedule.newScheduleState[scheduleType],
498
+ ...localData,
499
+ };
500
+ },
501
+ searchTransactionsForNewSchedule: {
502
+ prepare({ query, scheduleType, }) {
503
+ return { payload: { query, scheduleType } };
504
+ },
505
+ reducer(draft, action) {
506
+ const trimmed = action.payload.query.trim();
507
+ // Cleared or too-short query: no API (see epic) — reset immediately.
508
+ if (trimmed.length < jeSchedulesViewState_1.MIN_NEW_SCHEDULE_SEARCH_LENGTH) {
509
+ draft.newSchedule.searchTransactions = exports.searchTransactionsInitialState;
510
+ return;
511
+ }
512
+ draft.newSchedule.searchTransactions = {
513
+ ...draft.newSchedule.searchTransactions,
514
+ searchString: action.payload.query,
515
+ fetchState: 'In-Progress',
516
+ };
517
+ },
518
+ },
519
+ searchTransactionsForNewScheduleSuccess(draft, action) {
520
+ draft.newSchedule.searchTransactions = {
521
+ ...draft.newSchedule.searchTransactions,
522
+ searchResults: action.payload.searchResults,
523
+ fetchState: 'Completed',
524
+ error: undefined,
525
+ };
526
+ },
527
+ searchTransactionsForNewScheduleFailure(draft, action) {
528
+ draft.newSchedule.searchTransactions = {
529
+ ...draft.newSchedule.searchTransactions,
530
+ fetchState: 'Error',
531
+ error: action.payload.status,
532
+ };
533
+ },
534
+ clearSearchTransactionsForNewSchedule(draft) {
535
+ draft.newSchedule.searchTransactions = exports.searchTransactionsInitialState;
536
+ },
537
+ saveNewSchedule: {
538
+ prepare({ scheduleType, }) {
539
+ return { payload: { scheduleType } };
540
+ },
541
+ reducer(draft) {
542
+ draft.newSchedule.saveStatus = {
543
+ fetchState: 'In-Progress',
544
+ error: undefined,
545
+ };
546
+ },
547
+ },
548
+ saveNewScheduleSuccess(draft) {
549
+ draft.newSchedule.saveStatus = {
550
+ fetchState: 'Completed',
551
+ error: undefined,
552
+ };
553
+ },
554
+ saveNewScheduleFailure(draft, action) {
555
+ draft.newSchedule.saveStatus = {
556
+ fetchState: 'Error',
557
+ error: action.payload.status,
558
+ };
559
+ },
560
+ createOneTimeAccrual: {
561
+ prepare(localData) {
562
+ return { payload: { localData } };
563
+ },
564
+ reducer(draft) {
565
+ draft.newSchedule.createOneTimeAccrualStatus = {
566
+ fetchState: 'In-Progress',
567
+ error: undefined,
568
+ };
569
+ },
570
+ },
571
+ createOneTimeAccrualSuccess(draft) {
572
+ draft.newSchedule.createOneTimeAccrualStatus = {
573
+ fetchState: 'Completed',
574
+ error: undefined,
575
+ };
576
+ },
577
+ createOneTimeAccrualFailure(draft, action) {
578
+ draft.newSchedule.createOneTimeAccrualStatus = {
579
+ fetchState: 'Error',
580
+ error: action.payload.status,
581
+ };
582
+ },
583
+ promoteOneTimeAccrual: {
584
+ prepare(accrualId, amount) {
585
+ return { payload: { accrualId, amount } };
586
+ },
587
+ reducer(draft, action) {
588
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
589
+ fetchState: 'In-Progress',
590
+ error: undefined,
591
+ };
592
+ },
593
+ },
594
+ revertOneTimeAccrual: {
595
+ prepare(accrualId, reason, note) {
596
+ return { payload: { accrualId, reason, note } };
597
+ },
598
+ reducer(draft, action) {
599
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
600
+ fetchState: 'In-Progress',
601
+ error: undefined,
602
+ };
603
+ },
604
+ },
605
+ ignoreOneTimeAccrual: {
606
+ prepare(accrualId, reason, note) {
607
+ return { payload: { accrualId, reason, note } };
608
+ },
609
+ reducer(draft, action) {
610
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
611
+ fetchState: 'In-Progress',
612
+ error: undefined,
613
+ };
614
+ },
615
+ },
616
+ fetchOneTimeAccrual: {
617
+ prepare(accrualId) {
618
+ return { payload: { accrualId } };
619
+ },
620
+ reducer(draft, action) {
621
+ draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
622
+ fetchState: 'In-Progress',
623
+ error: undefined,
624
+ };
625
+ },
626
+ },
627
+ fetchOneTimeAccrualSuccess(draft, action) {
628
+ draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
629
+ fetchState: 'Completed',
630
+ error: undefined,
631
+ };
632
+ },
633
+ fetchOneTimeAccrualFailure(draft, action) {
634
+ draft.oneTimeAccrualFetchStatusById[action.payload.accrualId] = {
635
+ fetchState: 'Error',
636
+ error: action.payload.status,
637
+ };
638
+ },
639
+ oneTimeAccrualActionSuccess(draft, action) {
640
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
641
+ fetchState: 'Completed',
642
+ error: undefined,
643
+ };
644
+ },
645
+ oneTimeAccrualActionFailure(draft, action) {
646
+ draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
647
+ fetchState: 'Error',
648
+ error: action.payload.status,
649
+ };
650
+ },
376
651
  updateJESchedulesUIState(draft, action) {
377
652
  if (action.payload.sortKey != null) {
378
653
  draft.uiState.sortKey = action.payload.sortKey;
@@ -386,10 +661,21 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
386
661
  if (action.payload.scrollPosition != null) {
387
662
  draft.uiState.scrollPosition = action.payload.scrollPosition;
388
663
  }
389
- if (action.payload.selectedMainTab != null) {
390
- draft.uiState.selectedMainTab = action.payload.selectedMainTab;
664
+ if (action.payload.selectedPageTab != null) {
665
+ draft.uiState.selectedPageTab = action.payload.selectedPageTab;
391
666
  }
392
667
  },
668
+ updateJEScheduleTypeFilter(draft, action) {
669
+ draft.uiState.selectedJETypeFilter = action.payload;
670
+ },
671
+ toggleJEPendingGroupCollapsed(draft) {
672
+ draft.uiState.pendingGroupCollapsed =
673
+ !draft.uiState.pendingGroupCollapsed;
674
+ },
675
+ toggleJECreatedGroupCollapsed(draft) {
676
+ draft.uiState.createdGroupCollapsed =
677
+ !draft.uiState.createdGroupCollapsed;
678
+ },
393
679
  clearExpenseAutomationJESchedulesView(draft) {
394
680
  Object.assign(draft, exports.initialState);
395
681
  },
@@ -400,7 +686,7 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
400
686
  });
401
687
  },
402
688
  });
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;
689
+ _a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.clearSearchTransactionsForNewSchedule = _a.clearSearchTransactionsForNewSchedule, exports.createOneTimeAccrual = _a.createOneTimeAccrual, exports.createOneTimeAccrualFailure = _a.createOneTimeAccrualFailure, exports.createOneTimeAccrualSuccess = _a.createOneTimeAccrualSuccess, exports.ignoreOneTimeAccrual = _a.ignoreOneTimeAccrual, exports.oneTimeAccrualActionFailure = _a.oneTimeAccrualActionFailure, exports.oneTimeAccrualActionSuccess = _a.oneTimeAccrualActionSuccess, exports.promoteOneTimeAccrual = _a.promoteOneTimeAccrual, exports.revertJeSchedule = _a.revertJeSchedule, exports.revertJeScheduleFailure = _a.revertJeScheduleFailure, exports.revertJeScheduleSuccess = _a.revertJeScheduleSuccess, exports.revertOneTimeAccrual = _a.revertOneTimeAccrual, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchOneTimeAccrual = _a.fetchOneTimeAccrual, exports.fetchOneTimeAccrualFailure = _a.fetchOneTimeAccrualFailure, exports.fetchOneTimeAccrualSuccess = _a.fetchOneTimeAccrualSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.initializeNewSchedule = _a.initializeNewSchedule, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeAccruedScheduleKey = _a.removeJeAccruedScheduleKey, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.resetNewScheduleLocalData = _a.resetNewScheduleLocalData, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.saveNewSchedule = _a.saveNewSchedule, exports.saveNewScheduleFailure = _a.saveNewScheduleFailure, exports.saveNewScheduleSuccess = _a.saveNewScheduleSuccess, exports.searchTransactionsForNewSchedule = _a.searchTransactionsForNewSchedule, exports.searchTransactionsForNewScheduleFailure = _a.searchTransactionsForNewScheduleFailure, exports.searchTransactionsForNewScheduleSuccess = _a.searchTransactionsForNewScheduleSuccess, exports.toggleJECreatedGroupCollapsed = _a.toggleJECreatedGroupCollapsed, exports.toggleJEPendingGroupCollapsed = _a.toggleJEPendingGroupCollapsed, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJEScheduleTypeFilter = _a.updateJEScheduleTypeFilter, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateNewScheduleLocalData = _a.updateNewScheduleLocalData, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
404
690
  exports.default = expenseAutomationJESchedulesView.reducer;
405
691
  const doUpdateRecommendationForAccountSettings = (draft, payload) => {
406
692
  const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
@@ -468,4 +754,5 @@ const doUpdateAccountSettingsListForAccountTypes = (draft, accountPayloadList) =
468
754
  error: undefined,
469
755
  fetchState: 'Completed',
470
756
  };
757
+ draft.hasLoadedAccountSettings = true;
471
758
  };
@@ -97,7 +97,7 @@ export declare const fetchMissingReceipts: import("@reduxjs/toolkit").ActionCrea
97
97
  transactionId: ID;
98
98
  }, "expenseAutomationMissingReceiptsView/confirmBulkUploadMatchSuccess">, confirmBulkUploadMatchFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
99
99
  error: ZeniAPIStatus;
100
- }, "expenseAutomationMissingReceiptsView/confirmBulkUploadMatchFailure">, setBulkUploadResultsTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"completed" | "unmatched", "expenseAutomationMissingReceiptsView/setBulkUploadResultsTab">, setBulkUploadCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"all" | "ai_accountant" | "manual", "expenseAutomationMissingReceiptsView/setBulkUploadCompletedSubTab">, setBulkUploadSortConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
100
+ }, "expenseAutomationMissingReceiptsView/confirmBulkUploadMatchFailure">, setBulkUploadResultsTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"completed" | "unmatched", "expenseAutomationMissingReceiptsView/setBulkUploadResultsTab">, setBulkUploadCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"manual" | "all" | "ai_accountant", "expenseAutomationMissingReceiptsView/setBulkUploadCompletedSubTab">, setBulkUploadSortConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
101
101
  sortKey: BulkUploadSortKey | undefined;
102
102
  sortOrder: SortOrder | undefined;
103
103
  }, "expenseAutomationMissingReceiptsView/setBulkUploadSortConfig">, clearBulkUpload: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationMissingReceiptsView/clearBulkUpload">, searchTransactionsForManualMatch: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[query: string, pageToken?: string | null | undefined], {
@@ -68,8 +68,8 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
68
68
  cotTrackingByTransactionId: COTTransactionTrackingByTransactionId;
69
69
  }, "expenseAutomationTransactionsView/updateTransactionCategorization", never, never>, updateCurrentSelectedTransactionCategorizationTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSelectedTab: "review" | "autoCategorized"], {
70
70
  newSelectedTab: "review" | "autoCategorized";
71
- }, "expenseAutomationTransactionsView/updateCurrentSelectedTransactionCategorizationTab", never, never>, updateTransactionCategorizationCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSubTab: "all" | "ai_accountant" | "manual"], {
72
- newSubTab: "all" | "ai_accountant" | "manual";
71
+ }, "expenseAutomationTransactionsView/updateCurrentSelectedTransactionCategorizationTab", never, never>, updateTransactionCategorizationCompletedSubTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSubTab: "manual" | "all" | "ai_accountant"], {
72
+ newSubTab: "manual" | "all" | "ai_accountant";
73
73
  }, "expenseAutomationTransactionsView/updateTransactionCategorizationCompletedSubTab", never, never>, updateTransactionGroup: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newGroup: "income" | "expense" | "all"], {
74
74
  newGroup: "income" | "expense" | "all";
75
75
  }, "expenseAutomationTransactionsView/updateTransactionGroup", never, never>, updateTransactionCategorizationSaveStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
@@ -0,0 +1,58 @@
1
+ import { FetchStateAndError } from '../../../commonStateTypes/common';
2
+ import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
3
+ import { JEOneTimeAccrual } from '../../../entity/jeSchedules/jeSchedulesSelector';
4
+ import { ZeniDate } from '../../../zeniDayJS';
5
+ import { ActualMatchingTransactionSearchResult, ActualMatchingViewUIState, MatchAndReverseResult } from '../types/actualMatchingViewState';
6
+ export type ActualMatchingRowKind = 'auto_reversed' | 'pending_review';
7
+ export interface ActualMatchingRow extends JEOneTimeAccrual {
8
+ kind: ActualMatchingRowKind;
9
+ reversalDate?: ZeniDate;
10
+ }
11
+ export interface ActualMatchingKpiSummary {
12
+ ai: {
13
+ count: number;
14
+ };
15
+ autoReversed: {
16
+ amount: number;
17
+ count: number;
18
+ };
19
+ manual: {
20
+ count: number;
21
+ };
22
+ pendingReview: {
23
+ amount: number;
24
+ count: number;
25
+ };
26
+ totalThisClose: {
27
+ amount: number;
28
+ count: number;
29
+ };
30
+ }
31
+ export interface ActualMatchingMatchModalView {
32
+ accrualSearch: {
33
+ fetchState: FetchStateAndError;
34
+ isLoadingMore: boolean;
35
+ nextPageToken: string | null;
36
+ query: string;
37
+ results: JEOneTimeAccrual[];
38
+ };
39
+ confirmStatus: FetchStateAndError;
40
+ isOpen: boolean;
41
+ transactionSearch: {
42
+ fetchState: FetchStateAndError;
43
+ isLoadingMore: boolean;
44
+ nextPageToken: string | null;
45
+ query: string;
46
+ results: ActualMatchingTransactionSearchResult[];
47
+ };
48
+ lastBatchResults?: MatchAndReverseResult[];
49
+ }
50
+ export interface ExpenseAutomationActualMatchingViewSelector extends SelectorView {
51
+ autoReversed: ActualMatchingRow[];
52
+ hasLoadedForSelectedPeriod: boolean;
53
+ kpiSummary: ActualMatchingKpiSummary;
54
+ matchModal: ActualMatchingMatchModalView;
55
+ pendingReview: ActualMatchingRow[];
56
+ refreshStatus: FetchStateAndError;
57
+ uiState: ActualMatchingViewUIState;
58
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -6,6 +6,7 @@ import { MonthEndCloseChecksView } from '../../../view/monthEndCloseChecksView/m
6
6
  import { CompanyMonthEndReportSelectorView } from '../../companyMonthEndReportView/companyMonthEndReportViewSelector';
7
7
  import { ExpenseAutomationViewType } from '../expenseAutomationViewState';
8
8
  import { TransactionsTab } from '../types/transactionsViewState';
9
+ import { ExpenseAutomationActualMatchingViewSelector } from './actualMatchingViewSelectorTypes';
9
10
  import { ExpenseAutomationFluxAnalysisViewSelector } from './fluxAnalysisViewSelectorTypes';
10
11
  import { ExpenseAutomationJESchedulesViewSelector } from './jeSchedulesSelectorTypes';
11
12
  import { ExpenseAutomationMissingReceiptsViewSelector } from './missingReceiptsSelectorTypes';
@@ -21,6 +22,7 @@ export interface ExpenseAutomationStepDetails {
21
22
  title: string;
22
23
  }
23
24
  export interface ExpenseAutomationViewSelector extends SelectorView {
25
+ actualMatching: ExpenseAutomationActualMatchingViewSelector;
24
26
  allSteps: ExpenseAutomationStepDetails[];
25
27
  completionStatus: CompletionStatusType;
26
28
  currentSelectedView: ExpenseAutomationViewType;
@@ -12,6 +12,7 @@ export interface JEAccountSettingsView extends SelectorView {
12
12
  fixedAssetsAccountHierarchy: NestedAccountHierarchyForReport[];
13
13
  fixedAssetsAccountList: AccountBase[];
14
14
  fixedAssetsRecommendations: Recommendation[];
15
+ hasLoaded: boolean;
15
16
  prepaidExpensesAccountHierarchy: NestedAccountHierarchyForReport[];
16
17
  prepaidExpensesAccountList: AccountBase[];
17
18
  prepaidExpensesRecommendations: Recommendation[];