FA-60527 / Loyalty points ledgers / Member archive
Member-to-member point transfers: cap accounting of fees · case 02
Members hit the annual transfer cap early because fees are counted as transferred points.
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 |
|---|---|---|---|
| fees do not use cap | {"balances": [["a", 79498], ["c", 10000]], "results": [502, "cap"]} | {"balances": [["a", 68996], ["c", 20000]], "results": [502, 502]} | 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 ↗