import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsEnum, IsMongoId, IsOptional, IsString } from 'class-validator';
import { ModerationStatus } from '../../../common/enums/moderation-status.enum';
import { CommentQueryDto } from './comment-query.dto';

export class AdminCommentQueryDto extends CommentQueryDto {
  @ApiPropertyOptional({ description: 'Search comment content' })
  @IsOptional()
  @IsString()
  q?: string;

  @ApiPropertyOptional({ description: 'Optional post filter' })
  @IsOptional()
  @IsMongoId()
  postId?: string;

  @ApiPropertyOptional({ description: 'Optional author filter' })
  @IsOptional()
  @IsMongoId()
  authorId?: string;

  @ApiPropertyOptional({ enum: ModerationStatus, description: 'Optional moderation status filter' })
  @IsOptional()
  @IsEnum(ModerationStatus)
  moderationStatus?: ModerationStatus;
}
