flexbiz-server
Version:
Flexible Server
5 lines (4 loc) • 1.63 kB
JavaScript
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},ma_kh:String,ten_kh:String,dia_chi:String,ds_dien_thoai_khac:String,dien_thoai:String,dien_thoai2:String,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({id_app:1,phone:1,extend:1}),calllogSchema.index({id_app:1,ma_kh:1,ten_kh:1}),calllogSchema.index({id_app:1,dien_thoai:1,dien_thoai2:1}),calllogSchema.index({id_app:1,phone:1,extend:1,id_kh:1}),calllogSchema.index({id_app:1,phone:"text"},{name:"calllog_index"}),calllogSchema.index({id_app:1,status:1}),calllogSchema.index({id_app:1,user_created:1,visible_to:1,visible_to_users:1}),calllogSchema.index({id_app:1,user_created:1,visible_to:1,visible_to_users:1,
phone:1}));const model=mongoose.models.calllog||mongoose.model("calllog",calllogSchema);module.exports=model;