FA-59445 / Subscription proration billing / Member archive
Coupons on invoices with proration lines: credit lines excluded from percent · case 05
Invoices with an unused-time credit line receive a smaller percentage discount than their charges warrant.
Case contract
Input {lines: signed cents, coupon {type percent|amount, value, duration once|repeating|forever, months}, idx (0-based invoice number since redemption)}. Coupon active: forever always; once only at idx 0; repeating while idx < months. Percent coupons discount each positive line separately (half-up); credit lines are not discounted. Amount coupons subtract value capped at the sum of positive lines. Total = sum(lines) - discount. Return [discount, amount_due = max(0,total), credit = max(0,-total)].
Why this case matters
Coupons interact with proration credits; discounting a credit line or over-applying an amount-off coupon changes what customers pay.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [18200, 18197, 0] | [29419, 6978, 0] | 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 ↗