adamsaghy commented on code in PR #3919:
URL: https://github.com/apache/fineract/pull/3919#discussion_r1632916918
##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanproduct/calc/EMICalculationResult.java:
##########
@@ -16,29 +16,28 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.fineract.portfolio.loanproduct.calc.emi;
+package org.apache.fineract.portfolio.loanproduct.calc;
-import java.math.BigDecimal;
-import java.math.MathContext;
-
-public class FnValueFunctions {
+import lombok.AccessLevel;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
- protected FnValueFunctions() {}
+import java.math.BigDecimal;
+import java.util.List;
- /**
- * To calculate the function value for each period, we are going to use
the next formula:
- *
- * fn = 1 + fnValueFrom * rateFactorEnd
- *
- * @param previousFnValue
- *
- * @param currentRateFactor
- *
- * @param mathContext
- *
- */
- public static BigDecimal fnValue(final BigDecimal previousFnValue, final
BigDecimal currentRateFactor, final MathContext mc) {
- return BigDecimal.ONE.add(previousFnValue.multiply(currentRateFactor,
mc));
+@AllArgsConstructor(access = AccessLevel.PACKAGE)
+public class EMICalculationResult {
Review Comment:
I am not fully understand this class. Why do we need a
`getRateFactorMinus1ForPeriod` method? Also i dont really like the idea of
having the `getNumberOfPeriods` method which returns the value based on the
size of the ratefactor list. Down payments are particular periods where we dont
calculate ratefactor, neither interest... but it is still a period.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]