import { IsNumber, IsOptional, IsString, Min, Max, MinLength, MaxLength } from "class-validator";

/**
 * DTO for updating job progress from the coordinator
 */
export class UpdateJobProgressDto {
  @IsNumber({}, { message: "progressPercent must be a number" })
  @Min(0, { message: "progressPercent must be at least 0" })
  @Max(100, { message: "progressPercent must not exceed 100" })
  progressPercent!: number;

  @IsOptional()
  @IsString({ message: "currentStep must be a string" })
  @MinLength(1, { message: "currentStep must not be empty" })
  @MaxLength(255, { message: "currentStep must not exceed 255 characters" })
  currentStep?: string;

  @IsOptional()
  @IsNumber({}, { message: "tokensUsed must be a number" })
  @Min(0, { message: "tokensUsed must be at least 0" })
  tokensUsed?: number;
}
