@zeniai/client-epic-state 5.3.14-beta0MM → 5.3.14

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 (27) hide show
  1. package/lib/entity/actualMatching/actualMatchingPayload.d.ts +0 -1
  2. package/lib/entity/actualMatching/actualMatchingPayload.js +0 -3
  3. package/lib/entity/actualMatching/actualMatchingReducer.js +1 -2
  4. package/lib/entity/actualMatching/actualMatchingState.d.ts +0 -1
  5. package/lib/entity/actualMatching/actualMatchingTypes.d.ts +0 -2
  6. package/lib/entity/actualMatching/actualMatchingTypes.js +0 -9
  7. package/lib/esm/entity/actualMatching/actualMatchingPayload.js +0 -3
  8. package/lib/esm/entity/actualMatching/actualMatchingReducer.js +1 -2
  9. package/lib/esm/entity/actualMatching/actualMatchingTypes.js +1 -8
  10. package/lib/esm/index.js +0 -1
  11. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingEpic.js +1 -2
  12. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +2 -8
  13. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +3 -7
  14. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/undoReversalAccrualsEpic.js +7 -12
  15. package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +23 -30
  16. package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +0 -1
  17. package/lib/index.d.ts +0 -1
  18. package/lib/index.js +2 -4
  19. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingEpic.js +1 -2
  20. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +2 -8
  21. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +3 -7
  22. package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/undoReversalAccrualsEpic.js +7 -12
  23. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +3 -9
  24. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +23 -30
  25. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +0 -1
  26. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +0 -1
  27. package/package.json +1 -1
@@ -17,7 +17,6 @@ export interface ActualMatchingMatchPayload {
17
17
  currency_code?: string | null;
18
18
  currency_symbol?: string | null;
19
19
  leftovers?: JEOneTimeAccrualPayload[];
20
- match_batch_id?: string | null;
21
20
  match_shape?: string | null;
22
21
  match_tier?: string | null;
23
22
  transaction_date?: string | null;
@@ -34,9 +34,6 @@ function toActualMatchingMatch(payload, fallbackCurrency) {
34
34
  : currencyCode;
35
35
  return {
36
36
  matchId: payload.match_id,
37
- matchBatchId: payload.match_batch_id != null && payload.match_batch_id !== ''
38
- ? payload.match_batch_id
39
- : undefined,
40
37
  transactionType: (payload.transaction_type || '').toLowerCase(),
41
38
  transactionIntegrationId: payload.transaction_integration_id,
42
39
  transactionDate: payload.transaction_date ?? undefined,
@@ -5,7 +5,6 @@ exports.updateActualMatchingMatches = exports.removeActualMatchingMatch = export
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const rootActions_1 = require("../../rootActions");
7
7
  const actualMatchingPayload_1 = require("./actualMatchingPayload");
8
- const actualMatchingTypes_1 = require("./actualMatchingTypes");
9
8
  exports.initialState = {
10
9
  byMatchId: {},
11
10
  };
@@ -20,7 +19,7 @@ const actualMatching = (0, toolkit_1.createSlice)({
20
19
  reducer(draft, action) {
21
20
  action.payload.matches.forEach((payload) => {
22
21
  const match = (0, actualMatchingPayload_1.toActualMatchingMatch)(payload, action.payload.fallbackCurrency);
23
- draft.byMatchId[(0, actualMatchingTypes_1.actualMatchingRowKey)(match.matchId, match.matchBatchId)] = match;
22
+ draft.byMatchId[match.matchId] = match;
24
23
  });
25
24
  },
26
25
  },
@@ -12,7 +12,6 @@ export interface ActualMatchingMatch {
12
12
  transactionIntegrationId: ID;
13
13
  transactionType: string;
14
14
  leftovers?: JEOneTimeAccrualState[];
15
- matchBatchId?: string;
16
15
  matchShape?: string;
17
16
  matchTier?: string;
18
17
  transactionDate?: string;
@@ -1,3 +1 @@
1
1
  export type ActualMatchingMatchId = string;
2
- /** Store and status key. The route match id stays ``type:id``; the batch is separate. */
3
- export declare function actualMatchingRowKey(matchId: string, matchBatchId?: string | null): string;
@@ -1,11 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.actualMatchingRowKey = actualMatchingRowKey;
4
- /** Store and status key. The route match id stays ``type:id``; the batch is separate. */
5
- function actualMatchingRowKey(matchId, matchBatchId) {
6
- const batch = (matchBatchId ?? '').trim();
7
- if (batch === '') {
8
- return matchId;
9
- }
10
- return `${matchId}\u0000${batch}`;
11
- }
@@ -30,9 +30,6 @@ export function toActualMatchingMatch(payload, fallbackCurrency) {
30
30
  : currencyCode;
31
31
  return {
32
32
  matchId: payload.match_id,
33
- matchBatchId: payload.match_batch_id != null && payload.match_batch_id !== ''
34
- ? payload.match_batch_id
35
- : undefined,
36
33
  transactionType: (payload.transaction_type || '').toLowerCase(),
37
34
  transactionIntegrationId: payload.transaction_integration_id,
38
35
  transactionDate: payload.transaction_date ?? undefined,
@@ -1,7 +1,6 @@
1
1
  import { createSlice } from '@reduxjs/toolkit';
2
2
  import { clearAll } from '../../rootActions';
3
3
  import { toActualMatchingMatch, } from './actualMatchingPayload';
4
- import { actualMatchingRowKey, } from './actualMatchingTypes';
5
4
  export const initialState = {
6
5
  byMatchId: {},
7
6
  };
@@ -16,7 +15,7 @@ const actualMatching = createSlice({
16
15
  reducer(draft, action) {
17
16
  action.payload.matches.forEach((payload) => {
18
17
  const match = toActualMatchingMatch(payload, action.payload.fallbackCurrency);
19
- draft.byMatchId[actualMatchingRowKey(match.matchId, match.matchBatchId)] = match;
18
+ draft.byMatchId[match.matchId] = match;
20
19
  });
21
20
  },
22
21
  },
@@ -1,8 +1 @@
1
- /** Store and status key. The route match id stays ``type:id``; the batch is separate. */
2
- export function actualMatchingRowKey(matchId, matchBatchId) {
3
- const batch = (matchBatchId ?? '').trim();
4
- if (batch === '') {
5
- return matchId;
6
- }
7
- return `${matchId}\u0000${batch}`;
8
- }
1
+ export {};
package/lib/esm/index.js CHANGED
@@ -875,7 +875,6 @@ export { getInvoicingOnboardingGateView } from './view/invoicing/invoicingConfig
875
875
  // narrow a JEScheduleRow before reading baseTransaction / recurringAmount.
876
876
  export { getExpenseAutomationJEOneTimeAccrualDetailView, getJEScheduleRowType, isAccruedScheduleRow, isAiAccountantSchedule, isExistingTabRow, isOneTimeAccrualRow, isRenderableOneTimeAccrual, isPendingReviewRow, } from './view/expenseAutomationView/selectors/jeSchedulesViewSelector';
877
877
  export { getActualMatchingAmount, getActualMatchingReversalDate, getActualMatchingMatchModalConfirmStatus, getCloseMatchAfterIgnoreMatchId, getCloseMatchAfterUndo, getCloseMatchAfterUndoMatchId, parseActualMatchingMatchId, getExpenseAutomationActualMatchingMatchView, getExpenseAutomationActualMatchingView, isAutoReversedAccrual, isManuallyReversedAccrual, isPendingReviewAccrual, } from './view/expenseAutomationView/selectors/actualMatchingViewSelector';
878
- export { actualMatchingRowKey } from './entity/actualMatching/actualMatchingTypes';
879
878
  export { fetchCustomerSummaryDetail, fetchCustomerSummaryList, resetCustomerSummaryDetailUiState, saveCustomerSummaryDetail, updateCustomerAllTransactionsTabData, updateCustomerDetailSelectedTab, updateCustomerSummaryRevenueSelection, updateCustomerSummaryScrollYOffset, updateCustomerSummarySortUiState, updateCustomerTrendFilter, } from './view/customerSummaryView/customerSummaryViewReducer';
880
879
  export { getCustomerSummaryAllTransactionsTabData, getCustomerSummaryDetail, getCustomerSummaryList, getCustomerSummarySelectedTabType, getCustomerSummaryTrendFilter, isCustomersTabVisible, } from './view/customerSummaryView/customerSummaryViewSelector';
881
880
  export { CUSTOMER_REVENUE_KEYS } from './view/customerSummaryView/customerSummaryViewState';
@@ -1,7 +1,6 @@
1
1
  import { from, of } from 'rxjs';
2
2
  import { catchError, filter, mergeMap, switchMap, takeUntil, } from 'rxjs/operators';
3
3
  import { updateActualMatchingMatches } from '../../../../../entity/actualMatching/actualMatchingReducer';
4
- import { actualMatchingRowKey } from '../../../../../entity/actualMatching/actualMatchingTypes';
5
4
  import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
6
5
  import { clearAll } from '../../../../../rootActions';
7
6
  import { toServiceMonthFromPeriod, } from '../../../payload/actualMatchingPayload';
@@ -27,7 +26,7 @@ export const fetchActualMatchingEpic = (actions$, state$, zeniAPI) => actions$.p
27
26
  updateActions.push(updateActualMatchingMatches(matches, getTenantDisplayCurrency(state)));
28
27
  }
29
28
  updateActions.push(fetchActualMatchingSuccess({
30
- matchIds: matches.map((match) => actualMatchingRowKey(match.match_id, match.match_batch_id)),
29
+ matchIds: matches.map((match) => match.match_id),
31
30
  selectedPeriod: requestPeriod,
32
31
  refreshViewInBackground,
33
32
  }));
@@ -6,19 +6,15 @@ import { clearAll } from '../../../../../rootActions';
6
6
  import { fetchActualMatchingMatch, fetchActualMatchingMatchFailure, fetchActualMatchingMatchSuccess, } from '../../../reducers/actualMatchingViewReducer';
7
7
  import { getTenantDisplayCurrency } from '../../../selectors/actualMatchingViewSelector';
8
8
  export const fetchActualMatchingMatchEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchActualMatchingMatch.match), mergeMap((action) => {
9
- const { matchId, matchBatchId, refreshViewInBackground } = action.payload;
10
- const batchQuery = matchBatchId != null && matchBatchId !== ''
11
- ? `?batch_id=${encodeURIComponent(matchBatchId)}`
12
- : '';
9
+ const { matchId, refreshViewInBackground } = action.payload;
13
10
  return zeniAPI
14
- .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/actual-matching/${encodeURIComponent(matchId)}${batchQuery}`)
11
+ .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/actual-matching/${encodeURIComponent(matchId)}`)
15
12
  .pipe(mergeMap((response) => {
16
13
  if (isSuccessResponse(response) && response.data != null) {
17
14
  return from([
18
15
  updateActualMatchingMatches([response.data], getTenantDisplayCurrency(state$.value)),
19
16
  fetchActualMatchingMatchSuccess({
20
17
  matchId,
21
- matchBatchId,
22
18
  refreshViewInBackground,
23
19
  }),
24
20
  ]);
@@ -26,7 +22,6 @@ export const fetchActualMatchingMatchEpic = (actions$, state$, zeniAPI) => actio
26
22
  return from([
27
23
  fetchActualMatchingMatchFailure({
28
24
  matchId,
29
- matchBatchId,
30
25
  refreshViewInBackground,
31
26
  status: response.status,
32
27
  }),
@@ -34,7 +29,6 @@ export const fetchActualMatchingMatchEpic = (actions$, state$, zeniAPI) => actio
34
29
  }), catchError((error) => from([
35
30
  fetchActualMatchingMatchFailure({
36
31
  matchId,
37
- matchBatchId,
38
32
  refreshViewInBackground,
39
33
  status: createZeniAPIStatus('Unexpected Error', `Fetch actual matching match REST API call errored out ${JSON.stringify(error)}`),
40
34
  }),
@@ -56,12 +56,8 @@ function matchAndReverseHttpFailSnackbar(vendorName) {
56
56
  });
57
57
  }
58
58
  function matchVendorName(state, matchId) {
59
- const stored = getActualMatchingMatchById(state.actualMatchingState, matchId);
60
- if (stored?.vendorName != null && stored.vendorName !== '') {
61
- return stored.vendorName;
62
- }
63
- const sameBill = Object.values(state.actualMatchingState.byMatchId).find((match) => match.matchId === matchId);
64
- return sameBill?.vendorName ?? '';
59
+ return (getActualMatchingMatchById(state.actualMatchingState, matchId)
60
+ ?.vendorName ?? '');
65
61
  }
66
62
  export const matchAndReverseAccrualsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(matchAndReverseAccruals.match),
67
63
  // Per-match exhaust: a second click on the same match drops while HTTP is in
@@ -100,7 +96,7 @@ groupBy((action) => `${action.payload.transactionType.toLowerCase()}:${action.pa
100
96
  // List + detail: list can omit leftovers; detail GET always
101
97
  // writes intended occupancy so leftover retry can join C
102
98
  // onto the occupied bill instead of a stale cached row.
103
- successActions.push(...refreshActualMatchingList(state$.value), fetchActualMatchingMatch(matchId, true, response.data.match_batch_id));
99
+ successActions.push(...refreshActualMatchingList(state$.value), fetchActualMatchingMatch(matchId, true));
104
100
  }
105
101
  const snackbar = matchAndReverseSnackbar(results, vendorName);
106
102
  if (snackbar != null) {
@@ -1,7 +1,6 @@
1
1
  import { from, of } from 'rxjs';
2
2
  import { catchError, exhaustMap, filter, groupBy, mergeMap, takeUntil, } from 'rxjs/operators';
3
3
  import { getActualMatchingMatchById } from '../../../../../entity/actualMatching/actualMatchingSelector';
4
- import { actualMatchingRowKey } from '../../../../../entity/actualMatching/actualMatchingTypes';
5
4
  import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
6
5
  import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
7
6
  import { clearAll } from '../../../../../rootActions';
@@ -38,45 +37,41 @@ function undoReversalSnackbar(results, vendorName) {
38
37
  variables,
39
38
  });
40
39
  }
41
- function matchVendorName(state, matchId, matchBatchId) {
42
- const rowKey = actualMatchingRowKey(matchId, matchBatchId);
43
- return (getActualMatchingMatchById(state.actualMatchingState, rowKey)?.vendorName ??
44
- getActualMatchingMatchById(state.actualMatchingState, matchId)?.vendorName ??
40
+ function matchVendorName(state, matchId) {
41
+ return (getActualMatchingMatchById(state.actualMatchingState, matchId)?.vendorName ??
45
42
  '');
46
43
  }
47
44
  export const undoReversalAccrualsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(undoReversalAccruals.match),
48
45
  // Per-match exhaust: a second click on the same match drops while HTTP is in
49
46
  // flight. A different match must still run — a global exhaustMap left the
50
47
  // other match's reducer In-Progress with no request.
51
- groupBy((action) => actualMatchingRowKey(action.payload.matchId, action.payload.matchBatchId)), mergeMap((perMatch$) => perMatch$.pipe(exhaustMap((action) => {
52
- const { accrualIds, matchId, matchBatchId } = action.payload;
48
+ groupBy((action) => action.payload.matchId), mergeMap((perMatch$) => perMatch$.pipe(exhaustMap((action) => {
49
+ const { accrualIds, matchId } = action.payload;
53
50
  const body = {
54
51
  accrual_ids: accrualIds,
55
52
  };
56
- const vendorName = matchVendorName(state$.value, matchId, matchBatchId);
53
+ const vendorName = matchVendorName(state$.value, matchId);
57
54
  return zeniAPI
58
55
  .postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/undo-reversal`, body)
59
56
  .pipe(mergeMap((response) => {
60
57
  if (isSuccessResponse(response) && response.data != null) {
61
58
  const results = response.data.results.map(toUndoReversalResult);
62
59
  const successActions = [
63
- undoReversalAccrualsSuccess(matchId, results, matchBatchId),
60
+ undoReversalAccrualsSuccess(matchId, results),
64
61
  ];
65
62
  const anyUndone = results.some((result) => result.status === 'undone');
66
63
  if (anyUndone) {
67
- successActions.push(...refreshActualMatchingList(state$.value), fetchActualMatchingMatch(matchId, true, matchBatchId));
64
+ successActions.push(...refreshActualMatchingList(state$.value), fetchActualMatchingMatch(matchId, true));
68
65
  }
69
66
  successActions.push(undoReversalSnackbar(results, vendorName));
70
67
  return from(successActions);
71
68
  }
72
69
  return of(undoReversalAccrualsFailure({
73
70
  matchId,
74
- matchBatchId,
75
71
  status: response.status,
76
72
  }), undoReversalSnackbar([], vendorName));
77
73
  }), catchError((error) => of(undoReversalAccrualsFailure({
78
74
  matchId,
79
- matchBatchId,
80
75
  status: createZeniAPIStatus('Unexpected Error', 'Undo reversal accruals REST API call errored out' +
81
76
  JSON.stringify(error)),
82
77
  }), undoReversalSnackbar([], vendorName))), takeUntil(actions$.pipe(filter(clearAll.match))));
@@ -1,6 +1,5 @@
1
1
  import { createSlice } from '@reduxjs/toolkit';
2
2
  import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
3
- import { actualMatchingRowKey } from '../../../entity/actualMatching/actualMatchingTypes';
4
3
  import { generateJEOneTimeAccrualKey } from '../../../entity/jeSchedules/jeScheduleHelper';
5
4
  import { createZeniAPIStatus } from '../../../responsePayload';
6
5
  import { clearAll } from '../../../rootActions';
@@ -184,20 +183,19 @@ const expenseAutomationActualMatchingView = createSlice({
184
183
  }
185
184
  },
186
185
  fetchActualMatchingMatch: {
187
- prepare(matchId, refreshViewInBackground = false, matchBatchId) {
188
- return { payload: { matchId, matchBatchId, refreshViewInBackground } };
186
+ prepare(matchId, refreshViewInBackground = false) {
187
+ return { payload: { matchId, refreshViewInBackground } };
189
188
  },
190
189
  reducer(draft, action) {
191
- const { matchId, matchBatchId, refreshViewInBackground } = action.payload;
192
- const rowKey = actualMatchingRowKey(matchId, matchBatchId);
190
+ const { matchId, refreshViewInBackground } = action.payload;
193
191
  if (refreshViewInBackground) {
194
- draft.detailRefreshStatusByMatchId[rowKey] = {
192
+ draft.detailRefreshStatusByMatchId[matchId] = {
195
193
  fetchState: 'In-Progress',
196
194
  error: undefined,
197
195
  };
198
196
  }
199
197
  else {
200
- draft.detailFetchStateByMatchId[rowKey] = {
198
+ draft.detailFetchStateByMatchId[matchId] = {
201
199
  fetchState: 'In-Progress',
202
200
  error: undefined,
203
201
  };
@@ -205,32 +203,30 @@ const expenseAutomationActualMatchingView = createSlice({
205
203
  },
206
204
  },
207
205
  fetchActualMatchingMatchSuccess(draft, action) {
208
- const { matchId, matchBatchId, refreshViewInBackground } = action.payload;
209
- const rowKey = actualMatchingRowKey(matchId, matchBatchId);
206
+ const { matchId, refreshViewInBackground } = action.payload;
210
207
  if (refreshViewInBackground) {
211
- draft.detailRefreshStatusByMatchId[rowKey] = {
208
+ draft.detailRefreshStatusByMatchId[matchId] = {
212
209
  fetchState: 'Completed',
213
210
  error: undefined,
214
211
  };
215
212
  }
216
213
  else {
217
- draft.detailFetchStateByMatchId[rowKey] = {
214
+ draft.detailFetchStateByMatchId[matchId] = {
218
215
  fetchState: 'Completed',
219
216
  error: undefined,
220
217
  };
221
218
  }
222
219
  },
223
220
  fetchActualMatchingMatchFailure(draft, action) {
224
- const { matchId, matchBatchId, refreshViewInBackground, status } = action.payload;
225
- const rowKey = actualMatchingRowKey(matchId, matchBatchId);
221
+ const { matchId, refreshViewInBackground, status } = action.payload;
226
222
  if (refreshViewInBackground) {
227
- draft.detailRefreshStatusByMatchId[rowKey] = {
223
+ draft.detailRefreshStatusByMatchId[matchId] = {
228
224
  fetchState: 'Error',
229
225
  error: status,
230
226
  };
231
227
  }
232
228
  else {
233
- draft.detailFetchStateByMatchId[rowKey] = {
229
+ draft.detailFetchStateByMatchId[matchId] = {
234
230
  fetchState: 'Error',
235
231
  error: status,
236
232
  };
@@ -421,42 +417,40 @@ const expenseAutomationActualMatchingView = createSlice({
421
417
  },
422
418
  undoReversalAccruals: {
423
419
  reducer(draft, action) {
424
- const rowKey = actualMatchingRowKey(action.payload.matchId, action.payload.matchBatchId);
425
- draft.undoReversalStatusByMatchId[rowKey] = {
420
+ draft.undoReversalStatusByMatchId[action.payload.matchId] = {
426
421
  fetchState: 'In-Progress',
427
422
  error: undefined,
428
423
  };
429
424
  },
430
- prepare(matchId, accrualIds, matchBatchId) {
431
- return { payload: { matchId, accrualIds, matchBatchId } };
425
+ prepare(matchId, accrualIds) {
426
+ return { payload: { matchId, accrualIds } };
432
427
  },
433
428
  },
434
429
  undoReversalAccrualsSuccess: {
435
430
  reducer(draft, action) {
436
- const { matchId, matchBatchId, results } = action.payload;
437
- const rowKey = actualMatchingRowKey(matchId, matchBatchId);
438
- draft.undoReversalStatusByMatchId[rowKey] = {
431
+ const { matchId, results } = action.payload;
432
+ draft.undoReversalStatusByMatchId[matchId] = {
439
433
  fetchState: 'Completed',
440
434
  error: undefined,
441
435
  };
442
436
  const allUndone = results.length > 0 &&
443
437
  results.every((result) => result.status === 'undone');
444
438
  if (allUndone) {
445
- enqueueCloseMatchId(draft.closeMatchAfterUndoMatchIds, rowKey);
439
+ enqueueCloseMatchId(draft.closeMatchAfterUndoMatchIds, matchId);
446
440
  }
447
441
  else {
448
- draft.closeMatchAfterUndoMatchIds = dropCloseMatchId(draft.closeMatchAfterUndoMatchIds, rowKey);
442
+ draft.closeMatchAfterUndoMatchIds = dropCloseMatchId(draft.closeMatchAfterUndoMatchIds, matchId);
449
443
  }
450
444
  pruneLastMatchResultsForUndone(draft, matchId, results);
451
445
  if (allUndone) {
452
- delete draft.lastUndoResultsByMatchId[rowKey];
446
+ delete draft.lastUndoResultsByMatchId[matchId];
453
447
  }
454
448
  else {
455
- draft.lastUndoResultsByMatchId[rowKey] = results;
449
+ draft.lastUndoResultsByMatchId[matchId] = results;
456
450
  }
457
451
  },
458
- prepare(matchId, results, matchBatchId) {
459
- return { payload: { matchId, results, matchBatchId } };
452
+ prepare(matchId, results) {
453
+ return { payload: { matchId, results } };
460
454
  },
461
455
  },
462
456
  ackCloseMatchAfterUndo(draft) {
@@ -500,8 +494,7 @@ const expenseAutomationActualMatchingView = createSlice({
500
494
  draft.closeMatchAfterIgnoreMatchIds.shift();
501
495
  },
502
496
  undoReversalAccrualsFailure(draft, action) {
503
- const rowKey = actualMatchingRowKey(action.payload.matchId, action.payload.matchBatchId);
504
- draft.undoReversalStatusByMatchId[rowKey] = {
497
+ draft.undoReversalStatusByMatchId[action.payload.matchId] = {
505
498
  fetchState: 'Error',
506
499
  error: action.payload.status,
507
500
  };
@@ -131,7 +131,6 @@ function toActualMatchingRow(match) {
131
131
  return {
132
132
  ...first,
133
133
  matchId: match.matchId,
134
- matchBatchId: match.matchBatchId,
135
134
  kind: match.kind,
136
135
  accruedAmount: match.accruedAmount,
137
136
  actualAmount: match.actualAmount,
package/lib/index.d.ts CHANGED
@@ -1274,7 +1274,6 @@ export type { ExpenseAutomationActualMatchingMatchView } from './view/expenseAut
1274
1274
  export type { ActualMatchingMatch, ActualMatchingMatchKind, } from './entity/actualMatching/actualMatchingState';
1275
1275
  export type { ActualMatchingMatchId } from './entity/actualMatching/actualMatchingTypes';
1276
1276
  export type { SessionEndpointsLoader } from './sessionEndpointsLoader';
1277
- export { actualMatchingRowKey } from './entity/actualMatching/actualMatchingTypes';
1278
1277
  export type { DisplayCurrencyFallback } from './entity/actualMatching/actualMatchingPayload';
1279
1278
  export { fetchCustomerSummaryDetail, fetchCustomerSummaryList, resetCustomerSummaryDetailUiState, saveCustomerSummaryDetail, updateCustomerAllTransactionsTabData, updateCustomerDetailSelectedTab, updateCustomerSummaryRevenueSelection, updateCustomerSummaryScrollYOffset, updateCustomerSummarySortUiState, updateCustomerTrendFilter, } from './view/customerSummaryView/customerSummaryViewReducer';
1280
1279
  export { getCustomerSummaryAllTransactionsTabData, getCustomerSummaryDetail, getCustomerSummaryList, getCustomerSummarySelectedTabType, getCustomerSummaryTrendFilter, isCustomersTabVisible, } from './view/customerSummaryView/customerSummaryViewSelector';
package/lib/index.js CHANGED
@@ -86,8 +86,8 @@ exports.startInvoicingMigration = exports.rollbackInvoicingMigration = exports.r
86
86
  exports.updateInvoicingTransactionFilters = exports.setInvoicingTransactionActiveTab = exports.fetchInvoicingTransactionListPage = exports.fetchInvoicingTransactionList = exports.updateInvoicingTransactions = exports.removeInvoicingTransaction = exports.getInvoicingSubscriptionById = exports.fetchInvoicingSubscriptionDetailPage = exports.fetchInvoicingSubscriptionDetail = exports.getInvoicingSubscriptionListView = exports.INVOICING_SUBSCRIPTION_COLUMNS = exports.ALL_INVOICING_SUBSCRIPTION_TAB_IDS = exports.ALL_INVOICING_SUBSCRIPTION_SORT_KEYS = exports.updateInvoicingSubscriptionFilters = exports.setInvoicingSubscriptionActiveTab = exports.fetchInvoicingSubscriptionListPage = exports.fetchInvoicingSubscriptionList = exports.fetchInvoicingSubscriptionCounts = exports.updateInvoicingSubscriptions = exports.removeInvoicingSubscription = exports.resetPromotionalCreditAction = exports.submitAddPromotionalCredits = exports.getInvoicingSetupIntentFetchState = exports.getInvoicingSetupIntent = exports.getInvoicingSentPaymentLinkMagicUrl = exports.getInvoicingSentPaymentLinkEmail = exports.getInvoicingPlaidLinkToken = exports.getInvoicingPaymentMethodSaveState = exports.getInvoicingPaymentLinkSendState = exports.sendInvoicingPaymentLink = exports.saveInvoicingPaymentMethod = exports.resetInvoicingCustomerPaymentMethod = exports.fetchInvoicingPlaidLinkToken = exports.createInvoicingSetupIntent = exports.fetchInvoicingPaymentLinkEmailPreviewPage = exports.fetchInvoicingCustomerDetailPage = exports.fetchInvoicingCustomerDetail = exports.getInvoicingCustomerListView = exports.INVOICING_CUSTOMER_COLUMNS = exports.ALL_INVOICING_CUSTOMER_TAB_IDS = exports.ALL_INVOICING_CUSTOMER_SORT_KEYS = exports.updateInvoicingCustomerFilters = exports.setInvoicingCustomerActiveTab = exports.fetchInvoicingCustomerListPage = exports.fetchInvoicingCustomerList = exports.fetchInvoicingCustomerCounts = exports.updateInvoicingCustomers = exports.removeInvoicingCustomer = exports.INVOICING_LIST_PAGE_SIZE = exports.uploadInvoicingMigrationFiles = void 0;
87
87
  exports.INVOICING_DUNNING_CASE_COLUMNS = exports.ALL_INVOICING_DUNNING_CASE_TAB_IDS = exports.ALL_INVOICING_DUNNING_CASE_SORT_KEYS = exports.updateInvoicingDunningCaseFilters = exports.setInvoicingDunningCaseActiveTab = exports.fetchInvoicingDunningCaseListPage = exports.fetchInvoicingDunningCaseList = exports.fetchInvoicingDunningCaseCounts = exports.updateInvoicingDunningCases = exports.removeInvoicingDunningCase = exports.fetchInvoicingCouponDetail = exports.getInvoicingCouponById = exports.getInvoicingCouponListView = exports.getInvoicingCouponListNextCursor = exports.getInvoicingCouponListItems = exports.getInvoicingCouponListHasMore = exports.getInvoicingCouponListFilters = exports.getInvoicingCouponListFetchState = exports.getInvoicingCouponCounts = exports.INVOICING_COUPON_COLUMNS = exports.ALL_INVOICING_COUPON_TAB_IDS = exports.ALL_INVOICING_COUPON_SORT_KEYS = exports.updateInvoicingCouponFilters = exports.setInvoicingCouponActiveTab = exports.fetchInvoicingCouponListPage = exports.fetchInvoicingCouponList = exports.fetchInvoicingCouponCounts = exports.updateInvoicingCoupons = exports.removeInvoicingCoupon = exports.getInvoicingCreditNoteDetail = exports.getInvoicingCreditNoteById = exports.fetchInvoicingCreditNoteDetail = exports.getInvoicingCreditNoteListView = exports.INVOICING_CREDIT_NOTE_COLUMNS = exports.ALL_INVOICING_CREDIT_NOTE_TAB_IDS = exports.ALL_INVOICING_CREDIT_NOTE_SORT_KEYS = exports.updateInvoicingCreditNoteFilters = exports.setInvoicingCreditNoteActiveTab = exports.fetchInvoicingCreditNoteListPage = exports.fetchInvoicingCreditNoteList = exports.fetchInvoicingCreditNoteCounts = exports.updateInvoicingCreditNotes = exports.removeInvoicingCreditNote = exports.getInvoicingTransactionDetail = exports.getInvoicingTransactionById = exports.fetchInvoicingTransactionDetail = exports.getInvoicingTransactionListView = exports.INVOICING_TRANSACTION_COLUMNS = exports.ALL_INVOICING_TRANSACTION_TAB_IDS = exports.ALL_INVOICING_TRANSACTION_SORT_KEYS = void 0;
88
88
  exports.fetchInvoicingQboSyncHealth = exports.fetchInvoicingQboConnection = exports.fetchInvoicingAccountingPickers = exports.isStripeConnectedFromSettings = exports.initialInvoicingBrandingFormLocalData = exports.entityToInvoicingBrandingFormLocalData = exports.INVOICING_BUSINESS_ADDRESS_TYPE = exports.invoicingQboSettingsLocalDataToPayload = exports.initialInvoicingQboSettingsLocalData = exports.entityToInvoicingQboSettingsLocalData = exports.getInvoicingSettingsView = exports.getInvoicingSettingsHubView = exports.getInvoicingSettingsFetchState = exports.getInvoicingSettings = exports.getInvoicingQboSettingsFormView = exports.getInvoicingBrandingFormView = exports.updateInvoicingSettings = exports.updateInvoicingQboSettingsDraft = exports.updateInvoicingBrandingFormDraft = exports.submitInvoicingQboSettings = exports.submitInvoicingBrandingForm = exports.saveInvoicingSettings = exports.resetSaveInvoicingSettings = exports.resetInvoicingQboSettingsDraft = exports.resetInvoicingBrandingFormDraft = exports.fetchInvoicingSettings = exports.disconnectInvoicingStripe = exports.connectInvoicingStripe = exports.getLowestInvoicingCatalogPricePointAmount = exports.getInvoicingCatalogItemById = exports.fetchInvoicingCatalogItemDetail = exports.getInvoicingCatalogListView = exports.updateInvoicingCatalogProductFilters = exports.updateInvoicingCatalogPlanFilters = exports.fetchInvoicingCatalogProductList = exports.fetchInvoicingCatalogPlanList = exports.fetchInvoicingCatalogListPage = exports.fetchInvoicingCatalogCounts = exports.updateInvoicingCatalogItems = exports.removeInvoicingCatalogItem = exports.mergeInvoicingCatalogPricePoint = exports.getInvoicingDunningEmailPreview = exports.getInvoicingDunningCaseDetail = exports.getInvoicingDunningCaseById = exports.invalidateInvoicingDunningEmailPreview = exports.fetchInvoicingDunningEmailPreviewPage = exports.fetchInvoicingDunningCaseDetailPage = exports.fetchInvoicingDunningCaseDetail = exports.clearInvoicingDunningCaseDetailView = exports.getInvoicingDunningCaseListView = void 0;
89
- exports.getCustomerSummarySelectedTabType = exports.getCustomerSummaryList = exports.getCustomerSummaryDetail = exports.getCustomerSummaryAllTransactionsTabData = exports.updateCustomerTrendFilter = exports.updateCustomerSummarySortUiState = exports.updateCustomerSummaryScrollYOffset = exports.updateCustomerSummaryRevenueSelection = exports.updateCustomerDetailSelectedTab = exports.updateCustomerAllTransactionsTabData = exports.saveCustomerSummaryDetail = exports.resetCustomerSummaryDetailUiState = exports.fetchCustomerSummaryList = exports.fetchCustomerSummaryDetail = exports.actualMatchingRowKey = exports.isPendingReviewAccrual = exports.isManuallyReversedAccrual = exports.isAutoReversedAccrual = exports.getExpenseAutomationActualMatchingView = exports.getExpenseAutomationActualMatchingMatchView = exports.parseActualMatchingMatchId = exports.getCloseMatchAfterUndoMatchId = exports.getCloseMatchAfterUndo = exports.getCloseMatchAfterIgnoreMatchId = exports.getActualMatchingMatchModalConfirmStatus = exports.getActualMatchingReversalDate = exports.getActualMatchingAmount = exports.isPendingReviewRow = exports.isRenderableOneTimeAccrual = exports.isOneTimeAccrualRow = exports.isExistingTabRow = exports.isAiAccountantSchedule = exports.isAccruedScheduleRow = exports.getJEScheduleRowType = exports.getExpenseAutomationJEOneTimeAccrualDetailView = exports.getInvoicingOnboardingGateView = exports.getInvoicingConfigView = exports.updateInvoicingConfig = exports.resetInvoicingConfigActionStates = exports.fetchInvoicingConfig = exports.enableInvoicing = exports.acceptInvoicingTerms = exports.toInvoicingQboCustomerMatchingMode = exports.toInvoicingNamedOptionsByKey = exports.getInvoicingQboAccountMappingId = exports.INVOICING_QBO_CUSTOMER_MATCHING_MODES = exports.getInvoicingQboView = exports.invoicingAccountsForQboAccountTypes = exports.startInvoicingQboBackfill = exports.retryInvoicingQboSyncTask = void 0;
90
- exports.CUSTOMER_REVENUE_KEYS = exports.isCustomersTabVisible = exports.getCustomerSummaryTrendFilter = void 0;
89
+ exports.getCustomerSummaryTrendFilter = exports.getCustomerSummarySelectedTabType = exports.getCustomerSummaryList = exports.getCustomerSummaryDetail = exports.getCustomerSummaryAllTransactionsTabData = exports.updateCustomerTrendFilter = exports.updateCustomerSummarySortUiState = exports.updateCustomerSummaryScrollYOffset = exports.updateCustomerSummaryRevenueSelection = exports.updateCustomerDetailSelectedTab = exports.updateCustomerAllTransactionsTabData = exports.saveCustomerSummaryDetail = exports.resetCustomerSummaryDetailUiState = exports.fetchCustomerSummaryList = exports.fetchCustomerSummaryDetail = exports.isPendingReviewAccrual = exports.isManuallyReversedAccrual = exports.isAutoReversedAccrual = exports.getExpenseAutomationActualMatchingView = exports.getExpenseAutomationActualMatchingMatchView = exports.parseActualMatchingMatchId = exports.getCloseMatchAfterUndoMatchId = exports.getCloseMatchAfterUndo = exports.getCloseMatchAfterIgnoreMatchId = exports.getActualMatchingMatchModalConfirmStatus = exports.getActualMatchingReversalDate = exports.getActualMatchingAmount = exports.isPendingReviewRow = exports.isRenderableOneTimeAccrual = exports.isOneTimeAccrualRow = exports.isExistingTabRow = exports.isAiAccountantSchedule = exports.isAccruedScheduleRow = exports.getJEScheduleRowType = exports.getExpenseAutomationJEOneTimeAccrualDetailView = exports.getInvoicingOnboardingGateView = exports.getInvoicingConfigView = exports.updateInvoicingConfig = exports.resetInvoicingConfigActionStates = exports.fetchInvoicingConfig = exports.enableInvoicing = exports.acceptInvoicingTerms = exports.toInvoicingQboCustomerMatchingMode = exports.toInvoicingNamedOptionsByKey = exports.getInvoicingQboAccountMappingId = exports.INVOICING_QBO_CUSTOMER_MATCHING_MODES = exports.getInvoicingQboView = exports.invoicingAccountsForQboAccountTypes = exports.startInvoicingQboBackfill = exports.retryInvoicingQboSyncTask = void 0;
90
+ exports.CUSTOMER_REVENUE_KEYS = exports.isCustomersTabVisible = void 0;
91
91
  const allowedValue_1 = require("./commonStateTypes/allowedValue");
92
92
  Object.defineProperty(exports, "isAllowedValueWithCode", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithCode; } });
93
93
  Object.defineProperty(exports, "isAllowedValueWithID", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithID; } });
@@ -3297,8 +3297,6 @@ Object.defineProperty(exports, "getExpenseAutomationActualMatchingView", { enume
3297
3297
  Object.defineProperty(exports, "isAutoReversedAccrual", { enumerable: true, get: function () { return actualMatchingViewSelector_1.isAutoReversedAccrual; } });
3298
3298
  Object.defineProperty(exports, "isManuallyReversedAccrual", { enumerable: true, get: function () { return actualMatchingViewSelector_1.isManuallyReversedAccrual; } });
3299
3299
  Object.defineProperty(exports, "isPendingReviewAccrual", { enumerable: true, get: function () { return actualMatchingViewSelector_1.isPendingReviewAccrual; } });
3300
- var actualMatchingTypes_1 = require("./entity/actualMatching/actualMatchingTypes");
3301
- Object.defineProperty(exports, "actualMatchingRowKey", { enumerable: true, get: function () { return actualMatchingTypes_1.actualMatchingRowKey; } });
3302
3300
  var customerSummaryViewReducer_1 = require("./view/customerSummaryView/customerSummaryViewReducer");
3303
3301
  Object.defineProperty(exports, "fetchCustomerSummaryDetail", { enumerable: true, get: function () { return customerSummaryViewReducer_1.fetchCustomerSummaryDetail; } });
3304
3302
  Object.defineProperty(exports, "fetchCustomerSummaryList", { enumerable: true, get: function () { return customerSummaryViewReducer_1.fetchCustomerSummaryList; } });
@@ -4,7 +4,6 @@ exports.fetchActualMatchingEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const actualMatchingReducer_1 = require("../../../../../entity/actualMatching/actualMatchingReducer");
7
- const actualMatchingTypes_1 = require("../../../../../entity/actualMatching/actualMatchingTypes");
8
7
  const responsePayload_1 = require("../../../../../responsePayload");
9
8
  const rootActions_1 = require("../../../../../rootActions");
10
9
  const actualMatchingPayload_1 = require("../../../payload/actualMatchingPayload");
@@ -30,7 +29,7 @@ const fetchActualMatchingEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
30
29
  updateActions.push((0, actualMatchingReducer_1.updateActualMatchingMatches)(matches, (0, actualMatchingViewSelector_1.getTenantDisplayCurrency)(state)));
31
30
  }
32
31
  updateActions.push((0, actualMatchingViewReducer_1.fetchActualMatchingSuccess)({
33
- matchIds: matches.map((match) => (0, actualMatchingTypes_1.actualMatchingRowKey)(match.match_id, match.match_batch_id)),
32
+ matchIds: matches.map((match) => match.match_id),
34
33
  selectedPeriod: requestPeriod,
35
34
  refreshViewInBackground,
36
35
  }));
@@ -9,19 +9,15 @@ const rootActions_1 = require("../../../../../rootActions");
9
9
  const actualMatchingViewReducer_1 = require("../../../reducers/actualMatchingViewReducer");
10
10
  const actualMatchingViewSelector_1 = require("../../../selectors/actualMatchingViewSelector");
11
11
  const fetchActualMatchingMatchEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(actualMatchingViewReducer_1.fetchActualMatchingMatch.match), (0, operators_1.mergeMap)((action) => {
12
- const { matchId, matchBatchId, refreshViewInBackground } = action.payload;
13
- const batchQuery = matchBatchId != null && matchBatchId !== ''
14
- ? `?batch_id=${encodeURIComponent(matchBatchId)}`
15
- : '';
12
+ const { matchId, refreshViewInBackground } = action.payload;
16
13
  return zeniAPI
17
- .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/actual-matching/${encodeURIComponent(matchId)}${batchQuery}`)
14
+ .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/actual-matching/${encodeURIComponent(matchId)}`)
18
15
  .pipe((0, operators_1.mergeMap)((response) => {
19
16
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
20
17
  return (0, rxjs_1.from)([
21
18
  (0, actualMatchingReducer_1.updateActualMatchingMatches)([response.data], (0, actualMatchingViewSelector_1.getTenantDisplayCurrency)(state$.value)),
22
19
  (0, actualMatchingViewReducer_1.fetchActualMatchingMatchSuccess)({
23
20
  matchId,
24
- matchBatchId,
25
21
  refreshViewInBackground,
26
22
  }),
27
23
  ]);
@@ -29,7 +25,6 @@ const fetchActualMatchingMatchEpic = (actions$, state$, zeniAPI) => actions$.pip
29
25
  return (0, rxjs_1.from)([
30
26
  (0, actualMatchingViewReducer_1.fetchActualMatchingMatchFailure)({
31
27
  matchId,
32
- matchBatchId,
33
28
  refreshViewInBackground,
34
29
  status: response.status,
35
30
  }),
@@ -37,7 +32,6 @@ const fetchActualMatchingMatchEpic = (actions$, state$, zeniAPI) => actions$.pip
37
32
  }), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
38
33
  (0, actualMatchingViewReducer_1.fetchActualMatchingMatchFailure)({
39
34
  matchId,
40
- matchBatchId,
41
35
  refreshViewInBackground,
42
36
  status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Fetch actual matching match REST API call errored out ${JSON.stringify(error)}`),
43
37
  }),
@@ -59,12 +59,8 @@ function matchAndReverseHttpFailSnackbar(vendorName) {
59
59
  });
60
60
  }
61
61
  function matchVendorName(state, matchId) {
62
- const stored = (0, actualMatchingSelector_1.getActualMatchingMatchById)(state.actualMatchingState, matchId);
63
- if (stored?.vendorName != null && stored.vendorName !== '') {
64
- return stored.vendorName;
65
- }
66
- const sameBill = Object.values(state.actualMatchingState.byMatchId).find((match) => match.matchId === matchId);
67
- return sameBill?.vendorName ?? '';
62
+ return ((0, actualMatchingSelector_1.getActualMatchingMatchById)(state.actualMatchingState, matchId)
63
+ ?.vendorName ?? '');
68
64
  }
69
65
  const matchAndReverseAccrualsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(actualMatchingViewReducer_1.matchAndReverseAccruals.match),
70
66
  // Per-match exhaust: a second click on the same match drops while HTTP is in
@@ -103,7 +99,7 @@ const matchAndReverseAccrualsEpic = (actions$, state$, zeniAPI) => actions$.pipe
103
99
  // List + detail: list can omit leftovers; detail GET always
104
100
  // writes intended occupancy so leftover retry can join C
105
101
  // onto the occupied bill instead of a stale cached row.
106
- successActions.push(...(0, refreshActualMatchingList_1.refreshActualMatchingList)(state$.value), (0, actualMatchingViewReducer_1.fetchActualMatchingMatch)(matchId, true, response.data.match_batch_id));
102
+ successActions.push(...(0, refreshActualMatchingList_1.refreshActualMatchingList)(state$.value), (0, actualMatchingViewReducer_1.fetchActualMatchingMatch)(matchId, true));
107
103
  }
108
104
  const snackbar = matchAndReverseSnackbar(results, vendorName);
109
105
  if (snackbar != null) {
@@ -4,7 +4,6 @@ exports.undoReversalAccrualsEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const actualMatchingSelector_1 = require("../../../../../entity/actualMatching/actualMatchingSelector");
7
- const actualMatchingTypes_1 = require("../../../../../entity/actualMatching/actualMatchingTypes");
8
7
  const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
9
8
  const responsePayload_1 = require("../../../../../responsePayload");
10
9
  const rootActions_1 = require("../../../../../rootActions");
@@ -41,45 +40,41 @@ function undoReversalSnackbar(results, vendorName) {
41
40
  variables,
42
41
  });
43
42
  }
44
- function matchVendorName(state, matchId, matchBatchId) {
45
- const rowKey = (0, actualMatchingTypes_1.actualMatchingRowKey)(matchId, matchBatchId);
46
- return ((0, actualMatchingSelector_1.getActualMatchingMatchById)(state.actualMatchingState, rowKey)?.vendorName ??
47
- (0, actualMatchingSelector_1.getActualMatchingMatchById)(state.actualMatchingState, matchId)?.vendorName ??
43
+ function matchVendorName(state, matchId) {
44
+ return ((0, actualMatchingSelector_1.getActualMatchingMatchById)(state.actualMatchingState, matchId)?.vendorName ??
48
45
  '');
49
46
  }
50
47
  const undoReversalAccrualsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(actualMatchingViewReducer_1.undoReversalAccruals.match),
51
48
  // Per-match exhaust: a second click on the same match drops while HTTP is in
52
49
  // flight. A different match must still run — a global exhaustMap left the
53
50
  // other match's reducer In-Progress with no request.
54
- (0, operators_1.groupBy)((action) => (0, actualMatchingTypes_1.actualMatchingRowKey)(action.payload.matchId, action.payload.matchBatchId)), (0, operators_1.mergeMap)((perMatch$) => perMatch$.pipe((0, operators_1.exhaustMap)((action) => {
55
- const { accrualIds, matchId, matchBatchId } = action.payload;
51
+ (0, operators_1.groupBy)((action) => action.payload.matchId), (0, operators_1.mergeMap)((perMatch$) => perMatch$.pipe((0, operators_1.exhaustMap)((action) => {
52
+ const { accrualIds, matchId } = action.payload;
56
53
  const body = {
57
54
  accrual_ids: accrualIds,
58
55
  };
59
- const vendorName = matchVendorName(state$.value, matchId, matchBatchId);
56
+ const vendorName = matchVendorName(state$.value, matchId);
60
57
  return zeniAPI
61
58
  .postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/undo-reversal`, body)
62
59
  .pipe((0, operators_1.mergeMap)((response) => {
63
60
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
64
61
  const results = response.data.results.map(actualMatchingPayload_1.toUndoReversalResult);
65
62
  const successActions = [
66
- (0, actualMatchingViewReducer_1.undoReversalAccrualsSuccess)(matchId, results, matchBatchId),
63
+ (0, actualMatchingViewReducer_1.undoReversalAccrualsSuccess)(matchId, results),
67
64
  ];
68
65
  const anyUndone = results.some((result) => result.status === 'undone');
69
66
  if (anyUndone) {
70
- successActions.push(...(0, refreshActualMatchingList_1.refreshActualMatchingList)(state$.value), (0, actualMatchingViewReducer_1.fetchActualMatchingMatch)(matchId, true, matchBatchId));
67
+ successActions.push(...(0, refreshActualMatchingList_1.refreshActualMatchingList)(state$.value), (0, actualMatchingViewReducer_1.fetchActualMatchingMatch)(matchId, true));
71
68
  }
72
69
  successActions.push(undoReversalSnackbar(results, vendorName));
73
70
  return (0, rxjs_1.from)(successActions);
74
71
  }
75
72
  return (0, rxjs_1.of)((0, actualMatchingViewReducer_1.undoReversalAccrualsFailure)({
76
73
  matchId,
77
- matchBatchId,
78
74
  status: response.status,
79
75
  }), undoReversalSnackbar([], vendorName));
80
76
  }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, actualMatchingViewReducer_1.undoReversalAccrualsFailure)({
81
77
  matchId,
82
- matchBatchId,
83
78
  status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Undo reversal accruals REST API call errored out' +
84
79
  JSON.stringify(error)),
85
80
  }), undoReversalSnackbar([], vendorName))), (0, operators_1.takeUntil)(actions$.pipe((0, operators_1.filter)(rootActions_1.clearAll.match))));
@@ -14,19 +14,16 @@ export declare const ackCloseMatchAfterIgnore: import("@reduxjs/toolkit").Action
14
14
  refreshViewInBackground: boolean;
15
15
  selectedPeriod: MonthYearPeriod;
16
16
  status: ZeniAPIStatus;
17
- }, "expenseAutomationActualMatchingView/fetchActualMatchingFailure">, fetchActualMatchingMatch: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[matchId: string, refreshViewInBackground?: any, matchBatchId?: string | undefined], {
17
+ }, "expenseAutomationActualMatchingView/fetchActualMatchingFailure">, fetchActualMatchingMatch: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[matchId: string, refreshViewInBackground?: any], {
18
18
  matchId: string;
19
- matchBatchId: string | undefined;
20
19
  refreshViewInBackground: any;
21
20
  }, "expenseAutomationActualMatchingView/fetchActualMatchingMatch", never, never>, fetchActualMatchingMatchFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
22
21
  matchId: ActualMatchingMatchId;
23
22
  refreshViewInBackground: boolean;
24
23
  status: ZeniAPIStatus;
25
- matchBatchId?: string;
26
24
  }, "expenseAutomationActualMatchingView/fetchActualMatchingMatchFailure">, fetchActualMatchingMatchSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
27
25
  matchId: ActualMatchingMatchId;
28
26
  refreshViewInBackground: boolean;
29
- matchBatchId?: string;
30
27
  }, "expenseAutomationActualMatchingView/fetchActualMatchingMatchSuccess">, fetchActualMatchingPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
31
28
  period: TimePeriod;
32
29
  refreshViewInBackground: any;
@@ -79,18 +76,15 @@ export declare const ackCloseMatchAfterIgnore: import("@reduxjs/toolkit").Action
79
76
  append: boolean;
80
77
  nextPageToken: string | null;
81
78
  results: ActualMatchingTransactionSearchResult[];
82
- }, "expenseAutomationActualMatchingView/searchMatchTransactionsSuccess">, undoReversalAccruals: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[matchId: string, accrualIds: string[], matchBatchId?: string | undefined], {
79
+ }, "expenseAutomationActualMatchingView/searchMatchTransactionsSuccess">, undoReversalAccruals: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[matchId: string, accrualIds: string[]], {
83
80
  matchId: string;
84
81
  accrualIds: string[];
85
- matchBatchId: string | undefined;
86
82
  }, "expenseAutomationActualMatchingView/undoReversalAccruals", never, never>, undoReversalAccrualsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
87
83
  matchId: ActualMatchingMatchId;
88
84
  status: ZeniAPIStatus;
89
- matchBatchId?: string;
90
- }, "expenseAutomationActualMatchingView/undoReversalAccrualsFailure">, undoReversalAccrualsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[matchId: string, results: UndoReversalResult[], matchBatchId?: string | undefined], {
85
+ }, "expenseAutomationActualMatchingView/undoReversalAccrualsFailure">, undoReversalAccrualsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[matchId: string, results: UndoReversalResult[]], {
91
86
  matchId: string;
92
87
  results: UndoReversalResult[];
93
- matchBatchId: string | undefined;
94
88
  }, "expenseAutomationActualMatchingView/undoReversalAccrualsSuccess", never, never>, updateActualMatchingUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<ActualMatchingViewUIState>, "expenseAutomationActualMatchingView/updateActualMatchingUIState">;
95
89
  declare const _default: import("redux").Reducer<ActualMatchingViewState>;
96
90
  export default _default;
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
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
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
7
- const actualMatchingTypes_1 = require("../../../entity/actualMatching/actualMatchingTypes");
8
7
  const jeScheduleHelper_1 = require("../../../entity/jeSchedules/jeScheduleHelper");
9
8
  const responsePayload_1 = require("../../../responsePayload");
10
9
  const rootActions_1 = require("../../../rootActions");
@@ -188,20 +187,19 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
188
187
  }
189
188
  },
190
189
  fetchActualMatchingMatch: {
191
- prepare(matchId, refreshViewInBackground = false, matchBatchId) {
192
- return { payload: { matchId, matchBatchId, refreshViewInBackground } };
190
+ prepare(matchId, refreshViewInBackground = false) {
191
+ return { payload: { matchId, refreshViewInBackground } };
193
192
  },
194
193
  reducer(draft, action) {
195
- const { matchId, matchBatchId, refreshViewInBackground } = action.payload;
196
- const rowKey = (0, actualMatchingTypes_1.actualMatchingRowKey)(matchId, matchBatchId);
194
+ const { matchId, refreshViewInBackground } = action.payload;
197
195
  if (refreshViewInBackground) {
198
- draft.detailRefreshStatusByMatchId[rowKey] = {
196
+ draft.detailRefreshStatusByMatchId[matchId] = {
199
197
  fetchState: 'In-Progress',
200
198
  error: undefined,
201
199
  };
202
200
  }
203
201
  else {
204
- draft.detailFetchStateByMatchId[rowKey] = {
202
+ draft.detailFetchStateByMatchId[matchId] = {
205
203
  fetchState: 'In-Progress',
206
204
  error: undefined,
207
205
  };
@@ -209,32 +207,30 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
209
207
  },
210
208
  },
211
209
  fetchActualMatchingMatchSuccess(draft, action) {
212
- const { matchId, matchBatchId, refreshViewInBackground } = action.payload;
213
- const rowKey = (0, actualMatchingTypes_1.actualMatchingRowKey)(matchId, matchBatchId);
210
+ const { matchId, refreshViewInBackground } = action.payload;
214
211
  if (refreshViewInBackground) {
215
- draft.detailRefreshStatusByMatchId[rowKey] = {
212
+ draft.detailRefreshStatusByMatchId[matchId] = {
216
213
  fetchState: 'Completed',
217
214
  error: undefined,
218
215
  };
219
216
  }
220
217
  else {
221
- draft.detailFetchStateByMatchId[rowKey] = {
218
+ draft.detailFetchStateByMatchId[matchId] = {
222
219
  fetchState: 'Completed',
223
220
  error: undefined,
224
221
  };
225
222
  }
226
223
  },
227
224
  fetchActualMatchingMatchFailure(draft, action) {
228
- const { matchId, matchBatchId, refreshViewInBackground, status } = action.payload;
229
- const rowKey = (0, actualMatchingTypes_1.actualMatchingRowKey)(matchId, matchBatchId);
225
+ const { matchId, refreshViewInBackground, status } = action.payload;
230
226
  if (refreshViewInBackground) {
231
- draft.detailRefreshStatusByMatchId[rowKey] = {
227
+ draft.detailRefreshStatusByMatchId[matchId] = {
232
228
  fetchState: 'Error',
233
229
  error: status,
234
230
  };
235
231
  }
236
232
  else {
237
- draft.detailFetchStateByMatchId[rowKey] = {
233
+ draft.detailFetchStateByMatchId[matchId] = {
238
234
  fetchState: 'Error',
239
235
  error: status,
240
236
  };
@@ -425,42 +421,40 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
425
421
  },
426
422
  undoReversalAccruals: {
427
423
  reducer(draft, action) {
428
- const rowKey = (0, actualMatchingTypes_1.actualMatchingRowKey)(action.payload.matchId, action.payload.matchBatchId);
429
- draft.undoReversalStatusByMatchId[rowKey] = {
424
+ draft.undoReversalStatusByMatchId[action.payload.matchId] = {
430
425
  fetchState: 'In-Progress',
431
426
  error: undefined,
432
427
  };
433
428
  },
434
- prepare(matchId, accrualIds, matchBatchId) {
435
- return { payload: { matchId, accrualIds, matchBatchId } };
429
+ prepare(matchId, accrualIds) {
430
+ return { payload: { matchId, accrualIds } };
436
431
  },
437
432
  },
438
433
  undoReversalAccrualsSuccess: {
439
434
  reducer(draft, action) {
440
- const { matchId, matchBatchId, results } = action.payload;
441
- const rowKey = (0, actualMatchingTypes_1.actualMatchingRowKey)(matchId, matchBatchId);
442
- draft.undoReversalStatusByMatchId[rowKey] = {
435
+ const { matchId, results } = action.payload;
436
+ draft.undoReversalStatusByMatchId[matchId] = {
443
437
  fetchState: 'Completed',
444
438
  error: undefined,
445
439
  };
446
440
  const allUndone = results.length > 0 &&
447
441
  results.every((result) => result.status === 'undone');
448
442
  if (allUndone) {
449
- enqueueCloseMatchId(draft.closeMatchAfterUndoMatchIds, rowKey);
443
+ enqueueCloseMatchId(draft.closeMatchAfterUndoMatchIds, matchId);
450
444
  }
451
445
  else {
452
- draft.closeMatchAfterUndoMatchIds = dropCloseMatchId(draft.closeMatchAfterUndoMatchIds, rowKey);
446
+ draft.closeMatchAfterUndoMatchIds = dropCloseMatchId(draft.closeMatchAfterUndoMatchIds, matchId);
453
447
  }
454
448
  pruneLastMatchResultsForUndone(draft, matchId, results);
455
449
  if (allUndone) {
456
- delete draft.lastUndoResultsByMatchId[rowKey];
450
+ delete draft.lastUndoResultsByMatchId[matchId];
457
451
  }
458
452
  else {
459
- draft.lastUndoResultsByMatchId[rowKey] = results;
453
+ draft.lastUndoResultsByMatchId[matchId] = results;
460
454
  }
461
455
  },
462
- prepare(matchId, results, matchBatchId) {
463
- return { payload: { matchId, results, matchBatchId } };
456
+ prepare(matchId, results) {
457
+ return { payload: { matchId, results } };
464
458
  },
465
459
  },
466
460
  ackCloseMatchAfterUndo(draft) {
@@ -504,8 +498,7 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
504
498
  draft.closeMatchAfterIgnoreMatchIds.shift();
505
499
  },
506
500
  undoReversalAccrualsFailure(draft, action) {
507
- const rowKey = (0, actualMatchingTypes_1.actualMatchingRowKey)(action.payload.matchId, action.payload.matchBatchId);
508
- draft.undoReversalStatusByMatchId[rowKey] = {
501
+ draft.undoReversalStatusByMatchId[action.payload.matchId] = {
509
502
  fetchState: 'Error',
510
503
  error: action.payload.status,
511
504
  };
@@ -23,7 +23,6 @@ export interface ActualMatchingRow extends JEOneTimeAccrual {
23
23
  groupedMembers?: ActualMatchingGroupedAccrual[];
24
24
  intendedAccrualIds?: ID[];
25
25
  leftovers?: ActualMatchingLeftoverAccrual[];
26
- matchBatchId?: string;
27
26
  matchShape?: string;
28
27
  matchTier?: string;
29
28
  reversalDate?: ZeniDate;
@@ -153,7 +153,6 @@ function toActualMatchingRow(match) {
153
153
  return {
154
154
  ...first,
155
155
  matchId: match.matchId,
156
- matchBatchId: match.matchBatchId,
157
156
  kind: match.kind,
158
157
  accruedAmount: match.accruedAmount,
159
158
  actualAmount: match.actualAmount,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.3.14-beta0MM",
3
+ "version": "5.3.14",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",