import { IsOptional, IsString, IsEnum, IsInt, Min } from 'class-validator';
import { ApiPropertyOptional } from '@nestjs/swagger';
import { CategoryType } from '../../common/enums';

export class UpdateCategoryDto {
  @ApiPropertyOptional({ example: 'Deportes HD' })
  @IsOptional()
  @IsString()
  name?: string;

  @ApiPropertyOptional({ example: 'deportes-hd' })
  @IsOptional()
  @IsString()
  slug?: string;

  @ApiPropertyOptional({ example: '🏀' })
  @IsOptional()
  @IsString()
  icon?: string;

  @ApiPropertyOptional({ enum: CategoryType })
  @IsOptional()
  @IsEnum(CategoryType)
  type?: CategoryType;

  @ApiPropertyOptional({ example: 1 })
  @IsOptional()
  @IsInt()
  @Min(0)
  order?: number;
}
