tripstorekrabi-shared 1.13.69 → 1.13.70

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/booking.js +10 -3
  2. package/package.json +1 -1
package/booking.js CHANGED
@@ -8,6 +8,11 @@ dayjs.extend(advancedFormat);
8
8
  dayjs.extend(utc);
9
9
  dayjs.extend(timezone);
10
10
 
11
+ export let OPERATOR_NOTE = 'Operator';
12
+ export let CUSTOMER_NOTE = 'Customer';
13
+ export const NOTES = [OPERATOR_NOTE, CUSTOMER_NOTE];
14
+ export const MAX_NOTES = 10;
15
+
11
16
  const PHONE_REGEXP = /[^\d+]/g;
12
17
 
13
18
  export function addBookingFromInvoice(
@@ -252,9 +257,11 @@ export function getStartingPointMessage(booking, product) {
252
257
  text += '\n\nWHAT TO BRING: ' + product.whatToBring;
253
258
  }
254
259
 
255
- if (booking.specialRequirements) {
256
- text +=
257
- '\n\nSPECIAL REQUIREMENTS: ' + booking.specialRequirements.toUpperCase();
260
+ let notes = Object.values(booking.notes ?? {})
261
+ .filter((item) => item.visibility.includes(CUSTOMER_NOTE))
262
+ .map((item) => item.description);
263
+ if (notes.length > 0) {
264
+ text += '\n\nSPECIAL CUSTOMER NEEDS: ' + notes.join(', ');
258
265
  }
259
266
 
260
267
  if (product?.customerInformation?.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.13.69",
3
+ "version": "1.13.70",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {