FA-60718 / Loyalty points ledgers / Member archive
Monthly promotional bonus cap: cap period key · case 03
The monthly cap behaves like an annual cap and later months award no bonus.
Case contract
Input {cap, txns:[[yyyy-mm, base, bonus, exempt_bonus]]}. Base points are never capped. Regular bonus points are capped per calendar month: each transaction receives min(bonus, cap - bonus already awarded that month). Exempt bonus is always awarded and never uses the cap. Return {awards (base + awarded bonus + exempt per txn), total}.
Why this case matters
Member point balances, statements and the program liability depend on this ledger rule.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| new month resets | {"awards": [5000, 0], "total": 5000} | {"awards": [5000, 1003], "total": 6003} | 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 ↗