"use strict";

const bcrypt = require("bcrypt");

module.exports = {
  async up(queryInterface) {
    await queryInterface.bulkDelete('users', null, {});

    await queryInterface.bulkInsert(
      "users",
      [
        {
          id: 1,
          phone_number: "6281111111111",
          username: "superadmin@example.com",
          email: "superadmin@example.com",
          password: bcrypt.hashSync("6~$*N+{g}gPH?q2D", 10),
          active: true,
          role_id: 1,
        },
        {
          id: 2,
          phone_number: "-",
          username: "api@example.com",
          email: "api@example.com",
          password: bcrypt.hashSync("6~$*N+{g}gPH?q2D", 10),
          active: true,
          role_id: 2,
        },
        {
          id: 3,
          phone_number: "628222222222",
          username: "admin@example.com",
          email: "admin@example.com",
          password: bcrypt.hashSync("6~$*N+{g}gPH?q2D", 10),
          active: true,
          role_id: 2,
        },
        {
          id: 4,
          phone_number: "6283333333333",
          username: "staff@example.com",
          email: "staff@example.com",
          password: bcrypt.hashSync("6~$*N+{g}gPH?q2D", 10),
          active: true,
          role_id: 3,
        },
      ],
      {}
    );
  },
  async down(queryInterface) {
    await queryInterface.bulkDelete('users', null, {});
  },
};
