refactor: Address review feedback on payment-type split

Extract loanRatesFor() to replace the identical 4-line
managementFeeRate/interestRate/periodicRate preamble repeated in
makeFullPayment, makeLatePayment, and makeRegularPayment.

Clarify the constructLoanState(SLE::const_ref) doc comment to note
it's an overload of the 3-Number constructLoanState() above it,
rather than reading as a standalone function.
This commit is contained in:
Vito
2026-07-15 14:56:57 +02:00
parent 91ecdc8383
commit 13c9800448
2 changed files with 20 additions and 17 deletions

View File

@@ -263,8 +263,9 @@ constructLoanState(
Number const& principalOutstanding,
Number const& managementFeeOutstanding);
// Constructs a valid LoanState object from a Loan object, which always has
// rounded values
// Overload of constructLoanState() that reads the three tracked fields
// directly from a Loan ledger object, which always holds rounded values,
// rather than taking them as separate Number arguments.
LoanState
constructLoanState(SLE::const_ref loan);