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('ProjectManager'),
        name: 'Project Manager',
        createdAt,
        updatedAt,
      },

      {
        id: getId('SiteSupervisor'),
        name: 'Site Supervisor',
        createdAt,
        updatedAt,
      },

      {
        id: getId('SafetyOfficer'),
        name: 'Safety Officer',
        createdAt,
        updatedAt,
      },

      {
        id: getId('FieldEngineer'),
        name: 'Field Engineer',
        createdAt,
        updatedAt,
      },

      { id: getId('DataAnalyst'), name: 'Data Analyst', createdAt, updatedAt },

      { id: getId('Public'), name: 'Public', 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',
      'cameras_ptz',
      'epcs',
      'epis',
      'equipes_trabalho',
      'estrutura_projeto',
      'etapas_ou_trechos',
      'frames_imagem',
      'gemeos_digitais',
      'historico_alteracoes_projeto',
      'inspecao_aerea',
      'maquinas_atividade',
      'materiais_atividade',
      'membros_equipe',
      'memoriais_descritivos_asbuilt',
      'modelos_bim_asbuilt',
      'obras',
      'permissoes_modulo',
      'pessoas_atividade',
      'pessoas_frame',
      'plantas_asbuilt_2d',
      'relatorio_andamento_atual',
      'relatorios_analiticos_video',
      'relatorios_diarios',
      'relatorios_mensais',
      'relatorios_semanais',
      'subcontratadas',
      'usuarios',
      'roles',
      'permissions',
      'clientes',
      ,
    ];
    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('ProjectManager'),
        permissionId: getId('CREATE_CAMERAS_PTZ'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_CAMERAS_PTZ'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_CAMERAS_PTZ'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_CAMERAS_PTZ'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_CAMERAS_PTZ'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_CAMERAS_PTZ'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_CAMERAS_PTZ'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_CAMERAS_PTZ'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_CAMERAS_PTZ'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_CAMERAS_PTZ'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_CAMERAS_PTZ'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_EPCS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_EPCS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_EPCS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_EPCS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_EPCS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_EPCS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_EPCS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_EPCS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_EPCS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_EPCS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_EPIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_EPIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_EPIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_EPIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_EPIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_EPIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_EPIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_EPIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_EPIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_EPIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_EQUIPES_TRABALHO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_EQUIPES_TRABALHO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_EQUIPES_TRABALHO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_EQUIPES_TRABALHO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_EQUIPES_TRABALHO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_EQUIPES_TRABALHO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_EQUIPES_TRABALHO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_EQUIPES_TRABALHO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_EQUIPES_TRABALHO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_EQUIPES_TRABALHO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_EQUIPES_TRABALHO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_ESTRUTURA_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_ESTRUTURA_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_ESTRUTURA_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_ESTRUTURA_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_ESTRUTURA_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_ESTRUTURA_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_ESTRUTURA_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_ESTRUTURA_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_ESTRUTURA_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_ESTRUTURA_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_ESTRUTURA_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_ETAPAS_OU_TRECHOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_ETAPAS_OU_TRECHOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_ETAPAS_OU_TRECHOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_ETAPAS_OU_TRECHOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_ETAPAS_OU_TRECHOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_ETAPAS_OU_TRECHOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_ETAPAS_OU_TRECHOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_ETAPAS_OU_TRECHOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_ETAPAS_OU_TRECHOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_ETAPAS_OU_TRECHOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_ETAPAS_OU_TRECHOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_FRAMES_IMAGEM'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_FRAMES_IMAGEM'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_FRAMES_IMAGEM'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_FRAMES_IMAGEM'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_FRAMES_IMAGEM'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_FRAMES_IMAGEM'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_FRAMES_IMAGEM'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_FRAMES_IMAGEM'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_FRAMES_IMAGEM'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_FRAMES_IMAGEM'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_FRAMES_IMAGEM'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_GEMEOS_DIGITAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_GEMEOS_DIGITAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_GEMEOS_DIGITAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_GEMEOS_DIGITAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_GEMEOS_DIGITAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_GEMEOS_DIGITAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_GEMEOS_DIGITAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_GEMEOS_DIGITAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_GEMEOS_DIGITAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_GEMEOS_DIGITAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_GEMEOS_DIGITAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_HISTORICO_ALTERACOES_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_HISTORICO_ALTERACOES_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_HISTORICO_ALTERACOES_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_HISTORICO_ALTERACOES_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_HISTORICO_ALTERACOES_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_HISTORICO_ALTERACOES_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_HISTORICO_ALTERACOES_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_HISTORICO_ALTERACOES_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_HISTORICO_ALTERACOES_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_HISTORICO_ALTERACOES_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_HISTORICO_ALTERACOES_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_INSPECAO_AEREA'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_INSPECAO_AEREA'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_INSPECAO_AEREA'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_INSPECAO_AEREA'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_INSPECAO_AEREA'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_INSPECAO_AEREA'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_INSPECAO_AEREA'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_INSPECAO_AEREA'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_INSPECAO_AEREA'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_INSPECAO_AEREA'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_INSPECAO_AEREA'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_MAQUINAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_MAQUINAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_MAQUINAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_MAQUINAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_MAQUINAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_MAQUINAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_MAQUINAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_MAQUINAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_MAQUINAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_MAQUINAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_MAQUINAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_MATERIAIS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_MATERIAIS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_MATERIAIS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_MATERIAIS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_MATERIAIS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_MATERIAIS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_MATERIAIS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_MATERIAIS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_MATERIAIS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_MATERIAIS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_MATERIAIS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_MEMBROS_EQUIPE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_MEMBROS_EQUIPE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_MEMBROS_EQUIPE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_MEMBROS_EQUIPE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_MEMBROS_EQUIPE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_MEMBROS_EQUIPE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_MEMBROS_EQUIPE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_MEMBROS_EQUIPE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_MEMBROS_EQUIPE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_MEMBROS_EQUIPE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_MEMBROS_EQUIPE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_MODELOS_BIM_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_MODELOS_BIM_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_MODELOS_BIM_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_MODELOS_BIM_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_MODELOS_BIM_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_MODELOS_BIM_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_MODELOS_BIM_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_MODELOS_BIM_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_MODELOS_BIM_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_MODELOS_BIM_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_MODELOS_BIM_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_OBRAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_OBRAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_OBRAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_OBRAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_OBRAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_OBRAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_OBRAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_OBRAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_OBRAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_OBRAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_OBRAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_PESSOAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_PESSOAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_PESSOAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_PESSOAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_PESSOAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_PESSOAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_PESSOAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_PESSOAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_PESSOAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_PESSOAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_PESSOAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_PESSOAS_FRAME'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_PESSOAS_FRAME'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_PESSOAS_FRAME'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_PESSOAS_FRAME'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_PESSOAS_FRAME'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_PESSOAS_FRAME'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_PESSOAS_FRAME'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_PESSOAS_FRAME'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_PESSOAS_FRAME'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_PESSOAS_FRAME'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_PESSOAS_FRAME'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_PLANTAS_ASBUILT_2D'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_PLANTAS_ASBUILT_2D'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_PLANTAS_ASBUILT_2D'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_PLANTAS_ASBUILT_2D'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_PLANTAS_ASBUILT_2D'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_PLANTAS_ASBUILT_2D'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_PLANTAS_ASBUILT_2D'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_PLANTAS_ASBUILT_2D'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_PLANTAS_ASBUILT_2D'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_PLANTAS_ASBUILT_2D'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_PLANTAS_ASBUILT_2D'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_RELATORIO_ANDAMENTO_ATUAL'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_RELATORIO_ANDAMENTO_ATUAL'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_RELATORIO_ANDAMENTO_ATUAL'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_RELATORIO_ANDAMENTO_ATUAL'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_RELATORIO_ANDAMENTO_ATUAL'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_RELATORIO_ANDAMENTO_ATUAL'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_RELATORIO_ANDAMENTO_ATUAL'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_RELATORIO_ANDAMENTO_ATUAL'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_RELATORIO_ANDAMENTO_ATUAL'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_RELATORIO_ANDAMENTO_ATUAL'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_RELATORIO_ANDAMENTO_ATUAL'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_RELATORIOS_ANALITICOS_VIDEO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_RELATORIOS_ANALITICOS_VIDEO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_RELATORIOS_ANALITICOS_VIDEO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_RELATORIOS_ANALITICOS_VIDEO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_RELATORIOS_ANALITICOS_VIDEO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_RELATORIOS_ANALITICOS_VIDEO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_RELATORIOS_ANALITICOS_VIDEO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_RELATORIOS_ANALITICOS_VIDEO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_RELATORIOS_ANALITICOS_VIDEO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_RELATORIOS_ANALITICOS_VIDEO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_RELATORIOS_ANALITICOS_VIDEO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_RELATORIOS_DIARIOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_RELATORIOS_DIARIOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_RELATORIOS_DIARIOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_RELATORIOS_DIARIOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_RELATORIOS_DIARIOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_RELATORIOS_DIARIOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_RELATORIOS_DIARIOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_RELATORIOS_DIARIOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_RELATORIOS_DIARIOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_RELATORIOS_DIARIOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_RELATORIOS_DIARIOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_RELATORIOS_MENSAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_RELATORIOS_MENSAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_RELATORIOS_MENSAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_RELATORIOS_MENSAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_RELATORIOS_MENSAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_RELATORIOS_MENSAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_RELATORIOS_MENSAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_RELATORIOS_MENSAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_RELATORIOS_MENSAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_RELATORIOS_MENSAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_RELATORIOS_MENSAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_RELATORIOS_SEMANAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_RELATORIOS_SEMANAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_RELATORIOS_SEMANAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_RELATORIOS_SEMANAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('CREATE_RELATORIOS_SEMANAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_RELATORIOS_SEMANAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_RELATORIOS_SEMANAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_RELATORIOS_SEMANAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_RELATORIOS_SEMANAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_RELATORIOS_SEMANAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_RELATORIOS_SEMANAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('CREATE_SUBCONTRATADAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('READ_SUBCONTRATADAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('UPDATE_SUBCONTRATADAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('ProjectManager'),
        permissionId: getId('DELETE_SUBCONTRATADAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('READ_SUBCONTRATADAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SiteSupervisor'),
        permissionId: getId('UPDATE_SUBCONTRATADAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SafetyOfficer'),
        permissionId: getId('READ_SUBCONTRATADAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('READ_SUBCONTRATADAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('FieldEngineer'),
        permissionId: getId('UPDATE_SUBCONTRATADAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        permissionId: getId('READ_SUBCONTRATADAS'),
      },

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

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

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

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

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('DataAnalyst'),
        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_CAMERAS_PTZ'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_CAMERAS_PTZ'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_CAMERAS_PTZ'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_CAMERAS_PTZ'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_EPCS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_EPCS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_EPCS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_EPCS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_EPIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_EPIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_EPIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_EPIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_EQUIPES_TRABALHO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_EQUIPES_TRABALHO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_EQUIPES_TRABALHO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_EQUIPES_TRABALHO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_ESTRUTURA_PROJETO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_ESTRUTURA_PROJETO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_ESTRUTURA_PROJETO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_ESTRUTURA_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_ETAPAS_OU_TRECHOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_ETAPAS_OU_TRECHOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_ETAPAS_OU_TRECHOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_ETAPAS_OU_TRECHOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_FRAMES_IMAGEM'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_FRAMES_IMAGEM'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_FRAMES_IMAGEM'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_FRAMES_IMAGEM'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_GEMEOS_DIGITAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_GEMEOS_DIGITAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_GEMEOS_DIGITAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_GEMEOS_DIGITAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_HISTORICO_ALTERACOES_PROJETO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_HISTORICO_ALTERACOES_PROJETO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_HISTORICO_ALTERACOES_PROJETO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_HISTORICO_ALTERACOES_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_INSPECAO_AEREA'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_INSPECAO_AEREA'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_INSPECAO_AEREA'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_INSPECAO_AEREA'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_MAQUINAS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_MAQUINAS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_MAQUINAS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_MAQUINAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_MATERIAIS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_MATERIAIS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_MATERIAIS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_MATERIAIS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_MEMBROS_EQUIPE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_MEMBROS_EQUIPE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_MEMBROS_EQUIPE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_MEMBROS_EQUIPE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_MODELOS_BIM_ASBUILT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_MODELOS_BIM_ASBUILT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_MODELOS_BIM_ASBUILT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_MODELOS_BIM_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_OBRAS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_OBRAS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_OBRAS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_OBRAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_PERMISSOES_MODULO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_PERMISSOES_MODULO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_PERMISSOES_MODULO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_PERMISSOES_MODULO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_PESSOAS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_PESSOAS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_PESSOAS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_PESSOAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_PESSOAS_FRAME'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_PESSOAS_FRAME'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_PESSOAS_FRAME'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_PESSOAS_FRAME'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_PLANTAS_ASBUILT_2D'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_PLANTAS_ASBUILT_2D'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_PLANTAS_ASBUILT_2D'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_PLANTAS_ASBUILT_2D'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_RELATORIO_ANDAMENTO_ATUAL'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_RELATORIO_ANDAMENTO_ATUAL'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_RELATORIO_ANDAMENTO_ATUAL'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_RELATORIO_ANDAMENTO_ATUAL'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_RELATORIOS_ANALITICOS_VIDEO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_RELATORIOS_ANALITICOS_VIDEO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_RELATORIOS_ANALITICOS_VIDEO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_RELATORIOS_ANALITICOS_VIDEO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_RELATORIOS_DIARIOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_RELATORIOS_DIARIOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_RELATORIOS_DIARIOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_RELATORIOS_DIARIOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_RELATORIOS_MENSAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_RELATORIOS_MENSAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_RELATORIOS_MENSAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_RELATORIOS_MENSAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_RELATORIOS_SEMANAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_RELATORIOS_SEMANAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_RELATORIOS_SEMANAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_RELATORIOS_SEMANAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_SUBCONTRATADAS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_SUBCONTRATADAS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_SUBCONTRATADAS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_SUBCONTRATADAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('CREATE_USUARIOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('READ_USUARIOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('UPDATE_USUARIOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('Administrator'),
        permissionId: getId('DELETE_USUARIOS'),
      },

      {
        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_CAMERAS_PTZ'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_CAMERAS_PTZ'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_CAMERAS_PTZ'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_CAMERAS_PTZ'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_EPCS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_EPCS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_EPCS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_EPCS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_EPIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_EPIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_EPIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_EPIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_EQUIPES_TRABALHO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_EQUIPES_TRABALHO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_EQUIPES_TRABALHO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_EQUIPES_TRABALHO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_ESTRUTURA_PROJETO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_ESTRUTURA_PROJETO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_ESTRUTURA_PROJETO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_ESTRUTURA_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_ETAPAS_OU_TRECHOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_ETAPAS_OU_TRECHOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_ETAPAS_OU_TRECHOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_ETAPAS_OU_TRECHOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_FRAMES_IMAGEM'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_FRAMES_IMAGEM'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_FRAMES_IMAGEM'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_FRAMES_IMAGEM'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_GEMEOS_DIGITAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_GEMEOS_DIGITAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_GEMEOS_DIGITAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_GEMEOS_DIGITAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_HISTORICO_ALTERACOES_PROJETO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_HISTORICO_ALTERACOES_PROJETO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_HISTORICO_ALTERACOES_PROJETO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_HISTORICO_ALTERACOES_PROJETO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_INSPECAO_AEREA'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_INSPECAO_AEREA'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_INSPECAO_AEREA'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_INSPECAO_AEREA'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_MAQUINAS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_MAQUINAS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_MAQUINAS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_MAQUINAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_MATERIAIS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_MATERIAIS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_MATERIAIS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_MATERIAIS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_MEMBROS_EQUIPE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_MEMBROS_EQUIPE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_MEMBROS_EQUIPE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_MEMBROS_EQUIPE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_MEMORIAIS_DESCRITIVOS_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_MODELOS_BIM_ASBUILT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_MODELOS_BIM_ASBUILT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_MODELOS_BIM_ASBUILT'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_MODELOS_BIM_ASBUILT'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_OBRAS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_OBRAS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_OBRAS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_OBRAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_PERMISSOES_MODULO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_PERMISSOES_MODULO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_PERMISSOES_MODULO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_PERMISSOES_MODULO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_PESSOAS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_PESSOAS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_PESSOAS_ATIVIDADE'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_PESSOAS_ATIVIDADE'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_PESSOAS_FRAME'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_PESSOAS_FRAME'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_PESSOAS_FRAME'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_PESSOAS_FRAME'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_PLANTAS_ASBUILT_2D'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_PLANTAS_ASBUILT_2D'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_PLANTAS_ASBUILT_2D'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_PLANTAS_ASBUILT_2D'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_RELATORIO_ANDAMENTO_ATUAL'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_RELATORIO_ANDAMENTO_ATUAL'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_RELATORIO_ANDAMENTO_ATUAL'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_RELATORIO_ANDAMENTO_ATUAL'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_RELATORIOS_ANALITICOS_VIDEO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_RELATORIOS_ANALITICOS_VIDEO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_RELATORIOS_ANALITICOS_VIDEO'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_RELATORIOS_ANALITICOS_VIDEO'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_RELATORIOS_DIARIOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_RELATORIOS_DIARIOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_RELATORIOS_DIARIOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_RELATORIOS_DIARIOS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_RELATORIOS_MENSAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_RELATORIOS_MENSAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_RELATORIOS_MENSAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_RELATORIOS_MENSAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_RELATORIOS_SEMANAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_RELATORIOS_SEMANAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_RELATORIOS_SEMANAIS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_RELATORIOS_SEMANAIS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_SUBCONTRATADAS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_SUBCONTRATADAS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_SUBCONTRATADAS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_SUBCONTRATADAS'),
      },

      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('CREATE_USUARIOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_USUARIOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_USUARIOS'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_USUARIOS'),
      },

      {
        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_CLIENTES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('READ_CLIENTES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('UPDATE_CLIENTES'),
      },
      {
        createdAt,
        updatedAt,
        roles_permissionsId: getId('SuperAdmin'),
        permissionId: getId('DELETE_CLIENTES'),
      },

      {
        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(
        'ProjectManager',
      )}' WHERE "email"='client@hello.com'`,
    );
    await queryInterface.sequelize.query(
      `UPDATE "users" SET "app_roleId"='${getId(
        'SiteSupervisor',
      )}' WHERE "email"='john@doe.com'`,
    );
  },
};
