@zeniai/client-epic-state 5.1.92-betaRD5 → 5.1.92-betaRD7
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/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +7 -3
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +2 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +0 -12
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +7 -3
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +1 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +2 -1
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { updateJESchedules, updateJESchedulesDetails, } from '../../../../entity/jeSchedules/jeSchedulesReducer';
|
|
4
3
|
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
5
4
|
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
6
5
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
@@ -32,9 +31,14 @@ export const revertJeScheduleEpic = (actions$, state$, zeniAPI) => actions$.pipe
|
|
|
32
31
|
.putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/schedules/${jeScheduleId}/revert`, payload)
|
|
33
32
|
.pipe(mergeMap((response) => {
|
|
34
33
|
if (isSuccessResponse(response) && response.data != null) {
|
|
34
|
+
// Deliberately not written to the entity store. A reverted schedule is soft-deleted,
|
|
35
|
+
// so the endpoint returns its flat entity json -- `vendor_id` as a bare field, no
|
|
36
|
+
// nested `vendor` or `base_transaction` -- rather than the list DTO those mappers
|
|
37
|
+
// expect. Feeding it to updateJESchedules threw inside doUpdateVendors on
|
|
38
|
+
// `payload.vendor.vendor_id`, and because that happens mid-dispatch it killed the
|
|
39
|
+
// rest of this array: the row kept spinning and no snackbar appeared. The row is
|
|
40
|
+
// removed from the list below regardless, so there is nothing worth storing.
|
|
35
41
|
return from([
|
|
36
|
-
updateJESchedules(response.data.je_schedules),
|
|
37
|
-
updateJESchedulesDetails(response.data.je_schedules, response.data.scheduled_journal_entries),
|
|
38
42
|
revertJeScheduleSuccess({ jeScheduleTransactionKey }),
|
|
39
43
|
removeJeScheduleTransactionKey(jeScheduleTransactionKey, selectedPeriod),
|
|
40
44
|
fetchMonthEndCloseChecks({
|
|
@@ -194,7 +194,7 @@ export function getExpenseAutomationJESchedulesView(state) {
|
|
|
194
194
|
const accruedSchedules = [];
|
|
195
195
|
const oneTimeAccruals = [];
|
|
196
196
|
const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
197
|
-
const { jeScheduleTransactionKeysByPeriodAndTab, jeScheduleAccruedKeysByPeriodAndTab, jeScheduleOneTimeAccrualKeysByPeriodAndTab, failedJeScheduleTransactionKeysByPeriodAndTab, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus, newSchedule, } = expenseAutomationJESchedulesViewState;
|
|
197
|
+
const { jeScheduleTransactionKeysByPeriodAndTab, jeScheduleAccruedKeysByPeriodAndTab, jeScheduleOneTimeAccrualKeysByPeriodAndTab, failedJeScheduleTransactionKeysByPeriodAndTab, jeScheduleLocalDataById, postStatusById, ignoreStatusById, revertStatusById, uiState, error, fetchState, refreshStatus, newSchedule, } = expenseAutomationJESchedulesViewState;
|
|
198
198
|
const accountSettingsView = getJEAccountSettingsView(state);
|
|
199
199
|
const newScheduleView = newSchedule.selectedDetailScheduleType === 'fixed_assets' ||
|
|
200
200
|
newSchedule.selectedDetailScheduleType === 'prepaid_expenses'
|
|
@@ -408,6 +408,7 @@ export function getExpenseAutomationJESchedulesView(state) {
|
|
|
408
408
|
newScheduleView,
|
|
409
409
|
postStatusById: postStatusById,
|
|
410
410
|
ignoreStatusById: ignoreStatusById,
|
|
411
|
+
revertStatusById: revertStatusById,
|
|
411
412
|
fetchState: reducedFetchStatus.fetchState,
|
|
412
413
|
jeScheduleLocalDataById: jeScheduleLocalDataById,
|
|
413
414
|
uiState: uiState,
|
|
@@ -26,11 +26,6 @@ export declare const revertJeScheduleEpic: (actions$: ActionsObservable<ActionTy
|
|
|
26
26
|
}[];
|
|
27
27
|
};
|
|
28
28
|
type: "snackbar/openSnackbar";
|
|
29
|
-
} | {
|
|
30
|
-
payload: {
|
|
31
|
-
jeSchedulesTransactionsPayload: import("../../../../entity/jeSchedules/jeSchedulesPayload").JEScheduledTransactionPayload[];
|
|
32
|
-
};
|
|
33
|
-
type: "jeSchedules/updateJESchedules";
|
|
34
29
|
} | {
|
|
35
30
|
payload: {
|
|
36
31
|
period: import("../../../..").MonthYearPeriod;
|
|
@@ -38,13 +33,6 @@ export declare const revertJeScheduleEpic: (actions$: ActionsObservable<ActionTy
|
|
|
38
33
|
tenantId: import("../../../..").ID;
|
|
39
34
|
};
|
|
40
35
|
type: "monthEndCloseChecksView/fetchMonthEndCloseChecks";
|
|
41
|
-
} | {
|
|
42
|
-
payload: {
|
|
43
|
-
jeSchedulesPayload: import("../../../../entity/jeSchedules/jeSchedulesPayload").JEScheduledTransactionPayload[];
|
|
44
|
-
scheduledJEntriesPayload: import("../../../../entity/jeSchedules/jeSchedulesPayload").ScheduledJournalEntryPayload[] | undefined;
|
|
45
|
-
updateType: import("../../../..").UpdateType;
|
|
46
|
-
};
|
|
47
|
-
type: "jeSchedules/updateJESchedulesDetails";
|
|
48
36
|
} | {
|
|
49
37
|
payload: {
|
|
50
38
|
jeScheduleKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.revertJeScheduleEpic = 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");
|
|
@@ -35,9 +34,14 @@ const revertJeScheduleEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
|
|
|
35
34
|
.putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/schedules/${jeScheduleId}/revert`, payload)
|
|
36
35
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
37
36
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
37
|
+
// Deliberately not written to the entity store. A reverted schedule is soft-deleted,
|
|
38
|
+
// so the endpoint returns its flat entity json -- `vendor_id` as a bare field, no
|
|
39
|
+
// nested `vendor` or `base_transaction` -- rather than the list DTO those mappers
|
|
40
|
+
// expect. Feeding it to updateJESchedules threw inside doUpdateVendors on
|
|
41
|
+
// `payload.vendor.vendor_id`, and because that happens mid-dispatch it killed the
|
|
42
|
+
// rest of this array: the row kept spinning and no snackbar appeared. The row is
|
|
43
|
+
// removed from the list below regardless, so there is nothing worth storing.
|
|
38
44
|
return (0, rxjs_1.from)([
|
|
39
|
-
(0, jeSchedulesReducer_1.updateJESchedules)(response.data.je_schedules),
|
|
40
|
-
(0, jeSchedulesReducer_1.updateJESchedulesDetails)(response.data.je_schedules, response.data.scheduled_journal_entries),
|
|
41
45
|
(0, jeSchedulesViewReducer_1.revertJeScheduleSuccess)({ jeScheduleTransactionKey }),
|
|
42
46
|
(0, jeSchedulesViewReducer_1.removeJeScheduleTransactionKey)(jeScheduleTransactionKey, selectedPeriod),
|
|
43
47
|
(0, monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks)({
|
|
@@ -53,6 +53,7 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
|
53
53
|
postStatusById: Record<ID, FetchStateAndError>;
|
|
54
54
|
refreshStatus: FetchStateAndError;
|
|
55
55
|
resolveSchedules: JEScheduledTransactionWithFailedEntries[];
|
|
56
|
+
revertStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
|
|
56
57
|
scheduleCountsByTab: Partial<Record<JEPageTab, number>>;
|
|
57
58
|
uiState: JESchedulesViewUIState;
|
|
58
59
|
uncategorizedAccounts: UncategorizedAccounts;
|
|
@@ -209,7 +209,7 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
209
209
|
const accruedSchedules = [];
|
|
210
210
|
const oneTimeAccruals = [];
|
|
211
211
|
const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
212
|
-
const { jeScheduleTransactionKeysByPeriodAndTab, jeScheduleAccruedKeysByPeriodAndTab, jeScheduleOneTimeAccrualKeysByPeriodAndTab, failedJeScheduleTransactionKeysByPeriodAndTab, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus, newSchedule, } = expenseAutomationJESchedulesViewState;
|
|
212
|
+
const { jeScheduleTransactionKeysByPeriodAndTab, jeScheduleAccruedKeysByPeriodAndTab, jeScheduleOneTimeAccrualKeysByPeriodAndTab, failedJeScheduleTransactionKeysByPeriodAndTab, jeScheduleLocalDataById, postStatusById, ignoreStatusById, revertStatusById, uiState, error, fetchState, refreshStatus, newSchedule, } = expenseAutomationJESchedulesViewState;
|
|
213
213
|
const accountSettingsView = (0, jeAccountSettingsViewSelector_1.getJEAccountSettingsView)(state);
|
|
214
214
|
const newScheduleView = newSchedule.selectedDetailScheduleType === 'fixed_assets' ||
|
|
215
215
|
newSchedule.selectedDetailScheduleType === 'prepaid_expenses'
|
|
@@ -423,6 +423,7 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
423
423
|
newScheduleView,
|
|
424
424
|
postStatusById: postStatusById,
|
|
425
425
|
ignoreStatusById: ignoreStatusById,
|
|
426
|
+
revertStatusById: revertStatusById,
|
|
426
427
|
fetchState: reducedFetchStatus.fetchState,
|
|
427
428
|
jeScheduleLocalDataById: jeScheduleLocalDataById,
|
|
428
429
|
uiState: uiState,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.92-
|
|
3
|
+
"version": "5.1.92-betaRD7",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|