import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsInt, IsString, Min } from 'class-validator';

/**
 * 创建小组 DTO。
 */
export class CreateGroupDto {
  @ApiProperty({ description: '小组名称', example: 'A组' })
  @IsString({ message: 'name 必须是字符串' })
  name!: string;

  @ApiProperty({ description: '科室 ID', example: 1 })
  @Type(() => Number)
  @IsInt({ message: 'departmentId 必须是整数' })
  @Min(1, { message: 'departmentId 必须大于 0' })
  departmentId!: number;
}
