const mongoose = require('mongoose')

function image(img) {
  if (img) return '/uploads/images/lottery/' + img
}

const LotteryPopUpSchema = mongoose.Schema({
  visible: { type: Boolean, default: true },
  x: { type: Number, default: 15 },
  y: { type: Number, default: 15 },
  w: { type: Number, default: 40 },
  h: { type: Number, default: 40 },
  bgImg: { type: String, get: image }
})

module.exports = mongoose.model('LotteryPopUp', LotteryPopUpSchema)
