tripstorekrabi-shared 1.19.5 → 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.
Files changed (2) hide show
  1. package/booking.js +10 -11
  2. 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()).isSameOrBefore(
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
- // check pickup hotel and room number
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
- (!booking.roomNumber || booking.roomNumber === CHECK_IN_LATE)
388
+ booking.roomNumber !== CHECK_IN_LATE &&
389
+ !booking.roomNumber &&
390
390
  ) {
391
391
  todos.roomNumber = "missing";
392
392
  } else if (
@@ -397,8 +397,7 @@ export function createTodos(booking, product) {
397
397
  booking.roomNumber !== KEEP_PRIVATE &&
398
398
  booking.roomNumber !== CHECK_IN_LATE &&
399
399
  booking.roomNumber &&
400
- booking.sentToOperator === true
401
- && !pastTravelDate
400
+ booking.sentToOperator === true &&
402
401
  ) {
403
402
  todos.roomNumber = "sendToOperator";
404
403
  }
@@ -413,7 +412,7 @@ export function createTodos(booking, product) {
413
412
  }
414
413
 
415
414
  // hotel dropoff
416
- if (booking.productDescription.includes('with transfer to hotel')) {
415
+ if (booking.productDescription.includes('with transfer to hotel') && !pastTravelDate) {
417
416
  if ((booking.dropoffHotel ?? "").length === 0) {
418
417
  todos.dropoffHotel = "missing";
419
418
  } else if (!booking.dropoffHotelConfirmed) {
@@ -421,7 +420,7 @@ export function createTodos(booking, product) {
421
420
  }
422
421
  }
423
422
 
424
- if (isAirportPickup(booking.startingPointDescription)) {
423
+ if (isAirportPickup(booking.startingPointDescription) && !pastTravelDate) {
425
424
  if (!booking.flight) {
426
425
  todos.inboundFlightDetails = "missing";
427
426
  } else if (!booking.flightConfirmed) {
@@ -429,7 +428,7 @@ export function createTodos(booking, product) {
429
428
  }
430
429
  }
431
430
 
432
- if (isAirportDropOff(booking.productDescription)) {
431
+ if (isAirportDropOff(booking.productDescription) && !pastTravelDate) {
433
432
  if (!booking.flight) {
434
433
  todos.outboundFlightDetails = "missing";
435
434
  } else if (!booking.flightConfirmed) {
@@ -437,7 +436,7 @@ export function createTodos(booking, product) {
437
436
  }
438
437
  }
439
438
 
440
- if (isTrainStation(booking.startingPointDescription)) {
439
+ if (isTrainStation(booking.startingPointDescription) && !pastTravelDate) {
441
440
  if (!booking.train) {
442
441
  todos.inboundTrainDetails = "missing";
443
442
  } else if (!booking.trainConfirmed) {
@@ -445,7 +444,7 @@ export function createTodos(booking, product) {
445
444
  }
446
445
  }
447
446
 
448
- if (isTrainStation(booking.productDescription)) {
447
+ if (isTrainStation(booking.productDescription) && !pastTravelDate) {
449
448
  if (!booking.train) {
450
449
  todos.outboundTrainDetails = "missing";
451
450
  } else if (!booking.trainConfirmed) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.19.5",
3
+ "version": "1.19.6",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {