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

const SESSION_MODES = ['active_recall', 'feynman', 'review', 'reading'] as const;

export class StartSessionDto {
  @ApiPropertyOptional({ description: '知识点 ID' })
  @IsOptional()
  @IsString()
  knowledgeItemId?: string;

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

  @ApiPropertyOptional({
    description: '学习模式',
    enum: SESSION_MODES,
    default: 'reading',
  })
  @IsOptional()
  @IsString()
  @IsIn(SESSION_MODES)
  mode?: string;
}
