tripstorekrabi-shared 1.13.28 → 1.13.30
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 +1 -1
- package/utils.js +11 -4
package/package.json
CHANGED
package/utils.js
CHANGED
|
@@ -14,6 +14,11 @@ dayjs.extend(timezone);
|
|
|
14
14
|
|
|
15
15
|
export const PROD_URL = "https://www.tripstorekrabi.com";
|
|
16
16
|
export const MAX_AGE_SEC = 60 * 60 * 24;
|
|
17
|
+
export const NO_ROOM = 'NO ROOM';
|
|
18
|
+
export const IN_HOUSE = 'IN HOUSE';
|
|
19
|
+
export const CHECK_IN_LATE = 'CHECK-IN LATE';
|
|
20
|
+
export const ROOM_NUMBER_LIST = [NO_ROOM, IN_HOUSE, CHECK_IN_LATE];
|
|
21
|
+
|
|
17
22
|
const EMAIL_PATTERN = new RegExp(/^[a-zA-Z0-9.!#$%&' * +/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/);
|
|
18
23
|
const MEALS = ["lunch", "meal", "breakfast", "dinner"];
|
|
19
24
|
const SCHEDULE_PATTERN = new RegExp('^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$');
|
|
@@ -307,10 +312,12 @@ export function getBookingSummary(booking, options = {}) {
|
|
|
307
312
|
}
|
|
308
313
|
|
|
309
314
|
let hasHotelPickup = isHotelPickup(booking.startingPointDescription);
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
315
|
+
if (hasHotelPickup && booking.roomNumber?.length > 0) {
|
|
316
|
+
if (ROOM_NUMBER_LIST.includes(booking.roomNumber)) {
|
|
317
|
+
summary += ` (${booking.roomNumber})`;
|
|
318
|
+
} else {
|
|
319
|
+
summary += ` (room ${booking.roomNumber})`;
|
|
320
|
+
}
|
|
314
321
|
}
|
|
315
322
|
|
|
316
323
|
summary += ", " + booking.schedule;
|