mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 10:10:57 +00:00
schedule logic
This commit is contained in:
@@ -21,6 +21,7 @@ import { PinWagonsDto } from './dto/pin-wagons.dto';
|
||||
import { PreviewBulkTrainScheduleDto } from './dto/preview-bulk-train-schedule.dto';
|
||||
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 { UpdateTrainSchedulingGlobalRulesDto } from './dto/update-train-scheduling-global-rules.dto';
|
||||
import { TrainSchedulingService } from './train-scheduling.service';
|
||||
|
||||
@@ -161,6 +162,30 @@ export class TrainSchedulingController {
|
||||
return this.trainSchedulingService.dispatchSchedule(id);
|
||||
}
|
||||
|
||||
@Get('schedules/:id/checkpoints')
|
||||
@TrainSchedulingView()
|
||||
@ApiOperation({ summary: 'Get the tracking corridor + logged checkpoints for a train' })
|
||||
getScheduleCheckpoints(@Param('id', ParseUUIDPipe) id: string) {
|
||||
return this.trainSchedulingService.getScheduleCheckpoints(id);
|
||||
}
|
||||
|
||||
@Post('schedules/:id/checkpoints')
|
||||
@TrainSchedulingManage()
|
||||
@ApiOperation({ summary: 'Log the train passing a station (final station triggers arrival)' })
|
||||
recordCheckpoint(
|
||||
@Param('id', ParseUUIDPipe) id: string,
|
||||
@Body() dto: RecordCheckpointDto,
|
||||
) {
|
||||
return this.trainSchedulingService.recordCheckpoint(id, dto);
|
||||
}
|
||||
|
||||
@Post('schedules/:id/arrive')
|
||||
@TrainSchedulingManage()
|
||||
@ApiOperation({ summary: 'Mark a dispatched train arrived (flip readiness, free assets)' })
|
||||
arriveSchedule(@Param('id', ParseUUIDPipe) id: string) {
|
||||
return this.trainSchedulingService.arriveSchedule(id);
|
||||
}
|
||||
|
||||
@Get('container/schedules')
|
||||
@TrainSchedulingView()
|
||||
@ApiOperation({ summary: 'List container train schedules' })
|
||||
|
||||
Reference in New Issue
Block a user