import { JobStepStatus } from "@prisma/client";
import { IsEnum, IsString, IsOptional, IsInt, Min } from "class-validator";

/**
 * DTO for updating a job step
 */
export class UpdateStepDto {
  @IsOptional()
  @IsEnum(JobStepStatus, { message: "status must be a valid JobStepStatus" })
  status?: JobStepStatus;

  @IsOptional()
  @IsString({ message: "output must be a string" })
  output?: string;

  @IsOptional()
  @IsInt({ message: "tokensInput must be an integer" })
  @Min(0, { message: "tokensInput must be at least 0" })
  tokensInput?: number;

  @IsOptional()
  @IsInt({ message: "tokensOutput must be an integer" })
  @Min(0, { message: "tokensOutput must be at least 0" })
  tokensOutput?: number;
}
