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

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

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

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

    await queryInterface.bulkInsert("roles", [
      
      
      { id: getId("Administrator"), name: "Administrator", createdAt, updatedAt },
      
      
        
          { id: getId("PlantManager"), name: "Plant Manager", createdAt, updatedAt },
        
          { id: getId("ProductionPlanner"), name: "Production Planner", createdAt, updatedAt },
        
          { id: getId("QualityLead"), name: "Quality Lead", createdAt, updatedAt },
        
          { id: getId("MaintenanceTechnician"), name: "Maintenance Technician", createdAt, updatedAt },
        
          { id: getId("WarehouseOperator"), name: "Warehouse Operator", 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","suppliers","customers","uoms","warehouses","locations","items","approved_vendors","boms","bom_lines","routings","work_centers","routing_operations","machines","machine_events","reason_codes","work_orders","work_order_operations","lots","serials","inventory_balances","inventory_movements","purchase_orders","purchase_order_lines","inspection_plans","inspection_characteristics","inspections","inspection_results","nonconformances","disposition_codes","capa_actions","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.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("PlantManager"), permissionId: getId('CREATE_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_SUPPLIERS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_SUPPLIERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_SUPPLIERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_SUPPLIERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_SUPPLIERS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_CUSTOMERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_CUSTOMERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_CUSTOMERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_CUSTOMERS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_CUSTOMERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_CUSTOMERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_CUSTOMERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_CUSTOMERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_CUSTOMERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_CUSTOMERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_CUSTOMERS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_UOMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_UOMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_UOMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_UOMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_UOMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_UOMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_UOMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_UOMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_UOMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_UOMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_UOMS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_WAREHOUSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_WAREHOUSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_WAREHOUSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_WAREHOUSES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_WAREHOUSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_WAREHOUSES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_WAREHOUSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_WAREHOUSES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_WAREHOUSES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_WAREHOUSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_WAREHOUSES') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_LOCATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_LOCATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_LOCATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_LOCATIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_LOCATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_LOCATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_LOCATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_LOCATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_LOCATIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_LOCATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_LOCATIONS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_ITEMS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_APPROVED_VENDORS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_APPROVED_VENDORS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_APPROVED_VENDORS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_APPROVED_VENDORS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_APPROVED_VENDORS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_APPROVED_VENDORS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_APPROVED_VENDORS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_APPROVED_VENDORS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_APPROVED_VENDORS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_APPROVED_VENDORS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_APPROVED_VENDORS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_BOMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_BOMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_BOMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_BOMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_BOMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_BOMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_BOMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_BOMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_BOMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_BOMS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_BOM_LINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_BOM_LINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_BOM_LINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_BOM_LINES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_BOM_LINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_BOM_LINES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_BOM_LINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_BOM_LINES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_BOM_LINES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_BOM_LINES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_ROUTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_ROUTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_ROUTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_ROUTINGS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_ROUTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_ROUTINGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_ROUTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_ROUTINGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_ROUTINGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_ROUTINGS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_WORK_CENTERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_WORK_CENTERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_WORK_CENTERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_WORK_CENTERS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_WORK_CENTERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_WORK_CENTERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_WORK_CENTERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_WORK_CENTERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_WORK_CENTERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('UPDATE_WORK_CENTERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_WORK_CENTERS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_ROUTING_OPERATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_ROUTING_OPERATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_ROUTING_OPERATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_ROUTING_OPERATIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_ROUTING_OPERATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_ROUTING_OPERATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_ROUTING_OPERATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_ROUTING_OPERATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_ROUTING_OPERATIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_ROUTING_OPERATIONS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_MACHINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_MACHINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_MACHINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_MACHINES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_MACHINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_MACHINES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_MACHINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_MACHINES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_MACHINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('UPDATE_MACHINES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_MACHINES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_MACHINE_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_MACHINE_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_MACHINE_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_MACHINE_EVENTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_MACHINE_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_MACHINE_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_MACHINE_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_MACHINE_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('CREATE_MACHINE_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_MACHINE_EVENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('UPDATE_MACHINE_EVENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_MACHINE_EVENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_REASON_CODES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_REASON_CODES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_REASON_CODES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_REASON_CODES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_REASON_CODES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_REASON_CODES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_REASON_CODES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_REASON_CODES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('DELETE_REASON_CODES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_REASON_CODES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('UPDATE_REASON_CODES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_REASON_CODES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_REASON_CODES') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_WORK_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_WORK_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_WORK_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_WORK_ORDERS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('CREATE_WORK_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_WORK_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_WORK_ORDERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_WORK_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_WORK_ORDERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_WORK_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('UPDATE_WORK_ORDERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_WORK_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_WORK_ORDERS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_WORK_ORDER_OPERATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_WORK_ORDER_OPERATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_WORK_ORDER_OPERATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_WORK_ORDER_OPERATIONS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('CREATE_WORK_ORDER_OPERATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_WORK_ORDER_OPERATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_WORK_ORDER_OPERATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_WORK_ORDER_OPERATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_WORK_ORDER_OPERATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_WORK_ORDER_OPERATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('UPDATE_WORK_ORDER_OPERATIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_WORK_ORDER_OPERATIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_WORK_ORDER_OPERATIONS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_LOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_LOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_LOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_LOTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_LOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_LOTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_LOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_LOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('DELETE_LOTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_LOTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('CREATE_LOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_LOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_LOTS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_SERIALS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_SERIALS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_SERIALS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_SERIALS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_SERIALS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_SERIALS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_SERIALS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_SERIALS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('DELETE_SERIALS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_SERIALS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('CREATE_SERIALS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_SERIALS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_SERIALS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_INVENTORY_BALANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_INVENTORY_BALANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_INVENTORY_BALANCES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_INVENTORY_BALANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_INVENTORY_BALANCES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_INVENTORY_BALANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_INVENTORY_BALANCES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_INVENTORY_BALANCES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_INVENTORY_BALANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_INVENTORY_BALANCES') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_INVENTORY_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_INVENTORY_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_INVENTORY_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_INVENTORY_MOVEMENTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('CREATE_INVENTORY_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_INVENTORY_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_INVENTORY_MOVEMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_INVENTORY_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_INVENTORY_MOVEMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_INVENTORY_MOVEMENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('CREATE_INVENTORY_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_INVENTORY_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_INVENTORY_MOVEMENTS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_PURCHASE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_PURCHASE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_PURCHASE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_PURCHASE_ORDERS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('CREATE_PURCHASE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_PURCHASE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_PURCHASE_ORDERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_PURCHASE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_PURCHASE_ORDERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_PURCHASE_ORDERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_PURCHASE_ORDERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_PURCHASE_ORDERS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_PURCHASE_ORDER_LINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_PURCHASE_ORDER_LINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_PURCHASE_ORDER_LINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_PURCHASE_ORDER_LINES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('CREATE_PURCHASE_ORDER_LINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_PURCHASE_ORDER_LINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_PURCHASE_ORDER_LINES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_PURCHASE_ORDER_LINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_PURCHASE_ORDER_LINES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_PURCHASE_ORDER_LINES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_PURCHASE_ORDER_LINES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_PURCHASE_ORDER_LINES') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_INSPECTION_PLANS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_INSPECTION_PLANS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_INSPECTION_PLANS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_INSPECTION_PLANS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_INSPECTION_PLANS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_INSPECTION_PLANS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('CREATE_INSPECTION_PLANS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_INSPECTION_PLANS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_INSPECTION_PLANS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_INSPECTION_PLANS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_INSPECTION_PLANS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_INSPECTION_PLANS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_INSPECTION_CHARACTERISTICS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_INSPECTION_CHARACTERISTICS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_INSPECTION_CHARACTERISTICS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_INSPECTION_CHARACTERISTICS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_INSPECTION_CHARACTERISTICS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_INSPECTION_CHARACTERISTICS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('CREATE_INSPECTION_CHARACTERISTICS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_INSPECTION_CHARACTERISTICS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_INSPECTION_CHARACTERISTICS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_INSPECTION_CHARACTERISTICS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_INSPECTION_CHARACTERISTICS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_INSPECTION_CHARACTERISTICS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_INSPECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_INSPECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_INSPECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_INSPECTIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_INSPECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_INSPECTIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('CREATE_INSPECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_INSPECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_INSPECTIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_INSPECTIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_INSPECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_INSPECTIONS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_INSPECTION_RESULTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_INSPECTION_RESULTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_INSPECTION_RESULTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_INSPECTION_RESULTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_INSPECTION_RESULTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_INSPECTION_RESULTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('CREATE_INSPECTION_RESULTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_INSPECTION_RESULTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_INSPECTION_RESULTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_INSPECTION_RESULTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_INSPECTION_RESULTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_INSPECTION_RESULTS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_NONCONFORMANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_NONCONFORMANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_NONCONFORMANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_NONCONFORMANCES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_NONCONFORMANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_NONCONFORMANCES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('CREATE_NONCONFORMANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_NONCONFORMANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_NONCONFORMANCES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_NONCONFORMANCES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_NONCONFORMANCES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_NONCONFORMANCES') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_DISPOSITION_CODES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_DISPOSITION_CODES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_DISPOSITION_CODES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_DISPOSITION_CODES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_DISPOSITION_CODES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_DISPOSITION_CODES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('CREATE_DISPOSITION_CODES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_DISPOSITION_CODES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_DISPOSITION_CODES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_DISPOSITION_CODES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_DISPOSITION_CODES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_DISPOSITION_CODES') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_CAPA_ACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_CAPA_ACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('UPDATE_CAPA_ACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('DELETE_CAPA_ACTIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_CAPA_ACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('UPDATE_CAPA_ACTIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('CREATE_CAPA_ACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_CAPA_ACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('UPDATE_CAPA_ACTIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_CAPA_ACTIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_CAPA_ACTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('UPDATE_CAPA_ACTIONS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
     
  
      
      
        
            { createdAt, updatedAt, roles_permissionsId: getId("PlantManager"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("ProductionPlanner"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("QualityLead"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("MaintenanceTechnician"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("WarehouseOperator"), permissionId: getId('CREATE_SEARCH') },
        
      
      
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_USERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_USERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_USERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_USERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ROLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ROLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ROLES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ROLES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PERMISSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PERMISSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PERMISSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PERMISSIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_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_CUSTOMERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_CUSTOMERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_CUSTOMERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_CUSTOMERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_UOMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_UOMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_UOMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_UOMS') },
    
    { 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_LOCATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_LOCATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_LOCATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_LOCATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_APPROVED_VENDORS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_APPROVED_VENDORS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_APPROVED_VENDORS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_APPROVED_VENDORS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_BOMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_BOMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_BOMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_BOMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_BOM_LINES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_BOM_LINES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_BOM_LINES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_BOM_LINES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ROUTINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ROUTINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ROUTINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ROUTINGS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_WORK_CENTERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_WORK_CENTERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_WORK_CENTERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_WORK_CENTERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ROUTING_OPERATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ROUTING_OPERATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ROUTING_OPERATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ROUTING_OPERATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_MACHINES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_MACHINES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_MACHINES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_MACHINES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_MACHINE_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_MACHINE_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_MACHINE_EVENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_MACHINE_EVENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_REASON_CODES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_REASON_CODES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_REASON_CODES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_REASON_CODES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_WORK_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_WORK_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_WORK_ORDERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_WORK_ORDERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_WORK_ORDER_OPERATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_WORK_ORDER_OPERATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_WORK_ORDER_OPERATIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_WORK_ORDER_OPERATIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_LOTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_LOTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_LOTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_LOTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SERIALS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SERIALS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SERIALS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SERIALS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INVENTORY_BALANCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INVENTORY_BALANCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INVENTORY_BALANCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INVENTORY_BALANCES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INVENTORY_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INVENTORY_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INVENTORY_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INVENTORY_MOVEMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_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_LINES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PURCHASE_ORDER_LINES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PURCHASE_ORDER_LINES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PURCHASE_ORDER_LINES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INSPECTION_PLANS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INSPECTION_PLANS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INSPECTION_PLANS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INSPECTION_PLANS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INSPECTION_CHARACTERISTICS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INSPECTION_CHARACTERISTICS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INSPECTION_CHARACTERISTICS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INSPECTION_CHARACTERISTICS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INSPECTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INSPECTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INSPECTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INSPECTIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INSPECTION_RESULTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INSPECTION_RESULTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INSPECTION_RESULTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INSPECTION_RESULTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_NONCONFORMANCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_NONCONFORMANCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_NONCONFORMANCES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_NONCONFORMANCES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_DISPOSITION_CODES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_DISPOSITION_CODES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_DISPOSITION_CODES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_DISPOSITION_CODES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_CAPA_ACTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_CAPA_ACTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_CAPA_ACTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_CAPA_ACTIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_AUDIT_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_AUDIT_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_AUDIT_LOGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_AUDIT_LOGS') },
    
    
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('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("PlantManager")}' WHERE "email"='client@hello.com'`);
        await queryInterface.sequelize.query(`UPDATE "users" SET "app_roleId"='${getId("ProductionPlanner")}' WHERE "email"='john@doe.com'`);
       
      
      

}
};

