import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document, Types } from 'mongoose';
import moment from 'moment';
import * as Model from './index';
import { Users } from './user.schema';
// const types= [null, 'USER', 'ADMIN','SELLER']
const device_types = [null, 'IOS', 'ANDROID', 'WEB'];

@Schema()
export class CallTranscript extends Document {

    @Prop({ type: Types.ObjectId, ref: 'calls', default: null })
    call_id: Types.ObjectId = null;

    @Prop({ type: String, default: null })
    stream_id: string = null;

    @Prop({ type: String, default: "user" })
    role: string

    @Prop({ type: String, default: null })
    text: string;

    @Prop({ type: Boolean, default: false })
    is_delete: boolean;

    @Prop({ type: Boolean, default: false })
    is_send: boolean;

    @Prop({ default: moment().utc().valueOf() })
    updated_at: number = moment().utc().valueOf();
  
    @Prop({ default: moment().utc().valueOf() })
    created_at: number = moment().utc().valueOf();
}

export const callTranscriptSchema = SchemaFactory.createForClass(CallTranscript);
