tripstorekrabi-shared 1.17.9 → 1.18.1
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/booking.js +1 -1
- package/package.json +2 -2
- package/price.js +8 -2
package/booking.js
CHANGED
|
@@ -280,7 +280,7 @@ export function getStartingPointMessage(booking, product) {
|
|
|
280
280
|
text += "Your booking includes a " + booking.productDescription.substring(booking.productDescription.indexOf(transferTo)).replace(transferTo, "transfer to") + '. ';
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
text += '
|
|
283
|
+
text += 'Kindly watch for staff representing ' + booking.operator + '.';
|
|
284
284
|
|
|
285
285
|
if (booking.googleMapsLocation?.length > 0) {
|
|
286
286
|
text += `\n\n${isHotelPickup(booking.startingPointDescription)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tripstorekrabi-shared",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.1",
|
|
4
4
|
"description": "Shared library for Trip Store Krabi",
|
|
5
5
|
"author": "Stefan Sommer <tonprince@gmail.com>",
|
|
6
6
|
"repository": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"dayjs": "^1.11.13",
|
|
19
|
-
"libphonenumber-js": "^1.11.
|
|
19
|
+
"libphonenumber-js": "^1.11.8",
|
|
20
20
|
"nanoid": "^5.0.7"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
package/price.js
CHANGED
|
@@ -49,8 +49,14 @@ function calculateSellingPrice(commissionRate, price) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
function calculateProductPrice(booking, pricing, options = { mode: SELLING_MODE }) {
|
|
52
|
-
if (pricing.promotion
|
|
53
|
-
|
|
52
|
+
if (pricing.promotion) {
|
|
53
|
+
let departureDate = booking.departureDate instanceof Date ? dayjs(booking.departureDate) : typeof booking.departureDate.toDate === 'function' ? dayjs(booking.departureDate.toDate()) : null;
|
|
54
|
+
let startDate = pricing.promotion.startDate instanceof Date ? pricing.promotion.startDate : typeof pricing.promotion.startDate.toDate === 'function' ? pricing.promotion.startDate.toDate() : null;
|
|
55
|
+
let endDate = pricing.promotion.endDate instanceof Date ? pricing.promotion.endDate : typeof pricing.promotion.endDate.toDate === 'function' ? pricing.promotion.endDate.toDate() : null;
|
|
56
|
+
|
|
57
|
+
if (departureDate?.isBetween(startDate, endDate, "day", "[]")) {
|
|
58
|
+
pricing = { ...pricing, volumes: pricing.promotion.volumes };
|
|
59
|
+
}
|
|
54
60
|
}
|
|
55
61
|
|
|
56
62
|
let type = pricing.type;
|