import { WagonStatus } from '@edr/types';
import { IsString, IsUUID, IsOptional, IsInt, Min, IsNumber, IsEnum } from 'class-validator';

export class CreateWagonDto {
  @IsString()
  wagonNumber!: string;

  @IsUUID()
  wagonTypeId!: string;

  @IsOptional()
  @IsUUID()
  trainId?: string;

  @IsOptional()
  @IsInt()
  @Min(1)
  sequenceNumber?: number;

  @IsNumber()
  @Min(0)
  tareWeight!: number;

  @IsNumber()
  @Min(0)
  maxPayloadWeight!: number;

  @IsOptional()
  @IsEnum(WagonStatus)
  status?: WagonStatus;

  @IsOptional()
  @IsUUID()
  currentYardId?: string;

  @IsOptional()
  @IsString()
  notes?: string;
}
