Booking overlap detection
Le problème
Two users booking the same room for overlapping times caused conflicts.
Comment je l'ai résolu
Service-layer query checking active bookings with overlapping time ranges before insert.
const conflict = await prisma.booking.findFirst({
where: { roomId, status: 'ACTIVE',
startTime: { lt: endTime }, endTime: { gt: startTime } },
});
if (conflict) throw new ConflictException('Room already booked');


