FA-59549 / Subscription proration billing / Member archive
Annual-to-monthly switch credit: started month cap · case 04
Customers switching after the annual term produce a negative credit.
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 | [-9992, -2, 8066] | [0, 0, 0] | 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 ↗