flexbiz-server
Version:
Flexible Server
7 lines (6 loc) • 2.24 kB
JavaScript
;const kbmlcttgtSchema=new Schema({id_app:{type:String,required:!0,maxlength:1024},id_rptform:{type:String},stt:{type:Number,required:!0},ma_so:{type:String,required:!0,uppercase:!0},chi_tieu:{type:String,required:!0},chi_tieu2:{type:String},thuyet_minh:{type:String},print:{type:Boolean,default:!0},bold:{type:Boolean,default:!1},phan_loai:{type:String,require:!0,enum:["1","2"]},cach_tinh:{type:String,required:!0,enum:"12345678".split("")},tk_no:[String],tk_co:[String],giam_tru_no:{type:Boolean,
default:!1},giam_tru_co:{type:Boolean,default:!1},khong_am:{type:Boolean,default:!1},bu_tru_cong_no:{type:Boolean,default:!1},cong_thuc:{type:String},cong_thuc_so_kn:{type:String},cong_thuc_so_kn_nt:{type:String},cong_thuc_so_kt:{type:String},cong_thuc_so_kt_nt:{type:String},so_kn:{type:Number},so_kt:{type:Number},so_kn_nt:{type:Number},so_kt_nt:{type:Number},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:""}});
kbmlcttgtSchema.validate={cach_tinh:[function($id_app$$,$value$$,$callback$$){"1"==$value$$||"2"==$value$$||"3"==$value$$?$callback$$(!0):$callback$$(!1)},"C\u00e1ch t\u00ednh:1-M\u00e3 s\u1ed1,2-Tinh theo s\u1ed1 ph\u00e1t sinh,3-Tinh theo s\u1ed1 d\u01b0 \u0111\u1ea7u k\u1ef3,4-T\u00ednh theo s\u1ed1 d\u01b0 n\u1ee3 \u0111\u1ea7u k\u1ef3,5-T\u00ednh theo s\u1ed1 d\u01b0 c\u00f3 \u0111\u1ea7u k\u1ef3,6-T\u00ednh theo s\u1ed1 d\u01b0 cu\u1ed1i k\u1ef3,7-T\u00ednh theo s\u1ed1 d\u01b0 n\u1ee3 cu\u1ed1i k\u1ef3,8-T\u00ednh theo s\u1ed1 d\u01b0 c\u00f3 cu\u1ed1i k\u1ef3"],phan_loai:[function($id_app$$,
$value$$,$callback$$){"1"==$value$$||"2"==$value$$?$callback$$(!0):$callback$$(!1)},"Ph\u00e2n lo\u1ea1i:1-chi,2-thu"]};(global.configs||{}).createIndexes&&(kbmlcttgtSchema.index({id_app:1,stt:1,ma_so:1}),kbmlcttgtSchema.index({id_rptform:1}),kbmlcttgtSchema.index({ma_so:"text",chi_tieu:"text",chi_tieu2:"text",thuyet_minh:"text"},{name:"kbmlcttgt_index_text"}),kbmlcttgtSchema.index({status:1}),kbmlcttgtSchema.index({user_created:1,visible_to:1,visible_to_users:1}));
module.exports=mongoose.models.kbmlcttgt||mongoose.model("kbmlcttgt",kbmlcttgtSchema);