tripstorekrabi-shared 1.21.6 → 1.21.8
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 +8 -5
- package/ota.js +2 -2
- package/package.json +1 -1
package/booking.js
CHANGED
|
@@ -193,11 +193,14 @@ export function getOperatorSignature(agent, operatorName, contact) {
|
|
|
193
193
|
|
|
194
194
|
export function buildIndex(id, booking) {
|
|
195
195
|
let referenceNumbers = [booking.referenceNumber];
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
196
|
+
|
|
197
|
+
(booking.expediaVoucherNumbers ?? []).forEach((item) => {
|
|
198
|
+
referenceNumbers.push(item + '');
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
(booking.musementCodes ?? []).forEach((item) => {
|
|
202
|
+
referenceNumbers.push(item + '');
|
|
203
|
+
});
|
|
201
204
|
|
|
202
205
|
let travellers = [booking.leadTraveller];
|
|
203
206
|
if (booking.travellers) {
|
package/ota.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function isCommissionable(operatorId, booking, otas) {
|
|
1
|
+
export function isCommissionable(operatorId, booking, otas, defaultValue = true) {
|
|
2
2
|
let ota = otas.find((item) => booking.referenceNumber.startsWith(item.bookingPrefix));
|
|
3
3
|
|
|
4
4
|
// stop checking if it's not an OTA booking
|
|
@@ -20,5 +20,5 @@ export function isCommissionable(operatorId, booking, otas) {
|
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
return account?.commissionable ??
|
|
23
|
+
return account?.commissionable ?? defaultValue;
|
|
24
24
|
}
|