FA-60515 / Loyalty points ledgers / Member archive
Member-to-member point transfers: fee rounding direction · case 05
Transfer fees come out a point short on amounts that do not divide evenly.
Case contract
Input {members:{id:balance}, transfers:[[from,to,pts]], fee_bp, min_transfer, annual_cap, sent_ytd}. Self transfers or unknown members are "invalid"; pts below the minimum are "below minimum"; sent_ytd + pts above annual_cap is "cap" (fees do not count toward the cap). The fee is ceil(pts*fee_bp/10000) points charged to the sender, who must hold pts + fee ("insufficient" otherwise). The recipient receives pts. Return {results (fee or reason), balances:[[id,bal]] 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 |
|---|---|---|---|
| normal transfer | {"balances": [["a", 2946], ["b", 2104]], "results": [50]} | {"balances": [["a", 2945], ["b", 2104]], "results": [51]} | 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 ↗