const { v4: uuid } = require('uuid');

module.exports = {
  /**
   * @param{import("sequelize").QueryInterface} queryInterface
   * @return {Promise<void>}
   */
  async up(queryInterface) {
    const createdAt = new Date();
    const updatedAt = new Date();

    /** @type {Map<string, string>} */
    const idMap = new Map();

    /**
     * @param {string} key
     * @return {string}
     */
    function getId(key) {
      if (idMap.has(key)) {
        return idMap.get(key);
      }
      const id = uuid();
      idMap.set(key, id);
      return id;
    }

    await queryInterface.bulkInsert('roles', [
      {
        id: getId('SuperAdmin'),
        name: 'Super Administrator',
        createdAt,
        updatedAt,
      },

      {
        id: getId('Administrator'),
        name: 'Administrator',
        createdAt,
        updatedAt,
      },

      {
        id: getId('SystemArchitect'),
        name: 'System Architect',
        createdAt,
        updatedAt,
      },

      {
        id: getId('OperationsDirector'),
        name: 'Operations Director',
        createdAt,
        updatedAt,
      },

      {
        id: getId('FinanceController'),
        name: 'Finance Controller',
        createdAt,
        updatedAt,
      },

      {
        id: getId('HRSpecialist'),
        name: 'HR Specialist',
        createdAt,
        updatedAt,
      },

      {
        id: getId('SalesExecutive'),
        name: 'Sales Executive',
        createdAt,
        updatedAt,
      },
    ]);

    /**
     * @param {string} name
     */
    function createPermissions(name) {
      return [
        {
          id: getId(`CREATE_${name.toUpperCase()}`),
          createdAt,
          updatedAt,
          name: `CREATE_${name.toUpperCase()}`,
        },
        {
          id: getId(`READ_${name.toUpperCase()}`),
          createdAt,
          updatedAt,
          name: `READ_${name.toUpperCase()}`,
        },
        {
          id: getId(`UPDATE_${name.toUpperCase()}`),
          createdAt,
          updatedAt,
          name: `UPDATE_${name.toUpperCase()}`,
        },
        {
          id: getId(`DELETE_${name.toUpperCase()}`),
          createdAt,
          updatedAt,
          name: `DELETE_${name.toUpperCase()}`,
        },
      ];
    }

    const entities = [
      'users',
      'assets',
      'employees',
      'financial_records',
      'inventories',
      'manufacturing_orders',
      'procurements',
      'projects',
      'sales',
      'subscriptions',
      'invoices',
      'payments',
      'contracts',
      'shipments',
      'warehouses',
      'payrolls',
      'attendance',
      'leave_requests',
      'recruitment',
      'budgets',
      'taxes',
      'expenses',
      'revenues',
      'leads',
      'tickets',
      'marketing_campaigns',
      'audit_logs',
      'notifications',
      'roles',
      'permissions',
      'companies',
      ,
    ];
    await queryInterface.bulkInsert(
      'permissions',
      entities.flatMap(createPermissions),
    );
    await queryInterface.bulkInsert('permissions', [
      {
        id: getId(`READ_API_DOCS`),
        createdAt,
        updatedAt,
        name: `READ_API_DOCS`,
      },
    ]);
    await queryInterface.bulkInsert('permissions', [
      {
        id: getId(`CREATE_SEARCH`),
        createdAt,
        updatedAt,
        name: `CREATE_SEARCH`,
      },
    ]);

    await queryInterface.bulkUpdate(
      'roles',
      { globalAccess: true },
      { id: getId('SuperAdmin') },
    );

    await queryInterface.sequelize
      .query(`create table "rolesPermissionsPermissions"
(
"createdAt"           timestamp with time zone not null,
"updatedAt"           timestamp with time zone not null,
"roles_permissionsId" uuid                     not null,
"permissionId"        uuid                     not null,
primary key ("roles_permissionsId", "permissionId")
);`);

    await queryInterface.bulkInsert('rolesPermissionsPermissions', [
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('CREATE_USERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('READ_USERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('UPDATE_USERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('DELETE_USERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('READ_USERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('UPDATE_USERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('DELETE_USERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('UPDATE_USERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('DELETE_USERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('UPDATE_USERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('DELETE_USERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('UPDATE_USERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('DELETE_USERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('CREATE_ASSETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('READ_ASSETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('UPDATE_ASSETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('DELETE_ASSETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('READ_ASSETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('UPDATE_ASSETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('DELETE_ASSETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('UPDATE_ASSETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('DELETE_ASSETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('UPDATE_ASSETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('DELETE_ASSETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('UPDATE_ASSETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('DELETE_ASSETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('CREATE_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('READ_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('UPDATE_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('DELETE_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('READ_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('UPDATE_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('DELETE_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('UPDATE_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('DELETE_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('CREATE_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('READ_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('UPDATE_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('DELETE_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('UPDATE_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('DELETE_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('CREATE_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('READ_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('UPDATE_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('DELETE_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('READ_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('UPDATE_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('DELETE_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('CREATE_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('READ_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('UPDATE_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('DELETE_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('UPDATE_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('DELETE_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('UPDATE_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('DELETE_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('CREATE_INVENTORIES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('READ_INVENTORIES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('UPDATE_INVENTORIES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('DELETE_INVENTORIES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('READ_INVENTORIES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('UPDATE_INVENTORIES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('DELETE_INVENTORIES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('UPDATE_INVENTORIES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('DELETE_INVENTORIES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('UPDATE_INVENTORIES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('DELETE_INVENTORIES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('UPDATE_INVENTORIES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('DELETE_INVENTORIES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('CREATE_MANUFACTURING_ORDERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('READ_MANUFACTURING_ORDERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('UPDATE_MANUFACTURING_ORDERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('DELETE_MANUFACTURING_ORDERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('READ_MANUFACTURING_ORDERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('UPDATE_MANUFACTURING_ORDERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('DELETE_MANUFACTURING_ORDERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('UPDATE_MANUFACTURING_ORDERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('DELETE_MANUFACTURING_ORDERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('UPDATE_MANUFACTURING_ORDERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('DELETE_MANUFACTURING_ORDERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('UPDATE_MANUFACTURING_ORDERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('DELETE_MANUFACTURING_ORDERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('CREATE_PROCUREMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('READ_PROCUREMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('UPDATE_PROCUREMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('DELETE_PROCUREMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('READ_PROCUREMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('UPDATE_PROCUREMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('DELETE_PROCUREMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('UPDATE_PROCUREMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('DELETE_PROCUREMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('UPDATE_PROCUREMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('DELETE_PROCUREMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('UPDATE_PROCUREMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('DELETE_PROCUREMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('CREATE_PROJECTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('READ_PROJECTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('UPDATE_PROJECTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('DELETE_PROJECTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('READ_PROJECTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('UPDATE_PROJECTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('DELETE_PROJECTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('UPDATE_PROJECTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('DELETE_PROJECTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('UPDATE_PROJECTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('DELETE_PROJECTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('UPDATE_PROJECTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('DELETE_PROJECTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('CREATE_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('READ_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('UPDATE_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('DELETE_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('READ_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('UPDATE_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('DELETE_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('UPDATE_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('DELETE_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('UPDATE_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('DELETE_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('CREATE_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('READ_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('UPDATE_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('DELETE_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('CREATE_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('READ_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('UPDATE_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('DELETE_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('READ_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('UPDATE_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('DELETE_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('CREATE_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('READ_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('UPDATE_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('DELETE_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('UPDATE_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('DELETE_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('UPDATE_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('DELETE_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SystemArchitect'),
        permissionId: getId('CREATE_SEARCH'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('OperationsDirector'),
        permissionId: getId('CREATE_SEARCH'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FinanceController'),
        permissionId: getId('CREATE_SEARCH'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('HRSpecialist'),
        permissionId: getId('CREATE_SEARCH'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SalesExecutive'),
        permissionId: getId('CREATE_SEARCH'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_USERS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_USERS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_USERS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_USERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_ASSETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_ASSETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_ASSETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_ASSETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_EMPLOYEES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_EMPLOYEES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_EMPLOYEES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_FINANCIAL_RECORDS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_FINANCIAL_RECORDS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_FINANCIAL_RECORDS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_INVENTORIES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_INVENTORIES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_INVENTORIES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_INVENTORIES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_MANUFACTURING_ORDERS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_MANUFACTURING_ORDERS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_MANUFACTURING_ORDERS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_MANUFACTURING_ORDERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_PROCUREMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_PROCUREMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_PROCUREMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_PROCUREMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_PROJECTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_PROJECTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_PROJECTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_PROJECTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_SALES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_SALES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_SALES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_SUBSCRIPTIONS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_SUBSCRIPTIONS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_SUBSCRIPTIONS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_INVOICES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_INVOICES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_INVOICES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_INVOICES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_PAYMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_PAYMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_PAYMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_PAYMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_CONTRACTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_CONTRACTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_CONTRACTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_CONTRACTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_SHIPMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_SHIPMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_SHIPMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_SHIPMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_WAREHOUSES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_WAREHOUSES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_WAREHOUSES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_WAREHOUSES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_PAYROLLS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_PAYROLLS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_PAYROLLS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_PAYROLLS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_ATTENDANCE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_ATTENDANCE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_ATTENDANCE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_ATTENDANCE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_LEAVE_REQUESTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_LEAVE_REQUESTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_LEAVE_REQUESTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_LEAVE_REQUESTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_RECRUITMENT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_RECRUITMENT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_RECRUITMENT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_RECRUITMENT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_BUDGETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_BUDGETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_BUDGETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_BUDGETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_TAXES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_TAXES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_TAXES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_TAXES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_EXPENSES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_EXPENSES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_EXPENSES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_EXPENSES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_REVENUES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_REVENUES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_REVENUES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_REVENUES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_LEADS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_LEADS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_LEADS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_LEADS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_TICKETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_TICKETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_TICKETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_TICKETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_MARKETING_CAMPAIGNS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_MARKETING_CAMPAIGNS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_MARKETING_CAMPAIGNS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_MARKETING_CAMPAIGNS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_AUDIT_LOGS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_AUDIT_LOGS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_AUDIT_LOGS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_AUDIT_LOGS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_NOTIFICATIONS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_NOTIFICATIONS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_NOTIFICATIONS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_NOTIFICATIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_USERS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_USERS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_USERS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_USERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_ASSETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_ASSETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_ASSETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_ASSETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_EMPLOYEES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_EMPLOYEES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_EMPLOYEES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_EMPLOYEES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_FINANCIAL_RECORDS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_FINANCIAL_RECORDS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_FINANCIAL_RECORDS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_FINANCIAL_RECORDS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_INVENTORIES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_INVENTORIES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_INVENTORIES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_INVENTORIES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_MANUFACTURING_ORDERS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_MANUFACTURING_ORDERS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_MANUFACTURING_ORDERS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_MANUFACTURING_ORDERS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_PROCUREMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_PROCUREMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_PROCUREMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_PROCUREMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_PROJECTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_PROJECTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_PROJECTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_PROJECTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_SALES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_SALES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_SALES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_SALES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_SUBSCRIPTIONS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_SUBSCRIPTIONS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_SUBSCRIPTIONS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_SUBSCRIPTIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_INVOICES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_INVOICES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_INVOICES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_INVOICES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_PAYMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_PAYMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_PAYMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_PAYMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_CONTRACTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_CONTRACTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_CONTRACTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_CONTRACTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_SHIPMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_SHIPMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_SHIPMENTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_SHIPMENTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_WAREHOUSES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_WAREHOUSES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_WAREHOUSES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_WAREHOUSES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_PAYROLLS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_PAYROLLS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_PAYROLLS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_PAYROLLS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_ATTENDANCE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_ATTENDANCE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_ATTENDANCE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_ATTENDANCE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_LEAVE_REQUESTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_LEAVE_REQUESTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_LEAVE_REQUESTS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_LEAVE_REQUESTS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_RECRUITMENT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_RECRUITMENT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_RECRUITMENT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_RECRUITMENT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_BUDGETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_BUDGETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_BUDGETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_BUDGETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_TAXES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_TAXES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_TAXES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_TAXES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_EXPENSES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_EXPENSES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_EXPENSES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_EXPENSES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_REVENUES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_REVENUES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_REVENUES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_REVENUES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_LEADS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_LEADS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_LEADS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_LEADS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_TICKETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_TICKETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_TICKETS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_TICKETS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_MARKETING_CAMPAIGNS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_MARKETING_CAMPAIGNS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_MARKETING_CAMPAIGNS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_MARKETING_CAMPAIGNS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_AUDIT_LOGS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_AUDIT_LOGS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_AUDIT_LOGS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_AUDIT_LOGS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_NOTIFICATIONS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_NOTIFICATIONS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_NOTIFICATIONS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_NOTIFICATIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_ROLES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_ROLES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_ROLES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_ROLES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_PERMISSIONS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_PERMISSIONS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_PERMISSIONS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_PERMISSIONS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_COMPANIES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_COMPANIES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_COMPANIES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_COMPANIES'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_API_DOCS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_SEARCH'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_API_DOCS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_SEARCH'),
      },
    ]);

    await queryInterface.sequelize.query(
      `UPDATE "users" SET "app_roleId"='${getId(
        'SuperAdmin',
      )}' WHERE "email"='super_admin@flatlogic.com'`,
    );
    await queryInterface.sequelize.query(
      `UPDATE "users" SET "app_roleId"='${getId(
        'Administrator',
      )}' WHERE "email"='admin@flatlogic.com'`,
    );

    await queryInterface.sequelize.query(
      `UPDATE "users" SET "app_roleId"='${getId(
        'SystemArchitect',
      )}' WHERE "email"='client@hello.com'`,
    );
    await queryInterface.sequelize.query(
      `UPDATE "users" SET "app_roleId"='${getId(
        'OperationsDirector',
      )}' WHERE "email"='john@doe.com'`,
    );
  },
};
