Merge pull request #887 from Tria-plc/alpha

Blocked seats report updates
This commit is contained in:
Stephanos A.
2026-07-21 21:21:31 +03:00
committed by GitHub

View File

@@ -496,10 +496,14 @@ export class ReportsService {
orderBy: { expiresAt: 'desc' }, 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({ const blocks = await this.prisma.seatBlock.findMany({
where: { where: {
scheduleId, OR: [
{ scheduleId },
{ scheduleId: null },
],
NOT: [ NOT: [
{ reason: { startsWith: 'MAINTENANCE:' } }, { reason: { startsWith: 'MAINTENANCE:' } },
{ blockedBy: 'system' }, { blockedBy: 'system' },