flexbiz-server
Version:
Flexible Server
4 lines (3 loc) • 1.27 kB
JavaScript
;const templatestoreSchema=new Schema({func_code:{type:String,required:!0,lowercase:!0,maxlength:32,trim:!0},func_ref:{type:String,lowercase:!0,maxlength:32,trim:!0},code:{type:String,required:!0,trim:!0},title:{type:String,required:!0,maxlength:1024},description:{type:String,maxlength:4E3},picture:{type:String},data:Schema.Types.Mixed,price:{type:Number,default:0},currency:{type:String,default:"VND"},default_when_create_app:{type:Boolean,default:!1},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:""},visible_to:{type:Number,default:1},visible_to_users:[String],update_right:[String],delete_right:[String]});
(global.configs||{}).createIndexes&&(templatestoreSchema.index({code:1,title:1}),templatestoreSchema.index({func_code:1}),templatestoreSchema.index({func_ref:1}),templatestoreSchema.index({title:"text"},{name:"templateevoucher_index_text"}),templatestoreSchema.index({status:1}),templatestoreSchema.index({user_created:1,visible_to:1,visible_to_users:1}));const model=mongoose.models.templatestore||mongoose.model("templatestore",templatestoreSchema);module.exports=model;