small fix

This commit is contained in:
Marshal
2026-07-09 13:36:36 +00:00
parent eb819d66a1
commit 3afadcd9f2

View File

@@ -1073,11 +1073,16 @@ export class TrainSchedulingService {
containerPlacements ?? [],
);
// The link above puts these bookings on the train: they are SCHEDULED, not
// ELIGIBLE. Leaving them ELIGIBLE re-offers an allocated booking to the next
// batch fill, which unlinks it and frees its wagons on the next window cycle.
const scheduledAt = new Date();
for (const booking of bookings) {
await this.bookingsRepository.updateSchedulingFields(
booking.id,
{
schedulingStatus: SchedulingStatus.Eligible,
schedulingStatus: SchedulingStatus.Scheduled,
scheduledAt,
wagonsRequired: sumWagonsRequired(booking),
},
manager,