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

export class CreateTagDto {
  @ApiProperty()
  @IsString()
  @IsNotEmpty()
  tagName!: string;

  @ApiProperty({
    required: false,
    nullable: true,
    description: 'Hex color, e.g. #FF0000',
    example: '#FF8800',
  })
  @IsOptional()
  @IsHexColor()
  tagColor?: string;

  @ApiProperty({
    required: false,
    nullable: true,
    description: 'Hex font color, e.g. #FFFFFF',
    example: '#FFFFFF',
  })
  @IsOptional()
  @IsHexColor()
  tagFontColor?: string;

  @ApiProperty({ required: false, nullable: true })
  @IsOptional()
  @IsString()
  timing?: string;

  @ApiProperty({ required: false, nullable: true, description: 'Tag group ID' })
  @IsOptional()
  @IsInt()
  @Min(1)
  tagGroupId?: number;

  @ApiProperty({ required: false, default: 0 })
  @IsOptional()
  @IsInt()
  @Min(0)
  sortOrder?: number;
}
