@hyper.software/common-helpers 1.0.65 → 1.0.67
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.
|
@@ -5,8 +5,10 @@ export declare const getTotalCostForRoomBooking: (roomBooking: IRoomBooking & {
|
|
|
5
5
|
price?: number;
|
|
6
6
|
pricingRules?: IRoomTypePricePlanPricingRules;
|
|
7
7
|
pricingInformation?: Partial<IRoomTypePricePlanPricingInformation>;
|
|
8
|
-
}, checkinDate: Moment, checkoutDate: Moment, numberOfAdults: number
|
|
8
|
+
}, checkinDate: Moment, checkoutDate: Moment, numberOfAdults: number) => number;
|
|
9
9
|
export declare const getServicesCost: (booking: IBooking) => number;
|
|
10
|
+
export declare const getLengthOfStayRoomBooking: (roomBooking: IRoomBooking) => number;
|
|
11
|
+
export declare const getBreakfastCost: (roomBooking: IRoomBooking) => number;
|
|
10
12
|
export declare const getAccommodationCost: (roomBookings: Array<{
|
|
11
13
|
roomId?: string;
|
|
12
14
|
breakfastIncluded?: boolean;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -37,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
27
|
};
|
|
39
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.removeInvalidCharacters = exports.ensureValueIsNumber = exports.getAccommodationCost = exports.getServicesCost = exports.getTotalCostForRoomBooking = exports.getDefaultRoomTypePricePlan = void 0;
|
|
29
|
+
exports.removeInvalidCharacters = exports.ensureValueIsNumber = exports.getAccommodationCost = exports.getBreakfastCost = exports.getLengthOfStayRoomBooking = exports.getServicesCost = exports.getTotalCostForRoomBooking = exports.getDefaultRoomTypePricePlan = void 0;
|
|
41
30
|
var moment_1 = __importDefault(require("moment"));
|
|
42
31
|
var helpers_1 = require("../../helpers");
|
|
43
32
|
var interfaces_1 = require("@hyper.software/common-models/lib/interfaces");
|
|
@@ -50,24 +39,13 @@ var getDefaultRoomTypePricePlan = function (roomTypePricePlans) {
|
|
|
50
39
|
roomTypePricePlans.find(function (roomTypePricePlan) { return roomTypePricePlan.type === interfaces_1.CHANNEL_TYPE.DEFAULT; }));
|
|
51
40
|
};
|
|
52
41
|
exports.getDefaultRoomTypePricePlan = getDefaultRoomTypePricePlan;
|
|
53
|
-
var getTotalCostForRoomBooking = function (roomBooking, checkinDate, checkoutDate, numberOfAdults
|
|
54
|
-
var _a, _b, _c
|
|
42
|
+
var getTotalCostForRoomBooking = function (roomBooking, checkinDate, checkoutDate, numberOfAdults) {
|
|
43
|
+
var _a, _b, _c;
|
|
55
44
|
if (!roomBooking) {
|
|
56
45
|
return 0;
|
|
57
46
|
}
|
|
58
|
-
var roomTypePricePlan = (0, exports.getDefaultRoomTypePricePlan)((_b = (_a = roomBooking.room) === null || _a === void 0 ? void 0 : _a.roomType) === null || _b === void 0 ? void 0 : _b.roomTypePricePlans);
|
|
59
|
-
roomBooking.pricingInformation = roomTypePricePlan.pricing;
|
|
60
|
-
roomBooking.pricingRules = roomBooking.pricingRules || roomTypePricePlan.pricingRules;
|
|
61
|
-
if (roomBooking.price) {
|
|
62
|
-
roomBooking.pricingInformation = dateService
|
|
63
|
-
.getDays(checkinDate.toISOString(), checkoutDate.toISOString())
|
|
64
|
-
.reduce(function (prevVal, currVal) {
|
|
65
|
-
var _a;
|
|
66
|
-
return (__assign(__assign({}, prevVal), (_a = {}, _a[currVal] = roomBooking.price, _a)));
|
|
67
|
-
}, {});
|
|
68
|
-
}
|
|
69
47
|
var totalCost = 0;
|
|
70
|
-
var maxNumberOfAdults = ((
|
|
48
|
+
var maxNumberOfAdults = ((_b = (_a = roomBooking === null || roomBooking === void 0 ? void 0 : roomBooking.room) === null || _a === void 0 ? void 0 : _a.roomType) === null || _b === void 0 ? void 0 : _b.maxNumberOfAdults) || ((_c = roomBooking === null || roomBooking === void 0 ? void 0 : roomBooking.roomType) === null || _c === void 0 ? void 0 : _c.maxNumberOfAdults);
|
|
71
49
|
var actualNumberOfAdults = roomBooking.personsPayingBreakfast || numberOfAdults;
|
|
72
50
|
var shouldIncreasePrice = actualNumberOfAdults > maxNumberOfAdults;
|
|
73
51
|
var adjustmentFactor = shouldIncreasePrice ? 1 : -1;
|
|
@@ -83,8 +61,9 @@ var getTotalCostForRoomBooking = function (roomBooking, checkinDate, checkoutDat
|
|
|
83
61
|
})
|
|
84
62
|
: null;
|
|
85
63
|
}
|
|
86
|
-
var
|
|
87
|
-
|
|
64
|
+
var pricingInfo = roomBooking.pricingInformation || {};
|
|
65
|
+
var dateKey = checkinDate.format(helpers_1.DATE_FORMATS.YYYY_MM_DD);
|
|
66
|
+
var cost = roomBooking.pricePerNight || (0, exports.ensureValueIsNumber)(pricingInfo[dateKey]) || 0;
|
|
88
67
|
var calculation = actualNumberOfAdults === maxNumberOfAdults || !discountOrIncrease.value
|
|
89
68
|
? cost
|
|
90
69
|
: (discountOrIncrease === null || discountOrIncrease === void 0 ? void 0 : discountOrIncrease.type) === interfaces_1.DISCOUNT_TYPE.PERCENTAGE
|
|
@@ -94,9 +73,6 @@ var getTotalCostForRoomBooking = function (roomBooking, checkinDate, checkoutDat
|
|
|
94
73
|
totalCost += calculation;
|
|
95
74
|
checkinDate.add(1, 'days');
|
|
96
75
|
}
|
|
97
|
-
if (booking && company) {
|
|
98
|
-
totalCost += calculateTourismTaxCost(booking, company);
|
|
99
|
-
}
|
|
100
76
|
return totalCost;
|
|
101
77
|
};
|
|
102
78
|
exports.getTotalCostForRoomBooking = getTotalCostForRoomBooking;
|
|
@@ -133,6 +109,13 @@ var getServicesCost = function (booking) {
|
|
|
133
109
|
return servicesCost;
|
|
134
110
|
};
|
|
135
111
|
exports.getServicesCost = getServicesCost;
|
|
112
|
+
var getLengthOfStayRoomBooking = function (roomBooking) {
|
|
113
|
+
if (!(roomBooking === null || roomBooking === void 0 ? void 0 : roomBooking.checkinDate) || !(roomBooking === null || roomBooking === void 0 ? void 0 : roomBooking.checkoutDate)) {
|
|
114
|
+
return 0;
|
|
115
|
+
}
|
|
116
|
+
return (0, moment_1.default)(dateService.normalizeDate(roomBooking.checkoutDate)).diff((0, moment_1.default)(dateService.normalizeDate(roomBooking.checkinDate)), 'days');
|
|
117
|
+
};
|
|
118
|
+
exports.getLengthOfStayRoomBooking = getLengthOfStayRoomBooking;
|
|
136
119
|
var calculateTourismTaxCost = function (booking, company) {
|
|
137
120
|
var _a;
|
|
138
121
|
var tourismTaxRate = ((_a = company === null || company === void 0 ? void 0 : company.receipts) === null || _a === void 0 ? void 0 : _a.tourismTax) || 0;
|
|
@@ -140,6 +123,17 @@ var calculateTourismTaxCost = function (booking, company) {
|
|
|
140
123
|
var lengthOfStay = (0, moment_1.default)(dateService.normalizeDate(booking === null || booking === void 0 ? void 0 : booking.checkoutDate)).diff((0, moment_1.default)(dateService.normalizeDate(booking === null || booking === void 0 ? void 0 : booking.checkinDate)));
|
|
141
124
|
return tourismTaxRate * numberOfAdults * lengthOfStay;
|
|
142
125
|
};
|
|
126
|
+
var getBreakfastCost = function (roomBooking) {
|
|
127
|
+
var _a, _b, _c, _d;
|
|
128
|
+
if (!(roomBooking === null || roomBooking === void 0 ? void 0 : roomBooking.breakfastIncluded)) {
|
|
129
|
+
return 0;
|
|
130
|
+
}
|
|
131
|
+
var lengthOfStay = (0, exports.getLengthOfStayRoomBooking)(roomBooking);
|
|
132
|
+
var breakfastCost = ((_c = (_b = (_a = roomBooking === null || roomBooking === void 0 ? void 0 : roomBooking.room) === null || _a === void 0 ? void 0 : _a.roomType) === null || _b === void 0 ? void 0 : _b.breakfastInformation) === null || _c === void 0 ? void 0 : _c.cost) || 0;
|
|
133
|
+
var personsPayingBreakfast = (_d = roomBooking === null || roomBooking === void 0 ? void 0 : roomBooking.personsPayingBreakfast) !== null && _d !== void 0 ? _d : 0;
|
|
134
|
+
return breakfastCost * personsPayingBreakfast * lengthOfStay;
|
|
135
|
+
};
|
|
136
|
+
exports.getBreakfastCost = getBreakfastCost;
|
|
143
137
|
var getAccommodationCost = function (roomBookings, _checkinDate, _checkoutDate, numberOfAdults, booking, company) {
|
|
144
138
|
if (!_checkinDate || !_checkoutDate) {
|
|
145
139
|
return null;
|
|
@@ -149,8 +143,11 @@ var getAccommodationCost = function (roomBookings, _checkinDate, _checkoutDate,
|
|
|
149
143
|
var totalCost = 0;
|
|
150
144
|
for (var _i = 0, roomBookings_1 = roomBookings; _i < roomBookings_1.length; _i++) {
|
|
151
145
|
var roomBooking = roomBookings_1[_i];
|
|
152
|
-
var costForRoomBooking = (0, exports.getTotalCostForRoomBooking)(roomBooking, (0, moment_1.default)(checkinDate.toISOString()), (0, moment_1.default)(checkoutDate.toISOString()), roomBooking.personsPayingBreakfast || numberOfAdults
|
|
146
|
+
var costForRoomBooking = (0, exports.getTotalCostForRoomBooking)(roomBooking, (0, moment_1.default)(checkinDate.toISOString()), (0, moment_1.default)(checkoutDate.toISOString()), roomBooking.personsPayingBreakfast || numberOfAdults);
|
|
153
147
|
totalCost += costForRoomBooking;
|
|
148
|
+
if (booking && company) {
|
|
149
|
+
totalCost += calculateTourismTaxCost(booking, company);
|
|
150
|
+
}
|
|
154
151
|
}
|
|
155
152
|
return totalCost;
|
|
156
153
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bookingsService.js","sourceRoot":"","sources":["../../../src/services/bookingService/bookingsService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bookingsService.js","sourceRoot":"","sources":["../../../src/services/bookingService/bookingsService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAuC;AACvC,yCAAqD;AACrD,2EAUqD;AACrD,sEAAyD;AAElD,IAAM,2BAA2B,GAAG,UAAC,kBAAwC;IAClF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE;QACtC,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,CACL,kBAAkB,CAAC,IAAI,CAAC,UAAC,iBAAiB,IAAK,OAAA,iBAAiB,CAAC,IAAI,KAAK,yBAAY,CAAC,OAAO,EAA/C,CAA+C,CAAC;QAC/F,kBAAkB,CAAC,IAAI,CAAC,UAAC,iBAAiB,IAAK,OAAA,iBAAiB,CAAC,IAAI,KAAK,yBAAY,CAAC,OAAO,EAA/C,CAA+C,CAAC,CAChG,CAAA;AACH,CAAC,CAAA;AATY,QAAA,2BAA2B,+BASvC;AAEM,IAAM,0BAA0B,GAAG,UACxC,WAIC,EACD,WAAmB,EACnB,YAAoB,EACpB,cAAsB;;IAEtB,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,CAAC,CAAA;KACT;IAED,IAAI,SAAS,GAAG,CAAC,CAAA;IAEjB,IAAM,iBAAiB,GACrB,CAAA,MAAA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,0CAAE,QAAQ,0CAAE,iBAAiB,MAAI,MAAC,WAAmB,aAAnB,WAAW,uBAAX,WAAW,CAAU,QAAQ,0CAAE,iBAAiB,CAAA,CAAA;IACrG,IAAM,oBAAoB,GAAG,WAAW,CAAC,sBAAsB,IAAI,cAAc,CAAA;IAEjF,IAAM,mBAAmB,GAAG,oBAAoB,GAAG,iBAAiB,CAAA;IACpE,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