@zeniai/client-epic-state 4.8.97 → 4.8.98

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.
@@ -3,7 +3,9 @@ import { JEScheduledTransactionPayload, ScheduledJournalEntryPayload } from './j
3
3
  export declare const initialState: JESchedulesState;
4
4
  export declare const updateJESchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeSchedulesTransactionsPayload: JEScheduledTransactionPayload[]], {
5
5
  jeSchedulesTransactionsPayload: JEScheduledTransactionPayload[];
6
- }, string, never, never>, updateJESchedulesDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeSchedulesPayload: JEScheduledTransactionPayload[], scheduledJEntriesPayload?: ScheduledJournalEntryPayload[] | undefined], {
6
+ }, string, never, never>, updateJEScheduledTransaction: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
7
+ jeSchedulesTransactionsPayload: JEScheduledTransactionPayload[];
8
+ }, string>, updateJESchedulesDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeSchedulesPayload: JEScheduledTransactionPayload[], scheduledJEntriesPayload?: ScheduledJournalEntryPayload[] | undefined], {
7
9
  jeSchedulesPayload: JEScheduledTransactionPayload[];
8
10
  scheduledJEntriesPayload: ScheduledJournalEntryPayload[] | undefined;
9
11
  }, string, never, never>, clearAllJEScheduleTransactions: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  var _a;
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.clearAllJEScheduleTransactions = exports.updateJESchedulesDetails = exports.updateJESchedules = exports.initialState = void 0;
7
+ exports.clearAllJEScheduleTransactions = exports.updateJESchedulesDetails = exports.updateJEScheduledTransaction = exports.updateJESchedules = exports.initialState = void 0;
8
8
  const toolkit_1 = require("@reduxjs/toolkit");
9
9
  const assignWith_1 = __importDefault(require("lodash/assignWith"));
10
10
  const jeSchedulesPayload_1 = require("./jeSchedulesPayload");
@@ -23,12 +23,15 @@ const jeSchedules = (0, toolkit_1.createSlice)({
23
23
  },
24
24
  };
25
25
  },
26
- reducer(draft, action) {
27
- action.payload.jeSchedulesTransactionsPayload.forEach((schedule) => {
28
- doUpdateJEScheduledTransaction(draft.schedulesByTransactionKey, (0, jeSchedulesPayload_1.getTransactionDetailKeyPayload)(schedule.base_transaction), schedule, 'merge');
29
- });
26
+ reducer() {
27
+ // do nothing here
30
28
  },
31
29
  },
30
+ updateJEScheduledTransaction: (draft, action) => {
31
+ action.payload.jeSchedulesTransactionsPayload.forEach((schedule) => {
32
+ doUpdateJEScheduledTransaction(draft.schedulesByTransactionKey, (0, jeSchedulesPayload_1.getTransactionDetailKeyPayload)(schedule.base_transaction), schedule, 'merge');
33
+ });
34
+ },
32
35
  updateJESchedulesDetails: {
33
36
  prepare(jeSchedulesPayload, scheduledJEntriesPayload) {
34
37
  return {
@@ -54,7 +57,7 @@ const jeSchedules = (0, toolkit_1.createSlice)({
54
57
  },
55
58
  },
56
59
  });
57
- _a = jeSchedules.actions, exports.updateJESchedules = _a.updateJESchedules, exports.updateJESchedulesDetails = _a.updateJESchedulesDetails, exports.clearAllJEScheduleTransactions = _a.clearAllJEScheduleTransactions;
60
+ _a = jeSchedules.actions, exports.updateJESchedules = _a.updateJESchedules, exports.updateJEScheduledTransaction = _a.updateJEScheduledTransaction, exports.updateJESchedulesDetails = _a.updateJESchedulesDetails, exports.clearAllJEScheduleTransactions = _a.clearAllJEScheduleTransactions;
58
61
  exports.default = jeSchedules.reducer;
59
62
  /**
60
63
  * Helper functions
@@ -1,10 +1,10 @@
1
1
  import { ActionsObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
- import { updateJESchedules } from './jeSchedulesReducer';
3
+ import { updateJEScheduledTransaction, updateJESchedules } from './jeSchedulesReducer';
4
4
  import { updateAllUsers } from '../user/userReducer';
5
5
  import { updateVendors } from '../vendor/vendorReducer';
6
6
  import { updateScheduleTransactions } from '../transaction/transactionReducer';
7
7
  import { updateAccounts } from '../account/accountReducer';
8
8
  import { updateClasses } from '../class/classReducer';
9
- export declare type ActionType = ReturnType<typeof updateJESchedules> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateVendors> | ReturnType<typeof updateClasses> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateScheduleTransactions>;
9
+ export declare type ActionType = ReturnType<typeof updateJESchedules> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateVendors> | ReturnType<typeof updateClasses> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateScheduleTransactions> | ReturnType<typeof updateJEScheduledTransaction>;
10
10
  export declare const updateJESchedulesEpic: (actions$: ActionsObservable<ActionType>) => Observable<ActionType>;
@@ -59,6 +59,9 @@ const updateJESchedulesEpic = (actions$) => actions$.pipe((0, operators_1.filter
59
59
  actions.push((0, transactionReducer_1.updateScheduleTransactions)(jeTransactions.transactions, jeTransactions.currency.currency_code, jeTransactions.currency.currency_symbol));
60
60
  });
61
61
  actions.push((0, userReducer_1.updateAllUsers)({ users: userPayload, updateType: 'merge' }));
62
+ actions.push((0, jeSchedulesReducer_1.updateJEScheduledTransaction)({
63
+ jeSchedulesTransactionsPayload: action.payload.jeSchedulesTransactionsPayload,
64
+ }));
62
65
  }
63
66
  return (0, rxjs_1.from)(actions);
64
67
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.8.97",
3
+ "version": "4.8.98",
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
  "types": "lib/index.d.ts",