Ok the main problem was that the file needed to be in app\src\api\hotel-product\content-types\hotel-product\lifecycles.js instead, then I could see the logs.
Then the correct way to use services to access another content type is different and the object to create the entry needs to be different
See code below (it’s working now)
module.exports = {
async beforeCreate(event) {
const { data, where, select, populate } = event.params;
console.log("creating product", data);
if (!data.inventory_item) {
try {
// console.log(Object.keys(strapi.services['api::inventory-item.inventory-item'].create));
const new_inventory_item = await strapi.services['api::inventory-item.inventory-item'].create({data: {quantity: data.quantity_in_stock, title: data.slug}});
// console.log("new inventory item", new_inventory_item);
event.params.data.inventory_item = new_inventory_item;
} catch (err) {
strapi.log.debug("Error assigning new inventory item to newly created product\n", err);
}
}
},
afterCreate(event) {
const { result, params } = event;
// do something to the result;
},
};