import { IsOptional, IsString, IsInt, Min, Max, IsEnum } from "class-validator";
import { Type } from "class-transformer";
import { EventType, ALL_EVENT_TYPES } from "../event-types";

/**
 * DTO for querying job events
 */
export class QueryEventsDto {
  @IsOptional()
  @IsEnum(ALL_EVENT_TYPES)
  type?: EventType;

  @IsOptional()
  @IsString()
  stepId?: string;

  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @Min(1)
  page?: number;

  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @Min(1)
  @Max(100)
  limit?: number;
}
