FA-60658 / Loyalty points ledgers / Member archive
Partner miles conversion: bonus threshold basis · case 03
Members whose raw balance crosses the bonus threshold get a bonus though fewer usable points were converted.
Case contract
Input {pts, block, min_pts, num, den, bonus_bp, threshold}. Usable points = pts floored to a block; usable below min_pts returns {"error"}. Miles = floor(usable*num/den). If usable >= threshold, bonus miles = floor(miles*bonus_bp/10000). Leftover points stay in the account. Return {used, miles, bonus, leftover}.
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 |
|---|---|---|---|
| threshold by raw only | {"bonus": 2000, "leftover": 403, "miles": 10000, "used": 10000} | {"bonus": 0, "leftover": 403, "miles": 10000, "used": 10000} | 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 ↗