FA-59623 / Subscription proration billing / Member archive
Sequential plan changes within one cycle: change window · case 03
Changes timestamped before the period start produce prorations larger than the period price.
Case contract
Input {start, end, initial price, changes: [[t, price]]}. Changes are ordered by time; at equal times only the last applies. A change outside [start, end) or to the current price is ignored. Each effective change emits a credit line -(current*(end-t)/span) and a debit line new*(end-t)/span, magnitudes half-up, and the new price becomes current. Return the list of line amounts.
Why this case matters
Customers who change plans several times in a cycle must be credited for the plan they actually had at each change.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [-2200, 5500, -4333, 4040, -2486, 3733] | [-1733, 4040, -2486, 3733] | 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 ↗