import { IsString, IsOptional, IsBoolean, IsIn, IsInt, IsNotEmpty } from "class-validator";

/**
 * DTO for creating a new quality gate
 */
export class CreateQualityGateDto {
  @IsString()
  @IsNotEmpty()
  name!: string;

  @IsOptional()
  @IsString()
  description?: string;

  @IsIn(["build", "lint", "test", "coverage", "custom"])
  type!: string;

  @IsOptional()
  @IsString()
  command?: string;

  @IsOptional()
  @IsString()
  expectedOutput?: string;

  @IsOptional()
  @IsBoolean()
  isRegex?: boolean;

  @IsOptional()
  @IsBoolean()
  required?: boolean;

  @IsOptional()
  @IsInt()
  order?: number;
}
