src/chartmogul/chartmogul-feeder.js
/**
   * THe middleware in charge of fetching the other MRR Movements.
   *
   * @param {Object} config - The config require for the fetch
   *
   * @return {Promise} The promisified geckoFormatted result of the fetch
   *
   */
THe middleware in charge of fetching the other MRR Movements.
@param {Object} config - The config require for the fetch

@return {Promise} The promisified geckoFormatted result of the fetch
THe middleware in charge of fetching the other MRR Movements . @param { Object } config - The config require for the fetch @return { Promise } The promisified geckoFormatted result of the fetch
async fetchMRRMovements(config) {
    const {
      entries,
    } = await this.requestChartMogulFor('/metrics/mrr', {
      'start-date': config['start-date'],
      'end-date': config['end-date'],
      'interval': config['interval'],
    });
    const otherMrr = entries.pop();
    switch (config.out) {
      case 'list':
        const items = mrrsEntries.map((item) => [
          item.label,
          otherMrr[item.entrie] / 100,
        ]);
        return GeckoFormatter.toLeaderboard(items, 'currency', 'EUR');
      case 'html':
      default:
        const mrrMoves = mrrsEntries.map((item) => [
          item.label,
          otherMrr[item.entrie] / 100,
        ]);
        mrrMoves.pop();
        return {
          'item': [{
            'text': HTMLFormatter.toTextMRRMovements(mrrMoves),
          }],
        };
    }
  }
async fetchMRRMovements ( config ) { const { entries , } = await this . requestChartMogulFor ( '/metrics/mrr' , { 'start-date' : config [ 'start-date' ] , 'end-date' : config [ 'end-date' ] , 'interval' : config [ 'interval' ] , } ) ; const otherMrr = entries . pop ( ) ; switch ( config . out ) { case 'list' : const items = mrrsEntries . map ( ( item ) => [ item . label , otherMrr [ item . entrie ] / 100 , ] ) ; return GeckoFormatter . toLeaderboard ( items , 'currency' , 'EUR' ) ; case 'html' : default : const mrrMoves = mrrsEntries . map ( ( item ) => [ item . label , otherMrr [ item . entrie ] / 100 , ] ) ; mrrMoves . pop ( ) ; return { 'item' : [ { 'text' : HTMLFormatter . toTextMRRMovements ( mrrMoves ) , } ] , } ; } }
THe middleware in charge of fetching the other MRR Movements.
THe middleware in charge of fetching the other MRR Movements .