import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsString, IsOptional, MaxLength } from 'class-validator';

export class CreateImportDto {
  @ApiPropertyOptional({ description: '用户 ID', example: 'user-001' })
  @IsOptional()
  @IsString()
  userId?: string;

  @ApiPropertyOptional({ description: '知识库 ID' })
  @IsOptional()
  @IsString()
  knowledgeBaseId?: string;

  @ApiPropertyOptional({ description: '文件名', example: '笔记.pdf' })
  @IsOptional()
  @IsString()
  @MaxLength(500)
  fileName?: string;

  @ApiPropertyOptional({ description: '来源类型', example: 'file', default: 'file' })
  @IsOptional()
  @IsString()
  sourceType?: string;

  @ApiPropertyOptional({ description: '原始文本内容（直接文本导入时使用）' })
  @IsOptional()
  @IsString()
  rawText?: string;
}
