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

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 @@ export declare enum BookingHistoryOperationType {
7
7
  REFUND = "refund",
8
8
  PAYMENT = "payment",
9
9
  MERGED = "merged",
10
- DELETE_SLOT_EVENT = "delete_slot_event"
10
+ DELETE_SLOT_EVENT = "delete_slot_event",
11
+ EXTENSION = "extension"
11
12
  }
12
13
  export declare const OPERATION_TYPES: BookingHistoryOperationType[];
@@ -12,6 +12,7 @@ var BookingHistoryOperationType;
12
12
  BookingHistoryOperationType["PAYMENT"] = "payment";
13
13
  BookingHistoryOperationType["MERGED"] = "merged";
14
14
  BookingHistoryOperationType["DELETE_SLOT_EVENT"] = "delete_slot_event";
15
+ BookingHistoryOperationType["EXTENSION"] = "extension";
15
16
  })(BookingHistoryOperationType || (exports.BookingHistoryOperationType = BookingHistoryOperationType = {}));
16
17
  exports.OPERATION_TYPES = [
17
18
  BookingHistoryOperationType.DELETE,
@@ -12,7 +12,7 @@ export interface ICreateOneSlotBookingDetailsRequest {
12
12
  discountedCost: number;
13
13
  amountPaid: number;
14
14
  pitchId: number;
15
- pitchIds: number[];
15
+ pitchIds?: number[];
16
16
  status: BookingDetailsStatus;
17
17
  sport: string;
18
18
  remarks?: string | null;
@@ -34,6 +34,7 @@ export interface IUpdateRecurringBookingResponse extends IModifyEntity<IBookingD
34
34
  discountPolicy?: string;
35
35
  delete_slot?: IDeleteBookingByCodesDto;
36
36
  update_slot?: IUpdateBookingByCodesDto;
37
+ extension_booking_codes?: string[];
37
38
  }
38
39
  export interface IUpdateRecurringSlotBookingDetailsRequest {
39
40
  customerName?: string;
@@ -9,15 +9,15 @@ var ChargesModel = /** @class */ (function () {
9
9
  this.initialBookingGrossAmount = initialGrossAmount;
10
10
  this.amountPaid = paidAmount;
11
11
  this.couponCode = couponCode;
12
+ this.totalBookingHours = totalBookingHours;
13
+ this.discountPolicy = discountPolicy;
12
14
  this.additionalBookingGrossAmount = 0;
13
15
  this.cancelledBookingGrossAmount = 0;
14
16
  this.totalCancellationCharges = 0;
15
17
  this.refundPayable = 0;
16
18
  this.totalRefundedAmount = 0;
17
- this.totalBookingHours = totalBookingHours;
18
19
  this.netTotal = this.getNetAmount();
19
20
  this.amountPayable = this.getPayableRefundAmount();
20
- this.discountPolicy = discountPolicy;
21
21
  }
22
22
  ChargesModel.prototype.getGrossAmount = function () {
23
23
  return (this.initialBookingGrossAmount +
@@ -25,7 +25,6 @@ var ChargesModel = /** @class */ (function () {
25
25
  this.cancelledBookingGrossAmount);
26
26
  };
27
27
  ChargesModel.prototype.getNetAmount = function () {
28
- // console.log("getNetAmount", this.getGrossAmount(), this.getDiscountAmount());
29
28
  return this.getGrossAmount() - this.getDiscountAmount();
30
29
  };
31
30
  ChargesModel.prototype.getDiscountAmount = function () {
@@ -104,10 +103,6 @@ var ChargesModel = /** @class */ (function () {
104
103
  };
105
104
  ChargesModel.prototype.modify = function (bookingModification) {
106
105
  var oldBookingCode = bookingModification.oldBookingCode, newBookingCode = bookingModification.newBookingCode, cancellationUnit = bookingModification.cancellationUnit;
107
- // this.totalBookingHours =
108
- // this.totalBookingHours -
109
- // oldBookingCode.getTotalTime("hr") +
110
- // (newBookingCode ? newBookingCode.getTotalTime("hr") : 0);
111
106
  if (!newBookingCode) {
112
107
  return this.modifyDelete(oldBookingCode, cancellationUnit !== null && cancellationUnit !== void 0 ? cancellationUnit : "");
113
108
  }
@@ -153,7 +148,6 @@ var ChargesModel = /** @class */ (function () {
153
148
  var newChargeModel = this.clone();
154
149
  newChargeModel.totalBookingHours = newTotalBookingHours;
155
150
  var costDifference = oldBookingCode.getCost() - newBookingCode.getCost();
156
- // console.log(`costDifference ${costDifference}`);
157
151
  newChargeModel.cancelledBookingGrossAmount += costDifference;
158
152
  var cancellationCharges = ChargesModel.getDiscountAmount(cancellationUnit, costDifference);
159
153
  // console.log(`cancellationCharges ${cancellationCharges}`);
@@ -225,8 +219,7 @@ var ChargesModel = /** @class */ (function () {
225
219
  return newChargeModel;
226
220
  };
227
221
  ChargesModel.prototype.extension = function (extensionBookingCode) {
228
- var newTotalBookingHours = this.totalBookingHours +
229
- (extensionBookingCode ? extensionBookingCode.getTotalTime("hr") : 0);
222
+ var newTotalBookingHours = this.totalBookingHours + (extensionBookingCode ? extensionBookingCode.getTotalTime("hr") : 0);
230
223
  var newChargeModel = this.clone();
231
224
  newChargeModel.totalBookingHours = newTotalBookingHours;
232
225
  newChargeModel.additionalBookingGrossAmount += extensionBookingCode.getCost();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turf-common",
3
- "version": "1.4.2-beta.16",
3
+ "version": "1.4.2-beta.18",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",