'use strict';
const bcrypt = require('bcryptjs');
const { v4: uuidv4 } = require('uuid');

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up (queryInterface, Sequelize) {
    const hashedPassword = await bcrypt.hash("SuperAdmin@123", 10);

    await queryInterface.bulkInsert("Admins", [{
      id: uuidv4(),
      fullName: "System Admin",
      email: "superadmin@airpero.com",
      password: hashedPassword,
      role: "superadmin",       
      status: "active",
      createdAt: new Date(),
      updatedAt: new Date(),
    }]);
  },

  async down (queryInterface, Sequelize) {
    await queryInterface.bulkDelete("Admins", { email: "superadmin@airpero.com" });
  }
};
