var mongoose = require("mongoose");
var passportLocalMongoose = require("passport-local-mongoose");

const userRoleEnum = {};//setup later

var userSchema = new mongoose.Schema({
    email: String,
    password: String,
    role: String,
    first_name: String,
    last_name: String,
    phone: String,
    adress: String,
    country: String,
    city: String,
    zip: String,
    reset_pass_token: {
        token: { type: String },
        expiry: { type: Date, default: Date.now() + 3600000 }
    },
    confirmed: { type: Boolean, default: false }
});

userSchema.plugin(passportLocalMongoose, { usernameField: 'email' });
module.exports = mongoose.model("User", userSchema);
