FA-59825 / Subscription proration billing / Member archive
Package pricing with milli-unit usage: round-up packaging · case 05
Exact package multiples and zero usage are billed an extra package.
Case contract
Input {events in milli-units, free units, div (units per package), round up|down, price per package}. Units = ceil(sum(events)/1000) once per invoice. Billable = max(0, units - free). Packages = ceil or floor(billable/div) by round. Return [units, packages, packages*price].
Why this case matters
Package pricing rounds usage twice, and doing either rounding at the wrong grain changes the bill.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [7, 8, 2000] | [7, 7, 1750] | 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 ↗