
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("PlatformOperator"), name: "Platform Operator", createdAt, updatedAt },
        
          { id: getId("ComplianceManager"), name: "Compliance Manager", createdAt, updatedAt },
        
          { id: getId("QuantResearcher"), name: "Quant Researcher", createdAt, updatedAt },
        
          { id: getId("BrokerageSupport"), name: "Brokerage Support", createdAt, updatedAt },
        
          { id: getId("Investor"), name: "Investor", 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","api_providers","market_symbols","symbol_fundamentals","price_quotes","technical_indicators","analyst_ratings","earnings_reports","news_articles","news_article_symbols","article_bookmarks","watchlists","watchlist_items","paper_accounts","paper_orders","paper_trades","paper_positions","portfolio_snapshots","screener_filters","screener_runs","screener_results","ai_chat_sessions","ai_messages","learning_modules","user_tooltips","ir_companies","ir_management_members","ir_filings","ir_dividends","ir_announcements","ir_financial_statement_summaries","audit_events",,
    ];
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("QuantResearcher"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('READ_API_PROVIDERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("BrokerageSupport"), permissionId: getId('READ_API_PROVIDERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_MARKET_SYMBOLS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_SYMBOL_FUNDAMENTALS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_PRICE_QUOTES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_TECHNICAL_INDICATORS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_ANALYST_RATINGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_EARNINGS_REPORTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_NEWS_ARTICLES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_NEWS_ARTICLE_SYMBOLS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('CREATE_ARTICLE_BOOKMARKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('READ_ARTICLE_BOOKMARKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_ARTICLE_BOOKMARKS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('CREATE_ARTICLE_BOOKMARKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('READ_ARTICLE_BOOKMARKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('UPDATE_ARTICLE_BOOKMARKS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('DELETE_ARTICLE_BOOKMARKS') },
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('CREATE_WATCHLISTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('READ_WATCHLISTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_WATCHLISTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('CREATE_WATCHLISTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('READ_WATCHLISTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('UPDATE_WATCHLISTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('DELETE_WATCHLISTS') },
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('CREATE_WATCHLIST_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('READ_WATCHLIST_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_WATCHLIST_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('CREATE_WATCHLIST_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('READ_WATCHLIST_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('UPDATE_WATCHLIST_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('DELETE_WATCHLIST_ITEMS') },
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('CREATE_PAPER_ACCOUNTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('READ_PAPER_ACCOUNTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_PAPER_ACCOUNTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('CREATE_PAPER_ACCOUNTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('READ_PAPER_ACCOUNTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('UPDATE_PAPER_ACCOUNTS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('CREATE_PAPER_ORDERS') },
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_PAPER_ORDERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('CREATE_PAPER_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('READ_PAPER_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('UPDATE_PAPER_ORDERS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('CREATE_SCREENER_FILTERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('READ_SCREENER_FILTERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_SCREENER_FILTERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('CREATE_SCREENER_FILTERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('READ_SCREENER_FILTERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('UPDATE_SCREENER_FILTERS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('CREATE_SCREENER_RUNS') },
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('CREATE_SCREENER_RUNS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('READ_SCREENER_RUNS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('CREATE_AI_CHAT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('READ_AI_CHAT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_AI_CHAT_SESSIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('CREATE_AI_CHAT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('READ_AI_CHAT_SESSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('UPDATE_AI_CHAT_SESSIONS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('CREATE_AI_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('READ_AI_MESSAGES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('CREATE_AI_MESSAGES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('READ_AI_MESSAGES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_LEARNING_MODULES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('CREATE_USER_TOOLTIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('READ_USER_TOOLTIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_USER_TOOLTIPS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('CREATE_USER_TOOLTIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('READ_USER_TOOLTIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('UPDATE_USER_TOOLTIPS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_IR_COMPANIES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_IR_MANAGEMENT_MEMBERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_IR_FILINGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_IR_DIVIDENDS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_IR_ANNOUNCEMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('UPDATE_IR_FINANCIAL_STATEMENT_SUMMARIES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("BrokerageSupport"), permissionId: getId('UPDATE_AUDIT_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Investor"), permissionId: getId('READ_AUDIT_EVENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
     
  
      
      
        
            { createdAt, updatedAt, roles_permissionsId: getId("PlatformOperator"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("ComplianceManager"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("QuantResearcher"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("BrokerageSupport"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("Investor"), 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_API_PROVIDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_API_PROVIDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_API_PROVIDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_API_PROVIDERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_MARKET_SYMBOLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_MARKET_SYMBOLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_MARKET_SYMBOLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_MARKET_SYMBOLS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SYMBOL_FUNDAMENTALS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SYMBOL_FUNDAMENTALS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SYMBOL_FUNDAMENTALS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SYMBOL_FUNDAMENTALS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PRICE_QUOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PRICE_QUOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PRICE_QUOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PRICE_QUOTES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_TECHNICAL_INDICATORS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_TECHNICAL_INDICATORS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_TECHNICAL_INDICATORS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_TECHNICAL_INDICATORS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ANALYST_RATINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ANALYST_RATINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ANALYST_RATINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ANALYST_RATINGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_EARNINGS_REPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_EARNINGS_REPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_EARNINGS_REPORTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_EARNINGS_REPORTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_NEWS_ARTICLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_NEWS_ARTICLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_NEWS_ARTICLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_NEWS_ARTICLES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_NEWS_ARTICLE_SYMBOLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_NEWS_ARTICLE_SYMBOLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_NEWS_ARTICLE_SYMBOLS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_NEWS_ARTICLE_SYMBOLS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ARTICLE_BOOKMARKS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ARTICLE_BOOKMARKS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ARTICLE_BOOKMARKS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ARTICLE_BOOKMARKS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_WATCHLISTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_WATCHLISTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_WATCHLISTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_WATCHLISTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_WATCHLIST_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_WATCHLIST_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_WATCHLIST_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_WATCHLIST_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PAPER_ACCOUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PAPER_ACCOUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PAPER_ACCOUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PAPER_ACCOUNTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PAPER_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PAPER_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PAPER_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PAPER_ORDERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PAPER_TRADES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PAPER_TRADES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PAPER_TRADES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PAPER_TRADES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PAPER_POSITIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PAPER_POSITIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PAPER_POSITIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PAPER_POSITIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PORTFOLIO_SNAPSHOTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PORTFOLIO_SNAPSHOTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PORTFOLIO_SNAPSHOTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PORTFOLIO_SNAPSHOTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SCREENER_FILTERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SCREENER_FILTERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SCREENER_FILTERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SCREENER_FILTERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SCREENER_RUNS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SCREENER_RUNS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SCREENER_RUNS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SCREENER_RUNS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SCREENER_RESULTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SCREENER_RESULTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SCREENER_RESULTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SCREENER_RESULTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_AI_CHAT_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_AI_CHAT_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_AI_CHAT_SESSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_AI_CHAT_SESSIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_AI_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_AI_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_AI_MESSAGES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_AI_MESSAGES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_LEARNING_MODULES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_LEARNING_MODULES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_LEARNING_MODULES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_LEARNING_MODULES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_USER_TOOLTIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_USER_TOOLTIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_USER_TOOLTIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_USER_TOOLTIPS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_IR_COMPANIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_IR_COMPANIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_IR_COMPANIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_IR_COMPANIES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_IR_MANAGEMENT_MEMBERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_IR_MANAGEMENT_MEMBERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_IR_MANAGEMENT_MEMBERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_IR_MANAGEMENT_MEMBERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_IR_FILINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_IR_FILINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_IR_FILINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_IR_FILINGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_IR_DIVIDENDS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_IR_DIVIDENDS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_IR_DIVIDENDS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_IR_DIVIDENDS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_IR_ANNOUNCEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_IR_ANNOUNCEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_IR_ANNOUNCEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_IR_ANNOUNCEMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_IR_FINANCIAL_STATEMENT_SUMMARIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_IR_FINANCIAL_STATEMENT_SUMMARIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_IR_FINANCIAL_STATEMENT_SUMMARIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_IR_FINANCIAL_STATEMENT_SUMMARIES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_AUDIT_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_AUDIT_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_AUDIT_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_AUDIT_EVENTS') },
    
    
    
    { 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("PlatformOperator")}' WHERE "email"='client@hello.com'`);
        await queryInterface.sequelize.query(`UPDATE "users" SET "app_roleId"='${getId("ComplianceManager")}' WHERE "email"='john@doe.com'`);
       
      
      

}
};

