Commit graph

7 commits

Author SHA1 Message Date
3c4bdd9a1c Room planner: fix category exclusion field name (category_id not site_category_id)
NewBook API returns category_id on site objects; exclusion check was using
the non-existent site_category_id field so excluded categories config never worked.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-04 12:09:16 +00:00
0d14473daf Room planner: add debug-room endpoint, fix next_status null check
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-04 11:54:32 +00:00
916dc50390 Room planner: fix next-bracket visibility and vacant room misdetection
Extend booking fetch window to day-after-tomorrow so tomorrow-arriving
bookings appear in nextBooking lookups (some NewBook regions exclude
arrivals exactly on period_to date, causing right brackets to not render).

Add booking_site_id fallback in site-ID matching so bookings are found
correctly even when NewBook returns booking_site_id instead of site_id in
the booking object (was causing some rooms to show as vacant).

Remove category debug logging (no longer needed).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-04 11:40:46 +00:00
b66b3a7854 Room planner: fix spans_next, night counter, and B2B booking priority
spans_next was using departure > viewDate (today), which made any 1-night
booking extend the card to the right. Fixed to departure > tomorrow so the
card only extends when it's also active tomorrow.

Night counter used Date.parse() on NewBook datetime strings, which browsers
parse as local time and shift off by hours in BST. Replaced with utcDay()
which slices the YYYY-MM-DD prefix and calls Date.UTC() — always correct.

When multiple bookings overlap today, prefer the one arriving today so an
arriving guest takes priority over a stale stopover. Also treat a co-active
non-arriving booking as the B2B departing context.

Force previous-day bracket to show as "departed" (purple) when that booking
departs today, without waiting for NewBook to update its status field.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-04 11:31:29 +00:00
663ef5d107 Room planner: flexible category field resolution + debug logging
Resolve NewBook category fields from site_category_id, category_id, or
category.id (whichever is present) so categories work regardless of which
naming convention the NewBook region uses. Log the first site's keys on
each /api/rooms request to confirm field names in docker compose logs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-04 11:13:33 +00:00
3c0eb5ae73 fix: pass task_type=[-1] to tasks_list — required param, -1 means all types
NewBook returns 412 if task_type is absent. The original dailylist plugin
always passes [-1] as a fallback when no specific types are configured.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-04 09:43:34 +00:00
1e658b6a48 feat: add room-planner app — 3-day HK room view with NewBook integration
NewBook-connected daily housekeeping planner. Replaces the hotelhubmodule-housekeeping-dailylist
WordPress plugin. LXC 120 · 10.10.10.120:3080 · slug: room-planner.

- 3-day booking window (yesterday/today/tomorrow) fetched live from NewBook
- Task completion ticks back to NewBook; room status patches NewBook directly
- 23px border sliver CSS system for adjacent-day booking status
- 3-state filter cycling (off→inclusive→exclusive) for categories and flow types
- Stat filters for outstanding tasks and clean/dirty status
- Rolling 48h activity log with checkout/checkin/status/tasks events
- newbook_pings event bus for future NewBook poller integration
- Room modal with permission-gated guest/rate/notes, task checkboxes, status buttons
- Placeholder sections for future linen-count and routine-tasks modules
- Settings page: task type colours, twin/extra-bed detection, category exclusions
- Mobile-first layout (sidebar desktop, compact top bar mobile)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-03 13:07:00 +00:00