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
tetsing
  • Loading branch information
PavelMakarchuk committed Jul 16, 2024
commit b931609e9e99769f32e8d823d11f3dc25eef5b81
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
description: Addition to the Minimum Guarantee for each severely disabled adult.
values:
2018-04-01: 64.30
2018-04-01: 64.3
2019-04-01: 65.85
2020-04-01: 66.95
2021-04-01: 67.30
2022-04-01: 69.40
2021-04-01: 67.3
2022-04-01: 69.4
2023-04-01: 76.4
2024-04-01: 81.50
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
- 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_disabled_child_minimum_guarantee_addition: (95.48 + 61.16) * 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_disabled_child_minimum_guarantee_addition: 1_542.32

- name: Two children, none disabled
period: 2022
input:
people:
person1:
is_child_or_QYP: 5
pip:
dla:
child_2:
is_child_or_QYP: 5
pip: 0
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_disabled_child_minimum_guarantee_addition: 0

- name: Two children, both disabled, one severely
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: 2
dla: 0
child_3:
is_child_or_QYP: 5
pip: 1
receives_highest_dla_sc: 0
receives_enhanced_pip_dl: 0
dla: 0
benunits:
benunit:
members: [person1, child_2, child_3]
output:
pension_credit_disabled_child_minimum_guarantee_addition: 6_354.4

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ def formula(benunit, period, parameters):
gc = parameters(period).gov.dwp.pension_credit.guarantee_credit

base_amount = benunit.sum(is_child) * gc.child.amount * WEEKS_IN_YEAR
disabled_child_amount = benunit("pension_credit_child_minimum_guarantee_addition_eligible", period)
disabled_child_amount = benunit("pension_credit_disabled_child_minimum_guarantee_addition", period)
return base_amount + disabled_child_amount
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from policyengine_uk.model_api import *


class pension_credit_child_minimum_guarantee_addition_eligible(Variable):
class pension_credit_disabled_child_minimum_guarantee_addition(Variable):
label = "eligible for the child-related Pension Credit addition"
entity = BenUnit
definition_period = YEAR
Expand Down
Loading