FA-60359 / Loyalty points ledgers / Member archive
Order points earning: per-order flooring · case 04
Orders with many small lines earn fewer points than one line of the same total.
Case contract
Input {lines:[{cat,amount cents}], tax, shipping, tier, promo:{cat:multiplier}}. Eligible spend = non-giftcard line amounts (tax and shipping never earn). Eligible spend below 500 cents earns nothing. Base = floor(eligible/100) computed once per order. Tier points = floor(base*pct/100) with pct base 100, silver 125, gold 150. Promo bonus per non-giftcard category = floor(category spend/100)*(multiplier-1); the order bonus is capped at 1000. Return {base, tier, bonus, 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 |
|---|---|---|---|
| plain order | {"base": 38, "bonus": 0, "tier": 38, "total": 38} | {"base": 39, "bonus": 0, "tier": 39, "total": 39} | 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 ↗