mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 17:38:12 +00:00
changes
This commit is contained in:
@@ -263,14 +263,19 @@ export class BookingWindowService implements OnModuleInit {
|
||||
) {
|
||||
const paymentPhaseEndsAt = new Date(now.getTime() + cfg.paymentWindowMinutes * 60_000);
|
||||
await this.setPhase(schedule, { windowPhase: 'PAYMENT', paymentPhaseEndsAt });
|
||||
// Run the batch: priority fill over the route-day pool, reserving pay windows
|
||||
// (or allocating government) — skipped automatically for everyone who fits
|
||||
// is handled inside the fill (all fit → all reserved → all notified).
|
||||
await this.bookingBatchService.processRouteDay({
|
||||
const routeDay = {
|
||||
originYardId: schedule.originStationId,
|
||||
destinationYardId: schedule.destinationStationId,
|
||||
day: eatDay(schedule.scheduledDepartureDate),
|
||||
});
|
||||
};
|
||||
// Doc review is over: bookings staff never accepted (still pending) can no
|
||||
// longer make this train — expire them BEFORE the batch so they never
|
||||
// compete for capacity and never reach the pool.
|
||||
await this.bookingBatchService.expireUnacceptedForRouteDay(routeDay);
|
||||
// Run the batch: priority fill over the route-day pool, reserving pay windows
|
||||
// (or allocating government) — skipped automatically for everyone who fits
|
||||
// is handled inside the fill (all fit → all reserved → all notified).
|
||||
await this.bookingBatchService.processRouteDay(routeDay);
|
||||
this.logger.log(
|
||||
`Batch ran for schedule ${schedule.id}; payment phase until ${paymentPhaseEndsAt.toISOString()}`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user