flexbiz-server
Version:
Flexible Server
6 lines (5 loc) • 1.89 kB
JavaScript
;const voucherSchema=new Schema({wallet_address:String,token:String,so_luong:Number,menh_gia:Number,gia_tri:Number,da_hoan_tra:Boolean,line:Number}),assbookingSchema=new Schema({id_app:String,ma_ct:{type:String,default:"ASSBOOKING"},so_ct:String,ngay_ct:{type:Date,default:Date.now},id_product:{type:String,required:!0,trim:!0},ten_san_pham:{type:String},user_hotel:String,ma_phong:{type:String,required:!0,uppercase:!0,trim:!0},ngay_nhan_phong:{type:Date,required:!0},so_dem:Number,don_gia_vc:Number,
id_period:String,so_luong_vc:Number,menh_gia:Number,gia_tri_can_thanh_toan:Number,voucher_thanh_toan:[voucherSchema],gia_tri_da_thanh_toan:Number,chenh_lech:Number,wallet_hotel:String,trang_thai:String,ks_xac_nhan_nhan_phong:Boolean,kh_xac_nhan_nhan_phong:Boolean,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.assbooking||
mongoose.model("assbooking",assbookingSchema);
(global.configs||{}).createIndexes&&(assbookingSchema.index({id_app:1}),assbookingSchema.index({so_ct:1}),assbookingSchema.index({denom:1}),assbookingSchema.index({token:1}),assbookingSchema.index({trang_thai:1}),assbookingSchema.index({id_product:1}),assbookingSchema.index({ten_san_pham:1}),assbookingSchema.index({ngay_nhan_phong:1}),assbookingSchema.index({user_hotel:1}),assbookingSchema.index({ma_phong:1}),assbookingSchema.index({id_period:1}),assbookingSchema.index({status:1}),assbookingSchema.index({user_created:1}),
assbookingSchema.index({creator:"text",token:"text",denom:"text",ten_san_pham:"text"},{name:"assbooking_index2"}),model.on("index",async function($err$$){$err$$?console.error("assbooking index error",$err$$):console.info("assbooking indexing complete")}));module.exports=model;