UNPKG

flexbiz-server

Version:

Flexible Server

5 lines (4 loc) 1.55 kB
'use strict';const assprofitsharingSchema=new Schema({id_app:String,creator:{type:String,required:!0,trim:!0},id:{type:String,trim:!0},id_product:{type:String,required:!0,trim:!0},ten_san_pham:{type:String},token:{type:String,lowercase:!0,trim:!0},id_period:String,denom:{type:String,required:!0,trim:!0},da_chia_loi_nhuan:Boolean,loi_nhuan_duoc_chia:Number,ngay_chia_loi_nhuan:Date,trang_thai:String,signature: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:""}}),model=mongoose.models.assprofitsharing||mongoose.model("assprofitsharing",assprofitsharingSchema); (global.configs||{}).createIndexes&&(assprofitsharingSchema.index({id_app:1}),assprofitsharingSchema.index({creator:1}),assprofitsharingSchema.index({id:1}),assprofitsharingSchema.index({id_product:1}),assprofitsharingSchema.index({id_period:1}),assprofitsharingSchema.index({token:1}),assprofitsharingSchema.index({ten_san_pham:1}),assprofitsharingSchema.index({denom:1}),assprofitsharingSchema.index({trang_thai:1}),assprofitsharingSchema.index({status:1}),assprofitsharingSchema.index({user_created:1}), assprofitsharingSchema.index({creator:"text",ten_san_pham:"text",ten_ky_han:"text",denom:"text"},{name:"assprofitsharing_index2"}),model.on("index",async function($err$$){$err$$?console.error("assprofitsharing index error",$err$$):console.info("assprofitsharing indexing complete")}));module.exports=model;