
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("PlatformOwner"), name: "Platform Owner", createdAt, updatedAt },
        
          { id: getId("ComplianceDirector"), name: "Compliance Director", createdAt, updatedAt },
        
          { id: getId("FinanceController"), name: "Finance Controller", createdAt, updatedAt },
        
          { id: getId("OperationsManager"), name: "Operations Manager", createdAt, updatedAt },
        
          { id: getId("StaffViewer"), name: "Staff Viewer", 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","companies","company_memberships","branches","departments","compliance_categories","compliance_templates","company_compliances","tasks","documents","document_versions","alerts","calendar_events","subscription_plans","company_subscriptions","payments","ai_chat_sessions","ai_chat_messages","audit_logs","activity_events","report_exports","compliance_rule_overrides","integrations","notifications_preferences",,
    ];
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("PlatformOwner"), permissionId: getId('CREATE_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_USERS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_COMPANIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_COMPANIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_COMPANIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_COMPANIES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_COMPANIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_COMPANIES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_COMPANIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_COMPANIES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_COMPANIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('UPDATE_COMPANIES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_COMPANIES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_COMPANY_MEMBERSHIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_COMPANY_MEMBERSHIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_COMPANY_MEMBERSHIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_COMPANY_MEMBERSHIPS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_COMPANY_MEMBERSHIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_COMPANY_MEMBERSHIPS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_COMPANY_MEMBERSHIPS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_COMPANY_MEMBERSHIPS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_COMPANY_MEMBERSHIPS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_BRANCHES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_BRANCHES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_BRANCHES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_BRANCHES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_BRANCHES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_BRANCHES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_BRANCHES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_BRANCHES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_BRANCHES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('UPDATE_BRANCHES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_BRANCHES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_DEPARTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_DEPARTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_DEPARTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_DEPARTMENTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_DEPARTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_DEPARTMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_DEPARTMENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_DEPARTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('UPDATE_DEPARTMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_DEPARTMENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_COMPLIANCE_CATEGORIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_COMPLIANCE_CATEGORIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_COMPLIANCE_CATEGORIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_COMPLIANCE_CATEGORIES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_COMPLIANCE_CATEGORIES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_COMPLIANCE_TEMPLATES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_COMPLIANCE_TEMPLATES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_COMPLIANCE_TEMPLATES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_COMPLIANCE_TEMPLATES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_COMPLIANCE_TEMPLATES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_COMPANY_COMPLIANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_COMPANY_COMPLIANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_COMPANY_COMPLIANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_COMPANY_COMPLIANCES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('CREATE_COMPANY_COMPLIANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_COMPANY_COMPLIANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_COMPANY_COMPLIANCES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_COMPANY_COMPLIANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_COMPANY_COMPLIANCES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('CREATE_COMPANY_COMPLIANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_COMPANY_COMPLIANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('UPDATE_COMPANY_COMPLIANCES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_COMPANY_COMPLIANCES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_TASKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_TASKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_TASKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_TASKS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('CREATE_TASKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_TASKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_TASKS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('CREATE_TASKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_TASKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_TASKS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('CREATE_TASKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_TASKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('UPDATE_TASKS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_TASKS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_DOCUMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_DOCUMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_DOCUMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_DOCUMENTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('CREATE_DOCUMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_DOCUMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_DOCUMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('CREATE_DOCUMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_DOCUMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_DOCUMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('CREATE_DOCUMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_DOCUMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('UPDATE_DOCUMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_DOCUMENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_DOCUMENT_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_DOCUMENT_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_DOCUMENT_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_DOCUMENT_VERSIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('CREATE_DOCUMENT_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_DOCUMENT_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_DOCUMENT_VERSIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('CREATE_DOCUMENT_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_DOCUMENT_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_DOCUMENT_VERSIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('CREATE_DOCUMENT_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_DOCUMENT_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('UPDATE_DOCUMENT_VERSIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_DOCUMENT_VERSIONS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_ALERTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('CREATE_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_ALERTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_ALERTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('CREATE_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('UPDATE_ALERTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_ALERTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_CALENDAR_EVENTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('CREATE_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_CALENDAR_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_CALENDAR_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('CREATE_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('UPDATE_CALENDAR_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_CALENDAR_EVENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_SUBSCRIPTION_PLANS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_SUBSCRIPTION_PLANS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_SUBSCRIPTION_PLANS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_SUBSCRIPTION_PLANS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_COMPANY_SUBSCRIPTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_COMPANY_SUBSCRIPTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_COMPANY_SUBSCRIPTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_COMPANY_SUBSCRIPTIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_COMPANY_SUBSCRIPTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_COMPANY_SUBSCRIPTIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_COMPANY_SUBSCRIPTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_COMPANY_SUBSCRIPTIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_COMPANY_SUBSCRIPTIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_COMPANY_SUBSCRIPTIONS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_PAYMENTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('CREATE_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_PAYMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_AI_CHAT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_AI_CHAT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_AI_CHAT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_AI_CHAT_SESSIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('CREATE_AI_CHAT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_AI_CHAT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_AI_CHAT_SESSIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('CREATE_AI_CHAT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_AI_CHAT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_AI_CHAT_SESSIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('CREATE_AI_CHAT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_AI_CHAT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('UPDATE_AI_CHAT_SESSIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_AI_CHAT_SESSIONS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_AI_CHAT_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_AI_CHAT_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_AI_CHAT_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_AI_CHAT_MESSAGES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('CREATE_AI_CHAT_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_AI_CHAT_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_AI_CHAT_MESSAGES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('CREATE_AI_CHAT_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_AI_CHAT_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_AI_CHAT_MESSAGES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('CREATE_AI_CHAT_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_AI_CHAT_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('UPDATE_AI_CHAT_MESSAGES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_AI_CHAT_MESSAGES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_AUDIT_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_AUDIT_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_AUDIT_LOGS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_ACTIVITY_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_ACTIVITY_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_ACTIVITY_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_ACTIVITY_EVENTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_ACTIVITY_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_ACTIVITY_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_ACTIVITY_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_ACTIVITY_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_ACTIVITY_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('UPDATE_ACTIVITY_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_ACTIVITY_EVENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_REPORT_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_REPORT_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_REPORT_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_REPORT_EXPORTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('CREATE_REPORT_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_REPORT_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_REPORT_EXPORTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('CREATE_REPORT_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_REPORT_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_REPORT_EXPORTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('CREATE_REPORT_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_REPORT_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('UPDATE_REPORT_EXPORTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_REPORT_EXPORTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_COMPLIANCE_RULE_OVERRIDES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_COMPLIANCE_RULE_OVERRIDES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_COMPLIANCE_RULE_OVERRIDES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_COMPLIANCE_RULE_OVERRIDES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('CREATE_COMPLIANCE_RULE_OVERRIDES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_COMPLIANCE_RULE_OVERRIDES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_COMPLIANCE_RULE_OVERRIDES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_COMPLIANCE_RULE_OVERRIDES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_COMPLIANCE_RULE_OVERRIDES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('CREATE_COMPLIANCE_RULE_OVERRIDES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_COMPLIANCE_RULE_OVERRIDES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('UPDATE_COMPLIANCE_RULE_OVERRIDES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_INTEGRATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_INTEGRATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_INTEGRATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_INTEGRATIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_INTEGRATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_INTEGRATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_INTEGRATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_INTEGRATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_INTEGRATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('UPDATE_INTEGRATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_NOTIFICATIONS_PREFERENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_NOTIFICATIONS_PREFERENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_NOTIFICATIONS_PREFERENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_NOTIFICATIONS_PREFERENCES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('CREATE_NOTIFICATIONS_PREFERENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('READ_NOTIFICATIONS_PREFERENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('UPDATE_NOTIFICATIONS_PREFERENCES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('CREATE_NOTIFICATIONS_PREFERENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('READ_NOTIFICATIONS_PREFERENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('UPDATE_NOTIFICATIONS_PREFERENCES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('CREATE_NOTIFICATIONS_PREFERENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('READ_NOTIFICATIONS_PREFERENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('UPDATE_NOTIFICATIONS_PREFERENCES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), permissionId: getId('READ_NOTIFICATIONS_PREFERENCES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
     
  
      
      
        
            { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("ComplianceDirector"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("FinanceController"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("OperationsManager"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("StaffViewer"), 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_COMPANIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_COMPANIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_COMPANIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_COMPANIES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_COMPANY_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_COMPANY_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_COMPANY_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_COMPANY_MEMBERSHIPS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_BRANCHES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_BRANCHES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_BRANCHES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_BRANCHES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_DEPARTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_DEPARTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_DEPARTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_DEPARTMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_COMPLIANCE_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_COMPLIANCE_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_COMPLIANCE_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_COMPLIANCE_CATEGORIES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_COMPLIANCE_TEMPLATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_COMPLIANCE_TEMPLATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_COMPLIANCE_TEMPLATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_COMPLIANCE_TEMPLATES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_COMPANY_COMPLIANCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_COMPANY_COMPLIANCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_COMPANY_COMPLIANCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_COMPANY_COMPLIANCES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_TASKS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_TASKS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_TASKS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_TASKS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_DOCUMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_DOCUMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_DOCUMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_DOCUMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_DOCUMENT_VERSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_DOCUMENT_VERSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_DOCUMENT_VERSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_DOCUMENT_VERSIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ALERTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ALERTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ALERTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ALERTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_CALENDAR_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_CALENDAR_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_CALENDAR_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_CALENDAR_EVENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SUBSCRIPTION_PLANS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SUBSCRIPTION_PLANS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SUBSCRIPTION_PLANS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SUBSCRIPTION_PLANS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_COMPANY_SUBSCRIPTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_COMPANY_SUBSCRIPTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_COMPANY_SUBSCRIPTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_COMPANY_SUBSCRIPTIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PAYMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_AI_CHAT_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_AI_CHAT_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_AI_CHAT_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_AI_CHAT_SESSIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_AI_CHAT_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_AI_CHAT_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_AI_CHAT_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_AI_CHAT_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("Administrator"), permissionId: getId('CREATE_ACTIVITY_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ACTIVITY_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ACTIVITY_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ACTIVITY_EVENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_REPORT_EXPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_REPORT_EXPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_REPORT_EXPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_REPORT_EXPORTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_COMPLIANCE_RULE_OVERRIDES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_COMPLIANCE_RULE_OVERRIDES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_COMPLIANCE_RULE_OVERRIDES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_COMPLIANCE_RULE_OVERRIDES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INTEGRATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INTEGRATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INTEGRATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INTEGRATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_NOTIFICATIONS_PREFERENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_NOTIFICATIONS_PREFERENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_NOTIFICATIONS_PREFERENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_NOTIFICATIONS_PREFERENCES') },
    
    
    
    { 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_COMPANIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_COMPANIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_COMPANIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_COMPANIES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_COMPANY_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_COMPANY_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_COMPANY_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_COMPANY_MEMBERSHIPS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_BRANCHES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_BRANCHES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_BRANCHES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_BRANCHES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_DEPARTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_DEPARTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_DEPARTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_DEPARTMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_COMPLIANCE_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_COMPLIANCE_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_COMPLIANCE_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_COMPLIANCE_CATEGORIES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_COMPLIANCE_TEMPLATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_COMPLIANCE_TEMPLATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_COMPLIANCE_TEMPLATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_COMPLIANCE_TEMPLATES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_COMPANY_COMPLIANCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_COMPANY_COMPLIANCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_COMPANY_COMPLIANCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_COMPANY_COMPLIANCES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_TASKS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_TASKS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_TASKS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_TASKS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_DOCUMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_DOCUMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_DOCUMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_DOCUMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_DOCUMENT_VERSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_DOCUMENT_VERSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_DOCUMENT_VERSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_DOCUMENT_VERSIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_ALERTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_ALERTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_ALERTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_ALERTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_CALENDAR_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_CALENDAR_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_CALENDAR_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_CALENDAR_EVENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_SUBSCRIPTION_PLANS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_SUBSCRIPTION_PLANS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_SUBSCRIPTION_PLANS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_SUBSCRIPTION_PLANS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_COMPANY_SUBSCRIPTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_COMPANY_SUBSCRIPTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_COMPANY_SUBSCRIPTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_COMPANY_SUBSCRIPTIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_PAYMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_AI_CHAT_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_AI_CHAT_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_AI_CHAT_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_AI_CHAT_SESSIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_AI_CHAT_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_AI_CHAT_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_AI_CHAT_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_AI_CHAT_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('CREATE_ACTIVITY_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_ACTIVITY_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_ACTIVITY_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_ACTIVITY_EVENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_REPORT_EXPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_REPORT_EXPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_REPORT_EXPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_REPORT_EXPORTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_COMPLIANCE_RULE_OVERRIDES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_COMPLIANCE_RULE_OVERRIDES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_COMPLIANCE_RULE_OVERRIDES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_COMPLIANCE_RULE_OVERRIDES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_INTEGRATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_INTEGRATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_INTEGRATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_INTEGRATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_NOTIFICATIONS_PREFERENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_NOTIFICATIONS_PREFERENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_NOTIFICATIONS_PREFERENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_NOTIFICATIONS_PREFERENCES') },
    
    
    
    { 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("PlatformOwner")}' WHERE "email"='client@hello.com'`);
        await queryInterface.sequelize.query(`UPDATE "users" SET "app_roleId"='${getId("ComplianceDirector")}' WHERE "email"='john@doe.com'`);
       
      
      

}
};

