FAILURE MAP
← Case archive

FA-60433 / Loyalty points ledgers / Member archive

Points redemption at checkout: cash due valuation · case 03

Cash due is wrong for programs where a point is worth more than one cent.

Member previewVariant 3 · 3 implementations · 7 checks per implementation

Case contract

Input {balance, order_cents, request_pts, max_pct, cpp (cents per point)}. Balance below 500 returns {"error":"below minimum"}. Points are used in blocks of 100: used = min(request floored to a block, balance floored to a block, cap) where cap = floor(order*max_pct/100 / cpp) floored to a block. Cash due = order - used*cpp. Return {points_used, cash_due}.

Why this case matters

Member point balances, statements and the program liability depend on this ledger rule.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
minimum balance edge{"cash_due": 9499, "points_used": 500}{"cash_due": 8499, "points_used": 500}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 ↗