@zeniai/client-epic-state 5.3.14-beta1MM → 5.3.15

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 -2
  2. package/lib/entity/actualMatching/actualMatchingPayload.js +0 -6
  3. package/lib/entity/actualMatching/actualMatchingReducer.js +1 -2
  4. package/lib/entity/actualMatching/actualMatchingState.d.ts +0 -2
  5. package/lib/entity/actualMatching/actualMatchingTypes.d.ts +0 -6
  6. package/lib/entity/actualMatching/actualMatchingTypes.js +0 -17
  7. package/lib/esm/entity/actualMatching/actualMatchingPayload.js +0 -6
  8. package/lib/esm/entity/actualMatching/actualMatchingReducer.js +1 -2
  9. package/lib/esm/entity/actualMatching/actualMatchingTypes.js +1 -16
  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 -17
  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 -32
  16. package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +0 -2
  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 -17
  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 -12
  24. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +23 -32
  25. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +0 -2
  26. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +0 -2
  27. package/package.json +1 -1
@@ -17,10 +17,8 @@ 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
- suggestion_key?: string | null;
24
22
  transaction_date?: string | null;
25
23
  vendor_id?: ID | null;
26
24
  vendor_name?: string | null;
@@ -34,12 +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
- suggestionKey: payload.suggestion_key != null && payload.suggestion_key !== ''
41
- ? payload.suggestion_key
42
- : undefined,
43
37
  transactionType: (payload.transaction_type || '').toLowerCase(),
44
38
  transactionIntegrationId: payload.transaction_integration_id,
45
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.suggestionKey)] = match;
22
+ draft.byMatchId[match.matchId] = match;
24
23
  });
25
24
  },
26
25
  },
@@ -12,10 +12,8 @@ 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
- suggestionKey?: string;
19
17
  transactionDate?: string;
20
18
  vendorId?: ID;
21
19
  vendorName?: string;
@@ -1,7 +1 @@
1
1
  export type ActualMatchingMatchId = string;
2
- /** Store and status key. The route match id stays ``type:id``.
3
-
4
- The second part is the cleared ``match_batch_id`` when one exists, otherwise the
5
- pending suggestion's ``suggestion_key``.
6
- */
7
- export declare function actualMatchingRowKey(matchId: string, matchBatchId?: string | null, suggestionKey?: string | null): string;
@@ -1,19 +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``.
5
-
6
- The second part is the cleared ``match_batch_id`` when one exists, otherwise the
7
- pending suggestion's ``suggestion_key``.
8
- */
9
- function actualMatchingRowKey(matchId, matchBatchId, suggestionKey) {
10
- const batch = (matchBatchId ?? '').trim();
11
- if (batch !== '') {
12
- return `${matchId}\u0000${batch}`;
13
- }
14
- const suggestion = (suggestionKey ?? '').trim();
15
- if (suggestion === '') {
16
- return matchId;
17
- }
18
- return `${matchId}\u0000${suggestion}`;
19
- }
@@ -30,12 +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
- suggestionKey: payload.suggestion_key != null && payload.suggestion_key !== ''
37
- ? payload.suggestion_key
38
- : undefined,
39
33
  transactionType: (payload.transaction_type || '').toLowerCase(),
40
34
  transactionIntegrationId: payload.transaction_integration_id,
41
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.suggestionKey)] = match;
18
+ draft.byMatchId[match.matchId] = match;
20
19
  });
21
20
  },
22
21
  },
@@ -1,16 +1 @@
1
- /** Store and status key. The route match id stays ``type:id``.
2
-
3
- The second part is the cleared ``match_batch_id`` when one exists, otherwise the
4
- pending suggestion's ``suggestion_key``.
5
- */
6
- export function actualMatchingRowKey(matchId, matchBatchId, suggestionKey) {
7
- const batch = (matchBatchId ?? '').trim();
8
- if (batch !== '') {
9
- return `${matchId}\u0000${batch}`;
10
- }
11
- const suggestion = (suggestionKey ?? '').trim();
12
- if (suggestion === '') {
13
- return matchId;
14
- }
15
- return `${matchId}\u0000${suggestion}`;
16
- }
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, match.suggestion_key)),
29
+ matchIds: matches.map((match) => match.match_id),
31
30
  selectedPeriod: requestPeriod,
32
31
  refreshViewInBackground,
33
32
  }));
@@ -6,44 +6,29 @@ 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 { suggestionKey, matchBatchId, matchId, refreshViewInBackground } = action.payload;
10
- const detailQuery = new URLSearchParams();
11
- if (matchBatchId != null && matchBatchId !== '') {
12
- detailQuery.set('batch_id', matchBatchId);
13
- }
14
- else if (suggestionKey != null && suggestionKey !== '') {
15
- detailQuery.set('suggestion_key', suggestionKey);
16
- }
17
- const encodedQuery = detailQuery.toString();
18
- const batchQuery = encodedQuery === '' ? '' : `?${encodedQuery}`;
9
+ const { matchId, refreshViewInBackground } = action.payload;
19
10
  return zeniAPI
20
- .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/actual-matching/${encodeURIComponent(matchId)}${batchQuery}`)
11
+ .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/actual-matching/${encodeURIComponent(matchId)}`)
21
12
  .pipe(mergeMap((response) => {
22
13
  if (isSuccessResponse(response) && response.data != null) {
23
14
  return from([
24
15
  updateActualMatchingMatches([response.data], getTenantDisplayCurrency(state$.value)),
25
16
  fetchActualMatchingMatchSuccess({
26
- suggestionKey,
27
17
  matchId,
28
- matchBatchId,
29
18
  refreshViewInBackground,
30
19
  }),
31
20
  ]);
32
21
  }
33
22
  return from([
34
23
  fetchActualMatchingMatchFailure({
35
- suggestionKey,
36
24
  matchId,
37
- matchBatchId,
38
25
  refreshViewInBackground,
39
26
  status: response.status,
40
27
  }),
41
28
  ]);
42
29
  }), catchError((error) => from([
43
30
  fetchActualMatchingMatchFailure({
44
- suggestionKey,
45
31
  matchId,
46
- matchBatchId,
47
32
  refreshViewInBackground,
48
33
  status: createZeniAPIStatus('Unexpected Error', `Fetch actual matching match REST API call errored out ${JSON.stringify(error)}`),
49
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,22 +183,19 @@ const expenseAutomationActualMatchingView = createSlice({
184
183
  }
185
184
  },
186
185
  fetchActualMatchingMatch: {
187
- prepare(matchId, refreshViewInBackground = false, matchBatchId, suggestionKey) {
188
- return {
189
- payload: { suggestionKey, matchBatchId, matchId, refreshViewInBackground },
190
- };
186
+ prepare(matchId, refreshViewInBackground = false) {
187
+ return { payload: { matchId, refreshViewInBackground } };
191
188
  },
192
189
  reducer(draft, action) {
193
- const { suggestionKey, matchBatchId, matchId, refreshViewInBackground } = action.payload;
194
- const rowKey = actualMatchingRowKey(matchId, matchBatchId, suggestionKey);
190
+ const { matchId, refreshViewInBackground } = action.payload;
195
191
  if (refreshViewInBackground) {
196
- draft.detailRefreshStatusByMatchId[rowKey] = {
192
+ draft.detailRefreshStatusByMatchId[matchId] = {
197
193
  fetchState: 'In-Progress',
198
194
  error: undefined,
199
195
  };
200
196
  }
201
197
  else {
202
- draft.detailFetchStateByMatchId[rowKey] = {
198
+ draft.detailFetchStateByMatchId[matchId] = {
203
199
  fetchState: 'In-Progress',
204
200
  error: undefined,
205
201
  };
@@ -207,32 +203,30 @@ const expenseAutomationActualMatchingView = createSlice({
207
203
  },
208
204
  },
209
205
  fetchActualMatchingMatchSuccess(draft, action) {
210
- const { suggestionKey, matchBatchId, matchId, refreshViewInBackground } = action.payload;
211
- const rowKey = actualMatchingRowKey(matchId, matchBatchId, suggestionKey);
206
+ const { matchId, refreshViewInBackground } = action.payload;
212
207
  if (refreshViewInBackground) {
213
- draft.detailRefreshStatusByMatchId[rowKey] = {
208
+ draft.detailRefreshStatusByMatchId[matchId] = {
214
209
  fetchState: 'Completed',
215
210
  error: undefined,
216
211
  };
217
212
  }
218
213
  else {
219
- draft.detailFetchStateByMatchId[rowKey] = {
214
+ draft.detailFetchStateByMatchId[matchId] = {
220
215
  fetchState: 'Completed',
221
216
  error: undefined,
222
217
  };
223
218
  }
224
219
  },
225
220
  fetchActualMatchingMatchFailure(draft, action) {
226
- const { suggestionKey, matchBatchId, matchId, refreshViewInBackground, status } = action.payload;
227
- const rowKey = actualMatchingRowKey(matchId, matchBatchId, suggestionKey);
221
+ const { matchId, refreshViewInBackground, status } = action.payload;
228
222
  if (refreshViewInBackground) {
229
- draft.detailRefreshStatusByMatchId[rowKey] = {
223
+ draft.detailRefreshStatusByMatchId[matchId] = {
230
224
  fetchState: 'Error',
231
225
  error: status,
232
226
  };
233
227
  }
234
228
  else {
235
- draft.detailFetchStateByMatchId[rowKey] = {
229
+ draft.detailFetchStateByMatchId[matchId] = {
236
230
  fetchState: 'Error',
237
231
  error: status,
238
232
  };
@@ -423,42 +417,40 @@ const expenseAutomationActualMatchingView = createSlice({
423
417
  },
424
418
  undoReversalAccruals: {
425
419
  reducer(draft, action) {
426
- const rowKey = actualMatchingRowKey(action.payload.matchId, action.payload.matchBatchId);
427
- draft.undoReversalStatusByMatchId[rowKey] = {
420
+ draft.undoReversalStatusByMatchId[action.payload.matchId] = {
428
421
  fetchState: 'In-Progress',
429
422
  error: undefined,
430
423
  };
431
424
  },
432
- prepare(matchId, accrualIds, matchBatchId) {
433
- return { payload: { matchId, accrualIds, matchBatchId } };
425
+ prepare(matchId, accrualIds) {
426
+ return { payload: { matchId, accrualIds } };
434
427
  },
435
428
  },
436
429
  undoReversalAccrualsSuccess: {
437
430
  reducer(draft, action) {
438
- const { matchId, matchBatchId, results } = action.payload;
439
- const rowKey = actualMatchingRowKey(matchId, matchBatchId);
440
- draft.undoReversalStatusByMatchId[rowKey] = {
431
+ const { matchId, results } = action.payload;
432
+ draft.undoReversalStatusByMatchId[matchId] = {
441
433
  fetchState: 'Completed',
442
434
  error: undefined,
443
435
  };
444
436
  const allUndone = results.length > 0 &&
445
437
  results.every((result) => result.status === 'undone');
446
438
  if (allUndone) {
447
- enqueueCloseMatchId(draft.closeMatchAfterUndoMatchIds, rowKey);
439
+ enqueueCloseMatchId(draft.closeMatchAfterUndoMatchIds, matchId);
448
440
  }
449
441
  else {
450
- draft.closeMatchAfterUndoMatchIds = dropCloseMatchId(draft.closeMatchAfterUndoMatchIds, rowKey);
442
+ draft.closeMatchAfterUndoMatchIds = dropCloseMatchId(draft.closeMatchAfterUndoMatchIds, matchId);
451
443
  }
452
444
  pruneLastMatchResultsForUndone(draft, matchId, results);
453
445
  if (allUndone) {
454
- delete draft.lastUndoResultsByMatchId[rowKey];
446
+ delete draft.lastUndoResultsByMatchId[matchId];
455
447
  }
456
448
  else {
457
- draft.lastUndoResultsByMatchId[rowKey] = results;
449
+ draft.lastUndoResultsByMatchId[matchId] = results;
458
450
  }
459
451
  },
460
- prepare(matchId, results, matchBatchId) {
461
- return { payload: { matchId, results, matchBatchId } };
452
+ prepare(matchId, results) {
453
+ return { payload: { matchId, results } };
462
454
  },
463
455
  },
464
456
  ackCloseMatchAfterUndo(draft) {
@@ -502,8 +494,7 @@ const expenseAutomationActualMatchingView = createSlice({
502
494
  draft.closeMatchAfterIgnoreMatchIds.shift();
503
495
  },
504
496
  undoReversalAccrualsFailure(draft, action) {
505
- const rowKey = actualMatchingRowKey(action.payload.matchId, action.payload.matchBatchId);
506
- draft.undoReversalStatusByMatchId[rowKey] = {
497
+ draft.undoReversalStatusByMatchId[action.payload.matchId] = {
507
498
  fetchState: 'Error',
508
499
  error: action.payload.status,
509
500
  };
@@ -130,9 +130,7 @@ function toActualMatchingRow(match) {
130
130
  ];
131
131
  return {
132
132
  ...first,
133
- suggestionKey: match.suggestionKey,
134
133
  matchId: match.matchId,
135
- matchBatchId: match.matchBatchId,
136
134
  kind: match.kind,
137
135
  accruedAmount: match.accruedAmount,
138
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, match.suggestion_key)),
32
+ matchIds: matches.map((match) => match.match_id),
34
33
  selectedPeriod: requestPeriod,
35
34
  refreshViewInBackground,
36
35
  }));
@@ -9,44 +9,29 @@ 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 { suggestionKey, matchBatchId, matchId, refreshViewInBackground } = action.payload;
13
- const detailQuery = new URLSearchParams();
14
- if (matchBatchId != null && matchBatchId !== '') {
15
- detailQuery.set('batch_id', matchBatchId);
16
- }
17
- else if (suggestionKey != null && suggestionKey !== '') {
18
- detailQuery.set('suggestion_key', suggestionKey);
19
- }
20
- const encodedQuery = detailQuery.toString();
21
- const batchQuery = encodedQuery === '' ? '' : `?${encodedQuery}`;
12
+ const { matchId, refreshViewInBackground } = action.payload;
22
13
  return zeniAPI
23
- .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/actual-matching/${encodeURIComponent(matchId)}${batchQuery}`)
14
+ .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/actual-matching/${encodeURIComponent(matchId)}`)
24
15
  .pipe((0, operators_1.mergeMap)((response) => {
25
16
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
26
17
  return (0, rxjs_1.from)([
27
18
  (0, actualMatchingReducer_1.updateActualMatchingMatches)([response.data], (0, actualMatchingViewSelector_1.getTenantDisplayCurrency)(state$.value)),
28
19
  (0, actualMatchingViewReducer_1.fetchActualMatchingMatchSuccess)({
29
- suggestionKey,
30
20
  matchId,
31
- matchBatchId,
32
21
  refreshViewInBackground,
33
22
  }),
34
23
  ]);
35
24
  }
36
25
  return (0, rxjs_1.from)([
37
26
  (0, actualMatchingViewReducer_1.fetchActualMatchingMatchFailure)({
38
- suggestionKey,
39
27
  matchId,
40
- matchBatchId,
41
28
  refreshViewInBackground,
42
29
  status: response.status,
43
30
  }),
44
31
  ]);
45
32
  }), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
46
33
  (0, actualMatchingViewReducer_1.fetchActualMatchingMatchFailure)({
47
- suggestionKey,
48
34
  matchId,
49
- matchBatchId,
50
35
  refreshViewInBackground,
51
36
  status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Fetch actual matching match REST API call errored out ${JSON.stringify(error)}`),
52
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,22 +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, suggestionKey?: string | undefined], {
18
- suggestionKey: string | undefined;
19
- matchBatchId: string | undefined;
17
+ }, "expenseAutomationActualMatchingView/fetchActualMatchingFailure">, fetchActualMatchingMatch: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[matchId: string, refreshViewInBackground?: any], {
20
18
  matchId: string;
21
19
  refreshViewInBackground: any;
22
20
  }, "expenseAutomationActualMatchingView/fetchActualMatchingMatch", never, never>, fetchActualMatchingMatchFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
23
21
  matchId: ActualMatchingMatchId;
24
22
  refreshViewInBackground: boolean;
25
23
  status: ZeniAPIStatus;
26
- matchBatchId?: string;
27
- suggestionKey?: string;
28
24
  }, "expenseAutomationActualMatchingView/fetchActualMatchingMatchFailure">, fetchActualMatchingMatchSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
29
25
  matchId: ActualMatchingMatchId;
30
26
  refreshViewInBackground: boolean;
31
- matchBatchId?: string;
32
- suggestionKey?: string;
33
27
  }, "expenseAutomationActualMatchingView/fetchActualMatchingMatchSuccess">, fetchActualMatchingPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
34
28
  period: TimePeriod;
35
29
  refreshViewInBackground: any;
@@ -82,18 +76,15 @@ export declare const ackCloseMatchAfterIgnore: import("@reduxjs/toolkit").Action
82
76
  append: boolean;
83
77
  nextPageToken: string | null;
84
78
  results: ActualMatchingTransactionSearchResult[];
85
- }, "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[]], {
86
80
  matchId: string;
87
81
  accrualIds: string[];
88
- matchBatchId: string | undefined;
89
82
  }, "expenseAutomationActualMatchingView/undoReversalAccruals", never, never>, undoReversalAccrualsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
90
83
  matchId: ActualMatchingMatchId;
91
84
  status: ZeniAPIStatus;
92
- matchBatchId?: string;
93
- }, "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[]], {
94
86
  matchId: string;
95
87
  results: UndoReversalResult[];
96
- matchBatchId: string | undefined;
97
88
  }, "expenseAutomationActualMatchingView/undoReversalAccrualsSuccess", never, never>, updateActualMatchingUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<ActualMatchingViewUIState>, "expenseAutomationActualMatchingView/updateActualMatchingUIState">;
98
89
  declare const _default: import("redux").Reducer<ActualMatchingViewState>;
99
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,22 +187,19 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
188
187
  }
189
188
  },
190
189
  fetchActualMatchingMatch: {
191
- prepare(matchId, refreshViewInBackground = false, matchBatchId, suggestionKey) {
192
- return {
193
- payload: { suggestionKey, matchBatchId, matchId, refreshViewInBackground },
194
- };
190
+ prepare(matchId, refreshViewInBackground = false) {
191
+ return { payload: { matchId, refreshViewInBackground } };
195
192
  },
196
193
  reducer(draft, action) {
197
- const { suggestionKey, matchBatchId, matchId, refreshViewInBackground } = action.payload;
198
- const rowKey = (0, actualMatchingTypes_1.actualMatchingRowKey)(matchId, matchBatchId, suggestionKey);
194
+ const { matchId, refreshViewInBackground } = action.payload;
199
195
  if (refreshViewInBackground) {
200
- draft.detailRefreshStatusByMatchId[rowKey] = {
196
+ draft.detailRefreshStatusByMatchId[matchId] = {
201
197
  fetchState: 'In-Progress',
202
198
  error: undefined,
203
199
  };
204
200
  }
205
201
  else {
206
- draft.detailFetchStateByMatchId[rowKey] = {
202
+ draft.detailFetchStateByMatchId[matchId] = {
207
203
  fetchState: 'In-Progress',
208
204
  error: undefined,
209
205
  };
@@ -211,32 +207,30 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
211
207
  },
212
208
  },
213
209
  fetchActualMatchingMatchSuccess(draft, action) {
214
- const { suggestionKey, matchBatchId, matchId, refreshViewInBackground } = action.payload;
215
- const rowKey = (0, actualMatchingTypes_1.actualMatchingRowKey)(matchId, matchBatchId, suggestionKey);
210
+ const { matchId, refreshViewInBackground } = action.payload;
216
211
  if (refreshViewInBackground) {
217
- draft.detailRefreshStatusByMatchId[rowKey] = {
212
+ draft.detailRefreshStatusByMatchId[matchId] = {
218
213
  fetchState: 'Completed',
219
214
  error: undefined,
220
215
  };
221
216
  }
222
217
  else {
223
- draft.detailFetchStateByMatchId[rowKey] = {
218
+ draft.detailFetchStateByMatchId[matchId] = {
224
219
  fetchState: 'Completed',
225
220
  error: undefined,
226
221
  };
227
222
  }
228
223
  },
229
224
  fetchActualMatchingMatchFailure(draft, action) {
230
- const { suggestionKey, matchBatchId, matchId, refreshViewInBackground, status } = action.payload;
231
- const rowKey = (0, actualMatchingTypes_1.actualMatchingRowKey)(matchId, matchBatchId, suggestionKey);
225
+ const { matchId, refreshViewInBackground, status } = action.payload;
232
226
  if (refreshViewInBackground) {
233
- draft.detailRefreshStatusByMatchId[rowKey] = {
227
+ draft.detailRefreshStatusByMatchId[matchId] = {
234
228
  fetchState: 'Error',
235
229
  error: status,
236
230
  };
237
231
  }
238
232
  else {
239
- draft.detailFetchStateByMatchId[rowKey] = {
233
+ draft.detailFetchStateByMatchId[matchId] = {
240
234
  fetchState: 'Error',
241
235
  error: status,
242
236
  };
@@ -427,42 +421,40 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
427
421
  },
428
422
  undoReversalAccruals: {
429
423
  reducer(draft, action) {
430
- const rowKey = (0, actualMatchingTypes_1.actualMatchingRowKey)(action.payload.matchId, action.payload.matchBatchId);
431
- draft.undoReversalStatusByMatchId[rowKey] = {
424
+ draft.undoReversalStatusByMatchId[action.payload.matchId] = {
432
425
  fetchState: 'In-Progress',
433
426
  error: undefined,
434
427
  };
435
428
  },
436
- prepare(matchId, accrualIds, matchBatchId) {
437
- return { payload: { matchId, accrualIds, matchBatchId } };
429
+ prepare(matchId, accrualIds) {
430
+ return { payload: { matchId, accrualIds } };
438
431
  },
439
432
  },
440
433
  undoReversalAccrualsSuccess: {
441
434
  reducer(draft, action) {
442
- const { matchId, matchBatchId, results } = action.payload;
443
- const rowKey = (0, actualMatchingTypes_1.actualMatchingRowKey)(matchId, matchBatchId);
444
- draft.undoReversalStatusByMatchId[rowKey] = {
435
+ const { matchId, results } = action.payload;
436
+ draft.undoReversalStatusByMatchId[matchId] = {
445
437
  fetchState: 'Completed',
446
438
  error: undefined,
447
439
  };
448
440
  const allUndone = results.length > 0 &&
449
441
  results.every((result) => result.status === 'undone');
450
442
  if (allUndone) {
451
- enqueueCloseMatchId(draft.closeMatchAfterUndoMatchIds, rowKey);
443
+ enqueueCloseMatchId(draft.closeMatchAfterUndoMatchIds, matchId);
452
444
  }
453
445
  else {
454
- draft.closeMatchAfterUndoMatchIds = dropCloseMatchId(draft.closeMatchAfterUndoMatchIds, rowKey);
446
+ draft.closeMatchAfterUndoMatchIds = dropCloseMatchId(draft.closeMatchAfterUndoMatchIds, matchId);
455
447
  }
456
448
  pruneLastMatchResultsForUndone(draft, matchId, results);
457
449
  if (allUndone) {
458
- delete draft.lastUndoResultsByMatchId[rowKey];
450
+ delete draft.lastUndoResultsByMatchId[matchId];
459
451
  }
460
452
  else {
461
- draft.lastUndoResultsByMatchId[rowKey] = results;
453
+ draft.lastUndoResultsByMatchId[matchId] = results;
462
454
  }
463
455
  },
464
- prepare(matchId, results, matchBatchId) {
465
- return { payload: { matchId, results, matchBatchId } };
456
+ prepare(matchId, results) {
457
+ return { payload: { matchId, results } };
466
458
  },
467
459
  },
468
460
  ackCloseMatchAfterUndo(draft) {
@@ -506,8 +498,7 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
506
498
  draft.closeMatchAfterIgnoreMatchIds.shift();
507
499
  },
508
500
  undoReversalAccrualsFailure(draft, action) {
509
- const rowKey = (0, actualMatchingTypes_1.actualMatchingRowKey)(action.payload.matchId, action.payload.matchBatchId);
510
- draft.undoReversalStatusByMatchId[rowKey] = {
501
+ draft.undoReversalStatusByMatchId[action.payload.matchId] = {
511
502
  fetchState: 'Error',
512
503
  error: action.payload.status,
513
504
  };
@@ -23,11 +23,9 @@ 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;
30
- suggestionKey?: string;
31
29
  transactionDate?: string;
32
30
  transactionType?: string;
33
31
  }
@@ -152,9 +152,7 @@ function toActualMatchingRow(match) {
152
152
  ];
153
153
  return {
154
154
  ...first,
155
- suggestionKey: match.suggestionKey,
156
155
  matchId: match.matchId,
157
- matchBatchId: match.matchBatchId,
158
156
  kind: match.kind,
159
157
  accruedAmount: match.accruedAmount,
160
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-beta1MM",
3
+ "version": "5.3.15",
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",