
const { v4: uuid } = require("uuid");

module.exports = {
  /**
   * @param{import("sequelize").QueryInterface} queryInterface
   * @return {Promise<void>}
   */
  async up(queryInterface) {
    const createdAt = new Date();
    const updatedAt = new Date();

    /** @type {Map<string, string>} */
    const idMap = new Map();

    /**
     * @param {string} key
     * @return {string}
     */
    function getId(key) {
      if (idMap.has(key)) {
        return idMap.get(key);
      }
      const id = uuid();
      idMap.set(key, id);
      return id;
    }

    await queryInterface.bulkInsert("roles", [
      
      { id: getId("SuperAdmin"), name: "Super Administrator", createdAt, updatedAt },
      
      
      { id: getId("Administrator"), name: "Administrator", createdAt, updatedAt },
      
      
        
          { id: getId("PlatformOwner"), name: "Platform Owner", createdAt, updatedAt },
        
          { id: getId("OperationsDirector"), name: "Operations Director", createdAt, updatedAt },
        
          { id: getId("FarmManager"), name: "Farm Manager", createdAt, updatedAt },
        
          { id: getId("MarketplaceManager"), name: "Marketplace Manager", createdAt, updatedAt },
        
          { id: getId("InvestorAnalyst"), name: "Investor Analyst", createdAt, updatedAt },
        
      
      
      { id: getId("Public"), name: "Public", createdAt, updatedAt },
    ]);

    /**
     * @param {string} name
     */
    function createPermissions(name) {
      return [
        { id: getId(`CREATE_${name.toUpperCase()}`), createdAt, updatedAt, name: `CREATE_${name.toUpperCase()}` },
        { id: getId(`READ_${name.toUpperCase()}`), createdAt, updatedAt, name: `READ_${name.toUpperCase()}` },
        { id: getId(`UPDATE_${name.toUpperCase()}`), createdAt, updatedAt, name: `UPDATE_${name.toUpperCase()}` },
        { id: getId(`DELETE_${name.toUpperCase()}`), createdAt, updatedAt, name: `DELETE_${name.toUpperCase()}` }
      ];
    }

    const entities = [
      "users","roles","permissions","organizations","tenants","user_memberships","tenant_locations","ponds","species","batches","feed_products","inventory_items","inventory_movements","feeding_logs","water_quality_logs","health_events","harvests","marketplace_listings","orders","order_items","payment_transactions","shipment_updates","investments","api_keys","webhook_endpoints","webhook_deliveries","email_notifications","audit_logs","csv_jobs",,
    ];
await queryInterface.bulkInsert("permissions", entities.flatMap(createPermissions));
await queryInterface.bulkInsert("permissions", [{ id: getId(`READ_API_DOCS`), createdAt, updatedAt, name: `READ_API_DOCS` }]);
await queryInterface.bulkInsert("permissions", [{ id: getId(`CREATE_SEARCH`), createdAt, updatedAt, name: `CREATE_SEARCH`}]);

await queryInterface.bulkUpdate('roles', { globalAccess: true }, { id: getId('SuperAdmin') });


await queryInterface.sequelize.query(`create table "rolesPermissionsPermissions"
(
"createdAt"           timestamp with time zone not null,
"updatedAt"           timestamp with time zone not null,
"roles_permissionsId" uuid                     not null,
"permissionId"        uuid                     not null,
primary key ("roles_permissionsId", "permissionId")
);`);


await queryInterface.bulkInsert("rolesPermissionsPermissions", [
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_USERS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_TENANTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_TENANTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_TENANTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_TENANTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_TENANTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_TENANTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_TENANTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_TENANTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_TENANTS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_USER_MEMBERSHIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_USER_MEMBERSHIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_USER_MEMBERSHIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_USER_MEMBERSHIPS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_USER_MEMBERSHIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_USER_MEMBERSHIPS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_USER_MEMBERSHIPS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_USER_MEMBERSHIPS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_USER_MEMBERSHIPS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_TENANT_LOCATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_TENANT_LOCATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_TENANT_LOCATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_TENANT_LOCATIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('CREATE_TENANT_LOCATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_TENANT_LOCATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_TENANT_LOCATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('READ_TENANT_LOCATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_TENANT_LOCATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_TENANT_LOCATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_TENANT_LOCATIONS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_PONDS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_PONDS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_PONDS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_PONDS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('CREATE_PONDS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_PONDS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_PONDS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('CREATE_PONDS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('READ_PONDS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_PONDS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_PONDS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_PONDS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_SPECIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_SPECIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_SPECIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_SPECIES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_SPECIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_SPECIES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('READ_SPECIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_SPECIES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('READ_SPECIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_SPECIES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('READ_SPECIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_SPECIES') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_BATCHES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_BATCHES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_BATCHES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_BATCHES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('CREATE_BATCHES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_BATCHES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_BATCHES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('CREATE_BATCHES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('READ_BATCHES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_BATCHES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_BATCHES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('READ_BATCHES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_BATCHES') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_FEED_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_FEED_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_FEED_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_FEED_PRODUCTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('CREATE_FEED_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_FEED_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_FEED_PRODUCTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('CREATE_FEED_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('READ_FEED_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_FEED_PRODUCTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_FEED_PRODUCTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_FEED_PRODUCTS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_INVENTORY_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_INVENTORY_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_INVENTORY_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_INVENTORY_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('CREATE_INVENTORY_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_INVENTORY_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_INVENTORY_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('CREATE_INVENTORY_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('READ_INVENTORY_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_INVENTORY_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_INVENTORY_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_INVENTORY_ITEMS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_INVENTORY_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_INVENTORY_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_INVENTORY_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_INVENTORY_MOVEMENTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('CREATE_INVENTORY_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_INVENTORY_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_INVENTORY_MOVEMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('CREATE_INVENTORY_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('READ_INVENTORY_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_INVENTORY_MOVEMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_INVENTORY_MOVEMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_INVENTORY_MOVEMENTS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_FEEDING_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_FEEDING_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_FEEDING_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_FEEDING_LOGS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('CREATE_FEEDING_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_FEEDING_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_FEEDING_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('CREATE_FEEDING_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('READ_FEEDING_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_FEEDING_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_FEEDING_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_FEEDING_LOGS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_WATER_QUALITY_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_WATER_QUALITY_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_WATER_QUALITY_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_WATER_QUALITY_LOGS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('CREATE_WATER_QUALITY_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_WATER_QUALITY_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_WATER_QUALITY_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('CREATE_WATER_QUALITY_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('READ_WATER_QUALITY_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_WATER_QUALITY_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_WATER_QUALITY_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_WATER_QUALITY_LOGS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_HEALTH_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_HEALTH_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_HEALTH_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_HEALTH_EVENTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('CREATE_HEALTH_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_HEALTH_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_HEALTH_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('CREATE_HEALTH_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('READ_HEALTH_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_HEALTH_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_HEALTH_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_HEALTH_EVENTS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_HARVESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_HARVESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_HARVESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_HARVESTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('CREATE_HARVESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_HARVESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_HARVESTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('CREATE_HARVESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('READ_HARVESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_HARVESTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('READ_HARVESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_HARVESTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('READ_HARVESTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_HARVESTS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_MARKETPLACE_LISTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_MARKETPLACE_LISTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_MARKETPLACE_LISTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_MARKETPLACE_LISTINGS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_MARKETPLACE_LISTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_MARKETPLACE_LISTINGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('CREATE_MARKETPLACE_LISTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('READ_MARKETPLACE_LISTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_MARKETPLACE_LISTINGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('CREATE_MARKETPLACE_LISTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('READ_MARKETPLACE_LISTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_MARKETPLACE_LISTINGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('READ_MARKETPLACE_LISTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_MARKETPLACE_LISTINGS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_ORDERS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_ORDERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('READ_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_ORDERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('CREATE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('READ_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_ORDERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('READ_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_ORDERS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_ORDER_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_ORDER_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('READ_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_ORDER_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('CREATE_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('READ_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_ORDER_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('READ_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_ORDER_ITEMS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_PAYMENT_TRANSACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_PAYMENT_TRANSACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_PAYMENT_TRANSACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_PAYMENT_TRANSACTIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_PAYMENT_TRANSACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_PAYMENT_TRANSACTIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_PAYMENT_TRANSACTIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('CREATE_PAYMENT_TRANSACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('READ_PAYMENT_TRANSACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_PAYMENT_TRANSACTIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('READ_PAYMENT_TRANSACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_PAYMENT_TRANSACTIONS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_SHIPMENT_UPDATES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_SHIPMENT_UPDATES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_SHIPMENT_UPDATES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_SHIPMENT_UPDATES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_SHIPMENT_UPDATES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_SHIPMENT_UPDATES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('READ_SHIPMENT_UPDATES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_SHIPMENT_UPDATES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('CREATE_SHIPMENT_UPDATES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('READ_SHIPMENT_UPDATES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_SHIPMENT_UPDATES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('READ_SHIPMENT_UPDATES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_SHIPMENT_UPDATES') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_INVESTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_INVESTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_INVESTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_INVESTMENTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_INVESTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_INVESTMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_INVESTMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_INVESTMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('READ_INVESTMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_INVESTMENTS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_API_KEYS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_API_KEYS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_API_KEYS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_API_KEYS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_API_KEYS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_API_KEYS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('READ_API_KEYS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_API_KEYS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_WEBHOOK_ENDPOINTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_WEBHOOK_ENDPOINTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_WEBHOOK_ENDPOINTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_WEBHOOK_ENDPOINTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_WEBHOOK_ENDPOINTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_WEBHOOK_ENDPOINTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('READ_WEBHOOK_ENDPOINTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_WEBHOOK_ENDPOINTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_WEBHOOK_DELIVERIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_WEBHOOK_DELIVERIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_WEBHOOK_DELIVERIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_WEBHOOK_DELIVERIES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_WEBHOOK_DELIVERIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_WEBHOOK_DELIVERIES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('READ_WEBHOOK_DELIVERIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_WEBHOOK_DELIVERIES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_EMAIL_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_EMAIL_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_EMAIL_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_EMAIL_NOTIFICATIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_EMAIL_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_EMAIL_NOTIFICATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_EMAIL_NOTIFICATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('READ_EMAIL_NOTIFICATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_EMAIL_NOTIFICATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_EMAIL_NOTIFICATIONS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_AUDIT_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_AUDIT_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_AUDIT_LOGS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_AUDIT_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_AUDIT_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_AUDIT_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_AUDIT_LOGS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_CSV_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('READ_CSV_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('UPDATE_CSV_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('DELETE_CSV_JOBS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('CREATE_CSV_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('READ_CSV_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('UPDATE_CSV_JOBS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('CREATE_CSV_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('READ_CSV_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('UPDATE_CSV_JOBS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('CREATE_CSV_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('READ_CSV_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('UPDATE_CSV_JOBS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), permissionId: getId('UPDATE_CSV_JOBS') },
                    
                  
                    
                  
                  
             
          
    
  
    
     
  
      
      
        
            { createdAt, updatedAt, roles_permissionsId: getId("PlatformOwner"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("OperationsDirector"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("FarmManager"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("MarketplaceManager"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("InvestorAnalyst"), 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_TENANTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_TENANTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_TENANTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_TENANTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_USER_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_USER_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_USER_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_USER_MEMBERSHIPS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_TENANT_LOCATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_TENANT_LOCATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_TENANT_LOCATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_TENANT_LOCATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PONDS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PONDS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PONDS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PONDS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SPECIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SPECIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SPECIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SPECIES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_BATCHES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_BATCHES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_BATCHES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_BATCHES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_FEED_PRODUCTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_FEED_PRODUCTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_FEED_PRODUCTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_FEED_PRODUCTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INVENTORY_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INVENTORY_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INVENTORY_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INVENTORY_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INVENTORY_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INVENTORY_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INVENTORY_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INVENTORY_MOVEMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_FEEDING_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_FEEDING_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_FEEDING_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_FEEDING_LOGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_WATER_QUALITY_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_WATER_QUALITY_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_WATER_QUALITY_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_WATER_QUALITY_LOGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_HEALTH_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_HEALTH_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_HEALTH_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_HEALTH_EVENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_HARVESTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_HARVESTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_HARVESTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_HARVESTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_MARKETPLACE_LISTINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_MARKETPLACE_LISTINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_MARKETPLACE_LISTINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_MARKETPLACE_LISTINGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ORDERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ORDER_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PAYMENT_TRANSACTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PAYMENT_TRANSACTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PAYMENT_TRANSACTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PAYMENT_TRANSACTIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SHIPMENT_UPDATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SHIPMENT_UPDATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SHIPMENT_UPDATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SHIPMENT_UPDATES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INVESTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INVESTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INVESTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INVESTMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_API_KEYS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_API_KEYS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_API_KEYS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_API_KEYS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_WEBHOOK_ENDPOINTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_WEBHOOK_ENDPOINTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_WEBHOOK_ENDPOINTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_WEBHOOK_ENDPOINTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_WEBHOOK_DELIVERIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_WEBHOOK_DELIVERIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_WEBHOOK_DELIVERIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_WEBHOOK_DELIVERIES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_EMAIL_NOTIFICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_EMAIL_NOTIFICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_EMAIL_NOTIFICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_EMAIL_NOTIFICATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_AUDIT_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_AUDIT_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_AUDIT_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_AUDIT_LOGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_CSV_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_CSV_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_CSV_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_CSV_JOBS') },
    
    
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_USERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_USERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_USERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_USERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_ROLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_ROLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_ROLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_ROLES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_PERMISSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_PERMISSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_PERMISSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_PERMISSIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_ORGANIZATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_ORGANIZATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_ORGANIZATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_ORGANIZATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_TENANTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_TENANTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_TENANTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_TENANTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_USER_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_USER_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_USER_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_USER_MEMBERSHIPS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_TENANT_LOCATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_TENANT_LOCATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_TENANT_LOCATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_TENANT_LOCATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_PONDS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_PONDS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_PONDS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_PONDS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_SPECIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_SPECIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_SPECIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_SPECIES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_BATCHES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_BATCHES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_BATCHES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_BATCHES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_FEED_PRODUCTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_FEED_PRODUCTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_FEED_PRODUCTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_FEED_PRODUCTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_INVENTORY_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_INVENTORY_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_INVENTORY_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_INVENTORY_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_INVENTORY_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_INVENTORY_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_INVENTORY_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_INVENTORY_MOVEMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_FEEDING_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_FEEDING_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_FEEDING_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_FEEDING_LOGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_WATER_QUALITY_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_WATER_QUALITY_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_WATER_QUALITY_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_WATER_QUALITY_LOGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_HEALTH_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_HEALTH_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_HEALTH_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_HEALTH_EVENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_HARVESTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_HARVESTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_HARVESTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_HARVESTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_MARKETPLACE_LISTINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_MARKETPLACE_LISTINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_MARKETPLACE_LISTINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_MARKETPLACE_LISTINGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_ORDERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_ORDER_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_PAYMENT_TRANSACTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_PAYMENT_TRANSACTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_PAYMENT_TRANSACTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_PAYMENT_TRANSACTIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_SHIPMENT_UPDATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_SHIPMENT_UPDATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_SHIPMENT_UPDATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_SHIPMENT_UPDATES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_INVESTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_INVESTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_INVESTMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_INVESTMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_API_KEYS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_API_KEYS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_API_KEYS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_API_KEYS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_WEBHOOK_ENDPOINTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_WEBHOOK_ENDPOINTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_WEBHOOK_ENDPOINTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_WEBHOOK_ENDPOINTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_WEBHOOK_DELIVERIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_WEBHOOK_DELIVERIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_WEBHOOK_DELIVERIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_WEBHOOK_DELIVERIES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_EMAIL_NOTIFICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_EMAIL_NOTIFICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_EMAIL_NOTIFICATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_EMAIL_NOTIFICATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_AUDIT_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_AUDIT_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_AUDIT_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_AUDIT_LOGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_CSV_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_CSV_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_CSV_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_CSV_JOBS') },
    
    
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_API_DOCS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_SEARCH') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_API_DOCS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SEARCH') },
    ]);


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

}
};

