From 8dfc00c6d2bf92379bd803ef9309930b5422ea8e Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Sun, 24 Dec 2023 03:29:01 +0000 Subject: [PATCH] Nova Scotia Age Amount Supplement Fix #455 Add a new check for age eligibility --- .../credits/age/ns_age_amount_supplement.yaml | 15 +++++---------- .../credits/age/ns_age_amount_supplement.py | 2 +- .../age/ns_age_amount_supplement_eligible.py | 5 ++--- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.yaml b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.yaml index 538df869d..e239929f2 100644 --- a/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.yaml +++ b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.yaml @@ -1,44 +1,39 @@ - name: Nova Scotia Age amonut supplement; eligible age with eligible taxable income below 25_000 period: 2023 input: - province_code: NS - age: 65 ns_taxable_income: 24_999 + ns_age_amount_supplement_eligible: true output: ns_age_amount_supplement: 1_465 - name: Nova Scotia Age amonut supplement; eligible age with eligible taxable income between 25_000 and 75_000 period: 2023 input: - province_code: NS - age: 65 ns_taxable_income: 65_000 + ns_age_amount_supplement_eligible: true output: ns_age_amount_supplement: 293 - name: Nova Scotia Age tax credit; eligible age with ineligible taxable income more than 75_000 period: 2023 input: - province_code: NS - age: 65 ns_taxable_income: 75_001 + ns_age_amount_supplement_eligible: true output: ns_age_amount_supplement: 0 - name: Nova Scotia Age tax credit; ineligible age with eligible taxable income period: 2023 input: - province_code: NS - age: 64 ns_taxable_income: 24_999 + ns_age_amount_supplement_eligible: false output: ns_age_amount_supplement: 0 - name: Nova Scotia Age tax credit; ineligible age with ineligible taxable income period: 2023 input: - province_code: NS - age: 64 ns_taxable_income: 75_001 + ns_age_amount_supplement_eligible: false output: ns_age_amount_supplement: 0 diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.py index 93a7f8b99..63bb3b117 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.py @@ -7,7 +7,7 @@ class ns_age_amount_supplement(Variable): label = "Nova Scotia Age Amount Supplement" unit = CAD definition_period = YEAR - defined_for = ns_age_amount_supplement_eligible + defined_for = "ns_age_amount_supplement_eligible" reference = ( "https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1", "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ns-ws/td1ns-ws-23e.pdf#page=1", diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement_eligible.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement_eligible.py index 4acdbee1b..b497e582c 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement_eligible.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement_eligible.py @@ -2,10 +2,9 @@ class ns_age_amount_supplement_eligible(Variable): - value_type = float + value_type = bool entity = Person - label = "Nova Scotia Age Amount Supplement Eligible" - unit = CAD + label = "Eligible for the Nova Scotia Age Amount Supplement" definition_period = YEAR defined_for = ProvinceCode.NS reference = (