code: function getTransformationCost(transformation) {
      let {
        inputItems
      } = transformation
      let promises = inputItems.map((item) => {
        let deferred = Q.defer()
        ItemsLogic.getItems({id: item._id})
          .then(item => {
            deferred.resolve(item.price * item.quantity)
          })
        return deferred.promise
      })
      Q.all(promises)
        .done(values => {
          return Q(values.reduce((m, i) => (m + i), 0))
        })
    }
docs: TODO: check function and decide where to place this logic