UNPKG

flexbiz-server

Version:

Flexible Server

4 lines (3 loc) 1.25 kB
'use strict';const calllogSchema=new Schema({id_app:{type:String,required:!0,maxlength:1024},phone:{type:String,required:!0,maxlength:32},extend:{type:String,maxlength:32},type:{type:String,maxlength:32},call_status:{type:String,required:!0,maxlength:32},callid:String,msgid:String,calldate:Date,recording:String,play:String,eplay:String,download:String,did:String,src:String,dst:String,note:String,disposition:String,lastapp:String,billsec:String,duration:String,duration_minutes:String,duration_seconds:String, hotline:{type:String,maxlength:32},id_kh:{type:String,maxlength:1024},exfields:Schema.Types.Mixed,status:{type:Boolean,default:!0},date_created:{type:Date,default:Date.now},date_updated:{type:Date,default:Date.now},user_created:{type:String,default:""},user_updated:{type:String,default:""},visible_to:{type:Number,default:0},visible_to_users:[String],update_right:[String],delete_right:[String]}); (global.configs||{}).createIndexes&&(calllogSchema.index({phone:1,ext:1,id_kh:1}),calllogSchema.index({phone:"text"},{name:"calllog_index"}),calllogSchema.index({status:1}),calllogSchema.index({user_created:1,visible_to:1,visible_to_users:1}));const model=mongoose.models.calllog||mongoose.model("calllog",calllogSchema);module.exports=model;