@zeniai/client-epic-state 5.2.35-beta0MM → 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 +7 -1
- package/lib/entity/actualMatching/actualMatchingPayload.js +19 -12
- package/lib/entity/actualMatching/actualMatchingReducer.d.ts +3 -2
- package/lib/entity/actualMatching/actualMatchingReducer.js +3 -3
- package/lib/entity/actualMatching/actualMatchingState.d.ts +3 -2
- package/lib/entity/aiCfo/aiCfoReducer.js +78 -4
- package/lib/entity/aiCfo/aiCfoState.d.ts +16 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +2 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +4 -0
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +2 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/esm/entity/actualMatching/actualMatchingPayload.js +18 -12
- package/lib/esm/entity/actualMatching/actualMatchingReducer.js +3 -3
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +79 -5
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +4 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/esm/index.js +6 -6
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +3 -5
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingMatchEpic.js +3 -2
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +80 -25
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/refreshActualMatchingList.js +16 -0
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +16 -6
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +12 -11
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/undoReversalAccrualsEpic.js +50 -26
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +5 -9
- package/lib/esm/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +1 -9
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -3
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +34 -16
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +8 -8
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -1
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +5 -2
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewState.js +4 -2
- package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +10 -10
- package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +90 -20
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -1
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +206 -61
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +1 -0
- package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +3 -0
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +3 -0
- package/lib/esm/view/financeStatement/financeStatementReducer.js +17 -27
- package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +3 -3
- package/lib/index.d.ts +7 -6
- package/lib/index.js +52 -48
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +3 -5
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingMatchEpic.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingMatchEpic.js +3 -2
- package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +77 -22
- 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 +3 -2
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +15 -5
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +10 -9
- package/lib/view/expenseAutomationView/epics/actualMatching/undoReversalAccrualsEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/actualMatching/undoReversalAccrualsEpic.js +48 -24
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +1 -2
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +5 -9
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +1 -2
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +1 -9
- 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 +33 -15
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +1 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +8 -8
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +5 -2
- 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 +3 -3
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +10 -10
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +21 -16
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +90 -20
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -1
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -1
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +13 -9
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +9 -0
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +11 -2
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +209 -60
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +1 -0
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +8 -2
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +4 -0
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +3 -0
- package/lib/view/financeStatement/financeStatementReducer.js +17 -27
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +2 -2
- package/package.json +1 -1
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,30 +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
|
-
|
|
21
|
-
//
|
|
24
|
+
const actions = [];
|
|
25
|
+
// AM is chrome-only on ALL_JE_PAGE_TABS; warming it with fetchJeSchedules
|
|
26
|
+
// would hit the wrong endpoint.
|
|
22
27
|
const otherPageTab = jeSchedulesViewState_1.ALL_JE_PAGE_TABS.find((pageTab) => pageTab !== selectedPageTab && pageTab !== 'actual_matching');
|
|
23
|
-
if (otherPageTab == null) {
|
|
24
|
-
return rxjs_1.EMPTY;
|
|
25
|
-
}
|
|
26
28
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
27
29
|
const selectedPeriod = state.expenseAutomationViewState.selectedPeriodByTenantId[currentTenant.tenantId];
|
|
28
|
-
if (selectedPeriod
|
|
29
|
-
|
|
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
|
+
}
|
|
30
53
|
}
|
|
31
|
-
|
|
32
|
-
// just left, since a switch also fires fetchJeSchedulesPage.
|
|
33
|
-
const otherPeriodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(otherPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
|
|
34
|
-
const isOtherTabAlreadyLoaded = state.expenseAutomationJESchedulesViewState
|
|
35
|
-
.jeScheduleTransactionKeysByPeriodAndTab[otherPeriodTabKey] != null;
|
|
36
|
-
if (isOtherTabAlreadyLoaded) {
|
|
54
|
+
if (actions.length === 0) {
|
|
37
55
|
return rxjs_1.EMPTY;
|
|
38
56
|
}
|
|
39
|
-
return (0, rxjs_1.
|
|
57
|
+
return (0, rxjs_1.from)(actions);
|
|
40
58
|
}));
|
|
41
59
|
exports.prefetchOtherJeSchedulesTabEpic = prefetchOtherJeSchedulesTabEpic;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { RootState } from '../../../../reducer';
|
|
4
|
-
import { fetchActualMatchingPage } from '../../reducers/actualMatchingViewReducer';
|
|
5
4
|
import { fetchJeSchedulesPage, updateJESchedulesUIState } from '../../reducers/jeSchedulesViewReducer';
|
|
6
|
-
export type ActionType = ReturnType<typeof
|
|
5
|
+
export type ActionType = ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof updateJESchedulesUIState>;
|
|
7
6
|
export declare const switchJESchedulesTabEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -5,13 +5,17 @@ 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");
|
|
9
8
|
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
10
|
-
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) => {
|
|
11
10
|
const state = state$.value;
|
|
11
|
+
const nextTab = action.payload.selectedPageTab;
|
|
12
12
|
const { fetchState, refreshStatus } = state.expenseAutomationJESchedulesViewState;
|
|
13
|
-
|
|
14
|
-
|
|
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')) {
|
|
15
19
|
return rxjs_1.EMPTY;
|
|
16
20
|
}
|
|
17
21
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
@@ -28,10 +32,6 @@ const switchJESchedulesTabEpic = (actions$, state$) => actions$.pipe((0, operato
|
|
|
28
32
|
if (timePeriodStart == null || timePeriodEnd == null) {
|
|
29
33
|
return rxjs_1.EMPTY;
|
|
30
34
|
}
|
|
31
|
-
const { selectedPageTab } = state.expenseAutomationJESchedulesViewState.uiState;
|
|
32
|
-
if (selectedPageTab === 'actual_matching') {
|
|
33
|
-
return (0, rxjs_1.of)((0, actualMatchingViewReducer_1.fetchActualMatchingPage)({ start: timePeriodStart, end: timePeriodEnd }, true));
|
|
34
|
-
}
|
|
35
35
|
return (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, true));
|
|
36
36
|
}));
|
|
37
37
|
exports.switchJESchedulesTabEpic = switchJESchedulesTabEpic;
|
|
@@ -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
|
},
|
|
@@ -25,7 +25,7 @@ const isPreviousStepDisabled = (selectedTransactionCategorizationTab, allSteps,
|
|
|
25
25
|
return allSteps[stepIndex - 1].isDisabled;
|
|
26
26
|
};
|
|
27
27
|
function getExpenseAutomationView(state) {
|
|
28
|
-
const { expenseAutomationViewState, tenantState, expenseAutomationMissingReceiptsViewState, expenseAutomationJESchedulesViewState,
|
|
28
|
+
const { expenseAutomationViewState, tenantState, expenseAutomationMissingReceiptsViewState, expenseAutomationJESchedulesViewState, expenseAutomationTransactionsViewState, expenseAutomationReconciliationViewState, monthEndCloseChecksState, companyState, } = state;
|
|
29
29
|
const { loggedInUser, currentTenantId } = tenantState;
|
|
30
30
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
31
31
|
const { currentSelectedView, selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
@@ -46,6 +46,7 @@ function getExpenseAutomationView(state) {
|
|
|
46
46
|
const reconciliation = (0, reconciliationViewSelector_1.getExpenseAutomationReconciliationView)(state);
|
|
47
47
|
const expenseAutomationTransactionsView = (0, transactionCategorizationSelector_1.getExpenseAutomationTransactionView)(state);
|
|
48
48
|
const jeSchedules = (0, jeSchedulesViewSelector_1.getExpenseAutomationJESchedulesView)(state);
|
|
49
|
+
// Top-level sibling of `jeSchedules`: see ExpenseAutomationViewSelector.
|
|
49
50
|
const actualMatching = (0, actualMatchingViewSelector_1.getExpenseAutomationActualMatchingView)(state);
|
|
50
51
|
switch (currentSelectedView) {
|
|
51
52
|
case 'reconciliation':
|
|
@@ -104,10 +105,12 @@ function getExpenseAutomationView(state) {
|
|
|
104
105
|
};
|
|
105
106
|
break;
|
|
106
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.
|
|
107
111
|
const fetchStateVariables = [
|
|
108
112
|
expenseAutomationMissingReceiptsViewState,
|
|
109
113
|
expenseAutomationJESchedulesViewState,
|
|
110
|
-
expenseAutomationActualMatchingViewState,
|
|
111
114
|
expenseAutomationTransactionsView,
|
|
112
115
|
expenseAutomationReconciliationViewState,
|
|
113
116
|
];
|
|
@@ -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: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { TimePeriod } from '../../../commonStateTypes/timePeriod';
|
|
3
|
-
import { ActualMatchingListResponsePayload } from '../../../entity/actualMatching/actualMatchingPayload';
|
|
3
|
+
import { ActualMatchingListResponsePayload, DisplayCurrencyFallback } from '../../../entity/actualMatching/actualMatchingPayload';
|
|
4
4
|
import { JEOneTimeAccrualPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
|
|
5
5
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
6
6
|
import { ActualMatchingTransactionSearchResult, MatchAndReverseResult, UndoReversalResult } from '../types/actualMatchingViewState';
|
|
@@ -47,10 +47,10 @@ export interface MatchTransactionSearchResponsePayload {
|
|
|
47
47
|
next_page_token?: string | null;
|
|
48
48
|
}
|
|
49
49
|
export type MatchTransactionSearchResponse = ZeniAPIResponse<MatchTransactionSearchResponsePayload>;
|
|
50
|
-
export declare function toActualMatchingTransactionSearchResult(payload: MatchTransactionSearchResultPayload): ActualMatchingTransactionSearchResult;
|
|
50
|
+
export declare function toActualMatchingTransactionSearchResult(payload: MatchTransactionSearchResultPayload, fallbackCurrency?: DisplayCurrencyFallback): ActualMatchingTransactionSearchResult;
|
|
51
51
|
export interface MatchAndReverseRequestPayload {
|
|
52
52
|
accrual_ids: ID[];
|
|
53
|
-
|
|
53
|
+
line_ids: ID[];
|
|
54
54
|
transaction_id: ID;
|
|
55
55
|
transaction_integration_id: string;
|
|
56
56
|
transaction_sync_token: string;
|
|
@@ -9,8 +9,6 @@ const actualMatchingViewState_1 = require("../types/actualMatchingViewState");
|
|
|
9
9
|
function toServiceMonthFromPeriod(period) {
|
|
10
10
|
return (0, timePeriod_1.toString)(period.start).slice(0, 7);
|
|
11
11
|
}
|
|
12
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
13
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
14
12
|
function resolveMatchSearchAmount(payload) {
|
|
15
13
|
const raw = payload.total_amount ?? payload.amount;
|
|
16
14
|
if (typeof raw === 'number' && Number.isFinite(raw)) {
|
|
@@ -24,22 +22,24 @@ function resolveMatchSearchAmount(payload) {
|
|
|
24
22
|
}
|
|
25
23
|
return 0;
|
|
26
24
|
}
|
|
27
|
-
function resolveMatchSearchCurrencySymbol(payload, currencyCode) {
|
|
25
|
+
function resolveMatchSearchCurrencySymbol(payload, currencyCode, fallbackCurrency) {
|
|
28
26
|
if (payload.currency_symbol != null && payload.currency_symbol !== '') {
|
|
29
27
|
return payload.currency_symbol;
|
|
30
28
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
if (fallbackCurrency != null &&
|
|
30
|
+
currencyCode === fallbackCurrency.currencyCode) {
|
|
31
|
+
return fallbackCurrency.currencySymbol;
|
|
32
|
+
}
|
|
33
|
+
return currencyCode;
|
|
34
34
|
}
|
|
35
|
-
function toActualMatchingTransactionSearchResult(payload) {
|
|
35
|
+
function toActualMatchingTransactionSearchResult(payload, fallbackCurrency) {
|
|
36
36
|
const currencyCode = payload.currency_code != null && payload.currency_code !== ''
|
|
37
37
|
? payload.currency_code
|
|
38
|
-
:
|
|
38
|
+
: fallbackCurrency?.currencyCode ?? '';
|
|
39
39
|
return {
|
|
40
40
|
transactionId: payload.transaction_id,
|
|
41
41
|
transactionIntegrationId: payload.transaction_integration_id,
|
|
42
|
-
transactionType: payload.transaction_type,
|
|
42
|
+
transactionType: (payload.transaction_type || '').toLowerCase(),
|
|
43
43
|
lineId: payload.line_id,
|
|
44
44
|
vendorId: payload.vendor_id ?? undefined,
|
|
45
45
|
vendorName: payload.vendor_name ?? '',
|
|
@@ -51,7 +51,7 @@ function toActualMatchingTransactionSearchResult(payload) {
|
|
|
51
51
|
accountingClassId: payload.accounting_class_id ?? undefined,
|
|
52
52
|
accountingClassName: payload.accounting_class_name ?? undefined,
|
|
53
53
|
currencyCode,
|
|
54
|
-
currencySymbol: resolveMatchSearchCurrencySymbol(payload, currencyCode),
|
|
54
|
+
currencySymbol: resolveMatchSearchCurrencySymbol(payload, currencyCode, fallbackCurrency),
|
|
55
55
|
transactionMemo: payload.transaction_memo ?? undefined,
|
|
56
56
|
transactionDescription: payload.transaction_description ?? undefined,
|
|
57
57
|
transactionTypeName: payload.transaction_type_name ?? undefined,
|
|
@@ -2,12 +2,12 @@ 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,
|
|
5
|
+
import { ActualMatchingAccrualSearchState, ActualMatchingMatchModalState, ActualMatchingTransactionSearchResult, ActualMatchingTransactionSearchState, ActualMatchingViewState, ActualMatchingViewUIState, MatchAndReverseResult, 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;
|
|
9
9
|
export declare const initialState: ActualMatchingViewState;
|
|
10
|
-
export declare const clearActualMatchingView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationActualMatchingView/clearActualMatchingView">, clearMatchNewModal: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationActualMatchingView/clearMatchNewModal">, closeMatchNewModal: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationActualMatchingView/closeMatchNewModal">, fetchActualMatching: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
|
|
10
|
+
export declare const ackCloseMatchAfterUndo: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationActualMatchingView/ackCloseMatchAfterUndo">, clearActualMatchingView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationActualMatchingView/clearActualMatchingView">, clearMatchNewModal: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationActualMatchingView/clearMatchNewModal">, closeMatchNewModal: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationActualMatchingView/closeMatchNewModal">, fetchActualMatching: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
|
|
11
11
|
period: TimePeriod;
|
|
12
12
|
refreshViewInBackground: any;
|
|
13
13
|
}, "expenseAutomationActualMatchingView/fetchActualMatching", never, never>, fetchActualMatchingFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -31,16 +31,21 @@ export declare const clearActualMatchingView: import("@reduxjs/toolkit").ActionC
|
|
|
31
31
|
matchIds: ActualMatchingMatchId[];
|
|
32
32
|
refreshViewInBackground: boolean;
|
|
33
33
|
selectedPeriod: MonthYearPeriod;
|
|
34
|
-
}, "expenseAutomationActualMatchingView/fetchActualMatchingSuccess">, matchAndReverseAccruals: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
34
|
+
}, "expenseAutomationActualMatchingView/fetchActualMatchingSuccess">, matchAndReverseAccruals: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: string, transactionIntegrationId: string, transactionType: string, lineIds: string[], transactionSyncToken: string, accrualIds: string[]], {
|
|
35
|
+
transactionId: string;
|
|
36
|
+
transactionIntegrationId: string;
|
|
37
|
+
transactionType: string;
|
|
38
|
+
lineIds: string[];
|
|
39
|
+
transactionSyncToken: string;
|
|
40
|
+
accrualIds: string[];
|
|
41
|
+
}, "expenseAutomationActualMatchingView/matchAndReverseAccruals", never, never>, matchAndReverseAccrualsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
35
42
|
status: ZeniAPIStatus;
|
|
36
43
|
}, "expenseAutomationActualMatchingView/matchAndReverseAccrualsFailure">, matchAndReverseAccrualsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
37
44
|
results: MatchAndReverseResult[];
|
|
45
|
+
matchId?: ActualMatchingMatchId;
|
|
38
46
|
}, "expenseAutomationActualMatchingView/matchAndReverseAccrualsSuccess">, openMatchNewModal: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[matchId?: string | undefined], {
|
|
39
47
|
matchId: string | undefined;
|
|
40
|
-
}, "expenseAutomationActualMatchingView/openMatchNewModal", never, never>, searchMatchAccruals: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
|
|
41
|
-
query: string;
|
|
42
|
-
pageToken?: string | null;
|
|
43
|
-
}], {
|
|
48
|
+
}, "expenseAutomationActualMatchingView/openMatchNewModal", never, never>, searchMatchAccruals: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[query: string, pageToken?: string | null | undefined], {
|
|
44
49
|
query: string;
|
|
45
50
|
pageToken: string | undefined;
|
|
46
51
|
}, "expenseAutomationActualMatchingView/searchMatchAccruals", never, never>, searchMatchAccrualsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -49,12 +54,7 @@ export declare const clearActualMatchingView: import("@reduxjs/toolkit").ActionC
|
|
|
49
54
|
append: boolean;
|
|
50
55
|
nextPageToken: string | null;
|
|
51
56
|
results: JEOneTimeAccrualPayload[];
|
|
52
|
-
}, "expenseAutomationActualMatchingView/searchMatchAccrualsSuccess">, searchMatchTransactions: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
|
|
53
|
-
query: string;
|
|
54
|
-
pageToken?: string | null;
|
|
55
|
-
transactionIntegrationId?: string;
|
|
56
|
-
transactionType?: string;
|
|
57
|
-
}], {
|
|
57
|
+
}, "expenseAutomationActualMatchingView/searchMatchAccrualsSuccess">, searchMatchTransactions: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[query: string, pageToken?: string | null | undefined, transactionType?: string | undefined, transactionIntegrationId?: string | undefined], {
|
|
58
58
|
query: string;
|
|
59
59
|
pageToken: string | undefined;
|
|
60
60
|
transactionType: string | undefined;
|
|
@@ -65,10 +65,15 @@ export declare const clearActualMatchingView: import("@reduxjs/toolkit").ActionC
|
|
|
65
65
|
append: boolean;
|
|
66
66
|
nextPageToken: string | null;
|
|
67
67
|
results: ActualMatchingTransactionSearchResult[];
|
|
68
|
-
}, "expenseAutomationActualMatchingView/searchMatchTransactionsSuccess">, undoReversalAccruals: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
68
|
+
}, "expenseAutomationActualMatchingView/searchMatchTransactionsSuccess">, undoReversalAccruals: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[matchId: string, accrualIds: string[]], {
|
|
69
|
+
matchId: string;
|
|
70
|
+
accrualIds: string[];
|
|
71
|
+
}, "expenseAutomationActualMatchingView/undoReversalAccruals", never, never>, undoReversalAccrualsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
72
|
+
matchId: ActualMatchingMatchId;
|
|
69
73
|
status: ZeniAPIStatus;
|
|
70
|
-
}, "expenseAutomationActualMatchingView/undoReversalAccrualsFailure">, undoReversalAccrualsSuccess: import("@reduxjs/toolkit").
|
|
74
|
+
}, "expenseAutomationActualMatchingView/undoReversalAccrualsFailure">, undoReversalAccrualsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[matchId: string, results: UndoReversalResult[]], {
|
|
75
|
+
matchId: string;
|
|
71
76
|
results: UndoReversalResult[];
|
|
72
|
-
}, "expenseAutomationActualMatchingView/undoReversalAccrualsSuccess">, updateActualMatchingUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<ActualMatchingViewUIState>, "expenseAutomationActualMatchingView/updateActualMatchingUIState">;
|
|
77
|
+
}, "expenseAutomationActualMatchingView/undoReversalAccrualsSuccess", never, never>, updateActualMatchingUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<ActualMatchingViewUIState>, "expenseAutomationActualMatchingView/updateActualMatchingUIState">;
|
|
73
78
|
declare const _default: import("redux").Reducer<ActualMatchingViewState>;
|
|
74
79
|
export default _default;
|