import { IsISO8601, IsOptional, IsString, Matches, MaxLength } from 'class-validator';

export class DashboardPeriodQueryDto {
  @IsOptional()
  @Matches(/^\d{4}-\d{2}-\d{2}$/)
  @IsISO8601({ strict: true })
  periodStart?: string;

  @IsOptional()
  @Matches(/^\d{4}-\d{2}-\d{2}$/)
  @IsISO8601({ strict: true })
  periodEnd?: string;
}

export class DashboardGanttQueryDto extends DashboardPeriodQueryDto {
  @IsOptional()
  @IsString()
  @MaxLength(50)
  building?: string;
}
