@zeniai/client-epic-state 5.2.53 → 5.2.54-betaRD1
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/jeSchedulesReducer.d.ts +4 -1
- package/lib/entity/jeSchedules/jeSchedulesReducer.js +79 -5
- package/lib/epic.d.ts +2 -1
- package/lib/epic.js +6 -4
- package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +78 -4
- package/lib/esm/epic.js +6 -4
- package/lib/esm/index.js +3 -3
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.js +39 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +14 -1
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +10 -13
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js +38 -17
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +17 -1
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +74 -1
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +49 -14
- package/lib/index.d.ts +3 -3
- package/lib/index.js +50 -49
- package/lib/tsconfig.mocks.tsbuildinfo +1 -0
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.d.ts +20 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.js +43 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +8 -11
- package/lib/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js +38 -17
- package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +17 -1
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +18 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +10 -3
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +76 -3
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +3 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +49 -14
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +16 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateJESchedules, updateJESchedulesDetails } from '../../../../entity/jeSchedules/jeSchedulesReducer';
|
|
4
|
+
import { clearAll } from '../../../../rootActions';
|
|
5
|
+
import { RootState } from '../../../../rootStateTypes';
|
|
6
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
7
|
+
import { fetchFailedJePostings, fetchFailedJePostingsFailure, fetchFailedJePostingsSuccess, initializeJeScheduleLocalData } from '../../reducers/jeSchedulesViewReducer';
|
|
8
|
+
export type ActionType = ReturnType<typeof clearAll> | ReturnType<typeof fetchFailedJePostings> | ReturnType<typeof fetchFailedJePostingsFailure> | ReturnType<typeof fetchFailedJePostingsSuccess> | ReturnType<typeof initializeJeScheduleLocalData> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails>;
|
|
9
|
+
/**
|
|
10
|
+
* Fetches every currently-failing posting for the tenant, on its own endpoint and with no window.
|
|
11
|
+
*
|
|
12
|
+
* Sends no query at all. The endpoint takes an optional `expected_post_start_date` floor and the
|
|
13
|
+
* client deliberately omits it: a failure is outstanding work until someone resolves it, whatever
|
|
14
|
+
* month it belongs to, and windowing this list is exactly what kept older failures off the only
|
|
15
|
+
* screen that can resolve them.
|
|
16
|
+
*
|
|
17
|
+
* `switchMap`, not `mergeMap`: there is one list per tenant, so a second trigger supersedes the
|
|
18
|
+
* first rather than racing it.
|
|
19
|
+
*/
|
|
20
|
+
export declare const fetchFailedJePostingsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchFailedJePostingsEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const jeSchedulesReducer_1 = require("../../../../entity/jeSchedules/jeSchedulesReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
|
+
const rootActions_1 = require("../../../../rootActions");
|
|
9
|
+
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
10
|
+
/**
|
|
11
|
+
* Fetches every currently-failing posting for the tenant, on its own endpoint and with no window.
|
|
12
|
+
*
|
|
13
|
+
* Sends no query at all. The endpoint takes an optional `expected_post_start_date` floor and the
|
|
14
|
+
* client deliberately omits it: a failure is outstanding work until someone resolves it, whatever
|
|
15
|
+
* month it belongs to, and windowing this list is exactly what kept older failures off the only
|
|
16
|
+
* screen that can resolve them.
|
|
17
|
+
*
|
|
18
|
+
* `switchMap`, not `mergeMap`: there is one list per tenant, so a second trigger supersedes the
|
|
19
|
+
* first rather than racing it.
|
|
20
|
+
*/
|
|
21
|
+
const fetchFailedJePostingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.fetchFailedJePostings.match), (0, operators_1.switchMap)(() => zeniAPI
|
|
22
|
+
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expenses_automation/failed_je_postings`)
|
|
23
|
+
.pipe((0, operators_1.switchMap)((response) => {
|
|
24
|
+
if (!(0, responsePayload_1.isSuccessResponse)(response) || response.data == null) {
|
|
25
|
+
return (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.fetchFailedJePostingsFailure)(response.status));
|
|
26
|
+
}
|
|
27
|
+
const { je_schedules: failedJeSchedules, scheduled_journal_entries: failedScheduledJournalEntries, } = response.data.failed_je_postings;
|
|
28
|
+
// Order matters and matches fetchJeSchedulesEpic: updateJESchedules fans out to the
|
|
29
|
+
// vendor / account / class / user entities, updateJESchedulesDetails then attaches the
|
|
30
|
+
// journal entries, and only then can initializeJeScheduleLocalData read them back.
|
|
31
|
+
return (0, rxjs_1.from)([
|
|
32
|
+
(0, jeSchedulesReducer_1.updateJESchedules)(failedJeSchedules),
|
|
33
|
+
(0, jeSchedulesReducer_1.updateJESchedulesDetails)(failedJeSchedules, failedScheduledJournalEntries),
|
|
34
|
+
(0, jeSchedulesViewReducer_1.initializeJeScheduleLocalData)(failedJeSchedules),
|
|
35
|
+
(0, jeSchedulesViewReducer_1.fetchFailedJePostingsSuccess)(failedJeSchedules, failedScheduledJournalEntries),
|
|
36
|
+
]);
|
|
37
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.fetchFailedJePostingsFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'fetch failed JE postings REST API call errored out' +
|
|
38
|
+
JSON.stringify(error))))),
|
|
39
|
+
// A tenant switch clears the store while this request is still in flight. Without this
|
|
40
|
+
// the old tenant's rows are written back into the freshly cleared store and stay on
|
|
41
|
+
// screen under the new tenant until a manual refresh.
|
|
42
|
+
(0, operators_1.takeUntil)(actions$.pipe((0, operators_1.filter)(rootActions_1.clearAll.match))))));
|
|
43
|
+
exports.fetchFailedJePostingsEpic = fetchFailedJePostingsEpic;
|
|
@@ -3,6 +3,6 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { RootState } from '../../../../rootStateTypes';
|
|
4
4
|
import { fetchAccountList } from '../../../accountList/accountListReducer';
|
|
5
5
|
import { fetchActualMatchingPage } from '../../reducers/actualMatchingViewReducer';
|
|
6
|
-
import { fetchJeSchedules, fetchJeSchedulesPage, initializeAccountSettingsView } from '../../reducers/jeSchedulesViewReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof fetchAccountList> | ReturnType<typeof fetchActualMatchingPage> | ReturnType<typeof fetchJeSchedules> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof initializeAccountSettingsView>;
|
|
6
|
+
import { fetchFailedJePostings, fetchJeSchedules, fetchJeSchedulesPage, initializeAccountSettingsView } from '../../reducers/jeSchedulesViewReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof fetchAccountList> | ReturnType<typeof fetchActualMatchingPage> | ReturnType<typeof fetchFailedJePostings> | ReturnType<typeof fetchJeSchedules> | ReturnType<typeof fetchJeSchedulesPage> | ReturnType<typeof initializeAccountSettingsView>;
|
|
8
8
|
export declare const fetchJeSchedulesPageEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -27,6 +27,19 @@ const fetchJeSchedulesPageEpic = (actions$, state$) => actions$.pipe((0, operato
|
|
|
27
27
|
else {
|
|
28
28
|
jeSchedulePageActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedules)(period, refreshViewInBackground));
|
|
29
29
|
}
|
|
30
|
+
// Failed postings are tenant-wide and carry no period, so a period change or a tab switch
|
|
31
|
+
// cannot invalidate them -- fetch once and let retry keep the list current from then on.
|
|
32
|
+
// Refreshes still refetch, silently, so a failure resolved elsewhere leaves eventually.
|
|
33
|
+
const { fetchState: failedPostingsFetchState } = state.expenseAutomationJESchedulesViewState.failedJePostings.fetchState;
|
|
34
|
+
const isBackgroundRefresh = refreshViewInBackground === true;
|
|
35
|
+
// 'Error' is retried, not just 'Not-Started'. A transient failure on first load would
|
|
36
|
+
// otherwise leave the bucket in Error, and a later period change -- which is not a
|
|
37
|
+
// background refresh -- would never ask again, so the tab stayed empty for the session.
|
|
38
|
+
if (failedPostingsFetchState === 'Not-Started' ||
|
|
39
|
+
failedPostingsFetchState === 'Error' ||
|
|
40
|
+
isBackgroundRefresh) {
|
|
41
|
+
jeSchedulePageActions.push((0, jeSchedulesViewReducer_1.fetchFailedJePostings)(isBackgroundRefresh));
|
|
42
|
+
}
|
|
30
43
|
// Only on the first page load. Account settings cannot change from a tab switch or a
|
|
31
44
|
// refresh, and re-initializing puts accountSettingsView back to 'In-Progress' -- which the
|
|
32
45
|
// page reads as "still loading" and answers with a full skeleton over rows it already has.
|
|
@@ -84,8 +84,9 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
|
|
|
84
84
|
one_time_accrual_service_month_end: parsedEndDate.format(jeSchedulesPayload_1.SERVICE_MONTH_FORMAT),
|
|
85
85
|
// Existing lists what actually reached the books.
|
|
86
86
|
one_time_accrual_statuses: ['posted'],
|
|
87
|
-
//
|
|
88
|
-
//
|
|
87
|
+
// Kept only so this tab's response shape is unchanged. Nothing reads the failed
|
|
88
|
+
// postings it returns any more -- they have their own endpoint and their own group
|
|
89
|
+
// on Review. Dropping the key from the response is a server-side follow-up.
|
|
89
90
|
filter_failed_je_postings_by_date: false,
|
|
90
91
|
}),
|
|
91
92
|
};
|
|
@@ -96,12 +97,10 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
|
|
|
96
97
|
const updateActions = [];
|
|
97
98
|
const accruedJeSchedules = response.data.accrued_je_schedules?.je_schedules ?? [];
|
|
98
99
|
const oneTimeAccruals = response.data.one_time_accruals ?? [];
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
...response.data.failed_je_postings.je_schedules,
|
|
104
|
-
]));
|
|
100
|
+
// failed_je_postings is deliberately ignored. This endpoint windows it to the close
|
|
101
|
+
// month, which is what hid older failures; fetchFailedJePostingsEpic owns that list
|
|
102
|
+
// now and fetches it unwindowed.
|
|
103
|
+
updateActions.push((0, jeSchedulesReducer_1.updateJESchedules)([...response.data.je_schedules]));
|
|
105
104
|
if (accruedJeSchedules.length > 0) {
|
|
106
105
|
updateActions.push((0, jeSchedulesReducer_1.updateAccruedJESchedules)(accruedJeSchedules), (0, jeSchedulesReducer_1.updateAccruedJESchedulesDetails)(accruedJeSchedules, response.data.accrued_je_schedules
|
|
107
106
|
?.scheduled_journal_entries));
|
|
@@ -114,9 +113,7 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
|
|
|
114
113
|
}
|
|
115
114
|
updateActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesSuccess)({
|
|
116
115
|
jeSchedules: [...response.data.je_schedules],
|
|
117
|
-
failedJeSchedules: [
|
|
118
|
-
...response.data.failed_je_postings.je_schedules,
|
|
119
|
-
],
|
|
116
|
+
failedJeSchedules: [],
|
|
120
117
|
accruedJeSchedules: accruedJeSchedules,
|
|
121
118
|
oneTimeAccruals: oneTimeAccruals,
|
|
122
119
|
selectedPeriod: selectedPeriod,
|
package/lib/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js
CHANGED
|
@@ -3,29 +3,50 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.initializeJeScheduleLocalDataEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const jeSchedulesSelector_1 = require("../../../../entity/jeSchedules/jeSchedulesSelector");
|
|
7
6
|
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
8
7
|
const initializeJeScheduleLocalDataEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.initializeJeScheduleLocalData.match), (0, operators_1.mergeMap)((action) => {
|
|
9
8
|
const state = state$.value;
|
|
9
|
+
const { jeScheduleLocalDataById } = state.expenseAutomationJESchedulesViewState;
|
|
10
10
|
const actions = [];
|
|
11
11
|
const { jeScheduleTransactionKeys } = action.payload;
|
|
12
12
|
jeScheduleTransactionKeys.forEach((jeScheduleTransactionKey) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
13
|
+
// Read straight off the entity rather than through
|
|
14
|
+
// getJEScheduledTransactionByJEScheduleTransactionKey. That selector resolves the vendor,
|
|
15
|
+
// the base transaction and the accounts, and THROWS when any of them is not in the store
|
|
16
|
+
// yet -- a missing-schedule guard does not cover it. This epic is a mergeMap with no
|
|
17
|
+
// catchError, so one throw takes its subscription down for the rest of the session and
|
|
18
|
+
// every later row silently renders without a Retry button. The three fields below are all
|
|
19
|
+
// it has ever needed.
|
|
20
|
+
const jeSchedule = state.jeSchedulesState.schedulesByTransactionKey[jeScheduleTransactionKey];
|
|
21
|
+
if (jeSchedule == null) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
// Filtered on `error` because the entry array is shared state: a schedule whose detail
|
|
25
|
+
// page or Quick View has been opened holds every month it has, posted ones included.
|
|
26
|
+
jeSchedule.scheduledJournalEntry
|
|
27
|
+
.filter((journalEntry) => journalEntry.error.length > 0)
|
|
28
|
+
.forEach((journalEntry) => {
|
|
29
|
+
const { scheduledJournalEntryID } = journalEntry;
|
|
30
|
+
// Seeded once and never re-seeded. updateJeScheduleLocalDataById merges what it is
|
|
31
|
+
// given over what is there, and the seed carries explicit undefined edits -- so
|
|
32
|
+
// re-running it on a background refresh wiped a category the user had already picked
|
|
33
|
+
// and Retry went on to post the original broken one.
|
|
34
|
+
if (jeScheduleLocalDataById[scheduledJournalEntryID] != null) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
actions.push((0, jeSchedulesViewReducer_1.updateJeScheduleLocalDataById)({
|
|
38
|
+
localData: {
|
|
39
|
+
jeScheduleType: jeSchedule.jeScheduleType,
|
|
40
|
+
jeScheduleID: jeSchedule.jeScheduleId,
|
|
41
|
+
scheduledJournalEntryID,
|
|
42
|
+
updatedVendor: undefined,
|
|
43
|
+
updatedCategoryId: undefined,
|
|
44
|
+
updatedAccumulatedDepreciationCategoryID: undefined,
|
|
45
|
+
updatedClassId: undefined,
|
|
46
|
+
},
|
|
47
|
+
scheduledJournalEntryID,
|
|
48
|
+
}));
|
|
49
|
+
});
|
|
29
50
|
});
|
|
30
51
|
return (0, rxjs_1.from)(actions);
|
|
31
52
|
}));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateJESchedules, updateJESchedulesDetails } from '../../../../entity/jeSchedules/jeSchedulesReducer';
|
|
3
|
+
import { removeScheduledJournalEntryFromJESchedule, updateJESchedules, updateJESchedulesDetails } from '../../../../entity/jeSchedules/jeSchedulesReducer';
|
|
4
4
|
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
5
5
|
import { RootState } from '../../../../rootStateTypes';
|
|
6
6
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
7
7
|
import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
|
|
8
8
|
import { removeFailedJeScheduleTransactionKey, removeJeScheduleLocalDataById, retryJeSchedule, retryJeScheduleFailure, retryJeScheduleSuccess, updateJeScheduleTransactionKeys } from '../../reducers/jeSchedulesViewReducer';
|
|
9
|
-
export type ActionType = ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof openSnackbar> | ReturnType<typeof removeFailedJeScheduleTransactionKey> | ReturnType<typeof removeJeScheduleLocalDataById> | ReturnType<typeof retryJeSchedule> | ReturnType<typeof retryJeScheduleFailure> | ReturnType<typeof retryJeScheduleSuccess> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails> | ReturnType<typeof updateJeScheduleTransactionKeys>;
|
|
9
|
+
export type ActionType = ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof openSnackbar> | ReturnType<typeof removeFailedJeScheduleTransactionKey> | ReturnType<typeof removeJeScheduleLocalDataById> | ReturnType<typeof removeScheduledJournalEntryFromJESchedule> | ReturnType<typeof retryJeSchedule> | ReturnType<typeof retryJeScheduleFailure> | ReturnType<typeof retryJeScheduleSuccess> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails> | ReturnType<typeof updateJeScheduleTransactionKeys>;
|
|
10
10
|
export declare const retryJeScheduleEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.retryJeScheduleEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const jeSchedulesReducer_1 = require("../../../../entity/jeSchedules/jeSchedulesReducer");
|
|
6
7
|
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
7
8
|
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
8
9
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
@@ -25,9 +26,21 @@ const retryJeScheduleEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
25
26
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
26
27
|
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
27
28
|
const updateActions = [];
|
|
29
|
+
// Retire this entry, and the schedule itself only when this was its last failed
|
|
30
|
+
// one. A schedule that failed in several months is several rows sharing one
|
|
31
|
+
// schedule key, so dropping the key outright took the still-failing months off the
|
|
32
|
+
// list with it and nothing would have surfaced them again.
|
|
33
|
+
// Counts only entries that actually carry an error, for the same reason the selector
|
|
34
|
+
// and the local-data seed do: opening a schedule's detail or Quick View replaces
|
|
35
|
+
// this array with every month it has, posted ones included. Counting those left the
|
|
36
|
+
// schedule key in the bucket after its last real failure was resolved, so a later
|
|
37
|
+
// details write could surface a resolved row again with nothing to retry.
|
|
38
|
+
const stillFailingEntriesForSchedule = state.jeSchedulesState.schedulesByTransactionKey[jeScheduleTransactionKey]?.scheduledJournalEntry.filter((journalEntry) => journalEntry.error.length > 0) ?? [];
|
|
39
|
+
const wasLastFailedEntryForSchedule = stillFailingEntriesForSchedule.filter((journalEntry) => journalEntry.scheduledJournalEntryID !==
|
|
40
|
+
scheduledJournalEntryID).length === 0;
|
|
28
41
|
updateActions.push((0, jeSchedulesViewReducer_1.retryJeScheduleSuccess)({
|
|
29
42
|
scheduledJournalEntryID,
|
|
30
|
-
}), (0,
|
|
43
|
+
}), (0, jeSchedulesReducer_1.removeScheduledJournalEntryFromJESchedule)(jeScheduleTransactionKey, scheduledJournalEntryID), (0, jeSchedulesViewReducer_1.removeJeScheduleLocalDataById)({ scheduledJournalEntryID }), // Important to remove localdata after success.
|
|
31
44
|
(0, monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks)({
|
|
32
45
|
tenantId: currentTenant.tenantId,
|
|
33
46
|
period: selectedPeriod,
|
|
@@ -37,6 +50,9 @@ const retryJeScheduleEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
37
50
|
messageText: 'success',
|
|
38
51
|
type: 'success',
|
|
39
52
|
}));
|
|
53
|
+
if (wasLastFailedEntryForSchedule) {
|
|
54
|
+
updateActions.push((0, jeSchedulesViewReducer_1.removeFailedJeScheduleTransactionKey)(jeScheduleTransactionKey, selectedPeriod));
|
|
55
|
+
}
|
|
40
56
|
return (0, rxjs_1.from)(updateActions);
|
|
41
57
|
}
|
|
42
58
|
else {
|
|
@@ -78,6 +78,24 @@ interface ExpenseAutomationJESchedulesPayload {
|
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
export type ExpenseAutomationJESchedulesResponse = ZeniAPIResponse<ExpenseAutomationJESchedulesPayload>;
|
|
81
|
+
/**
|
|
82
|
+
* `GET /1.0/expenses_automation/failed_je_postings`.
|
|
83
|
+
*
|
|
84
|
+
* Deliberately the same `failed_je_postings` shape the schedules endpoint sends under that key, so
|
|
85
|
+
* both responses feed the same mappers. The difference is what the server does before answering:
|
|
86
|
+
* this endpoint applies no date window, so a posting that failed months ago still comes back.
|
|
87
|
+
*/
|
|
88
|
+
export interface FailedJePostingsPayload {
|
|
89
|
+
je_schedules: JEScheduledTransactionPayload[];
|
|
90
|
+
scheduled_journal_entries: ScheduledJournalEntryPayload[];
|
|
91
|
+
}
|
|
92
|
+
interface ExpenseAutomationFailedJePostingsPayload {
|
|
93
|
+
failed_je_postings: FailedJePostingsPayload;
|
|
94
|
+
query?: {
|
|
95
|
+
expected_post_start_date: string | null;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export type ExpenseAutomationFailedJePostingsResponse = ZeniAPIResponse<ExpenseAutomationFailedJePostingsPayload>;
|
|
81
99
|
export declare const SERVICE_MONTH_FORMAT = "YYYY-MM";
|
|
82
100
|
export interface CreateOneTimeAccrualPayload {
|
|
83
101
|
amount: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePeriod';
|
|
3
3
|
import { AccountMetadataPayload } from '../../../entity/account/accountPayload';
|
|
4
|
-
import { JEAccruedScheduledTransactionPayload, JEOneTimeAccrualPayload, JEScheduledTransactionPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
|
|
4
|
+
import { JEAccruedScheduledTransactionPayload, JEOneTimeAccrualPayload, JEScheduledTransactionPayload, ScheduledJournalEntryPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
|
|
5
5
|
import { OneTimeAccrualEdits } from '../../../entity/jeSchedules/jeSchedulesState';
|
|
6
6
|
import { JEScheduleKey, JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
7
7
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
@@ -47,7 +47,14 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
47
47
|
period: TimePeriod;
|
|
48
48
|
refreshViewInBackground: any;
|
|
49
49
|
selectedPageTab: "schedules" | "actual_matching" | "existing_schedules" | undefined;
|
|
50
|
-
}, "expenseAutomationJESchedulesView/fetchJeSchedules", never, never>,
|
|
50
|
+
}, "expenseAutomationJESchedulesView/fetchJeSchedules", never, never>, fetchFailedJePostings: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[refreshInBackground?: any], {
|
|
51
|
+
refreshInBackground: any;
|
|
52
|
+
}, "expenseAutomationJESchedulesView/fetchFailedJePostings", never, never>, fetchFailedJePostingsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
53
|
+
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
54
|
+
}, "expenseAutomationJESchedulesView/fetchFailedJePostingsFailure", never, never>, fetchFailedJePostingsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[failedJeSchedules: JEScheduledTransactionPayload[], failedScheduledJournalEntries: ScheduledJournalEntryPayload[]], {
|
|
55
|
+
failedJeSchedules: JEScheduledTransactionPayload[];
|
|
56
|
+
failedScheduledJournalEntries: ScheduledJournalEntryPayload[];
|
|
57
|
+
}, "expenseAutomationJESchedulesView/fetchFailedJePostingsSuccess", never, never>, fetchJeSchedulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
51
58
|
selectedPageTab: JEPageTab;
|
|
52
59
|
selectedPeriod: MonthYearPeriod;
|
|
53
60
|
status: ZeniAPIStatus;
|
|
@@ -132,7 +139,7 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
132
139
|
status: ZeniAPIStatus;
|
|
133
140
|
}, "expenseAutomationJESchedulesView/searchTransactionsForNewScheduleFailure">, searchTransactionsForNewScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
134
141
|
searchResults: JEScheduleTransactionKey[];
|
|
135
|
-
}, "expenseAutomationJESchedulesView/searchTransactionsForNewScheduleSuccess">, toggleJECreatedGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJECreatedGroupCollapsed">, toggleJEPendingGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJEPendingGroupCollapsed">, updateAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
142
|
+
}, "expenseAutomationJESchedulesView/searchTransactionsForNewScheduleSuccess">, toggleJECreatedGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJECreatedGroupCollapsed">, toggleJEFailedGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJEFailedGroupCollapsed">, toggleJEPendingGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJEPendingGroupCollapsed">, updateAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
136
143
|
accountPayload: AccountMetadataPayload[];
|
|
137
144
|
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypes">, updateAccountSettingsListForAccountTypesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
138
145
|
status: ZeniAPIStatus;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateNewScheduleLocalData = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJeOneTimeAccrualLocalData = exports.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = exports.toggleJECreatedGroupCollapsed = exports.searchTransactionsForNewScheduleSuccess = exports.searchTransactionsForNewScheduleFailure = exports.searchTransactionsForNewSchedule = exports.saveNewScheduleSuccess = void 0;
|
|
4
|
+
exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.resetNewScheduleLocalData = exports.removeJeScheduleTransactionKey = exports.removeJeAccruedScheduleKey = exports.removeJeScheduleLocalDataById = exports.removeJeOneTimeAccrualLocalData = exports.removeFailedJeScheduleTransactionKey = exports.initializeNewSchedule = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchOneTimeAccrualSuccess = exports.fetchOneTimeAccrualFailure = exports.fetchOneTimeAccrual = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchFailedJePostingsSuccess = exports.fetchFailedJePostingsFailure = exports.fetchFailedJePostings = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.revertOneTimeAccrual = exports.revertJeScheduleSuccess = exports.revertJeScheduleFailure = exports.revertJeSchedule = exports.promoteOneTimeAccrual = exports.oneTimeAccrualActionSuccess = exports.oneTimeAccrualActionFailure = exports.ignoreOneTimeAccrual = exports.createOneTimeAccrualSuccess = exports.createOneTimeAccrualFailure = exports.createOneTimeAccrual = exports.clearSearchTransactionsForNewSchedule = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.searchTransactionsInitialState = exports.newScheduleInitialState = exports.getBaseNewScheduleLocalData = exports.accountSettingsInitialState = void 0;
|
|
5
|
+
exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateNewScheduleLocalData = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJeOneTimeAccrualLocalData = exports.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = exports.toggleJEFailedGroupCollapsed = exports.toggleJECreatedGroupCollapsed = exports.searchTransactionsForNewScheduleSuccess = exports.searchTransactionsForNewScheduleFailure = exports.searchTransactionsForNewSchedule = exports.saveNewScheduleSuccess = exports.saveNewScheduleFailure = exports.saveNewSchedule = exports.saveAccountSettingsSuccess = void 0;
|
|
6
6
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
7
7
|
const getNestedAccountIDHierarchyForReport_1 = require("../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
|
|
8
8
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
@@ -68,6 +68,11 @@ exports.initialState = {
|
|
|
68
68
|
jeScheduleAccruedKeysByPeriodAndTab: {},
|
|
69
69
|
jeScheduleOneTimeAccrualKeysByPeriodAndTab: {},
|
|
70
70
|
failedJeScheduleTransactionKeysByPeriodAndTab: {},
|
|
71
|
+
failedJePostings: {
|
|
72
|
+
fetchState: { fetchState: 'Not-Started', error: undefined },
|
|
73
|
+
jeScheduleTransactionKeys: [],
|
|
74
|
+
scheduledJournalEntryIDs: [],
|
|
75
|
+
},
|
|
71
76
|
postStatusById: {},
|
|
72
77
|
ignoreStatusById: {},
|
|
73
78
|
revertStatusById: {},
|
|
@@ -77,6 +82,9 @@ exports.initialState = {
|
|
|
77
82
|
oneTimeAccrualFetchStatusById: {},
|
|
78
83
|
uiState: {
|
|
79
84
|
createdGroupCollapsed: false,
|
|
85
|
+
// Expanded, like the other two. A failed posting is the only thing on this page that is
|
|
86
|
+
// actively wrong, so folding it away by default would hide the reason to open the tab.
|
|
87
|
+
failedGroupCollapsed: false,
|
|
80
88
|
pendingGroupCollapsed: false,
|
|
81
89
|
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
82
90
|
searchString: '',
|
|
@@ -148,6 +156,59 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
148
156
|
};
|
|
149
157
|
},
|
|
150
158
|
},
|
|
159
|
+
/**
|
|
160
|
+
* The Failed Postings list, fetched separately from the schedules it belongs to.
|
|
161
|
+
*
|
|
162
|
+
* No period and no tab in any of these three: the endpoint applies no date window, so there is
|
|
163
|
+
* one list per tenant and one slot to hold it. `refreshInBackground` keeps a silent refetch
|
|
164
|
+
* from dropping a skeleton over rows already on screen, the same way refreshStatus does for
|
|
165
|
+
* the schedules list.
|
|
166
|
+
*/
|
|
167
|
+
fetchFailedJePostings: {
|
|
168
|
+
reducer(draft, action) {
|
|
169
|
+
if (!action.payload.refreshInBackground) {
|
|
170
|
+
draft.failedJePostings.fetchState = {
|
|
171
|
+
fetchState: 'In-Progress',
|
|
172
|
+
error: undefined,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
prepare(refreshInBackground = false) {
|
|
177
|
+
return { payload: { refreshInBackground } };
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
fetchFailedJePostingsSuccess: {
|
|
181
|
+
reducer(draft, action) {
|
|
182
|
+
// Both lists are replaced, never merged: this response is the whole current answer to
|
|
183
|
+
// "what is failing right now", so an entry it no longer names has stopped failing --
|
|
184
|
+
// resolved by someone else, or posted since -- and must drop out of the group.
|
|
185
|
+
draft.failedJePostings = {
|
|
186
|
+
fetchState: { fetchState: 'Completed', error: undefined },
|
|
187
|
+
jeScheduleTransactionKeys: action.payload.failedJeSchedules.map((schedule) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedule.base_transaction)),
|
|
188
|
+
// `?? ''` mirrors toScheduledJournalEntryState, so an entry the server sent without an
|
|
189
|
+
// id lands on the same value on both sides and still matches itself.
|
|
190
|
+
scheduledJournalEntryIDs: action.payload.failedScheduledJournalEntries.map((journalEntry) => journalEntry.scheduled_journal_entry_id ?? ''),
|
|
191
|
+
};
|
|
192
|
+
},
|
|
193
|
+
prepare(failedJeSchedules, failedScheduledJournalEntries) {
|
|
194
|
+
return { payload: { failedJeSchedules, failedScheduledJournalEntries } };
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
fetchFailedJePostingsFailure: {
|
|
198
|
+
reducer(draft, action) {
|
|
199
|
+
// Keys are deliberately left alone. The schedules list clears its buckets on failure so an
|
|
200
|
+
// errored tab cannot read as "these are all the schedules there are", but this list is a
|
|
201
|
+
// set of outstanding problems -- showing the last known ones beside an error beats
|
|
202
|
+
// implying there are none.
|
|
203
|
+
draft.failedJePostings.fetchState = {
|
|
204
|
+
fetchState: 'Error',
|
|
205
|
+
error: action.payload.status,
|
|
206
|
+
};
|
|
207
|
+
},
|
|
208
|
+
prepare(status) {
|
|
209
|
+
return { payload: { status } };
|
|
210
|
+
},
|
|
211
|
+
},
|
|
151
212
|
fetchJeSchedulesSuccess(draft, action) {
|
|
152
213
|
const { jeSchedules, selectedPeriod, selectedPageTab, failedJeSchedules, accruedJeSchedules, oneTimeAccruals, refreshViewInBackground, } = action.payload;
|
|
153
214
|
const periodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
|
|
@@ -210,6 +271,13 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
210
271
|
error: undefined,
|
|
211
272
|
},
|
|
212
273
|
};
|
|
274
|
+
// This posting has just succeeded, so it is no longer part of the failing set. Removing the
|
|
275
|
+
// entry from the schedule entity is not enough on its own: a later detail or Quick View
|
|
276
|
+
// fetch re-adds that month from the server, and because is_posting_failed is never cleared
|
|
277
|
+
// it can still arrive carrying its old error array. With the id left in place the selector
|
|
278
|
+
// would match it again and put a Retry button back on a posting that already went through.
|
|
279
|
+
draft.failedJePostings.scheduledJournalEntryIDs =
|
|
280
|
+
draft.failedJePostings.scheduledJournalEntryIDs.filter((failedEntryID) => failedEntryID !== scheduledJournalEntryID);
|
|
213
281
|
},
|
|
214
282
|
retryJeScheduleFailure(draft, action) {
|
|
215
283
|
const { status, scheduledJournalEntryID } = action.payload;
|
|
@@ -364,6 +432,8 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
364
432
|
reducer(draft, action) {
|
|
365
433
|
const { failedJeScheduleKey } = action.payload;
|
|
366
434
|
removeKeyFromEveryTabSlot(draft.failedJeScheduleTransactionKeysByPeriodAndTab, failedJeScheduleKey);
|
|
435
|
+
draft.failedJePostings.jeScheduleTransactionKeys =
|
|
436
|
+
draft.failedJePostings.jeScheduleTransactionKeys.filter((jeScheduleKey) => jeScheduleKey !== failedJeScheduleKey);
|
|
367
437
|
},
|
|
368
438
|
},
|
|
369
439
|
initializeJeScheduleLocalData: {
|
|
@@ -706,6 +776,9 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
706
776
|
draft.uiState.createdGroupCollapsed =
|
|
707
777
|
!draft.uiState.createdGroupCollapsed;
|
|
708
778
|
},
|
|
779
|
+
toggleJEFailedGroupCollapsed(draft) {
|
|
780
|
+
draft.uiState.failedGroupCollapsed = !draft.uiState.failedGroupCollapsed;
|
|
781
|
+
},
|
|
709
782
|
clearExpenseAutomationJESchedulesView(draft) {
|
|
710
783
|
Object.assign(draft, exports.initialState);
|
|
711
784
|
},
|
|
@@ -716,7 +789,7 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
716
789
|
});
|
|
717
790
|
},
|
|
718
791
|
});
|
|
719
|
-
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.clearSearchTransactionsForNewSchedule = _a.clearSearchTransactionsForNewSchedule, exports.createOneTimeAccrual = _a.createOneTimeAccrual, exports.createOneTimeAccrualFailure = _a.createOneTimeAccrualFailure, exports.createOneTimeAccrualSuccess = _a.createOneTimeAccrualSuccess, exports.ignoreOneTimeAccrual = _a.ignoreOneTimeAccrual, exports.oneTimeAccrualActionFailure = _a.oneTimeAccrualActionFailure, exports.oneTimeAccrualActionSuccess = _a.oneTimeAccrualActionSuccess, exports.promoteOneTimeAccrual = _a.promoteOneTimeAccrual, exports.revertJeSchedule = _a.revertJeSchedule, exports.revertJeScheduleFailure = _a.revertJeScheduleFailure, exports.revertJeScheduleSuccess = _a.revertJeScheduleSuccess, exports.revertOneTimeAccrual = _a.revertOneTimeAccrual, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchOneTimeAccrual = _a.fetchOneTimeAccrual, exports.fetchOneTimeAccrualFailure = _a.fetchOneTimeAccrualFailure, exports.fetchOneTimeAccrualSuccess = _a.fetchOneTimeAccrualSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.initializeNewSchedule = _a.initializeNewSchedule, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeOneTimeAccrualLocalData = _a.removeJeOneTimeAccrualLocalData, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeAccruedScheduleKey = _a.removeJeAccruedScheduleKey, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.resetNewScheduleLocalData = _a.resetNewScheduleLocalData, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.saveNewSchedule = _a.saveNewSchedule, exports.saveNewScheduleFailure = _a.saveNewScheduleFailure, exports.saveNewScheduleSuccess = _a.saveNewScheduleSuccess, exports.searchTransactionsForNewSchedule = _a.searchTransactionsForNewSchedule, exports.searchTransactionsForNewScheduleFailure = _a.searchTransactionsForNewScheduleFailure, exports.searchTransactionsForNewScheduleSuccess = _a.searchTransactionsForNewScheduleSuccess, exports.toggleJECreatedGroupCollapsed = _a.toggleJECreatedGroupCollapsed, exports.toggleJEPendingGroupCollapsed = _a.toggleJEPendingGroupCollapsed, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJEScheduleTypeFilter = _a.updateJEScheduleTypeFilter, exports.updateJeOneTimeAccrualLocalData = _a.updateJeOneTimeAccrualLocalData, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateNewScheduleLocalData = _a.updateNewScheduleLocalData, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
|
|
792
|
+
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.clearSearchTransactionsForNewSchedule = _a.clearSearchTransactionsForNewSchedule, exports.createOneTimeAccrual = _a.createOneTimeAccrual, exports.createOneTimeAccrualFailure = _a.createOneTimeAccrualFailure, exports.createOneTimeAccrualSuccess = _a.createOneTimeAccrualSuccess, exports.ignoreOneTimeAccrual = _a.ignoreOneTimeAccrual, exports.oneTimeAccrualActionFailure = _a.oneTimeAccrualActionFailure, exports.oneTimeAccrualActionSuccess = _a.oneTimeAccrualActionSuccess, exports.promoteOneTimeAccrual = _a.promoteOneTimeAccrual, exports.revertJeSchedule = _a.revertJeSchedule, exports.revertJeScheduleFailure = _a.revertJeScheduleFailure, exports.revertJeScheduleSuccess = _a.revertJeScheduleSuccess, exports.revertOneTimeAccrual = _a.revertOneTimeAccrual, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchFailedJePostings = _a.fetchFailedJePostings, exports.fetchFailedJePostingsFailure = _a.fetchFailedJePostingsFailure, exports.fetchFailedJePostingsSuccess = _a.fetchFailedJePostingsSuccess, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchOneTimeAccrual = _a.fetchOneTimeAccrual, exports.fetchOneTimeAccrualFailure = _a.fetchOneTimeAccrualFailure, exports.fetchOneTimeAccrualSuccess = _a.fetchOneTimeAccrualSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.initializeNewSchedule = _a.initializeNewSchedule, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeOneTimeAccrualLocalData = _a.removeJeOneTimeAccrualLocalData, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeAccruedScheduleKey = _a.removeJeAccruedScheduleKey, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.resetNewScheduleLocalData = _a.resetNewScheduleLocalData, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.saveNewSchedule = _a.saveNewSchedule, exports.saveNewScheduleFailure = _a.saveNewScheduleFailure, exports.saveNewScheduleSuccess = _a.saveNewScheduleSuccess, exports.searchTransactionsForNewSchedule = _a.searchTransactionsForNewSchedule, exports.searchTransactionsForNewScheduleFailure = _a.searchTransactionsForNewScheduleFailure, exports.searchTransactionsForNewScheduleSuccess = _a.searchTransactionsForNewScheduleSuccess, exports.toggleJECreatedGroupCollapsed = _a.toggleJECreatedGroupCollapsed, exports.toggleJEFailedGroupCollapsed = _a.toggleJEFailedGroupCollapsed, exports.toggleJEPendingGroupCollapsed = _a.toggleJEPendingGroupCollapsed, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJEScheduleTypeFilter = _a.updateJEScheduleTypeFilter, exports.updateJeOneTimeAccrualLocalData = _a.updateJeOneTimeAccrualLocalData, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateNewScheduleLocalData = _a.updateNewScheduleLocalData, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
|
|
720
793
|
exports.default = expenseAutomationJESchedulesView.reducer;
|
|
721
794
|
const doUpdateRecommendationForAccountSettings = (draft, payload) => {
|
|
722
795
|
const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
|
|
@@ -47,6 +47,8 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
|
47
47
|
completionStatus: CompletionStatusType;
|
|
48
48
|
createdSchedules: JEScheduleRow[];
|
|
49
49
|
createdTotal: number;
|
|
50
|
+
failedPostings: JEScheduledTransactionWithFailedEntries[];
|
|
51
|
+
failedPostingsFetchState: FetchStateAndError;
|
|
50
52
|
hasLoadedForSelectedTab: boolean;
|
|
51
53
|
ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
|
|
52
54
|
jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
|
|
@@ -61,6 +63,7 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
|
61
63
|
pendingReviewTotal: number;
|
|
62
64
|
postStatusById: Record<ID, FetchStateAndError>;
|
|
63
65
|
refreshStatus: FetchStateAndError;
|
|
66
|
+
/** @deprecated Alias of `failedPostings`. Remove once webc and app-ui are repointed. */
|
|
64
67
|
resolveSchedules: JEScheduledTransactionWithFailedEntries[];
|
|
65
68
|
revertStatusById: Record<JEScheduleKey | JEScheduleTransactionKey, FetchStateAndError>;
|
|
66
69
|
scheduleCountsByTab: Partial<Record<JEPageTab, number>>;
|