mariiaKraievska commented on PR #6398:
URL: https://github.com/apache/fineract/pull/6398#issuecomment-5774760218

   > @mariiaKraievska Please review the below findings / concerns:
   > 
   > * ProjectedAmortizationScheduleModel.java:549 — generateFromAnnualEir 
solves from the raw amounts but stores/re-solves from currency-normalized 
Money; generate() deliberately normalizes first. A sub-unit discount (0.004 at 
2dp, or 20 on a 0dp inMultiplesOf=50 currency) passes create validation and 
assertAnnualEirCalculable, then rebuildPayments() in the constructor re-solves 
on the rounded 0.00 fee and throws IllegalArgumentException → 500 at approval.
   > * WorkingCapitalLoanProductDataValidator.java:758 — 
requirePairedFields=true whenever the strategy is in the request, ignoring 
isCreate; a partial PUT that merely echoes the unchanged strategy is rejected 
for discount/periodPaymentRate the product already stores.
   > * WorkingCapitalLoanProductUpdateUtil.java:93 — switching strategy never 
clears the other strategy's fields, so a product can persist 
period_payment_rate + rate bounds while being ANNUAL_EIR (a state 
create-validation would reject).
   > * WorkingCapitalLoanApplicationDataValidator.java:543 — loan-modify 
resolves the strategy from the product only, while the two other resolvers 
added in this PR prefer the loan's own copied detail; after a product strategy 
switch the validator and the schedule engine disagree.
   > * AmortizationParams.java:199 — no unit tests for the new solve (binary 
search, dailyRateFromAnnualEir, generateFromAnnualEir); the 2600-line 
calculator test suite is untouched and only Cucumber covers it.
   
   Thanks for the review — agreed on all five. Addressed in the latest push:
   
   1. generateFromAnnualEir / isAnnualEirCalculable — normalize via Money.of 
before solve (same as generate()).
   2. Product PUT — requirePairedFields only on create or an actual strategy 
change.
   3. Strategy switch — clears the other strategy’s fields (and incompatible 
min/max bounds).
   4. Loan modify — strategy resolve is loan-detail first, then product 
(aligned with the schedule engine).
   5. Unit tests — added coverage for Annual EIR generate and the product 
validator partial update cases.


-- 
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]

Reply via email to