import { IsUUID, IsOptional, IsInt, Min, Max, IsString } from "class-validator";
import { Type } from "class-transformer";

/**
 * DTO for querying domains with filters and pagination
 */
export class QueryDomainsDto {
  @IsOptional()
  @IsUUID("4", { message: "workspaceId must be a valid UUID" })
  workspaceId?: string;

  @IsOptional()
  @IsString({ message: "search must be a string" })
  search?: string;

  @IsOptional()
  @Type(() => Number)
  @IsInt({ message: "page must be an integer" })
  @Min(1, { message: "page must be at least 1" })
  page?: number;

  @IsOptional()
  @Type(() => Number)
  @IsInt({ message: "limit must be an integer" })
  @Min(1, { message: "limit must be at least 1" })
  @Max(100, { message: "limit must not exceed 100" })
  limit?: number;
}
