diff --git a/backend/src/routes/bookings.ts b/backend/src/routes/bookings.ts index baf17cd..ecd0e1d 100644 --- a/backend/src/routes/bookings.ts +++ b/backend/src/routes/bookings.ts @@ -82,11 +82,11 @@ const bookings: FastifyPluginAsync = async (fastify) => { status = 'confirmed', source = 'direct', total_amount, paid_amount = 0, notes, } = request.body - // Check for conflicts + // Check for conflicts (checked_out = early departure, doesn't block new booking) const { rows: conflicts } = await db.query( `SELECT id FROM bookings WHERE room_id = $1 - AND status NOT IN ('cancelled','no_show') + AND status NOT IN ('cancelled','no_show','checked_out') AND check_in < $2 AND check_out > $3`, [room_id, check_out, check_in], ) diff --git a/src/components/calendar/BookingCalendar.tsx b/src/components/calendar/BookingCalendar.tsx index 9dd2b4e..ef9bc53 100644 --- a/src/components/calendar/BookingCalendar.tsx +++ b/src/components/calendar/BookingCalendar.tsx @@ -386,7 +386,7 @@ export function BookingCalendar({ rooms, bookings, slug, onBookingCreate, onBook 'w-1.5 h-1.5 rounded-full', wsConnected ? 'bg-emerald-500' : 'bg-slate-300 dark:bg-slate-600 animate-pulse', )} /> - {wsConnected ? 'Синхронизация' : 'Офлайн'} + Синхронизация{!wsConnected && ': офлайн'} )} diff --git a/src/components/rooms/RoomContextMenu.tsx b/src/components/rooms/RoomContextMenu.tsx index b65b4ac..30140c6 100644 --- a/src/components/rooms/RoomContextMenu.tsx +++ b/src/components/rooms/RoomContextMenu.tsx @@ -131,8 +131,8 @@ export function RoomContextMenu({ room, x, y, onClose, onStatusChange, onHkStatu return createPortal(
e.preventDefault()} > {/* Header */}