FoyerDevelopers

Generated · Live registry

orders tools

9 tools in this domain, generated from the running registry.

All tool domains

orders.list

read-only

List in-stay orders for this tenant, newest-first. Filter by stayId (per-stay folio drill-down) or status (pending/confirmed/delivered/cancelled). Read-only.

Input parameters

FieldTypeRequiredNotes
stayIdstringno
statusenumnoOne of: pending, confirmed, delivered, cancelled
limitintegernoDefault: 50

Output fields

FieldTypeRequiredNotes
ordersarray of objectyes
orders.idstringyes
orders.stayIdstringyes
orders.itemIdstringyes
orders.quantityintegeryes
orders.notestring · nullableyes
orders.statusenumyesOne of: pending, confirmed, delivered, cancelled
orders.folioLineIdstring · nullableyes
orders.orderedAtstringyes
orders.updatedAtstringyes

orders.listCatalog

read-only

Catalog read — all active items for this tenant, ordered by sortOrder. RLS pins to caller's tenant. Read-only query.

Input parameters

Returns object.

Output fields

Returns array of object. Fields of each element:

FieldTypeRequiredNotes
idstringyes
tenantIdstringyes
namestringyes
descriptionstring · nullableyes
priceCentsintegeryes
currencystringyes
categorystringyes
activebooleanyes
sortOrderintegeryes
createdAtstringyes

orders.listCatalogByToken

read-only

Public-by-token catalog read for the guest portal. Resolves the token → (tenantId, stayId) via `gueltigeGastSitzung`, then runs the actual catalog read inside withSystem(tenantId) with an explicit tenantId filter (Pattern A defense-in-depth). Read-only query.

Input parameters

FieldTypeRequiredNotes
tokenstringyes

Output fields

Returns array of object. Fields of each element:

FieldTypeRequiredNotes
idstringyes
namestringyes
descriptionstring · nullableyes
priceCentsintegeryes
currencystringyes
categorystringyes

orders.listOrders

read-only

List orders for this tenant. Optional filters by stay + status. Newest-first by orderedAt. Read-only query.

Input parameters

FieldTypeRequiredNotes
stayIdstringno
statusenumnoOne of: pending, confirmed, delivered, cancelled

Output fields

Returns array of object. Fields of each element:

FieldTypeRequiredNotes
idstringyes
tenantIdstringyes
stayIdstringyes
itemIdstringyes
quantityintegeryes
notestring · nullableyes
statusenumyesOne of: pending, confirmed, delivered, cancelled
folioLineIdstring · nullableyes
orderedAtstringyes
updatedAtstringyes

orders.placeOrderByToken

writes

Public-by-token order placement from the guest portal. Token is the auth principal — no session. Resolves (tenantId, stayId), then runs the verify + insert + folio-line side-effect inside withSystem(tenantId) with explicit tenantId filters. Mutation — changes data.

Input parameters

FieldTypeRequiredNotes
tokenstringyes
itemIdstringyes
quantityintegernoDefault: 1
notestringno

Output fields

FieldTypeRequiredNotes
idstringyes
folioLineIdstring · nullableyes

orders.place_order

writes

Place an in-stay order on behalf of a guest. Verifies the catalog item belongs to this tenant + is active and the stay is this tenant's (else stay_not_found) with an open folio (else folio_closed), inserts the stay_orders row, then writes a folio_lines charge (VAT 19% for in-stay extras). Best-effort: if the folio insert fails the order still exists with folioLineId=NULL.

Input parameters

FieldTypeRequiredNotes
stayIdstringyes
itemIdstringyes
quantityintegernoDefault: 1
notestringno

Output fields

FieldTypeRequiredNotes
idstringyes
folioLineIdstring · nullableyes

orders.updateOrderStatus

writesconfirm

Set a guest order's status: confirmed / delivered / cancelled. Cancelled is final and cannot be undone; if the order had a folio line, a refund counter-line is booked in the folio. If the folio is already closed then, the call is rejected with folio_closed. Errors: order_not_found, order_cancelled, folio_closed. Requires confirmation.

Input parameters

FieldTypeRequiredNotes
idstringyes
statusenumyesOne of: confirmed, delivered, cancelled

Output fields

FieldTypeRequiredNotes
okliteralyesOne of: true

orders.update_status

writesconfirm

Transition an order to confirmed / delivered / cancelled. Owner-only. Cancellation books one negative 'refund' folio line reversing the order's charge (the original line stays); repeating it is a no-op. A cancelled order cannot change again (order_cancelled). Cancelling an order with a folio charge on a closed folio fails with folio_closed. Confirmation-gated.

Input parameters

FieldTypeRequiredNotes
idstringyes
statusenumyesOne of: confirmed, delivered, cancelled

Output fields

FieldTypeRequiredNotes
okliteralyesOne of: true

orders.upsertCatalogItem

writes

Catalog upsert — owner-only. Insert when no id, update otherwise. RLS scoping: update is `eq(id) AND eq(tenantId)` so a cross-tenant id is silently a no-op (Pattern-A silence). Mutation — changes data.

Input parameters

FieldTypeRequiredNotes
idstringno
namestringyes
descriptionstringno
priceCentsintegeryes
currencystringnoDefault: "EUR"
categorystringnoDefault: "general"
activebooleannoDefault: true
sortOrderintegernoDefault: 0

Output fields

FieldTypeRequiredNotes
idstringyes