Skip to content

feat(booking): add a "we'll call you" phone location (phone_outbound) - #273

Open
dominik-myszkowski wants to merge 2 commits into
Calnode:mainfrom
dominik-myszkowski:feat/phone-outbound-location
Open

dominik-myszkowski wants to merge 2 commits into
Calnode:mainfrom
dominik-myszkowski:feat/phone-outbound-location

Conversation

@dominik-myszkowski

Copy link
Copy Markdown

Implements shape (a) from #263: a real location type for calls the host makes to the attendee.

What it does

  • New event-type location phone_outbound ("We call the attendee" in the admin picker). The event type carries no number: validateLocation has a branch that requires none.
  • The booking page and the embed widget show a required tel field. CreateBooking refuses a missing, blank or invalid number with 400 instead of falling back to another meeting type.
  • A valid number is stored exactly like the allow_phone_call path: bookings.location_type = "phone", location_value = "tel:<number>". Calendar event location, tap-to-call, emails, webhooks and the manage page work unchanged.

Notes on the review points

  • Migration 00073 widens the location_type CHECK with the 00042 rebuild (NO TRANSACTION, foreign_keys=OFF). Columns are listed explicitly in their current order, including the ones added by ALTER after 00042. I checked on a database migrated to 00072 that table_info is identical before and after, and foreign_key_check / integrity_check are clean.
  • Down step: the widened CHECK stays, as in 00042 and 00071. An older binary doesn't know phone_outbound, so those event types become phone with no number and are deactivated. They stay a phone call, never quietly a video meeting, and can't be booked until the operator enters a number. Existing bookings are already stored as phone + tel: and need nothing.
  • Three surfaces: the field and its client-side check are in book.html and embed.js. manage.html has no booking form, only reschedule, and a reschedule keeps the booking's stored location and number, so there is nothing to add there. Its location label already comes from the booking (phone).
  • Assistant and MCP: they go through createBookingForSlug and can't collect a number, so the shared core refuses these event types (errPhoneRequired, alongside errPaymentRequired), and the assistant is hidden on the booking page and widget for them rather than offered and refused at the last step.
  • i18n: booker keys in en.json and pl.json (location_phone_outbound, phone_outbound_number, err_phone_required), admin keys in en.json and fr.json (the parity test requires French; please check my French).
  • docs/ARCHITECTURE.md §9 has a paragraph next to the allow_phone_call one.

The quiet Meet fallback on the existing allow_phone_call path is left for a separate PR as you suggested. That path has no explicit "video or phone" choice today, only an optional field, so I'd like to agree on the shape in #263 first.

Tests

  • TestBookingPhoneOutbound: valid number gives a phone booking with tel: and a calendar event without Meet (a Google calendar that could mint one is connected on purpose). Missing, blank, invalid and too-long numbers are refused and no booking row is created. I checked that the test fails if an empty number is let through.
  • TestBookPage_phoneOutboundRequiresNumber: required field on the page, phone_required in the public info, assistant off.
  • TestMCP_createBooking_phoneOutboundRefused, plus a phone_outbound case in TestBookPage_locationLabels.
  • TestEmbedJS_phoneOutboundRequired pins the widget's required field and its client-side check against the served source, the same way TestEmbedJS_identityPrefill does, since the widget has no browser harness.

Every step of ci.yml passes locally: gofmt, go vet, go build, go test ./..., i18n coverage, pnpm check, pnpm check:i18n, pnpm build and pnpm test:visual. Manually tested on a local build: the admin picker, the booking page and the widget (empty, invalid and valid number), reschedule from the manage page, and the unchanged allow_phone_call behaviour on a Meet event type.

I haven't touched CHANGELOG.md. Happy to add an entry under Added, and perhaps a line in the Upgrading note since 00073 rebuilds event_types, if you'd like it in this PR.

A new event-type location for calls the host makes to the attendee. The
event type carries no number; the booking page and the embed widget show a
required tel field, and the booking is stored exactly like the
allow_phone_call path (location_type "phone", "tel:<number>"), so calendar
events, emails, webhooks and the manage page are unchanged.

- migration 00073 widens the event_types.location_type CHECK with the 00042
  table rebuild; down turns such event types into inactive "phone" ones
- validateLocation accepts phone_outbound without a host number
- CreateBooking refuses a missing or invalid number (400) instead of
  falling back to another meeting type
- createBookingForSlug refuses these event types (the assistant and MCP
  cannot collect the number); the assistant is hidden for them
- admin location picker option, en/pl booker strings, en/fr admin strings
- ARCHITECTURE.md §9

Discussion: Calnode#263
The widget builds its own form and has no browser harness, so, as with
TestEmbedJS_identityPrefill, the required field and its client-side check
are pinned against the served source.
@pullfrog

pullfrog Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

OpenCode Go returned an error, so this run stopped. If it names your key, plan or balance, fix that with the provider or pick another model.

An active OpenCode Go subscription is required to use OpenCode Go models. (403)

Pick another model →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using deepseek-v4.1-flash

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA. ✅
Posted by the CLA Assistant Lite bot.

@dominik-myszkowski

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Nov 24, 2026
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.

1 participant