
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("HRDirector"), name: "HR Director", createdAt, updatedAt },
        
          { id: getId("OutletManager"), name: "Outlet Manager", createdAt, updatedAt },
        
          { id: getId("FinanceOfficer"), name: "Finance Officer", createdAt, updatedAt },
        
          { id: getId("HRStaff"), name: "HR Staff", createdAt, updatedAt },
        
          { id: getId("Employee"), name: "Employee", 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","roles","permissions","organizations","outlets","job_positions","employees","employee_contracts","attendance_logs","attendance_requests","overtime_logs","disciplinary_actions","kpi_periods","kpi_scores","outlet_revenues","service_charge_pools","loan_accounts","payroll_periods","payroll_items","payroll_adjustments","payslips","notification_messages","audit_logs",,
    ];
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("HRDirector"), permissionId: getId('CREATE_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_USERS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_OUTLETS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_OUTLETS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_OUTLETS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_OUTLETS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_OUTLETS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('UPDATE_OUTLETS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_OUTLETS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_OUTLETS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_OUTLETS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_OUTLETS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_JOB_POSITIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_JOB_POSITIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_JOB_POSITIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_JOB_POSITIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_JOB_POSITIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('UPDATE_JOB_POSITIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_JOB_POSITIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('CREATE_JOB_POSITIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_JOB_POSITIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_JOB_POSITIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_JOB_POSITIONS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_EMPLOYEES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_EMPLOYEES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_EMPLOYEES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_EMPLOYEES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('CREATE_EMPLOYEES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_EMPLOYEES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('UPDATE_EMPLOYEES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_EMPLOYEES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('UPDATE_EMPLOYEES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('CREATE_EMPLOYEES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_EMPLOYEES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_EMPLOYEES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_EMPLOYEES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('UPDATE_EMPLOYEES') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_EMPLOYEE_CONTRACTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_EMPLOYEE_CONTRACTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_EMPLOYEE_CONTRACTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_EMPLOYEE_CONTRACTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('CREATE_EMPLOYEE_CONTRACTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_EMPLOYEE_CONTRACTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('UPDATE_EMPLOYEE_CONTRACTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_EMPLOYEE_CONTRACTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('CREATE_EMPLOYEE_CONTRACTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_EMPLOYEE_CONTRACTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_EMPLOYEE_CONTRACTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_EMPLOYEE_CONTRACTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_ATTENDANCE_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_ATTENDANCE_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_ATTENDANCE_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_ATTENDANCE_LOGS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_ATTENDANCE_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('UPDATE_ATTENDANCE_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_ATTENDANCE_LOGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_ATTENDANCE_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_ATTENDANCE_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('CREATE_ATTENDANCE_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_ATTENDANCE_LOGS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_ATTENDANCE_REQUESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_ATTENDANCE_REQUESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_ATTENDANCE_REQUESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_ATTENDANCE_REQUESTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('CREATE_ATTENDANCE_REQUESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_ATTENDANCE_REQUESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('UPDATE_ATTENDANCE_REQUESTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_ATTENDANCE_REQUESTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_ATTENDANCE_REQUESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_ATTENDANCE_REQUESTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('CREATE_ATTENDANCE_REQUESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_ATTENDANCE_REQUESTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_OVERTIME_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_OVERTIME_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_OVERTIME_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_OVERTIME_LOGS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('CREATE_OVERTIME_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_OVERTIME_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('UPDATE_OVERTIME_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_OVERTIME_LOGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_OVERTIME_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_OVERTIME_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('CREATE_OVERTIME_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_OVERTIME_LOGS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_DISCIPLINARY_ACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_DISCIPLINARY_ACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_DISCIPLINARY_ACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_DISCIPLINARY_ACTIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('CREATE_DISCIPLINARY_ACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_DISCIPLINARY_ACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('UPDATE_DISCIPLINARY_ACTIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_DISCIPLINARY_ACTIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_DISCIPLINARY_ACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_DISCIPLINARY_ACTIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_DISCIPLINARY_ACTIONS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_KPI_PERIODS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_KPI_PERIODS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_KPI_PERIODS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_KPI_PERIODS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_KPI_PERIODS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('UPDATE_KPI_PERIODS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_KPI_PERIODS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('CREATE_KPI_PERIODS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_KPI_PERIODS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_KPI_PERIODS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_KPI_PERIODS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_KPI_SCORES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_KPI_SCORES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_KPI_SCORES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_KPI_SCORES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('CREATE_KPI_SCORES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_KPI_SCORES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('UPDATE_KPI_SCORES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_KPI_SCORES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('CREATE_KPI_SCORES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_KPI_SCORES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_KPI_SCORES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_KPI_SCORES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_OUTLET_REVENUES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_OUTLET_REVENUES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_OUTLET_REVENUES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_OUTLET_REVENUES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('CREATE_OUTLET_REVENUES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_OUTLET_REVENUES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('UPDATE_OUTLET_REVENUES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_OUTLET_REVENUES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('UPDATE_OUTLET_REVENUES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_OUTLET_REVENUES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_OUTLET_REVENUES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_SERVICE_CHARGE_POOLS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_SERVICE_CHARGE_POOLS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_SERVICE_CHARGE_POOLS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_SERVICE_CHARGE_POOLS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_SERVICE_CHARGE_POOLS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('UPDATE_SERVICE_CHARGE_POOLS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_SERVICE_CHARGE_POOLS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('UPDATE_SERVICE_CHARGE_POOLS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_SERVICE_CHARGE_POOLS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_SERVICE_CHARGE_POOLS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_LOAN_ACCOUNTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_LOAN_ACCOUNTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_LOAN_ACCOUNTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_LOAN_ACCOUNTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_LOAN_ACCOUNTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('CREATE_LOAN_ACCOUNTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_LOAN_ACCOUNTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('UPDATE_LOAN_ACCOUNTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_LOAN_ACCOUNTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_LOAN_ACCOUNTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_PAYROLL_PERIODS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_PAYROLL_PERIODS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_PAYROLL_PERIODS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_PAYROLL_PERIODS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_PAYROLL_PERIODS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_PAYROLL_PERIODS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('UPDATE_PAYROLL_PERIODS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('CREATE_PAYROLL_PERIODS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_PAYROLL_PERIODS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_PAYROLL_PERIODS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_PAYROLL_PERIODS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_PAYROLL_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_PAYROLL_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_PAYROLL_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_PAYROLL_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_PAYROLL_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_PAYROLL_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('UPDATE_PAYROLL_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('CREATE_PAYROLL_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_PAYROLL_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_PAYROLL_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_PAYROLL_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_PAYROLL_ADJUSTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_PAYROLL_ADJUSTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_PAYROLL_ADJUSTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_PAYROLL_ADJUSTMENTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_PAYROLL_ADJUSTMENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('CREATE_PAYROLL_ADJUSTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_PAYROLL_ADJUSTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('UPDATE_PAYROLL_ADJUSTMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('CREATE_PAYROLL_ADJUSTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_PAYROLL_ADJUSTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_PAYROLL_ADJUSTMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_PAYROLL_ADJUSTMENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_PAYSLIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_PAYSLIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_PAYSLIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_PAYSLIPS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_PAYSLIPS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_PAYSLIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('UPDATE_PAYSLIPS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('CREATE_PAYSLIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_PAYSLIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_PAYSLIPS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_PAYSLIPS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_NOTIFICATION_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_NOTIFICATION_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_NOTIFICATION_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_NOTIFICATION_MESSAGES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_NOTIFICATION_MESSAGES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('CREATE_NOTIFICATION_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_NOTIFICATION_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('UPDATE_NOTIFICATION_MESSAGES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('CREATE_NOTIFICATION_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_NOTIFICATION_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_NOTIFICATION_MESSAGES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_NOTIFICATION_MESSAGES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('UPDATE_AUDIT_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('DELETE_AUDIT_LOGS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('UPDATE_AUDIT_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Employee"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
     
  
      
      
        
            { createdAt, updatedAt, roles_permissionsId: getId("HRDirector"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("OutletManager"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("FinanceOfficer"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("HRStaff"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("Employee"), 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_OUTLETS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_OUTLETS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_OUTLETS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_OUTLETS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_JOB_POSITIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_JOB_POSITIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_JOB_POSITIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_JOB_POSITIONS') },
    
    { 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_EMPLOYEE_CONTRACTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_EMPLOYEE_CONTRACTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_EMPLOYEE_CONTRACTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_EMPLOYEE_CONTRACTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ATTENDANCE_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ATTENDANCE_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ATTENDANCE_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ATTENDANCE_LOGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ATTENDANCE_REQUESTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ATTENDANCE_REQUESTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ATTENDANCE_REQUESTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ATTENDANCE_REQUESTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_OVERTIME_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_OVERTIME_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_OVERTIME_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_OVERTIME_LOGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_DISCIPLINARY_ACTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_DISCIPLINARY_ACTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_DISCIPLINARY_ACTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_DISCIPLINARY_ACTIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_KPI_PERIODS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_KPI_PERIODS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_KPI_PERIODS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_KPI_PERIODS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_KPI_SCORES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_KPI_SCORES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_KPI_SCORES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_KPI_SCORES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_OUTLET_REVENUES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_OUTLET_REVENUES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_OUTLET_REVENUES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_OUTLET_REVENUES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SERVICE_CHARGE_POOLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SERVICE_CHARGE_POOLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SERVICE_CHARGE_POOLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SERVICE_CHARGE_POOLS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_LOAN_ACCOUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_LOAN_ACCOUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_LOAN_ACCOUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_LOAN_ACCOUNTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PAYROLL_PERIODS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PAYROLL_PERIODS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PAYROLL_PERIODS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PAYROLL_PERIODS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PAYROLL_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PAYROLL_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PAYROLL_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PAYROLL_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PAYROLL_ADJUSTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PAYROLL_ADJUSTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PAYROLL_ADJUSTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PAYROLL_ADJUSTMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PAYSLIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PAYSLIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PAYSLIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PAYSLIPS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_NOTIFICATION_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_NOTIFICATION_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_NOTIFICATION_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_NOTIFICATION_MESSAGES') },
    
    { 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("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_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_ORGANIZATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_ORGANIZATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_ORGANIZATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_ORGANIZATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_OUTLETS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_OUTLETS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_OUTLETS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_OUTLETS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_JOB_POSITIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_JOB_POSITIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_JOB_POSITIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_JOB_POSITIONS') },
    
    { 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_EMPLOYEE_CONTRACTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_EMPLOYEE_CONTRACTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_EMPLOYEE_CONTRACTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_EMPLOYEE_CONTRACTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_ATTENDANCE_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_ATTENDANCE_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_ATTENDANCE_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_ATTENDANCE_LOGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_ATTENDANCE_REQUESTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_ATTENDANCE_REQUESTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_ATTENDANCE_REQUESTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_ATTENDANCE_REQUESTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_OVERTIME_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_OVERTIME_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_OVERTIME_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_OVERTIME_LOGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_DISCIPLINARY_ACTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_DISCIPLINARY_ACTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_DISCIPLINARY_ACTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_DISCIPLINARY_ACTIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_KPI_PERIODS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_KPI_PERIODS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_KPI_PERIODS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_KPI_PERIODS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_KPI_SCORES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_KPI_SCORES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_KPI_SCORES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_KPI_SCORES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_OUTLET_REVENUES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_OUTLET_REVENUES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_OUTLET_REVENUES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_OUTLET_REVENUES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_SERVICE_CHARGE_POOLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_SERVICE_CHARGE_POOLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_SERVICE_CHARGE_POOLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_SERVICE_CHARGE_POOLS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_LOAN_ACCOUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_LOAN_ACCOUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_LOAN_ACCOUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_LOAN_ACCOUNTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_PAYROLL_PERIODS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_PAYROLL_PERIODS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_PAYROLL_PERIODS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_PAYROLL_PERIODS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_PAYROLL_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_PAYROLL_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_PAYROLL_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_PAYROLL_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_PAYROLL_ADJUSTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_PAYROLL_ADJUSTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_PAYROLL_ADJUSTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_PAYROLL_ADJUSTMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_PAYSLIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_PAYSLIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_PAYSLIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_PAYSLIPS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_NOTIFICATION_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_NOTIFICATION_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_NOTIFICATION_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_NOTIFICATION_MESSAGES') },
    
    { 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('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("HRDirector")}' WHERE "email"='client@hello.com'`);
        await queryInterface.sequelize.query(`UPDATE "users" SET "app_roleId"='${getId("OutletManager")}' WHERE "email"='john@doe.com'`);
       
      
      

}
};

