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=modifyfirst, then the next workflow read sees status=cancelled)
What it does
- Check
CANCEL_CLEAN_SENTinfo code on the booking — if=Y, skip (already notified) - Read
property_config.cleanersfor the property - For each cleaner, send
sendCleanerEmailwith subject:CANCEL — Titler Booking — {Property} — {arrival} to {departure} - Body: “Heads up — the booking has been CANCELLED. No cleaning needed.”
- Set
CANCEL_CLEAN_SENT=Yinfo code on the booking (idempotency) - Delete the
workflow_instancesrow (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.ts—ensureBookingFlagWorkflowcancel branchsrc/mailgun/cleaner.ts— shadow-mode email wrappersrc/beds24/client.ts—getInfoItem,setInfoItem
BA AA mapping
| BA AA | Status |
|---|---|
| 308252 (Cancel Steamboat Booking Cleaning) | Covered here |