@zeniai/client-epic-state 5.2.51-betaRD1 → 5.2.51
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 +1 -4
- package/lib/entity/jeSchedules/jeSchedulesReducer.js +5 -47
- package/lib/epic.d.ts +1 -2
- package/lib/epic.js +4 -6
- package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +4 -46
- package/lib/esm/epic.js +4 -6
- package/lib/esm/index.js +3 -3
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +1 -9
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +13 -10
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js +15 -29
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +1 -12
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -60
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +11 -11
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +45 -21
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.js +4 -1
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +16 -3
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +6 -2
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.js +4 -1
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/seedInvoicingCouponFormDraftEpic.js +6 -2
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +10 -2
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +33 -0
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.js +43 -17
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic.js +6 -2
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.js +10 -2
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +34 -0
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.js +44 -18
- package/lib/esm/view/invoicing/invoicingFormDraft.js +13 -0
- 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 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +11 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/initializeJeScheduleLocalDataEpic.js +15 -29
- package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/retryJeSchedulesEpic.js +1 -12
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +0 -18
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -8
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +3 -62
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +11 -11
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +0 -15
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +22 -6
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +47 -22
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.js +3 -0
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +14 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/seedInvoicingCatalogItemFormDraftEpic.js +6 -2
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.js +3 -0
- package/lib/view/invoicing/editInvoicingCouponDetailView/seedInvoicingCouponFormDraftEpic.js +6 -2
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.d.ts +3 -1
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer.js +10 -2
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.d.ts +7 -7
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +33 -0
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewState.d.ts +6 -0
- package/lib/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.d.ts +15 -10
- package/lib/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.js +42 -16
- package/lib/view/invoicing/editInvoicingCustomerDetailView/seedInvoicingCustomerFormDraftEpic.js +6 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.d.ts +3 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer.js +10 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +7 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +34 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewState.d.ts +6 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.d.ts +15 -11
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.js +42 -16
- package/lib/view/invoicing/invoicingFormDraft.d.ts +10 -1
- package/lib/view/invoicing/invoicingFormDraft.js +14 -0
- package/package.json +1 -1
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.js +0 -40
- package/lib/tsconfig.mocks.tsbuildinfo +0 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.d.ts +0 -20
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchFailedJePostingsEpic.js +0 -44
|
@@ -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
|
@@ -10,36 +10,22 @@ const initializeJeScheduleLocalDataEpic = (actions$, state$) => actions$.pipe((0
|
|
|
10
10
|
const actions = [];
|
|
11
11
|
const { jeScheduleTransactionKeys } = action.payload;
|
|
12
12
|
jeScheduleTransactionKeys.forEach((jeScheduleTransactionKey) => {
|
|
13
|
-
// Checked before the selector runs, not after: the selector destructures the record it
|
|
14
|
-
// looks up, so a key that is not in the store throws a TypeError rather than returning
|
|
15
|
-
// undefined. This epic is a mergeMap with no catchError, so that throw would take its
|
|
16
|
-
// subscription down for the rest of the session and silently stop local-data
|
|
17
|
-
// initialisation everywhere -- not just for this row.
|
|
18
|
-
if (state.jeSchedulesState.schedulesByTransactionKey[jeScheduleTransactionKey] == null) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
13
|
const jeScheduledTransaction = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleTransactionKey, state);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
updatedAccumulatedDepreciationCategoryID: undefined,
|
|
38
|
-
updatedClassId: undefined,
|
|
39
|
-
},
|
|
40
|
-
scheduledJournalEntryID,
|
|
41
|
-
}));
|
|
42
|
-
});
|
|
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
|
+
}));
|
|
43
29
|
});
|
|
44
30
|
return (0, rxjs_1.from)(actions);
|
|
45
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,16 +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
|
-
const failedEntriesForSchedule = state.jeSchedulesState.schedulesByTransactionKey[jeScheduleTransactionKey]?.scheduledJournalEntry ?? [];
|
|
34
|
-
const wasLastFailedEntryForSchedule = failedEntriesForSchedule.filter((journalEntry) => journalEntry.scheduledJournalEntryID !==
|
|
35
|
-
scheduledJournalEntryID).length === 0;
|
|
36
28
|
updateActions.push((0, jeSchedulesViewReducer_1.retryJeScheduleSuccess)({
|
|
37
29
|
scheduledJournalEntryID,
|
|
38
|
-
}), (0,
|
|
30
|
+
}), (0, jeSchedulesViewReducer_1.removeFailedJeScheduleTransactionKey)(jeScheduleTransactionKey, selectedPeriod), (0, jeSchedulesViewReducer_1.removeJeScheduleLocalDataById)({ scheduledJournalEntryID }), // Important to remove localdata after success.
|
|
39
31
|
(0, monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks)({
|
|
40
32
|
tenantId: currentTenant.tenantId,
|
|
41
33
|
period: selectedPeriod,
|
|
@@ -45,9 +37,6 @@ const retryJeScheduleEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
45
37
|
messageText: 'success',
|
|
46
38
|
type: 'success',
|
|
47
39
|
}));
|
|
48
|
-
if (wasLastFailedEntryForSchedule) {
|
|
49
|
-
updateActions.push((0, jeSchedulesViewReducer_1.removeFailedJeScheduleTransactionKey)(jeScheduleTransactionKey, selectedPeriod));
|
|
50
|
-
}
|
|
51
40
|
return (0, rxjs_1.from)(updateActions);
|
|
52
41
|
}
|
|
53
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;
|
|
@@ -47,13 +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[]], {
|
|
55
|
-
failedJeSchedules: JEScheduledTransactionPayload[];
|
|
56
|
-
}, "expenseAutomationJESchedulesView/fetchFailedJePostingsSuccess", never, never>, fetchJeSchedulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
50
|
+
}, "expenseAutomationJESchedulesView/fetchJeSchedules", never, never>, fetchJeSchedulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
57
51
|
selectedPageTab: JEPageTab;
|
|
58
52
|
selectedPeriod: MonthYearPeriod;
|
|
59
53
|
status: ZeniAPIStatus;
|
|
@@ -138,7 +132,7 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
138
132
|
status: ZeniAPIStatus;
|
|
139
133
|
}, "expenseAutomationJESchedulesView/searchTransactionsForNewScheduleFailure">, searchTransactionsForNewScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
140
134
|
searchResults: JEScheduleTransactionKey[];
|
|
141
|
-
}, "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<{
|
|
142
136
|
accountPayload: AccountMetadataPayload[];
|
|
143
137
|
}, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypes">, updateAccountSettingsListForAccountTypesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
144
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,10 +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
|
-
},
|
|
75
71
|
postStatusById: {},
|
|
76
72
|
ignoreStatusById: {},
|
|
77
73
|
revertStatusById: {},
|
|
@@ -81,9 +77,6 @@ exports.initialState = {
|
|
|
81
77
|
oneTimeAccrualFetchStatusById: {},
|
|
82
78
|
uiState: {
|
|
83
79
|
createdGroupCollapsed: false,
|
|
84
|
-
// Expanded, like the other two. A failed posting is the only thing on this page that is
|
|
85
|
-
// actively wrong, so folding it away by default would hide the reason to open the tab.
|
|
86
|
-
failedGroupCollapsed: false,
|
|
87
80
|
pendingGroupCollapsed: false,
|
|
88
81
|
scrollPosition: { scrollTop: 0, scrollLeft: undefined },
|
|
89
82
|
searchString: '',
|
|
@@ -155,53 +148,6 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
155
148
|
};
|
|
156
149
|
},
|
|
157
150
|
},
|
|
158
|
-
/**
|
|
159
|
-
* The Failed Postings list, fetched separately from the schedules it belongs to.
|
|
160
|
-
*
|
|
161
|
-
* No period and no tab in any of these three: the endpoint applies no date window, so there is
|
|
162
|
-
* one list per tenant and one slot to hold it. `refreshInBackground` keeps a silent refetch
|
|
163
|
-
* from dropping a skeleton over rows already on screen, the same way refreshStatus does for
|
|
164
|
-
* the schedules list.
|
|
165
|
-
*/
|
|
166
|
-
fetchFailedJePostings: {
|
|
167
|
-
reducer(draft, action) {
|
|
168
|
-
if (!action.payload.refreshInBackground) {
|
|
169
|
-
draft.failedJePostings.fetchState = {
|
|
170
|
-
fetchState: 'In-Progress',
|
|
171
|
-
error: undefined,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
prepare(refreshInBackground = false) {
|
|
176
|
-
return { payload: { refreshInBackground } };
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
fetchFailedJePostingsSuccess: {
|
|
180
|
-
reducer(draft, action) {
|
|
181
|
-
draft.failedJePostings = {
|
|
182
|
-
fetchState: { fetchState: 'Completed', error: undefined },
|
|
183
|
-
jeScheduleTransactionKeys: action.payload.failedJeSchedules.map((schedule) => (0, jeSchedulesPayload_1.getJEScheduleTransactionDetailKeyPayload)(schedule.base_transaction)),
|
|
184
|
-
};
|
|
185
|
-
},
|
|
186
|
-
prepare(failedJeSchedules) {
|
|
187
|
-
return { payload: { failedJeSchedules } };
|
|
188
|
-
},
|
|
189
|
-
},
|
|
190
|
-
fetchFailedJePostingsFailure: {
|
|
191
|
-
reducer(draft, action) {
|
|
192
|
-
// Keys are deliberately left alone. The schedules list clears its buckets on failure so an
|
|
193
|
-
// errored tab cannot read as "these are all the schedules there are", but this list is a
|
|
194
|
-
// set of outstanding problems -- showing the last known ones beside an error beats
|
|
195
|
-
// implying there are none.
|
|
196
|
-
draft.failedJePostings.fetchState = {
|
|
197
|
-
fetchState: 'Error',
|
|
198
|
-
error: action.payload.status,
|
|
199
|
-
};
|
|
200
|
-
},
|
|
201
|
-
prepare(status) {
|
|
202
|
-
return { payload: { status } };
|
|
203
|
-
},
|
|
204
|
-
},
|
|
205
151
|
fetchJeSchedulesSuccess(draft, action) {
|
|
206
152
|
const { jeSchedules, selectedPeriod, selectedPageTab, failedJeSchedules, accruedJeSchedules, oneTimeAccruals, refreshViewInBackground, } = action.payload;
|
|
207
153
|
const periodTabKey = (0, jeSchedulesViewState_1.getJESchedulePeriodTabKey)(selectedPageTab, (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod));
|
|
@@ -418,8 +364,6 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
418
364
|
reducer(draft, action) {
|
|
419
365
|
const { failedJeScheduleKey } = action.payload;
|
|
420
366
|
removeKeyFromEveryTabSlot(draft.failedJeScheduleTransactionKeysByPeriodAndTab, failedJeScheduleKey);
|
|
421
|
-
draft.failedJePostings.jeScheduleTransactionKeys =
|
|
422
|
-
draft.failedJePostings.jeScheduleTransactionKeys.filter((jeScheduleKey) => jeScheduleKey !== failedJeScheduleKey);
|
|
423
367
|
},
|
|
424
368
|
},
|
|
425
369
|
initializeJeScheduleLocalData: {
|
|
@@ -762,9 +706,6 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
762
706
|
draft.uiState.createdGroupCollapsed =
|
|
763
707
|
!draft.uiState.createdGroupCollapsed;
|
|
764
708
|
},
|
|
765
|
-
toggleJEFailedGroupCollapsed(draft) {
|
|
766
|
-
draft.uiState.failedGroupCollapsed = !draft.uiState.failedGroupCollapsed;
|
|
767
|
-
},
|
|
768
709
|
clearExpenseAutomationJESchedulesView(draft) {
|
|
769
710
|
Object.assign(draft, exports.initialState);
|
|
770
711
|
},
|
|
@@ -775,7 +716,7 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
775
716
|
});
|
|
776
717
|
},
|
|
777
718
|
});
|
|
778
|
-
_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;
|
|
779
720
|
exports.default = expenseAutomationJESchedulesView.reducer;
|
|
780
721
|
const doUpdateRecommendationForAccountSettings = (draft, payload) => {
|
|
781
722
|
const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
|
|
@@ -47,7 +47,6 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
|
47
47
|
completionStatus: CompletionStatusType;
|
|
48
48
|
createdSchedules: JEScheduleRow[];
|
|
49
49
|
createdTotal: number;
|
|
50
|
-
failedPostings: JEScheduledTransactionWithFailedEntries[];
|
|
51
50
|
hasLoadedForSelectedTab: boolean;
|
|
52
51
|
ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
|
|
53
52
|
jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
|
|
@@ -62,7 +61,6 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
|
62
61
|
pendingReviewTotal: number;
|
|
63
62
|
postStatusById: Record<ID, FetchStateAndError>;
|
|
64
63
|
refreshStatus: FetchStateAndError;
|
|
65
|
-
/** @deprecated Alias of `failedPostings`. Remove once webc and app-ui are repointed. */
|
|
66
64
|
resolveSchedules: JEScheduledTransactionWithFailedEntries[];
|
|
67
65
|
revertStatusById: Record<JEScheduleKey | JEScheduleTransactionKey, FetchStateAndError>;
|
|
68
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,16 +295,11 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
291
295
|
accruedSchedules.push(accruedScheduleDetails);
|
|
292
296
|
}
|
|
293
297
|
});
|
|
294
|
-
|
|
295
|
-
// close month, and windowing it is what kept older failures off the only tab that can resolve
|
|
296
|
-
// them.
|
|
297
|
-
failedJePostings.jeScheduleTransactionKeys.forEach((jeScheduleKey) => {
|
|
298
|
+
failedJeScheduleTransactionKeys.forEach((jeScheduleKey) => {
|
|
298
299
|
const jeScheduleDetails = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleKey, state);
|
|
299
300
|
failedJeScheduledTransaction.push(jeScheduleDetails);
|
|
300
301
|
});
|
|
301
302
|
const { sortKey, sortOrder, selectedJETypeFilter } = uiState;
|
|
302
|
-
const matchesTypeFilter = (schedule) => selectedJETypeFilter == null ||
|
|
303
|
-
getJEScheduleRowType(schedule) === selectedJETypeFilter;
|
|
304
303
|
const unsortedResolveSchedules = [];
|
|
305
304
|
failedJeScheduledTransaction.forEach((schedule) => {
|
|
306
305
|
schedule.scheduledJournalEntry.forEach((journalEntry) => {
|
|
@@ -310,7 +309,10 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
310
309
|
});
|
|
311
310
|
});
|
|
312
311
|
});
|
|
313
|
-
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;
|
|
314
316
|
const isCreatedStatus = (schedule) => {
|
|
315
317
|
// An accrual is "created" once it is not review work: posted, reversing, reversed, or in a
|
|
316
318
|
// transient posting claim.
|
|
@@ -328,6 +330,7 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
328
330
|
];
|
|
329
331
|
const pendingReviewSchedules = sortJEScheduledTransactions([
|
|
330
332
|
...allScheduleRows.filter((schedule) => isPendingReviewRow(schedule) && matchesTypeFilter(schedule)),
|
|
333
|
+
...validResolveForPending,
|
|
331
334
|
], sortKey, sortOrder);
|
|
332
335
|
const createdSchedules = sortJEScheduledTransactions(allScheduleRows.filter((schedule) => isCreatedStatus(schedule) && matchesTypeFilter(schedule)), sortKey, sortOrder);
|
|
333
336
|
// KPI summary — derived from unfiltered schedules so counts are always accurate
|
|
@@ -446,9 +449,6 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
446
449
|
kpiSummary,
|
|
447
450
|
pendingReviewSchedules,
|
|
448
451
|
pendingReviewTotal,
|
|
449
|
-
failedPostings: resolveSchedules,
|
|
450
|
-
// Deprecated alias of failedPostings. Still read by the section's footer-form effect and by
|
|
451
|
-
// app-ui analytics; remove once both are repointed.
|
|
452
452
|
resolveSchedules: resolveSchedules,
|
|
453
453
|
accountSettingsView,
|
|
454
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,22 +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
|
-
}
|
|
58
44
|
export interface JESchedulesViewState extends FetchedState {
|
|
59
45
|
accountSettings: AccountSettingsState;
|
|
60
|
-
failedJePostings: FailedJePostingsState;
|
|
61
46
|
failedJeScheduleTransactionKeysByPeriodAndTab: Record<JESchedulePeriodTabKey, JEScheduleTransactionKey[]>;
|
|
62
47
|
ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
|
|
63
48
|
jeScheduleAccruedKeysByPeriodAndTab: Record<JESchedulePeriodTabKey, JEScheduleKey[]>;
|
|
@@ -7,10 +7,8 @@ import { InvoicingCatalogItemFormLocalData } from './editInvoicingCatalogItemDet
|
|
|
7
7
|
export type SaveInvoicingCatalogItemResponse = ZeniAPIResponse<InvoicingPlanPayload>;
|
|
8
8
|
/**
|
|
9
9
|
* The price-point half of a save body. `InvoicingProductPayload` is the shape
|
|
10
|
-
* the service returns; a save differs in
|
|
11
|
-
*
|
|
12
|
-
* price point the form has only just added carries a blank `id`, which the
|
|
13
|
-
* update endpoint reads as "create this one".
|
|
10
|
+
* the service returns; a save differs in that a field is cleared by sending an
|
|
11
|
+
* explicit `null`, since an absent key reads as "leave it alone".
|
|
14
12
|
*/
|
|
15
13
|
export type InvoicingCatalogSubFamilySavePayload = Omit<Partial<InvoicingProductPayload>, 'accounting_detail' | 'description' | 'invoice_notes'> & {
|
|
16
14
|
accounting_detail?: InvoicingAccountingDetailPayload | null;
|
|
@@ -19,8 +17,13 @@ export type InvoicingCatalogSubFamilySavePayload = Omit<Partial<InvoicingProduct
|
|
|
19
17
|
};
|
|
20
18
|
/**
|
|
21
19
|
* The catalog-item save body: the item the service returns, minus the fields it
|
|
22
|
-
* assigns itself.
|
|
23
|
-
*
|
|
20
|
+
* assigns itself.
|
|
21
|
+
*
|
|
22
|
+
* Price points travel under `sub_families`, the name they are read back under,
|
|
23
|
+
* and differ only in allowing the cleared forms above. An update addresses them
|
|
24
|
+
* by id, so a price point added on the form — which has none yet — is created
|
|
25
|
+
* by its own request instead; see
|
|
26
|
+
* `localDataToCreateInvoicingCatalogProductPayloads`.
|
|
24
27
|
*/
|
|
25
28
|
export type InvoicingCatalogItemSavePayload = Omit<Partial<InvoicingPlanPayload>, 'sub_families'> & {
|
|
26
29
|
sub_families?: InvoicingCatalogSubFamilySavePayload[];
|
|
@@ -51,6 +54,19 @@ export declare const buildAccountingDetail: (subFamily: InvoicingCatalogAccounti
|
|
|
51
54
|
* edit cannot overwrite them with a value nobody chose.
|
|
52
55
|
*/
|
|
53
56
|
export declare const localDataToSaveInvoicingCatalogItemPayload: (localData: InvoicingCatalogItemFormLocalData, isCreate: boolean, lookup: InvoicingCatalogAccountingLookup) => InvoicingCatalogItemSavePayload;
|
|
57
|
+
/**
|
|
58
|
+
* The bodies that create the price points added on an edit form, one per
|
|
59
|
+
* request to `/catalog/products`.
|
|
60
|
+
*
|
|
61
|
+
* An update cannot carry them: it addresses price points by id, and these have
|
|
62
|
+
* none until the service assigns one. They are bound to their item by
|
|
63
|
+
* `item_id`, so this needs the saved item's id and runs after the item itself
|
|
64
|
+
* is saved.
|
|
65
|
+
*
|
|
66
|
+
* Empty values are left off rather than sent as `null`: there is nothing on a
|
|
67
|
+
* price point that does not exist yet to clear.
|
|
68
|
+
*/
|
|
69
|
+
export declare const localDataToCreateInvoicingCatalogProductPayloads: (localData: InvoicingCatalogItemFormLocalData, itemId: string, lookup: InvoicingCatalogAccountingLookup) => InvoicingCatalogSubFamilySavePayload[];
|
|
54
70
|
export type RunInvoicingCatalogPlanActionResponse = ZeniAPIResponse<InvoicingPlanPayload>;
|
|
55
71
|
export type RunInvoicingCatalogProductActionResponse = ZeniAPIResponse<InvoicingProductPayload>;
|
|
56
72
|
export type InvoicingCatalogItemDetailResponse = ZeniAPIResponse<InvoicingPlanPayload>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.localDataToSaveInvoicingCatalogItemPayload = exports.buildAccountingDetail = void 0;
|
|
3
|
+
exports.localDataToCreateInvoicingCatalogProductPayloads = exports.localDataToSaveInvoicingCatalogItemPayload = exports.buildAccountingDetail = void 0;
|
|
4
4
|
const accountPayload_1 = require("../../../entity/account/accountPayload");
|
|
5
5
|
const classPayload_1 = require("../../../entity/class/classPayload");
|
|
6
6
|
const invoicingCatalogItemFormHelper_1 = require("./invoicingCatalogItemFormHelper");
|
|
@@ -134,27 +134,52 @@ const localDataToSaveInvoicingCatalogItemPayload = (localData, isCreate, lookup)
|
|
|
134
134
|
const subFamilies = localData.subFamilies.length > 0
|
|
135
135
|
? localData.subFamilies
|
|
136
136
|
: [(0, invoicingCatalogItemFormHelper_1.blankInvoicingCatalogSubFamily)()];
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
137
|
+
if (isCreate) {
|
|
138
|
+
itemPayload.sub_families = subFamilies.map((subFamily) => buildSubFamilyPayload(localData, subFamily, false, lookup));
|
|
139
|
+
return itemPayload;
|
|
140
|
+
}
|
|
141
|
+
// Only price points the service has already stored travel in an update: it
|
|
142
|
+
// addresses them by id, and a blank one has nothing to address. A price point
|
|
143
|
+
// added on the form is created by its own request once the item is saved,
|
|
144
|
+
// rather than riding along as a row the update cannot place.
|
|
145
|
+
itemPayload.sub_families = subFamilies
|
|
146
|
+
.filter((subFamily) => subFamily.id !== '')
|
|
147
|
+
.map((subFamily) => {
|
|
148
|
+
// Edits send the same body a create does. The narrower hand-built one
|
|
149
|
+
// this replaces had to be kept in step by hand and was not: it dropped
|
|
150
|
+
// `accounting_detail` once, and `billing_cycles`, `price`,
|
|
151
|
+
// `pricing_model`, `period`, the trial fields, `proration_type`,
|
|
152
|
+
// `free_quantity`, `is_taxable` and `tiers` were never added at all, so
|
|
153
|
+
// editing any of them looked saved and changed nothing.
|
|
154
|
+
const detail = buildSubFamilyPayload(localData, subFamily, true, lookup);
|
|
155
|
+
// `null` rather than omitted when empty: an absent key on an update
|
|
156
|
+
// reads as "leave it alone", which would make a cleared mapping
|
|
157
|
+
// impossible to save — the same reason `description` and
|
|
158
|
+
// `invoice_notes` are cleared rather than dropped above.
|
|
159
|
+
detail.accounting_detail = detail.accounting_detail ?? null;
|
|
160
|
+
// Never blank: the filter above leaves only price points the service has
|
|
161
|
+
// already stored, which is the only kind an update can address.
|
|
162
|
+
return { ...detail, id: subFamily.id };
|
|
163
|
+
});
|
|
158
164
|
return itemPayload;
|
|
159
165
|
};
|
|
160
166
|
exports.localDataToSaveInvoicingCatalogItemPayload = localDataToSaveInvoicingCatalogItemPayload;
|
|
167
|
+
/**
|
|
168
|
+
* The bodies that create the price points added on an edit form, one per
|
|
169
|
+
* request to `/catalog/products`.
|
|
170
|
+
*
|
|
171
|
+
* An update cannot carry them: it addresses price points by id, and these have
|
|
172
|
+
* none until the service assigns one. They are bound to their item by
|
|
173
|
+
* `item_id`, so this needs the saved item's id and runs after the item itself
|
|
174
|
+
* is saved.
|
|
175
|
+
*
|
|
176
|
+
* Empty values are left off rather than sent as `null`: there is nothing on a
|
|
177
|
+
* price point that does not exist yet to clear.
|
|
178
|
+
*/
|
|
179
|
+
const localDataToCreateInvoicingCatalogProductPayloads = (localData, itemId, lookup) => localData.subFamilies
|
|
180
|
+
.filter((subFamily) => subFamily.id === '')
|
|
181
|
+
.map((subFamily) => ({
|
|
182
|
+
...buildSubFamilyPayload(localData, subFamily, false, lookup),
|
|
183
|
+
item_id: itemId,
|
|
184
|
+
}));
|
|
185
|
+
exports.localDataToCreateInvoicingCatalogProductPayloads = localDataToCreateInvoicingCatalogProductPayloads;
|
|
@@ -47,6 +47,9 @@ const editInvoicingCatalogItemDetailView = (0, toolkit_1.createSlice)({
|
|
|
47
47
|
draft.error = undefined;
|
|
48
48
|
draft.savedItemId = action.payload.itemId;
|
|
49
49
|
draft.savedKind = action.payload.kind;
|
|
50
|
+
// An edit is refetched on success; keep the saved values on screen until
|
|
51
|
+
// that lands, and let it replace them.
|
|
52
|
+
(0, invoicingFormDraft_1.applyInvoicingFormDraftSaved)(draft.editDraftById, action.payload.itemId);
|
|
50
53
|
},
|
|
51
54
|
submitInvoicingCatalogItemFormFailure(draft, action) {
|
|
52
55
|
draft.fetchState = 'Error';
|