@zeniai/client-epic-state 5.2.56-betaRD1 → 5.2.56
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/invoicing/dunningCase/dunningCaseTypes.d.ts +1 -1
- package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +1 -4
- package/lib/entity/jeSchedules/jeSchedulesReducer.js +5 -79
- package/lib/entity/task/taskState.d.ts +1 -1
- package/lib/epic.d.ts +1 -2
- package/lib/epic.js +4 -6
- package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +4 -78
- package/lib/esm/epic.js +4 -6
- package/lib/esm/index.js +3 -3
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +1 -14
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +13 -10
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js +17 -38
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +1 -17
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -74
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +14 -49
- package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +6 -6
- package/lib/index.d.ts +3 -3
- package/lib/index.js +49 -50
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +0 -13
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +11 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js +17 -38
- package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +1 -17
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +0 -18
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +3 -10
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +3 -76
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +0 -3
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +14 -49
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +0 -16
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +2 -2
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +6 -6
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +1 -1
- package/package.json +1 -1
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.js +0 -39
- package/lib/tsconfig.mocks.tsbuildinfo +0 -1
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.d.ts +0 -20
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.js +0 -43
|
@@ -84,9 +84,8 @@ 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
|
-
//
|
|
89
|
-
// on Review. Dropping the key from the response is a server-side follow-up.
|
|
87
|
+
// A failed posting from an earlier month still needs to surface here, so this list
|
|
88
|
+
// is deliberately not windowed.
|
|
90
89
|
filter_failed_je_postings_by_date: false,
|
|
91
90
|
}),
|
|
92
91
|
};
|
|
@@ -97,10 +96,12 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
|
|
|
97
96
|
const updateActions = [];
|
|
98
97
|
const accruedJeSchedules = response.data.accrued_je_schedules?.je_schedules ?? [];
|
|
99
98
|
const oneTimeAccruals = response.data.one_time_accruals ?? [];
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
updateActions.push((0, jeSchedulesReducer_1.updateJESchedules)([
|
|
100
|
+
...response.data.je_schedules,
|
|
101
|
+
...response.data.failed_je_postings.je_schedules,
|
|
102
|
+
]), (0, jeSchedulesReducer_1.updateJESchedulesDetails)([...response.data.failed_je_postings.je_schedules], response.data.failed_je_postings.scheduled_journal_entries), (0, jeSchedulesViewReducer_1.initializeJeScheduleLocalData)([
|
|
103
|
+
...response.data.failed_je_postings.je_schedules,
|
|
104
|
+
]));
|
|
104
105
|
if (accruedJeSchedules.length > 0) {
|
|
105
106
|
updateActions.push((0, jeSchedulesReducer_1.updateAccruedJESchedules)(accruedJeSchedules), (0, jeSchedulesReducer_1.updateAccruedJESchedulesDetails)(accruedJeSchedules, response.data.accrued_je_schedules
|
|
106
107
|
?.scheduled_journal_entries));
|
|
@@ -113,7 +114,9 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
|
|
|
113
114
|
}
|
|
114
115
|
updateActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesSuccess)({
|
|
115
116
|
jeSchedules: [...response.data.je_schedules],
|
|
116
|
-
failedJeSchedules: [
|
|
117
|
+
failedJeSchedules: [
|
|
118
|
+
...response.data.failed_je_postings.je_schedules,
|
|
119
|
+
],
|
|
117
120
|
accruedJeSchedules: accruedJeSchedules,
|
|
118
121
|
oneTimeAccruals: oneTimeAccruals,
|
|
119
122
|
selectedPeriod: selectedPeriod,
|
package/lib/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js
CHANGED
|
@@ -3,50 +3,29 @@ 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");
|
|
6
7
|
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
7
8
|
const initializeJeScheduleLocalDataEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.initializeJeScheduleLocalData.match), (0, operators_1.mergeMap)((action) => {
|
|
8
9
|
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
|
-
|
|
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
|
-
});
|
|
13
|
+
const jeScheduledTransaction = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleTransactionKey, state);
|
|
14
|
+
const initLocalData = {
|
|
15
|
+
jeScheduleType: jeScheduledTransaction.jeScheduleType,
|
|
16
|
+
jeScheduleID: jeScheduledTransaction.jeScheduleId,
|
|
17
|
+
scheduledJournalEntryID: jeScheduledTransaction.scheduledJournalEntry[0]
|
|
18
|
+
.scheduledJournalEntryID,
|
|
19
|
+
updatedVendor: undefined,
|
|
20
|
+
updatedCategoryId: undefined,
|
|
21
|
+
updatedAccumulatedDepreciationCategoryID: undefined,
|
|
22
|
+
updatedClassId: undefined,
|
|
23
|
+
};
|
|
24
|
+
actions.push((0, jeSchedulesViewReducer_1.updateJeScheduleLocalDataById)({
|
|
25
|
+
localData: initLocalData,
|
|
26
|
+
scheduledJournalEntryID: jeScheduledTransaction.scheduledJournalEntry[0]
|
|
27
|
+
.scheduledJournalEntryID,
|
|
28
|
+
}));
|
|
50
29
|
});
|
|
51
30
|
return (0, rxjs_1.from)(actions);
|
|
52
31
|
}));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import {
|
|
3
|
+
import { 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
|
|
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>;
|
|
10
10
|
export declare const retryJeScheduleEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -3,7 +3,6 @@ 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");
|
|
7
6
|
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
8
7
|
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
9
8
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
@@ -26,21 +25,9 @@ const retryJeScheduleEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
26
25
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
27
26
|
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
28
27
|
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;
|
|
41
28
|
updateActions.push((0, jeSchedulesViewReducer_1.retryJeScheduleSuccess)({
|
|
42
29
|
scheduledJournalEntryID,
|
|
43
|
-
}), (0,
|
|
30
|
+
}), (0, jeSchedulesViewReducer_1.removeFailedJeScheduleTransactionKey)(jeScheduleTransactionKey, selectedPeriod), (0, jeSchedulesViewReducer_1.removeJeScheduleLocalDataById)({ scheduledJournalEntryID }), // Important to remove localdata after success.
|
|
44
31
|
(0, monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks)({
|
|
45
32
|
tenantId: currentTenant.tenantId,
|
|
46
33
|
period: selectedPeriod,
|
|
@@ -50,9 +37,6 @@ const retryJeScheduleEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
50
37
|
messageText: 'success',
|
|
51
38
|
type: 'success',
|
|
52
39
|
}));
|
|
53
|
-
if (wasLastFailedEntryForSchedule) {
|
|
54
|
-
updateActions.push((0, jeSchedulesViewReducer_1.removeFailedJeScheduleTransactionKey)(jeScheduleTransactionKey, selectedPeriod));
|
|
55
|
-
}
|
|
56
40
|
return (0, rxjs_1.from)(updateActions);
|
|
57
41
|
}
|
|
58
42
|
else {
|
|
@@ -78,24 +78,6 @@ 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>;
|
|
99
81
|
export declare const SERVICE_MONTH_FORMAT = "YYYY-MM";
|
|
100
82
|
export interface CreateOneTimeAccrualPayload {
|
|
101
83
|
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
|
|
4
|
+
import { JEAccruedScheduledTransactionPayload, JEOneTimeAccrualPayload, JEScheduledTransactionPayload } 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,14 +47,7 @@ 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>,
|
|
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<{
|
|
50
|
+
}, "expenseAutomationJESchedulesView/fetchJeSchedules", never, never>, fetchJeSchedulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
58
51
|
selectedPageTab: JEPageTab;
|
|
59
52
|
selectedPeriod: MonthYearPeriod;
|
|
60
53
|
status: ZeniAPIStatus;
|
|
@@ -139,7 +132,7 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
139
132
|
status: ZeniAPIStatus;
|
|
140
133
|
}, "expenseAutomationJESchedulesView/searchTransactionsForNewScheduleFailure">, searchTransactionsForNewScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
141
134
|
searchResults: JEScheduleTransactionKey[];
|
|
142
|
-
}, "expenseAutomationJESchedulesView/searchTransactionsForNewScheduleSuccess">, toggleJECreatedGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJECreatedGroupCollapsed">,
|
|
135
|
+
}, "expenseAutomationJESchedulesView/searchTransactionsForNewScheduleSuccess">, toggleJECreatedGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJECreatedGroupCollapsed">, toggleJEPendingGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJEPendingGroupCollapsed">, updateAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
143
136
|
accountPayload: AccountMetadataPayload[];
|
|
144
137
|
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypes">, updateAccountSettingsListForAccountTypesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
145
138
|
status: ZeniAPIStatus;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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.
|
|
5
|
-
exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateNewScheduleLocalData = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJeOneTimeAccrualLocalData = exports.updateJEScheduleTypeFilter = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.toggleJEPendingGroupCollapsed = exports.
|
|
4
|
+
exports.saveNewScheduleFailure = exports.saveNewSchedule = exports.saveAccountSettingsSuccess = 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.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.toggleJECreatedGroupCollapsed = exports.searchTransactionsForNewScheduleSuccess = exports.searchTransactionsForNewScheduleFailure = exports.searchTransactionsForNewSchedule = exports.saveNewScheduleSuccess = 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,11 +68,6 @@ 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
|
-
},
|
|
76
71
|
postStatusById: {},
|
|
77
72
|
ignoreStatusById: {},
|
|
78
73
|
revertStatusById: {},
|
|
@@ -82,9 +77,6 @@ exports.initialState = {
|
|
|
82
77
|
oneTimeAccrualFetchStatusById: {},
|
|
83
78
|
uiState: {
|
|
84
79
|
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,
|
|
88
80
|
pendingGroupCollapsed: false,
|
|
89
81
|
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
90
82
|
searchString: '',
|
|
@@ -156,59 +148,6 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
156
148
|
};
|
|
157
149
|
},
|
|
158
150
|
},
|
|
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
|
-
},
|
|
212
151
|
fetchJeSchedulesSuccess(draft, action) {
|
|
213
152
|
const { jeSchedules, selectedPeriod, selectedPageTab, failedJeSchedules, accruedJeSchedules, oneTimeAccruals, refreshViewInBackground, } = action.payload;
|
|
214
153
|
const periodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
|
|
@@ -271,13 +210,6 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
271
210
|
error: undefined,
|
|
272
211
|
},
|
|
273
212
|
};
|
|
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);
|
|
281
213
|
},
|
|
282
214
|
retryJeScheduleFailure(draft, action) {
|
|
283
215
|
const { status, scheduledJournalEntryID } = action.payload;
|
|
@@ -432,8 +364,6 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
432
364
|
reducer(draft, action) {
|
|
433
365
|
const { failedJeScheduleKey } = action.payload;
|
|
434
366
|
removeKeyFromEveryTabSlot(draft.failedJeScheduleTransactionKeysByPeriodAndTab, failedJeScheduleKey);
|
|
435
|
-
draft.failedJePostings.jeScheduleTransactionKeys =
|
|
436
|
-
draft.failedJePostings.jeScheduleTransactionKeys.filter((jeScheduleKey) => jeScheduleKey !== failedJeScheduleKey);
|
|
437
367
|
},
|
|
438
368
|
},
|
|
439
369
|
initializeJeScheduleLocalData: {
|
|
@@ -776,9 +706,6 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
776
706
|
draft.uiState.createdGroupCollapsed =
|
|
777
707
|
!draft.uiState.createdGroupCollapsed;
|
|
778
708
|
},
|
|
779
|
-
toggleJEFailedGroupCollapsed(draft) {
|
|
780
|
-
draft.uiState.failedGroupCollapsed = !draft.uiState.failedGroupCollapsed;
|
|
781
|
-
},
|
|
782
709
|
clearExpenseAutomationJESchedulesView(draft) {
|
|
783
710
|
Object.assign(draft, exports.initialState);
|
|
784
711
|
},
|
|
@@ -789,7 +716,7 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
789
716
|
});
|
|
790
717
|
},
|
|
791
718
|
});
|
|
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.
|
|
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;
|
|
793
720
|
exports.default = expenseAutomationJESchedulesView.reducer;
|
|
794
721
|
const doUpdateRecommendationForAccountSettings = (draft, payload) => {
|
|
795
722
|
const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
|
|
@@ -47,8 +47,6 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
|
47
47
|
completionStatus: CompletionStatusType;
|
|
48
48
|
createdSchedules: JEScheduleRow[];
|
|
49
49
|
createdTotal: number;
|
|
50
|
-
failedPostings: JEScheduledTransactionWithFailedEntries[];
|
|
51
|
-
failedPostingsFetchState: FetchStateAndError;
|
|
52
50
|
hasLoadedForSelectedTab: boolean;
|
|
53
51
|
ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
|
|
54
52
|
jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
|
|
@@ -63,7 +61,6 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
|
63
61
|
pendingReviewTotal: number;
|
|
64
62
|
postStatusById: Record<ID, FetchStateAndError>;
|
|
65
63
|
refreshStatus: FetchStateAndError;
|
|
66
|
-
/** @deprecated Alias of `failedPostings`. Remove once webc and app-ui are repointed. */
|
|
67
64
|
resolveSchedules: JEScheduledTransactionWithFailedEntries[];
|
|
68
65
|
revertStatusById: Record<JEScheduleKey | JEScheduleTransactionKey, FetchStateAndError>;
|
|
69
66
|
scheduleCountsByTab: Partial<Record<JEPageTab, number>>;
|
|
@@ -225,7 +225,7 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
225
225
|
const accruedSchedules = [];
|
|
226
226
|
const oneTimeAccruals = [];
|
|
227
227
|
const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, } = state;
|
|
228
|
-
const { jeScheduleTransactionKeysByPeriodAndTab, jeScheduleAccruedKeysByPeriodAndTab, jeScheduleOneTimeAccrualKeysByPeriodAndTab,
|
|
228
|
+
const { jeScheduleTransactionKeysByPeriodAndTab, jeScheduleAccruedKeysByPeriodAndTab, jeScheduleOneTimeAccrualKeysByPeriodAndTab, failedJeScheduleTransactionKeysByPeriodAndTab, jeScheduleLocalDataById, postStatusById, ignoreStatusById, revertStatusById, oneTimeAccrualActionStatusById, uiState, error, fetchState, refreshStatus, newSchedule, } = expenseAutomationJESchedulesViewState;
|
|
229
229
|
const accountSettingsView = (0, jeAccountSettingsViewSelector_1.getJEAccountSettingsView)(state);
|
|
230
230
|
const newScheduleView = newSchedule.selectedDetailScheduleType === 'fixed_assets' ||
|
|
231
231
|
newSchedule.selectedDetailScheduleType === 'prepaid_expenses'
|
|
@@ -264,11 +264,15 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
264
264
|
const jeScheduleTransactionKeysForSelectedTab = selectedPeriodTabKey != null
|
|
265
265
|
? jeScheduleTransactionKeysByPeriodAndTab[selectedPeriodTabKey]
|
|
266
266
|
: undefined;
|
|
267
|
+
const failedJeScheduleTransactionKeysForSelectedTab = selectedPeriodTabKey != null
|
|
268
|
+
? failedJeScheduleTransactionKeysByPeriodAndTab[selectedPeriodTabKey]
|
|
269
|
+
: undefined;
|
|
267
270
|
// Distinguishes "this tab has never been fetched for this period" from "fetched and genuinely
|
|
268
271
|
// empty". Without it the page cannot tell a first visit from a real empty state, and renders an
|
|
269
272
|
// empty table where it should render a skeleton.
|
|
270
273
|
const hasLoadedForSelectedTab = jeScheduleTransactionKeysForSelectedTab != null;
|
|
271
274
|
const jeScheduleTransactionKeys = jeScheduleTransactionKeysForSelectedTab ?? [];
|
|
275
|
+
const failedJeScheduleTransactionKeys = failedJeScheduleTransactionKeysForSelectedTab ?? [];
|
|
272
276
|
const jeScheduleAccruedKeys = (selectedPeriodTabKey != null
|
|
273
277
|
? jeScheduleAccruedKeysByPeriodAndTab[selectedPeriodTabKey]
|
|
274
278
|
: undefined) ?? [];
|
|
@@ -291,57 +295,24 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
291
295
|
accruedSchedules.push(accruedScheduleDetails);
|
|
292
296
|
}
|
|
293
297
|
});
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
failedJePostings.jeScheduleTransactionKeys.forEach((jeScheduleKey) => {
|
|
298
|
-
// getJEScheduledTransactionByJEScheduleTransactionKey throws three different ways: it
|
|
299
|
-
// destructures the result of recordGet without a null check, and it raises explicitly for a
|
|
300
|
-
// missing vendor and for a missing base transaction. Catching rather than pre-checking each
|
|
301
|
-
// one keeps this correct if a fourth is added, and none of the three is recoverable here --
|
|
302
|
-
// the row cannot be drawn either way.
|
|
303
|
-
//
|
|
304
|
-
// This matters more for this bucket than anywhere else on the page. It is tenant-wide, so it
|
|
305
|
-
// names schedules the close-month list never loaded, and the group is defined by deleted
|
|
306
|
-
// vendors and deleted categories -- precisely the rows whose entities are most likely to be
|
|
307
|
-
// missing. Unguarded, one such key takes down the whole JE tab instead of dropping one row.
|
|
308
|
-
try {
|
|
309
|
-
failedJeScheduledTransaction.push((0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleKey, state));
|
|
310
|
-
}
|
|
311
|
-
catch {
|
|
312
|
-
// Intentionally swallowed: a failed posting we cannot resolve is one missing row, and the
|
|
313
|
-
// alternative is a blank page for every other row too.
|
|
314
|
-
}
|
|
298
|
+
failedJeScheduleTransactionKeys.forEach((jeScheduleKey) => {
|
|
299
|
+
const jeScheduleDetails = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleKey, state);
|
|
300
|
+
failedJeScheduledTransaction.push(jeScheduleDetails);
|
|
315
301
|
});
|
|
316
|
-
// What the endpoint last reported as failing. The entity store keeps every month a schedule
|
|
317
|
-
// has and an entry resolved by someone else keeps its old `error` array, so `error` alone would
|
|
318
|
-
// leave a Retry button on a posting that is no longer failing.
|
|
319
|
-
const failedScheduledJournalEntryIDs = new Set(failedJePostings.scheduledJournalEntryIDs);
|
|
320
302
|
const { sortKey, sortOrder, selectedJETypeFilter } = uiState;
|
|
321
|
-
const matchesTypeFilter = (schedule) => selectedJETypeFilter == null ||
|
|
322
|
-
getJEScheduleRowType(schedule) === selectedJETypeFilter;
|
|
323
303
|
const unsortedResolveSchedules = [];
|
|
324
304
|
failedJeScheduledTransaction.forEach((schedule) => {
|
|
325
|
-
|
|
326
|
-
// opening a schedule's detail page or Quick View replaces it with every month the schedule
|
|
327
|
-
// has, posted ones included, so fanning out over all of them turned one failed posting into a
|
|
328
|
-
// row per month -- and a month that never failed has nothing to resolve, so it rendered with
|
|
329
|
-
// an empty action column.
|
|
330
|
-
//
|
|
331
|
-
// Intersected with the ids the endpoint actually returned, not just `error`: the entry array
|
|
332
|
-
// is a cache of every month, and an entry whose failure someone else resolved keeps its stale
|
|
333
|
-
// error array until something overwrites it. Only what the last fetch named is still failing.
|
|
334
|
-
schedule.scheduledJournalEntry
|
|
335
|
-
.filter((journalEntry) => journalEntry.error.length > 0 &&
|
|
336
|
-
failedScheduledJournalEntryIDs.has(journalEntry.scheduledJournalEntryID))
|
|
337
|
-
.forEach((journalEntry) => {
|
|
305
|
+
schedule.scheduledJournalEntry.forEach((journalEntry) => {
|
|
338
306
|
unsortedResolveSchedules.push({
|
|
339
307
|
...schedule,
|
|
340
308
|
scheduledJournalEntry: journalEntry,
|
|
341
309
|
});
|
|
342
310
|
});
|
|
343
311
|
});
|
|
344
|
-
const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules
|
|
312
|
+
const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
|
|
313
|
+
const validResolveForPending = unsortedResolveSchedules.filter((r) => jeScheduleLocalDataById[r.scheduledJournalEntry.scheduledJournalEntryID] != null);
|
|
314
|
+
const matchesTypeFilter = (schedule) => selectedJETypeFilter == null ||
|
|
315
|
+
getJEScheduleRowType(schedule) === selectedJETypeFilter;
|
|
345
316
|
const isCreatedStatus = (schedule) => {
|
|
346
317
|
// An accrual is "created" once it is not review work: posted, reversing, reversed, or in a
|
|
347
318
|
// transient posting claim.
|
|
@@ -359,6 +330,7 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
359
330
|
];
|
|
360
331
|
const pendingReviewSchedules = sortJEScheduledTransactions([
|
|
361
332
|
...allScheduleRows.filter((schedule) => isPendingReviewRow(schedule) && matchesTypeFilter(schedule)),
|
|
333
|
+
...validResolveForPending,
|
|
362
334
|
], sortKey, sortOrder);
|
|
363
335
|
const createdSchedules = sortJEScheduledTransactions(allScheduleRows.filter((schedule) => isCreatedStatus(schedule) && matchesTypeFilter(schedule)), sortKey, sortOrder);
|
|
364
336
|
// KPI summary — derived from unfiltered schedules so counts are always accurate
|
|
@@ -477,13 +449,6 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
477
449
|
kpiSummary,
|
|
478
450
|
pendingReviewSchedules,
|
|
479
451
|
pendingReviewTotal,
|
|
480
|
-
failedPostings: resolveSchedules,
|
|
481
|
-
// Exposed so a consumer can tell "still loading" and "the lookup failed" from "nothing has
|
|
482
|
-
// failed". The bucket keeps its rows on failure precisely so an error can be shown beside
|
|
483
|
-
// them, which is only possible if the state travels with them.
|
|
484
|
-
failedPostingsFetchState: failedJePostings.fetchState,
|
|
485
|
-
// Deprecated alias of failedPostings. Still read by the section's footer-form effect and by
|
|
486
|
-
// app-ui analytics; remove once both are repointed.
|
|
487
452
|
resolveSchedules: resolveSchedules,
|
|
488
453
|
accountSettingsView,
|
|
489
454
|
newScheduleView,
|
|
@@ -19,7 +19,6 @@ export type JESchedulePeriodTabKey = `${JEPageTab}_${MonthYearPeriodId}`;
|
|
|
19
19
|
export declare const getJESchedulePeriodTabKey: (selectedPageTab: JEPageTab, monthYearPeriodId: MonthYearPeriodId) => JESchedulePeriodTabKey;
|
|
20
20
|
export interface JESchedulesViewUIState {
|
|
21
21
|
createdGroupCollapsed: boolean;
|
|
22
|
-
failedGroupCollapsed: boolean;
|
|
23
22
|
pendingGroupCollapsed: boolean;
|
|
24
23
|
scrollPosition: {
|
|
25
24
|
scrollTop: number;
|
|
@@ -42,23 +41,8 @@ export interface JEScheduleLocalData {
|
|
|
42
41
|
updatedClassId?: ID;
|
|
43
42
|
updatedVendor?: VendorBase;
|
|
44
43
|
}
|
|
45
|
-
/**
|
|
46
|
-
* The Failed Postings bucket, and the only list on this page that is not scoped to a period.
|
|
47
|
-
*
|
|
48
|
-
* A failed posting is broken until someone resolves it, whatever month it belongs to, so windowing
|
|
49
|
-
* it the way the schedule lists are windowed is what hid a March failure from the September close.
|
|
50
|
-
* It therefore has no period-tab key, and its own fetch state rather than the slice's: the list is
|
|
51
|
-
* fetched separately from `/1.0/expenses_automation/failed_je_postings`, so a slow or failing
|
|
52
|
-
* lookup here must not blank the schedules table, or vice versa.
|
|
53
|
-
*/
|
|
54
|
-
export interface FailedJePostingsState {
|
|
55
|
-
fetchState: FetchStateAndError;
|
|
56
|
-
jeScheduleTransactionKeys: JEScheduleTransactionKey[];
|
|
57
|
-
scheduledJournalEntryIDs: ID[];
|
|
58
|
-
}
|
|
59
44
|
export interface JESchedulesViewState extends FetchedState {
|
|
60
45
|
accountSettings: AccountSettingsState;
|
|
61
|
-
failedJePostings: FailedJePostingsState;
|
|
62
46
|
failedJeScheduleTransactionKeysByPeriodAndTab: Record<JESchedulePeriodTabKey, JEScheduleTransactionKey[]>;
|
|
63
47
|
ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
|
|
64
48
|
jeScheduleAccruedKeysByPeriodAndTab: Record<JESchedulePeriodTabKey, JEScheduleKey[]>;
|
package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer.d.ts
CHANGED
|
@@ -26,6 +26,6 @@ export declare const fetchInvoicingDunningCaseList: import("@reduxjs/toolkit").A
|
|
|
26
26
|
ids: ID[];
|
|
27
27
|
keepExistingListItems: boolean;
|
|
28
28
|
nextCursor: string | null;
|
|
29
|
-
}, "invoicingDunningCaseListView/updateInvoicingDunningCaseList">, updateInvoicingDunningCaseListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingDunningCaseListView/updateInvoicingDunningCaseListFailure">, fetchInvoicingDunningCaseCounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingDunningCaseListView/fetchInvoicingDunningCaseCounts">, updateInvoicingDunningCaseCounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingListCounts, "invoicingDunningCaseListView/updateInvoicingDunningCaseCounts">, updateInvoicingDunningCaseCountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingDunningCaseListView/updateInvoicingDunningCaseCountsFailure">, updateInvoicingDunningCaseFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingDunningCaseFilters, "invoicingDunningCaseListView/updateInvoicingDunningCaseFilters">, setInvoicingDunningCaseActiveTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"
|
|
29
|
+
}, "invoicingDunningCaseListView/updateInvoicingDunningCaseList">, updateInvoicingDunningCaseListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingDunningCaseListView/updateInvoicingDunningCaseListFailure">, fetchInvoicingDunningCaseCounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingDunningCaseListView/fetchInvoicingDunningCaseCounts">, updateInvoicingDunningCaseCounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingListCounts, "invoicingDunningCaseListView/updateInvoicingDunningCaseCounts">, updateInvoicingDunningCaseCountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingDunningCaseListView/updateInvoicingDunningCaseCountsFailure">, updateInvoicingDunningCaseFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingDunningCaseFilters, "invoicingDunningCaseListView/updateInvoicingDunningCaseFilters">, setInvoicingDunningCaseActiveTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"cancelled" | "scheduled" | "retrying" | "manual_review" | "resolved" | "paused" | "all", "invoicingDunningCaseListView/setInvoicingDunningCaseActiveTab">;
|
|
30
30
|
declare const _default: import("redux").Reducer<InvoicingDunningCaseListViewState>;
|
|
31
31
|
export default _default;
|
package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts
CHANGED
|
@@ -19,8 +19,8 @@ export interface InvoicingDunningCaseColumnConfig {
|
|
|
19
19
|
sortable: boolean;
|
|
20
20
|
}
|
|
21
21
|
export declare const INVOICING_DUNNING_CASE_COLUMNS: InvoicingDunningCaseColumnConfig[];
|
|
22
|
-
export declare const ALL_INVOICING_DUNNING_CASE_TAB_IDS: readonly ["all", "
|
|
23
|
-
export declare const toInvoicingDunningCaseTabId: (v: string) => "
|
|
22
|
+
export declare const ALL_INVOICING_DUNNING_CASE_TAB_IDS: readonly ["all", "retrying", "scheduled", "manual_review", "paused", "resolved", "cancelled"];
|
|
23
|
+
export declare const toInvoicingDunningCaseTabId: (v: string) => "cancelled" | "scheduled" | "retrying" | "manual_review" | "resolved" | "paused" | "all";
|
|
24
24
|
export type InvoicingDunningCaseTabId = ReturnType<typeof toInvoicingDunningCaseTabId>;
|
|
25
25
|
export interface InvoicingDunningCaseListViewState extends FetchedState {
|
|
26
26
|
/** Selected status tab (CES-owned so it persists across page revisits). */
|
package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js
CHANGED
|
@@ -26,12 +26,12 @@ exports.INVOICING_DUNNING_CASE_COLUMNS = [
|
|
|
26
26
|
];
|
|
27
27
|
exports.ALL_INVOICING_DUNNING_CASE_TAB_IDS = [
|
|
28
28
|
'all',
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
29
|
+
'retrying',
|
|
30
|
+
'scheduled',
|
|
31
|
+
'manual_review',
|
|
32
|
+
'paused',
|
|
33
|
+
'resolved',
|
|
34
|
+
'cancelled',
|
|
35
35
|
];
|
|
36
36
|
const toInvoicingDunningCaseTabId = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_INVOICING_DUNNING_CASE_TAB_IDS);
|
|
37
37
|
exports.toInvoicingDunningCaseTabId = toInvoicingDunningCaseTabId;
|
package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewReducer.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare const fetchInvoicingSubscriptionList: import("@reduxjs/toolkit").
|
|
|
27
27
|
ids: ID[];
|
|
28
28
|
keepExistingListItems: boolean;
|
|
29
29
|
nextCursor: string | null;
|
|
30
|
-
}, "invoicingSubscriptionListView/updateInvoicingSubscriptionList">, updateInvoicingSubscriptionListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingSubscriptionListView/updateInvoicingSubscriptionListFailure">, fetchInvoicingSubscriptionCounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingSubscriptionListView/fetchInvoicingSubscriptionCounts">, updateInvoicingSubscriptionCounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingListCounts, "invoicingSubscriptionListView/updateInvoicingSubscriptionCounts">, updateInvoicingSubscriptionCountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingSubscriptionListView/updateInvoicingSubscriptionCountsFailure">, updateInvoicingSubscriptionFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingSubscriptionFilters, "invoicingSubscriptionListView/updateInvoicingSubscriptionFilters">, setInvoicingSubscriptionActiveTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"active" | "cancelled" | "future" | "
|
|
30
|
+
}, "invoicingSubscriptionListView/updateInvoicingSubscriptionList">, updateInvoicingSubscriptionListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingSubscriptionListView/updateInvoicingSubscriptionListFailure">, fetchInvoicingSubscriptionCounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingSubscriptionListView/fetchInvoicingSubscriptionCounts">, updateInvoicingSubscriptionCounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingListCounts, "invoicingSubscriptionListView/updateInvoicingSubscriptionCounts">, updateInvoicingSubscriptionCountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingSubscriptionListView/updateInvoicingSubscriptionCountsFailure">, updateInvoicingSubscriptionFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingSubscriptionFilters, "invoicingSubscriptionListView/updateInvoicingSubscriptionFilters">, setInvoicingSubscriptionActiveTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"active" | "cancelled" | "future" | "paused" | "in_trial" | "non_renewing" | "all", "invoicingSubscriptionListView/setInvoicingSubscriptionActiveTab">, addInvoicingSubscriptionToList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
31
31
|
id: ID;
|
|
32
32
|
status?: InvoicingSubscriptionStatus;
|
|
33
33
|
}, "invoicingSubscriptionListView/addInvoicingSubscriptionToList">;
|