import { ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsInt, IsOptional, Min } from 'class-validator';
import { CreateSurgeryDeviceDto } from './create-surgery-device.dto.js';

export class UpdateSurgeryDeviceDto extends CreateSurgeryDeviceDto {
  @ApiPropertyOptional({
    description: '已存在的手术设备编号，编辑手术时必传',
    example: 12,
  })
  @IsOptional()
  @Type(() => Number)
  @IsInt({ message: 'devices.id 必须为整数' })
  @Min(1, { message: 'devices.id 必须大于 0' })
  id?: number;
}
