Sequelize Hooks is not triggering

I am facing an issue where the beforeCreate hook in my Sequelize model is not being triggered when I attempt to create a new record. I have defined hooks in my model, but it seems they are not executing as expected. Below is the detailed description of the problem and my setup.

/* eslint-disable no-await-in-loop */
/* eslint-disable no-use-before-define */
const Sequelize = require('sequelize');
const sequelize = require('../../config/database');
const { User } = require('./User');
const { Company } = require('./Company');

const hooks = {
  beforeCreate: async (project) => {
    console.log('Before Create Hook Triggered');
    console.log('Project before setting ID:', project);
    if (!project.project_id) {
      let uniqueIdentifier;
      let isUnique = false;

      while (!isUnique) {
        uniqueIdentifier = `P${Math.floor(100000 + Math.random() * 900000)
          .toString()
          .padStart(6, '0')}`;

        const existingProject = await Project.findOne({
          where: { project_id: uniqueIdentifier },
        });

        if (!existingProject) {
          isUnique = true;
        }
      }
      console.log('Generated Project ID:', uniqueIdentifier); // Debug log
      project.project_id = uniqueIdentifier;
      console.log('Project after setting ID:', project); // Debug log
    } else {
      console.log('Project ID already set:', project.project_id); // Debug log
    }
  },
  beforeValidate: (project) => {
    console.log('Before Validate Hook Triggered');
    if (!project.company_id) {
      if (!project.procurement_manager_id) {
        throw new Error('Internal Project: Procurement manager needed');
      }
      if (!project.project_manager_id) {
        throw new Error('Internal Project: Project manager needed');
      }
      if (!project.finance_manager_id) {
        throw new Error('Internal Project: Finance manager needed');
      }
    } else {
      if (project.procurement_manager_id) {
        throw new Error(
          'External Project: Procurement manager should not be set',
        );
      }
      if (project.project_manager_id) {
        throw new Error('External Project: Project manager should not be set');
      }
      if (project.finance_manager_id) {
        throw new Error('External Project: Finance manager should not be set');
      }
      if (!project.company_user_id) {
        throw new Error('External Project: Company user needed');
      }
    }
  },
};
const Project = sequelize.define(
  'project',
  {
    id: {
      type: Sequelize.UUID,
      primaryKey: true,
      allowNull: false,
      defaultValue: Sequelize.UUIDV4,
    },
    name: {
      type: Sequelize.STRING,
      allowNull: false,
      validate: {
        isUnique(value, next) {
          Project.findOne({
            where: {
              name: value,
              id: { [Sequelize.Op.ne]: this.id },
            },
          })
            .then((project) => {
              if (project) {
                return next('Sorry, This Project Already Exists');
              }
              return next();
            })
            .catch((err) => next(err));
        },
      },
    },
    contract_number: {
      type: Sequelize.STRING,
      allowNull: false,
    },
    description: {
      type: Sequelize.TEXT,
      allowNull: false,
    },
    status: {
      type: Sequelize.STRING,
      allowNull: false,
    },
    procurement_manager_id: {
      type: Sequelize.UUID,
      references: { model: User, key: 'id' },
    },
    project_manager_id: {
      type: Sequelize.UUID,
      references: { model: User, key: 'id' },
    },
    finance_manager_id: {
      type: Sequelize.UUID,
      references: { model: User, key: 'id' },
    },
    company_user_id: {
      type: Sequelize.UUID,
      references: { model: User, key: 'id' },
    },
    payment_status: {
      type: Sequelize.STRING,
      defaultValue: 'unpaid',
    },
    project_id: {
      type: Sequelize.STRING,
      allowNull: false,
      validate: {
        isUnique(value, next) {
          Project.findOne({
            where: {
              project_id: value,
              id: { [Sequelize.Op.ne]: this.id },
            },
          })
            .then((project) => {
              if (project) {
                return next('Sorry, This Project ID Already Exists');
              }
              return next();
            })
            .catch((err) => next(err));
        },
      },
    },
  },
  {
    hooks,
    timestamps: true,
    createdAt: 'created_at',
    updatedAt: 'updated_at',
  },
);

// Define associations
Project.belongsTo(User, {
  as: 'projectManager',
  foreignKey: 'project_manager_id',
});
Project.belongsTo(User, {
  as: 'procurementManager',
  foreignKey: 'procurement_manager_id',
});
Project.belongsTo(User, {
  as: 'financeManager',
  foreignKey: 'finance_manager_id',
});
Project.belongsTo(User, {
  as: 'companyUser',
  foreignKey: 'company_user_id',
});
Project.belongsTo(User, { foreignKey: 'user_id' });
Project.belongsTo(Company, { foreignKey: 'company_id' });
User.hasMany(Project, { foreignKey: 'user_id' });
Company.hasMany(Project, { foreignKey: 'company_id' });

module.exports = { Project };

Expected Behavior

The beforeCreate and beforeValidate hooks should trigger as expected, logging the relevant debug information to the console.

**Actual Behaviour **
The beforeValidate is only trigerring

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật