-
Notifications
You must be signed in to change notification settings - Fork 31
Add UK connection requirement to tax-free childcare eligibility #1443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Implements The Childcare Payments (Eligibility) Regulations 2015, regulations 7 and 8, which specify that claimants must have a UK connection to be eligible for tax-free childcare. Changes: - Add immigration_status variable to track immigration status - Add is_in_uk variable for ordinary UK residence - Add tax_free_childcare_uk_connection variable to check UK connection - Update tax_free_childcare_eligible to include UK connection check - Add tests for the new UK connection condition Closes #1046 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
@PolicyEngine can you run make format to pass the lint check pls. also put in a comment here the legislative background (use the lex mcp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR correctly implements the UK connection requirement for tax-free childcare based on The Childcare Payments (Eligibility) Regulations 2015.
What's good:
- Correctly references Regulations 7 and 8 (the issue referenced 3 and 4, but those are about different things - partners and child responsibility)
- The immigration status enum covers the key categories well
- The logic correctly exempts refugees, humanitarian protection, and discretionary leave holders per Regulation 8
- Sensible defaults (is_in_uk=True, immigration_status=CITIZEN) ensure backward compatibility
- Test coverage for all the main immigration statuses
Minor observations (not blocking):
- The
OTHERimmigration status is not tested and defaults to eligible (not excluded). This is probably fine as a conservative default, but worth documenting that users should explicitly set the appropriate status for edge cases. - Pre-settled status holders are correctly treated as eligible, which aligns with the EU Settlement Scheme policy.
The implementation correctly captures the regulatory intent and won't break existing simulations. LGTM 👍
|
@PolicyEngine you didn't fix the lint issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solid implementation. The code correctly implements regulations 7-8 of The Childcare Payments (Eligibility) Regulations 2015:
is_in_ukdefaults toTrueso existing simulations are unaffectedimmigration_statusdefaults toCITIZENfor the same reason- The logic correctly excludes only
VISA_HOLDERwhile allowing citizens, settled/pre-settled status, refugees, humanitarian protection, and discretionary leave holders - Tests cover the key scenarios
One minor note: the ImmigrationStatus import in tax_free_childcare_uk_connection.py is unused since the code correctly uses immigration_status.possible_values at runtime. Not a blocker, just a cleanup opportunity.
The OTHER immigration status is currently treated as eligible (not subject to control), which seems like a reasonable default - users who need different behavior can specify a more precise status.
|
@PolicyEngine use claude code to clone this repo, run make format, and commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed the implementation. The PR correctly implements regulations 7-8 of The Childcare Payments (Eligibility) Regulations 2015 for tax-free childcare eligibility.
What looks good:
- Clean separation of concerns with dedicated variables for immigration status, UK residency, and UK connection check
- Correct default values (CITIZEN and is_in_uk=True) preserve existing behavior
- Tests cover all the key immigration status scenarios
- Proper use of benunit.all() pattern in the eligibility formula
Minor observation:
- The
OTHERimmigration status isn't tested and would be treated as eligible. This may be intentional (conservative default), but worth confirming the intended behavior for unknown immigration statuses.
LGTM overall! 👍
|
@PolicyEngine pls fix failing lint test |
|
Fixed the lint error - the |
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
@PolicyEngine thanks- can you wait and keep checking the CI until all things pass, and approve it if it does? |
|
I ran into an issue: |
Summary
immigration_statusvariable to track a person's immigration status (UK citizen, settled status, refugee, visa holder, etc.)is_in_ukvariable to track whether a person is ordinarily resident in the UKtax_free_childcare_uk_connectionvariable to check UK connection for tax-free childcaretax_free_childcare_eligibleto include UK connection as an eligibility conditionDetails
According to regulations 7-8 of The Childcare Payments (Eligibility) Regulations 2015:
By default,
is_in_ukisTrueandimmigration_statusisCITIZEN, so existing simulations are unaffected unless these variables are explicitly set.Test plan
tax_free_childcare_uk_connectioncovering all immigration status scenariostax_free_childcare_eligibilityto include UK connection conditionCloses #1046
🤖 Generated with Claude Code