UNPKG

flexbiz-server

Version:

Flexible Server

6 lines (5 loc) 1.88 kB
'use strict';const sosanxuatSchema=new global.Schema({id_app:{type:String,required:!0,maxlength:1024},id_ct:{type:String,maxlength:1024},ma_dvcs:{type:String,required:!0,maxlength:1024},ma_ct:{type:String,uppercase:!0,maxlength:32,trim:!0},ma_gd:{type:String,default:"0",maxlength:32,trim:!0},so_ct:{type:String,required:!0,uppercase:!0,trim:!0,maxlength:32},ngay_ct:{type:Date,default:Date.now,required:!0},id_lenhsx:{type:String,maxlength:1024,trim:!0},id_contract:{type:String,maxlength:1024,trim:!0}, ma_kh:{type:String,maxlength:32,trim:!0},ma_sp:{type:String,maxlength:1024,trim:!0},ma_dvt_sp:{type:String,maxlength:32,trim:!0},ma_cong_doan:{type:String,maxlength:32,trim:!0},stt:Number,ma_bp:String,sl_yc:Number,sl_ht:Number,dien_giai:{type:String,default:"",maxlength:1024},exfields:global.Schema.Types.Mixed,trang_thai:{type:String,maxlength:32},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&&(sosanxuatSchema.index({id_app:1,ma_dvcs:1,so_ct:-1,ngay_ct:-1}),sosanxuatSchema.index({ma_ct:1}),sosanxuatSchema.index({id_ct:1}),sosanxuatSchema.index({trang_thai:1}),sosanxuatSchema.index({id_lenhsx:1}),sosanxuatSchema.index({id_contract:1}),sosanxuatSchema.index({ma_kh:1}),sosanxuatSchema.index({ma_sp:1}),sosanxuatSchema.index({ma_cong_doan:1}),sosanxuatSchema.index({ma_bp:1}),sosanxuatSchema.index({user_created:1,date_created:-1}),sosanxuatSchema.index({date_updated:-1}), sosanxuatSchema.index({status:1}),sosanxuatSchema.index({user_created:1,visible_to:1,visible_to_users:1}));module.exports=global.mongoose.models.sosanxuat||global.mongoose.model("sosanxuat",sosanxuatSchema);