import { ApiProperty } from '@nestjs/swagger';
import { ArrayMinSize, IsArray, IsUUID } from 'class-validator';

export class UpdateTrainLocomotivesDto {
  @ApiProperty({
    type: [String],
    format: 'uuid',
    description: 'Full replacement locomotive set (minimum 2), in consist order',
  })
  @IsArray()
  @ArrayMinSize(2, { message: 'A train must be pulled by at least two locomotives' })
  @IsUUID('all', { each: true })
  locomotiveIds!: string[];
}
