const { DataTypes } = require("sequelize");
const sequelize = require("../db");

const Users = sequelize.define("Users", {
  fullname: {
    type: DataTypes.TEXT,
  },
  password: {
    type: DataTypes.TEXT,
  },
  email: {
    type: DataTypes.TEXT,
  },
  role: {
    type: DataTypes.ENUM,
    values: ["user", "admin", "visitor", "super-admin", "hr"],
  },
  phone: {
    type: DataTypes.TEXT,
    allowNull: true,
  },
  jobDesc: {
    type: DataTypes.TEXT,
  },
  department: {
    type: DataTypes.TEXT,
  },
  resetPasswordToken: {
    type: DataTypes.TEXT,
    allowNull: true,
  },
  resetPasswordExpires: {
    type: DataTypes.DATE,
    allowNull: true,
  },
  googleId: {
    type: DataTypes.STRING(255),
    allowNull: true,
  },
  microsoftId: {
    type: DataTypes.STRING(255),
    allowNull: true,
  },
  profilePicture: {
    type: DataTypes.TEXT,
    allowNull: true,
  },
},
{
  timestamps: true,
});

module.exports = Users;
