import { ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsInt, IsNumber, IsOptional, Min } from 'class-validator';

export class UpdateTrainSchedulingGlobalRulesDto {
  @ApiPropertyOptional({ example: 760 })
  @IsOptional()
  @Type(() => Number)
  @IsNumber()
  @Min(1)
  maxTrainLengthMeters?: number;

  @ApiPropertyOptional({ example: 3500 })
  @IsOptional()
  @Type(() => Number)
  @IsNumber()
  @Min(1)
  maxTrainWeightTons?: number;

  @ApiPropertyOptional({ example: 53 })
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @Min(1)
  maxWagonsPerTrain?: number;

  @ApiPropertyOptional({ example: 30 })
  @IsOptional()
  @Type(() => Number)
  @IsNumber()
  @Min(0.001)
  max20ftContainerWeightTons?: number;

  @ApiPropertyOptional({ example: 10 })
  @IsOptional()
  @Type(() => Number)
  @IsNumber()
  @Min(0)
  max20ftPairWeightDiffTons?: number;
}
