turf-common 1.2.1-beta.2 → 1.2.1-beta.4
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,6 +1,6 @@
|
|
|
1
|
-
import { IBookingDetailsWithBookingCodes } from "../../@type";
|
|
1
|
+
import { IBookingDetailsWithBookingCodes, IChargeModel } from "../../@type";
|
|
2
2
|
import { IModifyEntity } from "../modify-entity.interface";
|
|
3
|
-
export interface BookingDetailsData extends IModifyEntity<IBookingDetailsWithBookingCodes
|
|
3
|
+
export interface BookingDetailsData extends IModifyEntity<IBookingDetailsWithBookingCodes>, IChargeModel {
|
|
4
4
|
code?: string;
|
|
5
5
|
slot_cost?: string;
|
|
6
6
|
}
|
|
@@ -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;
|
|
@@ -32,9 +31,5 @@ export declare class ChargesModel implements IChargeModel {
|
|
|
32
31
|
getTotalAmount(): number;
|
|
33
32
|
getPaymentStatus(): "Refund" | "Paid" | "Pending";
|
|
34
33
|
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
34
|
getTotalNetAmount(): number;
|
|
40
35
|
}
|
|
@@ -229,43 +229,6 @@ var ChargesModel = /** @class */ (function () {
|
|
|
229
229
|
Object.assign(chargesModel, data);
|
|
230
230
|
return chargesModel;
|
|
231
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
232
|
ChargesModel.prototype.getTotalNetAmount = function () {
|
|
270
233
|
return this.getNetAmount() + this.totalCancellationCharges;
|
|
271
234
|
};
|