FA-60783 / Loyalty points ledgers / Member archive
Points plus cash split: negative room guard · case 03
When the price is below the minimum cash the member is credited points and charged more than the price.
Case contract
Input {price, balance, cpp10 (point value in tenths of a cent), min_cash}. Points may cover at most price - min_cash (never negative): max points = floor((price - min_cash)*10/cpp10), limited by balance. Credit = floor(points*cpp10/10); cash = price - credit. Return {points, cash}.
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 |
|---|---|---|---|
| price below minimum cash | {"cash": 403, "points": -103} | {"cash": 300, "points": 0} | 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 ↗