import { ApiProperty } from "@nestjs/swagger";
import { IsEnum, IsNotEmpty, IsString, MaxLength } from "class-validator";
import { DeviationSeveridad } from "../../control-plane/entities/schema-deviation.entity";

// Los 5 campos descriptivos (tabla/columna/tipos/alter) vienen del resultado
// de GET .../verificar que el frontend ya tiene en mano — se repiten aca en
// vez de recalcularlos, para que lo que quede guardado en SchemaDeviation
// sea EXACTAMENTE lo que el operador vio en pantalla cuando decidio omitir,
// no una version recalculada en otro momento que pudiera ya haber cambiado.
export class OmitDeviationDto {
  @ApiProperty()
  @IsString()
  @IsNotEmpty()
  @MaxLength(128)
  tabla: string;

  @ApiProperty()
  @IsString()
  @IsNotEmpty()
  @MaxLength(128)
  columna: string;

  @ApiProperty({ enum: DeviationSeveridad })
  @IsEnum(DeviationSeveridad)
  severidad: DeviationSeveridad;

  @ApiProperty()
  @IsString()
  @IsNotEmpty()
  @MaxLength(128)
  tipoEsperado: string;

  @ApiProperty()
  @IsString()
  @IsNotEmpty()
  @MaxLength(128)
  tipoReal: string;

  @ApiProperty()
  @IsString()
  @IsNotEmpty()
  alterSugerido: string;
}
