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 Calls extends Document {
  @Prop({ type: String, default: 'CALL' })
  type: string = null;

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

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

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

  @Prop({ type: String, default: 'ACTIVE' })
  status: string;

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

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

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

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

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

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

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

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

export const CallSchema = SchemaFactory.createForClass(Calls);
