UNPKG

flexbiz-server

Version:

Flexible Server

5 lines (4 loc) 1.35 kB
'use strict';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},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({ten_loai_cong:1}),dmloaicongSchema.index({ma_loai_cong:"text",ten_loai_cong:"text"},{name:"dmloaicong_index_text"}),dmloaicongSchema.index({status:1}),dmloaicongSchema.index({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;