From f969e5d242c2a6b0399cfc424a6ff4b6ddf4aa2f Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 8 May 2026 07:48:13 -0400 Subject: [PATCH] feat: configurable booking lead time in admin (default 48h) Adds leadTimeHours to HoursConfig. Slot generation, calendar minDate, and pickup disabled-date precomputation all read from the config. Admin hours page has a new input to adjust it without a redeploy. Co-Authored-By: Claude Sonnet 4.6 --- estore/src/app/admin/page.tsx | 20 ++++++++++++++++++++ estore/src/components/CartDrawer.tsx | 7 ++++--- estore/src/components/DeliveryDatePicker.tsx | 18 +++++++++++------- estore/src/lib/hours-config.ts | 2 ++ estore/src/lib/hours.ts | 1 + estore/src/lib/slots.ts | 10 ++++++---- 6 files changed, 44 insertions(+), 14 deletions(-) diff --git a/estore/src/app/admin/page.tsx b/estore/src/app/admin/page.tsx index e04a1f6..b326dd6 100644 --- a/estore/src/app/admin/page.tsx +++ b/estore/src/app/admin/page.tsx @@ -281,6 +281,26 @@ function HoursEditor() { ))} +
+ +

+ Minimum notice required before a delivery or pickup can be booked. Dates within this window are greyed out on the calendar. +

+ setConfig((prev) => prev ? { ...prev, leadTimeHours: Math.max(1, parseInt(e.target.value) || 48) } : prev)} + style={{ width: 100 }} + /> + hours +
+