import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";
import mongoose from "mongoose";
import { IFilterBatch } from "./filter-batch.interface";


@Schema({ timestamps: true })
export class FilterBatch implements IFilterBatch {
    _id?: string | mongoose.Types.ObjectId;

    @Prop({ type: String, required: [true, 'Name is required'] })
    name: string;
    
    @Prop({ type: String, required: false })
    description: string;
    
    @Prop({ type: Object, required: false,  })
    questionFilterVersion: {
        version: mongoose.Types.ObjectId;
        selectedFrom: 'admin' | 'user';
    }
    
    @Prop({ type: Object, required: false })
    answerFilterVersion: {
        version: mongoose.Types.ObjectId;
        selectedFrom: 'admin' | 'user';
    }
    
    @Prop({ type: String, required: false })
    questionModel: string;
    
    @Prop({ type: String, required: false })
    answerModel: string;
    
    @Prop({ type: Number, required: false })
    questionTemperature: number;
    
    @Prop({ type: Number, required: false })
    answerTemperature: number;
    
    @Prop({ type: String, required: false })
    systemPrompt: string;
    
    
    @Prop({ type: Number, required: false, default: 0 })
    promptsCount: number;

    createdAt: Date;
    updatedAt: Date;
}

export const FilterBatchSchema = SchemaFactory.createForClass(FilterBatch);
