const mongoose = require('mongoose') function image(img) { return '/uploads/images/icon/' + img } const StoreInfoSchema = mongoose.Schema({ title: {type: String , default: ''}, // image: {type: String, get: image}, caption: String, message : {type : String , default:''}, socials : { whatsaap : {type : String ,default : ''}, twitter : {type : String ,default : ''}, facebook : {type : String ,default : ''}, instagram : {type : String ,default : ''}, googlePlus : {type : String ,default : ''}, }, email : String, shippingCost : Number, shippingType : {type : Boolean , default: true}, /// true yani sabet va false yani bar asas kilometer tel : String, address : String, location : { type: {type : String , default : 'Point'} , coordinates: [Number]}, tax : {type : Boolean , default : true}, closeStore : {type : Boolean , default : false}, firstStartTime : {type : String , default : '12:00'}, firstEndTime : {type : String , default : '15:00'}, secondStartTime : {type : String , default : '17:00'}, secondEndTime : {type : String , default : '22:00'}, utcStartTime : {type : String , default : '8:30'}, utcEndTime : {type : String , default : '18:30'}, timezone : {type : String , default : 'Asia/Tehran'}, usePointWhenPay : {type : Boolean , default : false}, userRegistrationScore : {type : Number , default : 0}, userEmailVerifyScore : {type : Number , default : 0}, pointBirthDate : {type : Number , default : 0}, pointMarriageDate : {type : Number , default : 0}, invitePoint : {type : Number , default : 0}, pointForBuy : {type : Number , default : 0}, totalPricePoint : {type : Number , default : 0}, priceForChange : {type : Number , default : 0}, pointForChange : {type : Number , default : 0}, limitPrice : {type : Number , default : 0}, useSpecialMenu : {type : Boolean , default : true}, updateApp : {type : String , default : null}, active : {type : Boolean , default : true} }) StoreInfoSchema.index({'location': '2dsphere'}); module.exports = mongoose.model('StoreInfo', StoreInfoSchema)