import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import {
  IsIn,
  IsNotEmpty,
  IsOptional,
  IsString,
  MaxLength,
} from "class-validator";

export class PublicDecisionDto {
  @ApiProperty({ enum: ["aceptar", "rechazar"] })
  @IsIn(["aceptar", "rechazar"])
  decision: "aceptar" | "rechazar";

  @ApiProperty({ description: "Nombre de quien firma" })
  @IsString()
  @IsNotEmpty()
  @MaxLength(255)
  nombre: string;

  @ApiProperty({ description: "Firma en data URL" })
  @IsString()
  @IsNotEmpty()
  @MaxLength(1500000)
  firma: string;

  @ApiPropertyOptional({
    description: "Motivo si rechaza o comentario del cliente",
  })
  @IsOptional()
  @IsString()
  @MaxLength(1000)
  motivo?: string;
}
