
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("Administrator"), name: "Administrator", createdAt, updatedAt },
      
      
        
          { id: getId("PlatformOwner"), name: "Platform Owner", createdAt, updatedAt },
        
          { id: getId("ContentLead"), name: "Content Lead", createdAt, updatedAt },
        
          { id: getId("Teacher"), name: "Teacher", createdAt, updatedAt },
        
          { id: getId("Reviewer"), name: "Reviewer", createdAt, updatedAt },
        
          { id: getId("Student"), name: "Student", 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","subjects","grade_levels","textbooks","chapters","curriculum_standards","skills","question_banks","questions","answer_choices","tests","test_sections","test_items","test_versions","version_items","version_answer_orders","exports","answer_keys","scoring_schemes","test_matrices","matrix_rows","collections","ai_generation_jobs",,
    ];
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.sequelize.query(`create table "rolesPermissionsPermissions"
(
"createdAt"           timestamp with time zone not null,
"updatedAt"           timestamp with time zone not null,
"roles_permissionsId" uuid                     not null,
"permissionId"        uuid                     not null,
primary key ("roles_permissionsId", "permissionId")
);`);


await queryInterface.bulkInsert("rolesPermissionsPermissions", [
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_USERS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_SUBJECTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_SUBJECTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_SUBJECTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_SUBJECTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_SUBJECTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_SUBJECTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_SUBJECTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_SUBJECTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Student"), permissionId: getId('READ_SUBJECTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_GRADE_LEVELS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_GRADE_LEVELS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_GRADE_LEVELS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_GRADE_LEVELS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_GRADE_LEVELS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_GRADE_LEVELS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_GRADE_LEVELS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_GRADE_LEVELS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Student"), permissionId: getId('READ_GRADE_LEVELS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_TEXTBOOKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_TEXTBOOKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_TEXTBOOKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_TEXTBOOKS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_TEXTBOOKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_TEXTBOOKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_TEXTBOOKS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_TEXTBOOKS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_TEXTBOOKS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Student"), permissionId: getId('READ_TEXTBOOKS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_CHAPTERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_CHAPTERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_CHAPTERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_CHAPTERS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_CHAPTERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_CHAPTERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_CHAPTERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_CHAPTERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_CHAPTERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Student"), permissionId: getId('READ_CHAPTERS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_CURRICULUM_STANDARDS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_CURRICULUM_STANDARDS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_CURRICULUM_STANDARDS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_CURRICULUM_STANDARDS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_CURRICULUM_STANDARDS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_CURRICULUM_STANDARDS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_CURRICULUM_STANDARDS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_CURRICULUM_STANDARDS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_CURRICULUM_STANDARDS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Student"), permissionId: getId('READ_CURRICULUM_STANDARDS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_SKILLS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_SKILLS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_SKILLS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_SKILLS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_SKILLS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_SKILLS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_SKILLS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_SKILLS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_SKILLS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Student"), permissionId: getId('READ_SKILLS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_QUESTION_BANKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_QUESTION_BANKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_QUESTION_BANKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_QUESTION_BANKS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_QUESTION_BANKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_QUESTION_BANKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_QUESTION_BANKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('DELETE_QUESTION_BANKS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_QUESTION_BANKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_QUESTION_BANKS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_QUESTION_BANKS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Student"), permissionId: getId('READ_QUESTION_BANKS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_QUESTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_QUESTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_QUESTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_QUESTIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_QUESTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_QUESTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_QUESTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('DELETE_QUESTIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_QUESTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_QUESTIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_QUESTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('UPDATE_QUESTIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Student"), permissionId: getId('READ_QUESTIONS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_ANSWER_CHOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_ANSWER_CHOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_ANSWER_CHOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_ANSWER_CHOICES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_ANSWER_CHOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_ANSWER_CHOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_ANSWER_CHOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('DELETE_ANSWER_CHOICES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_ANSWER_CHOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_ANSWER_CHOICES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_ANSWER_CHOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('UPDATE_ANSWER_CHOICES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Student"), permissionId: getId('READ_ANSWER_CHOICES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_TESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_TESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_TESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_TESTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_TESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_TESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_TESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('DELETE_TESTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_TESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_TESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('UPDATE_TESTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_TESTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Student"), permissionId: getId('READ_TESTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_TEST_SECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_TEST_SECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_TEST_SECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_TEST_SECTIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_TEST_SECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_TEST_SECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_TEST_SECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('DELETE_TEST_SECTIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_TEST_SECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_TEST_SECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('UPDATE_TEST_SECTIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_TEST_SECTIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Student"), permissionId: getId('READ_TEST_SECTIONS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_TEST_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_TEST_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_TEST_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_TEST_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_TEST_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_TEST_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_TEST_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('DELETE_TEST_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_TEST_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_TEST_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('UPDATE_TEST_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_TEST_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Student"), permissionId: getId('READ_TEST_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_TEST_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_TEST_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_TEST_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_TEST_VERSIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_TEST_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_TEST_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_TEST_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('DELETE_TEST_VERSIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_TEST_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_TEST_VERSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('UPDATE_TEST_VERSIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_TEST_VERSIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Student"), permissionId: getId('READ_TEST_VERSIONS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_VERSION_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_VERSION_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_VERSION_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_VERSION_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_VERSION_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_VERSION_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_VERSION_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('DELETE_VERSION_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_VERSION_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_VERSION_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('UPDATE_VERSION_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_VERSION_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Student"), permissionId: getId('READ_VERSION_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_VERSION_ANSWER_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_VERSION_ANSWER_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_VERSION_ANSWER_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_VERSION_ANSWER_ORDERS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_VERSION_ANSWER_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_VERSION_ANSWER_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_VERSION_ANSWER_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('DELETE_VERSION_ANSWER_ORDERS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_VERSION_ANSWER_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_VERSION_ANSWER_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('UPDATE_VERSION_ANSWER_ORDERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_VERSION_ANSWER_ORDERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Student"), permissionId: getId('READ_VERSION_ANSWER_ORDERS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_EXPORTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('DELETE_EXPORTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_EXPORTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('UPDATE_EXPORTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_EXPORTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_ANSWER_KEYS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_ANSWER_KEYS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_ANSWER_KEYS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_ANSWER_KEYS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_ANSWER_KEYS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_ANSWER_KEYS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_ANSWER_KEYS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('DELETE_ANSWER_KEYS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_ANSWER_KEYS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_ANSWER_KEYS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('UPDATE_ANSWER_KEYS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_ANSWER_KEYS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_SCORING_SCHEMES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_SCORING_SCHEMES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_SCORING_SCHEMES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_SCORING_SCHEMES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_SCORING_SCHEMES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_SCORING_SCHEMES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_SCORING_SCHEMES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('DELETE_SCORING_SCHEMES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_SCORING_SCHEMES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_SCORING_SCHEMES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('UPDATE_SCORING_SCHEMES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_SCORING_SCHEMES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_TEST_MATRICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_TEST_MATRICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_TEST_MATRICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_TEST_MATRICES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_TEST_MATRICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_TEST_MATRICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_TEST_MATRICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('DELETE_TEST_MATRICES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_TEST_MATRICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_TEST_MATRICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('UPDATE_TEST_MATRICES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_TEST_MATRICES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_MATRIX_ROWS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_MATRIX_ROWS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_MATRIX_ROWS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_MATRIX_ROWS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_MATRIX_ROWS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_MATRIX_ROWS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_MATRIX_ROWS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('DELETE_MATRIX_ROWS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_MATRIX_ROWS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_MATRIX_ROWS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('UPDATE_MATRIX_ROWS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_MATRIX_ROWS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_COLLECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_COLLECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_COLLECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_COLLECTIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_COLLECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_COLLECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_COLLECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('DELETE_COLLECTIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_COLLECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_COLLECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('UPDATE_COLLECTIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_COLLECTIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_AI_GENERATION_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_AI_GENERATION_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_AI_GENERATION_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_AI_GENERATION_JOBS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_AI_GENERATION_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('READ_AI_GENERATION_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('UPDATE_AI_GENERATION_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('DELETE_AI_GENERATION_JOBS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_AI_GENERATION_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('READ_AI_GENERATION_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('UPDATE_AI_GENERATION_JOBS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('READ_AI_GENERATION_JOBS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
     
  
      
      
        
            { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("ContentLead"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("Teacher"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("Reviewer"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("Student"), 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_ROLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ROLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ROLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ROLES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PERMISSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PERMISSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PERMISSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PERMISSIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SUBJECTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SUBJECTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SUBJECTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SUBJECTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_GRADE_LEVELS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_GRADE_LEVELS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_GRADE_LEVELS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_GRADE_LEVELS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_TEXTBOOKS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_TEXTBOOKS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_TEXTBOOKS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_TEXTBOOKS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_CHAPTERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_CHAPTERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_CHAPTERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_CHAPTERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_CURRICULUM_STANDARDS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_CURRICULUM_STANDARDS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_CURRICULUM_STANDARDS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_CURRICULUM_STANDARDS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SKILLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SKILLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SKILLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SKILLS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_QUESTION_BANKS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_QUESTION_BANKS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_QUESTION_BANKS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_QUESTION_BANKS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_QUESTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_QUESTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_QUESTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_QUESTIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ANSWER_CHOICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ANSWER_CHOICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ANSWER_CHOICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ANSWER_CHOICES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_TESTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_TESTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_TESTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_TESTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_TEST_SECTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_TEST_SECTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_TEST_SECTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_TEST_SECTIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_TEST_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_TEST_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_TEST_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_TEST_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_TEST_VERSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_TEST_VERSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_TEST_VERSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_TEST_VERSIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_VERSION_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_VERSION_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_VERSION_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_VERSION_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_VERSION_ANSWER_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_VERSION_ANSWER_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_VERSION_ANSWER_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_VERSION_ANSWER_ORDERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_EXPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_EXPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_EXPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_EXPORTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ANSWER_KEYS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ANSWER_KEYS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ANSWER_KEYS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ANSWER_KEYS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SCORING_SCHEMES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SCORING_SCHEMES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SCORING_SCHEMES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SCORING_SCHEMES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_TEST_MATRICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_TEST_MATRICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_TEST_MATRICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_TEST_MATRICES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_MATRIX_ROWS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_MATRIX_ROWS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_MATRIX_ROWS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_MATRIX_ROWS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_COLLECTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_COLLECTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_COLLECTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_COLLECTIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_AI_GENERATION_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_AI_GENERATION_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_AI_GENERATION_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_AI_GENERATION_JOBS') },
    
    
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_API_DOCS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SEARCH') },
    ]);


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

}
};

