tripstorekrabi-shared 1.15.0 → 1.15.2
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 +5 -1
- package/package.json +2 -2
- package/utils.js +8 -3
package/booking.js
CHANGED
|
@@ -4,7 +4,7 @@ import utc from 'dayjs/plugin/utc.js';
|
|
|
4
4
|
import timezone from 'dayjs/plugin/timezone.js';
|
|
5
5
|
import { PAY_ON_TOUR, calculateTotalOperatorPrice } from './price.js';
|
|
6
6
|
import { nanoid } from 'nanoid';
|
|
7
|
-
import { isHotelPickup } from './utils.js';
|
|
7
|
+
import { isHotelPickup, isHotelDropOff } from './utils.js';
|
|
8
8
|
|
|
9
9
|
dayjs.extend(advancedFormat);
|
|
10
10
|
dayjs.extend(utc);
|
|
@@ -279,6 +279,10 @@ export function getStartingPointMessage(booking, product) {
|
|
|
279
279
|
text += ' on the ' + date;
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
+
if (booking.dropOffHotel && isHotelDropOff(booking.startingPointDescription)) {
|
|
283
|
+
text += ' with transfer to ' + booking.dropOffHotel;
|
|
284
|
+
}
|
|
285
|
+
|
|
282
286
|
text += '. Please watch out for the staff of ' + booking.operator + '.';
|
|
283
287
|
|
|
284
288
|
if (booking.googleMapLocation?.length > 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tripstorekrabi-shared",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.2",
|
|
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.10",
|
|
19
|
-
"nanoid": "^5.0.
|
|
19
|
+
"nanoid": "^5.0.6"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"deploy": "npm publish"
|
package/utils.js
CHANGED
|
@@ -341,6 +341,11 @@ export function getBookingSummary(booking, options = {}) {
|
|
|
341
341
|
if (options.includeVersion && booking.version) {
|
|
342
342
|
summary += ', Version: ' + booking.version;
|
|
343
343
|
}
|
|
344
|
+
|
|
345
|
+
if (options.includeExpediaVouchers && booking.expediaVoucherNumbers) {
|
|
346
|
+
summary += ', Vouchers: ' + booking.expediaVoucherNumbers.join(", ");
|
|
347
|
+
}
|
|
348
|
+
|
|
344
349
|
summary += ': ';
|
|
345
350
|
}
|
|
346
351
|
|
|
@@ -580,12 +585,12 @@ function checkTime(pickupTimeValue, departureTimeValue, context) {
|
|
|
580
585
|
return pickupTime.isSameOrBefore(departureTime)
|
|
581
586
|
? true
|
|
582
587
|
: context
|
|
583
|
-
|
|
588
|
+
? context.createError({
|
|
584
589
|
message: 'Pickup time should be before or equals departure time',
|
|
585
590
|
path: context.path,
|
|
586
591
|
params: { status: 'warning' },
|
|
587
592
|
})
|
|
588
|
-
|
|
593
|
+
: false;
|
|
589
594
|
} catch (e) {
|
|
590
595
|
return false;
|
|
591
596
|
}
|
|
@@ -626,7 +631,7 @@ export function createVoucherRequest(booking, product) {
|
|
|
626
631
|
pickupTime: booking.pickupTime,
|
|
627
632
|
mobileVoucher: product
|
|
628
633
|
? product.operator.mobileVoucher ??
|
|
629
|
-
|
|
634
|
+
product.operator.default.mobileVoucher
|
|
630
635
|
: true,
|
|
631
636
|
},
|
|
632
637
|
};
|