FA-59768 / Subscription proration billing / Member archive
Expiring credit grants applied to invoices: partial grant remainder · case 03
Partially used credits reappear at full value.
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 | [236, 0, [[4168, 56], [1900, 63]]] | [236, 0, [[3932, 56], [1900, 63]]] | 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 ↗