import { IsString, IsOptional, IsInt, IsBoolean, Length } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class CreateCategoryDto {
  @ApiProperty({ description: 'Category name' })
  @IsString()
  @Length(1, 100)
  name: string;

  @ApiProperty({ description: 'URL-friendly slug' })
  @IsString()
  @Length(1, 100)
  slug: string;

  @ApiPropertyOptional({ description: 'Category description' })
  @IsOptional()
  @IsString()
  description?: string;

  @ApiPropertyOptional({ description: 'Display order (lower = first)' })
  @IsOptional()
  @IsInt()
  display_order?: number;

  @ApiPropertyOptional({ description: 'Is category visible' })
  @IsOptional()
  @IsBoolean()
  visible?: boolean;
}
