schedule logic

This commit is contained in:
Marshal
2026-06-10 09:22:57 +00:00
parent 0335555892
commit 088295d81f
23 changed files with 1766 additions and 319 deletions

View File

@@ -0,0 +1,34 @@
import { ApiProperty } from '@nestjs/swagger';
import { TrainCheckpointKind } from '@edr/types';
import {
IsEnum,
IsInt,
IsISO8601,
IsOptional,
IsString,
MaxLength,
Min,
} from 'class-validator';
export class RecordCheckpointDto {
@ApiProperty({ description: 'Station position along the route (0 = origin).' })
@IsInt()
@Min(0)
sequenceNo!: number;
@ApiProperty({ enum: TrainCheckpointKind, required: false })
@IsOptional()
@IsEnum(TrainCheckpointKind)
kind?: TrainCheckpointKind;
@ApiProperty({ required: false, description: 'ISO timestamp; defaults to now.' })
@IsOptional()
@IsISO8601()
occurredAt?: string;
@ApiProperty({ required: false })
@IsOptional()
@IsString()
@MaxLength(500)
note?: string;
}