FA-60522 / Loyalty points ledgers / Member archive
Member-to-member point transfers: sufficiency includes fee · case 02
Senders end with negative balances after transferring their whole balance.
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 |
|---|---|---|---|
| fee needs balance | {"balances": [["a", -10], ["b", 2000]], "results": [50, "insufficient"]} | {"balances": [["a", 1012], ["b", 1002]], "results": ["insufficient", 26]} | 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 ↗