import {
  IsString,
  IsNotEmpty,
  IsOptional,
  IsEnum,
  IsObject,
  IsNumber,
  Min,
  Max,
} from 'class-validator';
import { VoiceFeedbackAction } from '../../../database/entities';

export class SaveVoiceFeedbackDto {
  @IsString()
  @IsOptional()
  childId?: string;

  @IsString()
  @IsOptional()
  activityId?: string;

  @IsString()
  @IsNotEmpty()
  transcript: string;

  @IsString()
  @IsOptional()
  language?: string;

  @IsString()
  @IsNotEmpty()
  extractedType: string;

  @IsObject()
  @IsNotEmpty()
  extractedData: Record<string, any>;

  @IsNumber()
  @Min(0)
  @Max(1)
  @IsOptional()
  confidence?: number;

  @IsEnum(VoiceFeedbackAction)
  @IsNotEmpty()
  action: VoiceFeedbackAction;

  @IsString()
  @IsOptional()
  finalType?: string;

  @IsObject()
  @IsOptional()
  finalData?: Record<string, any>;

  @IsString()
  @IsOptional()
  userNotes?: string;
}
