tripstorekrabi-shared 1.13.70 → 1.13.71

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 +6 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.13.70",
3
+ "version": "1.13.71",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {
package/utils.js CHANGED
@@ -5,6 +5,7 @@ import isSameOrBefore from 'dayjs/plugin/isSameOrBefore.js';
5
5
  import utc from 'dayjs/plugin/utc.js';
6
6
  import timezone from 'dayjs/plugin/timezone.js';
7
7
  import { findEndPoint, findStartingPoint } from './price.js';
8
+ import { CUSTOMER_NOTE } from './booking.js';
8
9
 
9
10
  dayjs.extend(customParseFormat);
10
11
  dayjs.extend(advancedFormat);
@@ -602,13 +603,13 @@ export function createVoucherRequest(booking, product) {
602
603
  let request = {
603
604
  booking: {
604
605
  referenceNumber: booking.referenceNumber,
605
- specialRequirements: booking.specialRequirements
606
- ? booking.specialRequirements.toUpperCase()
607
- : '',
606
+ specialRequirements: Object.values(booking.notes ?? {})
607
+ .filter((item) => item.visibility.includes(CUSTOMER_NOTE))
608
+ .map((item) => item.description)
609
+ .join(', '),
608
610
  nationalParkFee:
609
611
  product && product.nationalPark
610
- ? 'NATIONAL PARK ENTRANCE FEE: ' +
611
- booking.nationalParkFee.toUpperCase()
612
+ ? 'NATIONAL PARK ENTRANCE FEE: ' + booking.nationalParkFee
612
613
  : '',
613
614
  productDescription: booking.productDescription,
614
615
  leadTraveller: booking.leadTraveller,