module.exports = function (sequelize, DataTypes) {
  const User = sequelize.define('User', {
    id: {
      primaryKey: true,
      type: DataTypes.UUID,
      defaultValue: DataTypes.UUIDV4
    },
    name: {
      unique: true,
      type: DataTypes.STRING,
      allowNull: false,
      validate: {
        notEmpty: true
      }
    },
    email: {
      type: DataTypes.STRING,
      allowNull: false,
      validate: {
        isEmail: true
      },
      roles: false
    },
    hashedPassword: {
      type: DataTypes.STRING,
      allowNull: false,
      validate: {
        notEmpty: true
      },
      roles: false
    }
  }, {
    classMethods: {
      associate (models) {
        User.hasMany(models.Bikeshed)
        User.hasMany(models.Vote)
      }
    }
  })

  return User
}

@@ -1,8 +1,42 @@
+const bcrypt = require('bcrypt')%0A%0A
 module.e
@@ -787,16 +787,457 @@
 s.Vote)%0A
+      %7D,%0A%0A      hashPassword (password) %7B%0A        return new Promise((resolve, reject) =%3E %7B%0A          bcrypt.hash(password, 8, (err, hash) =%3E %7B%0A            err ? reject(err) : resolve(hash)%0A          %7D)%0A        %7D)%0A      %7D,%0A%0A      comparePassword (password, hash) %7B%0A        return new Promise((resolve, reject) =%3E %7B%0A          bcrypt.compare(password, hash, (err, res) =%3E %7B%0A            err ? reject(err) : resolve(res)%0A          %7D)%0A        %7D)%0A
       %7D%0A

Add password functions to user model