FA-59774 / Subscription proration billing / Member archive
Expiring credit grants applied to invoices: future grants excluded · case 04
Credits scheduled for next month pay this month's invoice.
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 fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [10480, 0, [[465, 48], [1384, 70]]] | [8552, 1928, []] | 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 ↗