fix: Prevent early loan impairment and due-date manipulation

Stop impairLoan and unimpairLoan from rewriting
sfNextPaymentDueDate when the amendment is active. Previously a
colluding broker could repeatedly impair and unimpair an overdue
loan to keep pushing the due date forward, permanently blocking
default eligibility and suppressing late-interest / late-fee
accrual.
This commit is contained in:
Vito
2026-03-17 16:21:38 +01:00
parent 68e4fbdf2b
commit 810ffde484
4 changed files with 338 additions and 42 deletions

View File

@@ -219,6 +219,10 @@ computeFullPaymentInterest(
std::uint32_t startDate,
TenthBips32 closeInterestRate);
/// Returns true if the loan's next payment due date has passed.
[[nodiscard]] bool
isPaymentLate(ReadView const& view, SLE::const_ref loanSle);
namespace detail {
// These classes and functions should only be accessed by LendingHelper
// functions and unit tests