import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsOptional, IsString, MaxLength, IsInt, IsUUID } from 'class-validator';

export class CreateAtributoValorDto {
  @ApiProperty({ example: 'uuid-del-atributo', description: 'ID del atributo padre' })
  @IsNotEmpty()
  @IsUUID()
  atributo_id: string;

  @ApiProperty({ example: 'Rojo', description: 'Valor del atributo' })
  @IsNotEmpty()
  @IsString()
  @MaxLength(100)
  valor: string;

  @ApiProperty({ example: 'ROJ', description: 'Código corto del valor', required: false })
  @IsOptional()
  @IsString()
  @MaxLength(20)
  codigo?: string;

  @ApiProperty({ example: '#FF0000', description: 'Color hex (solo para atributos de color)', required: false })
  @IsOptional()
  @IsString()
  @MaxLength(7)
  color_hex?: string;

  @ApiProperty({ example: 0, description: 'Orden de visualización', required: false })
  @IsOptional()
  @IsInt()
  orden?: number;
}
