implement batch board notification system for schedule changes and updates

This commit is contained in:
Marshal
2026-07-12 12:01:05 +00:00
parent 4b7f6d2548
commit 84ba56f7d0
10 changed files with 195 additions and 32 deletions

View File

@@ -153,6 +153,16 @@ export class BookingWindowService implements OnModuleInit {
.update(s.id, { docReviewCompletedAt: now });
s.docReviewCompletedAt = now;
await this.advanceSchedule(s, effectiveWindowConfig(s, liveCfg), now);
// The batch fill emits only for trains it actually reserved onto — this
// covers the empty-pool case so every open board still refetches. Push
// failures only log; the doc-review completion itself already persisted.
try {
this.gateway.emitBatchChanged(s.id, 'doc_review_completed');
} catch (err) {
this.logger.warn(
`Batch-board push failed for ${s.id}: ${(err as Error).message}`,
);
}
}
const fresh = await this.trainSchedulesRepository.findById(scheduleId);
return fresh ?? schedule;