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

/**
 * 更新小组 DTO。
 */
class UpdateGroupNameDto extends PartialType(
  OmitType(CreateGroupDto, ['departmentId'] as const),
) {}

export class UpdateGroupDto extends UpdateGroupNameDto {
  @ApiHideProperty()
  @IsOptional()
  @IsEmpty({ message: MESSAGES.ORG.GROUP_REPARENT_FORBIDDEN })
  departmentId?: unknown;
}
