fix: photo URLs (CDN_HOST), booking conflict excludes checked_out, sync label, context menu overflow
This commit is contained in:
@@ -82,11 +82,11 @@ const bookings: FastifyPluginAsync = async (fastify) => {
|
|||||||
status = 'confirmed', source = 'direct', total_amount, paid_amount = 0, notes,
|
status = 'confirmed', source = 'direct', total_amount, paid_amount = 0, notes,
|
||||||
} = request.body
|
} = request.body
|
||||||
|
|
||||||
// Check for conflicts
|
// Check for conflicts (checked_out = early departure, doesn't block new booking)
|
||||||
const { rows: conflicts } = await db.query(
|
const { rows: conflicts } = await db.query(
|
||||||
`SELECT id FROM bookings
|
`SELECT id FROM bookings
|
||||||
WHERE room_id = $1
|
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`,
|
AND check_in < $2 AND check_out > $3`,
|
||||||
[room_id, check_out, check_in],
|
[room_id, check_out, check_in],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -386,7 +386,7 @@ export function BookingCalendar({ rooms, bookings, slug, onBookingCreate, onBook
|
|||||||
'w-1.5 h-1.5 rounded-full',
|
'w-1.5 h-1.5 rounded-full',
|
||||||
wsConnected ? 'bg-emerald-500' : 'bg-slate-300 dark:bg-slate-600 animate-pulse',
|
wsConnected ? 'bg-emerald-500' : 'bg-slate-300 dark:bg-slate-600 animate-pulse',
|
||||||
)} />
|
)} />
|
||||||
<span className="hidden sm:inline">{wsConnected ? 'Синхронизация' : 'Офлайн'}</span>
|
<span className="hidden sm:inline">Синхронизация{!wsConnected && ': офлайн'}</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -131,8 +131,8 @@ export function RoomContextMenu({ room, x, y, onClose, onStatusChange, onHkStatu
|
|||||||
return createPortal(
|
return createPortal(
|
||||||
<div
|
<div
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className="fixed z-[9999] w-60 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-600 rounded-xl shadow-xl overflow-hidden select-none"
|
className="fixed z-[9999] w-60 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-600 rounded-xl shadow-xl overflow-y-auto select-none"
|
||||||
style={{ left: menuX, top: menuY }}
|
style={{ left: menuX, top: menuY, maxHeight: `${Math.min(window.innerHeight - menuY - 16, window.innerHeight * 0.9)}px` }}
|
||||||
onContextMenu={e => e.preventDefault()}
|
onContextMenu={e => e.preventDefault()}
|
||||||
>
|
>
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
|
|||||||
Reference in New Issue
Block a user