Skip to content

Cleaning cancellation notification

Ports BA AA 308252. Implemented in ensureBookingFlagWorkflow (in src/workflows/booking-flag.ts) — the place where the workflow sees that a booking is cancelled.

When it fires

Whenever ensureBookingFlagWorkflow runs and finds booking.status === "cancelled". Triggered by:

  • Beds24 webhook with status=cancel
  • BA panel cancel (which lands as status=modify first, then the next workflow read sees status=cancelled)

What it does

  1. Check CANCEL_CLEAN_SENT info code on the booking — if =Y, skip (already notified)
  2. Read property_config.cleaners for the property
  3. For each cleaner, send sendCleanerEmail with subject: CANCEL — Titler Booking — {Property} — {arrival} to {departure}
  4. Body: “Heads up — the booking has been CANCELLED. No cleaning needed.”
  5. Set CANCEL_CLEAN_SENT=Y info code on the booking (idempotency)
  6. Delete the workflow_instances row (terminate tracking)

Idempotency

CANCEL_CLEAN_SENT=Y info code is the dedup signal. If a cancelled booking gets a stray webhook hit later, the cleaner doesn’t get a second notification.

Channel routing

Uses sendCleanerEmail (src/mailgun/cleaner.ts) which respects the cleaner-email shadow flag — if shadow_mode=1, the email goes to Bill with [shadow → name email] prefix instead of the cleaner.

No SMS for cancellations — email is enough; cleaners aren’t time-sensitive for a “don’t come” message.

Source

  • src/workflows/booking-flag.tsensureBookingFlagWorkflow cancel branch
  • src/mailgun/cleaner.ts — shadow-mode email wrapper
  • src/beds24/client.tsgetInfoItem, setInfoItem

BA AA mapping

BA AAStatus
308252 (Cancel Steamboat Booking Cleaning)Covered here