import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsOptional, IsString } from 'class-validator';
import { PaginationDto } from 'src/config/pagination/paginationDto';

/**
 * DTO used to search and filter user settings with pagination support.
 *
 * Extends PaginationDto to include standard pagination parameters like
 * page number and page size.
 */
export class SearchUserSettingsDto extends PaginationDto {
  /**
   * Optional search query string.
   *
   * - Can be used to perform a text search on user settings
   *   (e.g., by setting name or other searchable fields).
   * - Optional field; when omitted, all user settings are returned
   *   according to pagination parameters.
   */
  @ApiPropertyOptional()
  @IsOptional()
  @IsString()
  q?: string;
}
