import { ApiHideProperty, OmitType, PartialType } from '@nestjs/swagger';
import { CreateDepartmentDto } from './create-department.dto.js';
import { IsEmpty, IsOptional } from 'class-validator';
import { MESSAGES } from '../../common/messages.js';

/**
 * 更新科室 DTO。
 */
class UpdateDepartmentNameDto extends PartialType(
  OmitType(CreateDepartmentDto, ['hospitalId'] as const),
) {}

export class UpdateDepartmentDto extends UpdateDepartmentNameDto {
  @ApiHideProperty()
  @IsOptional()
  @IsEmpty({ message: MESSAGES.ORG.DEPARTMENT_REPARENT_FORBIDDEN })
  hospitalId?: unknown;
}
