From 208278bddbb4c5d15f4503a5466d514565b55df4 Mon Sep 17 00:00:00 2001 From: counterweight Date: Sun, 21 Dec 2025 17:53:47 +0100 Subject: [PATCH] Use MIN_ADVANCE_DAYS constant globally instead of hardcoded value - Updated availability.py to use MIN_ADVANCE_DAYS constant instead of hardcoded timedelta(days=1) - Ensures consistency between booking and availability date ranges - Both now use the same constant from shared_constants --- backend/routes/availability.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/routes/availability.py b/backend/routes/availability.py index d4598b3..a0912ce 100644 --- a/backend/routes/availability.py +++ b/backend/routes/availability.py @@ -15,16 +15,16 @@ from schemas import ( SetAvailabilityRequest, CopyAvailabilityRequest, ) -from shared_constants import MAX_ADVANCE_DAYS +from shared_constants import MIN_ADVANCE_DAYS, MAX_ADVANCE_DAYS router = APIRouter(prefix="/api/admin/availability", tags=["availability"]) def _get_date_range_bounds() -> tuple[date, date]: - """Get the valid date range for availability (tomorrow to +30 days).""" + """Get the valid date range for availability (using MIN_ADVANCE_DAYS to MAX_ADVANCE_DAYS).""" today = date.today() - min_date = today + timedelta(days=1) # Tomorrow + min_date = today + timedelta(days=MIN_ADVANCE_DAYS) max_date = today + timedelta(days=MAX_ADVANCE_DAYS) return min_date, max_date