tripstorekrabi-shared 1.19.0 → 1.19.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/package.json +2 -2
- package/utils.js +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tripstorekrabi-shared",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.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.16",
|
|
20
20
|
"nanoid": "^5.0.9"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
package/utils.js
CHANGED
|
@@ -450,12 +450,22 @@ export function getBookingSummary(booking, options = {}) {
|
|
|
450
450
|
if (options.showPhoneNumber && booking.phoneNumber?.length > 0) {
|
|
451
451
|
summary += `, ${booking.phoneNumber}`;
|
|
452
452
|
}
|
|
453
|
+
|
|
454
|
+
if (options.showNotes) {
|
|
455
|
+
let notes = Object.values(booking.notes ?? {}).map((item) => item.description);
|
|
456
|
+
summary = [summary, ...notes].filter(Boolean).join(", ");
|
|
457
|
+
}
|
|
453
458
|
} else {
|
|
454
459
|
summary += '«THE BOOKING IS INCOMPLETE»';
|
|
455
460
|
|
|
456
461
|
if (options.showPhoneNumber && booking.phoneNumber?.length > 0) {
|
|
457
462
|
summary += `, ${booking.phoneNumber}`;
|
|
458
463
|
}
|
|
464
|
+
|
|
465
|
+
if (options.showNotes) {
|
|
466
|
+
let notes = Object.values(booking.notes ?? {}).map((item) => item.description);
|
|
467
|
+
summary = [summary, ...notes].filter(Boolean).join(", ");
|
|
468
|
+
}
|
|
459
469
|
}
|
|
460
470
|
|
|
461
471
|
return summary;
|