Review feedback from @Tapanito: overpayment value change

- In overpayment results, the management fee was being calculated twice:
  once as part of the value change, and as part of the fees paid.
  Exclude it from the value change.
This commit is contained in:
Ed Hennis
2025-12-03 18:35:25 -05:00
parent c953073c3a
commit 947ad002e0

View File

@@ -553,8 +553,8 @@ tryOverpayment(
// Calculate how the loan's value changed due to the overpayment.
// This should be negative (value decreased) or zero. A principal
// overpayment should never increase the loan's value.
auto const valueChange =
newRounded.valueOutstanding - hypotheticalValueOutstanding;
auto const valueChange = newRounded.valueOutstanding -
hypotheticalValueOutstanding - deltas.managementFee;
if (valueChange > 0)
{
JLOG(j.warn()) << "Principal overpayment would increase the value of "