import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsEnum, IsMongoId, IsOptional } from 'class-validator';
import { PaginationQueryDto } from '../../../common/dto/pagination-query.dto';
import {
  SUPPORT_TICKET_CATEGORIES,
  SUPPORT_TICKET_PRIORITIES,
  SUPPORT_TICKET_STATUSES,
  SupportTicketCategory,
  SupportTicketPriority,
  SupportTicketStatus,
} from '../schemas/support-ticket.schema';

export class SupportTicketQueryDto extends PaginationQueryDto {
  @ApiPropertyOptional({ enum: SUPPORT_TICKET_STATUSES })
  @IsOptional()
  @IsEnum(SUPPORT_TICKET_STATUSES)
  status?: SupportTicketStatus;

  @ApiPropertyOptional({ enum: SUPPORT_TICKET_CATEGORIES })
  @IsOptional()
  @IsEnum(SUPPORT_TICKET_CATEGORIES)
  category?: SupportTicketCategory;

  @ApiPropertyOptional({ enum: SUPPORT_TICKET_PRIORITIES })
  @IsOptional()
  @IsEnum(SUPPORT_TICKET_PRIORITIES)
  priority?: SupportTicketPriority;

  @ApiPropertyOptional()
  @IsOptional()
  @IsMongoId()
  userId?: string;
}
