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>
8 lines
374 B
SQL
8 lines
374 B
SQL
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()
|
|
);
|