code: function firstPaymentDate(loan, cb) {
      var d = Q.defer();
      if (!loan) d.reject('loan object not provided');
      else if (!loan.closingDate) d.reject('loan closing date not provided');
      else {
        var closingDate = loan.closingDate ? moment(loan.closingDate) : moment();
        var firstPaymentDay = !_.isEmpty(loan.firstPaymentDay) ? loan.firstPaymentDay : 1;
  
        loan.firstPaymentDate = closingDate.date() > 1 ? closingDate.add('M', 2).date(firstPaymentDay)
            : closingDate.add('M', 1).date(1);
        loan.firstPaymentDate = loan.firstPaymentDate.toISOString();
        d.resolve(loan);
      }
      if (cb) return cb(loan);
      return d.promise;
    }
docs: /*
  firstPaymentDate
  ----------------
  This function calculates the first payment date of a loan. It defaults to
  the first day of the month which is at least one full month from the date
  the loan was funded (origination or funding date).
  
  This function takes the following arguments:
  closingDate (required) - the funding or origination date of the loan
  firstPaymentDay (optional) - desired day of the month for the payment - defaults to the first day
  cb (optional) - optional CommonJS (Node style) callback