UNPKG

flexbiz-server

Version:

Flexible Server

4 lines (3 loc) 1.2 kB
'use strict';const floorSchema=new Schema({id_app:{type:String,required:!0,maxlength:1024},floor_code:{type:String,required:!0,uppercase:!0,maxlength:32},floor_name:{type:String,required:!0,maxlength:1024},floor_name_en:{type:String,maxlength:1024},floor_type:String,floor_type_en:String,stt:{type:Number,default:0},picture:{type:String,maxlength:1024},short_description:String,description:String,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:0},visible_to_users:[String],visible_to_usergroups:[String],update_right:[String],delete_right:[String],dataview_to:{type:Number,default:0},dataview_to_users:[String]}); (global.configs||{}).createIndexes&&(floorSchema.index({id_app:1,floor_code:1}),floorSchema.index({floor_code:"text",floor_name:"text"}),floorSchema.index({status:1}),floorSchema.index({visible_to_usergroups:1}),floorSchema.index({user_created:1,visible_to:1,visible_to_users:1}));const model=mongoose.models.floor||mongoose.model("floor",floorSchema);module.exports=model;