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

/**
 * DTO for creating a new runner job
 */
export class CreateJobDto {
  @IsString({ message: "type must be a string" })
  @MinLength(1, { message: "type must not be empty" })
  @MaxLength(100, { message: "type must not exceed 100 characters" })
  type!: string;

  @IsOptional()
  @IsUUID("4", { message: "agentTaskId must be a valid UUID" })
  agentTaskId?: string;

  @IsOptional()
  @IsInt({ message: "priority must be an integer" })
  @Min(0, { message: "priority must be at least 0" })
  @Max(10, { message: "priority must not exceed 10" })
  priority?: number;

  @IsOptional()
  @IsObject({ message: "data must be an object" })
  data?: Record<string, unknown>;
}
