mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 16:28:12 +00:00
30 lines
905 B
TypeScript
30 lines
905 B
TypeScript
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
import { IsNotEmpty, IsOptional, IsString, MaxLength } from 'class-validator';
|
|
|
|
/**
|
|
* Edit a built train's display identity: its name and its fixed import/export
|
|
* run numbers. Composition (yard, locomotives, wagons) has its own endpoints.
|
|
* Omitted fields keep their current value; an empty trainName clears the name.
|
|
*/
|
|
export class UpdateTrainDetailsDto {
|
|
@ApiPropertyOptional({ description: 'Display name; empty string clears it' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(100)
|
|
trainName?: string;
|
|
|
|
@ApiPropertyOptional({ description: 'Fixed IMPORT (even) run number' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MaxLength(20)
|
|
importTrainNumber?: string;
|
|
|
|
@ApiPropertyOptional({ description: 'Fixed EXPORT (odd) run number' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MaxLength(20)
|
|
exportTrainNumber?: string;
|
|
}
|