FoyerDevelopers

Generated · Live registry

folio tools

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

All tool domains

folio.addLine

writes

Add a charge line (room/extra/tax) to a stay's folio.

Input parameters

FieldTypeRequiredNotes
stayIdstringyes
datestringyes
categoryenumyesOne of: room_charge, breakfast, parking, late_checkout, early_checkin, manual
descriptionstringyes
qtyintegernoDefault: 1
unitCentsintegeryes
vatRatePctstringnoDefault: "7.00"

Output fields

FieldTypeRequiredNotes
idstringyes
tenantIdstringyes
stayIdstringyes
datestringyes
categorystringyes
descriptionstringyes
qtyintegeryes
unitCentsintegeryes
totalCentsintegeryes
vatRatePctstringyesDecimal as string — numeric column, not an IEEE-754 double
addedBystringyes
createdAtstringyes

folio.addPayment

writes

Record a payment against a stay's folio.

Input parameters

FieldTypeRequiredNotes
stayIdstringyes
amountCentsintegeryes
methodenumyesOne of: cash, card, bank_transfer, voucher, other
notestringno

Output fields

FieldTypeRequiredNotes
idstringyes
tenantIdstringyes
stayIdstringyes
amountCentsintegeryes
methodenumyesOne of: cash, card, bank_transfer, voucher, other
notestring · nullableyes
recordedAtstringyes
recordedBystring · nullableyes

folio.close

writes

Close the folio for a stay by setting folio_closed_at to now(). Should only be called when balanceCents = 0. Throws folio_not_found if the stay is invisible to the caller's tenant (RLS).

Input parameters

FieldTypeRequiredNotes
stayIdstringyes

Output fields

FieldTypeRequiredNotes
folioClosedstring · nullableyes

folio.closeFolio

writesconfirm

Close a stay's folio. Irreversible once balanced — no further edits. Requires confirmation.

Input parameters

FieldTypeRequiredNotes
stayIdstringyes

Output fields

FieldTypeRequiredNotes
folioClosedstring · nullableyes

folio.line.update

writes

Overwrite the quantity and unit price (cents) of an existing folio line. totalCents is recomputed as qty × unitCents. RLS: a line outside the caller's tenant is invisible — throws folio_line_not_found.

Input parameters

FieldTypeRequiredNotes
idstringyes
qtyintegeryes
unitCentsintegeryes

Output fields

FieldTypeRequiredNotes
idstringyes
stayIdstringyes
datestringyes
categorystringyes
descriptionstringyes
qtyintegeryes
unitCentsintegeryes
totalCentsintegeryes
vatRatePctstringyes
addedBystringyes
createdAtstringyes

folio.list

read-only

List all folio charge lines for a stay, ordered by date then creation time. Returns room_charge (auto-seeded on check-in) and any operator-added extras. RLS: caller sees only lines belonging to their tenant. Read-only.

Input parameters

FieldTypeRequiredNotes
stayIdstringyes

Output fields

FieldTypeRequiredNotes
linesarray of objectyes
lines.idstringyes
lines.stayIdstringyes
lines.datestringyes
lines.categorystringyes
lines.descriptionstringyes
lines.qtyintegeryes
lines.unitCentsintegeryes
lines.totalCentsintegeryes
lines.vatRatePctstringyes
lines.addedBystringyes
lines.createdAtstringyes

folio.listPayments

read-only

Folio: list payments. Read-only query. See the input schema for argument details.

Input parameters

FieldTypeRequiredNotes
stayIdstringyes

Output fields

Returns array of object. Fields of each element:

FieldTypeRequiredNotes
idstringyes
tenantIdstringyes
stayIdstringyes
amountCentsintegeryes
methodenumyesOne of: cash, card, bank_transfer, voucher, other
notestring · nullableyes
recordedAtstringyes
recordedBystring · nullableyes

folio.payment.add

writes

Record a payment against a stay folio. Supported methods: cash, card, bank_transfer, voucher, other. amount_cents must be > 0. An optional free-text note can be attached. RLS: only payments within the caller's tenant are visible.

Input parameters

FieldTypeRequiredNotes
stayIdstringyes
amountCentsintegeryes
methodenumyesOne of: cash, card, bank_transfer, voucher, other
notestringno
recordedBystringno

Output fields

FieldTypeRequiredNotes
idstringyes
stayIdstringyes
amountCentsintegeryes
methodstringyes
notestring · nullableyes
recordedAtstringyes
recordedBystring · nullableyes

folio.payment.list

read-only

List all payments recorded against a stay folio, ordered by recorded_at descending. RLS: only payments within the caller's tenant are returned. Read-only.

Input parameters

FieldTypeRequiredNotes
stayIdstringyes

Output fields

FieldTypeRequiredNotes
paymentsarray of objectyes
payments.idstringyes
payments.stayIdstringyes
payments.amountCentsintegeryes
payments.methodstringyes
payments.notestring · nullableyes
payments.recordedAtstringyes
payments.recordedBystring · nullableyes

folio.payment.remove

writes

Delete a folio payment by id. RLS silence: if the payment belongs to another tenant it is invisible — returns { deleted: false } without an error.

Input parameters

FieldTypeRequiredNotes
idstringyes

Output fields

FieldTypeRequiredNotes
deletedbooleanyes

folio.removeLine

writesconfirm

Remove a charge line from a folio.

Input parameters

FieldTypeRequiredNotes
idstringyes

Output fields

FieldTypeRequiredNotes
deletedbooleanyes

folio.removePayment

writesconfirm

Remove a recorded payment from a folio.

Input parameters

FieldTypeRequiredNotes
idstringyes

Output fields

FieldTypeRequiredNotes
deletedbooleanyes

folio.reset

writes

Reset a stay's auto-seeded folio lines (room_charge + city_tax, addedBy='system') to their computed original state, discarding manual edits. Operator-added extras are kept. Regenerates via folio-init. RLS: the stay must belong to the caller's tenant.

Input parameters

FieldTypeRequiredNotes
stayIdstringyes

Output fields

FieldTypeRequiredNotes
regeneratedintegeryes

folio.summary

read-only

Return aggregated folio totals for a stay: subtotal (net of VAT), vatCents (total tax), totalCents (gross = subtotal + vat), and lineCount. VAT is back-calculated from each line's vatRatePct (totalCents already includes VAT). Read-only.

Input parameters

FieldTypeRequiredNotes
stayIdstringyes

Output fields

FieldTypeRequiredNotes
subtotalCentsintegeryes
vatCentsintegeryes
totalCentsintegeryes
lineCountintegeryes

folio.updateLine

writes

Edit an existing folio charge line's description or amount.

Input parameters

FieldTypeRequiredNotes
idstringyes
qtyintegeryes
unitCentsintegeryes

Output fields

FieldTypeRequiredNotes
idstringyes
tenantIdstringyes
stayIdstringyes
datestringyes
categorystringyes
descriptionstringyes
qtyintegeryes
unitCentsintegeryes
totalCentsintegeryes
vatRatePctstringyesDecimal as string — numeric column, not an IEEE-754 double
addedBystringyes
createdAtstringyes