feat: 15-minute rental slots + compact calendar cell display

- Rental bookings now use minutes since midnight (start_hour/end_hour
  store e.g. 495 for 8:15, 570 for 9:30) — DB migration 017
- Buffer applied in exact minutes (no hour ceiling): 15min buffer after
  9:00 booking → next slot available at 9:15
- Calendar cell: removed working-hours line (8:00–22:00), now shows
  colored dot + compact time per booking (8–10, 8:15–9:15)
- Time selects show HH:MM format for 15-min intervals

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-21 23:02:24 +03:00
parent 370fe8a9a9
commit db05898c08
5 changed files with 121 additions and 88 deletions

View File

@@ -696,26 +696,21 @@ export function BookingCalendar({ rooms, bookings, slug, onBookingCreate, onBook
) : dayBookings.length > 0 ? (
/* Hourly bookings — squares + times */
<div className="absolute inset-x-1 top-1.5 flex flex-col gap-0.5">
{/* One colored square per booking */}
<div className="flex gap-0.5 flex-wrap">
{dayBookings.map(b => (
<div
key={b.id}
className={cn('w-3 h-3 rounded-[3px]', obj.color)}
title={`${b.guestName} · ${b.startHour}:00${b.endHour}:00`}
/>
))}
</div>
{/* Working hours range */}
<span className="text-[9px] text-slate-400 dark:text-slate-500 leading-none">
{obj.openHour}:00{obj.closeHour}:00
</span>
{/* Booked time slots */}
{dayBookings.map(b => (
<span key={b.id} className="text-[9px] text-slate-600 dark:text-slate-300 font-medium leading-none">
{b.startHour}{b.endHour}
</span>
))}
{/* One colored dot per booking + its time */}
{dayBookings.map(b => {
const fmtT = (min: number) => {
const h = Math.floor(min / 60), m = min % 60
return m === 0 ? `${h}` : `${h}:${String(m).padStart(2,'0')}`
}
return (
<div key={b.id} className="flex items-center gap-0.5">
<div className={cn('w-2.5 h-2.5 rounded-[3px] shrink-0', obj.color)} />
<span className="text-[9px] text-slate-700 dark:text-slate-200 font-medium leading-none truncate">
{fmtT(b.startHour)}{fmtT(b.endHour)}
</span>
</div>
)
})}
</div>
) : (
/* Empty — show "+" hint on hover */