
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("OpsManager"), name: "Ops Manager", createdAt, updatedAt },
        
          { id: getId("TrustandSafetyLead"), name: "Trust and Safety Lead", createdAt, updatedAt },
        
          { id: getId("ClientLead"), name: "Client Lead", createdAt, updatedAt },
        
          { id: getId("FreelancerPro"), name: "Freelancer Pro", 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","skills","service_categories","service_listings","tags","portfolios","jobs","job_attachments","proposals","contracts","milestones","deliverables","conversations","messages","notifications","payments","invoices","reviews","disputes","learning_articles","ai_tools","ai_tool_runs","admin_announcements",,
    ];
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("OpsManager"), permissionId: getId('READ_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
    
    
      
      
          
                
                
               
                
                  
                    
                      { 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("OpsManager"), permissionId: getId('CREATE_SKILLS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_SKILLS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_SKILLS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_SKILLS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_SKILLS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_SKILLS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_SERVICE_CATEGORIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_SERVICE_CATEGORIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_SERVICE_CATEGORIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_SERVICE_CATEGORIES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('CREATE_SERVICE_CATEGORIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_SERVICE_CATEGORIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_SERVICE_CATEGORIES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_SERVICE_CATEGORIES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_SERVICE_CATEGORIES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_SERVICE_CATEGORIES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_SERVICE_LISTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_SERVICE_LISTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_SERVICE_LISTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_SERVICE_LISTINGS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_SERVICE_LISTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_SERVICE_LISTINGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_SERVICE_LISTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('UPDATE_SERVICE_LISTINGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_SERVICE_LISTINGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('CREATE_SERVICE_LISTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_SERVICE_LISTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('UPDATE_SERVICE_LISTINGS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_TAGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_TAGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_TAGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_TAGS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('CREATE_TAGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_TAGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_TAGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_TAGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_TAGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_TAGS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_PORTFOLIOS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_PORTFOLIOS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_PORTFOLIOS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_PORTFOLIOS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_PORTFOLIOS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_PORTFOLIOS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_PORTFOLIOS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('UPDATE_PORTFOLIOS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_PORTFOLIOS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('CREATE_PORTFOLIOS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_PORTFOLIOS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('UPDATE_PORTFOLIOS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_JOBS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_JOBS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('UPDATE_JOBS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('CREATE_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('UPDATE_JOBS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('UPDATE_JOBS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_JOB_ATTACHMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_JOB_ATTACHMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_JOB_ATTACHMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_JOB_ATTACHMENTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_JOB_ATTACHMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_JOB_ATTACHMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_JOB_ATTACHMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('UPDATE_JOB_ATTACHMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('CREATE_JOB_ATTACHMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_JOB_ATTACHMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('UPDATE_JOB_ATTACHMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_JOB_ATTACHMENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_PROPOSALS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_PROPOSALS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_PROPOSALS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_PROPOSALS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_PROPOSALS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_PROPOSALS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_PROPOSALS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('UPDATE_PROPOSALS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_PROPOSALS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('UPDATE_PROPOSALS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('CREATE_PROPOSALS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_PROPOSALS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('UPDATE_PROPOSALS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_CONTRACTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_CONTRACTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_CONTRACTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_CONTRACTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_CONTRACTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_CONTRACTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_CONTRACTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('UPDATE_CONTRACTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_CONTRACTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('UPDATE_CONTRACTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_CONTRACTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('UPDATE_CONTRACTS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_MILESTONES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_MILESTONES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_MILESTONES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_MILESTONES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_MILESTONES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_MILESTONES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_MILESTONES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('UPDATE_MILESTONES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_MILESTONES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('UPDATE_MILESTONES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_MILESTONES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('UPDATE_MILESTONES') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_DELIVERABLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_DELIVERABLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_DELIVERABLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_DELIVERABLES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_DELIVERABLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_DELIVERABLES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_DELIVERABLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('UPDATE_DELIVERABLES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_DELIVERABLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('UPDATE_DELIVERABLES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('CREATE_DELIVERABLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_DELIVERABLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('UPDATE_DELIVERABLES') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_CONVERSATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_CONVERSATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_CONVERSATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_CONVERSATIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_CONVERSATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_CONVERSATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_CONVERSATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('UPDATE_CONVERSATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('CREATE_CONVERSATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_CONVERSATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('UPDATE_CONVERSATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('CREATE_CONVERSATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_CONVERSATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('UPDATE_CONVERSATIONS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_MESSAGES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_MESSAGES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('UPDATE_MESSAGES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('CREATE_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('UPDATE_MESSAGES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('CREATE_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('UPDATE_MESSAGES') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_NOTIFICATIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('CREATE_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_NOTIFICATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('CREATE_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('UPDATE_NOTIFICATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('CREATE_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('UPDATE_NOTIFICATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('CREATE_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('UPDATE_NOTIFICATIONS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_PAYMENTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_PAYMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('CREATE_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_INVOICES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_INVOICES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_INVOICES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('CREATE_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_INVOICES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_INVOICES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_REVIEWS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_REVIEWS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_REVIEWS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_REVIEWS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_REVIEWS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_REVIEWS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_REVIEWS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('UPDATE_REVIEWS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('CREATE_REVIEWS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_REVIEWS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('CREATE_REVIEWS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_REVIEWS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_DISPUTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_DISPUTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_DISPUTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_DISPUTES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('CREATE_DISPUTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_DISPUTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_DISPUTES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('CREATE_DISPUTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_DISPUTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('UPDATE_DISPUTES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('CREATE_DISPUTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_DISPUTES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('CREATE_DISPUTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_DISPUTES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_LEARNING_ARTICLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_LEARNING_ARTICLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_LEARNING_ARTICLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_LEARNING_ARTICLES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('CREATE_LEARNING_ARTICLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_LEARNING_ARTICLES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_LEARNING_ARTICLES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_LEARNING_ARTICLES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_LEARNING_ARTICLES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_LEARNING_ARTICLES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_AI_TOOLS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_AI_TOOLS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_AI_TOOLS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_AI_TOOLS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_AI_TOOLS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_AI_TOOLS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_AI_TOOLS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_AI_TOOLS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_AI_TOOLS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_AI_TOOL_RUNS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_AI_TOOL_RUNS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_AI_TOOL_RUNS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_AI_TOOL_RUNS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_AI_TOOL_RUNS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_AI_TOOL_RUNS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_AI_TOOL_RUNS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('CREATE_AI_TOOL_RUNS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_AI_TOOL_RUNS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('CREATE_AI_TOOL_RUNS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_AI_TOOL_RUNS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_ADMIN_ANNOUNCEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_ADMIN_ANNOUNCEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_ADMIN_ANNOUNCEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_ADMIN_ANNOUNCEMENTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('CREATE_ADMIN_ANNOUNCEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('READ_ADMIN_ANNOUNCEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('UPDATE_ADMIN_ANNOUNCEMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('READ_ADMIN_ANNOUNCEMENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('READ_ADMIN_ANNOUNCEMENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), permissionId: getId('READ_ADMIN_ANNOUNCEMENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
     
  
      
      
        
            { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("OpsManager"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("TrustandSafetyLead"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("ClientLead"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("FreelancerPro"), 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_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_SERVICE_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SERVICE_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SERVICE_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SERVICE_CATEGORIES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SERVICE_LISTINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SERVICE_LISTINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SERVICE_LISTINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SERVICE_LISTINGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_TAGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_TAGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_TAGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_TAGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PORTFOLIOS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PORTFOLIOS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PORTFOLIOS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PORTFOLIOS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_JOBS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_JOB_ATTACHMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_JOB_ATTACHMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_JOB_ATTACHMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_JOB_ATTACHMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PROPOSALS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PROPOSALS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PROPOSALS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PROPOSALS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_CONTRACTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_CONTRACTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_CONTRACTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_CONTRACTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_MILESTONES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_MILESTONES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_MILESTONES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_MILESTONES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_DELIVERABLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_DELIVERABLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_DELIVERABLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_DELIVERABLES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_CONVERSATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_CONVERSATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_CONVERSATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_CONVERSATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_MESSAGES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_NOTIFICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_NOTIFICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_NOTIFICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_NOTIFICATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PAYMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INVOICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INVOICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INVOICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INVOICES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_REVIEWS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_REVIEWS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_REVIEWS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_REVIEWS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_DISPUTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_DISPUTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_DISPUTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_DISPUTES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_LEARNING_ARTICLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_LEARNING_ARTICLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_LEARNING_ARTICLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_LEARNING_ARTICLES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_AI_TOOLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_AI_TOOLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_AI_TOOLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_AI_TOOLS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_AI_TOOL_RUNS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_AI_TOOL_RUNS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_AI_TOOL_RUNS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_AI_TOOL_RUNS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ADMIN_ANNOUNCEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ADMIN_ANNOUNCEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ADMIN_ANNOUNCEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ADMIN_ANNOUNCEMENTS') },
    
    
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_API_DOCS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SEARCH') },
    { createdAt, updatedAt, roles_permissionsId: getId("Public"), permissionId: getId('READ_SERVICE_LISTINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Public"), permissionId: getId('READ_SERVICE_CATEGORIES') },
    ]);


  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("OpsManager")}' WHERE "email"='john@doe.com'`);
       
      
      

}
};

