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 displayDayOfSlots enabled and nextDayCutoffTimeInMinutes set 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.
  • nextDayCutoffTimeInMinutes currently suppresses next-day slots after the configured time but has no effect on same-day slots. Same-day slots remain exposed as long as displayDayOfSlots is 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 displayDayOfSlots is 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=off scenario and added confirm-time validation via validateBookingDatetime.ts. The combination of displayDayOfSlots=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

  1. Cutoff scope — When a cutoff time is configured and displayDayOfSlots is on, same-day slots must be hidden after the cutoff time, consistent with how next-day slots are already treated.
  2. displayDayOfSlots off — Same-day blocking is handled by existing logic; the cutoff setting has no additional effect in this case.
  3. 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

  1. Configure a company with displayDayOfSlots = on and nextDayCutoffTimeInMinutes = 840 (2:00 PM).
  2. After 2:00 PM, open the public online scheduler for that company.
  3. Observe that same-day time slots are still displayed and selectable.
  4. Complete a booking for a same-day slot.
  5. Expected: No same-day slots are available after 2:00 PM. The scheduler should show the next available day.
  6. Actual: Same-day slots remain available and a booking can be completed after the cutoff time.

Scope

Backend (attik-backend)

  • src/routes/schedule.tsGET /schedule/optimal-slots returns same-day slots when displayDayOfSlots is true regardless of whether the current time has passed nextDayCutoffTimeInMinutes. Cutoff enforcement needs to apply to same-day slot exposure when displayDayOfSlots is 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 of displayDayOfSlots state.
  • src/models/scheduleSettingsSchema.tsnextDayCutoffTimeInMinutes and displayDayOfSlots are 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 — Applies nextDayCutoffTimeInMinutes as a client-side filter for next-day dates only. Needs to additionally suppress same-day slots when displayDayOfSlots is 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

Please authenticate to join the conversation.

Upvoters
Status

Planned

Board
🏠

Main App

Date

About 24 hours ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.