Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/afosto/afosto.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import bookingExperts from "../../booking_experts.app.mjs";

export default {
key: "booking_experts-add-guest-to-reservation",
name: "Add Guest to Reservation",
description: "Add a guest to a reservation.. [See the documentation](https://developers.bookingexperts.com/reference/administration-reservation-guests-create)",
version: "0.0.1",
type: "action",
props: {
bookingExperts,
administrationId: {
propDefinition: [
bookingExperts,
"administrationId",
],
},
reservationId: {
propDefinition: [
bookingExperts,
"reservationId",
(c) => ({
administrationId: c.administrationId,
}),
],
},
firstName: {
type: "string",
label: "First Name",
description: "The first name of the guest",
},
lastName: {
type: "string",
label: "Last Name",
description: "The last name of the guest",
},
email: {
type: "string",
label: "Email",
description: "The email of the guest",
optional: true,
},
phone: {
type: "string",
label: "Phone",
description: "The phone number of the guest",
optional: true,
},
address: {
type: "string",
label: "Address",
description: "The street address of the guest",
optional: true,
},
city: {
type: "string",
label: "City",
description: "The city of the guest",
optional: true,
},
postalCode: {
type: "string",
label: "Postal Code",
description: "The postal code of the guest",
optional: true,
},
countryCode: {
type: "string",
label: "Country Code",
description: "The country code of the guest",
optional: true,
},
},
async run({ $ }) {
const { data } = await this.bookingExperts.addGuestToReservation({
administrationId: this.administrationId,
reservationId: this.reservationId,
data: {
data: {
type: "guest",
attributes: {
first_name: this.firstName,
last_name: this.lastName,
email: this.email,
phone: this.phone,
address: this.address,
city: this.city,
postal_code: this.postalCode,
country_code: this.countryCode,
},
},
},
});
$.export("$summary", "Guest added to reservation");
return data;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import bookingExperts from "../../booking_experts.app.mjs";

export default {
key: "booking_experts-create-agenda-period",
name: "Create Agenda Period",
description: "Creates a new agenda period. [See the documentation](https://developers.bookingexperts.com/reference/administration-maintenance-agenda-periods-create)",
version: "0.0.1",
type: "action",
props: {
bookingExperts,
administrationId: {
propDefinition: [
bookingExperts,
"administrationId",
],
},
type: {
type: "string",
label: "Type",
description: "The type of agenda period to create",
options: [
"maintenance_agenda_periods",
"external_blocked_agenda_periods",
],
},
label: {
type: "string",
label: "Label",
description: "The label of the agenda period",
},
startDate: {
type: "string",
label: "Start Date",
description: "The start date of the agenda period. Example: `2025-08-28`",
},
endDate: {
type: "string",
label: "End Date",
description: "The end date of the agenda period",
},
inventoryObjectId: {
propDefinition: [
bookingExperts,
"inventoryObjectId",
(c) => ({
administrationId: c.administrationId,
}),
],
},
rentableId: {
propDefinition: [
bookingExperts,
"rentableId",
(c) => ({
administrationId: c.administrationId,
inventoryObjectId: c.inventoryObjectId,
}),
],
},
},
async run({ $ }) {
const { data } = await this.bookingExperts.createAgendaPeriod({
$,
administrationId: this.administrationId,
type: this.type,
data: {
data: {
type: "agenda_period",
attributes: {
label: this.label,
start_date: this.startDate,
end_date: this.endDate,
},
relationships: {
inventory_object: this.inventoryObjectId
? {
data: {
type: "inventory_object",
id: this.inventoryObjectId,
},
}
: undefined,
rentable: {
data: {
type: "rentable",
id: this.rentableId,
},
},
},
},
},
});
$.export("$summary", "Agenda period created");
return data;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import bookingExperts from "../../booking_experts.app.mjs";

export default {
key: "booking_experts-get-complex-prices",
name: "Get Complex Prices",
description: "Returns all complex prices of a master price list. [See the documentation](https://developers.bookingexperts.com/reference/administration-masterpricelist-complexprices-index)",
version: "0.0.1",
type: "action",
props: {
bookingExperts,
administrationId: {
propDefinition: [
bookingExperts,
"administrationId",
],
},
masterPriceListId: {
propDefinition: [
bookingExperts,
"masterPriceListId",
(c) => ({
administrationId: c.administrationId,
}),
],
},
page: {
propDefinition: [
bookingExperts,
"page",
],
},
perPage: {
propDefinition: [
bookingExperts,
"perPage",
],
},
},
async run({ $ }) {
const { data } = await this.bookingExperts.getComplexPrices({
$,
administrationId: this.administrationId,
masterPriceListId: this.masterPriceListId,
params: {
"page[number]": this.page,
"page[size]": this.perPage,
},
});
$.export("$summary", `Found ${data.length} complex prices`);
return data;
},
};
78 changes: 78 additions & 0 deletions components/booking_experts/actions/list-bookings/list-bookings.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import bookingExperts from "../../booking_experts.app.mjs";

export default {
key: "booking_experts-list-bookings",
name: "List Bookings",
description: "Returns a list of bookings for an administration. [See the documentation](https://developers.bookingexperts.com/reference/administration-bookings-index)",
version: "0.0.1",
type: "action",
props: {
bookingExperts,
administrationId: {
propDefinition: [
bookingExperts,
"administrationId",
],
},
ownerId: {
propDefinition: [
bookingExperts,
"ownerId",
(c) => ({
administrationId: c.administrationId,
}),
],
description: "Filter by owner",
},
channelId: {
propDefinition: [
bookingExperts,
"channelId",
(c) => ({
administrationId: c.administrationId,
}),
],
description: "Filter by channel",
},
reservationId: {
propDefinition: [
bookingExperts,
"reservationId",
(c) => ({
administrationId: c.administrationId,
}),
],
description: "Filter by reservation",
optional: true,
},
page: {
propDefinition: [
bookingExperts,
"page",
],
},
perPage: {
propDefinition: [
bookingExperts,
"perPage",
],
},
},
async run({ $ }) {
const { data } = await this.bookingExperts.listBookings({
$,
administrationId: this.administrationId,
params: {
"filter[owner]": this.ownerId,
"filter[channel]": this.channelId,
"filter[reservations]": this.reservationId,
"filter[created_at]": this.createdAt,
"filter[updated_at]": this.updatedAt,
"page[number]": this.page,
"page[size]": this.perPage,
},
});
$.export("$summary", `Found ${data.length} bookings`);
return data;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import bookingExperts from "../../booking_experts.app.mjs";

export default {
key: "booking_experts-list-inventory-objects",
name: "List Inventory Objects",
description: "Returns inventory objects of the administration. [See the documentation](https://developers.bookingexperts.com/reference/administration-inventoryobjects-index)",
version: "0.0.1",
type: "action",
props: {
bookingExperts,
administrationId: {
propDefinition: [
bookingExperts,
"administrationId",
],
},
name: {
type: "string",
label: "Name",
description: "Filter by name",
optional: true,
},
labels: {
type: "string[]",
label: "Labels",
description: "Filter by labels",
optional: true,
},
page: {
propDefinition: [
bookingExperts,
"page",
],
},
perPage: {
propDefinition: [
bookingExperts,
"perPage",
],
},
},
async run({ $ }) {
const { data } = await this.bookingExperts.listInventoryObjects({
administrationId: this.administrationId,
params: {
"filter[name]": this.name,
"filter[labels]": this.labels
? this.labels.join(",")
: undefined,
"page[number]": this.page,
"page[size]": this.perPage,
},
});
$.export("$summary", `Found ${data.length} inventory objects`);
return data;
},
};
Loading
Loading