Guests could previously book for the same day or tomorrow. The earliest
selectable date is now today + 5 days, configured in one place via the
BOOKING_MIN_LEAD_DAYS constant.
- constants.php: new BOOKING_MIN_LEAD_DAYS define (5)
- Service_model::getAvailableTimes(): optional $minLeadDays param, returns
no slots for dates closer than that; defaults to 0 so existing callers
are unaffected
- Pages::ajax(): guest actions (getAvailableTimes, isTimeAvailable) pass the
constant. The admin action getAvailableTimeOptions deliberately does not,
so staff can still enter phone bookings for tomorrow.
- Pages::booking_process(): rejects an early booking_date POST and redirects
back to /booking, guarding against a stale page or a crafted request
- booking-form.php: datepicker minDate/defaultDate and the hidden
booking_date default all derive from the constant
Deployed and verified on test, dev and prod.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MyYsTAAA1kJLMLCResmgTE