From 3b441280b83da3da1abcd1d1c75d3f64b466844d Mon Sep 17 00:00:00 2001 From: Charles Pizzato <311327716+modernitconsultants@users.noreply.github.com> Date: Sat, 15 Aug 2026 19:22:32 +1000 Subject: [PATCH] fix(front-desk): the tape chart hides guests who are already in-house MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fortnight view queried arrivalDateFrom / arrivalDateTo, which asks "who arrives during this window". That silently omits every guest who arrived before it and is still in the hotel — on a tape chart, the people most likely to be looked up. A guest who checked in yesterday for a week vanishes from today's view. A stay overlaps the window when it arrives before the window ends AND departs after it starts, so the filter becomes arrivalDateTo + departureDateFrom. Both are already accepted by ListReservationsDto; only the dashboard was asking the narrower question. Nothing else changes: same endpoint, same window, same rendering. Co-Authored-By: Claude Fable 5 --- apps/dashboard/src/pages/Reservations.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/src/pages/Reservations.tsx b/apps/dashboard/src/pages/Reservations.tsx index e8750a9..6d9a193 100644 --- a/apps/dashboard/src/pages/Reservations.tsx +++ b/apps/dashboard/src/pages/Reservations.tsx @@ -820,7 +820,16 @@ function AvailabilityCalendar() { const { data: resData } = useQuery({ queryKey: ['reservations', 'calendar', propertyId, format(startDate, 'yyyy-MM-dd')], queryFn: () => api.get('/v1/reservations', { - params: { propertyId, arrivalDateFrom: format(startDate, 'yyyy-MM-dd'), arrivalDateTo: format(addDays(startDate, 13), 'yyyy-MM-dd') }, + // OVERLAP, not arrival-within. Filtering on arrivalDateFrom asks "who + // arrives during this fortnight", which silently omits every guest who + // arrived before it and is still in the hotel — the people most likely to + // be looked up on a tape chart. A stay overlaps the window when it + // arrives before the window ends AND departs after it starts. + params: { + propertyId, + arrivalDateTo: format(addDays(startDate, 13), 'yyyy-MM-dd'), + departureDateFrom: format(startDate, 'yyyy-MM-dd'), + }, }).then((r) => r.data), enabled: !!propertyId, });