FA-59612 / Subscription proration billing / Member archive
Sequential plan changes within one cycle: current price tracking · case 02
The second plan change credits the original plan instead of the plan in effect.
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 | [-822, 4110, -279, 562, -192, 238] | [-822, 4110, -1397, 562, -386, 238] | 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 ↗