The function computes a rolling 48-hour window, converts each booking’s check-in to a comparable datetime, and keeps only records whose check-in falls inside that window.
Step 2: Return one action-ready payload to the widget
After each booking is classified, the function getArrivalReadiness() adds one row object to arrivals with: id, booking, guest, arrival, readiness, priority, issue, action.
At the same time, it builds summary with: total, ready, action_required, attention.
Finally, it returns a single response object:
- success
- generated_at
- window_hours
- summary
- arrivals
Because both summary cards and row-level actions come from this single payload, the widget can render in one function call (getArrivalReadiness) without additional CRM fetches.
Step 3: Render dashboard and bind row actions
Widget JS reads response.details.output, renders summary cards and actionable rows, then maps row actions to functions:
- Send reminder → sendArrivalReminder(bookingId)
- Assign task → create CRM Task, then call assignArrivalTask(bookingId)
All Deluge functions used by widget must be configured as Invoke as REST API.
Step 4: Execute “Send reminder” path for pending verification
For verification-pending bookings, sendArrivalReminder(bookingId) handles:
- Booking ID validation
- Booking lookup
- Guest email validation
- Duplicate reminder protection
- Email send
- Booking field updates (Reminder_Sent, Reminder_Sent_At)
This enables quick verification follow-up during pre-check-in.
Step 5: Execute “Assign task” path for unassigned requests
For unassigned special requests, widget creates a CRM Task linked to Bookings, then calls assignArrivalTask(bookingId) to update:
- Request_Status = Assigned
Using $se_module: "Bookings" ensures proper linkage to the custom module context.
Step 6: Refresh and reflect current operational truth
After any row action, widget refreshes readiness data so users immediately see updated status.
This creates a fast “identify → act → update → verify” loop.
Example outcomes:
- Laura Martin (BK-10492): ID verification pending → Action Required → Send reminder
- Ian Thomas (BK-10489): Late dinner request pending/unassigned → Action Required → Assign task
- Vivek Shah (BK-10491): Verification complete, no open request → Ready → No action
Conclusion
With this setup, the front office or operations team can move from record-checking to action execution in one screen.
You now have a working pattern that combines:
- readiness classification in Deluge
- direct actions in widget UI
- immediate CRM updates after each action
That combination is what makes the dashboard practically useful during real check-in prep.
We hope this Kaizen post is useful. If you have questions or suggestions, share them in the comments.