FA-60752 / Loyalty points ledgers / Member archive
Tier multiplier in force at transaction time: history ordering · case 02
An out-of-order tier history makes later transactions use an older tier.
Case contract
Input {tier_history:[[effective_day,tier]] (any order), txns:[[day,base]], mult:{tier:pct}}. Each transaction earns floor(base*pct/100) using the tier with the latest effective_day <= transaction day ("member" before any entry). Unknown tier names earn at 100%. Return {points, 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 |
|---|---|---|---|
| unsorted history | {"points": [102, 150], "total": 252} | {"points": [153, 200], "total": 353} | 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 ↗