financeCalculatorHelper.js

/**
 * Created by WORKER on 01-09-2015.
 */
/**
 * Take the records and find the total amount
 * @param  {Array} snippets Records to be processed
 * @return {Number}         Result of calculation
 */
function totalAmount(snippets) {
    var value = 0;
    for(var snippet in snippets) {
        value += parseInt(snippets[snippet].amount);
    }

    return value;
}

module.exports = totalAmount;