mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 11:21:18 +00:00
feat(bookings): enhance operation request flow and add location selection for first/last mile
This commit is contained in:
@@ -216,6 +216,26 @@ export class BookingBatchService implements OnModuleInit {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fire-and-forget batch pipeline for a (route, day) directly — used when a
|
||||
* booking enters the pool without a target train yet (e.g. after the
|
||||
* operations team accepts an operation request). The booking is already
|
||||
* FULLY_EXECUTED with its scheduled_date set, so the day-level fill will pick
|
||||
* it up; this just runs that fill immediately instead of waiting for the cron.
|
||||
*/
|
||||
enqueueRouteDayProcessing(
|
||||
originYardId: string,
|
||||
destinationYardId: string,
|
||||
day: string,
|
||||
): void {
|
||||
void this.processRouteDay({ originYardId, destinationYardId, day }).catch(
|
||||
(err) =>
|
||||
this.logger.error(
|
||||
`processRouteDay for ${originYardId}→${destinationYardId} on ${day} failed: ${(err as Error).message}`,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/** Resolve a schedule's (route, day) group and run the day-level pipeline. */
|
||||
private async processRouteDayForSchedule(scheduleId: string): Promise<void> {
|
||||
const schedule = await this.trainSchedulesRepository.findById(scheduleId);
|
||||
|
||||
Reference in New Issue
Block a user