FA-59697 / Subscription proration billing / Member archive
Volume discount tiers on quantity changes: discounted unit rounding · case 02
Discounted prorations drift by cents proportional to the quantity.
Case contract
Input {unit, old, new quantities, tiers: ascending [[min_qty, pct_off]], left, period}. A quantity's discount is the pct of the last tier with qty >= min_qty and applies to all units: total(q) = q*unit*(100-pct) in cent-percent. Proration of q = total(q)*left/(100*period) half-up. Return [-proration(old), proration(new)].
Why this case matters
Crossing a volume tier on a mid-cycle quantity change re-prices every unit for the rest of the period.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [-13050, 806] | [-13051, 806] | 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 ↗