mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-02 05:43:39 +00:00
intercity fix
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
import { ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsArray, IsOptional, IsUUID } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsArray, IsOptional, IsUUID, ValidateNested } from 'class-validator';
|
||||
|
||||
export class ConsistWagonSwitchDto {
|
||||
@ApiPropertyOptional({ format: 'uuid', description: 'Coupled wagon being taken out of the consist.' })
|
||||
@IsUUID()
|
||||
fromWagonId!: string;
|
||||
|
||||
@ApiPropertyOptional({ format: 'uuid', description: 'AVAILABLE same-type wagon from the current yard that takes its place (and its slot, cargo included).' })
|
||||
@IsUUID()
|
||||
toWagonId!: string;
|
||||
}
|
||||
|
||||
export class AdjustScheduleConsistDto {
|
||||
@ApiPropertyOptional({
|
||||
@@ -23,4 +34,15 @@ export class AdjustScheduleConsistDto {
|
||||
@IsArray()
|
||||
@IsUUID('all', { each: true })
|
||||
removeWagonIds?: string[];
|
||||
|
||||
@ApiPropertyOptional({
|
||||
type: [ConsistWagonSwitchDto],
|
||||
description:
|
||||
"Wagon swaps: the replacement takes over the outgoing wagon's position AND its slot, so cargo allocations ride the new wagon. This is how a LOADED wagon leaves the train — removal is blocked for it, switching is not. Replacement must be the same wagon type, AVAILABLE, standing in the train's current yard.",
|
||||
})
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => ConsistWagonSwitchDto)
|
||||
switches?: ConsistWagonSwitchDto[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user