
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("DirecteurGeneral"), name: "Directeur General", createdAt, updatedAt },
        
          { id: getId("ResponsableFinance"), name: "Responsable Finance", createdAt, updatedAt },
        
          { id: getId("ResponsableCommercial"), name: "Responsable Commercial", createdAt, updatedAt },
        
          { id: getId("ResponsableElevage"), name: "Responsable Elevage", createdAt, updatedAt },
        
          { id: getId("Magasinier"), name: "Magasinier", 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","role_permissions","clients","suppliers","categories","products","stock_movements","quotes","quote_items","sales","sale_items","invoices","invoice_items","payments","expenses","cash_movements","poultry_lots","egg_collections","treatments","alerts","settings","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("DirecteurGeneral"), permissionId: getId('CREATE_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_USERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_USERS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_USERS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_ROLE_PERMISSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_ROLE_PERMISSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_ROLE_PERMISSIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_ROLE_PERMISSIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_ROLE_PERMISSIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_ROLE_PERMISSIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_ROLE_PERMISSIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_CLIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_CLIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_CLIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_CLIENTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_CLIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('UPDATE_CLIENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('CREATE_CLIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_CLIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('UPDATE_CLIENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_CLIENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('UPDATE_CLIENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_CLIENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_SUPPLIERS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('UPDATE_SUPPLIERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('UPDATE_SUPPLIERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_SUPPLIERS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('UPDATE_SUPPLIERS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_SUPPLIERS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_CATEGORIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_CATEGORIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_CATEGORIES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_CATEGORIES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_CATEGORIES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_CATEGORIES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_CATEGORIES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_CATEGORIES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_PRODUCTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('UPDATE_PRODUCTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('UPDATE_PRODUCTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('UPDATE_PRODUCTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_PRODUCTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('UPDATE_PRODUCTS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_STOCK_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_STOCK_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_STOCK_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_STOCK_MOVEMENTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_STOCK_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('UPDATE_STOCK_MOVEMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_STOCK_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('UPDATE_STOCK_MOVEMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_STOCK_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('UPDATE_STOCK_MOVEMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('CREATE_STOCK_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_STOCK_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('UPDATE_STOCK_MOVEMENTS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_QUOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_QUOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_QUOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_QUOTES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_QUOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('UPDATE_QUOTES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('CREATE_QUOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_QUOTES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('UPDATE_QUOTES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_QUOTES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_QUOTES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_QUOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_QUOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_QUOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_QUOTE_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_QUOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('UPDATE_QUOTE_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('CREATE_QUOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_QUOTE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('UPDATE_QUOTE_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_QUOTE_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_QUOTE_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_SALES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_SALES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_SALES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_SALES') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_SALES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('UPDATE_SALES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('CREATE_SALES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_SALES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('UPDATE_SALES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_SALES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_SALES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('UPDATE_SALES') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_SALE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_SALE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_SALE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_SALE_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_SALE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('UPDATE_SALE_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('CREATE_SALE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_SALE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('UPDATE_SALE_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_SALE_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_SALE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('UPDATE_SALE_ITEMS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_INVOICES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('CREATE_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('UPDATE_INVOICES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('CREATE_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_INVOICES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('UPDATE_INVOICES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_INVOICES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_INVOICES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_INVOICE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_INVOICE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_INVOICE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_INVOICE_ITEMS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('CREATE_INVOICE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_INVOICE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('UPDATE_INVOICE_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('CREATE_INVOICE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_INVOICE_ITEMS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('UPDATE_INVOICE_ITEMS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_INVOICE_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_INVOICE_ITEMS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_PAYMENTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('CREATE_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('UPDATE_PAYMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('UPDATE_PAYMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_PAYMENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_EXPENSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_EXPENSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_EXPENSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_EXPENSES') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('CREATE_EXPENSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_EXPENSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('UPDATE_EXPENSES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_EXPENSES') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_EXPENSES') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('UPDATE_EXPENSES') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_EXPENSES') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_CASH_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_CASH_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_CASH_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_CASH_MOVEMENTS') },
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('CREATE_CASH_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_CASH_MOVEMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('UPDATE_CASH_MOVEMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_CASH_MOVEMENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_CASH_MOVEMENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_CASH_MOVEMENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_POULTRY_LOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_POULTRY_LOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_POULTRY_LOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_POULTRY_LOTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_POULTRY_LOTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_POULTRY_LOTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('CREATE_POULTRY_LOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_POULTRY_LOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('UPDATE_POULTRY_LOTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_POULTRY_LOTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('UPDATE_POULTRY_LOTS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_EGG_COLLECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_EGG_COLLECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_EGG_COLLECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_EGG_COLLECTIONS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_EGG_COLLECTIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_EGG_COLLECTIONS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('CREATE_EGG_COLLECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_EGG_COLLECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('UPDATE_EGG_COLLECTIONS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_EGG_COLLECTIONS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('UPDATE_EGG_COLLECTIONS') },
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_TREATMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_TREATMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_TREATMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_TREATMENTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_TREATMENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_TREATMENTS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('CREATE_TREATMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_TREATMENTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('UPDATE_TREATMENTS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_TREATMENTS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_ALERTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('UPDATE_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('DELETE_ALERTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('UPDATE_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('DELETE_ALERTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('UPDATE_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('DELETE_ALERTS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('UPDATE_ALERTS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('DELETE_ALERTS') },
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_SETTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_SETTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_SETTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_SETTINGS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_SETTINGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('UPDATE_SETTINGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_SETTINGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_SETTINGS') },
                    
                  
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
    
      
      
          
                
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('UPDATE_AUDIT_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('DELETE_AUDIT_LOGS') },
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('UPDATE_AUDIT_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('UPDATE_AUDIT_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('UPDATE_AUDIT_LOGS') },
                    
                  
                    
                  
                  
                
               
                
                  
                    
                  
                    
                      { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), permissionId: getId('READ_AUDIT_LOGS') },
                    
                  
                    
                  
                    
                  
                  
             
          
    
  
    
     
  
      
      
        
            { createdAt, updatedAt, roles_permissionsId: getId("DirecteurGeneral"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("ResponsableFinance"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("ResponsableCommercial"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("ResponsableElevage"), permissionId: getId('CREATE_SEARCH') },
        
            { createdAt, updatedAt, roles_permissionsId: getId("Magasinier"), 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_ROLE_PERMISSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ROLE_PERMISSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ROLE_PERMISSIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ROLE_PERMISSIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_CLIENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_CLIENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_CLIENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_CLIENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SUPPLIERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SUPPLIERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SUPPLIERS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SUPPLIERS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_CATEGORIES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_CATEGORIES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PRODUCTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PRODUCTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PRODUCTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PRODUCTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_STOCK_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_STOCK_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_STOCK_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_STOCK_MOVEMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_QUOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_QUOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_QUOTES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_QUOTES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_QUOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_QUOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_QUOTE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_QUOTE_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SALES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SALES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SALES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SALES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SALE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SALE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SALE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SALE_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INVOICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INVOICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INVOICES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INVOICES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_INVOICE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_INVOICE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_INVOICE_ITEMS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_INVOICE_ITEMS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_PAYMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_PAYMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_EXPENSES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_EXPENSES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_EXPENSES') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_EXPENSES') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_CASH_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_CASH_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_CASH_MOVEMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_CASH_MOVEMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_POULTRY_LOTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_POULTRY_LOTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_POULTRY_LOTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_POULTRY_LOTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_EGG_COLLECTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_EGG_COLLECTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_EGG_COLLECTIONS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_EGG_COLLECTIONS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_TREATMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_TREATMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_TREATMENTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_TREATMENTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_ALERTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_ALERTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_ALERTS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_ALERTS') },
    
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('CREATE_SETTINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('READ_SETTINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('UPDATE_SETTINGS') },
    { createdAt, updatedAt, roles_permissionsId: getId("Administrator"), permissionId: getId('DELETE_SETTINGS') },
    
    { 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("DirecteurGeneral")}' WHERE "email"='client@hello.com'`);
        await queryInterface.sequelize.query(`UPDATE "users" SET "app_roleId"='${getId("ResponsableFinance")}' WHERE "email"='john@doe.com'`);
       
      
      

}
};

