// models/User.js
import { DataTypes } from "sequelize";
import sequelize from "../lib/sequelize.js";

const User = sequelize.define("User", {
  
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true,
  },

  role: {
    type: DataTypes.STRING,
    defaultValue: 'user',
    allowNull:false,
        
  },

  name: {
    type: DataTypes.STRING,
    allowNull: false,
    
  },

  email: {
    type: DataTypes.STRING,
    allowNull: false,
    unique:true,

  },

  
  name: {
    type: DataTypes.STRING,
    allowNull: false,
    
  },

  
  password: {
    type: DataTypes.STRING,
    allowNull: false,
    
  },

  
  avatar: {
    type: DataTypes.STRING,
    allowNull: true,
  },

  isEmailVerified: {
    type: DataTypes.TINYINT,
    defaultValue: 0,
  },


  phone: {
    type: DataTypes.STRING,
    allowNull: true,
  },
  
  createdAt: { type: DataTypes.DATE, allowNull: true },
  updatedAt: { type: DataTypes.DATE, allowNull: true },
});



export default User;