feat(catering): support external catering backend in workplace bookings (PPT-2556)#471
Open
MrYuion wants to merge 1 commit into
Open
feat(catering): support external catering backend in workplace bookings (PPT-2556)#471MrYuion wants to merge 1 commit into
MrYuion wants to merge 1 commit into
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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.
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.backendisexternal, the booking menu comes from the externalCateringdriver'sproducts()and orders are placed viamatch_or_create_customer+create_external_order. Default staysnative.Changes
ExternalCateringService(@placeos/common) — wraps the driver (located via thecateringorg/building module binding), maps external products → nativeCateringItem(price → cents), and places orders.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.event-form.service.ts) — places orders externally, then creates localcatering-orderbooking records carrying anexternal_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_orderis called with positional args (driver expects aStringfirst param, not a single object);match_or_create_customertakes its single object arg.Behaviour notes
Verification
common(158),catering(49),events(83),workplacebuild — all green.match_or_create_customerround-trips.create_external_ordercurrently returns404 Not found resourcefrom the external API on dev (args parse fine; connectivity confirmed viamatch_or_create_customer).update/canceldriver method — required for edit support.🤖 Generated with Claude Code