FA-60554 / Loyalty points ledgers / Member archive
Promotion stacking rules: non-stackable tie-break · case 04
When two exclusive promos tie, the promo with the higher id is recorded as applied.
Case contract
Input {base, promos:[{id,kind,value,stackable,cap}]}. A multiplier promo (value in percent) gives floor(base*(value-100)/100) extra; a fixed promo gives value. Each extra is capped at cap when cap > 0. All stackable extras apply; of the non-stackable promos only the single best capped extra applies (ties to the lower id), in addition to the stackable ones. Return {bonus, applied ids sorted}.
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 |
|---|---|---|---|
| tie on value | {"applied": [7, 9], "bonus": 304} | {"applied": [3, 9], "bonus": 304} | 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 ↗