@zeniai/client-epic-state 5.2.61 → 5.2.62-beta0MM
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.
- package/lib/entity/actualMatching/actualMatchingReducer.d.ts +3 -1
- package/lib/entity/actualMatching/actualMatchingReducer.js +11 -2
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +1 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +1 -0
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +1 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/epic.d.ts +2 -1
- package/lib/epic.js +2 -0
- package/lib/esm/entity/actualMatching/actualMatchingReducer.js +9 -1
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +1 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/esm/epic.js +2 -0
- package/lib/esm/index.js +5 -5
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +50 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +7 -3
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +2 -23
- package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +66 -35
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +60 -64
- package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +15 -0
- package/lib/index.d.ts +6 -6
- package/lib/index.js +57 -49
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.d.ts +10 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +54 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +7 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +1 -22
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +12 -1
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +16 -8
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +67 -36
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +20 -8
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +7 -4
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +63 -64
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +20 -4
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +18 -1
- package/package.json +1 -1
|
@@ -16,15 +16,18 @@ exports.getActualMatchingReversalDate = getActualMatchingReversalDate;
|
|
|
16
16
|
exports.buildActualMatchingKpiSummary = buildActualMatchingKpiSummary;
|
|
17
17
|
exports.getExpenseAutomationActualMatchingMatchView = getExpenseAutomationActualMatchingMatchView;
|
|
18
18
|
exports.getCloseMatchAfterUndo = getCloseMatchAfterUndo;
|
|
19
|
+
exports.getCloseMatchAfterUndoMatchId = getCloseMatchAfterUndoMatchId;
|
|
20
|
+
exports.getCloseMatchAfterIgnoreMatchId = getCloseMatchAfterIgnoreMatchId;
|
|
21
|
+
exports.getActualMatchingMatchModalConfirmStatus = getActualMatchingMatchModalConfirmStatus;
|
|
19
22
|
exports.getExpenseAutomationActualMatchingView = getExpenseAutomationActualMatchingView;
|
|
20
23
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
24
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
21
25
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
22
26
|
const actualMatchingSelector_1 = require("../../../entity/actualMatching/actualMatchingSelector");
|
|
23
27
|
const jeScheduleHelper_1 = require("../../../entity/jeSchedules/jeScheduleHelper");
|
|
24
28
|
const jeSchedulesSelector_1 = require("../../../entity/jeSchedules/jeSchedulesSelector");
|
|
25
29
|
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
26
30
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
27
|
-
const actualMatchingViewState_1 = require("../types/actualMatchingViewState");
|
|
28
31
|
function getSelectedMonthYearForCurrentTenant(state) {
|
|
29
32
|
const tenantId = (0, tenantSelector_1.getCurrentTenant)(state)?.tenantId;
|
|
30
33
|
if (tenantId == null) {
|
|
@@ -53,27 +56,6 @@ function toMatchModalAccrual(member) {
|
|
|
53
56
|
jeOneTimeAccrualKey: (0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(member.accrualId),
|
|
54
57
|
};
|
|
55
58
|
}
|
|
56
|
-
function uniqueMatchModalAccruals(pinned, searched) {
|
|
57
|
-
const byId = new Map();
|
|
58
|
-
pinned.forEach((row) => byId.set(row.accrualId, row));
|
|
59
|
-
searched.forEach((row) => {
|
|
60
|
-
if (!byId.has(row.accrualId)) {
|
|
61
|
-
byId.set(row.accrualId, row);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
return Array.from(byId.values());
|
|
65
|
-
}
|
|
66
|
-
function uniqueTransactionSearchResults(pinned, searched) {
|
|
67
|
-
const byKey = new Map();
|
|
68
|
-
pinned.forEach((row) => byKey.set((0, actualMatchingViewState_1.actualMatchingTransactionLineKey)(row.transactionType, row.transactionIntegrationId, row.lineId), row));
|
|
69
|
-
searched.forEach((row) => {
|
|
70
|
-
const key = (0, actualMatchingViewState_1.actualMatchingTransactionLineKey)(row.transactionType, row.transactionIntegrationId, row.lineId);
|
|
71
|
-
if (!byKey.has(key)) {
|
|
72
|
-
byKey.set(key, row);
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
return Array.from(byKey.values());
|
|
76
|
-
}
|
|
77
59
|
function parseActualMatchingMatchId(matchId) {
|
|
78
60
|
const separator = matchId.indexOf(':');
|
|
79
61
|
if (separator <= 0 || separator === matchId.length - 1) {
|
|
@@ -246,6 +228,7 @@ function emptyKpiSummary() {
|
|
|
246
228
|
actualsReceived: { count: 0, expectedCount: 0, vendorsPending: 0 },
|
|
247
229
|
autoReversed: { count: 0, percent: 0, clearedAmount: 0 },
|
|
248
230
|
pendingReview: { count: 0, amount: 0, estimatedMinutesToClear: 0 },
|
|
231
|
+
reversed: { count: 0 },
|
|
249
232
|
variance: { percent: 0, averagePercentPerMatch: 0, netAmount: 0 },
|
|
250
233
|
};
|
|
251
234
|
}
|
|
@@ -301,6 +284,7 @@ function buildActualMatchingKpiSummary(rows, displayCurrencyCode) {
|
|
|
301
284
|
}
|
|
302
285
|
const autoReversed = kpiRows.filter((row) => row.kind === 'auto_reversed');
|
|
303
286
|
const pendingReview = kpiRows.filter((row) => row.kind === 'pending_review');
|
|
287
|
+
const reversed = kpiRows.filter((row) => isReversedMatchKind(row.kind));
|
|
304
288
|
const receivedCount = kpiRows.length;
|
|
305
289
|
const rowsWithActual = kpiRows.filter((row) => row.actualAmount?.amount != null);
|
|
306
290
|
const accruedTotal = rowsWithActual.reduce((sum, row) => sum + (row.accruedAmount?.amount ?? row.estimatedAmount.amount), 0);
|
|
@@ -326,6 +310,9 @@ function buildActualMatchingKpiSummary(rows, displayCurrencyCode) {
|
|
|
326
310
|
amount: sumRowAmounts(pendingReview, displayCurrencyCode),
|
|
327
311
|
estimatedMinutesToClear: pendingReview.length * ESTIMATED_MINUTES_PER_PENDING_MATCH,
|
|
328
312
|
},
|
|
313
|
+
reversed: {
|
|
314
|
+
count: reversed.length,
|
|
315
|
+
},
|
|
329
316
|
variance: {
|
|
330
317
|
percent: accruedTotal === 0
|
|
331
318
|
? 0
|
|
@@ -338,23 +325,55 @@ function buildActualMatchingKpiSummary(rows, displayCurrencyCode) {
|
|
|
338
325
|
},
|
|
339
326
|
};
|
|
340
327
|
}
|
|
341
|
-
function
|
|
342
|
-
const view = state.expenseAutomationActualMatchingViewState;
|
|
328
|
+
function toActualMatchingMatchView(match) {
|
|
343
329
|
return {
|
|
344
|
-
match
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
lastUndoResults: view.lastUndoResultsByMatchId?.[matchId],
|
|
330
|
+
...match,
|
|
331
|
+
members: match.members.map(toMatchModalAccrual),
|
|
332
|
+
leftovers: match.leftovers == null
|
|
333
|
+
? undefined
|
|
334
|
+
: match.leftovers.map(toMatchModalAccrual),
|
|
350
335
|
};
|
|
351
336
|
}
|
|
337
|
+
const EMPTY_ACTUAL_MATCHING_ROWS = [];
|
|
338
|
+
const matchViewSelectorById = new Map();
|
|
339
|
+
function getExpenseAutomationActualMatchingMatchView(state, matchId) {
|
|
340
|
+
let selector = matchViewSelectorById.get(matchId);
|
|
341
|
+
if (selector == null) {
|
|
342
|
+
selector = (0, toolkit_1.createSelector)([
|
|
343
|
+
(root) => root.expenseAutomationActualMatchingViewState,
|
|
344
|
+
(root) => (0, actualMatchingSelector_1.getActualMatchingMatchById)(root.actualMatchingState, matchId),
|
|
345
|
+
], (view, match) => ({
|
|
346
|
+
detailFetchState: view.detailFetchStateByMatchId[matchId] ?? NOT_STARTED,
|
|
347
|
+
ignoreStatus: view.ignoreStatusByMatchId[matchId] ?? NOT_STARTED,
|
|
348
|
+
lastMatchResults: view.lastMatchResultsByMatchId?.[matchId],
|
|
349
|
+
lastUndoResults: view.lastUndoResultsByMatchId?.[matchId],
|
|
350
|
+
match: match == null ? undefined : toActualMatchingMatchView(match),
|
|
351
|
+
refreshStatus: view.detailRefreshStatusByMatchId[matchId] ?? NOT_STARTED,
|
|
352
|
+
undoReversalStatus: view.undoReversalStatusByMatchId[matchId] ?? NOT_STARTED,
|
|
353
|
+
}));
|
|
354
|
+
matchViewSelectorById.set(matchId, selector);
|
|
355
|
+
}
|
|
356
|
+
return selector(state);
|
|
357
|
+
}
|
|
352
358
|
function getCloseMatchAfterUndo(state) {
|
|
353
|
-
return state.expenseAutomationActualMatchingViewState.
|
|
359
|
+
return state.expenseAutomationActualMatchingViewState.closeMatchAfterUndoMatchId;
|
|
360
|
+
}
|
|
361
|
+
function getCloseMatchAfterUndoMatchId(state) {
|
|
362
|
+
return getCloseMatchAfterUndo(state);
|
|
363
|
+
}
|
|
364
|
+
function getCloseMatchAfterIgnoreMatchId(state) {
|
|
365
|
+
return state.expenseAutomationActualMatchingViewState
|
|
366
|
+
.closeMatchAfterIgnoreMatchId;
|
|
367
|
+
}
|
|
368
|
+
function getActualMatchingMatchModalConfirmStatus(state, matchId) {
|
|
369
|
+
if (matchId != null && matchId !== '') {
|
|
370
|
+
return (state.expenseAutomationActualMatchingViewState.confirmStatusByMatchId[matchId] ?? NOT_STARTED);
|
|
371
|
+
}
|
|
372
|
+
return state.expenseAutomationActualMatchingViewState.matchModal.confirmStatus;
|
|
354
373
|
}
|
|
355
374
|
function getExpenseAutomationActualMatchingView(state) {
|
|
356
375
|
const { expenseAutomationActualMatchingViewState } = state;
|
|
357
|
-
const { matchIdsByPeriod, fetchState, error, refreshStatus, uiState, matchModal, } = expenseAutomationActualMatchingViewState;
|
|
376
|
+
const { matchIdsByPeriod, fetchState, error, refreshStatus, uiState, matchModal, ignoreStatusByMatchId, undoReversalStatusByMatchId, } = expenseAutomationActualMatchingViewState;
|
|
358
377
|
const selectedPeriod = getSelectedMonthYearForCurrentTenant(state);
|
|
359
378
|
const monthYearPeriodId = selectedPeriod != null ? (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod) : undefined;
|
|
360
379
|
const matchIds = monthYearPeriodId != null ? matchIdsByPeriod[monthYearPeriodId] : undefined;
|
|
@@ -364,38 +383,18 @@ function getExpenseAutomationActualMatchingView(state) {
|
|
|
364
383
|
.filter((match) => match.members.length > 0)
|
|
365
384
|
.map(toActualMatchingRow);
|
|
366
385
|
const rows = allRows.filter((row) => matchesSearch(row, uiState.searchString));
|
|
367
|
-
const
|
|
368
|
-
const
|
|
386
|
+
const includePendingReview = uiState.statusFilter !== 'reversed';
|
|
387
|
+
const includeReversed = uiState.statusFilter !== 'pending_review';
|
|
388
|
+
const reversed = includeReversed
|
|
389
|
+
? sortActualMatchingRows(rows.filter((row) => isReversedMatchKind(row.kind)), uiState)
|
|
390
|
+
: EMPTY_ACTUAL_MATCHING_ROWS;
|
|
391
|
+
const pendingReview = includePendingReview
|
|
392
|
+
? sortActualMatchingRows(rows.filter((row) => row.kind === 'pending_review'), uiState)
|
|
393
|
+
: EMPTY_ACTUAL_MATCHING_ROWS;
|
|
369
394
|
const kpiSummary = buildActualMatchingKpiSummary(allRows, getTenantDisplayCurrency(state)?.currencyCode);
|
|
370
395
|
const searchedAccruals = matchModal.accrualSearch.results
|
|
371
396
|
.map((key) => (0, jeSchedulesSelector_1.getJEOneTimeAccrualByKey)(key, state.jeSchedulesState))
|
|
372
397
|
.filter((accrual) => accrual != null);
|
|
373
|
-
const openedMatch = matchModal.openedFromMatchId != null
|
|
374
|
-
? (0, actualMatchingSelector_1.getActualMatchingMatchById)(state.actualMatchingState, matchModal.openedFromMatchId)
|
|
375
|
-
: undefined;
|
|
376
|
-
const pinnedAccruals = [
|
|
377
|
-
...(openedMatch?.members ?? []),
|
|
378
|
-
...(openedMatch?.leftovers ?? []),
|
|
379
|
-
].map(toMatchModalAccrual);
|
|
380
|
-
const firstMember = openedMatch?.members[0];
|
|
381
|
-
const cleared = firstMember?.cleared;
|
|
382
|
-
const suggestion = firstMember?.matchSuggestion;
|
|
383
|
-
const stamp = cleared ?? suggestion;
|
|
384
|
-
const consumedLineIds = cleared?.consumedLineIds;
|
|
385
|
-
const prefill = openedMatch == null
|
|
386
|
-
? undefined
|
|
387
|
-
: {
|
|
388
|
-
selectedAccrualIds: [
|
|
389
|
-
...openedMatch.members.map((member) => member.accrualId),
|
|
390
|
-
...(openedMatch.leftovers ?? []).map((leftover) => leftover.accrualId),
|
|
391
|
-
],
|
|
392
|
-
actualAmount: openedMatch.actualAmount.amount,
|
|
393
|
-
matchedTransactionId: stamp?.matchedTransactionId,
|
|
394
|
-
matchedLineId: cleared == null ? suggestion?.matchedLineId : undefined,
|
|
395
|
-
...(consumedLineIds != null && consumedLineIds.length > 0
|
|
396
|
-
? { consumedLineIds }
|
|
397
|
-
: {}),
|
|
398
|
-
};
|
|
399
398
|
// `fetchState` is a flat slice field that survives a period switch. Until this
|
|
400
399
|
// month's ids land, leftover Completed/Error is the previous month. Report
|
|
401
400
|
// Not-Started so chrome matches Review's "cache slot missing" skeleton, not
|
|
@@ -413,16 +412,16 @@ function getExpenseAutomationActualMatchingView(state) {
|
|
|
413
412
|
kpiSummary,
|
|
414
413
|
uiState,
|
|
415
414
|
refreshStatus,
|
|
415
|
+
ignoreStatusByMatchId,
|
|
416
|
+
undoReversalStatusByMatchId,
|
|
416
417
|
hasLoadedForSelectedPeriod: matchIds != null,
|
|
417
418
|
matchModal: {
|
|
418
419
|
isOpen: matchModal.isOpen,
|
|
419
|
-
openedFromMatchId: matchModal.openedFromMatchId,
|
|
420
|
-
prefill,
|
|
421
420
|
confirmStatus: matchModal.confirmStatus,
|
|
422
421
|
lastBatchResults: matchModal.lastBatchResults,
|
|
423
422
|
transactionSearch: {
|
|
424
423
|
query: matchModal.transactionSearch.query,
|
|
425
|
-
results:
|
|
424
|
+
results: matchModal.transactionSearch.results,
|
|
426
425
|
fetchState: {
|
|
427
426
|
fetchState: matchModal.transactionSearch.fetchState,
|
|
428
427
|
error: matchModal.transactionSearch.error,
|
|
@@ -432,7 +431,7 @@ function getExpenseAutomationActualMatchingView(state) {
|
|
|
432
431
|
},
|
|
433
432
|
accrualSearch: {
|
|
434
433
|
query: matchModal.accrualSearch.query,
|
|
435
|
-
results:
|
|
434
|
+
results: searchedAccruals,
|
|
436
435
|
fetchState: {
|
|
437
436
|
fetchState: matchModal.accrualSearch.fetchState,
|
|
438
437
|
error: matchModal.accrualSearch.error,
|
|
@@ -5,6 +5,8 @@ import { ActualMatchingMatchId } from '../../../entity/actualMatching/actualMatc
|
|
|
5
5
|
import { JEOneTimeAccrualKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
6
6
|
export declare const toActualMatchingSortKey: (v: string) => "type" | "date" | "vendor" | "category" | "class" | "amount" | "variance" | "lifecycle" | "service" | "accrued" | "actual";
|
|
7
7
|
export type ActualMatchingSortKey = ReturnType<typeof toActualMatchingSortKey>;
|
|
8
|
+
export declare const toActualMatchingStatusFilter: (v: string) => "pending_review" | "reversed" | "all";
|
|
9
|
+
export type ActualMatchingStatusFilter = ReturnType<typeof toActualMatchingStatusFilter>;
|
|
8
10
|
export declare const MATCH_TRANSACTION_SEARCH_PAGE_SIZE = 50;
|
|
9
11
|
export declare const MATCH_ACCRUAL_SEARCH_LIMIT = 50;
|
|
10
12
|
export declare const MATCH_SEARCH_DEBOUNCE_MS = 300;
|
|
@@ -18,6 +20,12 @@ export interface ActualMatchingViewUIState {
|
|
|
18
20
|
searchString: string;
|
|
19
21
|
sortKey: ActualMatchingSortKey;
|
|
20
22
|
sortOrder: SortOrder;
|
|
23
|
+
/**
|
|
24
|
+
* List-only filter. `all` shows both groups; `pending_review` / `reversed`
|
|
25
|
+
* empty the other group (`reversed` includes auto and manual). KPI summary
|
|
26
|
+
* stays on the unfiltered period.
|
|
27
|
+
*/
|
|
28
|
+
statusFilter: ActualMatchingStatusFilter;
|
|
21
29
|
}
|
|
22
30
|
/**
|
|
23
31
|
* Sibling of Missing Receipts `MatchCandidate`. Confirm needs `lineId` and
|
|
@@ -69,6 +77,14 @@ export interface UndoReversalAccrualsParams {
|
|
|
69
77
|
accrualIds: ID[];
|
|
70
78
|
matchId: ActualMatchingMatchId;
|
|
71
79
|
}
|
|
80
|
+
export declare const toActualMatchingIgnoreReasonType: (v: string) => "other_ignore" | "already_handled" | "amount_off" | "wrong_period" | "wrong_bill";
|
|
81
|
+
export type ActualMatchingIgnoreReasonType = ReturnType<typeof toActualMatchingIgnoreReasonType>;
|
|
82
|
+
export declare const ALL_ACTUAL_MATCHING_IGNORE_REASONS: readonly ActualMatchingIgnoreReasonType[];
|
|
83
|
+
export interface IgnoreActualMatchingSuggestionParams {
|
|
84
|
+
matchId: ActualMatchingMatchId;
|
|
85
|
+
reason: ActualMatchingIgnoreReasonType;
|
|
86
|
+
note?: string;
|
|
87
|
+
}
|
|
72
88
|
export interface ActualMatchingTransactionSearchState extends FetchStateAndError {
|
|
73
89
|
isLoadingMore: boolean;
|
|
74
90
|
nextPageToken: string | null;
|
|
@@ -84,18 +100,16 @@ export interface ActualMatchingAccrualSearchState extends FetchStateAndError {
|
|
|
84
100
|
export interface ActualMatchingMatchModalState {
|
|
85
101
|
accrualSearch: ActualMatchingAccrualSearchState;
|
|
86
102
|
confirmStatus: FetchStateAndError;
|
|
87
|
-
didPinPrefillTransactions: boolean;
|
|
88
103
|
isOpen: boolean;
|
|
89
|
-
pinnedTransactionResults: ActualMatchingTransactionSearchResult[];
|
|
90
104
|
transactionSearch: ActualMatchingTransactionSearchState;
|
|
91
105
|
lastBatchResults?: MatchAndReverseResult[];
|
|
92
|
-
openedFromMatchId?: ActualMatchingMatchId;
|
|
93
106
|
}
|
|
94
107
|
export declare function actualMatchingTransactionLineKey(transactionType: string, transactionIntegrationId: string, lineId: string): string;
|
|
95
108
|
export interface ActualMatchingViewState extends FetchedState {
|
|
96
|
-
|
|
109
|
+
confirmStatusByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
|
|
97
110
|
detailFetchStateByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
|
|
98
111
|
detailRefreshStatusByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
|
|
112
|
+
ignoreStatusByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
|
|
99
113
|
lastMatchResultsByMatchId: Record<ActualMatchingMatchId, MatchAndReverseResult[]>;
|
|
100
114
|
lastUndoResultsByMatchId: Record<ActualMatchingMatchId, UndoReversalResult[]>;
|
|
101
115
|
matchIdsByPeriod: Record<MonthYearPeriodId, ActualMatchingMatchId[]>;
|
|
@@ -103,4 +117,6 @@ export interface ActualMatchingViewState extends FetchedState {
|
|
|
103
117
|
refreshStatus: FetchStateAndError;
|
|
104
118
|
uiState: ActualMatchingViewUIState;
|
|
105
119
|
undoReversalStatusByMatchId: Record<ActualMatchingMatchId, FetchStateAndError>;
|
|
120
|
+
closeMatchAfterIgnoreMatchId?: ActualMatchingMatchId;
|
|
121
|
+
closeMatchAfterUndoMatchId?: ActualMatchingMatchId;
|
|
106
122
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
3
|
+
exports.ALL_ACTUAL_MATCHING_IGNORE_REASONS = exports.toActualMatchingIgnoreReasonType = exports.toUndoReversalResultStatus = exports.toMatchAndReverseResultStatus = exports.MATCH_SEARCH_DEBOUNCE_MS = exports.MATCH_ACCRUAL_SEARCH_LIMIT = exports.MATCH_TRANSACTION_SEARCH_PAGE_SIZE = exports.toActualMatchingStatusFilter = exports.toActualMatchingSortKey = void 0;
|
|
4
4
|
exports.isMatchAndReverseCompleteStatus = isMatchAndReverseCompleteStatus;
|
|
5
5
|
exports.actualMatchingTransactionLineKey = actualMatchingTransactionLineKey;
|
|
6
6
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
@@ -19,6 +19,13 @@ const ACTUAL_MATCHING_SORT_KEYS = [
|
|
|
19
19
|
];
|
|
20
20
|
const toActualMatchingSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, ACTUAL_MATCHING_SORT_KEYS);
|
|
21
21
|
exports.toActualMatchingSortKey = toActualMatchingSortKey;
|
|
22
|
+
const ACTUAL_MATCHING_STATUS_FILTERS = [
|
|
23
|
+
'all',
|
|
24
|
+
'pending_review',
|
|
25
|
+
'reversed',
|
|
26
|
+
];
|
|
27
|
+
const toActualMatchingStatusFilter = (v) => (0, stringToUnion_1.stringToUnion)(v, ACTUAL_MATCHING_STATUS_FILTERS);
|
|
28
|
+
exports.toActualMatchingStatusFilter = toActualMatchingStatusFilter;
|
|
22
29
|
exports.MATCH_TRANSACTION_SEARCH_PAGE_SIZE = 50;
|
|
23
30
|
exports.MATCH_ACCRUAL_SEARCH_LIMIT = 50;
|
|
24
31
|
exports.MATCH_SEARCH_DEBOUNCE_MS = 300;
|
|
@@ -41,6 +48,16 @@ const UNDO_REVERSAL_RESULT_STATUSES = [
|
|
|
41
48
|
];
|
|
42
49
|
const toUndoReversalResultStatus = (v) => (0, stringToUnion_1.stringToUnion)(v, UNDO_REVERSAL_RESULT_STATUSES);
|
|
43
50
|
exports.toUndoReversalResultStatus = toUndoReversalResultStatus;
|
|
51
|
+
const ACTUAL_MATCHING_IGNORE_REASONS = [
|
|
52
|
+
'wrong_bill',
|
|
53
|
+
'wrong_period',
|
|
54
|
+
'amount_off',
|
|
55
|
+
'already_handled',
|
|
56
|
+
'other_ignore',
|
|
57
|
+
];
|
|
58
|
+
const toActualMatchingIgnoreReasonType = (v) => (0, stringToUnion_1.stringToUnion)(v, ACTUAL_MATCHING_IGNORE_REASONS);
|
|
59
|
+
exports.toActualMatchingIgnoreReasonType = toActualMatchingIgnoreReasonType;
|
|
60
|
+
exports.ALL_ACTUAL_MATCHING_IGNORE_REASONS = ACTUAL_MATCHING_IGNORE_REASONS;
|
|
44
61
|
function actualMatchingTransactionLineKey(transactionType, transactionIntegrationId, lineId) {
|
|
45
62
|
return `${transactionType}:${transactionIntegrationId}:${lineId}`;
|
|
46
63
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.62-beta0MM",
|
|
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",
|