FA-59705 / Subscription proration billing / Member archive
Subscription schedule phases within a period: phase end from next start · case 05
Periods with a phase change are charged for both phases on the overlapping days.
Case contract
Input {ps, pe (exclusive), phases: [[start_day, price per full period]]}. Phases are ordered by start; each lasts until the next phase starts (the last until pe). The period charge is sum(price * overlap days with [ps, pe)) / (pe - ps), rounded half-up once. Return cents.
Why this case matters
Phase transitions inside a billing period must be charged exactly for their overlapping days.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | 10548 | 1694 | 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 ↗