text: const mongoose = require("mongoose");
  const bcrypt = require("bcryptjs");
  
  const userSchema = new mongoose.Schema(
    {
      name: {
        type: String,
        require: [true, "Please enter your name"],
      },
      email: {
        type: String,
        required: [true, "Please enter your email address"],
        lowercase: true,
      },
      phone: {
        type: Number,
      },
      address: {
        type: String,
      },
      profilePicture: {
        type: String,
      },
      password: {
        type: String,
      },
      isDeleted: {
        type: Boolean,
        default: false,
      },
      isEmailVerified: {
        type: Boolean,
        default: false,
      },
      token: {
        type: String,
      },
    },
    {
      timestamps: true,
    }
  );
  
  userSchema.methods.correctPassword = async function (
    candidatePassword,
    userPassword
  ) {
    return await bcrypt.compare(candidatePassword, userPassword);
  };
  
  module.exports = mongoose.model("User", userSchema);
  