Slice 6: Reservations (CRM guest link) - #11
Merged
Conversation
Lights up the CRM integration without ever reading CRM data. - Schema: rest_reservation (003_reservations) — party_name/size/reserved_at/ notes are the restaurant's own first-party data; table_id (validated, same-plugin) + contact_id (a bare link to a CRM contact). - Reservations service: allow-list, party name required, allow-listed status (booked/seated/cancelled/no_show), strict datetime (accepts datetime-local), validated table ref. contact_id is stored as given and NOT resolved or existence-checked — reading the CRM would breach its capability gate. - Admin: the book (list + status filter + create/edit). Shows only the booking's own data; a CRM-linked booking renders a "Guest in CRM" LINK to /admin/crm?edit=<id> (core gates that page) — never CRM data itself. Gated on danmat.restaurant:floor + CSRF, mobile-reflow. - MCP: reservations / _get / _set / _status / _delete; contact_id passes through as a bare link. - Guide: reservations section (+ the CRM boundary). - Tests: ReservationsTest, ReservationsAdminTest (escape + gated CRM link, no CRM data), RestaurantToolsetTest (reservation tools + round-trip carrying only the link), RestaurantPluginTest (reservations page gated :floor). Security: the restaurant stores only contact_id and links out to the CRM's own gated page; no CRM PII is read, resolved or copied into rest_* tables. A proper in-process guest picker would need a CRM read service port (ADR 0019) — a documented follow-up. cs-fixer + PHPStan green locally; phpunit runs in CI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Lights up the CRM integration — reservations link to CRM guests — while honoring the cross-plugin PII boundary the security review pinned: the restaurant stores only a
contact_idand links out to the CRM's own gated page; it never reads, resolves or copies CRM contact data.What's here
rest_reservation(003_reservations).party_name/party_size/reserved_at/notesare the restaurant's own first-party data;table_idis a validated same-plugin ref;contact_idis a bare link to a CRM contact.Reservationsservice — field allow-list, party name required, allow-listed status (booked/seated/cancelled/no_show), strict datetime (acceptsdatetime-local), validated table ref.contact_idis stored as given and not resolved or existence-checked — reading the CRM would breach its capability gate./admin/crm?edit=<id>(core gates that page), never CRM data itself.danmat.restaurant:floor+ CSRF, mobile-reflow.reservations/_get/_set/_status/_delete;contact_idpasses through as a bare link.Security posture
The restaurant never reads CRM PII: it stores the guest's id and links to the CRM's own capability-gated page, so a floor user without
nimbuscms.crmaccess is denied there by core.party_nameis first-party booking data, not laundered from a CRM record. A proper in-process guest picker (searching CRM) would need a CRM read service port (ADR 0019) — a documented follow-up, not built here.Tests
ReservationsTest(round-trip, name required, datetime parsing, validated table ref,contact_idstored-not-resolved + bad-id rejected, status allow-list, ordering/filter),ReservationsAdminTest(escape-on-render; a linked booking links out to the CRM and shows no CRM data; an unlinked one shows no link),RestaurantToolsetTest(reservation tools listed; a reservation round-trips over MCP carrying only the link; content token can't reach),RestaurantPluginTest(the book is gated on:floor).cs-fixer + PHPStan L6 green locally; phpunit in CI (8.2 + 8.3).
🤖 Generated with Claude Code