FAILURE MAP
← Case archive

FA-59109 / Payroll withholding rules / Member archive

Net-pay deduction priority and arrears: arrears recording test · case 04

Fully paid deductions appear in the arrears report with zero balances.

Member previewVariant 4 · 3 implementations · 8 checks per implementation

Case contract

Input {gross, taxes, deductions: [[name, amount, priority, allow_partial]], arrears: {name: cents}}. Available = max(0, gross - taxes). Deductions run by ascending priority, ties in input order. Each is due amount + prior arrears; if due fits it is taken in full, else partial deductions take what is left and all-or-nothing deductions take 0. Any unpaid due becomes new arrears (only positive entries). Return {net, taken, arrears}.

Why this case matters

When net pay cannot cover every deduction, ordering and arrears carry-forward decide who gets paid.

One recorded failure

Sample boundary fixture

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

Boundary fixtureActualExpectedOutcome
regression 0{"arrears": {"charity": 0, "loan": 33627, "medical": 18616, "support": 10092, "union": 0}, "net": 0, "taken": {"charity": 17132, "loan": 0, "medical": 0, "support": 15920, "union": 39510}}{"arrears": {"loan": 33627, "medical": 18616, "support": 10092}, "net": 0, "taken": {"charity": 17132, "loan": 0, "medical": 0, "support": 15920, "union": 39510}}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 ↗