import { IsString, IsOptional, IsEnum, MinLength, MaxLength } from "class-validator";

/**
 * Valid status values for coordinator status updates
 */
export enum CoordinatorJobStatus {
  RUNNING = "RUNNING",
  PENDING = "PENDING",
}

/**
 * DTO for updating job status from the coordinator
 */
export class UpdateJobStatusDto {
  @IsEnum(CoordinatorJobStatus, { message: "status must be a valid CoordinatorJobStatus" })
  status!: CoordinatorJobStatus;

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

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