Skip to content

Commit a03922e

Browse files
mannie55ona-agentmichelle0927
authored
Be amenities and rentable types (#19387)
* Add amenities and rentable types actions to Booking Experts - Add listAmenities() method to fetch all amenities - Add getAmenity() method to fetch single amenity by ID - Add listRentableTypesForAdmin() method to list rentable types for administration - Create get_amenity action - Create list_amenities action - Create list_rentable_types action Co-authored-by: Ona <no-reply@ona.com> * Fix bugs in Booking Experts amenities and rentable types actions - Fix parameter name typo in listAmenities (opt -> opts) - Fix import path in list_amenities action - Fix parameter name in getAmenity (id -> amenityId) - Fix method name in list_rentable_types (listRentableTypes -> listRentableTypesForAdmin) - Fix parameter name in list_rentable_types (query -> params) - Rename misspelled file list_amennities.mjs to list_amenities.mjs - Add missing implementation to get_amenity and list_rentable_types actions Co-authored-by: Ona <no-reply@ona.com> * Fix code style and conventions in Booking Experts actions - Rename directories to use hyphens (get-amenity, list-amenities, list-rentable-types) - Add documentation links to get-amenity and list-rentable-types descriptions - Update list-amenities to use propDefinitions for page and perPage props - Fix property order in get-amenity (move annotations before type) - Fix indentation in list-amenities (use 2-space indentation) - Standardize summary formatting in list-rentable-types All actions now follow established codebase conventions. Co-authored-by: Ona <no-reply@ona.com> * updates * versions * update --------- Co-authored-by: Ona <no-reply@ona.com> Co-authored-by: Michelle Bergeron <michelle.bergeron@gmail.com> Co-authored-by: michelle0927 <michelle0927@users.noreply.github.com>
1 parent b58e280 commit a03922e

File tree

23 files changed

+309
-30
lines changed

23 files changed

+309
-30
lines changed

components/booking_experts/actions/add-guest-to-reservation/add-guest-to-reservation.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Add Guest to Reservation",
66
description:
77
"Add a guest to a reservation. [See the documentation](https://developers.bookingexperts.com/reference/administration-reservation-guests-create)",
8-
version: "0.0.7",
8+
version: "0.0.8",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/booking_experts/actions/create-agenda-period/create-agenda-period.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "booking_experts-create-agenda-period",
55
name: "Create Agenda Period",
66
description: "Creates a new agenda period. [See the documentation](https://developers.bookingexperts.com/reference/administration-maintenance-agenda-periods-create)",
7-
version: "0.0.6",
7+
version: "0.0.7",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/booking_experts/actions/delete-guest/delete-guest.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "booking_experts-delete-guest",
55
name: "Delete Guest",
66
description: "Delete a guest for a reservation. [See the documentation](https://developers.bookingexperts.com/reference/administration-reservation-guests-delete)",
7-
version: "0.0.4",
7+
version: "0.0.5",
88
annotations: {
99
destructiveHint: true,
1010
openWorldHint: true,
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import bookingExperts from "../../booking_experts.app.mjs";
2+
3+
export default {
4+
key: "booking_experts-get-amenity",
5+
name: "Get Amenity",
6+
description: "Retrieve a single amenity by ID. [See the documentation](https://developers.bookingexperts.com/reference/amenities-show)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
bookingExperts,
16+
amenityId: {
17+
propDefinition: [
18+
bookingExperts,
19+
"amenityId",
20+
],
21+
},
22+
},
23+
async run({ $ }) {
24+
const { data } = await this.bookingExperts.getAmenity({
25+
$,
26+
amenityId: this.amenityId,
27+
});
28+
29+
$.export("$summary", `Successfully retrieved amenity ${this.amenityId}`);
30+
return data;
31+
},
32+
};

components/booking_experts/actions/get-booking/get-booking.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "booking_experts-get-booking",
55
name: "Get Booking",
66
description: "Returns a booking. [See the documentation](https://developers.bookingexperts.com/reference/administration-bookings-show)",
7-
version: "0.0.4",
7+
version: "0.0.5",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/booking_experts/actions/get-complex-prices/get-complex-prices.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "booking_experts-get-complex-prices",
55
name: "Get Complex Prices",
66
description: "Returns all complex prices of a master price list. [See the documentation](https://developers.bookingexperts.com/reference/administration-masterpricelist-complexprices-index)",
7-
version: "0.0.6",
7+
version: "0.0.7",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/booking_experts/actions/get-reservation/get-reservation.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
name: "Get Reservation",
55
description: "Fetches a reservation by ID from Booking Experts. [See the documentation](https://developers.bookingexperts.com/reference/reservations-show)",
66
key: "booking_experts-get-reservation",
7-
version: "0.0.3",
7+
version: "0.0.4",
88
type: "action",
99
annotations: {
1010
destructiveHint: false,
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
import bookingExperts from "../../booking_experts.app.mjs";
2+
3+
export default {
4+
key: "booking_experts-list-amenities",
5+
name: "List Amenities",
6+
description: "List amenities from BookingExperts. [See the documentation](https://developers.bookingexperts.com/reference/amenities-index)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
bookingExperts,
16+
page: {
17+
propDefinition: [
18+
bookingExperts,
19+
"page",
20+
],
21+
},
22+
perPage: {
23+
propDefinition: [
24+
bookingExperts,
25+
"perPage",
26+
],
27+
},
28+
sort: {
29+
propDefinition: [
30+
bookingExperts,
31+
"sort",
32+
],
33+
},
34+
fields: {
35+
propDefinition: [
36+
bookingExperts,
37+
"fields",
38+
],
39+
},
40+
include: {
41+
propDefinition: [
42+
bookingExperts,
43+
"include",
44+
],
45+
},
46+
name: {
47+
type: "string",
48+
label: "Name",
49+
description: "Filter by name",
50+
optional: true,
51+
},
52+
type: {
53+
type: "string",
54+
label: "Type",
55+
description: "Filter by type",
56+
optional: true,
57+
},
58+
position: {
59+
type: "string",
60+
label: "Position",
61+
description: "Filter by position",
62+
optional: true,
63+
},
64+
semanticAmenityType: {
65+
type: "string",
66+
label: "Semantic Amenity Type",
67+
description: "Filter by semantic amenity type",
68+
optional: true,
69+
},
70+
amenityGroup: {
71+
propDefinition: [
72+
bookingExperts,
73+
"amenityGroupId",
74+
],
75+
optional: true,
76+
},
77+
amenityOptions: {
78+
type: "string",
79+
label: "Amenity Options",
80+
description: "Filter on amenity_options. Specify a comma separated list of IDs to filter on.",
81+
optional: true,
82+
},
83+
},
84+
async run({ $ }) {
85+
const params = {
86+
"page[number]": this.page,
87+
"page[size]": this.perPage,
88+
"sort": this.sort,
89+
"fields[amenity]": this.fields,
90+
"include": this.include,
91+
"filter[name]": this.name,
92+
"filter[type]": this.type,
93+
"filter[position]": this.position,
94+
"filter[semantic_amenity_type]": this.semanticAmenityType,
95+
"filter[amenity_group]": this.amenityGroup,
96+
"filter[amenity_options]": this.amenityOptions,
97+
};
98+
99+
const { data } = await this.bookingExperts.listAmenities({
100+
$,
101+
params,
102+
});
103+
104+
$.export("$summary", `Successfully retrieved ${data?.length ?? 0} amenities`);
105+
106+
return data;
107+
},
108+
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default {
1010
key: "booking_experts-list-availabilities",
1111
name: "List Availabilities",
1212
description: "List availabilities of a channel you have access to. [See the documentation](https://developers.bookingexperts.com/reference/availabilities-index)",
13-
version: "0.0.4",
13+
version: "0.0.5",
1414
annotations: {
1515
destructiveHint: false,
1616
openWorldHint: true,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "booking_experts-list-bookings",
55
name: "List Bookings",
66
description: "Returns a list of bookings for an administration. [See the documentation](https://developers.bookingexperts.com/reference/administration-bookings-index)",
7-
version: "0.0.6",
7+
version: "0.0.7",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

0 commit comments

Comments
 (0)