import { ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsInt, IsOptional, Min } from 'class-validator';
import { EmptyStringToUndefined } from '../../common/transforms/empty-string-to-undefined.transform.js';

/**
 * 可指派工程师查询 DTO：系统管理员可显式传医院范围。
 */
export class AssignableEngineerQueryDto {
  @ApiPropertyOptional({
    description: '医院 ID，仅系统管理员可选传',
    example: 1,
  })
  @IsOptional()
  @EmptyStringToUndefined()
  @Type(() => Number)
  @IsInt({ message: 'hospitalId 必须是整数' })
  @Min(1, { message: 'hospitalId 必须大于 0' })
  hospitalId?: number;
}
