@zeniai/client-epic-state 5.1.92-betaRD6 → 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.
@@ -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({
@@ -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)({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.1.92-betaRD6",
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",