Online Booking Cutoff Time should suppress same-day slots when cutoff has passed
Objective
- When Next Day Cutoff Time is configured, block all online booking — same-day and next-day — once that cutoff hour has passed for the current day.
- Close the gap where same-day slots remain available after the cutoff time because the cutoff logic currently applies to next-day slots only.
- Rename the setting label from "Next Day Cutoff Time" to "Online Booking Cutoff Time" with subtext clarifying it governs both same-day and next-day online availability.
- Additionally, brands would like to separate 'Display Day-of slots' between internal and online scheduler if possible as orders are getting scheduled online sometimes minutes before the start of an open slot.
Background
- Florida Home Inspection has
displayDayOfSlotsenabled andnextDayCutoffTimeInMinutesset to 2:00 PM (840 minutes). - On June 23, 2026, an online order was placed at 4:37 PM for a same-day inspection at 6:00 PM — 2.5 hours after the configured cutoff. Example order: 1008602138.
nextDayCutoffTimeInMinutescurrently suppresses next-day slots after the configured time but has no effect on same-day slots. Same-day slots remain exposed as long asdisplayDayOfSlotsis on, regardless of the time of day.- The intended behavior: once the cutoff time passes, no online booking of any kind is available — same-day or next-day.
- If
displayDayOfSlotsis off, same-day is already blocked entirely (enforced by ATT-1739); the cutoff has no additional role in that case. - ATT-1739 hardened same-day enforcement for the
displayDayOfSlots=offscenario and added confirm-time validation viavalidateBookingDatetime.ts. The combination ofdisplayDayOfSlots=on+ post-cutoff time was out of scope for that fix. - Same Day Online order Examples from Cat: 'One got booked at 10AM for 12noon, and the inspector wasnt ready. Wilmer was able to move it. And now, a booking came in at 11:41am and got booked for 12noon for Federico.'
Product Decisions
Locked
- Cutoff scope — When a cutoff time is configured and
displayDayOfSlotsis on, same-day slots must be hidden after the cutoff time, consistent with how next-day slots are already treated. displayDayOfSlotsoff — Same-day blocking is handled by existing logic; the cutoff setting has no additional effect in this case.- Settings label — Rename "Next Day Cutoff Time" to "Online Booking Cutoff Time" with subtext clarifying it applies to both same-day and next-day online availability.
Repro Steps
- Configure a company with
displayDayOfSlots= on andnextDayCutoffTimeInMinutes= 840 (2:00 PM). - After 2:00 PM, open the public online scheduler for that company.
- Observe that same-day time slots are still displayed and selectable.
- Complete a booking for a same-day slot.
- Expected: No same-day slots are available after 2:00 PM. The scheduler should show the next available day.
- Actual: Same-day slots remain available and a booking can be completed after the cutoff time.
Scope
Backend (attik-backend)
src/routes/schedule.ts—GET /schedule/optimal-slotsreturns same-day slots whendisplayDayOfSlotsis true regardless of whether the current time has passednextDayCutoffTimeInMinutes. Cutoff enforcement needs to apply to same-day slot exposure whendisplayDayOfSlotsis on.src/util/functions/scheduling/validateBookingDatetime.ts— Confirm-time validation added in ATT-1739. Should be extended to reject same-day datetimes submitted after the cutoff time, regardless ofdisplayDayOfSlotsstate.src/models/scheduleSettingsSchema.ts—nextDayCutoffTimeInMinutesanddisplayDayOfSlotsare defined here; no schema changes expected, but the interaction between these two fields is the root of the gap.
Frontend (attik-frontend)
src/app/scheduler/slots/CalendarView.tsx— AppliesnextDayCutoffTimeInMinutesas a client-side filter for next-day dates only. Needs to additionally suppress same-day slots whendisplayDayOfSlotsis on and the cutoff has passed.src/app/scheduler/slots/SlotsStep.tsx— Slot fetching and caching layer. If same-day suppression is enforced server-side, stale same-day slots should be cleared from cache when the cutoff time crosses.src/app/tools/settings/scheduling/SchedulingSettingsForm.tsx— Update label from "Next Day Cutoff Time" to "Online Booking Cutoff Time" with appropriate subtext.src/util/types/serverTypeCollection/scheduleSettings.ts— Frontend type definition for schedule settings; no change expected unless a new field is introduced.
References
- Example order: 1008602138
- Related: ATT-1739 — original scheduling window enforcement fix (Done, June 12)
- Backend:
attik-backend/src/routes/schedule.ts,attik-backend/src/util/functions/scheduling/validateBookingDatetime.ts,attik-backend/src/models/scheduleSettingsSchema.ts - Frontend:
attik-frontend/src/app/scheduler/slots/CalendarView.tsx,attik-frontend/src/app/scheduler/slots/SlotsStep.tsx,attik-frontend/src/app/tools/settings/scheduling/SchedulingSettingsForm.tsx
Status: Completed
Log in to comment and vote
No comments yet
Be the first to share your thoughts.