feat: housekeeping automation — auto-task on checkout + room status on done
Backend: - Migration 023: housekeeping_settings table (checkout_auto, checkout_priority, inspection_after_clean) - New route: GET/PATCH /api/hotels/:slug/housekeeping-settings - bookings.ts: on checked_out → auto-create turnover task + mark room dirty + broadcast WS - housekeeping.ts: on task done → update room status (inspect|clean per setting) + broadcast WS - ws.ts: export broadcast() for use in other routes Frontend: - HousekeepingPage: load/save settings to API, live Loader on save button - useHotelSocket: add housekeeping WS message types - HousekeepingPage: subscribe to WS — new tasks appear instantly without refresh - BookingModal: show total section when room + nights selected (not just when total > 0) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
7
backend/migrations/023_housekeeping_settings.sql
Normal file
7
backend/migrations/023_housekeeping_settings.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
CREATE TABLE IF NOT EXISTS housekeeping_settings (
|
||||
hotel_id UUID PRIMARY KEY REFERENCES hotels(id) ON DELETE CASCADE,
|
||||
checkout_auto BOOLEAN NOT NULL DEFAULT true,
|
||||
checkout_priority VARCHAR(10) NOT NULL DEFAULT 'high',
|
||||
inspection_after_clean BOOLEAN NOT NULL DEFAULT true,
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
Reference in New Issue
Block a user