Skip to content

Commit

Permalink
parameters, hard code
Browse files Browse the repository at this point in the history
Fixes #352
  • Loading branch information
karenlilr committed Jul 17, 2024
1 parent bb187be commit f9bc394
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
description: New Brunswick provides the following Spouse or Common-law partner base amount.
values:
2022-01-01: x
2022-01-01: 10_105
2023-01-01: 10_741
2024-01-01: 11_246
metadata:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
- name: One person eligible and one not
period: 2022
input:
people:
head:
is_spouse: false
individual_net_income: 10_000
spouse:
is_spouse: true
individual_net_income: 1_000
household:
members: [head, spouse]
province_code: NB
output:
nb_spouse_and_common_law_partner_amount_credit: 9_105

period: 2023
input:
people:
head:
is_spouse: false
individual_net_income: 10_000
spouse:
is_spouse: true
individual_net_income: 1_000
household:
members: [head, spouse]
province_code: NB
output:
nb_spouse_and_common_law_partner_amount_credit: 9_741

period: 2024
input:
people:
Expand All @@ -14,26 +42,54 @@
members: [head, spouse]
province_code: NB
output:
spouse_income: [0, 1_000]
nb_spouse_and_common_law_partner_amount_credit: 10_223

- name: Eligible spouse
period: 2022
input:
province_code: NB
is_spouse: true
individual_net_income: 10_000
output:
nb_spouse_and_common_law_partner_amount_credit: 105

period: 2023
input:
province_code: NB
is_spouse: true
individual_net_income: 10_000
output:
nb_spouse_and_common_law_partner_amount_credit: 741

period: 2024
input:
province_code: NB
is_spouse: true
individual_net_income: 10_000
output:
spouse_income: 10_000
nb_spouse_and_common_law_partner_amount_credit: 1_246

- name: Ineligible spouse
period: 2022
input:
province_code: NB
is_spouse: false
individual_net_income: 10_000
output:
nb_spouse_and_common_law_partner_amount_credit: 0

period: 2023
period: 2024
input:
province_code: NB
is_spouse: false
individual_net_income: 10_000
output:
spouse_income: 0
nb_spouse_and_common_law_partner_amount_credit: 0

period: 2024
input:
province_code: NB
is_spouse: false
individual_net_income: 10_000
output:
nb_spouse_and_common_law_partner_amount_credit: 0
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,20 @@
output:
nb_spouse_and_common_law_partner_amount_credit: 0

parameters:
gov:
provinces:
nb:
tax:
income:
credits:
spouse_or_common_law_partner_amount:
base_amount:
2022-01-01: 10_105
2023-01-01: 10_741
2024-01-01: 11_246
max_credit:
2022-01-01: 9_186
2023-01-01: 9_764
2024-01-01: 10_223

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from policyengine_canada.model_api import *

class nb_spouse_and_common_law_partner_amount_credit(Variable):
value_type = float
entity = Household
label = "New Brunswick spouse and common-law partner amount credit"
definition_period = YEAR
defined_for = ProvinceCode.NB


def formula(household, period, parameters):
p = parameters(period).gov.provinces.nb.tax.income.credits.spouse_or_common_law_partner_amount
base_amount = p.base_amount
max_credit = p.max_credit

spouse_income = add(household, period, ["spouse_income"])
reduced_amount = max_(base_amount - spouse_income, 0)

0 comments on commit f9bc394

Please sign in to comment.