Skip to content

feat(catering): support external catering backend in workplace bookings (PPT-2556)#471

Open
MrYuion wants to merge 1 commit into
developfrom
feat/ppt-2556-flex-catering
Open

feat(catering): support external catering backend in workplace bookings (PPT-2556)#471
MrYuion wants to merge 1 commit into
developfrom
feat/ppt-2556-flex-catering

Conversation

@MrYuion

@MrYuion MrYuion commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

PPT-2556 — Use external catering platform

Adds a settings-gated external catering backend that replaces the native PlaceOS catering system end-to-end in the workplace booking flow. When app.catering.backend is external, the booking menu comes from the external Catering driver's products() and orders are placed via match_or_create_customer + create_external_order. Default stays native.

Changes

  • ExternalCateringService (@placeos/common) — wraps the driver (located via the catering org/building module binding), maps external products → native CateringItem (price → cents), and places orders.
  • Menu hook (catering-order-state.service.ts) — reads the backend setting reactively so the menu reloads externally once org settings finish loading (fixes a load-order race that silently fell back to native). A load token prevents a slow stale load from overwriting a newer one.
  • Order submission (event-form.service.ts) — places orders externally, then creates local catering-order booking records carrying an external_reference (customer uuid, purchase order number, raw response) so orders display in the management UI like native ones while the external platform remains the fulfilment system of record.
  • create_external_order is called with positional args (driver expects a String first param, not a single object); match_or_create_customer takes its single object arg.

Behaviour notes

  • Orders are placed only for new bookings. The driver exposes no update/cancel and keys on the event id, so re-submitting on edit would duplicate the order. Editing catering on an existing external booking is therefore a no-op on the external side.

Verification

  • Unit/build: common (158), catering (49), events (83), workplace build — all green.
  • Live (dev): external menu loads & maps correctly (19 products); match_or_create_customer round-trips.

⚠️ Open items needing driver/backend follow-up (not frontend)

  • create_external_order currently returns 404 Not found resource from the external API on dev (args parse fine; connectivity confirmed via match_or_create_customer).
  • No update/cancel driver method — required for edit support.

🤖 Generated with Claude Code

Add a settings-gated external catering backend that replaces the native
PlaceOS catering system end-to-end in the workplace booking flow. When
`app.catering.backend` is `external`, the booking menu is sourced from the
external `Catering` driver's `products()` and orders are placed via
`match_or_create_customer` + `create_external_order`.

- ExternalCateringService (@placeos/common) wraps the driver, located via
  the `catering` org/building module binding, and maps external products
  to the native CateringItem (price -> cents).
- catering-order-state menu hook reads the backend setting reactively so
  the menu reloads externally once org settings finish loading (avoids a
  load-order race that silently fell back to native). A load token guards
  against a slow stale load overwriting a newer one.
- event-form places orders externally, then creates local `catering-order`
  booking records carrying an `external_reference` (customer uuid, purchase
  order number, raw response) so orders display in the management UI like
  native ones while the external platform remains the fulfilment system of
  record. Orders are only placed for new bookings: the driver has no
  update/cancel and keys on the event id, so re-submitting on edit would
  duplicate the order.
- create_external_order is called with positional args (driver expects a
  String first param, not a single object), per the driver guide.

PPT-2556

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
frontend-templates Ignored Ignored Jun 26, 2026 6:32am

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