turf-common 1.1.1-beta.78 → 1.2.1-beta.0
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.
package/build/@type.d.ts
CHANGED
|
@@ -28,3 +28,4 @@ export * from "./interface/modify.interface";
|
|
|
28
28
|
export * from "./interface/modify-entity.interface";
|
|
29
29
|
export * from "./interface/key-value.interface";
|
|
30
30
|
export * from "./interface/ui/upgrade-subscription-data.interface";
|
|
31
|
+
export * from "./interface/ui/booking-data.interface";
|
package/build/@type.js
CHANGED
|
@@ -45,3 +45,4 @@ __exportStar(require("./interface/modify-entity.interface"), exports);
|
|
|
45
45
|
__exportStar(require("./interface/key-value.interface"), exports);
|
|
46
46
|
// changes for the ui
|
|
47
47
|
__exportStar(require("./interface/ui/upgrade-subscription-data.interface"), exports);
|
|
48
|
+
__exportStar(require("./interface/ui/booking-data.interface"), exports);
|
|
@@ -1,6 +1,7 @@
|
|
|
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";
|
|
4
5
|
export declare class ChargesModel implements IChargeModel {
|
|
5
6
|
initialBookingGrossAmount: number;
|
|
6
7
|
additionalBookingGrossAmount: number;
|
|
@@ -30,4 +31,10 @@ export declare class ChargesModel implements IChargeModel {
|
|
|
30
31
|
static assignByInterface(bookingDetailsEntity: IChargeModel, discountPolicy?: ModificationDiscountPolicy): ChargesModel;
|
|
31
32
|
getTotalAmount(): number;
|
|
32
33
|
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
|
+
getTotalNetAmount(): number;
|
|
33
40
|
}
|
|
@@ -222,6 +222,53 @@ 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
|
+
ChargesModel.prototype.getTotalNetAmount = function () {
|
|
270
|
+
return this.getNetAmount() + this.totalCancellationCharges;
|
|
271
|
+
};
|
|
225
272
|
return ChargesModel;
|
|
226
273
|
}());
|
|
227
274
|
exports.ChargesModel = ChargesModel;
|