turf-common 1.2.1-beta.3 → 1.2.1-beta.5

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.
@@ -1,7 +1,6 @@
1
1
  import { IBookingModification } from "../types/booking-modification.type";
2
2
  import { ModificationDiscountPolicy } from "../enums/modification-discount-policy.enum";
3
3
  import { IChargeModel } from "../interface/model/charge-model.interface";
4
- import { BookingDetailsData, IGetBookingDetailsByIdResponse } from "../@type";
5
4
  export declare class ChargesModel implements IChargeModel {
6
5
  initialBookingGrossAmount: number;
7
6
  additionalBookingGrossAmount: number;
@@ -27,14 +26,9 @@ export declare class ChargesModel implements IChargeModel {
27
26
  private modifyMove;
28
27
  clone(): ChargesModel;
29
28
  private modifyDelete;
30
- static getInstanceByInterface(bookingDetailsEntity: IChargeModel, discountPolicy?: ModificationDiscountPolicy): ChargesModel;
29
+ static getInstance(bookingDetailsEntity: IChargeModel, discountPolicy?: ModificationDiscountPolicy): ChargesModel;
31
30
  static assignByInterface(bookingDetailsEntity: IChargeModel, discountPolicy?: ModificationDiscountPolicy): ChargesModel;
32
31
  getTotalAmount(): number;
33
32
  getPaymentStatus(): "Refund" | "Paid" | "Pending";
34
- static getInstance(data: Partial<ChargesModel>, discountPolicy?: ModificationDiscountPolicy): ChargesModel;
35
- static getInstanceByBookingDetailsData(bookingDetailsData: BookingDetailsData, discountPolicy?: ModificationDiscountPolicy): ChargesModel;
36
- static getInstanceByBookingDetailData(bookingDetailData: IGetBookingDetailsByIdResponse, discountPolicy?: ModificationDiscountPolicy): ChargesModel;
37
- static assignBookingDetailsData(existingData: Partial<ChargesModel>, bookingDetailsData: BookingDetailsData): Partial<ChargesModel>;
38
- static assignBookingDetailData(existingData: Partial<ChargesModel>, bookingDetailData: IGetBookingDetailsByIdResponse): Partial<ChargesModel>;
39
33
  getTotalNetAmount(): number;
40
34
  }
@@ -185,7 +185,7 @@ var ChargesModel = /** @class */ (function () {
185
185
  }
186
186
  return newChargeModel;
187
187
  };
188
- ChargesModel.getInstanceByInterface = function (bookingDetailsEntity, discountPolicy) {
188
+ ChargesModel.getInstance = function (bookingDetailsEntity, discountPolicy) {
189
189
  if (discountPolicy === void 0) { discountPolicy = modification_discount_policy_enum_1.ModificationDiscountPolicy.DISCOUNT_CONDITIONAL; }
190
190
  var chargesModel = new ChargesModel(bookingDetailsEntity.initialBookingGrossAmount, bookingDetailsEntity.amountPaid, bookingDetailsEntity.couponCode, discountPolicy);
191
191
  Object.assign(chargesModel, bookingDetailsEntity);
@@ -222,50 +222,6 @@ var ChargesModel = /** @class */ (function () {
222
222
  ? "Paid"
223
223
  : "Pending";
224
224
  };
225
- ChargesModel.getInstance = function (data, discountPolicy) {
226
- if (discountPolicy === void 0) { discountPolicy = modification_discount_policy_enum_1.ModificationDiscountPolicy.DISCOUNT_CONDITIONAL; }
227
- var chargesModel = new ChargesModel(data.initialBookingGrossAmount, data.amountPaid, data.couponCode, discountPolicy);
228
- // set values
229
- Object.assign(chargesModel, data);
230
- return chargesModel;
231
- };
232
- ChargesModel.getInstanceByBookingDetailsData = function (bookingDetailsData, discountPolicy) {
233
- if (discountPolicy === void 0) { discountPolicy = modification_discount_policy_enum_1.ModificationDiscountPolicy.DISCOUNT_CONDITIONAL; }
234
- var data = ChargesModel.assignBookingDetailsData({}, bookingDetailsData);
235
- var chargesModel = new ChargesModel(data.initialBookingGrossAmount, data.amountPaid, data.couponCode, discountPolicy);
236
- // set values
237
- Object.assign(chargesModel, data);
238
- return chargesModel;
239
- };
240
- ChargesModel.getInstanceByBookingDetailData = function (bookingDetailData, discountPolicy) {
241
- if (discountPolicy === void 0) { discountPolicy = modification_discount_policy_enum_1.ModificationDiscountPolicy.DISCOUNT_CONDITIONAL; }
242
- var data = ChargesModel.assignBookingDetailData({}, bookingDetailData);
243
- var chargesModel = new ChargesModel(data.initialBookingGrossAmount, data.amountPaid, data.couponCode, discountPolicy);
244
- // set values
245
- Object.assign(chargesModel, data);
246
- return chargesModel;
247
- };
248
- ChargesModel.assignBookingDetailsData = function (existingData, bookingDetailsData) {
249
- Object.assign(existingData, bookingDetailsData);
250
- return existingData;
251
- };
252
- ChargesModel.assignBookingDetailData = function (existingData, bookingDetailData) {
253
- existingData.additionalBookingGrossAmount =
254
- bookingDetailData.additionalBookingGrossAmount;
255
- existingData.initialBookingGrossAmount =
256
- bookingDetailData.initialBookingGrossAmount;
257
- existingData.cancelledBookingGrossAmount =
258
- bookingDetailData.cancelledBookingGrossAmount;
259
- existingData.refundPayable = bookingDetailData.refundPayable;
260
- existingData.totalRefundedAmount = bookingDetailData.totalRefundedAmount;
261
- existingData.amountPaid = bookingDetailData.amountPaid;
262
- existingData.totalCancellationCharges =
263
- bookingDetailData.totalCancellationCharges;
264
- existingData.netTotal = bookingDetailData.netTotal;
265
- existingData.couponCode = bookingDetailData.couponCode;
266
- existingData.amountPayable = bookingDetailData.amountPayable;
267
- return existingData;
268
- };
269
225
  ChargesModel.prototype.getTotalNetAmount = function () {
270
226
  return this.getNetAmount() + this.totalCancellationCharges;
271
227
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turf-common",
3
- "version": "1.2.1-beta.3",
3
+ "version": "1.2.1-beta.5",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",