The bug
is_WTC_eligible (policyengine_uk/variables/gov/dwp/is_WTC_eligible.py) tests the WTC hours conditions on the couple as a whole:
has_old = benunit.any(age >= 60) and has_disabled_adults = benunit.any(claimant & disabled) select the lower (16-hour) requirement;
total_hours = benunit.sum(weekly_hours) is compared with it.
So "someone is 60 or over" (or disabled) and "someone works 16 hours" can be different people. Example: a childless couple aged 70 and 40, where only the 40-year-old works, for 20 hours a week. The model pays them WTC; the law gives none.
The law
WTC Regs 2002 reg 4(1), Second condition, as at 6 April 2024. "The person" treated as in qualifying remunerative work must meet the variation themselves.
- Second variation, a joint claim where neither is responsible for a child, "the person":
- "is aged at least 16 and undertakes work for not less than 16 hours per week and has a physical or mental disability which puts that person at a disadvantage in getting a job ..."; or
- "is aged at least 25 and undertakes work for not less than 30 hours per week"; or
- "is aged at least 60 and undertakes work for not less than 16 hours per week".
- The third variation (a joint claim responsible for a child) has the same person-level limbs. It adds the couple limb: "at least one partner undertakes work for not less than 16 hours per week and the aggregate number of hours for which the couple undertake work is not less than 24 hours per week". It also adds a limb for a partner who is incapacitated, an in-patient, in prison or entitled to carer's allowance.
The first variation (a single claim) is unaffected, since there is only one person.
Fix
Test each partner's own age, disability and hours against the variation that applies, and keep the couple-hours limb only for couples responsible for a child. Add YAML cases from the regulation, including the 70/40 couple above.
Found in review of #2034, where a YAML case originally relied on this pooling.
The bug
is_WTC_eligible(policyengine_uk/variables/gov/dwp/is_WTC_eligible.py) tests the WTC hours conditions on the couple as a whole:has_old = benunit.any(age >= 60)andhas_disabled_adults = benunit.any(claimant & disabled)select the lower (16-hour) requirement;total_hours = benunit.sum(weekly_hours)is compared with it.So "someone is 60 or over" (or disabled) and "someone works 16 hours" can be different people. Example: a childless couple aged 70 and 40, where only the 40-year-old works, for 20 hours a week. The model pays them WTC; the law gives none.
The law
WTC Regs 2002 reg 4(1), Second condition, as at 6 April 2024. "The person" treated as in qualifying remunerative work must meet the variation themselves.
The first variation (a single claim) is unaffected, since there is only one person.
Fix
Test each partner's own age, disability and hours against the variation that applies, and keep the couple-hours limb only for couples responsible for a child. Add YAML cases from the regulation, including the 70/40 couple above.
Found in review of #2034, where a YAML case originally relied on this pooling.