UNPKG

flexbiz-server

Version:

Flexible Server

10 lines (9 loc) 4.06 kB
'use strict';const dmhoahonghdSchema=new Schema({id_app:{type:String,required:!0,maxlength:1024},loai:{type:String,default:"0"},ten_loai:String,yeu_cau_ma_gioi_thieu:{type:Boolean},kieu:{type:String,default:"0"},ten_kieu:String,doi_tuong:{type:String,default:"0"},hinh_thuc_tt:{type:String,default:"0"},tk_no:String,tk_co:String,do_uu_tien:{type:Number,default:0},ma_hoahong:{type:String,uppercase:!0,required:!0,maxlength:32},ten_hoahong:{type:String,required:!0,maxlength:1024},mieu_ta:{type:String}, chi_su_dung_cho_ct:{type:String,uppercase:!0},khong_su_dung_cho_ct:{type:String,uppercase:!0},user_group:String,ma_nv:{type:String,default:"",maxlength:32},ten_nv:String,ma_bp:{type:String,default:"",maxlength:1024},ten_bp:String,ma_kh:{type:String,default:"",maxlength:32},ten_kh:String,nh_kh:{type:String,default:"",maxlength:1024},ten_nh_kh:String,nh_kh2:{type:String,default:"",maxlength:1024},ten_nh_kh2:String,nh_kh3:{type:String,default:"",maxlength:1024},ten_nh_kh3:String,nh_kh4:{type:String, default:"",maxlength:1024},ten_nh_kh4:String,nh_kh5:{type:String,default:"",maxlength:1024},ten_nh_kh5:String,ma_kho:{type:String,default:"",maxlength:32},ten_kho:String,gt_tu:{type:Number,default:0},gt_den:{type:Number,default:0},vts:[],nvts:[],nvts2:[],nvts3:[],nvts4:[],sl_toi_thieu:{type:Number,default:0},ty_le_giam_gia_max:{type:Number,default:0},tien_hh:{type:Number,default:0},ty_le_hh:{type:Number,default:0},tien_hh_ngt:{type:Number,default:0},ty_le_hh_ngt:{type:Number,default:0},tien_hh_c2:{type:Number, default:0},ty_le_hh_c2:{type:Number,default:0},so_tien_max:{type:Number,default:0},tien_hh2:{type:Number,default:0},ty_le_hh2:{type:Number,default:0},tien_hh2_ngt:{type:Number,default:0},ty_le_hh2_ngt:{type:Number,default:0},hieu_luc_tu:{type:Date,required:!0},hieu_luc_den:{type:Date,required:!0},details_km:[],picture:{type:String},exfields:Schema.Types.Mixed,newsfeed:{type:Boolean,default:!0},online:{type:Boolean},offline:{type:Boolean},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:""},ma_kh_id:{type:Schema.Types.ObjectId,ref:"customer",localField:["ma_kh"],foreignField:["ma_kh"]},ma_kho_id:{type:Schema.Types.ObjectId,ref:"dmkho",localField:["ma_kho"],foreignField:["ma_kho"]}}); (global.configs||{}).createIndexes&&(dmhoahonghdSchema.index({id_app:1,ma_hoahong:1,ma_kho:1,ma_kh:1,hieu_luc_tu:-1,hieu_luc_den:-1}),dmhoahonghdSchema.index({gt_tu:1}),dmhoahonghdSchema.index({gt_den:1}),dmhoahonghdSchema.index({ten_kho:1}),dmhoahonghdSchema.index({nh_kh:1}),dmhoahonghdSchema.index({ten_nh_kh:1}),dmhoahonghdSchema.index({nh_kh2:1}),dmhoahonghdSchema.index({ten_nh_kh2:1}),dmhoahonghdSchema.index({nh_kh3:1}),dmhoahonghdSchema.index({ten_nh_kh3:1}),dmhoahonghdSchema.index({nh_kh4:1}), dmhoahonghdSchema.index({ten_nh_kh4:1}),dmhoahonghdSchema.index({nh_kh5:1}),dmhoahonghdSchema.index({ten_nh_kh5:1}),dmhoahonghdSchema.index({ma_nv:1}),dmhoahonghdSchema.index({ma_bp:1}),dmhoahonghdSchema.index({user_group:1}),dmhoahonghdSchema.index({kieu:1}),dmhoahonghdSchema.index({loai:1}),dmhoahonghdSchema.index({do_uu_tien:1}),dmhoahonghdSchema.index({vts:1}),dmhoahonghdSchema.index({nvts:1}),dmhoahonghdSchema.index({nvts2:1}),dmhoahonghdSchema.index({nvts3:1}),dmhoahonghdSchema.index({nvts4:1}), dmhoahonghdSchema.index({date_updated:-1}),dmhoahonghdSchema.index({date_created:-1}),dmhoahonghdSchema.index({user_created:1}),dmhoahonghdSchema.index({online:1}),dmhoahonghdSchema.index({offline:1}),dmhoahonghdSchema.index({mieu_ta:"text",ma_hoahong:"text",ten_hoahong:"text",ma_kh:"text",ten_kh:"text",nh_kh:"text",ten_nh_kh:"text",ma_kho:"text",ten_kho:"text",ma_nv:"text",ten_nv:"text",ma_bp:"text",ten_bp:"text"},{name:"dmhoahonghd_index_text"}),dmhoahonghdSchema.set("toObject",{virtuals:!0}),dmhoahonghdSchema.set("toJSON", {virtuals:!0}),dmhoahonghdSchema.index({status:1}));const model=mongoose.models.dmhoahonghd||mongoose.model("dmhoahonghd",dmhoahonghdSchema);module.exports=model;