Skip to content

Commit 35984e1

Browse files
authored
Merging pull request #18223
* wip * new components * pnpm-lock.yaml * pnpm-lock.yaml * update description
1 parent 60512b4 commit 35984e1

File tree

15 files changed

+976
-8
lines changed

15 files changed

+976
-8
lines changed

components/afosto/afosto.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
import bookingExperts from "../../booking_experts.app.mjs";
2+
3+
export default {
4+
key: "booking_experts-add-guest-to-reservation",
5+
name: "Add Guest to Reservation",
6+
description: "Add a guest to a reservation.. [See the documentation](https://developers.bookingexperts.com/reference/administration-reservation-guests-create)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
bookingExperts,
11+
administrationId: {
12+
propDefinition: [
13+
bookingExperts,
14+
"administrationId",
15+
],
16+
},
17+
reservationId: {
18+
propDefinition: [
19+
bookingExperts,
20+
"reservationId",
21+
(c) => ({
22+
administrationId: c.administrationId,
23+
}),
24+
],
25+
},
26+
firstName: {
27+
type: "string",
28+
label: "First Name",
29+
description: "The first name of the guest",
30+
},
31+
lastName: {
32+
type: "string",
33+
label: "Last Name",
34+
description: "The last name of the guest",
35+
},
36+
email: {
37+
type: "string",
38+
label: "Email",
39+
description: "The email of the guest",
40+
optional: true,
41+
},
42+
phone: {
43+
type: "string",
44+
label: "Phone",
45+
description: "The phone number of the guest",
46+
optional: true,
47+
},
48+
address: {
49+
type: "string",
50+
label: "Address",
51+
description: "The street address of the guest",
52+
optional: true,
53+
},
54+
city: {
55+
type: "string",
56+
label: "City",
57+
description: "The city of the guest",
58+
optional: true,
59+
},
60+
postalCode: {
61+
type: "string",
62+
label: "Postal Code",
63+
description: "The postal code of the guest",
64+
optional: true,
65+
},
66+
countryCode: {
67+
type: "string",
68+
label: "Country Code",
69+
description: "The country code of the guest",
70+
optional: true,
71+
},
72+
},
73+
async run({ $ }) {
74+
const { data } = await this.bookingExperts.addGuestToReservation({
75+
administrationId: this.administrationId,
76+
reservationId: this.reservationId,
77+
data: {
78+
data: {
79+
type: "guest",
80+
attributes: {
81+
first_name: this.firstName,
82+
last_name: this.lastName,
83+
email: this.email,
84+
phone: this.phone,
85+
address: this.address,
86+
city: this.city,
87+
postal_code: this.postalCode,
88+
country_code: this.countryCode,
89+
},
90+
},
91+
},
92+
});
93+
$.export("$summary", "Guest added to reservation");
94+
return data;
95+
},
96+
};
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
import bookingExperts from "../../booking_experts.app.mjs";
2+
3+
export default {
4+
key: "booking_experts-create-agenda-period",
5+
name: "Create Agenda Period",
6+
description: "Creates a new agenda period. [See the documentation](https://developers.bookingexperts.com/reference/administration-maintenance-agenda-periods-create)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
bookingExperts,
11+
administrationId: {
12+
propDefinition: [
13+
bookingExperts,
14+
"administrationId",
15+
],
16+
},
17+
type: {
18+
type: "string",
19+
label: "Type",
20+
description: "The type of agenda period to create",
21+
options: [
22+
"maintenance_agenda_periods",
23+
"external_blocked_agenda_periods",
24+
],
25+
},
26+
label: {
27+
type: "string",
28+
label: "Label",
29+
description: "The label of the agenda period",
30+
},
31+
startDate: {
32+
type: "string",
33+
label: "Start Date",
34+
description: "The start date of the agenda period. Example: `2025-08-28`",
35+
},
36+
endDate: {
37+
type: "string",
38+
label: "End Date",
39+
description: "The end date of the agenda period",
40+
},
41+
inventoryObjectId: {
42+
propDefinition: [
43+
bookingExperts,
44+
"inventoryObjectId",
45+
(c) => ({
46+
administrationId: c.administrationId,
47+
}),
48+
],
49+
},
50+
rentableId: {
51+
propDefinition: [
52+
bookingExperts,
53+
"rentableId",
54+
(c) => ({
55+
administrationId: c.administrationId,
56+
inventoryObjectId: c.inventoryObjectId,
57+
}),
58+
],
59+
},
60+
},
61+
async run({ $ }) {
62+
const { data } = await this.bookingExperts.createAgendaPeriod({
63+
$,
64+
administrationId: this.administrationId,
65+
type: this.type,
66+
data: {
67+
data: {
68+
type: "agenda_period",
69+
attributes: {
70+
label: this.label,
71+
start_date: this.startDate,
72+
end_date: this.endDate,
73+
},
74+
relationships: {
75+
inventory_object: this.inventoryObjectId
76+
? {
77+
data: {
78+
type: "inventory_object",
79+
id: this.inventoryObjectId,
80+
},
81+
}
82+
: undefined,
83+
rentable: {
84+
data: {
85+
type: "rentable",
86+
id: this.rentableId,
87+
},
88+
},
89+
},
90+
},
91+
},
92+
});
93+
$.export("$summary", "Agenda period created");
94+
return data;
95+
},
96+
};
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import bookingExperts from "../../booking_experts.app.mjs";
2+
3+
export default {
4+
key: "booking_experts-get-complex-prices",
5+
name: "Get Complex Prices",
6+
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.1",
8+
type: "action",
9+
props: {
10+
bookingExperts,
11+
administrationId: {
12+
propDefinition: [
13+
bookingExperts,
14+
"administrationId",
15+
],
16+
},
17+
masterPriceListId: {
18+
propDefinition: [
19+
bookingExperts,
20+
"masterPriceListId",
21+
(c) => ({
22+
administrationId: c.administrationId,
23+
}),
24+
],
25+
},
26+
page: {
27+
propDefinition: [
28+
bookingExperts,
29+
"page",
30+
],
31+
},
32+
perPage: {
33+
propDefinition: [
34+
bookingExperts,
35+
"perPage",
36+
],
37+
},
38+
},
39+
async run({ $ }) {
40+
const { data } = await this.bookingExperts.getComplexPrices({
41+
$,
42+
administrationId: this.administrationId,
43+
masterPriceListId: this.masterPriceListId,
44+
params: {
45+
"page[number]": this.page,
46+
"page[size]": this.perPage,
47+
},
48+
});
49+
$.export("$summary", `Found ${data.length} complex prices`);
50+
return data;
51+
},
52+
};
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import bookingExperts from "../../booking_experts.app.mjs";
2+
3+
export default {
4+
key: "booking_experts-list-bookings",
5+
name: "List Bookings",
6+
description: "Returns a list of bookings for an administration. [See the documentation](https://developers.bookingexperts.com/reference/administration-bookings-index)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
bookingExperts,
11+
administrationId: {
12+
propDefinition: [
13+
bookingExperts,
14+
"administrationId",
15+
],
16+
},
17+
ownerId: {
18+
propDefinition: [
19+
bookingExperts,
20+
"ownerId",
21+
(c) => ({
22+
administrationId: c.administrationId,
23+
}),
24+
],
25+
description: "Filter by owner",
26+
},
27+
channelId: {
28+
propDefinition: [
29+
bookingExperts,
30+
"channelId",
31+
(c) => ({
32+
administrationId: c.administrationId,
33+
}),
34+
],
35+
description: "Filter by channel",
36+
},
37+
reservationId: {
38+
propDefinition: [
39+
bookingExperts,
40+
"reservationId",
41+
(c) => ({
42+
administrationId: c.administrationId,
43+
}),
44+
],
45+
description: "Filter by reservation",
46+
optional: true,
47+
},
48+
page: {
49+
propDefinition: [
50+
bookingExperts,
51+
"page",
52+
],
53+
},
54+
perPage: {
55+
propDefinition: [
56+
bookingExperts,
57+
"perPage",
58+
],
59+
},
60+
},
61+
async run({ $ }) {
62+
const { data } = await this.bookingExperts.listBookings({
63+
$,
64+
administrationId: this.administrationId,
65+
params: {
66+
"filter[owner]": this.ownerId,
67+
"filter[channel]": this.channelId,
68+
"filter[reservations]": this.reservationId,
69+
"filter[created_at]": this.createdAt,
70+
"filter[updated_at]": this.updatedAt,
71+
"page[number]": this.page,
72+
"page[size]": this.perPage,
73+
},
74+
});
75+
$.export("$summary", `Found ${data.length} bookings`);
76+
return data;
77+
},
78+
};
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import bookingExperts from "../../booking_experts.app.mjs";
2+
3+
export default {
4+
key: "booking_experts-list-inventory-objects",
5+
name: "List Inventory Objects",
6+
description: "Returns inventory objects of the administration. [See the documentation](https://developers.bookingexperts.com/reference/administration-inventoryobjects-index)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
bookingExperts,
11+
administrationId: {
12+
propDefinition: [
13+
bookingExperts,
14+
"administrationId",
15+
],
16+
},
17+
name: {
18+
type: "string",
19+
label: "Name",
20+
description: "Filter by name",
21+
optional: true,
22+
},
23+
labels: {
24+
type: "string[]",
25+
label: "Labels",
26+
description: "Filter by labels",
27+
optional: true,
28+
},
29+
page: {
30+
propDefinition: [
31+
bookingExperts,
32+
"page",
33+
],
34+
},
35+
perPage: {
36+
propDefinition: [
37+
bookingExperts,
38+
"perPage",
39+
],
40+
},
41+
},
42+
async run({ $ }) {
43+
const { data } = await this.bookingExperts.listInventoryObjects({
44+
administrationId: this.administrationId,
45+
params: {
46+
"filter[name]": this.name,
47+
"filter[labels]": this.labels
48+
? this.labels.join(",")
49+
: undefined,
50+
"page[number]": this.page,
51+
"page[size]": this.perPage,
52+
},
53+
});
54+
$.export("$summary", `Found ${data.length} inventory objects`);
55+
return data;
56+
},
57+
};

0 commit comments

Comments
 (0)