FAILURE MAP
← Case archive

FA-60469 / Loyalty points ledgers / Member archive

Refund points clawback: refund total cap · case 04

Refunds that exceed the order value (e.g. including a goodwill credit) claw back more points than were earned.

Member previewVariant 4 · 3 implementations · 7 checks per implementation

Case contract

Input {earned, order_total, refunds:[cents], balance}. Cumulative refunds are capped at the order total. After each refund the cumulative clawback target is round-half-up(earned*cumulative refund/order total); the refund claws target minus already clawed. A clawback is taken from the balance only down to zero; the shortfall accumulates as debt. Return {claws, balance, debt}.

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
over refund{"balance": 380, "claws": [60, 60], "debt": 0}{"balance": 420, "claws": [60, 20], "debt": 0}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 ↗