Skip to content

Booking matching chain: interest → selection/confirmation → notifications - #4

Merged
ravivasavan merged 3 commits into
mainfrom
feat/booking-matching
Jun 17, 2026
Merged

Booking matching chain: interest → selection/confirmation → notifications#4
ravivasavan merged 3 commits into
mainfrom
feat/booking-matching

Conversation

@ravivasavan

Copy link
Copy Markdown
Owner

Builds the core marketplace loop on top of the 006 booking surface.

  • Express interest — interpreters express/withdraw interest on /pool/[id] (RLS-scoped writes to booking_interests); best-effort notifies the signer.
  • Selection + confirmation — signer reviews interested interpreters on /bookings/[id]/select, confirms via confirmInterpreters: ownership + interest checks, team-composition enforcement (isCompositionSatisfied), contact snapshot into booking_confirmations (interpreter contact via admin client), booking → confirmed, notifies confirmed interpreters. /bookings/[id] shows interest count / confirmed contacts.
  • Notifications — created via a service-role helper (notifications has no insert policy); /notifications lists them with unread state + mark-all-read; /home is now a hub (post / pool / notifications with unread count).

No DB/schema changes — uses the existing booking_interests / booking_confirmations / notifications tables + RLS. Verified: typecheck (web+mobile), lint, 36 tests, web build (new /bookings/[id]/select + /notifications routes).

Out of scope (later): partial/multi-slot selection UX, email/push delivery of notifications, the OQ4 timezone handling, the /auth/confirm prefetch hardening.

/pool/[id] gets an express/withdraw-interest button for interpreters →
expressInterest/withdrawInterest server actions writing booking_interests
(RLS-scoped: own interpreter_id, booking must be open; idempotent on the unique
violation). Expressing interest best-effort notifies the signer via the new
createNotification helper (service-role, since notifications has no insert
policy for authenticated). Signer-only/non-interpreter viewers see a note.
/bookings/[id] shows interest count + a 'Review & confirm' link while open, and
the confirmed interpreters + their shared contact once confirmed.
/bookings/[id]/select lists interested interpreters (safe-column public views)
for multi-select → confirmInterpreters action: verifies ownership + that picks
expressed interest, enforces team composition via isCompositionSatisfied,
snapshots both parties' contacts into booking_confirmations (interpreter contact
via admin client — signer can't read it under RLS), flips booking to confirmed,
and notifies each confirmed interpreter.
/notifications lists the user's notifications (RLS own-row), newest first, with
unread highlighting, relative timestamps, deep-links to the related booking/pool
item, and a 'Mark all read' server action. /home becomes a simple hub: post a
booking, browse the pool, and notifications with an unread count. Notification
rows are created by the interest/confirm actions (feature 1 + 2) via the
service-role helper.
@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
wavetap-web Ready Ready Preview, Comment Jun 17, 2026 6:07am

@ravivasavan
ravivasavan merged commit 453f955 into main Jun 17, 2026
3 checks passed
@ravivasavan
ravivasavan deleted the feat/booking-matching branch June 17, 2026 06:09
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