tripstorekrabi-shared 1.21.2 → 1.21.4

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/package.json +2 -2
  2. package/utils.js +9 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.21.2",
3
+ "version": "1.21.4",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "dayjs": "^1.11.13",
20
- "libphonenumber-js": "^1.12.12",
20
+ "libphonenumber-js": "^1.12.13",
21
21
  "nanoid": "^5.1.5"
22
22
  },
23
23
  "scripts": {
package/utils.js CHANGED
@@ -695,39 +695,39 @@ export function createVoucherRequest(booking, product) {
695
695
  }
696
696
 
697
697
  export function isGYGBooking(otaPartnerRef) {
698
- return otaPartnerRef.id === GYG_AGENCY_ID;
698
+ return otaPartnerRef?.id === GYG_AGENCY_ID;
699
699
  }
700
700
 
701
701
  export function isViatorBooking(otaPartnerRef) {
702
- return otaPartnerRef.id === VIATOR_AGENCY_ID;
702
+ return otaPartnerRef?.id === VIATOR_AGENCY_ID;
703
703
  }
704
704
 
705
705
  export function isExpediaBooking(otaPartnerRef) {
706
- return otaPartnerRef.id === EXP_AGENCY_ID;
706
+ return otaPartnerRef?.id === EXP_AGENCY_ID;
707
707
  }
708
708
 
709
709
  export function isKlookBooking(otaPartnerRef) {
710
- return otaPartnerRef.id === KLK_AGENCY_ID;
710
+ return otaPartnerRef?.id === KLK_AGENCY_ID;
711
711
  }
712
712
 
713
713
  export function isMusementBooking(otaPartnerRef) {
714
- return otaPartnerRef.id === MUS_AGENCY_ID;
714
+ return otaPartnerRef?.id === MUS_AGENCY_ID;
715
715
  }
716
716
 
717
717
  export function isTiqetsBooking(otaPartnerRef) {
718
- return otaPartnerRef.id === TIQ_AGENCY_ID;
718
+ return otaPartnerRef?.id === TIQ_AGENCY_ID;
719
719
  }
720
720
 
721
721
  export function isCivitatisBooking(otaPartnerRef) {
722
- return otaPartnerRef.id === CIV_AGENCY_ID;
722
+ return otaPartnerRef?.id === CIV_AGENCY_ID;
723
723
  }
724
724
 
725
725
  export function isCuriosidad(otaPartnerRef) {
726
- return otaPartnerRef.id === CUR_AGENCY_ID
726
+ return otaPartnerRef?.id === CUR_AGENCY_ID
727
727
  }
728
728
 
729
729
  export function isTSKBooking(otaPartnerRef) {
730
- return otaPartnerRef.id === TRIPSTORE_AGENCY_ID;
730
+ return !otaPartnerRef || otaPartnerRef.id === TRIPSTORE_AGENCY_ID;
731
731
  }
732
732
 
733
733
  export function getBookingType(referenceNumber) {