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

export class CreateCategoryDto {
  @ApiProperty()
  @IsString()
  @IsNotEmpty()
  categoryName!: string;

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

  @ApiProperty({ required: false, nullable: true, description: 'Parent category ID' })
  @IsOptional()
  @IsInt()
  @Min(1)
  parentCategoryId?: number;
}
