Blocked seats report updates

This commit is contained in:
Stephanos A
2026-07-21 21:19:55 +03:00
parent 053b2ffaf6
commit 2a40b01651

View File

@@ -496,10 +496,14 @@ export class ReportsService {
orderBy: { expiresAt: 'desc' },
});
// Manually blocked seats from back office — exclude MAINTENANCE and system-created blocks
// Manually blocked seats — schedule-scoped blocks for this schedule OR global blocks (scheduleId null)
// Exclude MAINTENANCE and booking-system-created blocks
const blocks = await this.prisma.seatBlock.findMany({
where: {
scheduleId,
OR: [
{ scheduleId },
{ scheduleId: null },
],
NOT: [
{ reason: { startsWith: 'MAINTENANCE:' } },
{ blockedBy: 'system' },