Commit ed4f10b
Pay couple Carer Premium when a benunit has 3+ carers (#1623)
* Pay couple Carer Premium when a benunit has 3+ carers
The select list used carers == 2, so any benefit unit with 3 or more
carers silently fell through to the numpy default of 0. A benefit unit
with e.g. two adult carers plus a young-carer child meeting
is_carer_for_benefits is the realistic way this arises. The Carer
Premium regulations don't define a rate for >2 carers, so clamping to
the couple rate is the correct behaviour.
Rewrote the select as [carers >= 2, carers == 1] → [couple, single],
which also drops the now-redundant carers == 0 branch (select's default
is 0 already).
Fixes #420.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Add regression test for #420 (three-carer benefit unit)
Covers the carers >= 2 branch of carer_premium with an explicit
num_carers=3 case that would have returned 0 under the previous
select. Also adds num_carers=0 and num_carers=2 cases so the full
branch table is exercised.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f59b5c1 commit ed4f10b
3 files changed
Lines changed: 27 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
0 commit comments