@zeniai/client-epic-state 4.19.97 → 4.19.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.
@@ -7,6 +7,7 @@ const formatZeniDateFY_1 = require("../../../../commonStateTypes/fiscalYearHelpe
7
7
  const accountReconReducer_1 = require("../../../../entity/accountRecon/accountReconReducer");
8
8
  const accountReconSelector_1 = require("../../../../entity/accountRecon/accountReconSelector");
9
9
  const accountReconState_1 = require("../../../../entity/accountRecon/accountReconState");
10
+ const entitySelector_1 = require("../../../../entity/genericEntity/entitySelector");
10
11
  const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
11
12
  const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
12
13
  const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
@@ -15,6 +16,7 @@ const responsePayload_1 = require("../../../../responsePayload");
15
16
  const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
16
17
  const saveReconciliationReviewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.saveReconciliationReview.match), (0, operators_1.mergeMap)((action) => {
17
18
  const state = state$.value;
19
+ const entityState = state.entityState;
18
20
  const { transactionId } = action.payload;
19
21
  const localData = state.expenseAutomationReconciliationViewState.reconTabsState.review
20
22
  .localData[transactionId];
@@ -62,7 +64,7 @@ const saveReconciliationReviewEpic = (actions$, state$, zeniAPI) => actions$.pip
62
64
  payload = getPayloadForCCPayment(updatedTransaction, localData, reconciliationData?.account.accountType);
63
65
  break;
64
66
  case 'record_deposit':
65
- payload = getPayloadForDeposit(updatedTransaction, localData);
67
+ payload = getPayloadForDeposit(updatedTransaction, localData, entityState);
66
68
  break;
67
69
  }
68
70
  }
@@ -163,7 +165,10 @@ function getPayloadForExpenseRecord(updatedTransaction, localData) {
163
165
  currency_code: updatedTransaction.amount.currencyCode,
164
166
  };
165
167
  }
166
- function getPayloadForDeposit(updatedTransaction, localData) {
168
+ function getPayloadForDeposit(updatedTransaction, localData, entityState) {
169
+ const customerZeniId = localData.customer?.id != null
170
+ ? (0, entitySelector_1.getEntityByEntityIDs)(entityState, [localData.customer?.id])[0]?.zeniId
171
+ : undefined;
167
172
  return {
168
173
  amount: updatedTransaction.amount.amount,
169
174
  transaction_memo: updatedTransaction.memo,
@@ -171,7 +176,7 @@ function getPayloadForDeposit(updatedTransaction, localData) {
171
176
  transaction_date: updatedTransaction.transactionDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT),
172
177
  transaction_direction: updatedTransaction.transactionDirection,
173
178
  transaction_id: updatedTransaction.transactionId,
174
- customer_id: localData.customer?.id,
179
+ customer_id: customerZeniId,
175
180
  customer_name: localData.customer?.name,
176
181
  account_id: localData.categoryId,
177
182
  accounting_class_id: localData.classId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.19.97",
3
+ "version": "4.19.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
  "module": "lib/esm/index.js",