var mongoose = require('mongoose');

var ParkingSchema = mongoose.Schema({

    name: {
        type: String,
        required: true,
        unique: true,
        trim: true
    },

    number: {
        type: Number,
        required: true,
        trim: true
    },

    street: {
        type: String,
        required: true
    },

    zipcode: {
        type: Number,
        required: true
    },

    city: {
        type: String,
        required: true
    },

    country: {
        type: String,
        required: true
    },

    lat : {
        type : Number,
        required : true
    },

    long : {
        type : Number,
        required: true
    },

    nbSpots: {
        type: Number,
        default: 0
    }
});

var parking = mongoose.model('Parking', ParkingSchema);

module.exports = parking;