mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 00:52:50 +00:00
auto allocation and batch managemnt, tracking the train
This commit is contained in:
@@ -22,6 +22,7 @@ import { PreviewBulkTrainScheduleDto } from './dto/preview-bulk-train-schedule.d
|
||||
import { PreviewContainerTrainScheduleDto } from './dto/preview-container-train-schedule.dto';
|
||||
import { PreviewTrainScheduleDto } from './dto/preview-train-schedule.dto';
|
||||
import { RecordCheckpointDto } from './dto/record-checkpoint.dto';
|
||||
import { AvailableLocomotivesQueryDto } from './dto/available-locomotives-query.dto';
|
||||
import { BookableSchedulesQueryDto } from './dto/bookable-schedules-query.dto';
|
||||
import { UpdateTrainSchedulingGlobalRulesDto } from './dto/update-train-scheduling-global-rules.dto';
|
||||
import { TrainSchedulingService } from './train-scheduling.service';
|
||||
@@ -64,6 +65,22 @@ export class TrainSchedulingController {
|
||||
return this.bookingBatchService.getBatchBoard();
|
||||
}
|
||||
|
||||
@Get('batch-board/:scheduleId')
|
||||
@TrainSchedulingView()
|
||||
@ApiOperation({ summary: 'Batch board detail for one schedule with EAT 3h windows' })
|
||||
getBatchBoardDetail(@Param('scheduleId', ParseUUIDPipe) scheduleId: string) {
|
||||
return this.bookingBatchService.getBatchBoardDetail(scheduleId);
|
||||
}
|
||||
|
||||
@Get('available-locomotives')
|
||||
@TrainSchedulingView()
|
||||
@ApiOperation({
|
||||
summary: 'List AVAILABLE locomotives filtered by route corridor readiness',
|
||||
})
|
||||
getAvailableLocomotives(@Query() query: AvailableLocomotivesQueryDto) {
|
||||
return this.trainSchedulingService.getAvailableLocomotivesForRoute(query.routeId);
|
||||
}
|
||||
|
||||
@Get('bookable-schedules')
|
||||
@TrainSchedulingView()
|
||||
@ApiOperation({ summary: 'OPEN same-route schedules a new booking can target' })
|
||||
@@ -191,7 +208,14 @@ export class TrainSchedulingController {
|
||||
@ApiOperation({ summary: 'Manually run the batch fill for a schedule' })
|
||||
async runBatch(@Param('id', ParseUUIDPipe) id: string) {
|
||||
await this.bookingBatchService.fillSchedule(id);
|
||||
return this.trainSchedulingService.getContainerTrainScheduleById(id);
|
||||
return this.bookingBatchService.getBatchBoardDetail(id);
|
||||
}
|
||||
|
||||
@Post('schedules/:id/run-allocation')
|
||||
@TrainSchedulingManage()
|
||||
@ApiOperation({ summary: 'Run wagon-level allocation for all eligible linked bookings' })
|
||||
async runAllocation(@Param('id', ParseUUIDPipe) id: string) {
|
||||
return this.bookingBatchService.runWagonAllocation(id);
|
||||
}
|
||||
|
||||
@Patch('schedules/:id/booking-window')
|
||||
|
||||
Reference in New Issue
Block a user