
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("tenant_owner"), name: "tenant_owner", createdAt, updatedAt },
        
          { id: getId("finance_manager"), name: "finance_manager", createdAt, updatedAt },
        
          { id: getId("sales_lead"), name: "sales_lead", createdAt, updatedAt },
        
          { id: getId("warehouse_manager"), name: "warehouse_manager", createdAt, updatedAt },
        
          { id: getId("auditor"), name: "auditor", 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","organization_memberships","tax_rates","payment_terms","numbering_sequences","clients","suppliers","product_categories","units","products","warehouses","quotes","quote_items","sales_orders","sales_order_items","delivery_notes","delivery_note_items","invoices","invoice_items","payments","credit_notes","credit_note_items","purchase_orders","purchase_order_items","stock_receptions","stock_reception_items","stock_reservations","stock_movements","inventory_counts","inventory_count_items","import_jobs","audit_logs",,
    ];
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("tenant_owner"), permissionId: getId('CREATE_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_USERS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_ORGANIZATION_MEMBERSHIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_ORGANIZATION_MEMBERSHIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_ORGANIZATION_MEMBERSHIPS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_ORGANIZATION_MEMBERSHIPS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_ORGANIZATION_MEMBERSHIPS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_ORGANIZATION_MEMBERSHIPS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_ORGANIZATION_MEMBERSHIPS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_ORGANIZATION_MEMBERSHIPS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_TAX_RATES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_TAX_RATES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_TAX_RATES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_TAX_RATES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('CREATE_TAX_RATES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_TAX_RATES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_TAX_RATES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_TAX_RATES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_TAX_RATES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_TAX_RATES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_PAYMENT_TERMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_PAYMENT_TERMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_PAYMENT_TERMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_PAYMENT_TERMS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('CREATE_PAYMENT_TERMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_PAYMENT_TERMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_PAYMENT_TERMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_PAYMENT_TERMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('UPDATE_PAYMENT_TERMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_PAYMENT_TERMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_PAYMENT_TERMS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_NUMBERING_SEQUENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_NUMBERING_SEQUENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_NUMBERING_SEQUENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_NUMBERING_SEQUENCES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('CREATE_NUMBERING_SEQUENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_NUMBERING_SEQUENCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_NUMBERING_SEQUENCES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_NUMBERING_SEQUENCES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_NUMBERING_SEQUENCES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_NUMBERING_SEQUENCES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_CLIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_CLIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_CLIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_CLIENTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('CREATE_CLIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_CLIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_CLIENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('CREATE_CLIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_CLIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('UPDATE_CLIENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_CLIENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_CLIENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_SUPPLIERS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('CREATE_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_SUPPLIERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_SUPPLIERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_SUPPLIERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_SUPPLIERS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_PRODUCT_CATEGORIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_PRODUCT_CATEGORIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_PRODUCT_CATEGORIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_PRODUCT_CATEGORIES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_PRODUCT_CATEGORIES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_PRODUCT_CATEGORIES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_PRODUCT_CATEGORIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_PRODUCT_CATEGORIES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_PRODUCT_CATEGORIES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_UNITS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_UNITS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_UNITS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_UNITS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_UNITS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_UNITS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_UNITS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_UNITS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_UNITS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_PRODUCTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_PRODUCTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('UPDATE_PRODUCTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('CREATE_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_PRODUCTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_PRODUCTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_WAREHOUSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_WAREHOUSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_WAREHOUSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_WAREHOUSES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_WAREHOUSES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_WAREHOUSES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('CREATE_WAREHOUSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_WAREHOUSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_WAREHOUSES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_WAREHOUSES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_QUOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_QUOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_QUOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_QUOTES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_QUOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_QUOTES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('CREATE_QUOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_QUOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('UPDATE_QUOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('DELETE_QUOTES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_QUOTES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_QUOTES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_QUOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_QUOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_QUOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_QUOTE_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_QUOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_QUOTE_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('CREATE_QUOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_QUOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('UPDATE_QUOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('DELETE_QUOTE_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_QUOTE_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_QUOTE_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_SALES_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_SALES_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_SALES_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_SALES_ORDERS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_SALES_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_SALES_ORDERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('CREATE_SALES_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_SALES_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('UPDATE_SALES_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('DELETE_SALES_ORDERS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_SALES_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_SALES_ORDERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_SALES_ORDERS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_SALES_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_SALES_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_SALES_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_SALES_ORDER_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_SALES_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_SALES_ORDER_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('CREATE_SALES_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_SALES_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('UPDATE_SALES_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('DELETE_SALES_ORDER_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_SALES_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_SALES_ORDER_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_SALES_ORDER_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_DELIVERY_NOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_DELIVERY_NOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_DELIVERY_NOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_DELIVERY_NOTES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_DELIVERY_NOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_DELIVERY_NOTES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('CREATE_DELIVERY_NOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_DELIVERY_NOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('UPDATE_DELIVERY_NOTES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('CREATE_DELIVERY_NOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_DELIVERY_NOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_DELIVERY_NOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('DELETE_DELIVERY_NOTES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_DELIVERY_NOTES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_DELIVERY_NOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_DELIVERY_NOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_DELIVERY_NOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_DELIVERY_NOTE_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_DELIVERY_NOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_DELIVERY_NOTE_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('CREATE_DELIVERY_NOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_DELIVERY_NOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('UPDATE_DELIVERY_NOTE_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('CREATE_DELIVERY_NOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_DELIVERY_NOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_DELIVERY_NOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('DELETE_DELIVERY_NOTE_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_DELIVERY_NOTE_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_INVOICES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('CREATE_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('DELETE_INVOICES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('CREATE_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('UPDATE_INVOICES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_INVOICES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_INVOICES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_INVOICE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_INVOICE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_INVOICE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_INVOICE_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('CREATE_INVOICE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_INVOICE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_INVOICE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('DELETE_INVOICE_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('CREATE_INVOICE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_INVOICE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('UPDATE_INVOICE_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_INVOICE_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_INVOICE_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_PAYMENTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('CREATE_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('DELETE_PAYMENTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_CREDIT_NOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_CREDIT_NOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_CREDIT_NOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_CREDIT_NOTES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('CREATE_CREDIT_NOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_CREDIT_NOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_CREDIT_NOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('DELETE_CREDIT_NOTES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_CREDIT_NOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('UPDATE_CREDIT_NOTES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_CREDIT_NOTES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_CREDIT_NOTES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_CREDIT_NOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_CREDIT_NOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_CREDIT_NOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_CREDIT_NOTE_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('CREATE_CREDIT_NOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_CREDIT_NOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_CREDIT_NOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('DELETE_CREDIT_NOTE_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_CREDIT_NOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('UPDATE_CREDIT_NOTE_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_CREDIT_NOTE_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_CREDIT_NOTE_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_PURCHASE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_PURCHASE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_PURCHASE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_PURCHASE_ORDERS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('CREATE_PURCHASE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_PURCHASE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_PURCHASE_ORDERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_PURCHASE_ORDERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('CREATE_PURCHASE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_PURCHASE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_PURCHASE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('DELETE_PURCHASE_ORDERS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_PURCHASE_ORDERS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_PURCHASE_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_PURCHASE_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_PURCHASE_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_PURCHASE_ORDER_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('CREATE_PURCHASE_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_PURCHASE_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_PURCHASE_ORDER_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_PURCHASE_ORDER_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('CREATE_PURCHASE_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_PURCHASE_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_PURCHASE_ORDER_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('DELETE_PURCHASE_ORDER_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_PURCHASE_ORDER_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_STOCK_RECEPTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_STOCK_RECEPTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_STOCK_RECEPTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_STOCK_RECEPTIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_STOCK_RECEPTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_STOCK_RECEPTIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_STOCK_RECEPTIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('CREATE_STOCK_RECEPTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_STOCK_RECEPTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_STOCK_RECEPTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('DELETE_STOCK_RECEPTIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_STOCK_RECEPTIONS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_STOCK_RECEPTION_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_STOCK_RECEPTION_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_STOCK_RECEPTION_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_STOCK_RECEPTION_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_STOCK_RECEPTION_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_STOCK_RECEPTION_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_STOCK_RECEPTION_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('CREATE_STOCK_RECEPTION_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_STOCK_RECEPTION_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_STOCK_RECEPTION_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('DELETE_STOCK_RECEPTION_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_STOCK_RECEPTION_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_STOCK_RESERVATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_STOCK_RESERVATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_STOCK_RESERVATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_STOCK_RESERVATIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_STOCK_RESERVATIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_STOCK_RESERVATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('UPDATE_STOCK_RESERVATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('CREATE_STOCK_RESERVATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_STOCK_RESERVATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_STOCK_RESERVATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('DELETE_STOCK_RESERVATIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_STOCK_RESERVATIONS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_STOCK_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_STOCK_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_STOCK_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_STOCK_MOVEMENTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_STOCK_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_STOCK_MOVEMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_STOCK_MOVEMENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('CREATE_STOCK_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_STOCK_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_STOCK_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('DELETE_STOCK_MOVEMENTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_STOCK_MOVEMENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_INVENTORY_COUNTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_INVENTORY_COUNTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_INVENTORY_COUNTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_INVENTORY_COUNTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_INVENTORY_COUNTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_INVENTORY_COUNTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('CREATE_INVENTORY_COUNTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_INVENTORY_COUNTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_INVENTORY_COUNTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('DELETE_INVENTORY_COUNTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_INVENTORY_COUNTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_INVENTORY_COUNT_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_INVENTORY_COUNT_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_INVENTORY_COUNT_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_INVENTORY_COUNT_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_INVENTORY_COUNT_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_INVENTORY_COUNT_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('CREATE_INVENTORY_COUNT_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_INVENTORY_COUNT_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_INVENTORY_COUNT_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('DELETE_INVENTORY_COUNT_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_INVENTORY_COUNT_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_IMPORT_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_IMPORT_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_IMPORT_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('DELETE_IMPORT_JOBS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('CREATE_IMPORT_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_IMPORT_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('UPDATE_IMPORT_JOBS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('CREATE_IMPORT_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_IMPORT_JOBS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_IMPORT_JOBS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('UPDATE_IMPORT_JOBS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_IMPORT_JOBS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('UPDATE_AUDIT_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("auditor"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
     
  
      
      
        
            { createdAt, updatedAt, roles_permissionsId: getId("tenant_owner"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("finance_manager"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("sales_lead"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("warehouse_manager"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("auditor"), 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_ORGANIZATION_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ORGANIZATION_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ORGANIZATION_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ORGANIZATION_MEMBERSHIPS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_TAX_RATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_TAX_RATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_TAX_RATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_TAX_RATES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PAYMENT_TERMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PAYMENT_TERMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PAYMENT_TERMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PAYMENT_TERMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_NUMBERING_SEQUENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_NUMBERING_SEQUENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_NUMBERING_SEQUENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_NUMBERING_SEQUENCES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_CLIENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_CLIENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_CLIENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_CLIENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SUPPLIERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SUPPLIERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SUPPLIERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SUPPLIERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PRODUCT_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PRODUCT_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PRODUCT_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PRODUCT_CATEGORIES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_UNITS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_UNITS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_UNITS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_UNITS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PRODUCTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PRODUCTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PRODUCTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PRODUCTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_WAREHOUSES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_WAREHOUSES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_WAREHOUSES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_WAREHOUSES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_QUOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_QUOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_QUOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_QUOTES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_QUOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_QUOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_QUOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_QUOTE_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SALES_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SALES_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SALES_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SALES_ORDERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SALES_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SALES_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SALES_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SALES_ORDER_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_DELIVERY_NOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_DELIVERY_NOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_DELIVERY_NOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_DELIVERY_NOTES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_DELIVERY_NOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_DELIVERY_NOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_DELIVERY_NOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_DELIVERY_NOTE_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INVOICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INVOICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INVOICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INVOICES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INVOICE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INVOICE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INVOICE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INVOICE_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PAYMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_CREDIT_NOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_CREDIT_NOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_CREDIT_NOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_CREDIT_NOTES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_CREDIT_NOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_CREDIT_NOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_CREDIT_NOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_CREDIT_NOTE_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PURCHASE_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PURCHASE_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PURCHASE_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PURCHASE_ORDERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PURCHASE_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PURCHASE_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PURCHASE_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PURCHASE_ORDER_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_STOCK_RECEPTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_STOCK_RECEPTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_STOCK_RECEPTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_STOCK_RECEPTIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_STOCK_RECEPTION_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_STOCK_RECEPTION_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_STOCK_RECEPTION_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_STOCK_RECEPTION_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_STOCK_RESERVATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_STOCK_RESERVATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_STOCK_RESERVATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_STOCK_RESERVATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_STOCK_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_STOCK_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_STOCK_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_STOCK_MOVEMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INVENTORY_COUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INVENTORY_COUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INVENTORY_COUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INVENTORY_COUNTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INVENTORY_COUNT_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INVENTORY_COUNT_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INVENTORY_COUNT_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INVENTORY_COUNT_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_IMPORT_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_IMPORT_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_IMPORT_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_IMPORT_JOBS') },
    
    { 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("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_ORGANIZATION_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_ORGANIZATION_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_ORGANIZATION_MEMBERSHIPS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_ORGANIZATION_MEMBERSHIPS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_TAX_RATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_TAX_RATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_TAX_RATES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_TAX_RATES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_PAYMENT_TERMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_PAYMENT_TERMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_PAYMENT_TERMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_PAYMENT_TERMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_NUMBERING_SEQUENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_NUMBERING_SEQUENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_NUMBERING_SEQUENCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_NUMBERING_SEQUENCES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_CLIENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_CLIENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_CLIENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_CLIENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_SUPPLIERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_SUPPLIERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_SUPPLIERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_SUPPLIERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_PRODUCT_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_PRODUCT_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_PRODUCT_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_PRODUCT_CATEGORIES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_UNITS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_UNITS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_UNITS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_UNITS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_PRODUCTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_PRODUCTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_PRODUCTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_PRODUCTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_WAREHOUSES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_WAREHOUSES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_WAREHOUSES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_WAREHOUSES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_QUOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_QUOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_QUOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_QUOTES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_QUOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_QUOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_QUOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_QUOTE_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_SALES_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_SALES_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_SALES_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_SALES_ORDERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_SALES_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_SALES_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_SALES_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_SALES_ORDER_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_DELIVERY_NOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_DELIVERY_NOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_DELIVERY_NOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_DELIVERY_NOTES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_DELIVERY_NOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_DELIVERY_NOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_DELIVERY_NOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_DELIVERY_NOTE_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_INVOICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_INVOICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_INVOICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_INVOICES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_INVOICE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_INVOICE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_INVOICE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_INVOICE_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_PAYMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_CREDIT_NOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_CREDIT_NOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_CREDIT_NOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_CREDIT_NOTES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_CREDIT_NOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_CREDIT_NOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_CREDIT_NOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_CREDIT_NOTE_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_PURCHASE_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_PURCHASE_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_PURCHASE_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_PURCHASE_ORDERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_PURCHASE_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_PURCHASE_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_PURCHASE_ORDER_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_PURCHASE_ORDER_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_STOCK_RECEPTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_STOCK_RECEPTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_STOCK_RECEPTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_STOCK_RECEPTIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_STOCK_RECEPTION_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_STOCK_RECEPTION_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_STOCK_RECEPTION_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_STOCK_RECEPTION_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_STOCK_RESERVATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_STOCK_RESERVATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_STOCK_RESERVATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_STOCK_RESERVATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_STOCK_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_STOCK_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_STOCK_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_STOCK_MOVEMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_INVENTORY_COUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_INVENTORY_COUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_INVENTORY_COUNTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_INVENTORY_COUNTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_INVENTORY_COUNT_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_INVENTORY_COUNT_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_INVENTORY_COUNT_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_INVENTORY_COUNT_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('CREATE_IMPORT_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('READ_IMPORT_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('UPDATE_IMPORT_JOBS') },
    { createdAt, updatedAt, roles_permissionsId: getId("SuperAdmin"), permissionId: getId('DELETE_IMPORT_JOBS') },
    
    { 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('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("tenant_owner")}' WHERE "email"='client@hello.com'`);
        await queryInterface.sequelize.query(`UPDATE "users" SET "app_roleId"='${getId("finance_manager")}' WHERE "email"='john@doe.com'`);
       
      
      

}
};

