@zeniai/client-epic-state 4.16.67 → 4.16.68

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.
@@ -99,15 +99,19 @@ const fetchReconciliationViewEpic = (actions$, state$, zeniAPI) => actions$.pipe
99
99
  }
100
100
  }));
101
101
  exports.fetchReconciliationViewEpic = fetchReconciliationViewEpic;
102
+ const getMemo = (transaction) => {
103
+ var _a, _b, _c;
104
+ return ((_c = (_b = (_a = transaction.recommended_action.recommended_transactions[0]) === null || _a === void 0 ? void 0 : _a.transaction_memo) !== null && _b !== void 0 ? _b : transaction.transaction_memo) !== null && _c !== void 0 ? _c : '');
105
+ };
102
106
  const prepareReviewTabLocalData = (transactionsToReview) => {
103
107
  return transactionsToReview.reduce((prev, currentTransaction) => {
104
- var _a, _b, _c, _d, _e, _f, _g, _h;
108
+ var _a, _b, _c, _d, _e, _f;
105
109
  const localData = {
106
- memo: (_b = (_a = currentTransaction.recommended_action.recommended_transactions[0]) === null || _a === void 0 ? void 0 : _a.transaction_memo) !== null && _b !== void 0 ? _b : '',
107
- categoryId: (_d = (_c = currentTransaction.recommended_action.recommended_transactions[0]) === null || _c === void 0 ? void 0 : _c.account_id) !== null && _d !== void 0 ? _d : undefined,
108
- classId: (_f = (_e = currentTransaction.recommended_action.recommended_transactions[0]) === null || _e === void 0 ? void 0 : _e.class_id) !== null && _f !== void 0 ? _f : undefined,
109
- vendor: ((_g = currentTransaction.recommended_action.recommended_transactions[0]) === null || _g === void 0 ? void 0 : _g.merchant_id) != null &&
110
- ((_h = currentTransaction.recommended_action.recommended_transactions[0]) === null || _h === void 0 ? void 0 : _h.merchant_name) != null
110
+ memo: getMemo(currentTransaction),
111
+ categoryId: (_b = (_a = currentTransaction.recommended_action.recommended_transactions[0]) === null || _a === void 0 ? void 0 : _a.account_id) !== null && _b !== void 0 ? _b : undefined,
112
+ classId: (_d = (_c = currentTransaction.recommended_action.recommended_transactions[0]) === null || _c === void 0 ? void 0 : _c.class_id) !== null && _d !== void 0 ? _d : undefined,
113
+ vendor: ((_e = currentTransaction.recommended_action.recommended_transactions[0]) === null || _e === void 0 ? void 0 : _e.merchant_id) != null &&
114
+ ((_f = currentTransaction.recommended_action.recommended_transactions[0]) === null || _f === void 0 ? void 0 : _f.merchant_name) != null
111
115
  ? {
112
116
  id: currentTransaction.recommended_action
113
117
  .recommended_transactions[0].merchant_id,
@@ -26,15 +26,19 @@ const initialiseDataForSelectedAccountIdEpic = (actions$, state$) => actions$.pi
26
26
  return (0, rxjs_1.from)(actions);
27
27
  }));
28
28
  exports.initialiseDataForSelectedAccountIdEpic = initialiseDataForSelectedAccountIdEpic;
29
+ const getMemo = (transaction) => {
30
+ var _a, _b, _c;
31
+ return ((_c = (_b = (_a = transaction.recommendedAction.recommendedTransactions[0]) === null || _a === void 0 ? void 0 : _a.memo) !== null && _b !== void 0 ? _b : transaction.memo) !== null && _c !== void 0 ? _c : '');
32
+ };
29
33
  const prepareReviewTabLocalData = (transactionsToReview) => {
30
34
  return transactionsToReview.reduce((prev, currentTransaction) => {
31
- var _a, _b, _c, _d, _e, _f, _g, _h;
35
+ var _a, _b, _c, _d, _e, _f;
32
36
  const localData = {
33
- memo: (_b = (_a = currentTransaction.recommendedAction.recommendedTransactions[0]) === null || _a === void 0 ? void 0 : _a.memo) !== null && _b !== void 0 ? _b : '',
34
- categoryId: (_d = (_c = currentTransaction.recommendedAction.recommendedTransactions[0]) === null || _c === void 0 ? void 0 : _c.accountId) !== null && _d !== void 0 ? _d : undefined,
35
- classId: (_f = (_e = currentTransaction.recommendedAction.recommendedTransactions[0]) === null || _e === void 0 ? void 0 : _e.classId) !== null && _f !== void 0 ? _f : undefined,
36
- vendor: ((_g = currentTransaction.recommendedAction.recommendedTransactions[0]) === null || _g === void 0 ? void 0 : _g.merchantId) != null &&
37
- ((_h = currentTransaction.recommendedAction.recommendedTransactions[0]) === null || _h === void 0 ? void 0 : _h.merchantName) != null
37
+ memo: getMemo(currentTransaction),
38
+ categoryId: (_b = (_a = currentTransaction.recommendedAction.recommendedTransactions[0]) === null || _a === void 0 ? void 0 : _a.accountId) !== null && _b !== void 0 ? _b : undefined,
39
+ classId: (_d = (_c = currentTransaction.recommendedAction.recommendedTransactions[0]) === null || _c === void 0 ? void 0 : _c.classId) !== null && _d !== void 0 ? _d : undefined,
40
+ vendor: ((_e = currentTransaction.recommendedAction.recommendedTransactions[0]) === null || _e === void 0 ? void 0 : _e.merchantId) != null &&
41
+ ((_f = currentTransaction.recommendedAction.recommendedTransactions[0]) === null || _f === void 0 ? void 0 : _f.merchantName) != null
38
42
  ? {
39
43
  id: currentTransaction.recommendedAction
40
44
  .recommendedTransactions[0].merchantId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.16.67",
3
+ "version": "4.16.68",
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",