tripstorekrabi-shared 1.15.0 → 1.15.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils.js +8 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.15.0",
3
+ "version": "1.15.1",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {
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
- ? context.createError({
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
- : false;
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
- product.operator.default.mobileVoucher
634
+ product.operator.default.mobileVoucher
630
635
  : true,
631
636
  },
632
637
  };