Skip to content

Commit 8164387

Browse files
committed
Add new option for including semantic segment counts and fix multibook safety margin naming in availabilities actions
- Introduced `includeSemanticSegmentCounts` option to enhance metadata results. - Renamed `multibookSsafetyMargin` to `multibookSafetyMargin` for consistency in rentable type availabilities. - Updated parsing logic for `wday` filter to handle undefined values correctly.
1 parent 9f6c1d8 commit 8164387

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

components/booking_experts/actions/list-availabilities/list-availabilities.mjs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,16 @@ export default {
4646
description: "Specify a list of channel IDs to be used for searching availability. By default, all accessible channels associated to your app will be used. Overriding this may be useful when you have access to multiple channels of the same administration.",
4747
optional: true,
4848
},
49+
includeSemanticSegmentCounts: {
50+
type: "boolean",
51+
label: "Include Semantic Segment Counts",
52+
description: "When `true`, the amount of results per semantic segment will be added to the metadata",
53+
optional: true,
54+
},
4955
includeAmenityCounts: {
5056
type: "boolean",
5157
label: "Include Amenity Counts",
52-
description: "When true, the amount of results per amenity will be added to the metadata",
58+
description: "When `true`, the amount of results per amenity will be added to the metadata",
5359
optional: true,
5460
},
5561
referrer: {
@@ -475,7 +481,9 @@ export default {
475481
"filter[includes_date]": this.includesDate,
476482
"filter[arrangement]": this.arrangement,
477483
"filter[los]": this.los,
478-
"filter[wday]": parseInt(this.wday),
484+
"filter[wday]": this.wday
485+
? parseInt(this.wday)
486+
: undefined,
479487
"filter[administration_ids]": parseObject(this.administrationIds)?.join(","),
480488
"filter[rentable_type_ids]": parseObject(this.rentableTypeIds)?.join(","),
481489
"filter[-rentable_type_ids]": parseObject(this.excludeRentableTypeIds)?.join(","),

components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default {
6262
description: "Includes list. A list of resources to include. [See the documentation](https://developers.bookingexperts.com/reference/channel-rentabletype-availabilities-index)",
6363
optional: true,
6464
},
65-
multibookSsafetyMargin: {
65+
multibookSafetyMargin: {
6666
type: "integer",
6767
label: "Multi-book Safety Margin",
6868
description: "Specifies a custom multibook safety margin (must be a positive number). A common problem that occurs when dealing with accommodations instead of hotelrooms is that a single accommodation must be available for all consecutive days for a given start date and LOS. The safety margin helps to prevent overbookings by transforming the available stock. When specified, the safety margin is subtracted from the actual stock. It is only applied to RentableType availabilities with capacity of 3 or more, as this issue cannot occur otherwise.",
@@ -84,7 +84,7 @@ export default {
8484
}),
8585
"fields[rentable_type_availability]": parseObject(this.fields)?.join(","),
8686
"include": parseObject(this.include)?.join(","),
87-
"multibook_safety_margin": this.multibookSsafetyMargin,
87+
"multibook_safety_margin": this.multibookSafetyMargin,
8888
},
8989
});
9090
$.export("$summary", `Found ${data.length} rentable type availabilities`);

0 commit comments

Comments
 (0)