var mongoose = require ('mongoose') ;

var vacationSchema = mongoose.Schema ({
    name: String,
    slug: String,
    category: String,
    sku: String,
    description: String,
    priceInCents: Number,
    tags: [String],
    inSeason: Boolean,
    available: Boolean,
    requiresWaiver: Boolean,
    maximumGuests: Number,
    notes: String,
    packagesSold: Number,
});

vacationSchema.method.getDisplayPrice = ()=> {
    return '$' + (this.priceInCents/100).toFixed(2);
};

var vacationModel = mongoose.model ('Vacation', vacationSchema);
module.exports = vacationModel;