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

export class CreateDanoDto {
  @ApiProperty({ description: "Zona del daño (frontal, lateral_izq, etc.)" })
  @IsNotEmpty()
  @IsString()
  @MaxLength(50)
  zona: string;

  @ApiProperty({ description: "ID del tipo de daño" })
  @IsNotEmpty()
  @IsInt()
  tipoDanoId: number;

  @ApiPropertyOptional({ description: "Descripción del daño" })
  @IsOptional()
  @IsString()
  descripcion?: string;

  @ApiPropertyOptional({ description: "Posición X en el SVG (%)" })
  @IsOptional()
  @IsNumber()
  posicionX?: number;

  @ApiPropertyOptional({ description: "Posición Y en el SVG (%)" })
  @IsOptional()
  @IsNumber()
  posicionY?: number;

  @ApiPropertyOptional({ description: "URL de la foto del daño" })
  @IsOptional()
  @IsString()
  @MaxLength(500)
  fotoUrl?: string;
}
