Skip to content
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

Tax free childcare #1004

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
adf96a0
Implement tax free childcare
vahid-ahmadi Jan 10, 2025
ee24d61
Parameterize values
vahid-ahmadi Jan 13, 2025
12d24be
Reformatting to pass the tests
vahid-ahmadi Jan 13, 2025
235fd08
Reformatting with black
vahid-ahmadi Jan 13, 2025
b3b1967
Reformatting with black
vahid-ahmadi Jan 13, 2025
55ce6c3
Format code with black
vahid-ahmadi Jan 13, 2025
9952ed9
Format code with black using 79-char line length
vahid-ahmadi Jan 13, 2025
d6b22e5
Fix YAML structure
vahid-ahmadi Jan 13, 2025
b06a47c
Fix age condition YAML file
vahid-ahmadi Jan 13, 2025
90eb823
Fix age condition YAML file
vahid-ahmadi Jan 13, 2025
0c871a5
Fix other YAML files
vahid-ahmadi Jan 13, 2025
b28b5f8
Edit parameterization
vahid-ahmadi Jan 13, 2025
ff1f456
Fix formatting
vahid-ahmadi Jan 13, 2025
d3ad685
Edit age in YAML files
vahid-ahmadi Jan 13, 2025
5c6d359
Replace if with where
vahid-ahmadi Jan 13, 2025
e0221f8
Format with black
vahid-ahmadi Jan 13, 2025
fc83a03
Edit for test passing
vahid-ahmadi Jan 13, 2025
4421154
Edit format with black
vahid-ahmadi Jan 13, 2025
b4e8d1a
Edit format of benefit py file
vahid-ahmadi Jan 13, 2025
cf7f6e6
Edit child as not being boolean
vahid-ahmadi Jan 13, 2025
d4ff3b2
Change if to where
vahid-ahmadi Jan 14, 2025
0058402
Change disability definition
vahid-ahmadi Jan 14, 2025
37c7228
Solve .values problem
vahid-ahmadi Jan 14, 2025
af96f3a
Edit .values error
vahid-ahmadi Jan 14, 2025
e96bc2e
Edit vectorization problem
vahid-ahmadi Jan 14, 2025
153c2f6
Change folder from hmrc to dwp
vahid-ahmadi Jan 14, 2025
c9fbd0c
Use is_disabled_for_benefits variable
vahid-ahmadi Jan 14, 2025
a2f73d2
Add .astype(bool) to fix error
vahid-ahmadi Jan 14, 2025
a061877
Fix bitwise AND operation error
vahid-ahmadi Jan 14, 2025
a9ca8a7
Add .astype(bool) to conditions
vahid-ahmadi Jan 14, 2025
c7c6762
Add unit tests
vahid-ahmadi Jan 14, 2025
59e1b78
Reformat with black
vahid-ahmadi Jan 14, 2025
cebaace
Fix the folders
vahid-ahmadi Jan 15, 2025
c1a5cf0
Fix the folders
vahid-ahmadi Jan 15, 2025
49ec556
Merge branch 'tax-free-childcare-new' of https://github.com/policyeng…
vahid-ahmadi Jan 15, 2025
4a5cad5
Implement free childcare program
vahid-ahmadi Jan 15, 2025
4432db2
Format with black
vahid-ahmadi Jan 15, 2025
c7c1998
Change tests
vahid-ahmadi Jan 15, 2025
789f676
Edit format based on Pavel's comments
vahid-ahmadi Jan 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: Age thresholds for tax-free childcare eligibility - disability-related limit
metadata:
unit: year
period: year
label: Disability age limit for tax-free childcare eligibility
reference:
- title: Childcare Act
href: https://www.legislation.gov.uk/ukdsi/2015/9780111127063
- title: Tax-Free Childcare Guidance
href: https://www.gov.uk/tax-free-childcare?step-by-step-nav=d78aeaf6-1747-4d72-9619-f16efb4dd89d
values:
2015-01-01: 17
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: Age thresholds for tax-free childcare eligibility - standard limit
metadata:
unit: year
period: year
label: Standard age limit for tax-free childcare eligibility
reference:
- title: Childcare Act
href: https://www.legislation.gov.uk/ukdsi/2015/9780111127063
- title: Tax-Free Childcare Guidance
href: https://www.gov.uk/tax-free-childcare?step-by-step-nav=d78aeaf6-1747-4d72-9619-f16efb4dd89d
values:
2015-01-01: 12
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: Maximum yearly contribution limit for disabled child tax-free childcare
metadata:
unit: currency-GBP
period: year
label: Disabled child yearly maximum contribution
reference:
- title: Childcare Payments Act
href: https://www.legislation.gov.uk/ukdsi/2015/9780111127063
- title: Tax-Free Childcare Guidance
href: https://www.gov.uk/tax-free-childcare?step-by-step-nav=d78aeaf6-1747-4d72-9619-f16efb4dd89d
values:
2015-01-01: 4000
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: Government contribution ratio for tax-free childcare
metadata:
unit: /1
period: year
label: Government contribution ratio for tax-free childcare
reference:
- title: Childcare Payments Act
href: https://www.legislation.gov.uk/ukdsi/2015/9780111127063
- title: Tax-Free Childcare Guidance
href: https://www.gov.uk/tax-free-childcare?step-by-step-nav=d78aeaf6-1747-4d72-9619-f16efb4dd89d
values:
2015-01-01: 0.25 # 2/8 expressed as decimal
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: Maximum yearly contribution limit for standard child tax-free childcare
metadata:
unit: currency-GBP
period: year
label: Standard child yearly maximum contribution
reference:
- title: Childcare Payments Act
href: https://www.legislation.gov.uk/ukdsi/2015/9780111127063
- title: Tax-Free Childcare Guidance
href: https://www.gov.uk/tax-free-childcare?step-by-step-nav=d78aeaf6-1747-4d72-9619-f16efb4dd89d
values:
2015-01-01: 2000
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
description: Income thresholds for tax-free childcare eligibility
metadata:
period: year
label: Income thresholds for tax-free childcare eligibility
reference:
- title: Childcare Payments Act
href: https://www.legislation.gov.uk/ukdsi/2015/9780111127063
- title: Tax-Free Childcare Guidance
href: https://www.gov.uk/tax-free-childcare?step-by-step-nav=d78aeaf6-1747-4d72-9619-f16efb4dd89d

brackets:
- threshold:
2015-01-01: 0
amount:
2015-01-01: 1_331
- threshold:
2015-01-01: 18
amount:
2015-01-01: 1_788
- threshold:
2015-01-01: 21
amount:
2015-01-01: 2_379
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
- name: Under standard age limit - eligible
period: 2025
input:
age: 10
is_disabled_for_benefits: false
output:
child_age_eligible: true

- name: Over standard age limit and not disabled - ineligible
period: 2025
input:
age: 12
is_disabled_for_benefits: false
output:
child_age_eligible: false

- name: Over standard age but under disability limit and disabled - eligible
period: 2025
input:
age: 15
is_disabled_for_benefits: true
output:
child_age_eligible: true

- name: Over disability age limit and disabled - ineligible
period: 2025
input:
age: 17
is_disabled_for_benefits: true
output:
child_age_eligible: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Tests for age under 18 bracket (threshold: £1,331 quarterly)
- name: Under threshold for age 15 with low income and no other income sources - ineligible
period: 2025
input:
age: 15
total_income: 5000
private_pension_income: 0
savings_interest_income: 500
dividend_income: 0
property_income: 0
output:
meets_income_requirements: false

- name: At threshold for age 15 - eligible
period: 2025
input:
age: 15
total_income: 6324
private_pension_income: 0
savings_interest_income: 0
dividend_income: 0
property_income: 200
output:
meets_income_requirements: true

# Tests for age 18-20 bracket (threshold: £1,788 quarterly)
- name: Under threshold for age 19 - ineligible
period: 2025
input:
age: 19
total_income: 7000 # £1,750 quarterly
private_pension_income: 0
savings_interest_income: 0
dividend_income: 0
property_income: 0
output:
meets_income_requirements: false

- name: At threshold for age 19 - eligible
period: 2025
input:
age: 18
total_income: 7152 # £1,788 quarterly
private_pension_income: 0
savings_interest_income: 0
dividend_income: 0
property_income: 0
output:
meets_income_requirements: true

# Tests for age 21+ bracket (threshold: £2,379 quarterly)
- name: Under threshold for age 22 - ineligible
period: 2025
input:
age: 22
total_income: 9000 # £2,250 quarterly
private_pension_income: 0
savings_interest_income: 0
dividend_income: 0
property_income: 0
output:
meets_income_requirements: false

- name: age 18 - eligible
period: 2025
input:
age: 18
total_income: 9516 # £2,379 quarterly
private_pension_income: 0
savings_interest_income: 0
dividend_income: 0
property_income: 0
output:
meets_income_requirements: true

# Tests with investment income
- name: Above threshold but with investment income making eligible income below threshold - ineligible
period: 2025
input:
age: 22
total_income: 12000
private_pension_income: 3000
savings_interest_income: 500
dividend_income: 1000
property_income: 500
# Net eligible income: 7000 (£1,750 quarterly)
output:
meets_income_requirements: false

- name: Edge case with investment income exactly at threshold - eligible
period: 2025
input:
age: 15
total_income: 7324
private_pension_income: 2000
savings_interest_income: 0
dividend_income: 0
property_income: 0
# Net eligible income: 5324 (£1,331 quarterly)
output:
meets_income_requirements: true

# Test age boundary cases
- name: Age boundary test at 18 - using higher threshold
period: 2025
input:
age: 18
total_income: 7152
private_pension_income: 0
savings_interest_income: 100
dividend_income: 0
property_income: 0
output:
meets_income_requirements: true
Loading
Loading