FAILURE MAP
← Case archive

FA-59453 / Subscription proration billing / Member archive

Coupons on invoices with proration lines: single-use coupon · case 03

A once coupon keeps discounting every renewal.

Member previewVariant 3 · 3 implementations · 8 checks per implementation

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 fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression 0[1345, 0, 47275][0, 0, 45930]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 ↗