FAILURE MAP
← Case archive

FA-59762 / Subscription proration billing / Member archive

Expiring credit grants applied to invoices: consumption order · case 02

Long-lived credits are consumed while short-lived ones expire unused.

Member previewVariant 2 · 3 implementations · 8 checks per implementation

Case contract

Input {grants: [[amount, expires_day, granted_day]], day, amount}. A grant is usable when granted_day <= day < expires_day. Usable grants are consumed soonest-expiring first (ties by earlier grant day, then input order). Return [applied, remaining_due, [[left, expires] for partially used or untouched usable grants]].

Why this case matters

Promotional credits must be burned in expiry order and never after they expire.

One recorded failure

Sample boundary fixture

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

Boundary fixtureActualExpectedOutcome
regression 0[3058, 0, [[733, 45], [4651, 53], [3113, 56]]][3058, 0, [[603, 45], [4651, 53], [3113, 56], [130, 62]]]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 ↗