@zeniai/client-epic-state 5.2.22-betaAM5 → 5.2.22-betaMM1

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 (29) hide show
  1. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +2 -0
  2. package/lib/entity/jeSchedules/jeSchedulesPayload.js +2 -0
  3. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +2 -0
  4. package/lib/epic.d.ts +2 -1
  5. package/lib/epic.js +2 -0
  6. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +2 -0
  7. package/lib/esm/epic.js +2 -0
  8. package/lib/esm/index.js +4 -4
  9. package/lib/esm/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +2 -1
  10. package/lib/esm/view/expenseAutomationView/epics/actualMatching/undoReversalAccrualsEpic.js +51 -0
  11. package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +9 -1
  12. package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +26 -1
  13. package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +3 -1
  14. package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +6 -0
  15. package/lib/index.d.ts +4 -4
  16. package/lib/index.js +50 -48
  17. package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +2 -1
  18. package/lib/view/expenseAutomationView/epics/actualMatching/undoReversalAccrualsEpic.d.ts +8 -0
  19. package/lib/view/expenseAutomationView/epics/actualMatching/undoReversalAccrualsEpic.js +55 -0
  20. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +17 -1
  21. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +9 -0
  22. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +6 -2
  23. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +27 -2
  24. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +1 -0
  25. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +1 -0
  26. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +3 -1
  27. package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +13 -0
  28. package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +8 -1
  29. package/package.json +1 -1
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.undoReversalAccrualsEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
7
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
8
+ const responsePayload_1 = require("../../../../responsePayload");
9
+ const rootActions_1 = require("../../../../rootActions");
10
+ const actualMatchingPayload_1 = require("../../payload/actualMatchingPayload");
11
+ const actualMatchingViewReducer_1 = require("../../reducers/actualMatchingViewReducer");
12
+ function refreshActualMatchingList(state) {
13
+ const selectedMonthYear = state.expenseAutomationViewState.selectedPeriodByTenantId[(0, tenantSelector_1.getCurrentTenant)(state).tenantId];
14
+ if (selectedMonthYear == null) {
15
+ return [];
16
+ }
17
+ const period = (0, timePeriod_1.convertToPeriod)(selectedMonthYear);
18
+ const start = (0, timePeriod_1.toAbsoluteDay)(period.start);
19
+ const end = (0, timePeriod_1.toAbsoluteDay)(period.end);
20
+ if (start == null || end == null) {
21
+ return [];
22
+ }
23
+ return [(0, actualMatchingViewReducer_1.fetchActualMatching)({ start, end }, true)];
24
+ }
25
+ function refreshOpenMatchDetails(state) {
26
+ const detailState = state.expenseAutomationActualMatchingViewState.detailFetchStateByMatchId;
27
+ return Object.keys(detailState)
28
+ .filter((matchId) => detailState[matchId]?.fetchState !== 'Not-Started')
29
+ .map((matchId) => (0, actualMatchingViewReducer_1.fetchActualMatchingMatch)(matchId, true));
30
+ }
31
+ const undoReversalAccrualsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(actualMatchingViewReducer_1.undoReversalAccruals.match), (0, operators_1.mergeMap)((action) => {
32
+ const body = {
33
+ accrual_ids: action.payload.accrualIds,
34
+ };
35
+ return zeniAPI
36
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/undo-reversal`, body)
37
+ .pipe((0, operators_1.mergeMap)((response) => {
38
+ if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
39
+ const results = (response.data.results ?? []).map(actualMatchingPayload_1.toUndoReversalResult);
40
+ const successActions = [
41
+ (0, actualMatchingViewReducer_1.undoReversalAccrualsSuccess)({ results }),
42
+ ];
43
+ const anyUndone = results.some((result) => result.status === 'undone');
44
+ if (anyUndone) {
45
+ successActions.push(...refreshActualMatchingList(state$.value), ...refreshOpenMatchDetails(state$.value));
46
+ }
47
+ return (0, rxjs_1.from)(successActions);
48
+ }
49
+ return (0, rxjs_1.of)((0, actualMatchingViewReducer_1.undoReversalAccrualsFailure)({ status: response.status }));
50
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, actualMatchingViewReducer_1.undoReversalAccrualsFailure)({
51
+ status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Undo reversal accruals REST API call errored out' +
52
+ JSON.stringify(error)),
53
+ }))), (0, operators_1.takeUntil)(actions$.pipe((0, operators_1.filter)(rootActions_1.clearAll.match))));
54
+ }));
55
+ exports.undoReversalAccrualsEpic = undoReversalAccrualsEpic;
@@ -3,7 +3,7 @@ import { TimePeriod } from '../../../commonStateTypes/timePeriod';
3
3
  import { ActualMatchingListResponsePayload } from '../../../entity/actualMatching/actualMatchingPayload';
4
4
  import { JEOneTimeAccrualPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
5
5
  import { ZeniAPIResponse } from '../../../responsePayload';
6
- import { ActualMatchingTransactionSearchResult, MatchAndReverseResult } from '../types/actualMatchingViewState';
6
+ import { ActualMatchingTransactionSearchResult, MatchAndReverseResult, UndoReversalResult } from '../types/actualMatchingViewState';
7
7
  export declare function toServiceMonthFromPeriod(period: TimePeriod): string;
8
8
  export type ActualMatchingListResponse = ZeniAPIResponse<ActualMatchingListResponsePayload>;
9
9
  export interface ActualMatchingAccrualSearchResponsePayload {
@@ -34,6 +34,7 @@ export interface MatchTransactionSearchResultPayload {
34
34
  amount?: number | null;
35
35
  currency_code?: string | null;
36
36
  currency_symbol?: string | null;
37
+ sync_token?: string | null;
37
38
  total_amount?: number | null;
38
39
  transaction_description?: string | null;
39
40
  transaction_memo?: string | null;
@@ -52,6 +53,7 @@ export interface MatchAndReverseRequestPayload {
52
53
  line_id: string;
53
54
  transaction_id: ID;
54
55
  transaction_integration_id: string;
56
+ transaction_sync_token: string;
55
57
  transaction_type: string;
56
58
  }
57
59
  export interface MatchAndReverseResultPayload {
@@ -67,3 +69,17 @@ export interface MatchAndReverseResponsePayload {
67
69
  }
68
70
  export type MatchAndReverseResponse = ZeniAPIResponse<MatchAndReverseResponsePayload>;
69
71
  export declare function toMatchAndReverseResult(payload: MatchAndReverseResultPayload): MatchAndReverseResult;
72
+ export interface UndoReversalRequestPayload {
73
+ accrual_ids: ID[];
74
+ }
75
+ export interface UndoReversalResultPayload {
76
+ accrual_id: ID;
77
+ status: string;
78
+ reason?: string | null;
79
+ }
80
+ export interface UndoReversalResponsePayload {
81
+ match_batch_id: string;
82
+ results: UndoReversalResultPayload[];
83
+ }
84
+ export type UndoReversalResponse = ZeniAPIResponse<UndoReversalResponsePayload>;
85
+ export declare function toUndoReversalResult(payload: UndoReversalResultPayload): UndoReversalResult;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toServiceMonthFromPeriod = toServiceMonthFromPeriod;
4
4
  exports.toActualMatchingTransactionSearchResult = toActualMatchingTransactionSearchResult;
5
5
  exports.toMatchAndReverseResult = toMatchAndReverseResult;
6
+ exports.toUndoReversalResult = toUndoReversalResult;
6
7
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
7
8
  const actualMatchingViewState_1 = require("../types/actualMatchingViewState");
8
9
  function toServiceMonthFromPeriod(period) {
@@ -54,6 +55,7 @@ function toActualMatchingTransactionSearchResult(payload) {
54
55
  transactionMemo: payload.transaction_memo ?? undefined,
55
56
  transactionDescription: payload.transaction_description ?? undefined,
56
57
  transactionTypeName: payload.transaction_type_name ?? undefined,
58
+ syncToken: payload.sync_token == null ? '' : String(payload.sync_token),
57
59
  };
58
60
  }
59
61
  function toMatchAndReverseResult(payload) {
@@ -63,3 +65,10 @@ function toMatchAndReverseResult(payload) {
63
65
  reason: payload.reason ?? undefined,
64
66
  };
65
67
  }
68
+ function toUndoReversalResult(payload) {
69
+ return {
70
+ accrualId: payload.accrual_id,
71
+ status: (0, actualMatchingViewState_1.toUndoReversalResultStatus)(payload.status),
72
+ reason: payload.reason ?? undefined,
73
+ };
74
+ }
@@ -2,7 +2,7 @@ import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePerio
2
2
  import { ActualMatchingMatchId } from '../../../entity/actualMatching/actualMatchingTypes';
3
3
  import { JEOneTimeAccrualPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
4
4
  import { ZeniAPIStatus } from '../../../responsePayload';
5
- import { ActualMatchingAccrualSearchState, ActualMatchingMatchModalState, ActualMatchingTransactionSearchResult, ActualMatchingTransactionSearchState, ActualMatchingViewState, ActualMatchingViewUIState, MatchAndReverseAccrualsParams, MatchAndReverseResult } from '../types/actualMatchingViewState';
5
+ import { ActualMatchingAccrualSearchState, ActualMatchingMatchModalState, ActualMatchingTransactionSearchResult, ActualMatchingTransactionSearchState, ActualMatchingViewState, ActualMatchingViewUIState, MatchAndReverseAccrualsParams, MatchAndReverseResult, UndoReversalAccrualsParams, UndoReversalResult } from '../types/actualMatchingViewState';
6
6
  export declare const initialTransactionSearchState: ActualMatchingTransactionSearchState;
7
7
  export declare const initialAccrualSearchState: ActualMatchingAccrualSearchState;
8
8
  export declare const initialMatchModalState: ActualMatchingMatchModalState;
@@ -65,6 +65,10 @@ export declare const clearActualMatchingView: import("@reduxjs/toolkit").ActionC
65
65
  append: boolean;
66
66
  nextPageToken: string | null;
67
67
  results: ActualMatchingTransactionSearchResult[];
68
- }, "expenseAutomationActualMatchingView/searchMatchTransactionsSuccess">, updateActualMatchingUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<ActualMatchingViewUIState>, "expenseAutomationActualMatchingView/updateActualMatchingUIState">;
68
+ }, "expenseAutomationActualMatchingView/searchMatchTransactionsSuccess">, undoReversalAccruals: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[params: UndoReversalAccrualsParams], UndoReversalAccrualsParams, "expenseAutomationActualMatchingView/undoReversalAccruals", never, never>, undoReversalAccrualsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
69
+ status: ZeniAPIStatus;
70
+ }, "expenseAutomationActualMatchingView/undoReversalAccrualsFailure">, undoReversalAccrualsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
71
+ results: UndoReversalResult[];
72
+ }, "expenseAutomationActualMatchingView/undoReversalAccrualsSuccess">, updateActualMatchingUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<ActualMatchingViewUIState>, "expenseAutomationActualMatchingView/updateActualMatchingUIState">;
69
73
  declare const _default: import("redux").Reducer<ActualMatchingViewState>;
70
74
  export default _default;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.updateActualMatchingUIState = exports.searchMatchTransactionsSuccess = exports.searchMatchTransactionsFailure = exports.searchMatchTransactions = exports.searchMatchAccrualsSuccess = exports.searchMatchAccrualsFailure = exports.searchMatchAccruals = exports.openMatchNewModal = exports.matchAndReverseAccrualsSuccess = exports.matchAndReverseAccrualsFailure = exports.matchAndReverseAccruals = exports.fetchActualMatchingSuccess = exports.fetchActualMatchingPage = exports.fetchActualMatchingMatchSuccess = exports.fetchActualMatchingMatchFailure = exports.fetchActualMatchingMatch = exports.fetchActualMatchingFailure = exports.fetchActualMatching = exports.closeMatchNewModal = exports.clearMatchNewModal = exports.clearActualMatchingView = exports.initialState = exports.initialMatchModalState = exports.initialAccrualSearchState = exports.initialTransactionSearchState = void 0;
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.fetchActualMatchingSuccess = exports.fetchActualMatchingPage = exports.fetchActualMatchingMatchSuccess = exports.fetchActualMatchingMatchFailure = exports.fetchActualMatchingMatch = exports.fetchActualMatchingFailure = exports.fetchActualMatching = exports.closeMatchNewModal = exports.clearMatchNewModal = exports.clearActualMatchingView = 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
7
  const jeScheduleHelper_1 = require("../../../entity/jeSchedules/jeScheduleHelper");
@@ -47,6 +47,7 @@ exports.initialState = {
47
47
  scrollPosition: { scrollTop: 0, scrollLeft: undefined },
48
48
  },
49
49
  matchModal: exports.initialMatchModalState,
50
+ undoReversalStatus: { fetchState: 'Not-Started', error: undefined },
50
51
  hasValidState() {
51
52
  return this.fetchState == 'Completed';
52
53
  },
@@ -329,6 +330,30 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
329
330
  error: action.payload.status,
330
331
  };
331
332
  },
333
+ undoReversalAccruals: {
334
+ reducer(draft) {
335
+ draft.undoReversalStatus = {
336
+ fetchState: 'In-Progress',
337
+ error: undefined,
338
+ };
339
+ },
340
+ prepare(params) {
341
+ return { payload: params };
342
+ },
343
+ },
344
+ undoReversalAccrualsSuccess(draft, action) {
345
+ draft.undoReversalStatus = {
346
+ fetchState: 'Completed',
347
+ error: undefined,
348
+ };
349
+ void action;
350
+ },
351
+ undoReversalAccrualsFailure(draft, action) {
352
+ draft.undoReversalStatus = {
353
+ fetchState: 'Error',
354
+ error: action.payload.status,
355
+ };
356
+ },
332
357
  clearActualMatchingView(draft) {
333
358
  Object.assign(draft, exports.initialState);
334
359
  },
@@ -339,5 +364,5 @@ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
339
364
  });
340
365
  },
341
366
  });
342
- _a = expenseAutomationActualMatchingView.actions, exports.clearActualMatchingView = _a.clearActualMatchingView, exports.clearMatchNewModal = _a.clearMatchNewModal, exports.closeMatchNewModal = _a.closeMatchNewModal, exports.fetchActualMatching = _a.fetchActualMatching, exports.fetchActualMatchingFailure = _a.fetchActualMatchingFailure, exports.fetchActualMatchingMatch = _a.fetchActualMatchingMatch, exports.fetchActualMatchingMatchFailure = _a.fetchActualMatchingMatchFailure, exports.fetchActualMatchingMatchSuccess = _a.fetchActualMatchingMatchSuccess, exports.fetchActualMatchingPage = _a.fetchActualMatchingPage, exports.fetchActualMatchingSuccess = _a.fetchActualMatchingSuccess, exports.matchAndReverseAccruals = _a.matchAndReverseAccruals, exports.matchAndReverseAccrualsFailure = _a.matchAndReverseAccrualsFailure, exports.matchAndReverseAccrualsSuccess = _a.matchAndReverseAccrualsSuccess, exports.openMatchNewModal = _a.openMatchNewModal, exports.searchMatchAccruals = _a.searchMatchAccruals, exports.searchMatchAccrualsFailure = _a.searchMatchAccrualsFailure, exports.searchMatchAccrualsSuccess = _a.searchMatchAccrualsSuccess, exports.searchMatchTransactions = _a.searchMatchTransactions, exports.searchMatchTransactionsFailure = _a.searchMatchTransactionsFailure, exports.searchMatchTransactionsSuccess = _a.searchMatchTransactionsSuccess, exports.updateActualMatchingUIState = _a.updateActualMatchingUIState;
367
+ _a = expenseAutomationActualMatchingView.actions, exports.clearActualMatchingView = _a.clearActualMatchingView, exports.clearMatchNewModal = _a.clearMatchNewModal, exports.closeMatchNewModal = _a.closeMatchNewModal, exports.fetchActualMatching = _a.fetchActualMatching, exports.fetchActualMatchingFailure = _a.fetchActualMatchingFailure, exports.fetchActualMatchingMatch = _a.fetchActualMatchingMatch, exports.fetchActualMatchingMatchFailure = _a.fetchActualMatchingMatchFailure, exports.fetchActualMatchingMatchSuccess = _a.fetchActualMatchingMatchSuccess, exports.fetchActualMatchingPage = _a.fetchActualMatchingPage, exports.fetchActualMatchingSuccess = _a.fetchActualMatchingSuccess, exports.matchAndReverseAccruals = _a.matchAndReverseAccruals, exports.matchAndReverseAccrualsFailure = _a.matchAndReverseAccrualsFailure, exports.matchAndReverseAccrualsSuccess = _a.matchAndReverseAccrualsSuccess, exports.openMatchNewModal = _a.openMatchNewModal, exports.searchMatchAccruals = _a.searchMatchAccruals, exports.searchMatchAccrualsFailure = _a.searchMatchAccrualsFailure, exports.searchMatchAccrualsSuccess = _a.searchMatchAccrualsSuccess, exports.searchMatchTransactions = _a.searchMatchTransactions, exports.searchMatchTransactionsFailure = _a.searchMatchTransactionsFailure, exports.searchMatchTransactionsSuccess = _a.searchMatchTransactionsSuccess, exports.undoReversalAccruals = _a.undoReversalAccruals, exports.undoReversalAccrualsFailure = _a.undoReversalAccrualsFailure, exports.undoReversalAccrualsSuccess = _a.undoReversalAccrualsSuccess, exports.updateActualMatchingUIState = _a.updateActualMatchingUIState;
343
368
  exports.default = expenseAutomationActualMatchingView.reducer;
@@ -79,4 +79,5 @@ export interface ExpenseAutomationActualMatchingViewSelector extends SelectorVie
79
79
  refreshStatus: FetchStateAndError;
80
80
  reversed: ActualMatchingRow[];
81
81
  uiState: ActualMatchingViewUIState;
82
+ undoReversalStatus?: FetchStateAndError;
82
83
  }
@@ -19,6 +19,7 @@ export declare function getActualMatchingReversalDate(accrual: JEOneTimeAccrual)
19
19
  export interface ExpenseAutomationActualMatchingMatchView {
20
20
  detailFetchState: FetchStateAndError;
21
21
  refreshStatus: FetchStateAndError;
22
+ undoReversalStatus: FetchStateAndError;
22
23
  match?: ActualMatchingMatch;
23
24
  }
24
25
  export declare function getExpenseAutomationActualMatchingMatchView(state: RootState, matchId: ActualMatchingMatchId): ExpenseAutomationActualMatchingMatchView;
@@ -197,11 +197,12 @@ function getExpenseAutomationActualMatchingMatchView(state, matchId) {
197
197
  match: (0, actualMatchingSelector_1.getActualMatchingMatchById)(matchId, state.actualMatchingState),
198
198
  detailFetchState: view.detailFetchStateByMatchId[matchId] ?? NOT_STARTED,
199
199
  refreshStatus: view.detailRefreshStatusByMatchId[matchId] ?? NOT_STARTED,
200
+ undoReversalStatus: view.undoReversalStatus ?? NOT_STARTED,
200
201
  };
201
202
  }
202
203
  function getExpenseAutomationActualMatchingView(state) {
203
204
  const { expenseAutomationActualMatchingViewState, expenseAutomationViewState } = state;
204
- const { matchIdsByPeriod, fetchState, error, refreshStatus, uiState, matchModal, } = expenseAutomationActualMatchingViewState;
205
+ const { matchIdsByPeriod, fetchState, error, refreshStatus, uiState, matchModal, undoReversalStatus, } = expenseAutomationActualMatchingViewState;
205
206
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
206
207
  const selectedPeriod = expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
207
208
  const monthYearPeriodId = selectedPeriod != null ? (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod) : undefined;
@@ -265,6 +266,7 @@ function getExpenseAutomationActualMatchingView(state) {
265
266
  uiState,
266
267
  refreshStatus,
267
268
  hasLoadedForSelectedPeriod: matchIds != null,
269
+ undoReversalStatus,
268
270
  matchModal: {
269
271
  isOpen: matchModal.isOpen,
270
272
  openedFromMatchId: matchModal.openedFromMatchId,
@@ -28,6 +28,7 @@ export interface ActualMatchingTransactionSearchResult {
28
28
  currencyCode: string;
29
29
  currencySymbol: string;
30
30
  lineId: string;
31
+ syncToken: string;
31
32
  transactionDate: string;
32
33
  transactionId: ID;
33
34
  transactionIntegrationId: string;
@@ -53,8 +54,19 @@ export interface MatchAndReverseAccrualsParams {
53
54
  lineId: string;
54
55
  transactionId: ID;
55
56
  transactionIntegrationId: string;
57
+ transactionSyncToken: string;
56
58
  transactionType: string;
57
59
  }
60
+ export declare const toUndoReversalResultStatus: (v: string) => "error" | "claim_lost" | "undone";
61
+ export type UndoReversalResultStatus = ReturnType<typeof toUndoReversalResultStatus>;
62
+ export interface UndoReversalResult {
63
+ accrualId: ID;
64
+ status: UndoReversalResultStatus;
65
+ reason?: string;
66
+ }
67
+ export interface UndoReversalAccrualsParams {
68
+ accrualIds: ID[];
69
+ }
58
70
  export interface ActualMatchingTransactionSearchState extends FetchStateAndError {
59
71
  isLoadingMore: boolean;
60
72
  nextPageToken: string | null;
@@ -83,4 +95,5 @@ export interface ActualMatchingViewState extends FetchedState {
83
95
  matchModal: ActualMatchingMatchModalState;
84
96
  refreshStatus: FetchStateAndError;
85
97
  uiState: ActualMatchingViewUIState;
98
+ undoReversalStatus: FetchStateAndError;
86
99
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toMatchAndReverseResultStatus = exports.MATCH_SEARCH_DEBOUNCE_MS = exports.MATCH_ACCRUAL_SEARCH_LIMIT = exports.MATCH_TRANSACTION_SEARCH_PAGE_SIZE = exports.toActualMatchingSortKey = void 0;
3
+ exports.toUndoReversalResultStatus = exports.toMatchAndReverseResultStatus = exports.MATCH_SEARCH_DEBOUNCE_MS = exports.MATCH_ACCRUAL_SEARCH_LIMIT = exports.MATCH_TRANSACTION_SEARCH_PAGE_SIZE = exports.toActualMatchingSortKey = void 0;
4
4
  const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
5
5
  const ACTUAL_MATCHING_SORT_KEYS = [
6
6
  'vendor',
@@ -29,3 +29,10 @@ const MATCH_AND_REVERSE_RESULT_STATUSES = [
29
29
  ];
30
30
  const toMatchAndReverseResultStatus = (v) => (0, stringToUnion_1.stringToUnion)(v, MATCH_AND_REVERSE_RESULT_STATUSES);
31
31
  exports.toMatchAndReverseResultStatus = toMatchAndReverseResultStatus;
32
+ const UNDO_REVERSAL_RESULT_STATUSES = [
33
+ 'undone',
34
+ 'claim_lost',
35
+ 'error',
36
+ ];
37
+ const toUndoReversalResultStatus = (v) => (0, stringToUnion_1.stringToUnion)(v, UNDO_REVERSAL_RESULT_STATUSES);
38
+ exports.toUndoReversalResultStatus = toUndoReversalResultStatus;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.2.22-betaAM5",
3
+ "version": "5.2.22-betaMM1",
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",