@zeniai/client-epic-state 5.2.40 → 5.2.41-beta2MM

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 (122) hide show
  1. package/lib/entity/actualMatching/actualMatchingPayload.d.ts +31 -0
  2. package/lib/entity/actualMatching/actualMatchingPayload.js +52 -0
  3. package/lib/entity/actualMatching/actualMatchingReducer.d.ts +11 -0
  4. package/lib/entity/actualMatching/actualMatchingReducer.js +42 -0
  5. package/lib/entity/actualMatching/actualMatchingSelector.d.ts +3 -0
  6. package/lib/entity/actualMatching/actualMatchingSelector.js +6 -0
  7. package/lib/entity/actualMatching/actualMatchingState.d.ts +23 -0
  8. package/lib/entity/actualMatching/actualMatchingState.js +2 -0
  9. package/lib/entity/actualMatching/actualMatchingTypes.d.ts +1 -0
  10. package/lib/entity/actualMatching/actualMatchingTypes.js +2 -0
  11. package/lib/entity/file/fileReducer.d.ts +8 -0
  12. package/lib/entity/file/fileReducer.js +10 -2
  13. package/lib/entity/invoicing/invoicingCommonPayload.d.ts +14 -1
  14. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +31 -0
  15. package/lib/entity/jeSchedules/jeSchedulesPayload.js +53 -0
  16. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +33 -0
  17. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  18. package/lib/entity/snackbar/snackbarTypes.js +3 -0
  19. package/lib/epic.d.ts +9 -1
  20. package/lib/epic.js +16 -0
  21. package/lib/esm/entity/actualMatching/actualMatchingPayload.js +48 -0
  22. package/lib/esm/entity/actualMatching/actualMatchingReducer.js +38 -0
  23. package/lib/esm/entity/actualMatching/actualMatchingSelector.js +3 -0
  24. package/lib/esm/entity/actualMatching/actualMatchingState.js +1 -0
  25. package/lib/esm/entity/actualMatching/actualMatchingTypes.js +1 -0
  26. package/lib/esm/entity/file/fileReducer.js +10 -2
  27. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +53 -0
  28. package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
  29. package/lib/esm/epic.js +16 -0
  30. package/lib/esm/index.js +7 -3
  31. package/lib/esm/reducer.js +6 -0
  32. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +25 -12
  33. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingEpic.js +46 -0
  34. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +36 -0
  35. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingPageEpic.js +7 -0
  36. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +49 -0
  37. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +108 -0
  38. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/refreshActualMatchingList.js +16 -0
  39. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchAccrualsEpic.js +60 -0
  40. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +74 -0
  41. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/undoReversalAccrualsEpic.js +78 -0
  42. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -3
  43. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +40 -15
  44. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +19 -8
  45. package/lib/esm/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -1
  46. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +24 -6
  47. package/lib/esm/view/expenseAutomationView/expenseAutomationViewState.js +4 -2
  48. package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +68 -0
  49. package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +497 -0
  50. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -1
  51. package/lib/esm/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +1 -0
  52. package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +432 -0
  53. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +4 -0
  54. package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +47 -0
  55. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -1
  56. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +1 -1
  57. package/lib/esm/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.js +6 -0
  58. package/lib/esm/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.js +7 -0
  59. package/lib/esm/view/invoicing/settingsView/invoicingBrandingFormConfig.js +1 -1
  60. package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +5 -0
  61. package/lib/esm/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.js +9 -0
  62. package/lib/index.d.ts +14 -5
  63. package/lib/index.js +87 -48
  64. package/lib/reducer.d.ts +2 -0
  65. package/lib/reducer.js +6 -0
  66. package/lib/rootStateTypes.d.ts +4 -0
  67. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +25 -12
  68. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingEpic.d.ts +9 -0
  69. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingEpic.js +50 -0
  70. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.d.ts +12 -0
  71. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +40 -0
  72. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingPageEpic.d.ts +5 -0
  73. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingPageEpic.js +11 -0
  74. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.d.ts +10 -0
  75. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +53 -0
  76. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.d.ts +9 -0
  77. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +112 -0
  78. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/refreshActualMatchingList.d.ts +3 -0
  79. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/refreshActualMatchingList.js +19 -0
  80. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchAccrualsEpic.d.ts +9 -0
  81. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchAccrualsEpic.js +64 -0
  82. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.d.ts +8 -0
  83. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +78 -0
  84. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/undoReversalAccrualsEpic.d.ts +9 -0
  85. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/undoReversalAccrualsEpic.js +82 -0
  86. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +2 -1
  87. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -3
  88. package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.d.ts +5 -1
  89. package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +39 -14
  90. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +18 -7
  91. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -1
  92. package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -1
  93. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +24 -6
  94. package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +2 -1
  95. package/lib/view/expenseAutomationView/expenseAutomationViewState.js +6 -3
  96. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  97. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +91 -0
  98. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +74 -0
  99. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +88 -0
  100. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +501 -0
  101. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +6 -5
  102. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -1
  103. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +88 -0
  104. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +2 -0
  105. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +11 -0
  106. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +40 -0
  107. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +452 -0
  108. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +4 -0
  109. package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +116 -0
  110. package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +56 -0
  111. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +1 -1
  112. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -1
  113. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +1 -1
  114. package/lib/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.js +6 -0
  115. package/lib/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.js +7 -0
  116. package/lib/view/invoicing/settingsView/epics/settingsViewActionType.d.ts +2 -1
  117. package/lib/view/invoicing/settingsView/invoicingBrandingFormConfig.js +1 -1
  118. package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +8 -0
  119. package/lib/view/invoicing/settingsView/settingsViewSelector.js +5 -0
  120. package/lib/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.d.ts +2 -1
  121. package/lib/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.js +9 -0
  122. package/package.json +1 -1
@@ -0,0 +1,501 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.updateActualMatchingUIState = exports.undoReversalAccrualsSuccess = exports.undoReversalAccrualsFailure = exports.undoReversalAccruals = exports.searchMatchTransactionsSuccess = exports.searchMatchTransactionsFailure = exports.searchMatchTransactions = exports.searchMatchAccrualsSuccess = exports.searchMatchAccrualsFailure = exports.searchMatchAccruals = exports.openMatchNewModal = exports.matchAndReverseAccrualsSuccess = exports.matchAndReverseAccrualsFailure = exports.matchAndReverseAccruals = exports.ignoreActualMatchingSuggestionSuccess = exports.ignoreActualMatchingSuggestionFailure = exports.ignoreActualMatchingSuggestion = exports.fetchActualMatchingSuccess = exports.fetchActualMatchingPage = exports.fetchActualMatchingMatchSuccess = exports.fetchActualMatchingMatchFailure = exports.fetchActualMatchingMatch = exports.fetchActualMatchingFailure = exports.fetchActualMatching = exports.closeMatchNewModal = exports.clearMatchNewModal = exports.clearActualMatchingView = exports.ackCloseMatchAfterUndo = exports.ackCloseMatchAfterIgnore = exports.initialState = exports.initialMatchModalState = exports.initialAccrualSearchState = exports.initialTransactionSearchState = void 0;
5
+ const toolkit_1 = require("@reduxjs/toolkit");
6
+ const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
7
+ const jeScheduleHelper_1 = require("../../../entity/jeSchedules/jeScheduleHelper");
8
+ const responsePayload_1 = require("../../../responsePayload");
9
+ const rootActions_1 = require("../../../rootActions");
10
+ const actualMatchingViewState_1 = require("../types/actualMatchingViewState");
11
+ exports.initialTransactionSearchState = {
12
+ query: '',
13
+ results: [],
14
+ fetchState: 'Not-Started',
15
+ error: undefined,
16
+ nextPageToken: null,
17
+ isLoadingMore: false,
18
+ };
19
+ exports.initialAccrualSearchState = {
20
+ query: '',
21
+ results: [],
22
+ fetchState: 'Not-Started',
23
+ error: undefined,
24
+ nextPageToken: null,
25
+ isLoadingMore: false,
26
+ };
27
+ exports.initialMatchModalState = {
28
+ isOpen: false,
29
+ openedFromMatchId: undefined,
30
+ didPinPrefillTransactions: false,
31
+ pinnedTransactionResults: [],
32
+ transactionSearch: exports.initialTransactionSearchState,
33
+ accrualSearch: exports.initialAccrualSearchState,
34
+ confirmStatus: { fetchState: 'Not-Started', error: undefined },
35
+ };
36
+ exports.initialState = {
37
+ matchIdsByPeriod: {},
38
+ fetchState: 'Not-Started',
39
+ error: undefined,
40
+ refreshStatus: {
41
+ fetchState: 'Not-Started',
42
+ error: undefined,
43
+ },
44
+ detailFetchStateByMatchId: {},
45
+ detailRefreshStatusByMatchId: {},
46
+ uiState: {
47
+ sortKey: 'date',
48
+ sortOrder: 'descending',
49
+ searchString: '',
50
+ scrollPosition: { scrollTop: 0, scrollLeft: undefined },
51
+ },
52
+ matchModal: exports.initialMatchModalState,
53
+ undoReversalStatusByMatchId: {},
54
+ ignoreStatusByMatchId: {},
55
+ closeMatchAfterUndo: false,
56
+ lastMatchResultsByMatchId: {},
57
+ lastUndoResultsByMatchId: {},
58
+ hasValidState() {
59
+ return this.fetchState == 'Completed';
60
+ },
61
+ };
62
+ function pruneLastMatchResultsForUndone(draft, matchId, results) {
63
+ const undoneIds = new Set(results
64
+ .filter((result) => result.status === 'undone')
65
+ .map((result) => result.accrualId));
66
+ if (undoneIds.size === 0) {
67
+ return;
68
+ }
69
+ const existing = draft.lastMatchResultsByMatchId[matchId];
70
+ if (existing == null) {
71
+ return;
72
+ }
73
+ const kept = existing.filter((result) => !undoneIds.has(result.accrualId));
74
+ if (kept.length === 0) {
75
+ delete draft.lastMatchResultsByMatchId[matchId];
76
+ return;
77
+ }
78
+ draft.lastMatchResultsByMatchId[matchId] = kept;
79
+ }
80
+ function pruneLastUndoResultsForMatched(draft, matchId, results) {
81
+ const matchedIds = new Set(results.map((result) => result.accrualId));
82
+ if (matchedIds.size === 0) {
83
+ return;
84
+ }
85
+ const existing = draft.lastUndoResultsByMatchId[matchId];
86
+ if (existing == null) {
87
+ return;
88
+ }
89
+ const kept = existing.filter((result) => !matchedIds.has(result.accrualId));
90
+ if (kept.length === 0) {
91
+ delete draft.lastUndoResultsByMatchId[matchId];
92
+ return;
93
+ }
94
+ draft.lastUndoResultsByMatchId[matchId] = kept;
95
+ }
96
+ function resetMatchModalSearches(draft) {
97
+ draft.matchModal.transactionSearch = exports.initialTransactionSearchState;
98
+ draft.matchModal.accrualSearch = exports.initialAccrualSearchState;
99
+ draft.matchModal.confirmStatus = {
100
+ fetchState: 'Not-Started',
101
+ error: undefined,
102
+ };
103
+ draft.matchModal.lastBatchResults = undefined;
104
+ draft.matchModal.openedFromMatchId = undefined;
105
+ draft.matchModal.didPinPrefillTransactions = false;
106
+ draft.matchModal.pinnedTransactionResults = [];
107
+ }
108
+ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
109
+ name: 'expenseAutomationActualMatchingView',
110
+ initialState: exports.initialState,
111
+ reducers: {
112
+ fetchActualMatchingPage: {
113
+ prepare(period, refreshViewInBackground = false) {
114
+ return {
115
+ payload: {
116
+ period,
117
+ refreshViewInBackground,
118
+ },
119
+ };
120
+ },
121
+ reducer() {
122
+ // Epic-only fan-out.
123
+ },
124
+ },
125
+ fetchActualMatching: {
126
+ reducer(draft, action) {
127
+ const { refreshViewInBackground } = action.payload;
128
+ if (refreshViewInBackground) {
129
+ draft.refreshStatus = { fetchState: 'In-Progress', error: undefined };
130
+ if (draft.fetchState === 'Not-Started') {
131
+ draft.fetchState = 'In-Progress';
132
+ }
133
+ }
134
+ else {
135
+ draft.fetchState = 'In-Progress';
136
+ draft.error = undefined;
137
+ }
138
+ },
139
+ prepare(period, refreshViewInBackground = false) {
140
+ return {
141
+ payload: {
142
+ period,
143
+ refreshViewInBackground,
144
+ },
145
+ };
146
+ },
147
+ },
148
+ fetchActualMatchingSuccess(draft, action) {
149
+ const { matchIds, selectedPeriod, refreshViewInBackground } = action.payload;
150
+ const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
151
+ draft.matchIdsByPeriod[periodId] = matchIds;
152
+ if (refreshViewInBackground) {
153
+ draft.refreshStatus = { fetchState: 'Completed', error: undefined };
154
+ if (draft.fetchState !== 'Completed') {
155
+ draft.fetchState = 'Completed';
156
+ draft.error = undefined;
157
+ }
158
+ }
159
+ else {
160
+ draft.fetchState = 'Completed';
161
+ draft.error = undefined;
162
+ }
163
+ },
164
+ fetchActualMatchingFailure(draft, action) {
165
+ const { status, refreshViewInBackground, selectedPeriod } = action.payload;
166
+ const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
167
+ // Stamp an empty slot so the selector does not remap this month's Error
168
+ // to leftover Not-Started chrome. Do not clobber ids from a prior success.
169
+ if (draft.matchIdsByPeriod[periodId] == null) {
170
+ draft.matchIdsByPeriod[periodId] = [];
171
+ }
172
+ if (refreshViewInBackground) {
173
+ draft.refreshStatus = { fetchState: 'Error', error: status };
174
+ if (draft.fetchState !== 'Completed') {
175
+ draft.fetchState = 'Error';
176
+ draft.error = status;
177
+ }
178
+ }
179
+ else {
180
+ draft.fetchState = 'Error';
181
+ draft.error = status;
182
+ }
183
+ },
184
+ fetchActualMatchingMatch: {
185
+ prepare(matchId, refreshViewInBackground = false) {
186
+ return { payload: { matchId, refreshViewInBackground } };
187
+ },
188
+ reducer(draft, action) {
189
+ const { matchId, refreshViewInBackground } = action.payload;
190
+ if (refreshViewInBackground) {
191
+ draft.detailRefreshStatusByMatchId[matchId] = {
192
+ fetchState: 'In-Progress',
193
+ error: undefined,
194
+ };
195
+ }
196
+ else {
197
+ draft.detailFetchStateByMatchId[matchId] = {
198
+ fetchState: 'In-Progress',
199
+ error: undefined,
200
+ };
201
+ }
202
+ },
203
+ },
204
+ fetchActualMatchingMatchSuccess(draft, action) {
205
+ const { matchId, refreshViewInBackground } = action.payload;
206
+ if (refreshViewInBackground) {
207
+ draft.detailRefreshStatusByMatchId[matchId] = {
208
+ fetchState: 'Completed',
209
+ error: undefined,
210
+ };
211
+ }
212
+ else {
213
+ draft.detailFetchStateByMatchId[matchId] = {
214
+ fetchState: 'Completed',
215
+ error: undefined,
216
+ };
217
+ }
218
+ },
219
+ fetchActualMatchingMatchFailure(draft, action) {
220
+ const { matchId, refreshViewInBackground, status } = action.payload;
221
+ if (refreshViewInBackground) {
222
+ draft.detailRefreshStatusByMatchId[matchId] = {
223
+ fetchState: 'Error',
224
+ error: status,
225
+ };
226
+ }
227
+ else {
228
+ draft.detailFetchStateByMatchId[matchId] = {
229
+ fetchState: 'Error',
230
+ error: status,
231
+ };
232
+ }
233
+ },
234
+ updateActualMatchingUIState(draft, action) {
235
+ if (action.payload.sortKey != null) {
236
+ draft.uiState.sortKey = action.payload.sortKey;
237
+ }
238
+ if (action.payload.sortOrder != null) {
239
+ draft.uiState.sortOrder = action.payload.sortOrder;
240
+ }
241
+ if (action.payload.searchString != null) {
242
+ draft.uiState.searchString = action.payload.searchString;
243
+ }
244
+ if (action.payload.scrollPosition != null) {
245
+ draft.uiState.scrollPosition = action.payload.scrollPosition;
246
+ }
247
+ },
248
+ openMatchNewModal: {
249
+ prepare(matchId) {
250
+ return { payload: { matchId } };
251
+ },
252
+ reducer(draft, action) {
253
+ resetMatchModalSearches(draft);
254
+ draft.matchModal.isOpen = true;
255
+ const matchId = action.payload.matchId;
256
+ draft.matchModal.openedFromMatchId =
257
+ matchId != null && matchId !== '' ? matchId : undefined;
258
+ if (draft.matchModal.openedFromMatchId != null) {
259
+ draft.matchModal.accrualSearch.fetchState = 'Completed';
260
+ }
261
+ },
262
+ },
263
+ // Dismiss (Cancel / overlay). Store reset matches `clearMatchNewModal`;
264
+ // the actions stay distinct so confirm-success vs user-dismiss stay observable.
265
+ closeMatchNewModal(draft) {
266
+ draft.matchModal.isOpen = false;
267
+ resetMatchModalSearches(draft);
268
+ },
269
+ // Confirm-success / host reset. Same slice write as close; different action type.
270
+ clearMatchNewModal(draft) {
271
+ draft.matchModal.isOpen = false;
272
+ resetMatchModalSearches(draft);
273
+ },
274
+ searchMatchTransactions: {
275
+ reducer(draft, action) {
276
+ const { query, pageToken } = action.payload;
277
+ const isLoadMore = pageToken != null;
278
+ draft.matchModal.transactionSearch.query = query;
279
+ if (isLoadMore) {
280
+ draft.matchModal.transactionSearch.isLoadingMore = true;
281
+ }
282
+ else {
283
+ draft.matchModal.transactionSearch.isLoadingMore = false;
284
+ draft.matchModal.transactionSearch.results = [];
285
+ draft.matchModal.transactionSearch.nextPageToken = null;
286
+ draft.matchModal.transactionSearch.fetchState = 'In-Progress';
287
+ draft.matchModal.transactionSearch.error = undefined;
288
+ }
289
+ },
290
+ prepare(query, pageToken, transactionType, transactionIntegrationId) {
291
+ return {
292
+ payload: {
293
+ query,
294
+ pageToken: pageToken ?? undefined,
295
+ transactionType,
296
+ transactionIntegrationId,
297
+ },
298
+ };
299
+ },
300
+ },
301
+ searchMatchTransactionsSuccess(draft, action) {
302
+ const { append, nextPageToken, results } = action.payload;
303
+ if (append) {
304
+ const merged = [
305
+ ...draft.matchModal.transactionSearch.results,
306
+ ...results,
307
+ ];
308
+ const byKey = new Map(merged.map((result) => [
309
+ (0, actualMatchingViewState_1.actualMatchingTransactionLineKey)(result.transactionType, result.transactionIntegrationId, result.lineId),
310
+ result,
311
+ ]));
312
+ draft.matchModal.transactionSearch.results = Array.from(byKey.values());
313
+ }
314
+ else {
315
+ draft.matchModal.transactionSearch.results = results;
316
+ if (draft.matchModal.openedFromMatchId != null &&
317
+ !draft.matchModal.didPinPrefillTransactions) {
318
+ draft.matchModal.didPinPrefillTransactions = true;
319
+ draft.matchModal.pinnedTransactionResults = results;
320
+ }
321
+ }
322
+ draft.matchModal.transactionSearch.nextPageToken = nextPageToken;
323
+ draft.matchModal.transactionSearch.isLoadingMore = false;
324
+ draft.matchModal.transactionSearch.fetchState = 'Completed';
325
+ draft.matchModal.transactionSearch.error = undefined;
326
+ },
327
+ searchMatchTransactionsFailure(draft, action) {
328
+ draft.matchModal.transactionSearch.isLoadingMore = false;
329
+ draft.matchModal.transactionSearch.fetchState = 'Error';
330
+ draft.matchModal.transactionSearch.error = action.payload.error;
331
+ },
332
+ searchMatchAccruals: {
333
+ reducer(draft, action) {
334
+ const { query, pageToken } = action.payload;
335
+ const isLoadMore = pageToken != null;
336
+ draft.matchModal.accrualSearch.query = query;
337
+ if (isLoadMore) {
338
+ draft.matchModal.accrualSearch.isLoadingMore = true;
339
+ }
340
+ else {
341
+ draft.matchModal.accrualSearch.isLoadingMore = false;
342
+ draft.matchModal.accrualSearch.results = [];
343
+ draft.matchModal.accrualSearch.nextPageToken = null;
344
+ draft.matchModal.accrualSearch.fetchState = 'In-Progress';
345
+ draft.matchModal.accrualSearch.error = undefined;
346
+ }
347
+ },
348
+ prepare(query, pageToken) {
349
+ return { payload: { query, pageToken: pageToken ?? undefined } };
350
+ },
351
+ },
352
+ searchMatchAccrualsSuccess(draft, action) {
353
+ const { append, nextPageToken, results } = action.payload;
354
+ const keys = results.map((accrual) => (0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrual._id));
355
+ if (append) {
356
+ const merged = [...draft.matchModal.accrualSearch.results, ...keys];
357
+ draft.matchModal.accrualSearch.results = Array.from(new Set(merged));
358
+ }
359
+ else {
360
+ draft.matchModal.accrualSearch.results = keys;
361
+ }
362
+ draft.matchModal.accrualSearch.nextPageToken = nextPageToken;
363
+ draft.matchModal.accrualSearch.isLoadingMore = false;
364
+ draft.matchModal.accrualSearch.fetchState = 'Completed';
365
+ draft.matchModal.accrualSearch.error = undefined;
366
+ },
367
+ searchMatchAccrualsFailure(draft, action) {
368
+ draft.matchModal.accrualSearch.isLoadingMore = false;
369
+ draft.matchModal.accrualSearch.fetchState = 'Error';
370
+ draft.matchModal.accrualSearch.error = action.payload.error;
371
+ },
372
+ matchAndReverseAccruals: {
373
+ reducer(draft) {
374
+ draft.matchModal.confirmStatus = {
375
+ fetchState: 'In-Progress',
376
+ error: undefined,
377
+ };
378
+ },
379
+ prepare(transactionId, transactionIntegrationId, transactionType, lineIds, transactionSyncToken, accrualIds) {
380
+ return {
381
+ payload: {
382
+ transactionId,
383
+ transactionIntegrationId,
384
+ transactionType,
385
+ lineIds,
386
+ transactionSyncToken,
387
+ accrualIds,
388
+ },
389
+ };
390
+ },
391
+ },
392
+ matchAndReverseAccrualsSuccess(draft, action) {
393
+ const { results } = action.payload;
394
+ const allComplete = results.length > 0 &&
395
+ results.every((result) => (0, actualMatchingViewState_1.isMatchAndReverseCompleteStatus)(result.status));
396
+ draft.matchModal.confirmStatus = allComplete
397
+ ? { fetchState: 'Completed', error: undefined }
398
+ : {
399
+ fetchState: 'Error',
400
+ error: (0, responsePayload_1.createZeniAPIStatus)('Partial match-and-reverse', 'Some accruals were not reversed'),
401
+ };
402
+ draft.matchModal.lastBatchResults = results;
403
+ if (action.payload.matchId != null) {
404
+ draft.lastMatchResultsByMatchId[action.payload.matchId] = results;
405
+ pruneLastUndoResultsForMatched(draft, action.payload.matchId, action.payload.results);
406
+ }
407
+ },
408
+ matchAndReverseAccrualsFailure(draft, action) {
409
+ draft.matchModal.confirmStatus = {
410
+ fetchState: 'Error',
411
+ error: action.payload.status,
412
+ };
413
+ },
414
+ undoReversalAccruals: {
415
+ reducer(draft, action) {
416
+ draft.undoReversalStatusByMatchId[action.payload.matchId] = {
417
+ fetchState: 'In-Progress',
418
+ error: undefined,
419
+ };
420
+ },
421
+ prepare(matchId, accrualIds) {
422
+ return { payload: { matchId, accrualIds } };
423
+ },
424
+ },
425
+ undoReversalAccrualsSuccess: {
426
+ reducer(draft, action) {
427
+ const { matchId, results } = action.payload;
428
+ draft.undoReversalStatusByMatchId[matchId] = {
429
+ fetchState: 'Completed',
430
+ error: undefined,
431
+ };
432
+ const allUndone = results.length > 0 &&
433
+ results.every((result) => result.status === 'undone');
434
+ draft.closeMatchAfterUndo = allUndone;
435
+ pruneLastMatchResultsForUndone(draft, matchId, results);
436
+ if (allUndone) {
437
+ delete draft.lastUndoResultsByMatchId[matchId];
438
+ }
439
+ else {
440
+ draft.lastUndoResultsByMatchId[matchId] = results;
441
+ }
442
+ },
443
+ prepare(matchId, results) {
444
+ return { payload: { matchId, results } };
445
+ },
446
+ },
447
+ ackCloseMatchAfterUndo(draft) {
448
+ draft.closeMatchAfterUndo = false;
449
+ },
450
+ ignoreActualMatchingSuggestion: {
451
+ prepare(matchId, reason, note) {
452
+ return { payload: { matchId, reason, note } };
453
+ },
454
+ reducer(draft, action) {
455
+ draft.ignoreStatusByMatchId[action.payload.matchId] = {
456
+ fetchState: 'In-Progress',
457
+ error: undefined,
458
+ };
459
+ },
460
+ },
461
+ ignoreActualMatchingSuggestionSuccess(draft, action) {
462
+ const { matchId } = action.payload;
463
+ draft.ignoreStatusByMatchId[matchId] = {
464
+ fetchState: 'Completed',
465
+ error: undefined,
466
+ };
467
+ draft.closeMatchAfterIgnoreMatchId = matchId;
468
+ if (draft.matchModal.openedFromMatchId === matchId) {
469
+ draft.matchModal = exports.initialMatchModalState;
470
+ }
471
+ Object.keys(draft.matchIdsByPeriod).forEach((periodId) => {
472
+ draft.matchIdsByPeriod[periodId] = draft.matchIdsByPeriod[periodId].filter((id) => id !== matchId);
473
+ });
474
+ },
475
+ ignoreActualMatchingSuggestionFailure(draft, action) {
476
+ draft.ignoreStatusByMatchId[action.payload.matchId] = {
477
+ fetchState: 'Error',
478
+ error: action.payload.status,
479
+ };
480
+ },
481
+ ackCloseMatchAfterIgnore(draft) {
482
+ draft.closeMatchAfterIgnoreMatchId = undefined;
483
+ },
484
+ undoReversalAccrualsFailure(draft, action) {
485
+ draft.undoReversalStatusByMatchId[action.payload.matchId] = {
486
+ fetchState: 'Error',
487
+ error: action.payload.status,
488
+ };
489
+ },
490
+ clearActualMatchingView(draft) {
491
+ Object.assign(draft, exports.initialState);
492
+ },
493
+ },
494
+ extraReducers: (builder) => {
495
+ builder.addCase(rootActions_1.clearAll, (draft) => {
496
+ Object.assign(draft, exports.initialState);
497
+ });
498
+ },
499
+ });
500
+ _a = expenseAutomationActualMatchingView.actions, exports.ackCloseMatchAfterIgnore = _a.ackCloseMatchAfterIgnore, exports.ackCloseMatchAfterUndo = _a.ackCloseMatchAfterUndo, exports.clearActualMatchingView = _a.clearActualMatchingView, exports.clearMatchNewModal = _a.clearMatchNewModal, exports.closeMatchNewModal = _a.closeMatchNewModal, exports.fetchActualMatching = _a.fetchActualMatching, exports.fetchActualMatchingFailure = _a.fetchActualMatchingFailure, exports.fetchActualMatchingMatch = _a.fetchActualMatchingMatch, exports.fetchActualMatchingMatchFailure = _a.fetchActualMatchingMatchFailure, exports.fetchActualMatchingMatchSuccess = _a.fetchActualMatchingMatchSuccess, exports.fetchActualMatchingPage = _a.fetchActualMatchingPage, exports.fetchActualMatchingSuccess = _a.fetchActualMatchingSuccess, exports.ignoreActualMatchingSuggestion = _a.ignoreActualMatchingSuggestion, exports.ignoreActualMatchingSuggestionFailure = _a.ignoreActualMatchingSuggestionFailure, exports.ignoreActualMatchingSuggestionSuccess = _a.ignoreActualMatchingSuggestionSuccess, exports.matchAndReverseAccruals = _a.matchAndReverseAccruals, exports.matchAndReverseAccrualsFailure = _a.matchAndReverseAccrualsFailure, exports.matchAndReverseAccrualsSuccess = _a.matchAndReverseAccrualsSuccess, exports.openMatchNewModal = _a.openMatchNewModal, exports.searchMatchAccruals = _a.searchMatchAccruals, exports.searchMatchAccrualsFailure = _a.searchMatchAccrualsFailure, exports.searchMatchAccrualsSuccess = _a.searchMatchAccrualsSuccess, exports.searchMatchTransactions = _a.searchMatchTransactions, exports.searchMatchTransactionsFailure = _a.searchMatchTransactionsFailure, exports.searchMatchTransactionsSuccess = _a.searchMatchTransactionsSuccess, exports.undoReversalAccruals = _a.undoReversalAccruals, exports.undoReversalAccrualsFailure = _a.undoReversalAccrualsFailure, exports.undoReversalAccrualsSuccess = _a.undoReversalAccrualsSuccess, exports.updateActualMatchingUIState = _a.updateActualMatchingUIState;
501
+ exports.default = expenseAutomationActualMatchingView.reducer;
@@ -43,17 +43,18 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
43
43
  accrualId: string;
44
44
  reason: "duplicate" | "amount_off" | "wrong_period" | "other_revert" | "not_accrual";
45
45
  note: string | undefined;
46
- }, "expenseAutomationJESchedulesView/revertOneTimeAccrual", never, never>, fetchAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/fetchAccountSettingsListForAccountTypes">, fetchJeSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any, selectedPageTab?: "schedules" | "existing_schedules" | undefined], {
46
+ }, "expenseAutomationJESchedulesView/revertOneTimeAccrual", never, never>, fetchAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/fetchAccountSettingsListForAccountTypes">, fetchJeSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any, selectedPageTab?: "schedules" | "actual_matching" | "existing_schedules" | undefined], {
47
47
  period: TimePeriod;
48
48
  refreshViewInBackground: any;
49
- selectedPageTab: "schedules" | "existing_schedules" | undefined;
49
+ selectedPageTab: "schedules" | "actual_matching" | "existing_schedules" | undefined;
50
50
  }, "expenseAutomationJESchedulesView/fetchJeSchedules", never, never>, fetchJeSchedulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
51
51
  selectedPageTab: JEPageTab;
52
52
  selectedPeriod: MonthYearPeriod;
53
53
  status: ZeniAPIStatus;
54
- }, "expenseAutomationJESchedulesView/fetchJeSchedulesFailure">, fetchJeSchedulesPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
54
+ }, "expenseAutomationJESchedulesView/fetchJeSchedulesFailure">, fetchJeSchedulesPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any, isAccrualEnabled?: any], {
55
55
  period: TimePeriod;
56
56
  refreshViewInBackground: any;
57
+ isAccrualEnabled: any;
57
58
  }, "expenseAutomationJESchedulesView/fetchJeSchedulesPage", never, never>, fetchJeSchedulesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
58
59
  accruedJeSchedules: JEAccruedScheduledTransactionPayload[];
59
60
  failedJeSchedules: JEScheduledTransactionPayload[];
@@ -141,10 +142,10 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
141
142
  }, "expenseAutomationJESchedulesView/updateJeOneTimeAccrualLocalData">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
142
143
  localData: Partial<JEScheduleLocalData>;
143
144
  scheduledJournalEntryID: ID;
144
- }, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[], selectedPeriod: MonthYearPeriod, selectedPageTab: "schedules" | "existing_schedules"], {
145
+ }, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[], selectedPeriod: MonthYearPeriod, selectedPageTab: "schedules" | "actual_matching" | "existing_schedules"], {
145
146
  jeScheduleKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[];
146
147
  selectedPeriod: MonthYearPeriod;
147
- selectedPageTab: "schedules" | "existing_schedules";
148
+ selectedPageTab: "schedules" | "actual_matching" | "existing_schedules";
148
149
  }, "expenseAutomationJESchedulesView/updateJeScheduleTransactionKeys", never, never>, updateNewScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
149
150
  localData: Partial<NewScheduleLocalDataFixedAssets>;
150
151
  scheduleType: "fixed_assets" | "prepaid_expenses";
@@ -111,11 +111,12 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
111
111
  initialState: exports.initialState,
112
112
  reducers: {
113
113
  fetchJeSchedulesPage: {
114
- prepare(period, refreshViewInBackground = false) {
114
+ prepare(period, refreshViewInBackground = false, isAccrualEnabled = false) {
115
115
  return {
116
116
  payload: {
117
117
  period,
118
118
  refreshViewInBackground,
119
+ isAccrualEnabled,
119
120
  },
120
121
  };
121
122
  },
@@ -0,0 +1,88 @@
1
+ import { Amount } from '../../../commonStateTypes/amount';
2
+ import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
3
+ import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
4
+ import { JEOneTimeAccrual } from '../../../entity/jeSchedules/jeSchedulesSelector';
5
+ import { ZeniDate } from '../../../zeniDayJS';
6
+ import { ActualMatchingTransactionSearchResult, ActualMatchingViewUIState, MatchAndReverseResult } from '../types/actualMatchingViewState';
7
+ export type ActualMatchingRowKind = 'auto_reversed' | 'pending_review' | 'manually_reversed';
8
+ export type ActualMatchingGroupedAccrual = {
9
+ accrualId: ID;
10
+ estimatedAmount?: Amount;
11
+ jeDebitAccountName?: string;
12
+ memo?: string;
13
+ serviceMonth?: string;
14
+ };
15
+ export interface ActualMatchingRow extends JEOneTimeAccrual {
16
+ accruedAmount: Amount;
17
+ actualAmount: Amount;
18
+ kind: ActualMatchingRowKind;
19
+ matchId: string;
20
+ groupedAccrualIds?: ID[];
21
+ groupedMembers?: ActualMatchingGroupedAccrual[];
22
+ intendedAccrualIds?: ID[];
23
+ leftovers?: ActualMatchingGroupedAccrual[];
24
+ matchShape?: string;
25
+ matchTier?: string;
26
+ reversalDate?: ZeniDate;
27
+ transactionDate?: string;
28
+ transactionType?: string;
29
+ }
30
+ export interface ActualMatchingKpiSummary {
31
+ actualsReceived: {
32
+ count: number;
33
+ expectedCount: number;
34
+ vendorsPending: number;
35
+ };
36
+ autoReversed: {
37
+ clearedAmount: number;
38
+ count: number;
39
+ percent: number;
40
+ };
41
+ pendingReview: {
42
+ amount: number;
43
+ count: number;
44
+ estimatedMinutesToClear: number;
45
+ };
46
+ variance: {
47
+ averagePercentPerMatch: number;
48
+ netAmount: number;
49
+ percent: number;
50
+ };
51
+ }
52
+ export interface ActualMatchingMatchModalView {
53
+ accrualSearch: {
54
+ fetchState: FetchStateAndError;
55
+ isLoadingMore: boolean;
56
+ nextPageToken: string | null;
57
+ query: string;
58
+ results: JEOneTimeAccrual[];
59
+ };
60
+ confirmStatus: FetchStateAndError;
61
+ isOpen: boolean;
62
+ transactionSearch: {
63
+ fetchState: FetchStateAndError;
64
+ isLoadingMore: boolean;
65
+ nextPageToken: string | null;
66
+ query: string;
67
+ results: ActualMatchingTransactionSearchResult[];
68
+ };
69
+ lastBatchResults?: MatchAndReverseResult[];
70
+ openedFromMatchId?: string;
71
+ prefill?: {
72
+ selectedAccrualIds: ID[];
73
+ actualAmount?: number;
74
+ consumedLineIds?: ID[];
75
+ matchedLineId?: string;
76
+ matchedTransactionId?: string;
77
+ };
78
+ }
79
+ export interface ExpenseAutomationActualMatchingViewSelector extends SelectorView {
80
+ hasLoadedForSelectedPeriod: boolean;
81
+ ignoreStatusByMatchId: Record<string, FetchStateAndError>;
82
+ kpiSummary: ActualMatchingKpiSummary;
83
+ matchModal: ActualMatchingMatchModalView;
84
+ pendingReview: ActualMatchingRow[];
85
+ refreshStatus: FetchStateAndError;
86
+ reversed: ActualMatchingRow[];
87
+ uiState: ActualMatchingViewUIState;
88
+ }
@@ -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,16 @@ export interface ExpenseAutomationStepDetails {
21
22
  title: string;
22
23
  }
23
24
  export interface ExpenseAutomationViewSelector extends SelectorView {
25
+ /**
26
+ * Sibling of `jeSchedules`, not nested under it. The Journal Entries navbar
27
+ * hosts Actual Matching (`selectedPageTab === 'actual_matching'`), but AM is
28
+ * a different GET, entity map (`byMatchId`), and period cache
29
+ * (`matchIdsByPeriod`) than Review / Existing. Nesting it on `jeSchedules`
30
+ * would hide a second store inside the schedules selector. Chrome coupling
31
+ * stays `jeSchedules.uiState.selectedPageTab`; AM rows, Match New, and undo
32
+ * live here.
33
+ */
34
+ actualMatching: ExpenseAutomationActualMatchingViewSelector;
24
35
  allSteps: ExpenseAutomationStepDetails[];
25
36
  completionStatus: CompletionStatusType;
26
37
  currentSelectedView: ExpenseAutomationViewType;