-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - booking_experts #18223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8a4945f
wip
michelle0927 420c33b
new components
michelle0927 c16cb97
pnpm-lock.yaml
michelle0927 97483dd
Merge remote-tracking branch 'origin/master' into issue-18055
michelle0927 ba11be3
pnpm-lock.yaml
michelle0927 74d4478
update description
michelle0927 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,4 +8,4 @@ export default { | |
| console.log(Object.keys(this.$auth)); | ||
| }, | ||
| }, | ||
| }; | ||
| }; | ||
96 changes: 96 additions & 0 deletions
96
components/booking_experts/actions/add-guest-to-reservation/add-guest-to-reservation.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| }, | ||
| }; | ||
96 changes: 96 additions & 0 deletions
96
components/booking_experts/actions/create-agenda-period/create-agenda-period.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| }, | ||
| }; |
52 changes: 52 additions & 0 deletions
52
components/booking_experts/actions/get-complex-prices/get-complex-prices.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
78 changes: 78 additions & 0 deletions
78
components/booking_experts/actions/list-bookings/list-bookings.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| }, | ||
| }; |
57 changes: 57 additions & 0 deletions
57
components/booking_experts/actions/list-inventory-objects/list-inventory-objects.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| }, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.