Skip to content

Admin views

Several /admin/... routes render HTML views over D1 data. Useful for quick checks without diving into the DB directly.

All require admin auth (Bearer token via BEDS24_WEBHOOK_SECRET or Basic auth challenge).

/admin/clean-status

Per-booking cleaning state. Defaults to upcoming bookings; ?past=1 includes past.

Columns: Arrival, Property, Booking (with /clean-ack link), Cleaner, Status (status pill + ETA + issue summary).

Source: src/routes/admin.tshandleCleanStatus.

/admin/email-status

Mailgun event timeline.

  • Default: last 100 events across all bookings
  • ?msg=<message-id> — full delivery story for one email
  • ?booking=<id> — every email event for one booking

Color-coded event pills: green delivered, red failed, etc.

Source: src/routes/admin.tshandleEmailStatus.

/admin/delivery-status

Cross-channel outbound_log view.

  • Default: last 100 sends across all channels
  • ?booking=<id> — every send (email + SMS + Beds24 thread) for that booking

Each row shows: sent timestamp, channel pill, purpose, recipient, booking link, status (delivered/pending/failed with reason), message-id with drill-link to /admin/email-status for the full event timeline.

Source: src/routes/admin.tshandleDeliveryStatus.

/admin/property/{id}

Visual editor for property_config per-property settings (form_overrides, cleaners, short codes, etc.). HTML form, saves via POST.

Source: src/routes/admin.tshandlePropertyEdit.

/admin/booking/{id}

Raw Beds24 booking dump — fetches via API + thread messages. Diagnostic view for “what does the system see for this booking?”

/admin/booking/{id}/addon-capture + /addon-decline

P5.M4c/M4d action endpoints. GET-callable URLs Bill clicks from the emails the workflow sends. See Early check-in.

/admin/booking/{id}/respawn

POST endpoint that forces ensureBookingFlagWorkflow to terminate + respawn a booking’s workflow. Use when state seems wrong.

/admin/booking/{id}/allow-auto-action?value=...

Surgical toggle for BA’s allowAutoAction field — used during test bookings where you want to disable BA’s auto-actions for one booking.

/admin/sms-test?to=+1...&body=...

Fire a one-shot SMS through Twilio. Diagnostic — verifies creds + status callbacks without waiting for a workflow.

/admin/backfill

POST that spawns DailyFlagSyncWorkflow with horizonDays=365. Forces a full re-sync of all bookings.

Source

  • src/routes/admin.ts — all /admin/* routes
  • Auth: src/lib/webhook-auth.tsverifyAdminAuth