tripstorekrabi-shared 1.19.4 → 1.19.6
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 +11 -11
- package/package.json +1 -1
package/booking.js
CHANGED
|
@@ -367,15 +367,14 @@ 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
376
|
if (customerBookingStatus !== 'Canceled') {
|
|
377
|
-
|
|
378
|
-
if (isHotelPickup(booking.startingPointDescription)) {
|
|
377
|
+
if (isHotelPickup(booking.startingPointDescription) && !pastTravelDate) {
|
|
379
378
|
if (booking.startingPointDescription === NO_PICKUP_HOTEL_YET) {
|
|
380
379
|
todos.pickupHotel = "missing";
|
|
381
380
|
}
|
|
@@ -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 (
|
|
@@ -396,8 +396,8 @@ export function createTodos(booking, product) {
|
|
|
396
396
|
booking.roomNumber !== STAY_NEARBY &&
|
|
397
397
|
booking.roomNumber !== KEEP_PRIVATE &&
|
|
398
398
|
booking.roomNumber !== CHECK_IN_LATE &&
|
|
399
|
-
booking.
|
|
400
|
-
&&
|
|
399
|
+
booking.roomNumber &&
|
|
400
|
+
booking.sentToOperator === true &&
|
|
401
401
|
) {
|
|
402
402
|
todos.roomNumber = "sendToOperator";
|
|
403
403
|
}
|
|
@@ -412,7 +412,7 @@ export function createTodos(booking, product) {
|
|
|
412
412
|
}
|
|
413
413
|
|
|
414
414
|
// hotel dropoff
|
|
415
|
-
if (booking.productDescription.includes('with transfer to hotel')) {
|
|
415
|
+
if (booking.productDescription.includes('with transfer to hotel') && !pastTravelDate) {
|
|
416
416
|
if ((booking.dropoffHotel ?? "").length === 0) {
|
|
417
417
|
todos.dropoffHotel = "missing";
|
|
418
418
|
} else if (!booking.dropoffHotelConfirmed) {
|
|
@@ -420,7 +420,7 @@ export function createTodos(booking, product) {
|
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
|
|
423
|
-
if (isAirportPickup(booking.startingPointDescription)) {
|
|
423
|
+
if (isAirportPickup(booking.startingPointDescription) && !pastTravelDate) {
|
|
424
424
|
if (!booking.flight) {
|
|
425
425
|
todos.inboundFlightDetails = "missing";
|
|
426
426
|
} else if (!booking.flightConfirmed) {
|
|
@@ -428,7 +428,7 @@ export function createTodos(booking, product) {
|
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
-
if (isAirportDropOff(booking.productDescription)) {
|
|
431
|
+
if (isAirportDropOff(booking.productDescription) && !pastTravelDate) {
|
|
432
432
|
if (!booking.flight) {
|
|
433
433
|
todos.outboundFlightDetails = "missing";
|
|
434
434
|
} else if (!booking.flightConfirmed) {
|
|
@@ -436,7 +436,7 @@ export function createTodos(booking, product) {
|
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
438
|
|
|
439
|
-
if (isTrainStation(booking.startingPointDescription)) {
|
|
439
|
+
if (isTrainStation(booking.startingPointDescription) && !pastTravelDate) {
|
|
440
440
|
if (!booking.train) {
|
|
441
441
|
todos.inboundTrainDetails = "missing";
|
|
442
442
|
} else if (!booking.trainConfirmed) {
|
|
@@ -444,7 +444,7 @@ export function createTodos(booking, product) {
|
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
-
if (isTrainStation(booking.productDescription)) {
|
|
447
|
+
if (isTrainStation(booking.productDescription) && !pastTravelDate) {
|
|
448
448
|
if (!booking.train) {
|
|
449
449
|
todos.outboundTrainDetails = "missing";
|
|
450
450
|
} else if (!booking.trainConfirmed) {
|