No description
Find a file
jtricerolph 99ec8b9747 Fix same-day turnover: pick the most-active booking per site, not just the first
pollOnce() previously collapsed multiple bookings overlapping today for one site
down to a single candidate before computing room_state, with a weak tie-break
(prefer 'arrived' status, else whichever the API happened to return first). On a
same-day turnover — departing guest + incoming guest both returned by NewBook's
'staying' list for the same site — if neither was marked 'arrived' yet, this could
arbitrarily lock onto the incoming guest's booking (still in 'booked', prep not
started) instead of the departing guest's (which should be 'cooling_down'), even
though the departing guest was the one actually still checked into the room.

Now every candidate booking for a site is evaluated (each zone applies its own
offsets, so this only resolves once we have the zone), and the state machine picks
whichever produces the most active result: occupied > heating_up > cooling_down >
booked > vacant. Zero behaviour change for the common single-booking-per-site case.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-25 09:55:35 +00:00
backend Fix same-day turnover: pick the most-active booking per site, not just the first 2026-08-25 09:55:35 +00:00
docs Add Phase 2 MHI Modbus register-map profile, xlsx importer, and a 2026-07-27 14:19:58 +00:00
frontend Add global occupied/vacant default templates with per-room overrides 2026-08-25 09:48:28 +00:00
.gitignore Add Phase 2 MHI Modbus register-map profile, xlsx importer, and a 2026-07-27 14:19:58 +00:00
docker-compose.yml hvac: fetch MQTT credentials from Settings (drop .env secret) 2026-08-13 13:42:58 +00:00
seed-app.js Scaffold Phase 1 hvac app — NewBook-driven room TRV heating scheduler 2026-07-26 18:00:42 +00:00