@zeniai/client-epic-state 5.2.22-betaAM1 → 5.2.22
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/jeSchedules/jeSchedulesPayload.d.ts +0 -24
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -40
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -26
- package/lib/epic.d.ts +1 -6
- package/lib/epic.js +0 -10
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -40
- package/lib/esm/epic.js +0 -10
- package/lib/esm/index.js +2 -6
- package/lib/esm/reducer.js +0 -3
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +11 -28
- package/lib/esm/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +1 -9
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -5
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +7 -22
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +0 -3
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -5
- package/lib/index.d.ts +4 -9
- package/lib/index.js +47 -73
- package/lib/reducer.d.ts +0 -1
- package/lib/reducer.js +0 -3
- package/lib/rootStateTypes.d.ts +0 -2
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +1 -2
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +11 -28
- 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/switchJESchedulesTabEpic.d.ts +1 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -5
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +7 -22
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +0 -3
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -5
- package/package.json +1 -1
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +0 -46
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +0 -7
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +0 -50
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +0 -44
- package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +0 -44
- package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +0 -60
- package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +0 -260
- package/lib/esm/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +0 -1
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +0 -200
- package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +0 -22
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.d.ts +0 -9
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +0 -50
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.d.ts +0 -5
- package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +0 -11
- package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +0 -54
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +0 -48
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +0 -48
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +0 -72
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +0 -65
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +0 -53
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +0 -264
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +0 -59
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +0 -2
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +0 -11
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +0 -212
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +0 -81
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +0 -27
package/lib/reducer.d.ts
CHANGED
|
@@ -65,7 +65,6 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
65
65
|
entityAutoCompleteState: import("./view/autoComplete/entityAutoCompleteState").EntityAutoCompleteState;
|
|
66
66
|
entityRecommendationState: import("./view/recommendation/recommendationState").EntityRecommendationState;
|
|
67
67
|
expenseAutomationFluxAnalysisViewState: import("./view/expenseAutomationView/types/fluxAnalysisViewState").FluxAnalysisViewState;
|
|
68
|
-
expenseAutomationActualMatchingViewState: import("./view/expenseAutomationView/types/actualMatchingViewState").ActualMatchingViewState;
|
|
69
68
|
expenseAutomationJESchedulesViewState: import("./view/expenseAutomationView/types/jeSchedulesViewState").JESchedulesViewState;
|
|
70
69
|
expenseAutomationMissingReceiptsViewState: import(".").ExpenseAutomationMissingReceiptsViewState;
|
|
71
70
|
expenseAutomationReconciliationViewState: import("./view/expenseAutomationView/types/reconciliationViewState").ReconciliationViewState;
|
package/lib/reducer.js
CHANGED
|
@@ -155,7 +155,6 @@ const creditAgentViewReducer_1 = __importStar(require("./view/creditAgentView/cr
|
|
|
155
155
|
const dashboardReducer_1 = __importStar(require("./view/dashboard/dashboardReducer"));
|
|
156
156
|
const dashboardLayoutReducer_1 = __importStar(require("./view/dashboardLayout/dashboardLayoutReducer"));
|
|
157
157
|
const expenseAutomationViewReducer_1 = __importStar(require("./view/expenseAutomationView/expenseAutomationViewReducer"));
|
|
158
|
-
const actualMatchingViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/actualMatchingViewReducer"));
|
|
159
158
|
const fluxAnalysisViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/fluxAnalysisViewReducer"));
|
|
160
159
|
const jeSchedulesViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/jeSchedulesViewReducer"));
|
|
161
160
|
const missingReceiptsViewReducer_1 = __importStar(require("./view/expenseAutomationView/reducers/missingReceiptsViewReducer"));
|
|
@@ -469,7 +468,6 @@ const initialViewsState = {
|
|
|
469
468
|
entityAutoCompleteState: entityAutoCompleteReducer_1.initialState,
|
|
470
469
|
entityRecommendationState: recommendationReducer_1.initialState,
|
|
471
470
|
expenseAutomationFluxAnalysisViewState: fluxAnalysisViewReducer_1.initialState,
|
|
472
|
-
expenseAutomationActualMatchingViewState: actualMatchingViewReducer_1.initialState,
|
|
473
471
|
expenseAutomationJESchedulesViewState: jeSchedulesViewReducer_1.initialState,
|
|
474
472
|
expenseAutomationMissingReceiptsViewState: missingReceiptsViewReducer_1.initialState,
|
|
475
473
|
expenseAutomationReconciliationViewState: reconciliationViewReducer_1.initialState,
|
|
@@ -764,7 +762,6 @@ const viewReducers = {
|
|
|
764
762
|
entityAutoCompleteState: entityAutoCompleteReducer_1.default,
|
|
765
763
|
entityRecommendationState: recommendationReducer_1.default,
|
|
766
764
|
expenseAutomationFluxAnalysisViewState: fluxAnalysisViewReducer_1.default,
|
|
767
|
-
expenseAutomationActualMatchingViewState: actualMatchingViewReducer_1.default,
|
|
768
765
|
expenseAutomationJESchedulesViewState: jeSchedulesViewReducer_1.default,
|
|
769
766
|
expenseAutomationMissingReceiptsViewState: missingReceiptsViewReducer_1.default,
|
|
770
767
|
expenseAutomationReconciliationViewState: reconciliationViewReducer_1.default,
|
package/lib/rootStateTypes.d.ts
CHANGED
|
@@ -114,7 +114,6 @@ import { CreditAgentViewState } from './view/creditAgentView/creditAgentViewStat
|
|
|
114
114
|
import { DashboardState } from './view/dashboard/dashboardState';
|
|
115
115
|
import { DashboardLayoutState } from './view/dashboardLayout/dashboardLayoutState';
|
|
116
116
|
import { ExpenseAutomationViewState } from './view/expenseAutomationView/expenseAutomationViewState';
|
|
117
|
-
import { ActualMatchingViewState as ExpenseAutomationActualMatchingViewState } from './view/expenseAutomationView/types/actualMatchingViewState';
|
|
118
117
|
import { FluxAnalysisViewState as ExpenseAutomationFluxAnalysisViewState } from './view/expenseAutomationView/types/fluxAnalysisViewState';
|
|
119
118
|
import { JESchedulesViewState as ExpenseAutomationJESchedulesViewState } from './view/expenseAutomationView/types/jeSchedulesViewState';
|
|
120
119
|
import { MissingReceiptsViewState as ExpenseAutomationMissingReceiptsViewState } from './view/expenseAutomationView/types/missingReceiptsViewState';
|
|
@@ -430,7 +429,6 @@ export type ViewsState = {
|
|
|
430
429
|
editRemiDetailViewState: EditRemiDetailViewState;
|
|
431
430
|
entityAutoCompleteState: EntityAutoCompleteState;
|
|
432
431
|
entityRecommendationState: EntityRecommendationState;
|
|
433
|
-
expenseAutomationActualMatchingViewState: ExpenseAutomationActualMatchingViewState;
|
|
434
432
|
expenseAutomationFluxAnalysisViewState: ExpenseAutomationFluxAnalysisViewState;
|
|
435
433
|
expenseAutomationJESchedulesViewState: ExpenseAutomationJESchedulesViewState;
|
|
436
434
|
expenseAutomationMissingReceiptsViewState: ExpenseAutomationMissingReceiptsViewState;
|
|
@@ -3,11 +3,10 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { RootState } from '../../../../rootStateTypes';
|
|
4
4
|
import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
|
|
5
5
|
import { fetchAllExpenseAutomationTabs } from '../../expenseAutomationViewReducer';
|
|
6
|
-
import { fetchActualMatchingPage } from '../../reducers/actualMatchingViewReducer';
|
|
7
6
|
import { fetchFluxAnalysisView } from '../../reducers/fluxAnalysisViewReducer';
|
|
8
7
|
import { fetchJeSchedulesPage } from '../../reducers/jeSchedulesViewReducer';
|
|
9
8
|
import { fetchMissingReceipts } from '../../reducers/missingReceiptsViewReducer';
|
|
10
9
|
import { fetchReconciliation } from '../../reducers/reconciliationViewReducer';
|
|
11
10
|
import { fetchTransactionCategorizationView } from '../../reducers/transactionsViewReducer';
|
|
12
|
-
export type ActionType = ReturnType<typeof fetchAllExpenseAutomationTabs> | ReturnType<typeof
|
|
11
|
+
export type ActionType = ReturnType<typeof fetchAllExpenseAutomationTabs> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchReconciliation> | ReturnType<typeof fetchTransactionCategorizationView>;
|
|
13
12
|
export declare const fetchAllExpenseAutomationTabsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -6,7 +6,6 @@ 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 expenseAutomationViewReducer_1 = require("../../expenseAutomationViewReducer");
|
|
9
|
-
const actualMatchingViewReducer_1 = require("../../reducers/actualMatchingViewReducer");
|
|
10
9
|
const fluxAnalysisViewReducer_1 = require("../../reducers/fluxAnalysisViewReducer");
|
|
11
10
|
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
12
11
|
const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
|
|
@@ -35,14 +34,11 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
|
|
|
35
34
|
}
|
|
36
35
|
if (cacheOverride === true) {
|
|
37
36
|
const actions = [];
|
|
38
|
-
const selectedPageTab = state.expenseAutomationJESchedulesViewState.uiState.selectedPageTab;
|
|
39
37
|
actions.push((0, transactionsViewReducer_1.fetchTransactionCategorizationView)(selectedTransactionCategorizationTab, { start: timePeriodStart, end: timePeriodEnd }, cacheOverride, false, undefined, undefined, refreshViewInBackground, false), (0, missingReceiptsViewReducer_1.fetchMissingReceipts)({ start: timePeriodStart, end: timePeriodEnd }, {
|
|
40
38
|
amount: 75.0,
|
|
41
39
|
currencyCode: 'USD',
|
|
42
40
|
currencySymbol: '$',
|
|
43
|
-
}, cacheOverride, refreshViewInBackground), (0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null),
|
|
44
|
-
? (0, actualMatchingViewReducer_1.fetchActualMatchingPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride)
|
|
45
|
-
: (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));
|
|
46
42
|
if (reconciliationEnabled) {
|
|
47
43
|
actions.push((0, reconciliationViewReducer_1.fetchReconciliation)(selectedPeriod, undefined, cacheOverride, refreshViewInBackground));
|
|
48
44
|
}
|
|
@@ -68,29 +64,16 @@ const fetchAllExpenseAutomationTabsEpic = (actions$, state$) => actions$.pipe((0
|
|
|
68
64
|
fetchActions.push((0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, cacheOverride, refreshViewInBackground, null));
|
|
69
65
|
}
|
|
70
66
|
// The two JE tabs cache separately, so only the tab actually being shown decides whether a
|
|
71
|
-
// fetch is still needed.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
const jeSchedulesPeriodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, monthYearPeriodId);
|
|
85
|
-
if (state.expenseAutomationJESchedulesViewState.fetchState !==
|
|
86
|
-
'In-Progress' &&
|
|
87
|
-
(!state.expenseAutomationJESchedulesViewState.hasValidState() ||
|
|
88
|
-
state.expenseAutomationJESchedulesViewState
|
|
89
|
-
.jeScheduleTransactionKeysByPeriodAndTab[jeSchedulesPeriodTabKey] == null ||
|
|
90
|
-
state.expenseAutomationJESchedulesViewState
|
|
91
|
-
.failedJeScheduleTransactionKeysByPeriodAndTab[jeSchedulesPeriodTabKey] == null)) {
|
|
92
|
-
fetchActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
|
|
93
|
-
}
|
|
67
|
+
// fetch is still needed.
|
|
68
|
+
const jeSchedulesPeriodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(state.expenseAutomationJESchedulesViewState.uiState.selectedPageTab, monthYearPeriodId);
|
|
69
|
+
if (state.expenseAutomationJESchedulesViewState.fetchState !==
|
|
70
|
+
'In-Progress' &&
|
|
71
|
+
(!state.expenseAutomationJESchedulesViewState.hasValidState() ||
|
|
72
|
+
state.expenseAutomationJESchedulesViewState
|
|
73
|
+
.jeScheduleTransactionKeysByPeriodAndTab[jeSchedulesPeriodTabKey] == null ||
|
|
74
|
+
state.expenseAutomationJESchedulesViewState
|
|
75
|
+
.failedJeScheduleTransactionKeysByPeriodAndTab[jeSchedulesPeriodTabKey] == null)) {
|
|
76
|
+
fetchActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, cacheOverride));
|
|
94
77
|
}
|
|
95
78
|
if (state.expenseAutomationReconciliationViewState.fetchState !==
|
|
96
79
|
'In-Progress' &&
|
package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts
CHANGED
|
@@ -4,11 +4,10 @@ import { RootState } from '../../../../rootStateTypes';
|
|
|
4
4
|
import { fetchCompanyMonthEndReportTemplates, fetchCompanyMonthEndReportView } from '../../../companyMonthEndReportView/companyMonthEndReportViewReducer';
|
|
5
5
|
import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
|
|
6
6
|
import { refreshExpenseAutomationCurrentTab } from '../../expenseAutomationViewReducer';
|
|
7
|
-
import { fetchActualMatchingPage } from '../../reducers/actualMatchingViewReducer';
|
|
8
7
|
import { fetchFluxAnalysisView } from '../../reducers/fluxAnalysisViewReducer';
|
|
9
8
|
import { fetchJeSchedulesPage } from '../../reducers/jeSchedulesViewReducer';
|
|
10
9
|
import { fetchMissingReceipts } from '../../reducers/missingReceiptsViewReducer';
|
|
11
10
|
import { fetchReconciliation } from '../../reducers/reconciliationViewReducer';
|
|
12
11
|
import { fetchTransactionCategorizationView } from '../../reducers/transactionsViewReducer';
|
|
13
|
-
export type ActionType = ReturnType<typeof refreshExpenseAutomationCurrentTab> | ReturnType<typeof
|
|
12
|
+
export type ActionType = ReturnType<typeof refreshExpenseAutomationCurrentTab> | ReturnType<typeof fetchCompanyMonthEndReportView> | ReturnType<typeof fetchCompanyMonthEndReportTemplates> | ReturnType<typeof fetchMissingReceipts> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchFluxAnalysisView> | ReturnType<typeof fetchReconciliation> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof fetchTransactionCategorizationView>;
|
|
14
13
|
export declare const refreshExpenseAutomationCurrentTabEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js
CHANGED
|
@@ -7,7 +7,6 @@ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
|
|
|
7
7
|
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
8
8
|
const companyMonthEndReportViewReducer_1 = require("../../../companyMonthEndReportView/companyMonthEndReportViewReducer");
|
|
9
9
|
const expenseAutomationViewReducer_1 = require("../../expenseAutomationViewReducer");
|
|
10
|
-
const actualMatchingViewReducer_1 = require("../../reducers/actualMatchingViewReducer");
|
|
11
10
|
const fluxAnalysisViewReducer_1 = require("../../reducers/fluxAnalysisViewReducer");
|
|
12
11
|
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
13
12
|
const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
|
|
@@ -42,17 +41,10 @@ const refreshExpenseAutomationCurrentTabEpic = (actions$, state$) => actions$.pi
|
|
|
42
41
|
return (0, rxjs_1.from)([
|
|
43
42
|
(0, fluxAnalysisViewReducer_1.fetchFluxAnalysisView)(selectedPeriod, true, true, null),
|
|
44
43
|
]);
|
|
45
|
-
case 'je_schedules':
|
|
46
|
-
const selectedPageTab = state.expenseAutomationJESchedulesViewState.uiState.selectedPageTab;
|
|
47
|
-
if (selectedPageTab === 'actual_matching') {
|
|
48
|
-
return (0, rxjs_1.from)([
|
|
49
|
-
(0, actualMatchingViewReducer_1.fetchActualMatchingPage)({ start: timePeriodStart, end: timePeriodEnd }, true),
|
|
50
|
-
]);
|
|
51
|
-
}
|
|
44
|
+
case 'je_schedules':
|
|
52
45
|
return (0, rxjs_1.from)([
|
|
53
46
|
(0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, true),
|
|
54
47
|
]);
|
|
55
|
-
}
|
|
56
48
|
case 'month_end_insights':
|
|
57
49
|
return (0, rxjs_1.from)([
|
|
58
50
|
(0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportView)(true, companyId, currentTenant.tenantId, period.end, true),
|
|
@@ -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,7 +5,6 @@ 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
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)(() => {
|
|
11
10
|
const state = state$.value;
|
|
@@ -28,10 +27,6 @@ const switchJESchedulesTabEpic = (actions$, state$) => actions$.pipe((0, operato
|
|
|
28
27
|
if (timePeriodStart == null || timePeriodEnd == null) {
|
|
29
28
|
return rxjs_1.EMPTY;
|
|
30
29
|
}
|
|
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
30
|
return (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.fetchJeSchedulesPage)({ start: timePeriodStart, end: timePeriodEnd }, true));
|
|
36
31
|
}));
|
|
37
32
|
exports.switchJESchedulesTabEpic = switchJESchedulesTabEpic;
|
|
@@ -7,7 +7,6 @@ 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");
|
|
11
10
|
const fluxAnalysisViewSelector_1 = require("./selectors/fluxAnalysisViewSelector");
|
|
12
11
|
const getAllStepsHelper_1 = require("./selectors/getAllStepsHelper");
|
|
13
12
|
const jeSchedulesViewSelector_1 = require("./selectors/jeSchedulesViewSelector");
|
|
@@ -25,7 +24,7 @@ const isPreviousStepDisabled = (selectedTransactionCategorizationTab, allSteps,
|
|
|
25
24
|
return allSteps[stepIndex - 1].isDisabled;
|
|
26
25
|
};
|
|
27
26
|
function getExpenseAutomationView(state) {
|
|
28
|
-
const { expenseAutomationViewState, tenantState, expenseAutomationMissingReceiptsViewState, expenseAutomationJESchedulesViewState,
|
|
27
|
+
const { expenseAutomationViewState, tenantState, expenseAutomationMissingReceiptsViewState, expenseAutomationJESchedulesViewState, expenseAutomationTransactionsViewState, expenseAutomationReconciliationViewState, monthEndCloseChecksState, companyState, } = state;
|
|
29
28
|
const { loggedInUser, currentTenantId } = tenantState;
|
|
30
29
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
31
30
|
const { currentSelectedView, selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
@@ -46,7 +45,6 @@ function getExpenseAutomationView(state) {
|
|
|
46
45
|
const reconciliation = (0, reconciliationViewSelector_1.getExpenseAutomationReconciliationView)(state);
|
|
47
46
|
const expenseAutomationTransactionsView = (0, transactionCategorizationSelector_1.getExpenseAutomationTransactionView)(state);
|
|
48
47
|
const jeSchedules = (0, jeSchedulesViewSelector_1.getExpenseAutomationJESchedulesView)(state);
|
|
49
|
-
const actualMatching = (0, actualMatchingViewSelector_1.getExpenseAutomationActualMatchingView)(state);
|
|
50
48
|
switch (currentSelectedView) {
|
|
51
49
|
case 'reconciliation':
|
|
52
50
|
currentSelectedViewFetchState = reconciliation.fetchStatus;
|
|
@@ -59,23 +57,12 @@ function getExpenseAutomationView(state) {
|
|
|
59
57
|
fluxAnalysis.refreshStatus;
|
|
60
58
|
break;
|
|
61
59
|
case 'je_schedules':
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
currentSelectedViewBackgroundRefreshFetchState =
|
|
69
|
-
actualMatching.refreshStatus;
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
currentSelectedViewFetchState = {
|
|
73
|
-
fetchState: jeSchedules.fetchState,
|
|
74
|
-
error: jeSchedules.error,
|
|
75
|
-
};
|
|
76
|
-
currentSelectedViewBackgroundRefreshFetchState =
|
|
77
|
-
jeSchedules.refreshStatus;
|
|
78
|
-
}
|
|
60
|
+
currentSelectedViewFetchState = {
|
|
61
|
+
fetchState: jeSchedules.fetchState,
|
|
62
|
+
error: jeSchedules.error,
|
|
63
|
+
};
|
|
64
|
+
currentSelectedViewBackgroundRefreshFetchState =
|
|
65
|
+
jeSchedules.refreshStatus;
|
|
79
66
|
break;
|
|
80
67
|
case 'missing_receipts':
|
|
81
68
|
currentSelectedViewFetchState = {
|
|
@@ -107,7 +94,6 @@ function getExpenseAutomationView(state) {
|
|
|
107
94
|
const fetchStateVariables = [
|
|
108
95
|
expenseAutomationMissingReceiptsViewState,
|
|
109
96
|
expenseAutomationJESchedulesViewState,
|
|
110
|
-
expenseAutomationActualMatchingViewState,
|
|
111
97
|
expenseAutomationTransactionsView,
|
|
112
98
|
expenseAutomationReconciliationViewState,
|
|
113
99
|
];
|
|
@@ -193,7 +179,6 @@ function getExpenseAutomationView(state) {
|
|
|
193
179
|
]);
|
|
194
180
|
return {
|
|
195
181
|
jeSchedules,
|
|
196
|
-
actualMatching,
|
|
197
182
|
transactionView: expenseAutomationTransactionsView,
|
|
198
183
|
missingReceipts,
|
|
199
184
|
reconciliation,
|
|
@@ -136,10 +136,10 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
136
136
|
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJESchedulesUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<JESchedulesViewUIState>, "expenseAutomationJESchedulesView/updateJESchedulesUIState">, updateJEScheduleTypeFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<"prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue" | null, "expenseAutomationJESchedulesView/updateJEScheduleTypeFilter">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
137
137
|
localData: Partial<JEScheduleLocalData>;
|
|
138
138
|
scheduledJournalEntryID: ID;
|
|
139
|
-
}, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[], selectedPeriod: MonthYearPeriod, selectedPageTab: "schedules" | "
|
|
139
|
+
}, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[], selectedPeriod: MonthYearPeriod, selectedPageTab: "schedules" | "existing_schedules"], {
|
|
140
140
|
jeScheduleKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[];
|
|
141
141
|
selectedPeriod: MonthYearPeriod;
|
|
142
|
-
selectedPageTab: "schedules" | "
|
|
142
|
+
selectedPageTab: "schedules" | "existing_schedules";
|
|
143
143
|
}, "expenseAutomationJESchedulesView/updateJeScheduleTransactionKeys", never, never>, updateNewScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
144
144
|
localData: Partial<NewScheduleLocalDataFixedAssets>;
|
|
145
145
|
scheduleType: "fixed_assets" | "prepaid_expenses";
|
package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { MonthEndCloseChecksView } from '../../../view/monthEndCloseChecksView/m
|
|
|
6
6
|
import { CompanyMonthEndReportSelectorView } from '../../companyMonthEndReportView/companyMonthEndReportViewSelector';
|
|
7
7
|
import { ExpenseAutomationViewType } from '../expenseAutomationViewState';
|
|
8
8
|
import { TransactionsTab } from '../types/transactionsViewState';
|
|
9
|
-
import { ExpenseAutomationActualMatchingViewSelector } from './actualMatchingViewSelectorTypes';
|
|
10
9
|
import { ExpenseAutomationFluxAnalysisViewSelector } from './fluxAnalysisViewSelectorTypes';
|
|
11
10
|
import { ExpenseAutomationJESchedulesViewSelector } from './jeSchedulesSelectorTypes';
|
|
12
11
|
import { ExpenseAutomationMissingReceiptsViewSelector } from './missingReceiptsSelectorTypes';
|
|
@@ -22,7 +21,6 @@ export interface ExpenseAutomationStepDetails {
|
|
|
22
21
|
title: string;
|
|
23
22
|
}
|
|
24
23
|
export interface ExpenseAutomationViewSelector extends SelectorView {
|
|
25
|
-
actualMatching: ExpenseAutomationActualMatchingViewSelector;
|
|
26
24
|
allSteps: ExpenseAutomationStepDetails[];
|
|
27
25
|
completionStatus: CompletionStatusType;
|
|
28
26
|
currentSelectedView: ExpenseAutomationViewType;
|
|
@@ -382,9 +382,6 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
382
382
|
// reports undefined rather than 0, so the UI can hide the badge instead of asserting "none".
|
|
383
383
|
const scheduleCountsByTab = {};
|
|
384
384
|
jeSchedulesViewState_1.ALL_JE_PAGE_TABS.forEach((pageTab) => {
|
|
385
|
-
if (pageTab === 'actual_matching') {
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
385
|
const periodTabKey = monthYearPeriodId != null
|
|
389
386
|
? (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(pageTab, monthYearPeriodId)
|
|
390
387
|
: null;
|
|
@@ -11,7 +11,7 @@ import { ZeniDate } from '../../../zeniDayJS';
|
|
|
11
11
|
import { JETransactionLink } from '../../scheduleView/scheduleDetailView/scheduleDetailState';
|
|
12
12
|
export declare const toJEScheduleSortKey: (v: string) => "type" | "vendor" | "category" | "class" | "memo" | "jePostingDate" | "runningBalance" | "depCategory" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "remainingMonths" | "totalAmount" | "transactionDate";
|
|
13
13
|
export type JEScheduleSortKey = ReturnType<typeof toJEScheduleSortKey>;
|
|
14
|
-
export declare const toJEPageTab: (v: string) => "schedules" | "
|
|
14
|
+
export declare const toJEPageTab: (v: string) => "schedules" | "existing_schedules";
|
|
15
15
|
export type JEPageTab = ReturnType<typeof toJEPageTab>;
|
|
16
16
|
export declare const ALL_JE_PAGE_TABS: readonly JEPageTab[];
|
|
17
17
|
export type JESchedulePeriodTabKey = `${JEPageTab}_${MonthYearPeriodId}`;
|
|
@@ -20,11 +20,7 @@ const JE_SCHEDULE_SORT_KEYS = [
|
|
|
20
20
|
];
|
|
21
21
|
const toJEScheduleSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_SCHEDULE_SORT_KEYS);
|
|
22
22
|
exports.toJEScheduleSortKey = toJEScheduleSortKey;
|
|
23
|
-
const JE_PAGE_TABS = [
|
|
24
|
-
'schedules',
|
|
25
|
-
'actual_matching',
|
|
26
|
-
'existing_schedules',
|
|
27
|
-
];
|
|
23
|
+
const JE_PAGE_TABS = ['schedules', 'existing_schedules'];
|
|
28
24
|
const toJEPageTab = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_PAGE_TABS);
|
|
29
25
|
exports.toJEPageTab = toJEPageTab;
|
|
30
26
|
exports.ALL_JE_PAGE_TABS = JE_PAGE_TABS;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.2.22
|
|
3
|
+
"version": "5.2.22",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { from, of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap, takeUntil } from 'rxjs/operators';
|
|
3
|
-
import { updateJEOneTimeAccruals } from '../../../../entity/jeSchedules/jeSchedulesReducer';
|
|
4
|
-
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
5
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
6
|
-
import { clearAll } from '../../../../rootActions';
|
|
7
|
-
import { toServiceMonthFromPeriod, } from '../../payload/actualMatchingPayload';
|
|
8
|
-
import { fetchActualMatching, fetchActualMatchingFailure, fetchActualMatchingSuccess, } from '../../reducers/actualMatchingViewReducer';
|
|
9
|
-
export const fetchActualMatchingEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchActualMatching.match), mergeMap((action) => {
|
|
10
|
-
const state = state$.value;
|
|
11
|
-
const { period, refreshViewInBackground } = action.payload;
|
|
12
|
-
const currentTenant = getCurrentTenant(state);
|
|
13
|
-
const selectedPeriod = state.expenseAutomationViewState
|
|
14
|
-
.selectedPeriodByTenantId[currentTenant.tenantId] ?? {
|
|
15
|
-
month: period.start.month,
|
|
16
|
-
year: period.start.year,
|
|
17
|
-
};
|
|
18
|
-
const serviceMonth = toServiceMonthFromPeriod(period);
|
|
19
|
-
return zeniAPI
|
|
20
|
-
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals?service_month=${encodeURIComponent(serviceMonth)}&view=actual_matching`)
|
|
21
|
-
.pipe(mergeMap((response) => {
|
|
22
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
23
|
-
const accruals = response.data.accruals ?? [];
|
|
24
|
-
const updateActions = [];
|
|
25
|
-
if (accruals.length > 0) {
|
|
26
|
-
updateActions.push(updateJEOneTimeAccruals(accruals));
|
|
27
|
-
}
|
|
28
|
-
updateActions.push(fetchActualMatchingSuccess({
|
|
29
|
-
accruals,
|
|
30
|
-
selectedPeriod,
|
|
31
|
-
refreshViewInBackground,
|
|
32
|
-
}));
|
|
33
|
-
return from(updateActions);
|
|
34
|
-
}
|
|
35
|
-
return of(fetchActualMatchingFailure({
|
|
36
|
-
status: response.status,
|
|
37
|
-
selectedPeriod,
|
|
38
|
-
refreshViewInBackground,
|
|
39
|
-
}));
|
|
40
|
-
}), catchError((error) => of(fetchActualMatchingFailure({
|
|
41
|
-
status: createZeniAPIStatus('Unexpected Error', 'fetch actual matching REST API call errored out' +
|
|
42
|
-
JSON.stringify(error)),
|
|
43
|
-
selectedPeriod,
|
|
44
|
-
refreshViewInBackground,
|
|
45
|
-
}))), takeUntil(actions$.pipe(filter(clearAll.match))));
|
|
46
|
-
}));
|
package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { of } from 'rxjs';
|
|
2
|
-
import { filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { fetchActualMatching, fetchActualMatchingPage, } from '../../reducers/actualMatchingViewReducer';
|
|
4
|
-
export const fetchActualMatchingPageEpic = (actions$) => actions$.pipe(filter(fetchActualMatchingPage.match), mergeMap((action) => {
|
|
5
|
-
const { period, refreshViewInBackground } = action.payload;
|
|
6
|
-
return of(fetchActualMatching(period, refreshViewInBackground));
|
|
7
|
-
}));
|
package/lib/esm/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { from, of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap, takeUntil } from 'rxjs/operators';
|
|
3
|
-
import { convertToPeriod, toAbsoluteDay, } from '../../../../commonStateTypes/timePeriod';
|
|
4
|
-
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
5
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
6
|
-
import { clearAll } from '../../../../rootActions';
|
|
7
|
-
import { toMatchAndReverseResult, } from '../../payload/actualMatchingPayload';
|
|
8
|
-
import { clearMatchNewModal, fetchActualMatching, matchAndReverseAccruals, matchAndReverseAccrualsFailure, matchAndReverseAccrualsSuccess, } from '../../reducers/actualMatchingViewReducer';
|
|
9
|
-
function refreshActualMatchingList(state) {
|
|
10
|
-
const selectedMonthYear = state.expenseAutomationViewState.selectedPeriodByTenantId[getCurrentTenant(state).tenantId];
|
|
11
|
-
if (selectedMonthYear == null) {
|
|
12
|
-
return [];
|
|
13
|
-
}
|
|
14
|
-
const period = convertToPeriod(selectedMonthYear);
|
|
15
|
-
const start = toAbsoluteDay(period.start);
|
|
16
|
-
const end = toAbsoluteDay(period.end);
|
|
17
|
-
if (start == null || end == null) {
|
|
18
|
-
return [];
|
|
19
|
-
}
|
|
20
|
-
return [fetchActualMatching({ start, end }, true)];
|
|
21
|
-
}
|
|
22
|
-
export const matchAndReverseAccrualsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(matchAndReverseAccruals.match), mergeMap((action) => {
|
|
23
|
-
const { transactionId, transactionIntegrationId, transactionType, lineId, accrualIds, } = action.payload;
|
|
24
|
-
const body = {
|
|
25
|
-
transaction_id: transactionId,
|
|
26
|
-
transaction_integration_id: transactionIntegrationId,
|
|
27
|
-
transaction_type: transactionType,
|
|
28
|
-
line_id: lineId,
|
|
29
|
-
accrual_ids: accrualIds,
|
|
30
|
-
};
|
|
31
|
-
return zeniAPI
|
|
32
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/match-and-reverse`, body)
|
|
33
|
-
.pipe(mergeMap((response) => {
|
|
34
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
35
|
-
const results = (response.data.results ?? []).map(toMatchAndReverseResult);
|
|
36
|
-
const successActions = [
|
|
37
|
-
matchAndReverseAccrualsSuccess({ results }),
|
|
38
|
-
];
|
|
39
|
-
const anyReversed = results.some((result) => result.status === 'reversed');
|
|
40
|
-
if (anyReversed) {
|
|
41
|
-
successActions.push(...refreshActualMatchingList(state$.value), clearMatchNewModal());
|
|
42
|
-
}
|
|
43
|
-
return from(successActions);
|
|
44
|
-
}
|
|
45
|
-
return of(matchAndReverseAccrualsFailure({ status: response.status }));
|
|
46
|
-
}), catchError((error) => of(matchAndReverseAccrualsFailure({
|
|
47
|
-
status: createZeniAPIStatus('Unexpected Error', 'Match and reverse accruals REST API call errored out' +
|
|
48
|
-
JSON.stringify(error)),
|
|
49
|
-
}))), takeUntil(actions$.pipe(filter(clearAll.match))));
|
|
50
|
-
}));
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { from, merge, of } from 'rxjs';
|
|
2
|
-
import { catchError, debounceTime, filter, mergeMap, switchMap, } from 'rxjs/operators';
|
|
3
|
-
import { updateJEOneTimeAccruals } from '../../../../entity/jeSchedules/jeSchedulesReducer';
|
|
4
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
5
|
-
import { searchMatchAccruals, searchMatchAccrualsFailure, searchMatchAccrualsSuccess, } from '../../reducers/actualMatchingViewReducer';
|
|
6
|
-
import { MATCH_ACCRUAL_SEARCH_LIMIT, MATCH_SEARCH_DEBOUNCE_MS, } from '../../types/actualMatchingViewState';
|
|
7
|
-
export const searchMatchAccrualsEpic = (actions$, _state$, zeniAPI) => {
|
|
8
|
-
const searchActions$ = actions$.pipe(filter(searchMatchAccruals.match));
|
|
9
|
-
const pagination$ = searchActions$.pipe(filter((action) => action.payload.pageToken != null));
|
|
10
|
-
const newSearchDebounced$ = searchActions$.pipe(filter((action) => action.payload.pageToken == null), debounceTime(MATCH_SEARCH_DEBOUNCE_MS));
|
|
11
|
-
return merge(pagination$, newSearchDebounced$).pipe(switchMap((action) => {
|
|
12
|
-
const { query, pageToken } = action.payload;
|
|
13
|
-
const offset = pageToken != null && pageToken.length > 0 ? Number(pageToken) : 0;
|
|
14
|
-
const searchText = encodeURIComponent(query);
|
|
15
|
-
const limit = MATCH_ACCRUAL_SEARCH_LIMIT;
|
|
16
|
-
return zeniAPI
|
|
17
|
-
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals?status=posted&reversal_policy=on_bill_match&search_text=${searchText}&limit=${limit}&offset=${offset}`)
|
|
18
|
-
.pipe(mergeMap((response) => {
|
|
19
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
20
|
-
const accruals = response.data.accruals ?? [];
|
|
21
|
-
const append = pageToken != null;
|
|
22
|
-
const nextOffset = offset + accruals.length;
|
|
23
|
-
const total = response.data.total ?? nextOffset;
|
|
24
|
-
const nextPageToken = nextOffset < total ? String(nextOffset) : null;
|
|
25
|
-
const actionsOut = [];
|
|
26
|
-
if (accruals.length > 0) {
|
|
27
|
-
actionsOut.push(updateJEOneTimeAccruals(accruals));
|
|
28
|
-
}
|
|
29
|
-
actionsOut.push(searchMatchAccrualsSuccess({
|
|
30
|
-
append,
|
|
31
|
-
nextPageToken,
|
|
32
|
-
results: accruals,
|
|
33
|
-
}));
|
|
34
|
-
return from(actionsOut);
|
|
35
|
-
}
|
|
36
|
-
return of(searchMatchAccrualsFailure({
|
|
37
|
-
error: response.status,
|
|
38
|
-
}));
|
|
39
|
-
}), catchError((error) => of(searchMatchAccrualsFailure({
|
|
40
|
-
error: createZeniAPIStatus('Unexpected Error', 'Search match accruals REST API call errored out' +
|
|
41
|
-
JSON.stringify(error)),
|
|
42
|
-
}))));
|
|
43
|
-
}));
|
|
44
|
-
};
|
package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { from, merge, of } from 'rxjs';
|
|
2
|
-
import { catchError, debounceTime, filter, mergeMap, switchMap, } from 'rxjs/operators';
|
|
3
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
4
|
-
import { toActualMatchingTransactionSearchResult, } from '../../payload/actualMatchingPayload';
|
|
5
|
-
import { openMatchNewModal, searchMatchAccruals, searchMatchTransactions, searchMatchTransactionsFailure, searchMatchTransactionsSuccess, } from '../../reducers/actualMatchingViewReducer';
|
|
6
|
-
import { MATCH_SEARCH_DEBOUNCE_MS, MATCH_TRANSACTION_SEARCH_PAGE_SIZE, } from '../../types/actualMatchingViewState';
|
|
7
|
-
export const searchMatchTransactionsEpic = (actions$, _state$, zeniAPI) => {
|
|
8
|
-
const openModal$ = actions$.pipe(filter(openMatchNewModal.match), mergeMap(() => from([
|
|
9
|
-
searchMatchTransactions({ query: '' }),
|
|
10
|
-
searchMatchAccruals({ query: '' }),
|
|
11
|
-
])));
|
|
12
|
-
const searchActions$ = actions$.pipe(filter(searchMatchTransactions.match));
|
|
13
|
-
const pagination$ = searchActions$.pipe(filter((action) => action.payload.pageToken != null));
|
|
14
|
-
const newSearchDebounced$ = searchActions$.pipe(filter((action) => action.payload.pageToken == null), debounceTime(MATCH_SEARCH_DEBOUNCE_MS));
|
|
15
|
-
const search$ = merge(pagination$, newSearchDebounced$).pipe(switchMap((action) => {
|
|
16
|
-
const { query, pageToken } = action.payload;
|
|
17
|
-
const queryParam = {
|
|
18
|
-
search_text: query,
|
|
19
|
-
page_size: MATCH_TRANSACTION_SEARCH_PAGE_SIZE,
|
|
20
|
-
...(pageToken != null ? { page_token: pageToken } : {}),
|
|
21
|
-
};
|
|
22
|
-
return zeniAPI
|
|
23
|
-
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/match-transaction-search?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
24
|
-
.pipe(mergeMap((response) => {
|
|
25
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
26
|
-
const { transactions, next_page_token } = response.data;
|
|
27
|
-
const append = pageToken != null;
|
|
28
|
-
const results = (transactions ?? []).map(toActualMatchingTransactionSearchResult);
|
|
29
|
-
return of(searchMatchTransactionsSuccess({
|
|
30
|
-
append,
|
|
31
|
-
nextPageToken: next_page_token ?? null,
|
|
32
|
-
results,
|
|
33
|
-
}));
|
|
34
|
-
}
|
|
35
|
-
return of(searchMatchTransactionsFailure({
|
|
36
|
-
error: response.status,
|
|
37
|
-
}));
|
|
38
|
-
}), catchError((error) => of(searchMatchTransactionsFailure({
|
|
39
|
-
error: createZeniAPIStatus('Unexpected Error', 'Search match transactions REST API call errored out' +
|
|
40
|
-
JSON.stringify(error)),
|
|
41
|
-
}))));
|
|
42
|
-
}));
|
|
43
|
-
return merge(openModal$, search$);
|
|
44
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { toString } from '../../../commonStateTypes/timePeriod';
|
|
2
|
-
import { toMatchAndReverseResultStatus, } from '../types/actualMatchingViewState';
|
|
3
|
-
export function toServiceMonthFromPeriod(period) {
|
|
4
|
-
return toString(period.start).slice(0, 7);
|
|
5
|
-
}
|
|
6
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
7
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
8
|
-
function resolveMatchSearchAmount(payload) {
|
|
9
|
-
const raw = payload.total_amount ?? payload.amount;
|
|
10
|
-
if (typeof raw === 'number' && Number.isFinite(raw)) {
|
|
11
|
-
return raw;
|
|
12
|
-
}
|
|
13
|
-
if (typeof raw === 'string' && raw !== '') {
|
|
14
|
-
const parsed = Number(raw);
|
|
15
|
-
if (Number.isFinite(parsed)) {
|
|
16
|
-
return parsed;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return 0;
|
|
20
|
-
}
|
|
21
|
-
function resolveMatchSearchCurrencySymbol(payload, currencyCode) {
|
|
22
|
-
if (payload.currency_symbol != null && payload.currency_symbol !== '') {
|
|
23
|
-
return payload.currency_symbol;
|
|
24
|
-
}
|
|
25
|
-
return currencyCode === DEFAULT_CURRENCY_CODE
|
|
26
|
-
? DEFAULT_CURRENCY_SYMBOL
|
|
27
|
-
: currencyCode;
|
|
28
|
-
}
|
|
29
|
-
export function toActualMatchingTransactionSearchResult(payload) {
|
|
30
|
-
const currencyCode = payload.currency_code != null && payload.currency_code !== ''
|
|
31
|
-
? payload.currency_code
|
|
32
|
-
: DEFAULT_CURRENCY_CODE;
|
|
33
|
-
return {
|
|
34
|
-
transactionId: payload.transaction_id,
|
|
35
|
-
transactionIntegrationId: payload.transaction_integration_id,
|
|
36
|
-
transactionType: payload.transaction_type,
|
|
37
|
-
lineId: payload.line_id,
|
|
38
|
-
vendorId: payload.vendor_id ?? undefined,
|
|
39
|
-
vendorName: payload.vendor_name ?? '',
|
|
40
|
-
amount: resolveMatchSearchAmount(payload),
|
|
41
|
-
transactionDate: payload.transaction_date,
|
|
42
|
-
accountId: payload.account_id ?? undefined,
|
|
43
|
-
accountName: payload.account_name ?? undefined,
|
|
44
|
-
accountDescription: payload.account_description ?? undefined,
|
|
45
|
-
accountingClassId: payload.accounting_class_id ?? undefined,
|
|
46
|
-
accountingClassName: payload.accounting_class_name ?? undefined,
|
|
47
|
-
currencyCode,
|
|
48
|
-
currencySymbol: resolveMatchSearchCurrencySymbol(payload, currencyCode),
|
|
49
|
-
transactionMemo: payload.transaction_memo ?? undefined,
|
|
50
|
-
transactionDescription: payload.transaction_description ?? undefined,
|
|
51
|
-
transactionTypeName: payload.transaction_type_name ?? undefined,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export function toMatchAndReverseResult(payload) {
|
|
55
|
-
return {
|
|
56
|
-
accrualId: payload.accrual_id,
|
|
57
|
-
status: toMatchAndReverseResultStatus(payload.status),
|
|
58
|
-
reason: payload.reason ?? undefined,
|
|
59
|
-
};
|
|
60
|
-
}
|