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

export class CreateCategoryDto {
  @ApiProperty({ example: 'Deportes' })
  @IsString()
  @IsNotEmpty()
  name: string;

  @ApiProperty({ example: 'deportes' })
  @IsString()
  @IsNotEmpty()
  slug: string;

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

  @ApiProperty({ enum: CategoryType, example: CategoryType.TV })
  @IsEnum(CategoryType)
  @IsNotEmpty()
  type: CategoryType;

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