FA-59812 / Subscription proration billing / Member archive
Package pricing with milli-unit usage: unit rounding grain · case 02
Customers with many small events are billed for far more units than they used.
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 | [10, 1, 250] | [9, 1, 250] | 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 ↗