@zeniai/client-epic-state 5.2.34 → 5.2.35-beta10MM
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/actualMatchingPayload.d.ts +31 -0
- package/lib/entity/actualMatching/actualMatchingPayload.js +50 -0
- package/lib/entity/actualMatching/actualMatchingReducer.d.ts +9 -0
- package/lib/entity/actualMatching/actualMatchingReducer.js +33 -0
- package/lib/entity/actualMatching/actualMatchingSelector.d.ts +3 -0
- package/lib/entity/actualMatching/actualMatchingSelector.js +6 -0
- package/lib/entity/actualMatching/actualMatchingState.d.ts +23 -0
- package/lib/entity/actualMatching/actualMatchingState.js +2 -0
- package/lib/entity/actualMatching/actualMatchingTypes.d.ts +1 -0
- package/lib/entity/actualMatching/actualMatchingTypes.js +2 -0
- package/lib/entity/aiCfo/aiCfoReducer.js +78 -4
- package/lib/entity/aiCfo/aiCfoState.d.ts +16 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +31 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +53 -0
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +33 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/epic.d.ts +8 -1
- package/lib/epic.js +14 -0
- package/lib/esm/entity/actualMatching/actualMatchingPayload.js +46 -0
- package/lib/esm/entity/actualMatching/actualMatchingReducer.js +30 -0
- package/lib/esm/entity/actualMatching/actualMatchingSelector.js +3 -0
- package/lib/esm/entity/actualMatching/actualMatchingState.js +1 -0
- package/lib/esm/entity/actualMatching/actualMatchingTypes.js +1 -0
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +79 -5
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +53 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/esm/epic.js +14 -0
- package/lib/esm/index.js +7 -3
- package/lib/esm/reducer.js +6 -0
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +44 -0
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingMatchEpic.js +36 -0
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +7 -0
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +107 -0
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/refreshActualMatchingList.js +16 -0
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +54 -0
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +74 -0
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/undoReversalAccrualsEpic.js +76 -0
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +25 -12
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -3
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +35 -15
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +8 -3
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -1
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +24 -6
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewState.js +4 -2
- package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +68 -0
- package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +434 -0
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -1
- package/lib/esm/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +1 -0
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +426 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +4 -0
- package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +35 -0
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -1
- package/lib/esm/view/financeStatement/financeStatementReducer.js +17 -27
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewPayload.js +4 -0
- package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +3 -3
- package/lib/index.d.ts +15 -6
- package/lib/index.js +82 -48
- package/lib/reducer.d.ts +2 -0
- package/lib/reducer.js +6 -0
- package/lib/rootStateTypes.d.ts +4 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +48 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingMatchEpic.d.ts +12 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingMatchEpic.js +40 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.d.ts +5 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +11 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +111 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/refreshActualMatchingList.d.ts +3 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/refreshActualMatchingList.js +19 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +58 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +78 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/undoReversalAccrualsEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/actualMatching/undoReversalAccrualsEpic.js +80 -0
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +25 -12
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.d.ts +5 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +34 -14
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +8 -3
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +24 -6
- package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +2 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewState.js +6 -3
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +85 -0
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +74 -0
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +79 -0
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +438 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +6 -5
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -1
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +87 -0
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +11 -0
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +38 -0
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +445 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +4 -0
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +105 -0
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +42 -0
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -1
- package/lib/view/financeStatement/financeStatementReducer.js +17 -27
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewPayload.d.ts +1 -11
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewPayload.js +4 -0
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.d.ts +1 -2
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.d.ts +1 -2
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewState.d.ts +15 -1
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
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 actualMatchingSelector_1 = require("../../../../entity/actualMatching/actualMatchingSelector");
|
|
7
|
+
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
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
|
+
const refreshActualMatchingList_1 = require("./refreshActualMatchingList");
|
|
13
|
+
function undoReversalSnackbar(results, vendorName) {
|
|
14
|
+
const undoneCount = results.filter((result) => result.status === 'undone').length;
|
|
15
|
+
const failedCount = results.length - undoneCount;
|
|
16
|
+
const variables = [
|
|
17
|
+
{ variableName: '_count_', variableValue: String(undoneCount) },
|
|
18
|
+
{ variableName: '_vendor_name_', variableValue: vendorName },
|
|
19
|
+
];
|
|
20
|
+
if (results.length > 0 && failedCount === 0) {
|
|
21
|
+
return (0, snackbarReducer_1.openSnackbar)({
|
|
22
|
+
messageSection: 'actual_matching_undo_reversal',
|
|
23
|
+
messageText: 'success',
|
|
24
|
+
type: 'success',
|
|
25
|
+
variables,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
if (undoneCount > 0 && failedCount > 0) {
|
|
29
|
+
return (0, snackbarReducer_1.openSnackbar)({
|
|
30
|
+
messageSection: 'actual_matching_undo_reversal',
|
|
31
|
+
messageText: 'notification',
|
|
32
|
+
type: 'warning',
|
|
33
|
+
variables,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return (0, snackbarReducer_1.openSnackbar)({
|
|
37
|
+
messageSection: 'actual_matching_undo_reversal',
|
|
38
|
+
messageText: 'failed',
|
|
39
|
+
type: 'error',
|
|
40
|
+
variables,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function matchVendorName(state, matchId) {
|
|
44
|
+
return ((0, actualMatchingSelector_1.getActualMatchingMatchById)(state.actualMatchingState, matchId)?.vendorName ??
|
|
45
|
+
'');
|
|
46
|
+
}
|
|
47
|
+
const undoReversalAccrualsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(actualMatchingViewReducer_1.undoReversalAccruals.match),
|
|
48
|
+
// Posts QBO deletes; drop duplicate clicks while the first request is in flight.
|
|
49
|
+
(0, operators_1.exhaustMap)((action) => {
|
|
50
|
+
const { accrualIds, matchId } = action.payload;
|
|
51
|
+
const body = {
|
|
52
|
+
accrual_ids: accrualIds,
|
|
53
|
+
};
|
|
54
|
+
const vendorName = matchVendorName(state$.value, matchId);
|
|
55
|
+
return zeniAPI
|
|
56
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/undo-reversal`, body)
|
|
57
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
58
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
59
|
+
const results = response.data.results.map(actualMatchingPayload_1.toUndoReversalResult);
|
|
60
|
+
const successActions = [
|
|
61
|
+
(0, actualMatchingViewReducer_1.undoReversalAccrualsSuccess)(matchId, results),
|
|
62
|
+
];
|
|
63
|
+
const anyUndone = results.some((result) => result.status === 'undone');
|
|
64
|
+
if (anyUndone) {
|
|
65
|
+
successActions.push(...(0, refreshActualMatchingList_1.refreshActualMatchingList)(state$.value), (0, actualMatchingViewReducer_1.fetchActualMatchingMatch)(matchId, true));
|
|
66
|
+
}
|
|
67
|
+
successActions.push(undoReversalSnackbar(results, vendorName));
|
|
68
|
+
return (0, rxjs_1.from)(successActions);
|
|
69
|
+
}
|
|
70
|
+
return (0, rxjs_1.of)((0, actualMatchingViewReducer_1.undoReversalAccrualsFailure)({
|
|
71
|
+
matchId,
|
|
72
|
+
status: response.status,
|
|
73
|
+
}), undoReversalSnackbar([], vendorName));
|
|
74
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, actualMatchingViewReducer_1.undoReversalAccrualsFailure)({
|
|
75
|
+
matchId,
|
|
76
|
+
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Undo reversal accruals REST API call errored out' +
|
|
77
|
+
JSON.stringify(error)),
|
|
78
|
+
}), undoReversalSnackbar([], vendorName))), (0, operators_1.takeUntil)(actions$.pipe((0, operators_1.filter)(rootActions_1.clearAll.match))));
|
|
79
|
+
}));
|
|
80
|
+
exports.undoReversalAccrualsEpic = undoReversalAccrualsEpic;
|
|
@@ -13,7 +13,7 @@ const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewRe
|
|
|
13
13
|
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
14
14
|
const jeSchedulesViewState_1 = require("../../types/jeSchedulesViewState");
|
|
15
15
|
const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(expenseAutomationViewReducer_1.fetchAllExpenseAutomationTabs.match), (0, operators_1.switchMap)((action) => {
|
|
16
|
-
const { cacheOverride, refreshViewInBackground } = action.payload;
|
|
16
|
+
const { cacheOverride, refreshViewInBackground, isAccrualEnabled } = action.payload;
|
|
17
17
|
const state = state$.value;
|
|
18
18
|
const { monthEndCloseChecksState } = state;
|
|
19
19
|
const { monthEndCloseChecksByTenantId } = monthEndCloseChecksState;
|
|
@@ -38,7 +38,7 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
|
|
|
38
38
|
amount: 75.0,
|
|
39
39
|
currencyCode: 'USD',
|
|
40
40
|
currencySymbol: '$',
|
|
41
|
-
}, cacheOverride, refreshViewInBackground), (0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null), (0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
|
|
41
|
+
}, cacheOverride, refreshViewInBackground), (0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null), (0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride, isAccrualEnabled));
|
|
42
42
|
if (reconciliationEnabled) {
|
|
43
43
|
actions.push((0, reconciliationViewReducer_1.fetchReconciliation)(selectedPeriod, undefined, cacheOverride, refreshViewInBackground));
|
|
44
44
|
}
|
|
@@ -64,16 +64,29 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
|
|
|
64
64
|
fetchActions.push((0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null));
|
|
65
65
|
}
|
|
66
66
|
// The two JE tabs cache separately, so only the tab actually being shown decides whether a
|
|
67
|
-
// fetch is still needed.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
state.
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
// fetch is still needed. Actual Matching is a third tab on the same page with its own
|
|
68
|
+
// endpoint; fetchJeSchedulesPage carries isAccrualEnabled so the prefetch epic can warm AM.
|
|
69
|
+
const selectedPageTab = state.expenseAutomationJESchedulesViewState.uiState.selectedPageTab;
|
|
70
|
+
if (selectedPageTab === 'actual_matching') {
|
|
71
|
+
const actualMatchingPeriodKeys = state.expenseAutomationActualMatchingViewState.matchIdsByPeriod[monthYearPeriodId];
|
|
72
|
+
if (state.expenseAutomationActualMatchingViewState.fetchState !==
|
|
73
|
+
'In-Progress' &&
|
|
74
|
+
(!state.expenseAutomationActualMatchingViewState.hasValidState() ||
|
|
75
|
+
actualMatchingPeriodKeys == null)) {
|
|
76
|
+
fetchActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride, isAccrualEnabled));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
const jeSchedulesPeriodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, monthYearPeriodId);
|
|
81
|
+
if (state.expenseAutomationJESchedulesViewState.fetchState !==
|
|
82
|
+
'In-Progress' &&
|
|
83
|
+
(!state.expenseAutomationJESchedulesViewState.hasValidState() ||
|
|
84
|
+
state.expenseAutomationJESchedulesViewState
|
|
85
|
+
.jeScheduleTransactionKeysByPeriodAndTab[jeSchedulesPeriodTabKey] == null ||
|
|
86
|
+
state.expenseAutomationJESchedulesViewState
|
|
87
|
+
.failedJeScheduleTransactionKeysByPeriodAndTab[jeSchedulesPeriodTabKey] == null)) {
|
|
88
|
+
fetchActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride, isAccrualEnabled));
|
|
89
|
+
}
|
|
77
90
|
}
|
|
78
91
|
if (state.expenseAutomationReconciliationViewState.fetchState !==
|
|
79
92
|
'In-Progress' &&
|
|
@@ -2,6 +2,7 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { RootState } from '../../../../rootStateTypes';
|
|
4
4
|
import { fetchAccountList } from '../../../accountList/accountListReducer';
|
|
5
|
+
import { fetchActualMatchingPage } from '../../reducers/actualMatchingViewReducer';
|
|
5
6
|
import { fetchJeSchedules, fetchJeSchedulesPage, initializeAccountSettingsView } from '../../reducers/jeSchedulesViewReducer';
|
|
6
|
-
export type ActionType = ReturnType<typeof fetchAccountList> | ReturnType<typeof fetchJeSchedules> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof initializeAccountSettingsView>;
|
|
7
|
+
export type ActionType = ReturnType<typeof fetchAccountList> | ReturnType<typeof fetchActualMatchingPage> | ReturnType<typeof fetchJeSchedules> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof initializeAccountSettingsView>;
|
|
7
8
|
export declare const fetchJeSchedulesPageEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -5,24 +5,34 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const accountListReducer_1 = require("../../../accountList/accountListReducer");
|
|
7
7
|
const scheduleListHelper_1 = require("../../../scheduleView/scheduleListView/scheduleListHelper");
|
|
8
|
+
const actualMatchingViewReducer_1 = require("../../reducers/actualMatchingViewReducer");
|
|
8
9
|
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
9
10
|
const fetchJeSchedulesPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.fetchJeSchedulesPage.match), (0, operators_1.mergeMap)((action) => {
|
|
10
11
|
const jeSchedulePageActions = [];
|
|
11
12
|
const { period, refreshViewInBackground } = action.payload;
|
|
13
|
+
const state = state$.value;
|
|
14
|
+
const { selectedPageTab } = state.expenseAutomationJESchedulesViewState.uiState;
|
|
12
15
|
const accountType = (0, scheduleListHelper_1.getAccountsTypesForScheduleEpics)();
|
|
13
|
-
const accountListState = state
|
|
16
|
+
const accountListState = state.accountListState;
|
|
14
17
|
if (accountListState.byReportId[accountType.accountListKey].fetchState ===
|
|
15
18
|
'Not-Started') {
|
|
16
19
|
// call this only if the account list for schedules is not fetched already
|
|
17
20
|
jeSchedulePageActions.push((0, accountListReducer_1.fetchAccountList)(accountType.accountListKey, true, false, false, false, accountType.allowedAccountList));
|
|
18
21
|
}
|
|
19
|
-
|
|
22
|
+
// AM is chrome on this page but a different endpoint. fetchJeSchedules with
|
|
23
|
+
// selectedPageTab === 'actual_matching' would hit /1.0/schedules and write a bogus cache slot.
|
|
24
|
+
if (selectedPageTab === 'actual_matching') {
|
|
25
|
+
jeSchedulePageActions.push((0, actualMatchingViewReducer_1.fetchActualMatchingPage)(period, refreshViewInBackground));
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
jeSchedulePageActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedules)(period, refreshViewInBackground));
|
|
29
|
+
}
|
|
20
30
|
// Only on the first page load. Account settings cannot change from a tab switch or a
|
|
21
31
|
// refresh, and re-initializing puts accountSettingsView back to 'In-Progress' -- which the
|
|
22
32
|
// page reads as "still loading" and answers with a full skeleton over rows it already has.
|
|
23
33
|
// The action also resets localData, so re-dispatching it blindly would empty the settings
|
|
24
34
|
// form until the refetch lands. Saving account settings still re-initializes explicitly.
|
|
25
|
-
if (!state
|
|
35
|
+
if (!state.expenseAutomationJESchedulesViewState.accountSettings
|
|
26
36
|
.hasLoadedAccountSettings) {
|
|
27
37
|
jeSchedulePageActions.push((0, jeSchedulesViewReducer_1.initializeAccountSettingsView)());
|
|
28
38
|
}
|
package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { RootState } from '../../../../rootStateTypes';
|
|
4
|
+
import { fetchActualMatchingPage } from '../../reducers/actualMatchingViewReducer';
|
|
4
5
|
import { fetchJeSchedules, fetchJeSchedulesPage } from '../../reducers/jeSchedulesViewReducer';
|
|
5
|
-
export type ActionType = ReturnType<typeof fetchJeSchedules> | ReturnType<typeof fetchJeSchedulesPage>;
|
|
6
|
+
export type ActionType = ReturnType<typeof fetchActualMatchingPage> | ReturnType<typeof fetchJeSchedules> | ReturnType<typeof fetchJeSchedulesPage>;
|
|
6
7
|
/**
|
|
7
8
|
* Warms the tab the user is not looking at, so switching to it renders rows instead of a skeleton.
|
|
8
9
|
*
|
|
9
10
|
* Listens for `fetchJeSchedulesPage` rather than `fetchJeSchedules` on purpose: the prefetch emits
|
|
10
11
|
* `fetchJeSchedules`, so listening for that would make this epic feed itself.
|
|
12
|
+
*
|
|
13
|
+
* Review <-> Existing share `/1.0/schedules`. Actual Matching is a different endpoint; it is
|
|
14
|
+
* warmed with `fetchActualMatchingPage` when the page action carries `isAccrualEnabled`.
|
|
11
15
|
*/
|
|
12
16
|
export declare const prefetchOtherJeSchedulesTabEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -5,6 +5,7 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
|
|
7
7
|
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
8
|
+
const actualMatchingViewReducer_1 = require("../../reducers/actualMatchingViewReducer");
|
|
8
9
|
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
9
10
|
const jeSchedulesViewState_1 = require("../../types/jeSchedulesViewState");
|
|
10
11
|
/**
|
|
@@ -12,28 +13,47 @@ const jeSchedulesViewState_1 = require("../../types/jeSchedulesViewState");
|
|
|
12
13
|
*
|
|
13
14
|
* Listens for `fetchJeSchedulesPage` rather than `fetchJeSchedules` on purpose: the prefetch emits
|
|
14
15
|
* `fetchJeSchedules`, so listening for that would make this epic feed itself.
|
|
16
|
+
*
|
|
17
|
+
* Review <-> Existing share `/1.0/schedules`. Actual Matching is a different endpoint; it is
|
|
18
|
+
* warmed with `fetchActualMatchingPage` when the page action carries `isAccrualEnabled`.
|
|
15
19
|
*/
|
|
16
20
|
const prefetchOtherJeSchedulesTabEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.fetchJeSchedulesPage.match), (0, operators_1.mergeMap)((action) => {
|
|
17
21
|
const state = state$.value;
|
|
18
|
-
const { period } = action.payload;
|
|
22
|
+
const { period, isAccrualEnabled } = action.payload;
|
|
19
23
|
const { selectedPageTab } = state.expenseAutomationJESchedulesViewState.uiState;
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
const actions = [];
|
|
25
|
+
// AM is chrome-only on ALL_JE_PAGE_TABS; warming it with fetchJeSchedules
|
|
26
|
+
// would hit the wrong endpoint.
|
|
27
|
+
const otherPageTab = jeSchedulesViewState_1.ALL_JE_PAGE_TABS.find((pageTab) => pageTab !== selectedPageTab && pageTab !== 'actual_matching');
|
|
24
28
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
25
29
|
const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
|
|
26
|
-
if (selectedPeriod
|
|
27
|
-
|
|
30
|
+
if (otherPageTab != null && selectedPeriod != null) {
|
|
31
|
+
const otherPeriodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(otherPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
|
|
32
|
+
const isOtherTabAlreadyLoaded = state.expenseAutomationJESchedulesViewState
|
|
33
|
+
.jeScheduleTransactionKeysByPeriodAndTab[otherPeriodTabKey] != null;
|
|
34
|
+
if (!isOtherTabAlreadyLoaded) {
|
|
35
|
+
actions.push((0, jeSchedulesViewReducer_1.fetchJeSchedules)(period, true, otherPageTab));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// GET /actual-matching is not Statsig-gated; CES has no Statsig. The screen
|
|
39
|
+
// passes is_accrual_enabled so disabled tenants do not pay for a list they
|
|
40
|
+
// cannot open. Visible AM is fetchJeSchedulesPageEpic's job.
|
|
41
|
+
if (isAccrualEnabled === true &&
|
|
42
|
+
selectedPageTab !== 'actual_matching') {
|
|
43
|
+
const periodId = (0, timePeriod_1.toMonthYearPeriodId)({
|
|
44
|
+
month: period.start.month,
|
|
45
|
+
year: period.start.year,
|
|
46
|
+
});
|
|
47
|
+
// `fetchState` is global across months. Skipping on In-Progress would drop
|
|
48
|
+
// October prefetch while September is still loading; September's success
|
|
49
|
+
// then marks the slice Completed and October looks loaded with no ids.
|
|
50
|
+
if (state.expenseAutomationActualMatchingViewState.matchIdsByPeriod[periodId] == null) {
|
|
51
|
+
actions.push((0, actualMatchingViewReducer_1.fetchActualMatchingPage)(period, true));
|
|
52
|
+
}
|
|
28
53
|
}
|
|
29
|
-
|
|
30
|
-
// just left, since a switch also fires fetchJeSchedulesPage.
|
|
31
|
-
const otherPeriodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(otherPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
|
|
32
|
-
const isOtherTabAlreadyLoaded = state.expenseAutomationJESchedulesViewState
|
|
33
|
-
.jeScheduleTransactionKeysByPeriodAndTab[otherPeriodTabKey] != null;
|
|
34
|
-
if (isOtherTabAlreadyLoaded) {
|
|
54
|
+
if (actions.length === 0) {
|
|
35
55
|
return rxjs_1.EMPTY;
|
|
36
56
|
}
|
|
37
|
-
return (0, rxjs_1.
|
|
57
|
+
return (0, rxjs_1.from)(actions);
|
|
38
58
|
}));
|
|
39
59
|
exports.prefetchOtherJeSchedulesTabEpic = prefetchOtherJeSchedulesTabEpic;
|
|
@@ -6,11 +6,16 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
|
|
7
7
|
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
8
8
|
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
9
|
-
const switchJESchedulesTabEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.updateJESchedulesUIState.match), (0, operators_1.filter)((action) => action.payload.selectedPageTab != null), (0, operators_1.mergeMap)(() => {
|
|
9
|
+
const switchJESchedulesTabEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.updateJESchedulesUIState.match), (0, operators_1.filter)((action) => action.payload.selectedPageTab != null), (0, operators_1.mergeMap)((action) => {
|
|
10
10
|
const state = state$.value;
|
|
11
|
+
const nextTab = action.payload.selectedPageTab;
|
|
11
12
|
const { fetchState, refreshStatus } = state.expenseAutomationJESchedulesViewState;
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
// Review/Existing share `/1.0/schedules`; skip a second JE fetch while one
|
|
14
|
+
// is in flight. AM is a different endpoint — do not block it on JE
|
|
15
|
+
// In-Progress or the tab stays on a skeleton until the user leaves.
|
|
16
|
+
if (nextTab !== 'actual_matching' &&
|
|
17
|
+
(fetchState === 'In-Progress' ||
|
|
18
|
+
refreshStatus.fetchState === 'In-Progress')) {
|
|
14
19
|
return rxjs_1.EMPTY;
|
|
15
20
|
}
|
|
16
21
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
@@ -2,9 +2,10 @@ import { ID } from '../../commonStateTypes/common';
|
|
|
2
2
|
import { MonthYearPeriod } from '../../commonStateTypes/timePeriod';
|
|
3
3
|
import { ExpenseAutomationViewState } from './expenseAutomationViewState';
|
|
4
4
|
export declare const initialState: ExpenseAutomationViewState;
|
|
5
|
-
export declare const fetchAllExpenseAutomationTabs: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined, refreshViewInBackground?: boolean | undefined], {
|
|
5
|
+
export declare const fetchAllExpenseAutomationTabs: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined, refreshViewInBackground?: boolean | undefined, isAccrualEnabled?: boolean | undefined], {
|
|
6
6
|
cacheOverride: boolean;
|
|
7
7
|
refreshViewInBackground: boolean;
|
|
8
|
+
isAccrualEnabled: boolean;
|
|
8
9
|
}, "expenseAutomationView/fetchAllExpenseAutomationTabs", never, never>, updateCurrentSelectedPeriod: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, newSelectedPeriod: MonthYearPeriod], {
|
|
9
10
|
newSelectedPeriod: MonthYearPeriod;
|
|
10
11
|
tenantId: string;
|
|
@@ -23,11 +23,12 @@ const expenseAutomationView = (0, toolkit_1.createSlice)({
|
|
|
23
23
|
reducer() {
|
|
24
24
|
//do nothing
|
|
25
25
|
},
|
|
26
|
-
prepare(cacheOverride = false, refreshViewInBackground = false) {
|
|
26
|
+
prepare(cacheOverride = false, refreshViewInBackground = false, isAccrualEnabled = false) {
|
|
27
27
|
return {
|
|
28
28
|
payload: {
|
|
29
29
|
cacheOverride,
|
|
30
30
|
refreshViewInBackground,
|
|
31
|
+
isAccrualEnabled,
|
|
31
32
|
},
|
|
32
33
|
};
|
|
33
34
|
},
|
|
@@ -7,6 +7,7 @@ const monthEndCloseChecksSelector_1 = require("../../entity/monthEndCloseChecks/
|
|
|
7
7
|
const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
|
|
8
8
|
const companyMonthEndReportViewSelector_1 = require("../companyMonthEndReportView/companyMonthEndReportViewSelector");
|
|
9
9
|
const monthEndCloseChecksViewSelector_1 = require("../monthEndCloseChecksView/monthEndCloseChecksViewSelector");
|
|
10
|
+
const actualMatchingViewSelector_1 = require("./selectors/actualMatchingViewSelector");
|
|
10
11
|
const fluxAnalysisViewSelector_1 = require("./selectors/fluxAnalysisViewSelector");
|
|
11
12
|
const getAllStepsHelper_1 = require("./selectors/getAllStepsHelper");
|
|
12
13
|
const jeSchedulesViewSelector_1 = require("./selectors/jeSchedulesViewSelector");
|
|
@@ -45,6 +46,8 @@ function getExpenseAutomationView(state) {
|
|
|
45
46
|
const reconciliation = (0, reconciliationViewSelector_1.getExpenseAutomationReconciliationView)(state);
|
|
46
47
|
const expenseAutomationTransactionsView = (0, transactionCategorizationSelector_1.getExpenseAutomationTransactionView)(state);
|
|
47
48
|
const jeSchedules = (0, jeSchedulesViewSelector_1.getExpenseAutomationJESchedulesView)(state);
|
|
49
|
+
// Top-level sibling of `jeSchedules`: see ExpenseAutomationViewSelector.
|
|
50
|
+
const actualMatching = (0, actualMatchingViewSelector_1.getExpenseAutomationActualMatchingView)(state);
|
|
48
51
|
switch (currentSelectedView) {
|
|
49
52
|
case 'reconciliation':
|
|
50
53
|
currentSelectedViewFetchState = reconciliation.fetchStatus;
|
|
@@ -57,12 +60,23 @@ function getExpenseAutomationView(state) {
|
|
|
57
60
|
fluxAnalysis.refreshStatus;
|
|
58
61
|
break;
|
|
59
62
|
case 'je_schedules':
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
if (expenseAutomationJESchedulesViewState.uiState.selectedPageTab ===
|
|
64
|
+
'actual_matching') {
|
|
65
|
+
currentSelectedViewFetchState = {
|
|
66
|
+
fetchState: actualMatching.fetchState,
|
|
67
|
+
error: actualMatching.error,
|
|
68
|
+
};
|
|
69
|
+
currentSelectedViewBackgroundRefreshFetchState =
|
|
70
|
+
actualMatching.refreshStatus;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
currentSelectedViewFetchState = {
|
|
74
|
+
fetchState: jeSchedules.fetchState,
|
|
75
|
+
error: jeSchedules.error,
|
|
76
|
+
};
|
|
77
|
+
currentSelectedViewBackgroundRefreshFetchState =
|
|
78
|
+
jeSchedules.refreshStatus;
|
|
79
|
+
}
|
|
66
80
|
break;
|
|
67
81
|
case 'missing_receipts':
|
|
68
82
|
currentSelectedViewFetchState = {
|
|
@@ -91,6 +105,9 @@ function getExpenseAutomationView(state) {
|
|
|
91
105
|
};
|
|
92
106
|
break;
|
|
93
107
|
}
|
|
108
|
+
// AM is optional (flag-off / background prefetch) and must not keep the
|
|
109
|
+
// page-level AND-complete fetchState stuck on Not-Started. Tab chrome uses
|
|
110
|
+
// currentSelectedViewFetchState, which already switches to AM when selected.
|
|
94
111
|
const fetchStateVariables = [
|
|
95
112
|
expenseAutomationMissingReceiptsViewState,
|
|
96
113
|
expenseAutomationJESchedulesViewState,
|
|
@@ -179,6 +196,7 @@ function getExpenseAutomationView(state) {
|
|
|
179
196
|
]);
|
|
180
197
|
return {
|
|
181
198
|
jeSchedules,
|
|
199
|
+
actualMatching,
|
|
182
200
|
transactionView: expenseAutomationTransactionsView,
|
|
183
201
|
missingReceipts,
|
|
184
202
|
reconciliation,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { FetchStateAndError, FetchedState, ID } from '../../commonStateTypes/common';
|
|
2
2
|
import { MonthYearPeriod } from '../../commonStateTypes/timePeriod';
|
|
3
|
-
export declare const EXPENSE_AUTOMATION_VIEW_TYPES: readonly ["transaction_categorization", "je_schedules", "reconciliation", "missing_receipts", "flux_analysis", "month_end_insights"];
|
|
4
3
|
export declare const toExpenseAutomationViewType: (v: string) => "transaction_categorization" | "je_schedules" | "reconciliation" | "missing_receipts" | "flux_analysis" | "month_end_insights";
|
|
5
4
|
export type ExpenseAutomationViewType = ReturnType<typeof toExpenseAutomationViewType>;
|
|
5
|
+
/** Unlike `toExpenseAutomationViewType`, unknown strings return `undefined`. */
|
|
6
|
+
export declare const toExpenseAutomationViewTypeStrict: (v: string) => ExpenseAutomationViewType | undefined;
|
|
6
7
|
export interface ExpenseAutomationViewState extends FetchedState {
|
|
7
8
|
currentSelectedView: ExpenseAutomationViewType;
|
|
8
9
|
saveStatus: FetchStateAndError;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toExpenseAutomationViewTypeStrict = exports.toExpenseAutomationViewType = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
5
|
-
|
|
5
|
+
const EXPENSE_AUTOMATION_VIEW_TYPES = [
|
|
6
6
|
'transaction_categorization',
|
|
7
7
|
'je_schedules',
|
|
8
8
|
'reconciliation',
|
|
@@ -10,5 +10,8 @@ exports.EXPENSE_AUTOMATION_VIEW_TYPES = [
|
|
|
10
10
|
'flux_analysis',
|
|
11
11
|
'month_end_insights',
|
|
12
12
|
];
|
|
13
|
-
const toExpenseAutomationViewType = (v) => (0, stringToUnion_1.stringToUnion)(v,
|
|
13
|
+
const toExpenseAutomationViewType = (v) => (0, stringToUnion_1.stringToUnion)(v, EXPENSE_AUTOMATION_VIEW_TYPES);
|
|
14
14
|
exports.toExpenseAutomationViewType = toExpenseAutomationViewType;
|
|
15
|
+
/** Unlike `toExpenseAutomationViewType`, unknown strings return `undefined`. */
|
|
16
|
+
const toExpenseAutomationViewTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, EXPENSE_AUTOMATION_VIEW_TYPES);
|
|
17
|
+
exports.toExpenseAutomationViewTypeStrict = toExpenseAutomationViewTypeStrict;
|
package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: S
|
|
|
39
39
|
export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
|
|
40
40
|
export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
|
|
41
41
|
export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
|
|
42
|
-
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_approval_reorder" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_approval_reorder" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "card_policy_created" | "card_policy_updated" | "card_policy_deleted" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "revert_schedule" | "ignore_accrual" | "revert_accrual" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "create_transfer_entry" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "accounting_projects_enabled_update" | "accounting_projects_qbo_not_enabled" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "confirm_statement_mapping" | "statement_parsing_in_progress" | "statement_parsing_complete" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron" | "create_sub_task" | "qbo_connection_already_linked" | "qbo_connection_failed" | "accounting_projects_qbo_reconnect_failed" | "product_services_update" | "qbo_realm_id_update" | "invoicing_dunning_case_resolved" | "invoicing_dunning_retry" | "invoicing_dunning_cancel" | "invoicing_dunning_settings_save" | "invoicing_qbo_backfill" | "invoicing_qbo_sync_health_retry" | "invoicing_qbo_settings_save" | "invoicing_branding_save" | "invoicing_discount_archive" | "invoicing_discount_unarchive" | "invoicing_discount_delete" | "invoicing_invoice_reminder_sent" | "invoicing_invoice_regenerated" | "invoicing_invoice_voided" | "invoicing_catalog_item_saved" | "invoicing_customer_saved" | "invoicing_subscription_saved" | "invoicing_coupon_saved" | "invoicing_invoice_saved" | "invoicing_credit_note_saved" | "invoicing_payment_recorded" | "invoicing_subscription_activated" | "invoicing_subscription_cancellation_removed" | "invoicing_subscription_cancelled" | "invoicing_subscription_non_renewing" | "invoicing_subscription_paused" | "invoicing_subscription_reactivated" | "invoicing_subscription_resumed" | "invoicing_subscription_term_end_changed";
|
|
42
|
+
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "actual_matching_match_and_reverse" | "actual_matching_undo_reversal" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_approval_reorder" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_approval_reorder" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "card_policy_created" | "card_policy_updated" | "card_policy_deleted" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "revert_schedule" | "ignore_accrual" | "revert_accrual" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "create_transfer_entry" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "accounting_projects_enabled_update" | "accounting_projects_qbo_not_enabled" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "confirm_statement_mapping" | "statement_parsing_in_progress" | "statement_parsing_complete" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron" | "create_sub_task" | "qbo_connection_already_linked" | "qbo_connection_failed" | "accounting_projects_qbo_reconnect_failed" | "product_services_update" | "qbo_realm_id_update" | "invoicing_dunning_case_resolved" | "invoicing_dunning_retry" | "invoicing_dunning_cancel" | "invoicing_dunning_settings_save" | "invoicing_qbo_backfill" | "invoicing_qbo_sync_health_retry" | "invoicing_qbo_settings_save" | "invoicing_branding_save" | "invoicing_discount_archive" | "invoicing_discount_unarchive" | "invoicing_discount_delete" | "invoicing_invoice_reminder_sent" | "invoicing_invoice_regenerated" | "invoicing_invoice_voided" | "invoicing_catalog_item_saved" | "invoicing_customer_saved" | "invoicing_subscription_saved" | "invoicing_coupon_saved" | "invoicing_invoice_saved" | "invoicing_credit_note_saved" | "invoicing_payment_recorded" | "invoicing_subscription_activated" | "invoicing_subscription_cancellation_removed" | "invoicing_subscription_cancelled" | "invoicing_subscription_non_renewing" | "invoicing_subscription_paused" | "invoicing_subscription_reactivated" | "invoicing_subscription_resumed" | "invoicing_subscription_term_end_changed";
|
|
43
43
|
messageText: "notification" | "failed" | "success";
|
|
44
44
|
type: "error" | "success" | "info";
|
|
45
45
|
variables: {
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { ID } from '../../../commonStateTypes/common';
|
|
2
|
+
import { TimePeriod } from '../../../commonStateTypes/timePeriod';
|
|
3
|
+
import { ActualMatchingListResponsePayload, DisplayCurrencyFallback } from '../../../entity/actualMatching/actualMatchingPayload';
|
|
4
|
+
import { JEOneTimeAccrualPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
|
|
5
|
+
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
6
|
+
import { ActualMatchingTransactionSearchResult, MatchAndReverseResult, UndoReversalResult } from '../types/actualMatchingViewState';
|
|
7
|
+
export declare function toServiceMonthFromPeriod(period: TimePeriod): string;
|
|
8
|
+
export type ActualMatchingListResponse = ZeniAPIResponse<ActualMatchingListResponsePayload>;
|
|
9
|
+
export interface ActualMatchingAccrualSearchResponsePayload {
|
|
10
|
+
accruals: JEOneTimeAccrualPayload[];
|
|
11
|
+
total: number;
|
|
12
|
+
limit?: number | null;
|
|
13
|
+
offset?: number | null;
|
|
14
|
+
}
|
|
15
|
+
export type ActualMatchingAccrualSearchResponse = ZeniAPIResponse<ActualMatchingAccrualSearchResponsePayload>;
|
|
16
|
+
export interface MatchTransactionSearchQueryPayload {
|
|
17
|
+
page_size: number;
|
|
18
|
+
search_text: string;
|
|
19
|
+
page_token?: string | null;
|
|
20
|
+
transaction_integration_id?: string;
|
|
21
|
+
transaction_type?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface MatchTransactionSearchResultPayload {
|
|
24
|
+
line_id: string;
|
|
25
|
+
transaction_date: string;
|
|
26
|
+
transaction_id: ID;
|
|
27
|
+
transaction_integration_id: string;
|
|
28
|
+
transaction_type: string;
|
|
29
|
+
account_description?: string | null;
|
|
30
|
+
account_id?: ID | null;
|
|
31
|
+
account_name?: string | null;
|
|
32
|
+
accounting_class_id?: ID | null;
|
|
33
|
+
accounting_class_name?: string | null;
|
|
34
|
+
amount?: number | null;
|
|
35
|
+
currency_code?: string | null;
|
|
36
|
+
currency_symbol?: string | null;
|
|
37
|
+
sync_token?: string | null;
|
|
38
|
+
total_amount?: number | null;
|
|
39
|
+
transaction_description?: string | null;
|
|
40
|
+
transaction_memo?: string | null;
|
|
41
|
+
transaction_type_name?: string | null;
|
|
42
|
+
vendor_id?: ID | null;
|
|
43
|
+
vendor_name?: string | null;
|
|
44
|
+
}
|
|
45
|
+
export interface MatchTransactionSearchResponsePayload {
|
|
46
|
+
transactions: MatchTransactionSearchResultPayload[];
|
|
47
|
+
next_page_token?: string | null;
|
|
48
|
+
}
|
|
49
|
+
export type MatchTransactionSearchResponse = ZeniAPIResponse<MatchTransactionSearchResponsePayload>;
|
|
50
|
+
export declare function toActualMatchingTransactionSearchResult(payload: MatchTransactionSearchResultPayload, fallbackCurrency?: DisplayCurrencyFallback): ActualMatchingTransactionSearchResult;
|
|
51
|
+
export interface MatchAndReverseRequestPayload {
|
|
52
|
+
accrual_ids: ID[];
|
|
53
|
+
line_ids: ID[];
|
|
54
|
+
transaction_id: ID;
|
|
55
|
+
transaction_integration_id: string;
|
|
56
|
+
transaction_sync_token: string;
|
|
57
|
+
transaction_type: string;
|
|
58
|
+
}
|
|
59
|
+
export interface MatchAndReverseResultPayload {
|
|
60
|
+
accrual_id: ID;
|
|
61
|
+
status: string;
|
|
62
|
+
reason?: string | null;
|
|
63
|
+
}
|
|
64
|
+
export interface MatchAndReverseResponsePayload {
|
|
65
|
+
match_batch_id: string;
|
|
66
|
+
results: MatchAndReverseResultPayload[];
|
|
67
|
+
transaction_id: ID;
|
|
68
|
+
transaction_integration_id: string;
|
|
69
|
+
}
|
|
70
|
+
export type MatchAndReverseResponse = ZeniAPIResponse<MatchAndReverseResponsePayload>;
|
|
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;
|