diff --git a/openfisca_aotearoa/parameters/social_security/accommodation_supplement/cutout.yaml b/openfisca_aotearoa/parameters/social_security/accommodation_supplement/cutout.yaml index f6d9097f..9b676a16 100644 --- a/openfisca_aotearoa/parameters/social_security/accommodation_supplement/cutout.yaml +++ b/openfisca_aotearoa/parameters/social_security/accommodation_supplement/cutout.yaml @@ -146,7 +146,7 @@ section_5: section_6: description: > - o any other person whose accommodation costs are the sum of payments + To any other person whose accommodation costs are the sum of payments required under any mortgage security, and other payments that the chief executive is satisfied are reasonably required to be made in respect of the person’s home. diff --git a/openfisca_aotearoa/tests/social_security/accommodation_supplement/2018/_benefit_me.yaml b/openfisca_aotearoa/tests/social_security/accommodation_supplement/2018/_benefit_me.yaml new file mode 100644 index 00000000..63f5dfb9 --- /dev/null +++ b/openfisca_aotearoa/tests/social_security/accommodation_supplement/2018/_benefit_me.yaml @@ -0,0 +1,37 @@ +- name: > + BenefitMe + Peta's Story + period: 2022-12-05 + relative_error_margin: 0.001 + input: + persons: + Peta: + age: + day:2022-01-01:365: 32 + social_security__in_a_relationship: + week:2022-W01:52: false + accommodation_costs: + week:2022-W01:52: 350 + accommodation_type: + week:2022-W01:52: rent + accommodation_supplement__area_of_residence: + week:2022-W01:52: area_2 + family_tax_credit__eligible: + 2022: true + jobseeker_support__entitled: + week:2022-W01:52: true + Anahera: + age: + day:2022-01-01:365: 5 + social_security__dependent_child: + week:2022-W01:52: true + family_tax_credit__dependent_child: + 2022: true + family: + principal: Peta + children: [Anahera] + output: + accommodation_supplement: + 2022-W49: [145.54, 0] + family_tax_credit: + 2022: [6623.80, 0] diff --git a/openfisca_aotearoa/tests/social_security/accommodation_supplement/2018/base.yaml b/openfisca_aotearoa/tests/social_security/accommodation_supplement/2018/base.yaml index f81c8f8a..cc7eacf3 100644 --- a/openfisca_aotearoa/tests/social_security/accommodation_supplement/2018/base.yaml +++ b/openfisca_aotearoa/tests/social_security/accommodation_supplement/2018/base.yaml @@ -50,7 +50,7 @@ 2022-W02: true 2022-W03: false family_tax_credit__dependent_child: - 2022: 33 + 2022: .33 Srko: date_of_birth: ETERNITY: 2006-01-11 @@ -59,7 +59,7 @@ 2022-W02: true 2022-W03: false family_tax_credit__dependent_child: - 2022: 33 + 2022: .33 Ash: date_of_birth: ETERNITY: 2006-01-12 @@ -68,7 +68,7 @@ 2022-W02: true 2022-W03: true family_tax_credit__dependent_child: - 2022: 33 + 2022: .33 family: principal: Vranda children: [Piedad, Srko, Ash] @@ -154,7 +154,7 @@ 2022-W02: true 2022-W03: false family_tax_credit__dependent_child: - 2022: 33 + 2022: .33 Srko: date_of_birth: ETERNITY: 2006-01-11 @@ -163,7 +163,7 @@ 2022-W02: true 2022-W03: false family_tax_credit__dependent_child: - 2022: 33 + 2022: .33 Ash: date_of_birth: ETERNITY: 2006-01-12 @@ -172,7 +172,7 @@ 2022-W02: true 2022-W03: true family_tax_credit__dependent_child: - 2022: 33 + 2022: .33 family: principal: Vranda children: [Piedad, Srko, Ash] @@ -214,7 +214,7 @@ 2022-W02: true 2022-W03: false family_tax_credit__dependent_child: - 2022: 33 + 2022: .33 Srko: date_of_birth: ETERNITY: 2006-01-11 @@ -223,7 +223,7 @@ 2022-W02: true 2022-W03: false family_tax_credit__dependent_child: - 2022: 33 + 2022: .33 Ash: date_of_birth: ETERNITY: 2006-01-12 @@ -232,7 +232,7 @@ 2022-W02: true 2022-W03: true family_tax_credit__dependent_child: - 2022: 33 + 2022: .33 family: principal: Vranda children: [Piedad, Srko, Ash] @@ -314,7 +314,7 @@ 2022-W02: true 2022-W03: false family_tax_credit__dependent_child: - 2022: 33 + 2022: .33 Srko: date_of_birth: ETERNITY: 2006-01-11 @@ -323,7 +323,7 @@ 2022-W02: true 2022-W03: false family_tax_credit__dependent_child: - 2022: 33 + 2022: .33 Ash: date_of_birth: ETERNITY: 2006-01-12 @@ -332,7 +332,7 @@ 2022-W02: true 2022-W03: true family_tax_credit__dependent_child: - 2022: 33 + 2022: .33 family: principal: Vranda children: [Piedad, Srko, Ash] @@ -394,7 +394,7 @@ 2022-W02: true 2022-W03: false family_tax_credit__dependent_child: - 2022: 33 + 2022: .33 Srko: date_of_birth: ETERNITY: 2006-01-11 @@ -403,7 +403,7 @@ 2022-W02: true 2022-W03: false family_tax_credit__dependent_child: - 2022: 33 + 2022: .33 Ash: date_of_birth: ETERNITY: 2006-01-12 @@ -412,7 +412,7 @@ 2022-W02: true 2022-W03: true family_tax_credit__dependent_child: - 2022: 33 + 2022: .33 family: principal: Vranda partners: [Bob] diff --git a/openfisca_aotearoa/variables/acts/social_security/accommodation_supplement/area.py b/openfisca_aotearoa/variables/acts/social_security/accommodation_supplement/area.py index 59b8b749..7586078c 100644 --- a/openfisca_aotearoa/variables/acts/social_security/accommodation_supplement/area.py +++ b/openfisca_aotearoa/variables/acts/social_security/accommodation_supplement/area.py @@ -5,7 +5,7 @@ import numpy import pandas -from openfisca_core import indexed_enums, periods, variables +from openfisca_core import holders, indexed_enums, periods, variables from openfisca_aotearoa import entities @@ -37,6 +37,7 @@ class accommodation_supplement__area_of_residence(variables.Variable): possible_values = AccommodationSupplement__AreaOfResidence default_value = AccommodationSupplement__AreaOfResidence.unknown definition_period = periods.DateUnit.WEEK + set_input = holders.set_input_dispatch_by_period def formula_2018_11_26(people, period, _params): area_of_residence = AccommodationSupplement__AreaOfResidence diff --git a/openfisca_aotearoa/variables/acts/social_security/jobseeker_support/jobseeker_support.py b/openfisca_aotearoa/variables/acts/social_security/jobseeker_support/jobseeker_support.py index 1e3708db..1df5537b 100644 --- a/openfisca_aotearoa/variables/acts/social_security/jobseeker_support/jobseeker_support.py +++ b/openfisca_aotearoa/variables/acts/social_security/jobseeker_support/jobseeker_support.py @@ -37,6 +37,7 @@ class jobseeker_support__entitled(variables.Variable): definition_period = periods.WEEK label = "Jobseeker Support eligibility and amount" reference = "https://www.legislation.govt.nz/act/public/2018/0032/latest/whole.html#DLM6783144", "http://legislation.govt.nz/act/public/1964/0136/latest/DLM5478527.html" + set_input = holders.set_input_dispatch_by_period # Old Job Seeker formula for 1964 Act, rewritten to show gaps def formula_2013_04_17(persons, period, parameters): diff --git a/openfisca_aotearoa/variables/acts/social_security/sole_parent_support/sole_parent_support_benefit.py b/openfisca_aotearoa/variables/acts/social_security/sole_parent_support/sole_parent_support_benefit.py index 4d123e01..a3347f04 100644 --- a/openfisca_aotearoa/variables/acts/social_security/sole_parent_support/sole_parent_support_benefit.py +++ b/openfisca_aotearoa/variables/acts/social_security/sole_parent_support/sole_parent_support_benefit.py @@ -6,7 +6,7 @@ # # For more information on OpenFisca's available modules: # https://openfisca.org/doc/openfisca-python-api/index.html -from openfisca_core import periods, variables +from openfisca_core import holders, periods, variables # We import the required `entities` corresponding to our formulas. # @@ -24,6 +24,7 @@ class sole_parent_support__benefit(variables.Variable): definition_period = periods.WEEK label = "The final net benefit entitlement" reference = "https://www.legislation.govt.nz/act/public/2018/0032/latest/DLM6784854.html" + set_input = holders.set_input_dispatch_by_period def formula_2018_11_26(people, period, parameters): return people("sole_parent_support__entitled", period) * numpy.clip(people("sole_parent_support__base", period) - people("sole_parent_support__reduction", period), 0, people("sole_parent_support__base", period)) diff --git a/openfisca_aotearoa/variables/demographics/housing.py b/openfisca_aotearoa/variables/demographics/housing.py index cd1a32eb..85c2dcc7 100644 --- a/openfisca_aotearoa/variables/demographics/housing.py +++ b/openfisca_aotearoa/variables/demographics/housing.py @@ -1,6 +1,6 @@ """TODO: Add missing doctring.""" -from openfisca_core import indexed_enums, periods, variables +from openfisca_core import holders, indexed_enums, periods, variables from openfisca_aotearoa import entities @@ -24,6 +24,7 @@ class accommodation_type(variables.Variable): possible_values = AccommodationType default_value = AccommodationType.unknown definition_period = periods.DateUnit.WEEK + set_input = holders.set_input_dispatch_by_period class accommodation_costs(variables.Variable): @@ -34,3 +35,4 @@ class accommodation_costs(variables.Variable): value_type = float default_value = 0 definition_period = periods.DateUnit.WEEK + set_input = holders.set_input_dispatch_by_period