turf-common 1.4.2-beta.18 → 1.4.2-beta.19

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.
@@ -237,7 +237,7 @@ var ChargesModel = /** @class */ (function () {
237
237
  };
238
238
  ChargesModel.getInstance = function (chargeData, discountPolicy) {
239
239
  if (discountPolicy === void 0) { discountPolicy = modification_discount_policy_enum_1.ModificationDiscountPolicy.DISCOUNT_CONDITIONAL; }
240
- var chargesModel = new ChargesModel(chargeData.initialBookingGrossAmount, chargeData.amountPaid, chargeData.couponCode, chargeData.totalBookingHours, discountPolicy);
240
+ var chargesModel = new ChargesModel(chargeData.initialBookingGrossAmount, chargeData.amountPaid, chargeData.couponCode, parseFloat(chargeData.totalBookingHours.toString()), discountPolicy);
241
241
  Object.assign(chargesModel, chargeData);
242
242
  return chargesModel;
243
243
  };
@@ -33,6 +33,7 @@ describe("AppController (e2e)", function () {
33
33
  var expectedTotalRefundedAmount = 0;
34
34
  var expectedCouponCode = "100PHU";
35
35
  var expectedDiscountPolicy = _enum_1.ModificationDiscountPolicy.DISCOUNT_CONDITIONAL;
36
+ var expectedTotalBookingHours = 3;
36
37
  var initialGrossAmount = bookingCodes
37
38
  .map(function (bookingCode) { return bookingCode.getCost(); })
38
39
  .reduce(function (a, b) { return a + b; }, 0);
@@ -49,6 +50,7 @@ describe("AppController (e2e)", function () {
49
50
  expect(chargeModel.totalRefundedAmount).toEqual(expectedTotalRefundedAmount);
50
51
  expect(chargeModel.couponCode).toEqual(expectedCouponCode);
51
52
  expect(chargeModel.discountPolicy).toEqual(expectedDiscountPolicy);
53
+ expect(chargeModel.totalBookingHours).toEqual(expectedTotalBookingHours);
52
54
  });
53
55
  it("1. modify extend", function () {
54
56
  var expectedInitialBookingGrossAmount = 3000;
@@ -62,6 +64,7 @@ describe("AppController (e2e)", function () {
62
64
  var expectedTotalRefundedAmount = 0;
63
65
  var expectedCouponCode = "100PHU";
64
66
  var expectedDiscountPolicy = _enum_1.ModificationDiscountPolicy.DISCOUNT_CONDITIONAL;
67
+ var expectedTotalBookingHours = 4;
65
68
  if (currentChargeModel)
66
69
  currentChargeModel = currentChargeModel.modify({
67
70
  oldBookingCode: initialBookingCode2,
@@ -80,6 +83,7 @@ describe("AppController (e2e)", function () {
80
83
  expect(currentChargeModel.totalRefundedAmount).toEqual(expectedTotalRefundedAmount);
81
84
  expect(currentChargeModel.couponCode).toEqual(expectedCouponCode);
82
85
  expect(currentChargeModel.discountPolicy).toEqual(expectedDiscountPolicy);
86
+ expect(currentChargeModel.totalBookingHours).toEqual(expectedTotalBookingHours);
83
87
  }
84
88
  });
85
89
  it("2. extension", function () {
@@ -94,6 +98,7 @@ describe("AppController (e2e)", function () {
94
98
  var expectedTotalRefundedAmount = 0;
95
99
  var expectedCouponCode = "100PHU";
96
100
  var expectedDiscountPolicy = _enum_1.ModificationDiscountPolicy.DISCOUNT_CONDITIONAL;
101
+ var expectedTotalBookingHours = 4.5;
97
102
  if (currentChargeModel)
98
103
  currentChargeModel = currentChargeModel.extension(modify2ExtensionBookingCode);
99
104
  expect(currentChargeModel).not.toBeNull();
@@ -109,6 +114,7 @@ describe("AppController (e2e)", function () {
109
114
  expect(currentChargeModel.totalRefundedAmount).toEqual(expectedTotalRefundedAmount);
110
115
  expect(currentChargeModel.couponCode).toEqual(expectedCouponCode);
111
116
  expect(currentChargeModel.discountPolicy).toEqual(expectedDiscountPolicy);
117
+ expect(currentChargeModel.totalBookingHours).toEqual(expectedTotalBookingHours);
112
118
  }
113
119
  });
114
120
  it("3. modify reduce", function () {
@@ -153,7 +153,7 @@ describe("AppController (e2e)", function () {
153
153
  for (var _l = 0, expectedBillingCycleKeys_3 = expectedBillingCycleKeys; _l < expectedBillingCycleKeys_3.length; _l++) {
154
154
  var billingCycleKey = expectedBillingCycleKeys_3[_l];
155
155
  var subscribedPricingPlanModelV2 = new _model_1.SubscribedPricingPlanModelV2(pricingPlanModelV2, pitchCount, billingCycleKey);
156
- console.log("---- Pitch Count: '".concat(subscribedPricingPlanModelV2.pitchCount, "', Billing: '").concat(subscribedPricingPlanModelV2.billingCycle, "'"));
156
+ // console.log(`---- Pitch Count: '${subscribedPricingPlanModelV2.pitchCount}', Billing: '${subscribedPricingPlanModelV2.billingCycle}'`)
157
157
  // TODO: Need to check the usability of the below method
158
158
  // console.log(`subscribedPricingPlanModelV2.getMonths() : ${subscribedPricingPlanModelV2.getMonths()}`)
159
159
  // TODO: Needs to change the name to getBasePriceByPitchSlab for Monthly
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turf-common",
3
- "version": "1.4.2-beta.18",
3
+ "version": "1.4.2-beta.19",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",