tripstorekrabi-shared 1.19.5 → 1.19.7
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/booking.js +5 -6
- package/package.json +1 -1
package/booking.js
CHANGED
|
@@ -367,14 +367,13 @@ export function hasFood(product) {
|
|
|
367
367
|
export function createTodos(booking, product) {
|
|
368
368
|
let todos = {};
|
|
369
369
|
|
|
370
|
-
let pastTravelDate = dayjs(booking.departureDate.toDate()).
|
|
370
|
+
let pastTravelDate = dayjs(booking.departureDate.toDate()).isBefore(
|
|
371
371
|
dayjs().startOf('day'),
|
|
372
372
|
'day'
|
|
373
373
|
);
|
|
374
374
|
|
|
375
375
|
let customerBookingStatus = booking.customerBookingStatus;
|
|
376
|
-
if (customerBookingStatus !== 'Canceled') {
|
|
377
|
-
// check pickup hotel and room number
|
|
376
|
+
if (customerBookingStatus !== 'Canceled' && !pastTravelDate) {
|
|
378
377
|
if (isHotelPickup(booking.startingPointDescription)) {
|
|
379
378
|
if (booking.startingPointDescription === NO_PICKUP_HOTEL_YET) {
|
|
380
379
|
todos.pickupHotel = "missing";
|
|
@@ -386,7 +385,8 @@ export function createTodos(booking, product) {
|
|
|
386
385
|
booking.roomNumber !== IN_HOUSE &&
|
|
387
386
|
booking.roomNumber !== STAY_NEARBY &&
|
|
388
387
|
booking.roomNumber !== KEEP_PRIVATE &&
|
|
389
|
-
|
|
388
|
+
booking.roomNumber !== CHECK_IN_LATE &&
|
|
389
|
+
!booking.roomNumber
|
|
390
390
|
) {
|
|
391
391
|
todos.roomNumber = "missing";
|
|
392
392
|
} else if (
|
|
@@ -398,13 +398,12 @@ export function createTodos(booking, product) {
|
|
|
398
398
|
booking.roomNumber !== CHECK_IN_LATE &&
|
|
399
399
|
booking.roomNumber &&
|
|
400
400
|
booking.sentToOperator === true
|
|
401
|
-
&& !pastTravelDate
|
|
402
401
|
) {
|
|
403
402
|
todos.roomNumber = "sendToOperator";
|
|
404
403
|
}
|
|
405
404
|
}
|
|
406
405
|
|
|
407
|
-
if (product && hasFood(product)
|
|
406
|
+
if (product && hasFood(product)) {
|
|
408
407
|
if (!booking.dietary) {
|
|
409
408
|
todos.dietary = "missing";
|
|
410
409
|
} else if (!booking.dietaryConfirmed && booking.dietary?.length > 0 && booking.dietary !== 'None' && booking.sentToOperator === true) {
|