Skip to content

feat(wp-hotel-booking): add WP Hotel Booking integration - #244

Open
RishadAlam wants to merge 13 commits into
mainfrom
feat/wp-hotel-booking
Open

RishadAlam wants to merge 13 commits into
mainfrom
feat/wp-hotel-booking

Conversation

@RishadAlam

@RishadAlam RishadAlam commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Description

Adds WP Hotel Booking (ThimPress) as a Pro integration in Bit Integrations Free. The PR adds the action settings screen for 24 actions, the dropdown routes, and the hooks that pass each run to Bit Integrations Pro. It also registers the 12 Pro triggers so they show in the trigger list. The action and trigger logic is in the matching Pro PR: bit-apps-pro/bit-integrations-pro#164.

Motivation & Context

WP Hotel Booking is in Bit Flows (bit-apps-pro/bit-pi#883). This PR ports its WordPress-hook triggers and its write actions to Bit Integrations.

The following were left out on purpose:

  • Read actions: Get Booking, Get Room and Check Room Availability. Their data goes into dropdowns instead.

Related Links: (if applicable)

  • Bit Flows source: bit-apps-pro/bit-pi#883
  • Pro side: bit-apps-pro/bit-integrations-pro#164

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📚 Documentation update
  • ⚡ Improvement
  • 🔄 Code refactor

Key Changes

Integrations

  • Added the 24 Pro actions, all listed in the action dropdown:
    • Bookings: Create Booking, Update Booking Status, Update Booking Customer, Update Booking Note, Mark Payment Complete, Delete Booking, Add Room to Booking, Remove Booking Item.
    • Coupons: Create Coupon, Update Coupon, Delete Coupon, Apply Coupon to Booking, Remove Coupon from Booking.
    • Rooms: Create Room, Update Room, Delete Room, Set Room Regular Price, Add Seasonal Pricing Plan, Create Room Type.
    • Extras: Create Extra, Update Extra, Delete Extra, Assign Extras to Room.
    • Reviews: Add Room Review.
  • Added WpHotelBookingController with the refresh_wp_hotel_booking_{rooms,coupons,extras,room_types,payment_methods} routes and the plugin check (WPHB_VERSION).
  • Added RecordApiHelper. It builds the field data, joins a mapped array value into one comma-separated string, and fires one wp_hotel_booking_* hook per action with only the arguments that action reads. It logs every run with LogHandler.
  • Registered WP Hotel Booking in AllTriggersName (Pro) and in customFormIntegrations, so the flow edit page opens the custom trigger editor.

Frontend

  • Added the WP Hotel Booking screens, built from data in staticData.js:
    • Field map: the record IDs, names, dates, prices and counts. Each action adds its required fields to the map.
    • Dropdowns: room, booking status, discount type, coupon and a multi-select for extras, each with a refresh button where the list comes from the site. Room, coupon and extra lists show published records only.
    • Utilities: checkboxes for on-only options (Delete Permanently, Featured, Hold for Moderation, Replace Extras) and selects for room status, room types, payment method and rating.
  • Added a date format note (YYYY-MM-DD) on actions that take dates.
  • Added the logo, the tutorial link entry and the New, Edit, Info and Select Action registrations.

Review fixes

  • Fixed the plugin-inactive path so it writes a task log entry, and reworded errors to say what to do.
  • Fixed setup validation messages ("Action is not selected", empty field map rows) and showed the server message when a list cannot load.
  • Changed the action doc link to stay hidden until the doc page is published, like the trigger.

Testing

Tested on a local site with WP Hotel Booking 2.3.4 through the Bit Integrations UI:

  • Triggers: every trigger captured a sample from a real event (guest checkout, admin status changes, admin room save, cart, extras and the front-end review popup).
  • Actions: every action ran from a Contact Form 7 flow submitted as a guest, and the result was checked in the database and the task log.
  • Errors: a non-numeric record ID logs a clear error in the task log.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Tests added/updated
  • Documentation updated if needed
  • README updated if needed

Changelog

  • New Triggers
    • WP Hotel Booking: 12 new events added (Pro).
  • New Actions
    • WP Hotel Booking: 24 new events added (Pro).

🤖 Generated with Claude Code

Controller with dropdown routes and a RecordApiHelper that fires one Pro hook per action. Register the WP Hotel Booking trigger.
Action picker, required selects (room, booking status, discount type, coupon, extras), field map and utilities for the 24 Pro actions.
…flow

WpHotelBooking was missing from customFormIntegrations, so the flow edit page fell back to the form trigger UI.
Use tutorialLinkKey and pass nextPage straight through, like WP Simple Booking Calendar.
A mapped checkbox field sent an array into text and meta fields. Join its values with commas. Also say "activated" in the missing Pro message.
Long "(YYYY-MM-DD)" suffixes were cut off next to a custom value. Use short labels, show one date format hint above the field map, and read labels from staticData so saved flows pick up label changes.
Copilot AI balanced review requested due to automatic review settings October 25, 2026 11:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@github-actions

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

Unpublished rooms have no price plans, so bookings made with them had a total of 0.
Copilot AI balanced review requested due to automatic review settings October 25, 2026 11:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Copilot AI balanced review requested due to automatic review settings October 25, 2026 12:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Copilot AI balanced review requested due to automatic review settings October 26, 2026 08:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

…n errors

Errors now say what is wrong and what to do.
… link

- Say when no action is selected and when a field map row is empty.
- Show the server message when a list cannot load.
- Hide the action doc link until the page is published, like the trigger.
- Say that the room price applies to all days.
Copilot AI balanced review requested due to automatic review settings October 26, 2026 09:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

TagifyInput binds its onChange once at mount, and the shared
handleCustomValue spread that stale conf, so editing a custom value
reverted settings changed afterwards, such as the booking status.
Update the field map through a functional setter instead.
Copilot AI balanced review requested due to automatic review settings November 5, 2026 07:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants