@zeniai/client-epic-state 4.9.82 → 4.9.84

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.
@@ -4,11 +4,11 @@ import { RootState } from '../../../../reducer';
4
4
  import { fetchUserDetails, resetVendorDetailLocalData, saveVendor, saveVendorSuccessOrFailure, updateVendorDetailLocalData } from '../vendorViewReducer';
5
5
  import { updateVendors } from '../../../../entity/vendor/vendorReducer';
6
6
  import { updateAddresses } from '../../../../entity/address/addressReducer';
7
- import { convertAmountToHomeCurrency, saveBillUpdatesToLocalStore, updateRecommendedVendorId } from '../../../spendManagement/billPay/editBillView/editBillViewReducer';
7
+ import { convertAmountToHomeCurrency, saveBillUpdatesToLocalStore } from '../../../spendManagement/billPay/editBillView/editBillViewReducer';
8
8
  import { fetchPreviousBills } from '../../../spendManagement/billPay/previousBills/previousBillsReducer';
9
9
  import { updateContacts } from '../../../../entity/billPay/contact/contactReducer';
10
10
  import { updateBankAccounts } from '../../../../entity/bankAccount/bankAccountReducer';
11
11
  import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
12
12
  import { updatePaymentInstruments } from '../../../../entity/paymentInstrument/paymentInstrumentReducer';
13
- export declare type ActionType = ReturnType<typeof saveVendor> | ReturnType<typeof updateVendors> | ReturnType<typeof updateContacts> | ReturnType<typeof updateBankAccounts> | ReturnType<typeof updateRecommendedVendorId> | ReturnType<typeof saveBillUpdatesToLocalStore> | ReturnType<typeof fetchPreviousBills> | ReturnType<typeof openSnackbar> | ReturnType<typeof saveVendorSuccessOrFailure> | ReturnType<typeof resetVendorDetailLocalData> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateVendorDetailLocalData> | ReturnType<typeof fetchUserDetails> | ReturnType<typeof updatePaymentInstruments> | ReturnType<typeof convertAmountToHomeCurrency>;
13
+ export declare type ActionType = ReturnType<typeof saveVendor> | ReturnType<typeof updateVendors> | ReturnType<typeof updateContacts> | ReturnType<typeof updateBankAccounts> | ReturnType<typeof saveBillUpdatesToLocalStore> | ReturnType<typeof fetchPreviousBills> | ReturnType<typeof openSnackbar> | ReturnType<typeof saveVendorSuccessOrFailure> | ReturnType<typeof resetVendorDetailLocalData> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateVendorDetailLocalData> | ReturnType<typeof fetchUserDetails> | ReturnType<typeof updatePaymentInstruments> | ReturnType<typeof convertAmountToHomeCurrency>;
14
14
  export declare const saveVendorEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
@@ -77,7 +77,7 @@ const saveVendorEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operator
77
77
  const vendorCurrencySymbol = updatedVendor.vendorCurrencySymbol;
78
78
  Object.keys(updatedLines).forEach((lineId) => {
79
79
  const line = lines[lineId];
80
- updatedLines[lineId] = Object.assign(Object.assign({}, line), { account: vendorCategory, class: vendorClass });
80
+ updatedLines[lineId] = Object.assign(Object.assign(Object.assign({}, line), { account: vendorCategory, class: vendorClass }), editBillViewState_1.defaultRecommendationStateObj);
81
81
  });
82
82
  //when it's a new bill and it doesn't have any line item, we want to default the account and class to vendor's account and class
83
83
  if (Object.keys(updatedLines).length === 0) {
@@ -148,7 +148,7 @@ const saveVendorEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operator
148
148
  isRecurring: false,
149
149
  },
150
150
  billId: action.payload.billId,
151
- }), (0, editBillViewReducer_1.updateRecommendedVendorId)());
151
+ }));
152
152
  if ((updatedVendor === null || updatedVendor === void 0 ? void 0 : updatedVendor.qboId) != null) {
153
153
  actions.push((0, previousBillsReducer_1.fetchPreviousBills)(updatedVendor.qboId, false));
154
154
  }
@@ -72,11 +72,14 @@ const waitForVendorByIdThenSaveBillUpdatetoLocalStoreEpic = (actions$, state$) =
72
72
  state.editBillDetailViewState.editBillStateById[billDetailKey];
73
73
  }
74
74
  if (vendor != null) {
75
- (0, editBillViewReducer_1.convertAmountToHomeCurrency)(true, {
76
- amount: (_b = (_a = billInLocalStore.billDetailLocalData.totalAmount) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : 0,
77
- currencyCode: (_c = vendor.vendorCurrencyCode) !== null && _c !== void 0 ? _c : 'USD',
78
- currencySymbol: (_d = vendor.vendorCurrencySymbol) !== null && _d !== void 0 ? _d : '$',
79
- }, 'USD', action.payload.billId);
75
+ if (vendor.vendorCurrencyCode != null &&
76
+ !(0, currencyHelper_1.isUsdCurrency)(vendor.vendorCurrencyCode)) {
77
+ fetchActions.push((0, editBillViewReducer_1.convertAmountToHomeCurrency)(true, {
78
+ amount: (_b = (_a = billInLocalStore.billDetailLocalData.totalAmount) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : 0,
79
+ currencyCode: (_c = vendor.vendorCurrencyCode) !== null && _c !== void 0 ? _c : 'USD',
80
+ currencySymbol: (_d = vendor.vendorCurrencySymbol) !== null && _d !== void 0 ? _d : '$',
81
+ }, 'USD', action.payload.billId));
82
+ }
80
83
  fetchActions.push((0, editBillViewReducer_1.saveBillUpdatesToLocalStore)({
81
84
  billDetailLocalData: prepareBillLocalData(state, billInLocalStore, vendor),
82
85
  billId: action.payload.billId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.9.82",
3
+ "version": "4.9.84",
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",