A backdated cancellation refunds the wrong amount
A policy is cancelled effective 1 July but keyed on 20 August. The refund routine counts the unexpired days from the date the transaction was posted, not the effective date. The customer is refunded for 134 days instead of 184, and nothing on screen looks wrong.
also: reinstatement three weeks later, leap years, 365 vs 366await clock.set('2026-08-20') const r = await cancel(policy, { effective: '2026-07-01' }) const expected = proRata(policy.premium, '2026-07-01', policy.termEnd) expect(r.refund).toBe(expected) // got 44055, want 60493 expect(ledger.imbalance()).toBe(0)

