FA-59557 / Subscription proration billing / Member archive
Annual-to-monthly switch credit: fully covered invoice count · case 02
A partially funded monthly invoice is reported as covered and the leftover balance goes negative.
Case contract
Input {annual, months_used, days_into_month, month_days, monthly}. Months started = months_used plus one if the current month has begun (days_into_month > 0), capped at 12. Credit = annual*(12 - started)//12. The credit pays whole future monthly invoices; the remainder stays as balance. Return [credit, covered_invoices, leftover].
Why this case matters
Switching billing intervals converts unused prepaid time into credit that funds future invoices.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [99900, 3, -16956] | [99900, 2, 21996] | 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 ↗