UNPKG

flexbiz-server

Version:

Flexible Server

5 lines (4 loc) 1.67 kB
const dmloaicongSchema=new Schema({id_app:{type:String,required:!0,maxlength:1024},stt:Number,ma_loai_cong:{type:String,required:!0,uppercase:!0,maxlength:32,trim:!0},ten_loai_cong:{type:String,required:!0,maxlength:1024},ngay_cong:{type:Number,default:0},ngay_phep:{type:Number,default:0},ngay_khong_luong:{type:Number,default:0},ngay_khong_phep:{type:Number,default:0},la_cong_lam_them:{type:Boolean,default:!1},tinh_phu_cap:{type:Boolean,default:!0},tong_gio_lam_tu:{type:Number,default:0},tong_gio_lam_den:{type:Number, default:0},gio_vao_toi_thieu:Date,gio_ra_toi_thieu:Date,nhung_ngay_trong_tuan:[String],color:{type:String,maxlength:32},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:""}}); (global.configs||{}).createIndexes&&(dmloaicongSchema.index({id_app:1,ma_loai_cong:1},{unique:!0}),dmloaicongSchema.index({id_app:1,ten_loai_cong:1}),dmloaicongSchema.index({id_app:1,tong_gio_lam_tu:-1,tong_gio_lam_den:1,gio_vao_toi_thieu:-1,gio_ra_toi_thieu:1,nhung_ngay_trong_tuan:1,status:1}),dmloaicongSchema.index({id_app:1,ma_loai_cong:"text",ten_loai_cong:"text"},{name:"dmloaicong_index_text"}),dmloaicongSchema.index({id_app:1,status:1}),dmloaicongSchema.index({id_app:1,user_created:1,visible_to:1, visible_to_users:1}));const model=mongoose.models.dmloaicong||mongoose.model("dmloaicong",dmloaicongSchema);model.referenceKeys={ma_loai_cong:[{model:"chamcong",key:"ma_loai_cong",error:"M\u00e3 lo\u1ea1i c\u00f4ng {{VALUE}} \u0111\u00e3 ph\u00e1t sinh d\u1eef li\u1ec7u"}]};module.exports=model;