
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("platform_owner"), name: "platform_owner", createdAt, updatedAt },
        
          { id: getId("clinical_lead"), name: "clinical_lead", createdAt, updatedAt },
        
          { id: getId("care_coordinator"), name: "care_coordinator", createdAt, updatedAt },
        
          { id: getId("family_manager"), name: "family_manager", createdAt, updatedAt },
        
          { id: getId("family_viewer"), name: "family_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","accounts","patients","patient_access_grants","medications","medication_schedules","calendar_events","reminders","cognitive_programs","cognitive_exercises","cognitive_sessions","cognitive_attempts","stage_assessments","voice_assistant_sessions","iot_devices","iot_telemetry_events","geofences","alerts","alert_notifications","shared_dashboard_posts","scientific_articles","article_recommendations","clinical_reports","admin_metrics_snapshots",,
    ];
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("platform_owner"), permissionId: getId('CREATE_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_USERS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_PATIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_PATIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_PATIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_PATIENTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_PATIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_PATIENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_PATIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_PATIENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_PATIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_PATIENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_PATIENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_PATIENT_ACCESS_GRANTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_PATIENT_ACCESS_GRANTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_PATIENT_ACCESS_GRANTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_PATIENT_ACCESS_GRANTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_PATIENT_ACCESS_GRANTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('CREATE_PATIENT_ACCESS_GRANTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_PATIENT_ACCESS_GRANTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_PATIENT_ACCESS_GRANTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('CREATE_PATIENT_ACCESS_GRANTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_PATIENT_ACCESS_GRANTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_PATIENT_ACCESS_GRANTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_PATIENT_ACCESS_GRANTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_MEDICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_MEDICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_MEDICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_MEDICATIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('CREATE_MEDICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_MEDICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_MEDICATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('CREATE_MEDICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_MEDICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_MEDICATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('CREATE_MEDICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_MEDICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_MEDICATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_MEDICATIONS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_MEDICATION_SCHEDULES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_MEDICATION_SCHEDULES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_MEDICATION_SCHEDULES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_MEDICATION_SCHEDULES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('CREATE_MEDICATION_SCHEDULES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_MEDICATION_SCHEDULES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_MEDICATION_SCHEDULES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('CREATE_MEDICATION_SCHEDULES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_MEDICATION_SCHEDULES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_MEDICATION_SCHEDULES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('CREATE_MEDICATION_SCHEDULES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_MEDICATION_SCHEDULES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_MEDICATION_SCHEDULES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_MEDICATION_SCHEDULES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_CALENDAR_EVENTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('CREATE_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_CALENDAR_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('CREATE_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_CALENDAR_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('CREATE_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_CALENDAR_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_CALENDAR_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_CALENDAR_EVENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_REMINDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_REMINDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_REMINDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_REMINDERS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_REMINDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_REMINDERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('CREATE_REMINDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_REMINDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_REMINDERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('CREATE_REMINDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_REMINDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_REMINDERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_REMINDERS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_COGNITIVE_PROGRAMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_COGNITIVE_PROGRAMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_COGNITIVE_PROGRAMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_COGNITIVE_PROGRAMS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('CREATE_COGNITIVE_PROGRAMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_COGNITIVE_PROGRAMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_COGNITIVE_PROGRAMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_COGNITIVE_PROGRAMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_COGNITIVE_PROGRAMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_COGNITIVE_PROGRAMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_COGNITIVE_PROGRAMS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_COGNITIVE_EXERCISES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_COGNITIVE_EXERCISES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_COGNITIVE_EXERCISES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_COGNITIVE_EXERCISES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('CREATE_COGNITIVE_EXERCISES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_COGNITIVE_EXERCISES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_COGNITIVE_EXERCISES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_COGNITIVE_EXERCISES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_COGNITIVE_EXERCISES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_COGNITIVE_EXERCISES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_COGNITIVE_EXERCISES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_COGNITIVE_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_COGNITIVE_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_COGNITIVE_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_COGNITIVE_SESSIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('CREATE_COGNITIVE_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_COGNITIVE_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_COGNITIVE_SESSIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('CREATE_COGNITIVE_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_COGNITIVE_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_COGNITIVE_SESSIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('CREATE_COGNITIVE_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_COGNITIVE_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_COGNITIVE_SESSIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_COGNITIVE_SESSIONS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_COGNITIVE_ATTEMPTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_COGNITIVE_ATTEMPTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_COGNITIVE_ATTEMPTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_COGNITIVE_ATTEMPTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('CREATE_COGNITIVE_ATTEMPTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_COGNITIVE_ATTEMPTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_COGNITIVE_ATTEMPTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('CREATE_COGNITIVE_ATTEMPTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_COGNITIVE_ATTEMPTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_COGNITIVE_ATTEMPTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('CREATE_COGNITIVE_ATTEMPTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_COGNITIVE_ATTEMPTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_COGNITIVE_ATTEMPTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_COGNITIVE_ATTEMPTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_STAGE_ASSESSMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_STAGE_ASSESSMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_STAGE_ASSESSMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_STAGE_ASSESSMENTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('CREATE_STAGE_ASSESSMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_STAGE_ASSESSMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_STAGE_ASSESSMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('CREATE_STAGE_ASSESSMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_STAGE_ASSESSMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_STAGE_ASSESSMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_STAGE_ASSESSMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_STAGE_ASSESSMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_STAGE_ASSESSMENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_VOICE_ASSISTANT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_VOICE_ASSISTANT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_VOICE_ASSISTANT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_VOICE_ASSISTANT_SESSIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_VOICE_ASSISTANT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_VOICE_ASSISTANT_SESSIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_VOICE_ASSISTANT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_VOICE_ASSISTANT_SESSIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('CREATE_VOICE_ASSISTANT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_VOICE_ASSISTANT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_VOICE_ASSISTANT_SESSIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_VOICE_ASSISTANT_SESSIONS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_IOT_DEVICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_IOT_DEVICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_IOT_DEVICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_IOT_DEVICES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_IOT_DEVICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_IOT_DEVICES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('CREATE_IOT_DEVICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_IOT_DEVICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_IOT_DEVICES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_IOT_DEVICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_IOT_DEVICES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_IOT_DEVICES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_IOT_TELEMETRY_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_IOT_TELEMETRY_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_IOT_TELEMETRY_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_IOT_TELEMETRY_EVENTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_IOT_TELEMETRY_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_IOT_TELEMETRY_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_IOT_TELEMETRY_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_IOT_TELEMETRY_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_IOT_TELEMETRY_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_IOT_TELEMETRY_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_IOT_TELEMETRY_EVENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_GEOFENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_GEOFENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_GEOFENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_GEOFENCES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_GEOFENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_GEOFENCES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('CREATE_GEOFENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_GEOFENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_GEOFENCES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('CREATE_GEOFENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_GEOFENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_GEOFENCES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_GEOFENCES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_ALERTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_ALERTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('CREATE_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_ALERTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('CREATE_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_ALERTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_ALERTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_ALERT_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_ALERT_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_ALERT_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_ALERT_NOTIFICATIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_ALERT_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_ALERT_NOTIFICATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('CREATE_ALERT_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_ALERT_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_ALERT_NOTIFICATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_ALERT_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_ALERT_NOTIFICATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_ALERT_NOTIFICATIONS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_SHARED_DASHBOARD_POSTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_SHARED_DASHBOARD_POSTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_SHARED_DASHBOARD_POSTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_SHARED_DASHBOARD_POSTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_SHARED_DASHBOARD_POSTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_SHARED_DASHBOARD_POSTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('CREATE_SHARED_DASHBOARD_POSTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_SHARED_DASHBOARD_POSTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_SHARED_DASHBOARD_POSTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('CREATE_SHARED_DASHBOARD_POSTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_SHARED_DASHBOARD_POSTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_SHARED_DASHBOARD_POSTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_SHARED_DASHBOARD_POSTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_SCIENTIFIC_ARTICLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_SCIENTIFIC_ARTICLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_SCIENTIFIC_ARTICLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_SCIENTIFIC_ARTICLES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('CREATE_SCIENTIFIC_ARTICLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_SCIENTIFIC_ARTICLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_SCIENTIFIC_ARTICLES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_SCIENTIFIC_ARTICLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_SCIENTIFIC_ARTICLES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_SCIENTIFIC_ARTICLES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_SCIENTIFIC_ARTICLES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_ARTICLE_RECOMMENDATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_ARTICLE_RECOMMENDATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_ARTICLE_RECOMMENDATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_ARTICLE_RECOMMENDATIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('CREATE_ARTICLE_RECOMMENDATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_ARTICLE_RECOMMENDATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_ARTICLE_RECOMMENDATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('CREATE_ARTICLE_RECOMMENDATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_ARTICLE_RECOMMENDATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_ARTICLE_RECOMMENDATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('CREATE_ARTICLE_RECOMMENDATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_ARTICLE_RECOMMENDATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_ARTICLE_RECOMMENDATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_ARTICLE_RECOMMENDATIONS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_CLINICAL_REPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_CLINICAL_REPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_CLINICAL_REPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_CLINICAL_REPORTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('CREATE_CLINICAL_REPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_CLINICAL_REPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('UPDATE_CLINICAL_REPORTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('CREATE_CLINICAL_REPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_CLINICAL_REPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('UPDATE_CLINICAL_REPORTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('READ_CLINICAL_REPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('UPDATE_CLINICAL_REPORTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), permissionId: getId('READ_CLINICAL_REPORTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_ADMIN_METRICS_SNAPSHOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('READ_ADMIN_METRICS_SNAPSHOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('UPDATE_ADMIN_METRICS_SNAPSHOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('DELETE_ADMIN_METRICS_SNAPSHOTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('READ_ADMIN_METRICS_SNAPSHOTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('READ_ADMIN_METRICS_SNAPSHOTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
     
  
      
      
        
            { createdAt, updatedAt, roles_permissionsId: getId("platform_owner"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("clinical_lead"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("care_coordinator"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("family_manager"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("family_viewer"), 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_PATIENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PATIENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PATIENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PATIENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PATIENT_ACCESS_GRANTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PATIENT_ACCESS_GRANTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PATIENT_ACCESS_GRANTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PATIENT_ACCESS_GRANTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_MEDICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_MEDICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_MEDICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_MEDICATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_MEDICATION_SCHEDULES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_MEDICATION_SCHEDULES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_MEDICATION_SCHEDULES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_MEDICATION_SCHEDULES') },
    
    { 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_REMINDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_REMINDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_REMINDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_REMINDERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_COGNITIVE_PROGRAMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_COGNITIVE_PROGRAMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_COGNITIVE_PROGRAMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_COGNITIVE_PROGRAMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_COGNITIVE_EXERCISES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_COGNITIVE_EXERCISES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_COGNITIVE_EXERCISES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_COGNITIVE_EXERCISES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_COGNITIVE_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_COGNITIVE_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_COGNITIVE_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_COGNITIVE_SESSIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_COGNITIVE_ATTEMPTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_COGNITIVE_ATTEMPTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_COGNITIVE_ATTEMPTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_COGNITIVE_ATTEMPTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_STAGE_ASSESSMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_STAGE_ASSESSMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_STAGE_ASSESSMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_STAGE_ASSESSMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_VOICE_ASSISTANT_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_VOICE_ASSISTANT_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_VOICE_ASSISTANT_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_VOICE_ASSISTANT_SESSIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_IOT_DEVICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_IOT_DEVICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_IOT_DEVICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_IOT_DEVICES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_IOT_TELEMETRY_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_IOT_TELEMETRY_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_IOT_TELEMETRY_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_IOT_TELEMETRY_EVENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_GEOFENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_GEOFENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_GEOFENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_GEOFENCES') },
    
    { 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_ALERT_NOTIFICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ALERT_NOTIFICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ALERT_NOTIFICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ALERT_NOTIFICATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SHARED_DASHBOARD_POSTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SHARED_DASHBOARD_POSTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SHARED_DASHBOARD_POSTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SHARED_DASHBOARD_POSTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SCIENTIFIC_ARTICLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SCIENTIFIC_ARTICLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SCIENTIFIC_ARTICLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SCIENTIFIC_ARTICLES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ARTICLE_RECOMMENDATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ARTICLE_RECOMMENDATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ARTICLE_RECOMMENDATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ARTICLE_RECOMMENDATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_CLINICAL_REPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_CLINICAL_REPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_CLINICAL_REPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_CLINICAL_REPORTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ADMIN_METRICS_SNAPSHOTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ADMIN_METRICS_SNAPSHOTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ADMIN_METRICS_SNAPSHOTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ADMIN_METRICS_SNAPSHOTS') },
    
    
    
    { 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_ACCOUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_ACCOUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_ACCOUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_ACCOUNTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_PATIENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_PATIENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_PATIENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_PATIENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_PATIENT_ACCESS_GRANTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_PATIENT_ACCESS_GRANTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_PATIENT_ACCESS_GRANTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_PATIENT_ACCESS_GRANTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_MEDICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_MEDICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_MEDICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_MEDICATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_MEDICATION_SCHEDULES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_MEDICATION_SCHEDULES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_MEDICATION_SCHEDULES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_MEDICATION_SCHEDULES') },
    
    { 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_REMINDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_REMINDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_REMINDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_REMINDERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_COGNITIVE_PROGRAMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_COGNITIVE_PROGRAMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_COGNITIVE_PROGRAMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_COGNITIVE_PROGRAMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_COGNITIVE_EXERCISES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_COGNITIVE_EXERCISES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_COGNITIVE_EXERCISES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_COGNITIVE_EXERCISES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_COGNITIVE_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_COGNITIVE_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_COGNITIVE_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_COGNITIVE_SESSIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_COGNITIVE_ATTEMPTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_COGNITIVE_ATTEMPTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_COGNITIVE_ATTEMPTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_COGNITIVE_ATTEMPTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_STAGE_ASSESSMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_STAGE_ASSESSMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_STAGE_ASSESSMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_STAGE_ASSESSMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_VOICE_ASSISTANT_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_VOICE_ASSISTANT_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_VOICE_ASSISTANT_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_VOICE_ASSISTANT_SESSIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_IOT_DEVICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_IOT_DEVICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_IOT_DEVICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_IOT_DEVICES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_IOT_TELEMETRY_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_IOT_TELEMETRY_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_IOT_TELEMETRY_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_IOT_TELEMETRY_EVENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_GEOFENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_GEOFENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_GEOFENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_GEOFENCES') },
    
    { 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_ALERT_NOTIFICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_ALERT_NOTIFICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_ALERT_NOTIFICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_ALERT_NOTIFICATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_SHARED_DASHBOARD_POSTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_SHARED_DASHBOARD_POSTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_SHARED_DASHBOARD_POSTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_SHARED_DASHBOARD_POSTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_SCIENTIFIC_ARTICLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_SCIENTIFIC_ARTICLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_SCIENTIFIC_ARTICLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_SCIENTIFIC_ARTICLES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_ARTICLE_RECOMMENDATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_ARTICLE_RECOMMENDATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_ARTICLE_RECOMMENDATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_ARTICLE_RECOMMENDATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_CLINICAL_REPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_CLINICAL_REPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_CLINICAL_REPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_CLINICAL_REPORTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_ADMIN_METRICS_SNAPSHOTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_ADMIN_METRICS_SNAPSHOTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_ADMIN_METRICS_SNAPSHOTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_ADMIN_METRICS_SNAPSHOTS') },
    
    
    
    { 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("platform_owner")}' WHERE "email"='client@hello.com'`);
        await queryInterface.sequelize.query(`UPDATE "users" SET "app_roleId"='${getId("clinical_lead")}' WHERE "email"='john@doe.com'`);
       
      
      

}
};

