FA-59342 / Subscription proration billing / Member archive
Daily plan-change proration: remaining day count · case 02
Customers who upgrade are charged and credited for one day fewer than remain in the period.
Case contract
Input {old, new prices per period, start, end (exclusive), change} dates with start <= change < end. Remaining days = end - change; period days = end - start. Credit = old*remaining/period and charge = new*remaining/period, each rounded half-up. Net = charge - credit; a positive net is due now, a negative net becomes a credit balance. Return [credit, charge, amount_due, credit_balance].
Why this case matters
Mid-cycle plan changes must credit unused time on the old plan and charge the new plan for the same days.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [4576, 758, 0, 3818] | [4992, 827, 0, 4165] | 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 ↗