feat: notifications API, auto-jobs, calendar housekeeping fixes
Backend: - notifications table (024 migration) — stores per-hotel notifications - GET/PATCH/POST/DELETE /api/hotels/:slug/notifications endpoints - createNotification() helper used by jobs + future hooks - jobs.ts — background tasks every 10min: auto-cancel no-shows and auto-checkout overdue stays based on hotel_settings, broadcasts WS events and creates notifications for each automated action Frontend: - CalendarPage: handle housekeeping_done WS → update room status in calendar in real-time (bug fix) - CalendarPage: when manually setting room to dirty via context menu, auto-create housekeeping task and broadcast via WS (bug fix) - NotificationsContext: replaced mock data with real API integration, polls every 60s, syncs markRead/delete to backend - SettingsPage booking section: auto-cancel no-show toggle + hours selector; auto-checkout toggle + hours selector - api.ts: notifications API methods - useHotelSocket: notification:new WS message type Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ export type WsMessage =
|
||||
| { type: 'housekeeping_task_created'; task: Record<string, unknown> }
|
||||
| { type: 'housekeeping_updated'; task: Record<string, unknown> }
|
||||
| { type: 'housekeeping_done'; taskId: string; roomId: string; roomStatus: string }
|
||||
| { type: 'notification:new'; notification: Record<string, unknown> }
|
||||
|
||||
interface Options {
|
||||
slug: string
|
||||
|
||||
Reference in New Issue
Block a user