Bookings 0.1.0: Stays, appointments and free-form reservations in one module
Bookings 0.1.0 is the first release of the PhoenixKit booking module. One install takes reservations for hotel-style stays, appointments on fixed time slots and free-form bookings of any length, with public booking pages, guest booking and confirmation emails.
One module, three shapes of booking
The shape is chosen per service, not for the whole site, so a hotel can also offer massages:
- Day or night stays: a pool of rooms or places, minimum and maximum stay, check-in and check-out times.
- Fixed slots: a duration and a slot grid, such as one-hour massages on the hour.
- Free-form: any start and any length, within a minimum and maximum.
Each service has availability rules (weekly hours, date overrides and blackouts), capacity, buffers, minimum notice and how far ahead people may book. It can require approval, so bookings wait as pending, and can allow guests or require sign-in. Rooms or courts can be named, and each booking then gets a free one. A staff member attached to several services cannot be double-booked across them.
Public booking pages
Visitors find services at /bookings and book at /book/:slug. Picking a time holds it for 5 minutes while they fill in their details, and other visitors see it as taken. Bookings are checked again inside a locked transaction, so the last place can only be taken once. Full dates offer a waitlist, and a cancellation emails everyone waiting.
Customers get a confirmation email with an .ics calendar file and a manage link, plus approval, cancellation and reminder emails. The manage link lets a guest view and cancel their booking without an account, within the service’s cancellation window, for up to 90 days. Prices per booking, hour, day or night are worked out and stored on each booking; taking payment is not wired yet.
Admin
The admin has Reservations with filters, an approval queue and cancel, Services with the form, availability rules, named units and a trash, and a settings page. The base bookings permission limits a user to the services they own; Manage all bookings (bookings.manage_all) covers the whole site. The settings decide whether users may create their own services, and how many.
Upgrading
Add {:phoenix_kit_bookings, "~> 0.1.0"}, run mix deps.get, then mix phoenix_kit.update, which creates the module’s own tables. It needs phoenix_kit 2.x. Then enable Bookings on the admin Modules page.
Full release notes: Bookings 0.1.0
0.1.0 · 11 August 2026
First release. Requires phoenix_kit ~> 2.0.
Added
-
The universal booking module (#1) — one engine behind both shapes of booking: minute-unit services (appointments, classes, resources) and day/night services (stays), with
starts_at/ends_atorstarts_on/ends_onenforced exclusive by a database CHECK. -
Services with availability rules, per-service units, seats/capacity, buffers, min notice, max advance, min/max stay, check-in and check-out times, flexible durations, approval requirements and a
anyone/login_requiredsignup policy. -
A locked create path.
Engine.validate_request/5is pure and advisory;create_booking/4re-runs it inside a transaction holdingSELECT … FOR UPDATEon the service row — and, when a provider is attached, on all that provider’s services inuuidorder, so cross-service provider conflicts serialise without deadlocking. Expired holds are pruned inside the same transaction and the caller’s own hold is excluded from the count. -
Public booking surface — a service listing, a booking flow, and a guest self-service page reached by a
Phoenix.Token-signed manage link (90-day max age, no account needed) that cancels within the service’s cancel window, re-checked server-side. -
Holds, waitlist, pricing, ICS export, an Oban reminder worker, activity logging, and admin pages for services, bookings and settings.
Fixed before release
-
The migration could not run on a named-schema (
--prefix) install. All sixCREATE TABLEs declared the primary key with a bareuuid_generate_v7(). Core installs that function into whichever schema it migrated into, so on a prefixed installsearch_pathdoes not carry it and the statement fails outright. Every call is now schema-qualified, which costs nothing on a public install; guarded by a test that fails on a bare call. -
The migration prefix was interpolated into DDL unvalidated. It is now checked against an identifier pattern and raises otherwise, matching core and the other module-owned chains.
Bookings 0.1.0. Install or update: {:phoenix_kit_bookings, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.