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

Refactor the Pension Credit parameter, variable and test files #904

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
format
  • Loading branch information
PavelMakarchuk committed Jul 16, 2024
commit 1a4194635f107b3a5a635f569c173a402bea57fb
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: minor
changes:
changed:
- Refactor the Pension Credit parameter, variable and test files.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
description: Additional elements available in Pension Credit.
description: The following additional elements are provided under the Pension Credit.
metadata:
economy: false
period: year
propagate_metadata_to_children: true
reference: none
unit: currency-GBP
label: Pension Credit guarantee credit additions
values:
2002-01-01:
- pension_credit_severe_disability_minimum_guarantee_addition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ metadata:
label: Pension Credit carer addition amount
uprating: gov.benefit_uprating_cpi
reference:
- title: The Social Security Benefits Up-rating Order 2022
href: https://www.legislation.gov.uk/uksi/2022/292/article/30/made#article-30-2-c
- title: The State Pension Credit Regulations 2002 Part II reg. 6 (8)
href: https://www.legislation.gov.uk/uksi/2002/1792/data.pdf#page=22
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
period: week
propagate_metadata_to_children: true
reference:
- href: https://www.legislation.gov.uk/uksi/2002/1792/schedule/IIA/paragraph/9/2019-02-01
title: The State Pension Credit Regulations 2002
- title: The State Pension Credit Regulations 2002
href: https://www.legislation.gov.uk/uksi/2002/1792/schedule/IIA/paragraph/9/2019-02-01
unit: currency-GBP
uprating: gov.benefit_uprating_cpi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ metadata:
uprating: gov.benefit_uprating_cpi
unit: currency-GBP
reference:
- title: The State Pension Credit Regulations 2002 reg. 6 (1)
- title: The State Pension Credit Regulations 2002 Part II reg. 6 (1)
href: https://www.legislation.gov.uk/uksi/2002/1792/data.pdf#page=21
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ metadata:
propagate_metadata_to_children: true
period: year
reference:
- title: State Pension Credit Act 2002 s. 15(1)
href: https://www.legislation.gov.uk/ukpga/2002/16/section/15

- title: State Pension Credit Act 2002 s. 15(1)
href: https://www.legislation.gov.uk/ukpga/2002/16/section/15
unit: list

values:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
benunit:
members: [claimant, spouse]
output:
pension_credit_carer_minimum_guarantee_addition: 3_920
pension_credit_carer_minimum_guarantee_addition: 3_920

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
- name: Three children, one not disabled, two disabled, one severely.
period: 2022
input:
people:
child_1:
age: 5
child_2:
age: 5
dla_sc_category: LOWER
child_3:
age: 5
dla_sc_category: HIGHER
benunits:
benunit:
members: [child_1, child_2, child_3]
output:
pension_credit_child_minimum_guarantee_addition: (54.60 + 84.26 + 147.14) * 52

- name: Two children, one disabled
period: 2022
input:
people:
person1:
is_child_or_QYP: 5
pip:
dla:
child_2:
is_child_or_QYP: 5
pip: 1
receives_highest_dla_sc: 0
receives_enhanced_pip_dl: 0
dla: 0
child_3:
is_child_or_QYP: 5
pip: 0
receives_highest_dla_sc: 0
receives_enhanced_pip_dl: 0
dla: 0
benunits:
benunit:
members: [person1, child_2, child_3]
output:
pension_credit_child_minimum_guarantee_addition: (54.60 + 84.26 + 147.14) * 52
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class pension_credit_additional_minimum_guarantee(Variable):
label = "Pension Credit additional minimum Ggarantee"
label = "Pension Credit additional minimum guarantee"
entity = BenUnit
definition_period = YEAR
value_type = float
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class pension_credit_carer_minimum_guarantee_addition(Variable):
label = "Carer-related increase"
label = "Pension Credit carer minimum guarantee addition"
entity = BenUnit
definition_period = YEAR
value_type = float
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,27 @@ def formula(benunit, period, parameters):
gc = parameters(period).gov.dwp.pension_credit.guarantee_credit
standard_disability_benefits = gc.child.disability.eligibility
severe_disability_benefits = gc.child.disability.severe.eligibility
is_disabled = add(person, period, standard_disability_benefits) > 0
is_severely_disabled = (
receives_disability_benefits = (
add(person, period, standard_disability_benefits) > 0
)
receives_severe_disability_benefits = (
add(person, period, severe_disability_benefits) > 0
)
is_standard_disabled = is_disabled & ~is_severely_disabled
is_not_disabled = ~is_disabled
per_child_amount = (
select(
[
is_child & is_not_disabled,
is_child & is_standard_disabled,
is_child & is_severely_disabled,
],
[
gc.child.amount,
gc.child.amount + gc.child.disability.amount,
gc.child.amount + gc.child.disability.severe.amount,
],
)
* WEEKS_IN_YEAR
is_standard_disabled = (
receives_disability_benefits & ~receives_severe_disability_benefits
)
is_not_disabled = ~receives_disability_benefits
per_child_amount = select(
[
is_child & is_not_disabled,
is_child & is_standard_disabled,
is_child & receives_severe_disability_benefits,
],
[
gc.child.amount,
gc.child.amount + gc.child.disability.amount,
gc.child.amount + gc.child.disability.severe.amount,
],
default=0,
)
return benunit.sum(per_child_amount)
return benunit.sum(per_child_amount) * WEEKS_IN_YEAR
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class is_savings_credit_eligible(Variable):
label = "Eligible for Savings Credit"
label = "eligible for Savings Credit"
entity = BenUnit
definition_period = YEAR
value_type = bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class savings_credit_income(Variable):
label = "Income for Savings Credit"
label = "income considered for the Savings Credit"
documentation = "Savings Credit (Pension Credit) excludes certain income sources from the calculation of the amount."
entity = BenUnit
definition_period = YEAR
Expand Down
Loading