fix issue

This commit is contained in:
Marshal
2026-08-02 10:26:36 +00:00
parent 53d8655dc3
commit ff772fddef
63 changed files with 10927 additions and 14 deletions

View File

@@ -1632,6 +1632,18 @@ export class BookingBatchService implements OnModuleInit {
for (const b of candidates) {
if (!pinnedIds.has(b.id)) bookings.push(b);
}
// Expiry frees the schedule pin (expire() nulls train_schedule_id), so
// expired bookings match neither query above — merge them back so the
// board keeps its expired lane. Display-only: boardState maps them to
// EXPIRED, which every capacity meter already excludes.
const expiredPool =
await this.bookingsRepository.findExpiredByCorridorDay(
stops,
eatDay(s.scheduledDepartureDate),
);
for (const b of expiredPool) {
if (!pinnedIds.has(b.id)) bookings.push(b);
}
} catch (err) {
// The board must still render the pinned bookings.
this.logger.warn(