Exemplo n.º 1
0
        public static decimal CalculateFeesCost(int monthNumber, decimal principalBalance, IEnumerable <FeeModel> fees)
        {
            var feeCost = 0m;

            //Add the sum of all annual fees
            if (monthNumber != 1 && monthNumber % 12 == 1)
            {
                feeCost += UtilsHelpers.GetAnnualFees(fees).Select(x => GetFeeCost(x, principalBalance)).Sum();
            }

            //Add the sum of all monthly fees
            feeCost += UtilsHelpers.GetMonthlyFees(fees).Select(x => GetFeeCost(x, principalBalance)).Sum();

            return(feeCost);
        }
Exemplo n.º 2
0
 public static decimal CalculateStartingFeesCost(decimal loanAmount, IEnumerable <FeeModel> fees)
 {
     //Get the sum of all starting fees
     return(UtilsHelpers.GetStartingFees(fees).Select(x => GetFeeCost(x, loanAmount)).Sum());
 }