public void ContractProcess(Contract contract, int months) { double payment = contract.ContractValue / months; for (int nMonths = 1; nMonths <= months; nMonths++) { DateTime dueDate = contract.Date.AddMonths(nMonths); double totalToPay = payment + _onlinePaymentService.InterestFee(payment, nMonths); totalToPay += _onlinePaymentService.PaymentFee(totalToPay); contract.AddInstallments(new Installment(dueDate, totalToPay)); } }
public void ProcessContract(Contract contract, int months) { double basicValue = contract.ContractValue / months; for (int i = 1; i <= months; i++) { DateTime paymDate = contract.ContractDate.AddMonths(i); double updateValue = basicValue + _iOnPaymService.InterestFee(basicValue, i); double fullValue = updateValue + _iOnPaymService.PaymentFee(updateValue); contract.AddInstallments(new Installment(paymDate, fullValue)); } }