import { ApiPropertyOptional } from "@nestjs/swagger"
import { Type } from "class-transformer"
import { IsNumber, IsOptional, IsString } from "class-validator"

export class AppContentFilterDto {
  @ApiPropertyOptional({ description: "Search", example: "welcome" })
  @IsOptional()
  @IsString()
  search?: string

  @ApiPropertyOptional({
    description: "Number of records to retrieve",
    example: 10,
  })
  @IsOptional()
  @Type(() => Number)
  @IsNumber()
  take?: number

  @ApiPropertyOptional({ description: "Number of records to skip", example: 0 })
  @IsOptional()
  @Type(() => Number)
  @IsNumber()
  skip?: number
}
