import { IsString, IsOptional, IsIn, IsObject } from "class-validator";

/**
 * DTO for querying stat card widget data
 */
export class StatCardQueryDto {
  @IsString({ message: "dataSource must be a string" })
  @IsIn(["tasks", "events", "projects"], {
    message: "dataSource must be one of: tasks, events, projects",
  })
  dataSource!: "tasks" | "events" | "projects";

  @IsString({ message: "metric must be a string" })
  @IsIn(["count", "completed", "overdue", "upcoming"], {
    message: "metric must be one of: count, completed, overdue, upcoming",
  })
  metric!: "count" | "completed" | "overdue" | "upcoming";

  @IsOptional()
  @IsObject({ message: "filter must be an object" })
  filter?: Record<string, unknown>;
}
