text: /**
   * 
   * EXERCISE 1
   * 
   * @param {Promise} promise 
   * @param {function} asyncTransformer 
   */
  function flatMapPromise(promise, asyncTransformer){
    return new Promise((resolve, reject) => {
      promise
        .then(async data => {
          await resolve(asyncTransformer(data));
        }, 
        err => reject(err));
    });
  }
  
  /**
   * 
   * EXERCISE 2
   * 
   * @param {Promise} firstPromise 
   * @param {function} slowAsyncProcess 
   */
  function chainTwoAsyncProcesses(firstPromise, slowAsyncProcess){
    return firstPromise.then(async data => {
      return await slowAsyncProcess(data);
    });
  }
  
  /**
   * 
   * EXERCISE 3
   * 
   * @param {function} getUserById 
   * @param {function} getOrganizationById 
   */
  function makeGetUserByIdWithOrganization(getUserById, getOrganizationById){
    return function getUserByIdWithOrganization(userId){
      return getUserById(userId).then(user => {
        return getOrganizationById(user.organizationId).then(organization => {
          return {...user, organization };
        });
      }).catch(err => {
        return undefined;
      });
    };
  }
  
  module.exports = {
    flatMapPromise,
    chainTwoAsyncProcesses,
    makeGetUserByIdWithOrganization,
  };