tripstorekrabi-shared 1.13.27 → 1.13.29

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 (3) hide show
  1. package/booking.js +1 -0
  2. package/package.json +1 -1
  3. package/utils.js +8 -4
package/booking.js CHANGED
@@ -62,6 +62,7 @@ export function addBookingFromInvoice(firestore, admin, invoice, paymentData, co
62
62
  comment,
63
63
  customerPaymentStatus: "Paid",
64
64
  operatorPaymentStatus: "Pending",
65
+ extraPayments: {},
65
66
  addOns: item.addOns ?? null,
66
67
  labels: ["NEW"],
67
68
  paypalInvoiceId: "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.13.27",
3
+ "version": "1.13.29",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {
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,9 @@ export function getBookingSummary(booking, options = {}) {
307
312
  }
308
313
 
309
314
  let hasHotelPickup = isHotelPickup(booking.startingPointDescription);
310
- let hasRoomNumber = booking.roomNumber;
311
-
312
- if (hasHotelPickup && hasRoomNumber) {
313
- summary += " (room " + booking.roomNumber + ")";
315
+ if (hasHotelPickup && booking.roomNumber?.length > 0) {
316
+ if (booking.roomNumber)
317
+ summary += " (room " + booking.roomNumber + ")";
314
318
  }
315
319
 
316
320
  summary += ", " + booking.schedule;