// @ts-check
const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const EventSchema = new Schema({
  title: { type: String, required: true },
  start: { type: Date, required: true, index: true },
  end: { type: Date },
  place: String,
  teaser: String,
  cover: String,
  to: String,
  createdAt: { type: Date, default: Date.now }
}, { collection: 'events', versionKey: false });

var EventModel = module.exports = mongoose.model('Event', EventSchema);

