Skip to content

Commit

Permalink
Edit main py files and add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vahid-ahmadi committed Feb 13, 2025
1 parent 53d7db2 commit aad4007
Show file tree
Hide file tree
Showing 14 changed files with 357 additions and 261 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ metadata:
amount_unit: currency-GBP
label: Targeted childcare entitlement hourly rates
reference:
- title: Different rates for targeted childcare entitlement
href:
- https://www.nurseryworld.co.uk/content/news/dfe-confirms-extended-30-hours-funding-rates-but-sector-says-they-dont-reflect-the-real-delivery-cost/
- https://www.gov.uk/government/news/childcare-settings-receive-cash-boost-as-funding-rates-increase
- title: Commons Library
href: https://commonslibrary.parliament.uk/research-briefings/cbp-8052/
values:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
description: The Department for Education provides targeted childcare entitlement in England.
metadata:
type: scale
type: single_amount
threshold_unit: year
amount_unit: hour
label: "Age eligibility for targeted 2-year-old childcare entitlement"
reference:
- title: The Local Authority (Duty to Secure Early Years Provision Free of Charge) Regulations 2014 - regulation 3
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
- name: Eligible with JSA - couple
period: 2025
input:
people:
adult1:
total_income: 10000
social_security_income: 0
adult2:
total_income: 5000
social_security_income: 0
benunits:
benunit:
members: ["adult1", "adult2"]
jsa_income: 100
esa_income: 0
universal_credit: 0
is_guarantee_credit_eligible: false
child_tax_credit: 0
working_tax_credit: 0
output:
targeted_childcare_entitlement_meets_benefits: [true]

- name: Eligible with UC under income threshold - family
period: 2025
input:
people:
parent:
total_income: 15000
social_security_income: 5000 # Makes adjusted income = 10000
child:
total_income: 0
social_security_income: 0
benunits:
benunit:
members: ["parent", "child"]
jsa_income: 0
esa_income: 0
universal_credit: 100
is_guarantee_credit_eligible: false
child_tax_credit: 0
working_tax_credit: 0
output:
targeted_childcare_entitlement_meets_benefits: [true]

- name: Eligible with tax credits under income threshold - large family
period: 2025
input:
people:
parent1:
total_income: 10000
social_security_income: 0
parent2:
total_income: 6000
social_security_income: 0
child1:
total_income: 0
social_security_income: 0
child2:
total_income: 0
social_security_income: 0
benunits:
benunit:
members: ["parent1", "parent2", "child1", "child2"]
jsa_income: 0
esa_income: 0
universal_credit: 0
is_guarantee_credit_eligible: false
child_tax_credit: 100
working_tax_credit: 0
output:
targeted_childcare_entitlement_meets_benefits: [true]

- name: Ineligible due to high income with UC
period: 2025
input:
people:
adult1:
total_income: 250000
benunits:
benunit:
members: ["adult1"]
universal_credit: 10000
jsa_income: 0
output:
targeted_childcare_entitlement_meets_benefits: [false]

- name: Ineligible with no qualifying benefits - family
period: 2025
input:
people:
parent:
total_income: 10000
social_security_income: 0
child1:
total_income: 0
social_security_income: 0
child2:
total_income: 0
social_security_income: 0
benunits:
benunit:
members: ["parent", "child1", "child2"]
jsa_income: 0
esa_income: 0
universal_credit: 0
is_guarantee_credit_eligible: false
child_tax_credit: 0
working_tax_credit: 0
output:
targeted_childcare_entitlement_meets_benefits: [false]

- name: Eligible with ESA - couple
period: 2025
input:
people:
adult1:
total_income: 8000
social_security_income: 0
adult2:
total_income: 7000
social_security_income: 0
benunits:
benunit:
members: ["adult1", "adult2"]
jsa_income: 0
esa_income: 100
universal_credit: 0
is_guarantee_credit_eligible: false
child_tax_credit: 0
working_tax_credit: 0
output:
targeted_childcare_entitlement_meets_benefits: [true]

- name: Eligible with pension credit - couple
period: 2025
input:
people:
adult1:
total_income: 8000
social_security_income: 0
adult2:
total_income: 7000
social_security_income: 0
benunits:
benunit:
members: ["adult1", "adult2"]
jsa_income: 0
esa_income: 0
universal_credit: 0
is_guarantee_credit_eligible: true
child_tax_credit: 0
working_tax_credit: 0
output:
targeted_childcare_entitlement_meets_benefits: [true]
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
- name: Child aged 2 with benefits eligibility
period: 2024
input:
people:
child:
age: 2
targeted_childcare_entitlement_hours: 570
benunits:
benunit:
members: ["child"]
output:
targeted_childcare_entitlement: [4719.60]

- name: Child aged 3 not eligible
period: 2024
input:
people:
child:
age: 3
targeted_childcare_entitlement_hours: 0
benunits:
benunit:
members: ["child"]
output:
targeted_childcare_entitlement: [0]

- name: Child aged 4 not eligible
period: 2024
input:
people:
child:
age: 4
targeted_childcare_entitlement_hours: 0
benunits:
benunit:
members: ["child"]
output:
targeted_childcare_entitlement: [0]

- name: Multiple children different ages
period: 2024
input:
people:
parent:
age: 35
child1:
age: 2
targeted_childcare_entitlement_hours: 570
child2:
age: 3
targeted_childcare_entitlement_hours: 0
child3:
age: 4
targeted_childcare_entitlement_hours: 0
benunits:
benunit:
members: ["parent", "child1", "child2", "child3"]
output:
targeted_childcare_entitlement: [0, 4719.60, 0, 0]

- name: Family with twins both age 2
period: 2024
input:
people:
parent:
age: 35
twin1:
age: 2
targeted_childcare_entitlement_hours: 570
twin2:
age: 2
targeted_childcare_entitlement_hours: 570
benunits:
benunit:
members: ["parent", "twin1", "twin2"]
output:
targeted_childcare_entitlement: [0, 4719.60, 4719.60]
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
- name: fully eligible
period: 2025
input:
people:
child:
age: 2
benunits:
benunit:
members: ["child"]
targeted_childcare_entitlement_meets_benefits: true
output:
targeted_childcare_entitlement_hours: [570]

- name: not eligible due to benefits
period: 2025
input:
people:
child:
age: 2
benunits:
benunit:
members: ["child"]
targeted_childcare_entitlement_meets_benefits: false
output:
targeted_childcare_entitlement_hours: [0]

- name: not eligible due to age
period: 2025
input:
people:
child:
age: 3
benunits:
benunit:
members: ["child"]
targeted_childcare_entitlement_meets_benefits: true
output:
targeted_childcare_entitlement_hours: [0]

- name: multiple children with mixed eligibility
period: 2025
input:
people:
child1:
age: 2
child2:
age: 3
child3:
age: 4
benunits:
benunit:
members: ["child1", "child2", "child3"]
targeted_childcare_entitlement_meets_benefits: true
output:
targeted_childcare_entitlement_hours: [570, 0, 0]

- name: family with twins both eligible
period: 2025
input:
people:
twin1:
age: 2
twin2:
age: 2
benunits:
benunit:
members: ["twin1", "twin2"]
targeted_childcare_entitlement_meets_benefits: true
output:
targeted_childcare_entitlement_hours: [570, 570]
Loading

0 comments on commit aad4007

Please sign in to comment.