Skip to content

Pre-check-in form

/forms/pre-checkin?b={bookingId} — multi-section single-page form the guest completes before arrival. Replaced ChargeAutomation entirely (Phase 5).

Form sections

  1. Stay summary — booking dates, property, your guest info
  2. T&Cs viewer + signature — full rental terms, canvas signature pad. Required to proceed.
  3. Contact info — full name, phone, email (override BA’s stored values if guest wants a different best-contact)
  4. Guests — adult + child counts
  5. Cleaning notice preference — how to be notified of cleaning schedule (text / email / booking-msg / none)
  6. Arrival info — how they’re arriving (flying / driving) + estimated arrival time
  7. Identity verification — selfie photo upload (compressed client-side to 1920px JPEG q=0.75, uploaded to Dropbox /PMS/...)
  8. Optional add-ons — early check-in + late check-out (each shows per-property price). If selected, Stripe Elements card form appears.

Submit flow

Submit-intercept JavaScript:

  1. Compress selfie if changed
  2. Stripe createPaymentMethod if add-ons selected
  3. Multipart POST to /forms/pre-checkin
  4. Server: validate, write to D1, authorize Stripe (if add-ons), set CA_PRE_CHECKIN_COMPL=Y info code on Beds24 booking
  5. Call form-bridge action (runFormBridge with kind="pre_checkin") — thanks email + flag + CHECKINCOM info code
  6. Render thanks page

Persisted state

All in the pre_checkin_submissions D1 table (one row per booking). Key columns:

  • terms_acknowledged_at, signature_data_url, signature_signed_at
  • guest_full_name, guest_phone, guest_email
  • num_adults, num_children
  • cleaning_notice_pref, arriving_by, estimated_arrival_time
  • selfie_dropbox_path, selfie_uploaded_at
  • addon_early_checkin, addon_late_checkout, addon_total_usd
  • stripe_payment_intent_id, payment_status, payment_authorized_at, payment_captured_at
  • early_checkin_decision, late_checkout_decision, late_checkout_chosen_time (set by M4c / M4d flows)
  • last_pre_arrival_msg_at (used by 24h gate)
  • submitted_at, created_at, updated_at

Validation

Server-side enforced:

  • Signature required (must be data:image/...)
  • Full name, phone, email required
  • Selfie required (server checks selfie_dropbox_path IS NOT NULL OR upload in request)
  • Card details required IF any add-on selected

Editable later

The form is re-fillable. Guest can revisit and update any field. If they re-submit after the first submission:

  • D1 row updated (not replaced)
  • Bridge actions re-run (but BA bridge stays idempotent via flags set on first submit)

Source

  • Route: src/routes/forms-pre-checkin.ts
  • Migration: migrations/0017_pre_checkin_submissions.sql + 0018–0021 for signature, selfie, add-ons, payments
  • CRUD lib: src/lib/pre-checkin.ts