@zeniai/client-epic-state 4.7.78 → 4.7.80

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,8 @@ import { ZeniAPI } from '../../../../../zeniAPI';
3
3
  import { RootState } from '../../../../../reducer';
4
4
  import { saveBillDetail, saveBillSuccessOrFailure } from '../editBillViewReducer';
5
5
  import { updateBillTransaction } from '../../../../../entity/billPay/billTransaction/billTransactionReducer';
6
- import { RecurringBillInstance } from '../editBillViewState';
6
+ import { EditBillDetail, RecurringBillInstance } from '../editBillViewState';
7
+ import { BillTransaction } from '../../../../../entity/billPay/billTransaction/billTransactionState';
7
8
  import { updateRecurringBillConfigs, updateRecurringBills } from '../../../../../entity/billPay/recurringBills/recurringBillsReducer';
8
9
  import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
9
10
  export declare type ActionType = ReturnType<typeof saveBillDetail> | ReturnType<typeof updateBillTransaction> | ReturnType<typeof openSnackbar> | ReturnType<typeof saveBillSuccessOrFailure> | ReturnType<typeof updateRecurringBillConfigs> | ReturnType<typeof updateRecurringBills>;
@@ -15,3 +16,4 @@ export interface RecurringBillInstancePayload {
15
16
  vendor_receive_date_notes: string;
16
17
  }
17
18
  export declare const toRecurringBillInstancePayload: (recurringBillInstance: RecurringBillInstance, maxPaymentProcessingDays: number) => RecurringBillInstancePayload;
19
+ export declare const checkIfUpdateCurrentBill: (editBillDetail: EditBillDetail, originalBillDetail?: BillTransaction | undefined) => boolean;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.toRecurringBillInstancePayload = exports.saveBillDetailEpic = void 0;
6
+ exports.checkIfUpdateCurrentBill = exports.toRecurringBillInstancePayload = exports.saveBillDetailEpic = void 0;
7
7
  const rxjs_1 = require("rxjs");
8
8
  const operators_1 = require("rxjs/operators");
9
9
  const get_1 = __importDefault(require("lodash/get"));
@@ -83,7 +83,7 @@ const getSaveBillApiURL = (saveBillBaseURL, isRecurring, billId) => {
83
83
  }
84
84
  };
85
85
  function prepareSaveBillPayload(accountState, billTransactionState, paymentAccountState, setupViewState, vendorState, recurringBillState, billDetail, billStageCode, isVendorRecommendationEnabled, isLocalCurrencyEnabled) {
86
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21;
86
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18;
87
87
  const billId = billDetail.billId;
88
88
  let detail;
89
89
  const withdrawFromList = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, setupViewState.accountDetails.paymentAccountIds);
@@ -187,8 +187,7 @@ function prepareSaveBillPayload(accountState, billTransactionState, paymentAccou
187
187
  recurringConfig.updateRecurringBills === 'all';
188
188
  payload.is_update_current_bill =
189
189
  recurringConfig.updateRecurringBills === 'all' ||
190
- ((_20 = (_19 = billDetail.billDetailLocalData.paymentDetailsSection) === null || _19 === void 0 ? void 0 : _19.paymentDate) === null || _20 === void 0 ? void 0 : _20.toString()) !==
191
- ((_21 = detail === null || detail === void 0 ? void 0 : detail.billPayInfo.paymentDate) === null || _21 === void 0 ? void 0 : _21.toString())
190
+ (0, exports.checkIfUpdateCurrentBill)(billDetail, detail)
192
191
  ? true
193
192
  : recurringConfig.updateRecurringBills === 'current';
194
193
  if ((isConfigChangedForExistingBill ||
@@ -246,3 +245,24 @@ const toRecurringBillInstancePayload = (recurringBillInstance, maxPaymentProcess
246
245
  };
247
246
  };
248
247
  exports.toRecurringBillInstancePayload = toRecurringBillInstancePayload;
248
+ const checkIfUpdateCurrentBill = (editBillDetail, originalBillDetail) => {
249
+ var _a, _b, _c, _d, _e;
250
+ const { paymentDetailsSection, whatForSection } = editBillDetail.billDetailLocalData;
251
+ if (((_a = paymentDetailsSection === null || paymentDetailsSection === void 0 ? void 0 : paymentDetailsSection.paymentDate) === null || _a === void 0 ? void 0 : _a.toString()) !==
252
+ ((_b = originalBillDetail === null || originalBillDetail === void 0 ? void 0 : originalBillDetail.billPayInfo.paymentDate) === null || _b === void 0 ? void 0 : _b.toString())) {
253
+ return true;
254
+ }
255
+ if ((whatForSection === null || whatForSection === void 0 ? void 0 : whatForSection.invoiceNumber) !== (originalBillDetail === null || originalBillDetail === void 0 ? void 0 : originalBillDetail.documentId)) {
256
+ return true;
257
+ }
258
+ if (((_c = whatForSection === null || whatForSection === void 0 ? void 0 : whatForSection.billDueDate) === null || _c === void 0 ? void 0 : _c.toString()) !==
259
+ ((_d = originalBillDetail === null || originalBillDetail === void 0 ? void 0 : originalBillDetail.dueDate) === null || _d === void 0 ? void 0 : _d.toString())) {
260
+ return true;
261
+ }
262
+ if (((_e = whatForSection === null || whatForSection === void 0 ? void 0 : whatForSection.invoiceDate) === null || _e === void 0 ? void 0 : _e.toString()) !==
263
+ (originalBillDetail === null || originalBillDetail === void 0 ? void 0 : originalBillDetail.date.toString())) {
264
+ return true;
265
+ }
266
+ return false;
267
+ };
268
+ exports.checkIfUpdateCurrentBill = checkIfUpdateCurrentBill;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.7.78",
3
+ "version": "4.7.80",
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",