FA-58532 / Loan amortization schedules / Member archive
Late fee after grace period: unpaid lateness end · case 02
Late payments report lateness up to the statement date instead of the payment date.
Case contract
x = {'due_day', 'grace', 'paid_day' or None, 'payment_due', 'paid_amount', 'tolerance', 'fee_bp', 'fee_min', 'fee_max', 'as_of'}. A payment is on time when paid_day is not None, paid_day <= due_day + grace and payment_due - paid_amount <= tolerance. Otherwise fee = clamp(round_half_up(payment_due*fee_bp/10000), fee_min, fee_max) and days_late = max(0, (paid_day or as_of when unpaid) - due_day). Return {'late', 'fee', 'days_late'}.
Why this case matters
Amortization engines drive borrower statements, payoff quotes and investor remittances; a misplaced rounding step, boundary or ordering rule compounds across hundreds of periods.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: unpaid lateness end | {"days_late": 40, "fee": 2500, "late": true} | {"days_late": 1, "fee": 2500, "late": true} | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗