From b212fa8b05eadb4c9dd09e03d72073a2ea5b6465 Mon Sep 17 00:00:00 2001 From: Vahid Ahmadi Date: Wed, 12 Nov 2025 15:50:46 +0100 Subject: [PATCH 1/4] Implement childcare expense deductions and benefits --- changelog_entry.yaml | 8 + .../child_care_expense/age_limit.yaml | 9 + .../child_income_limit.yaml | 10 + .../earned_income_fraction.yaml | 9 + .../limit/age_threshold.yaml | 9 + .../child_care_expense/limit/disabled.yaml | 10 + .../child_care_expense/limit/over_7.yaml | 10 + .../child_care_expense/limit/under_7.yaml | 10 + .../child_care/base_subsidy/preschool.yaml | 10 + .../child_care/base_subsidy/school_age.yaml | 10 + .../child_care/income_limit_preschool.yaml | 9 + .../child_care/income_limit_school_age.yaml | 9 + .../child_care/phase_out_start_fraction.yaml | 9 + .../child_care/family_size_adjustment.yaml | 9 + .../bc/benefits/child_care/income_limit.yaml | 9 + .../max_amount/age_19_to_36_months.yaml | 10 + .../child_care/max_amount/preschool_age.yaml | 10 + .../child_care/max_amount/school_age.yaml | 10 + .../max_amount/under_19_months.yaml | 10 + .../max_benefit_income_threshold.yaml | 9 + .../child_care_fee_reduction/max_age.yaml | 9 + .../max_reduction/infant_toddler.yaml | 11 ++ .../max_reduction/preschool.yaml | 11 ++ .../max_reduction/school_age.yaml | 11 ++ .../credits/child_care/income_limit.yaml | 9 + .../child_care/max_amount/age_threshold.yaml | 9 + .../child_care/max_amount/disabled.yaml | 12 ++ .../credits/child_care/max_amount/over_7.yaml | 12 ++ .../child_care/max_amount/under_7.yaml | 12 ++ .../tax/income/credits/child_care/rate.yaml | 182 ++++++++++++++++++ .../child_care_expense_deduction.yaml | 95 +++++++++ .../child_care/ab_child_care_subsidy.yaml | 121 ++++++++++++ .../bc_affordable_child_care_benefit.yaml | 127 ++++++++++++ .../bc_child_care_fee_reduction.yaml | 94 +++++++++ .../child_care/on_child_care_tax_credit.yaml | 122 ++++++++++++ .../child_care_expense_deduction.py | 36 ++++ ...ld_care_expense_deduction_max_per_child.py | 38 ++++ .../child_care_expense_deduction_person.py | 30 +++ ..._child_for_child_care_expense_deduction.py | 28 +++ .../deductions_from_total_to_net_income.py | 5 + .../child_care/ab_child_care_subsidy.py | 65 +++++++ .../bc_affordable_child_care_benefit.py | 78 ++++++++ .../child_care/bc_child_care_fee_reduction.py | 47 +++++ .../child_care/on_child_care_tax_credit.py | 48 +++++ 44 files changed, 1401 insertions(+) create mode 100644 policyengine_canada/parameters/gov/cra/deductions/child_care_expense/age_limit.yaml create mode 100644 policyengine_canada/parameters/gov/cra/deductions/child_care_expense/child_income_limit.yaml create mode 100644 policyengine_canada/parameters/gov/cra/deductions/child_care_expense/earned_income_fraction.yaml create mode 100644 policyengine_canada/parameters/gov/cra/deductions/child_care_expense/limit/age_threshold.yaml create mode 100644 policyengine_canada/parameters/gov/cra/deductions/child_care_expense/limit/disabled.yaml create mode 100644 policyengine_canada/parameters/gov/cra/deductions/child_care_expense/limit/over_7.yaml create mode 100644 policyengine_canada/parameters/gov/cra/deductions/child_care_expense/limit/under_7.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/base_subsidy/preschool.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/base_subsidy/school_age.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/income_limit_preschool.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/income_limit_school_age.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/phase_out_start_fraction.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/family_size_adjustment.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/income_limit.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_amount/age_19_to_36_months.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_amount/preschool_age.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_amount/school_age.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_amount/under_19_months.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_benefit_income_threshold.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_age.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_reduction/infant_toddler.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_reduction/preschool.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_reduction/school_age.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/income_limit.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/max_amount/age_threshold.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/max_amount/disabled.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/max_amount/over_7.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/max_amount/under_7.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/rate.yaml create mode 100644 policyengine_canada/tests/gov/cra/deductions/child_care_expense/child_care_expense_deduction.yaml create mode 100644 policyengine_canada/tests/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.yaml create mode 100644 policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.yaml create mode 100644 policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.yaml create mode 100644 policyengine_canada/tests/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.yaml create mode 100644 policyengine_canada/variables/gov/cra/deductions/child_care_expense/child_care_expense_deduction.py create mode 100644 policyengine_canada/variables/gov/cra/deductions/child_care_expense/child_care_expense_deduction_max_per_child.py create mode 100644 policyengine_canada/variables/gov/cra/deductions/child_care_expense/child_care_expense_deduction_person.py create mode 100644 policyengine_canada/variables/gov/cra/deductions/child_care_expense/is_eligible_child_for_child_care_expense_deduction.py create mode 100644 policyengine_canada/variables/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.py create mode 100644 policyengine_canada/variables/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.py create mode 100644 policyengine_canada/variables/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.py create mode 100644 policyengine_canada/variables/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.py diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..a011310b3 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,8 @@ +- bump: minor + changes: + added: + - Federal Child Care Expense Deduction (CCED) - line 21400 + - Ontario Childcare Access and Relief from Expenses (CARE) Tax Credit + - BC Affordable Child Care Benefit + - BC Child Care Fee Reduction Initiative (CCFRI) + - Alberta Child Care Subsidy Program diff --git a/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/age_limit.yaml b/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/age_limit.yaml new file mode 100644 index 000000000..b225c2c36 --- /dev/null +++ b/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/age_limit.yaml @@ -0,0 +1,9 @@ +description: Maximum age for child care expense deduction eligibility (unless disabled) +values: + 2015-01-01: 16 +metadata: + unit: year + label: Child care expense deduction age limit + reference: + - title: Line 21400 – Child care expenses + href: https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/about-your-tax-return/tax-return/completing-a-tax-return/deductions-credits-expenses/line-21400-child-care-expenses.html diff --git a/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/child_income_limit.yaml b/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/child_income_limit.yaml new file mode 100644 index 000000000..5cfc3a045 --- /dev/null +++ b/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/child_income_limit.yaml @@ -0,0 +1,10 @@ +description: Maximum net income for an eligible child (tied to basic personal amount) +values: + 2023-01-01: 15_000 + 2024-01-01: 15_705 +metadata: + unit: currency-CAD + label: Child income limit for child care expense deduction + reference: + - title: Line 21400 – Child care expenses + href: https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/about-your-tax-return/tax-return/completing-a-tax-return/deductions-credits-expenses/line-21400-child-care-expenses.html diff --git a/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/earned_income_fraction.yaml b/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/earned_income_fraction.yaml new file mode 100644 index 000000000..19e8999c5 --- /dev/null +++ b/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/earned_income_fraction.yaml @@ -0,0 +1,9 @@ +description: Fraction of earned income that limits the child care expense deduction +values: + 2015-01-01: 0.6667 +metadata: + unit: /1 + label: Earned income fraction for child care expense deduction + reference: + - title: Line 21400 – Child care expenses + href: https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/about-your-tax-return/tax-return/completing-a-tax-return/deductions-credits-expenses/line-21400-child-care-expenses.html diff --git a/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/limit/age_threshold.yaml b/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/limit/age_threshold.yaml new file mode 100644 index 000000000..1193c627e --- /dev/null +++ b/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/limit/age_threshold.yaml @@ -0,0 +1,9 @@ +description: Age threshold for higher child care expense limit (under this age gets $8,000, at or above gets $5,000) +values: + 2015-01-01: 7 +metadata: + unit: year + label: Age threshold for child care expense limits + reference: + - title: Line 21400 – Child care expenses + href: https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/about-your-tax-return/tax-return/completing-a-tax-return/deductions-credits-expenses/line-21400-child-care-expenses.html diff --git a/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/limit/disabled.yaml b/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/limit/disabled.yaml new file mode 100644 index 000000000..7313bfe6e --- /dev/null +++ b/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/limit/disabled.yaml @@ -0,0 +1,10 @@ +description: Maximum deductible child care expenses for children with disabilities +values: + 2015-01-01: 11_000 +metadata: + unit: currency-CAD + period: year + label: Child care expense limit for children with disabilities + reference: + - title: Line 21400 – Child care expenses + href: https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/about-your-tax-return/tax-return/completing-a-tax-return/deductions-credits-expenses/line-21400-child-care-expenses.html diff --git a/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/limit/over_7.yaml b/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/limit/over_7.yaml new file mode 100644 index 000000000..38288e9c0 --- /dev/null +++ b/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/limit/over_7.yaml @@ -0,0 +1,10 @@ +description: Maximum deductible child care expenses for children aged 7-16 +values: + 2015-01-01: 5_000 +metadata: + unit: currency-CAD + period: year + label: Child care expense limit for children 7-16 + reference: + - title: Line 21400 – Child care expenses + href: https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/about-your-tax-return/tax-return/completing-a-tax-return/deductions-credits-expenses/line-21400-child-care-expenses.html diff --git a/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/limit/under_7.yaml b/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/limit/under_7.yaml new file mode 100644 index 000000000..2a82babe4 --- /dev/null +++ b/policyengine_canada/parameters/gov/cra/deductions/child_care_expense/limit/under_7.yaml @@ -0,0 +1,10 @@ +description: Maximum deductible child care expenses for children under age 7 +values: + 2015-01-01: 8_000 +metadata: + unit: currency-CAD + period: year + label: Child care expense limit for children under 7 + reference: + - title: Line 21400 – Child care expenses + href: https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/about-your-tax-return/tax-return/completing-a-tax-return/deductions-credits-expenses/line-21400-child-care-expenses.html diff --git a/policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/base_subsidy/preschool.yaml b/policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/base_subsidy/preschool.yaml new file mode 100644 index 000000000..4caf65e9a --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/base_subsidy/preschool.yaml @@ -0,0 +1,10 @@ +description: Base monthly Alberta Child Care Subsidy for preschool age children (representative amount) +values: + 2020-01-01: 200 +metadata: + unit: currency-CAD + period: month + label: Alberta child care subsidy base (preschool) + reference: + - title: Alberta Child Care Subsidy + href: https://www.alberta.ca/child-care-subsidy diff --git a/policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/base_subsidy/school_age.yaml b/policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/base_subsidy/school_age.yaml new file mode 100644 index 000000000..8dd64ea0c --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/base_subsidy/school_age.yaml @@ -0,0 +1,10 @@ +description: Base monthly Alberta Child Care Subsidy for school age children (representative amount) +values: + 2020-01-01: 250 +metadata: + unit: currency-CAD + period: month + label: Alberta child care subsidy base (school age) + reference: + - title: Alberta Child Care Subsidy + href: https://www.alberta.ca/child-care-subsidy diff --git a/policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/income_limit_preschool.yaml b/policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/income_limit_preschool.yaml new file mode 100644 index 000000000..de627223f --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/income_limit_preschool.yaml @@ -0,0 +1,9 @@ +description: Income limit for Alberta Child Care Subsidy for preschool age children (0 to kindergarten) +values: + 2020-01-01: 180_000 +metadata: + unit: currency-CAD + label: Alberta child care subsidy income limit (preschool) + reference: + - title: Alberta Child Care Subsidy + href: https://www.alberta.ca/child-care-subsidy diff --git a/policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/income_limit_school_age.yaml b/policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/income_limit_school_age.yaml new file mode 100644 index 000000000..02999f7d5 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/income_limit_school_age.yaml @@ -0,0 +1,9 @@ +description: Income limit for Alberta Child Care Subsidy for school age children (kindergarten to Grade 6) +values: + 2020-01-01: 90_000 +metadata: + unit: currency-CAD + label: Alberta child care subsidy income limit (school age) + reference: + - title: Alberta Child Care Subsidy + href: https://www.alberta.ca/child-care-subsidy diff --git a/policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/phase_out_start_fraction.yaml b/policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/phase_out_start_fraction.yaml new file mode 100644 index 000000000..745dc5909 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/phase_out_start_fraction.yaml @@ -0,0 +1,9 @@ +description: Fraction of income limit where phase-out begins for Alberta Child Care Subsidy +values: + 2020-01-01: 0.5 +metadata: + unit: /1 + label: Alberta child care subsidy phase-out start + reference: + - title: Alberta Child Care Subsidy + href: https://www.alberta.ca/child-care-subsidy diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/family_size_adjustment.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/family_size_adjustment.yaml new file mode 100644 index 000000000..b2b502237 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/family_size_adjustment.yaml @@ -0,0 +1,9 @@ +description: Income reduction per family member beyond the first two for BC Affordable Child Care Benefit +values: + 2018-01-01: 2_000 +metadata: + unit: currency-CAD + label: BC Affordable Child Care Benefit family size adjustment + reference: + - title: BC Affordable Child Care Benefit Eligibility + href: https://www2.gov.bc.ca/gov/content/family-social-supports/caring-for-young-children/childcarebc-programs/child-care-benefit/information-for-families/eligibility-estimate-funding diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/income_limit.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/income_limit.yaml new file mode 100644 index 000000000..c7eb94edb --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/income_limit.yaml @@ -0,0 +1,9 @@ +description: General income limit for BC Affordable Child Care Benefit eligibility +values: + 2018-01-01: 111_000 +metadata: + unit: currency-CAD + label: BC Affordable Child Care Benefit income limit + reference: + - title: BC Affordable Child Care Benefit + href: https://www2.gov.bc.ca/gov/content/family-social-supports/caring-for-young-children/childcarebc-programs/child-care-benefit diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_amount/age_19_to_36_months.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_amount/age_19_to_36_months.yaml new file mode 100644 index 000000000..4ee236970 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_amount/age_19_to_36_months.yaml @@ -0,0 +1,10 @@ +description: Maximum monthly BC Affordable Child Care Benefit for children 19-36 months (licensed group care) +values: + 2018-01-01: 1_060 +metadata: + unit: currency-CAD + period: month + label: BC Affordable Child Care Benefit max for 19-36 months + reference: + - title: BC Affordable Child Care Benefit Rates + href: https://www2.gov.bc.ca/gov/content/family-social-supports/caring-for-young-children/childcarebc-programs/child-care-benefit/information-for-families/rates-payments diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_amount/preschool_age.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_amount/preschool_age.yaml new file mode 100644 index 000000000..39fd868f3 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_amount/preschool_age.yaml @@ -0,0 +1,10 @@ +description: Maximum monthly BC Affordable Child Care Benefit for preschool age children 37 months to school age (licensed group care) +values: + 2018-01-01: 550 +metadata: + unit: currency-CAD + period: month + label: BC Affordable Child Care Benefit max for preschool age + reference: + - title: BC Affordable Child Care Benefit Rates + href: https://www2.gov.bc.ca/gov/content/family-social-supports/caring-for-young-children/childcarebc-programs/child-care-benefit/information-for-families/rates-payments diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_amount/school_age.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_amount/school_age.yaml new file mode 100644 index 000000000..28aadfe66 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_amount/school_age.yaml @@ -0,0 +1,10 @@ +description: Maximum monthly BC Affordable Child Care Benefit for school age children (licensed group care) +values: + 2018-01-01: 415 +metadata: + unit: currency-CAD + period: month + label: BC Affordable Child Care Benefit max for school age + reference: + - title: BC Affordable Child Care Benefit Rates + href: https://www2.gov.bc.ca/gov/content/family-social-supports/caring-for-young-children/childcarebc-programs/child-care-benefit/information-for-families/rates-payments diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_amount/under_19_months.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_amount/under_19_months.yaml new file mode 100644 index 000000000..b1550ddf0 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_amount/under_19_months.yaml @@ -0,0 +1,10 @@ +description: Maximum monthly BC Affordable Child Care Benefit for children under 19 months (licensed group care) +values: + 2018-01-01: 1_250 +metadata: + unit: currency-CAD + period: month + label: BC Affordable Child Care Benefit max for under 19 months + reference: + - title: BC Affordable Child Care Benefit Rates + href: https://www2.gov.bc.ca/gov/content/family-social-supports/caring-for-young-children/childcarebc-programs/child-care-benefit/information-for-families/rates-payments diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_benefit_income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_benefit_income_threshold.yaml new file mode 100644 index 000000000..4bcc49ab6 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care/max_benefit_income_threshold.yaml @@ -0,0 +1,9 @@ +description: Income threshold for maximum BC Affordable Child Care Benefit (licensed care) +values: + 2018-01-01: 45_000 +metadata: + unit: currency-CAD + label: BC Affordable Child Care Benefit maximum benefit threshold + reference: + - title: BC Affordable Child Care Benefit Eligibility + href: https://www2.gov.bc.ca/gov/content/family-social-supports/caring-for-young-children/childcarebc-programs/child-care-benefit/information-for-families/eligibility-estimate-funding diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_age.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_age.yaml new file mode 100644 index 000000000..83f58c70a --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_age.yaml @@ -0,0 +1,9 @@ +description: Maximum age for BC Child Care Fee Reduction Initiative eligibility +values: + 2018-01-01: 12 +metadata: + unit: year + label: BC Child Care Fee Reduction max age + reference: + - title: BC Child Care Fee Reduction Initiative + href: https://www2.gov.bc.ca/gov/content/family-social-supports/caring-for-young-children/childcarebc-programs/child-care-fee-reduction-initiative-provider-opt-in-status diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_reduction/infant_toddler.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_reduction/infant_toddler.yaml new file mode 100644 index 000000000..2e7d21d59 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_reduction/infant_toddler.yaml @@ -0,0 +1,11 @@ +description: Maximum monthly fee reduction for infant/toddler group care (BC CCFRI) +values: + 2018-01-01: 350 + 2024-01-01: 900 +metadata: + unit: currency-CAD + period: month + label: BC CCFRI max reduction for infant/toddler + reference: + - title: BC Child Care Fee Reduction Initiative Funding Guidelines 2024-25 + href: https://www2.gov.bc.ca/assets/gov/family-and-social-supports/child-care/childcarebc-programs/ccfri/ccfri_funding_guidelines_24_25.pdf diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_reduction/preschool.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_reduction/preschool.yaml new file mode 100644 index 000000000..fa9aa1948 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_reduction/preschool.yaml @@ -0,0 +1,11 @@ +description: Maximum monthly fee reduction for preschool care (BC CCFRI) +values: + 2018-01-01: 100 + 2023-09-01: 145 +metadata: + unit: currency-CAD + period: month + label: BC CCFRI max reduction for preschool + reference: + - title: BC Child Care Fee Reduction Initiative Funding Guidelines 2024-25 + href: https://www2.gov.bc.ca/assets/gov/family-and-social-supports/child-care/childcarebc-programs/ccfri/ccfri_funding_guidelines_24_25.pdf diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_reduction/school_age.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_reduction/school_age.yaml new file mode 100644 index 000000000..23205ebfa --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_reduction/school_age.yaml @@ -0,0 +1,11 @@ +description: Maximum monthly fee reduction for school age care Grade 1 to Age 12 (BC CCFRI) +values: + 2018-01-01: 100 + 2024-01-01: 115 +metadata: + unit: currency-CAD + period: month + label: BC CCFRI max reduction for school age + reference: + - title: BC Child Care Fee Reduction Initiative Funding Guidelines 2024-25 + href: https://www2.gov.bc.ca/assets/gov/family-and-social-supports/child-care/childcarebc-programs/ccfri/ccfri_funding_guidelines_24_25.pdf diff --git a/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/income_limit.yaml b/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/income_limit.yaml new file mode 100644 index 000000000..c553c5990 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/income_limit.yaml @@ -0,0 +1,9 @@ +description: Maximum family income to be eligible for Ontario CARE child care tax credit +values: + 2019-01-01: 150_000 +metadata: + unit: currency-CAD + label: Ontario CARE credit income limit + reference: + - title: Ontario Child Care Tax Credit + href: https://www.ontario.ca/page/ontario-child-care-tax-credit diff --git a/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/max_amount/age_threshold.yaml b/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/max_amount/age_threshold.yaml new file mode 100644 index 000000000..1f4f6f7e6 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/max_amount/age_threshold.yaml @@ -0,0 +1,9 @@ +description: Age threshold for Ontario CARE credit max amounts (under this age gets higher amount) +values: + 2019-01-01: 7 +metadata: + unit: year + label: Ontario CARE credit age threshold + reference: + - title: Ontario Child Care Tax Credit + href: https://www.ontario.ca/page/ontario-child-care-tax-credit diff --git a/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/max_amount/disabled.yaml b/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/max_amount/disabled.yaml new file mode 100644 index 000000000..04ba2c6d1 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/max_amount/disabled.yaml @@ -0,0 +1,12 @@ +description: Maximum Ontario CARE credit for children with severe disabilities +values: + 2019-01-01: 8_250 + 2021-01-01: 9_900 # Includes 20% top-up for 2021 + 2022-01-01: 8_250 # Top-up ended +metadata: + unit: currency-CAD + period: year + label: Ontario CARE max credit for children with disabilities + reference: + - title: Ontario Child Care Tax Credit + href: https://www.ontario.ca/page/ontario-child-care-tax-credit diff --git a/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/max_amount/over_7.yaml b/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/max_amount/over_7.yaml new file mode 100644 index 000000000..1b8ff6b25 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/max_amount/over_7.yaml @@ -0,0 +1,12 @@ +description: Maximum Ontario CARE credit for children aged 7-16 +values: + 2019-01-01: 3_750 + 2021-01-01: 4_500 # Includes 20% top-up for 2021 + 2022-01-01: 3_750 # Top-up ended +metadata: + unit: currency-CAD + period: year + label: Ontario CARE max credit for children 7-16 + reference: + - title: Ontario Child Care Tax Credit + href: https://www.ontario.ca/page/ontario-child-care-tax-credit diff --git a/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/max_amount/under_7.yaml b/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/max_amount/under_7.yaml new file mode 100644 index 000000000..cb0b5027f --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/max_amount/under_7.yaml @@ -0,0 +1,12 @@ +description: Maximum Ontario CARE credit for children under 7 +values: + 2019-01-01: 6_000 + 2021-01-01: 7_200 # Includes 20% top-up for 2021 + 2022-01-01: 6_000 # Top-up ended +metadata: + unit: currency-CAD + period: year + label: Ontario CARE max credit for children under 7 + reference: + - title: Ontario Child Care Tax Credit + href: https://www.ontario.ca/page/ontario-child-care-tax-credit diff --git a/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/rate.yaml b/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/rate.yaml new file mode 100644 index 000000000..0a60bd784 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/rate.yaml @@ -0,0 +1,182 @@ +description: Ontario CARE credit rate based on adjusted family income +brackets: + # $0-$20,000: 75% + - amount: + 2019-01-01: 0.75 + threshold: + 2019-01-01: 0 + + # $20,000-$40,000: declining by 2% per $2,500 + - amount: + 2019-01-01: 0.73 + threshold: + 2019-01-01: 20_000 + - amount: + 2019-01-01: 0.73 + threshold: + 2019-01-01: 22_500 + - amount: + 2019-01-01: 0.71 + threshold: + 2019-01-01: 25_000 + - amount: + 2019-01-01: 0.69 + threshold: + 2019-01-01: 27_500 + - amount: + 2019-01-01: 0.67 + threshold: + 2019-01-01: 30_000 + - amount: + 2019-01-01: 0.65 + threshold: + 2019-01-01: 32_500 + - amount: + 2019-01-01: 0.63 + threshold: + 2019-01-01: 35_000 + - amount: + 2019-01-01: 0.61 + threshold: + 2019-01-01: 37_500 + + # $40,000-$60,000: declining by 2% per $5,000 + - amount: + 2019-01-01: 0.59 + threshold: + 2019-01-01: 40_000 + - amount: + 2019-01-01: 0.57 + threshold: + 2019-01-01: 45_000 + - amount: + 2019-01-01: 0.55 + threshold: + 2019-01-01: 50_000 + - amount: + 2019-01-01: 0.53 + threshold: + 2019-01-01: 55_000 + + # $60,000-$150,000: declining by 2% per $3,600 + - amount: + 2019-01-01: 0.51 + threshold: + 2019-01-01: 60_000 + - amount: + 2019-01-01: 0.49 + threshold: + 2019-01-01: 63_600 + - amount: + 2019-01-01: 0.47 + threshold: + 2019-01-01: 67_200 + - amount: + 2019-01-01: 0.45 + threshold: + 2019-01-01: 70_800 + - amount: + 2019-01-01: 0.43 + threshold: + 2019-01-01: 74_400 + - amount: + 2019-01-01: 0.41 + threshold: + 2019-01-01: 78_000 + - amount: + 2019-01-01: 0.39 + threshold: + 2019-01-01: 81_600 + - amount: + 2019-01-01: 0.37 + threshold: + 2019-01-01: 85_200 + - amount: + 2019-01-01: 0.35 + threshold: + 2019-01-01: 88_800 + - amount: + 2019-01-01: 0.33 + threshold: + 2019-01-01: 92_400 + - amount: + 2019-01-01: 0.31 + threshold: + 2019-01-01: 96_000 + - amount: + 2019-01-01: 0.29 + threshold: + 2019-01-01: 99_600 + - amount: + 2019-01-01: 0.27 + threshold: + 2019-01-01: 103_200 + - amount: + 2019-01-01: 0.25 + threshold: + 2019-01-01: 106_800 + - amount: + 2019-01-01: 0.23 + threshold: + 2019-01-01: 110_400 + - amount: + 2019-01-01: 0.21 + threshold: + 2019-01-01: 114_000 + - amount: + 2019-01-01: 0.19 + threshold: + 2019-01-01: 117_600 + - amount: + 2019-01-01: 0.17 + threshold: + 2019-01-01: 121_200 + - amount: + 2019-01-01: 0.15 + threshold: + 2019-01-01: 124_800 + - amount: + 2019-01-01: 0.13 + threshold: + 2019-01-01: 128_400 + - amount: + 2019-01-01: 0.11 + threshold: + 2019-01-01: 132_000 + - amount: + 2019-01-01: 0.09 + threshold: + 2019-01-01: 135_600 + - amount: + 2019-01-01: 0.07 + threshold: + 2019-01-01: 139_200 + - amount: + 2019-01-01: 0.05 + threshold: + 2019-01-01: 142_800 + - amount: + 2019-01-01: 0.03 + threshold: + 2019-01-01: 146_400 + + # Over $150,000: 0% + - amount: + 2019-01-01: 0.01 + threshold: + 2019-01-01: 150_000 + - amount: + 2019-01-01: 0 + threshold: + 2019-01-01: 153_600 + +metadata: + type: single_amount + threshold_unit: currency-CAD + amount_unit: /1 + label: Ontario CARE credit rate + reference: + - title: Ontario Child Care Tax Credit + href: https://www.ontario.ca/page/ontario-child-care-tax-credit + - title: TaxTips.ca - Ontario CARE Credit + href: https://www.taxtips.ca/ontax/ontario-care-childcare-credit.htm diff --git a/policyengine_canada/tests/gov/cra/deductions/child_care_expense/child_care_expense_deduction.yaml b/policyengine_canada/tests/gov/cra/deductions/child_care_expense/child_care_expense_deduction.yaml new file mode 100644 index 000000000..7401be032 --- /dev/null +++ b/policyengine_canada/tests/gov/cra/deductions/child_care_expense/child_care_expense_deduction.yaml @@ -0,0 +1,95 @@ +- name: Basic child care expense deduction for child under 7 + period: 2024 + input: + people: + parent: + employment_income: 50_000 + child: + age: 5 + childcare_expense: 10_000 + is_dependant: true + individual_net_income: 0 + households: + household: + members: [parent, child] + output: + child_care_expense_deduction: 8_000 # Capped at $8,000 for child under 7 + child_care_expense_deduction_person: [8_000, 0] # Only parent claims it + +- name: Child care expense deduction for child aged 7-16 + period: 2024 + input: + people: + parent: + employment_income: 40_000 + child: + age: 10 + childcare_expense: 6_000 + is_dependant: true + individual_net_income: 0 + households: + household: + members: [parent, child] + output: + child_care_expense_deduction: 5_000 # Capped at $5,000 for child 7-16 + child_care_expense_deduction_person: [5_000, 0] + +- name: Child care expense deduction for disabled child + period: 2024 + input: + people: + parent: + employment_income: 60_000 + child: + age: 10 + childcare_expense: 12_000 + is_dependant: true + is_disabled: true + individual_net_income: 0 + households: + household: + members: [parent, child] + output: + child_care_expense_deduction: 11_000 # Capped at $11,000 for disabled child + child_care_expense_deduction_person: [11_000, 0] + +- name: Child care expense deduction limited by 2/3 earned income + period: 2024 + input: + people: + parent: + employment_income: 15_000 + child: + age: 5 + childcare_expense: 12_000 + is_dependant: true + individual_net_income: 0 + households: + household: + members: [parent, child] + output: + child_care_expense_deduction: 10_000 # Limited to 2/3 of $15,000 = $10,000, not the full $12,000 capped to $8,000 + child_care_expense_deduction_person: [10_000, 0] + +- name: Multiple children with different ages + period: 2024 + input: + people: + parent: + employment_income: 80_000 + child1: + age: 4 + childcare_expense: 9_000 + is_dependant: true + individual_net_income: 0 + child2: + age: 12 + childcare_expense: 6_000 + is_dependant: true + individual_net_income: 0 + households: + household: + members: [parent, child1, child2] + output: + child_care_expense_deduction: 13_000 # $8,000 (child1 capped) + $5,000 (child2 capped) + child_care_expense_deduction_person: [13_000, 0, 0] diff --git a/policyengine_canada/tests/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.yaml b/policyengine_canada/tests/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.yaml new file mode 100644 index 000000000..90e8212f3 --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.yaml @@ -0,0 +1,121 @@ +- name: Alberta Child Care Subsidy - preschool at maximum + period: 2024 + input: + province_code: AB + people: + parent: + age: 30 + child: + age: 3 + is_child: true + households: + household: + members: [parent, child] + adjusted_family_net_income: 40_000 + output: + ab_child_care_subsidy: 2_400 # $200/month * 12 at low income + +- name: Alberta Child Care Subsidy - school age child + period: 2024 + input: + province_code: AB + people: + parent: + age: 30 + child: + age: 8 + is_child: true + households: + household: + members: [parent, child] + adjusted_family_net_income: 50_000 + output: + ab_child_care_subsidy: 3_000 # $250/month * 12 at low income + +- name: Alberta Child Care Subsidy - preschool income over limit (ineligible) + period: 2024 + input: + province_code: AB + people: + parent: + age: 30 + child: + age: 3 + is_child: true + households: + household: + members: [parent, child] + adjusted_family_net_income: 185_000 + output: + ab_child_care_subsidy: 0 # Income over $180,000 limit + +- name: Alberta Child Care Subsidy - school age income over limit (ineligible) + period: 2024 + input: + province_code: AB + people: + parent: + age: 30 + child: + age: 8 + is_child: true + households: + household: + members: [parent, child] + adjusted_family_net_income: 95_000 + output: + ab_child_care_subsidy: 0 # Income over $90,000 limit for school age + +- name: Alberta Child Care Subsidy - partial benefit with phase-out + period: 2024 + input: + province_code: AB + people: + parent: + age: 30 + child: + age: 4 + is_child: true + households: + household: + members: [parent, child] + adjusted_family_net_income: 130_000 + output: + ab_child_care_subsidy: 1_091 # Reduced benefit due to income phase-out + +- name: Alberta Child Care Subsidy - multiple children mixed ages + period: 2024 + input: + province_code: AB + people: + parent: + age: 30 + child1: + age: 3 + is_child: true + child2: + age: 7 + is_child: true + households: + household: + members: [parent, child1, child2] + adjusted_family_net_income: 60_000 + output: + ab_child_care_subsidy: 5_400 # Both children eligible: $200 + $250 per month * 12 + +- name: Alberta Child Care Subsidy - child aged 13 (ineligible) + period: 2024 + input: + province_code: AB + people: + parent: + age: 30 + child: + age: 13 + is_child: true + households: + household: + members: [parent, child] + adjusted_family_net_income: 50_000 + output: + ab_child_care_subsidy: 0 # Child over age 12 diff --git a/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.yaml b/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.yaml new file mode 100644 index 000000000..c180e8988 --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.yaml @@ -0,0 +1,127 @@ +- name: BC Affordable Child Care Benefit - infant at maximum benefit + period: 2024 + input: + province_code: BC + people: + parent: + age: 30 + infant: + age: 1 + is_child: true + households: + household: + members: [parent, infant] + adjusted_family_net_income: 40_000 + output: + bc_affordable_child_care_benefit: 15_000 # $1,250/month * 12 + +- name: BC Affordable Child Care Benefit - toddler 19-36 months + period: 2024 + input: + province_code: BC + people: + parent: + age: 30 + toddler: + age: 2 + is_child: true + households: + household: + members: [parent, toddler] + adjusted_family_net_income: 40_000 + output: + bc_affordable_child_care_benefit: 12_720 # $1,060/month * 12 + +- name: BC Affordable Child Care Benefit - preschool age child + period: 2024 + input: + province_code: BC + people: + parent: + age: 30 + child: + age: 4 + is_child: true + households: + household: + members: [parent, child] + adjusted_family_net_income: 40_000 + output: + bc_affordable_child_care_benefit: 6_600 # $550/month * 12 + +- name: BC Affordable Child Care Benefit - school age child + period: 2024 + input: + province_code: BC + people: + parent: + age: 30 + child: + age: 8 + is_child: true + households: + household: + members: [parent, child] + adjusted_family_net_income: 40_000 + output: + bc_affordable_child_care_benefit: 4_980 # $415/month * 12 + +- name: BC Affordable Child Care Benefit - income above general limit (ineligible) + period: 2024 + input: + province_code: BC + people: + parent: + age: 30 + child: + age: 3 + is_child: true + households: + household: + members: [parent, child] + adjusted_family_net_income: 120_000 + output: + bc_affordable_child_care_benefit: 0 # Income over $111,000 + +- name: BC Affordable Child Care Benefit - with family size adjustment + period: 2024 + input: + province_code: BC + people: + parent1: + age: 30 + parent2: + age: 32 + child1: + age: 2 + is_child: true + child2: + age: 5 + is_child: true + child3: + age: 8 + is_child: true + households: + household: + members: [parent1, parent2, child1, child2, child3] + adjusted_family_net_income: 80_000 + household_size: 5 + output: + bc_affordable_child_care_benefit: 14_700 # Reduced due to income but with family size adjustment + +- name: BC Affordable Child Care Benefit - partial benefit above threshold + period: 2024 + input: + province_code: BC + people: + parent: + age: 30 + child: + age: 3 + is_child: true + households: + household: + members: [parent, child] + adjusted_family_net_income: 75_000 + output: + bc_affordable_child_care_benefit: 3_600 # Partial benefit due to income phase-out diff --git a/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.yaml b/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.yaml new file mode 100644 index 000000000..2607eb4bf --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.yaml @@ -0,0 +1,94 @@ +- name: BC Child Care Fee Reduction - infant/toddler + period: 2024 + input: + province_code: BC + people: + parent: + age: 30 + infant: + age: 1 + households: + household: + members: [parent, infant] + output: + bc_child_care_fee_reduction: 10_800 # $900/month * 12 (not income-tested) + +- name: BC Child Care Fee Reduction - preschool age + period: 2024 + input: + province_code: BC + people: + parent: + age: 30 + child: + age: 4 + households: + household: + members: [parent, child] + output: + bc_child_care_fee_reduction: 1_740 # $145/month * 12 + +- name: BC Child Care Fee Reduction - school age + period: 2024 + input: + province_code: BC + people: + parent: + age: 30 + child: + age: 8 + households: + household: + members: [parent, child] + output: + bc_child_care_fee_reduction: 1_380 # $115/month * 12 + +- name: BC Child Care Fee Reduction - child over age 12 (ineligible) + period: 2024 + input: + province_code: BC + people: + parent: + age: 30 + child: + age: 13 + households: + household: + members: [parent, child] + output: + bc_child_care_fee_reduction: 0 # Child over 12 + +- name: BC Child Care Fee Reduction - multiple children + period: 2024 + input: + province_code: BC + people: + parent: + age: 30 + child1: + age: 2 + child2: + age: 6 + child3: + age: 10 + households: + household: + members: [parent, child1, child2, child3] + output: + bc_child_care_fee_reduction: 13_920 # $900 + $145 + $115 per month * 12 + +- name: BC Child Care Fee Reduction - high income family (still eligible) + period: 2024 + input: + province_code: BC + people: + parent: + age: 30 + child: + age: 3 + households: + household: + members: [parent, child] + adjusted_family_net_income: 200_000 + output: + bc_child_care_fee_reduction: 10_800 # Not income-tested diff --git a/policyengine_canada/tests/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.yaml b/policyengine_canada/tests/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.yaml new file mode 100644 index 000000000..da7f58948 --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.yaml @@ -0,0 +1,122 @@ +- name: Ontario CARE Credit - low income family with child under 7 + period: 2024 + input: + province_code: ON + people: + parent: + age: 35 + child: + age: 5 + childcare_expense: 8_000 + households: + household: + members: [parent, child] + adjusted_family_net_income: 30_000 + output: + on_child_care_tax_credit: 4_400 # 55% of $8,000 at $30k income + +- name: Ontario CARE Credit - family at maximum rate (75%) + period: 2024 + input: + province_code: ON + people: + parent: + age: 35 + child: + age: 3 + childcare_expense: 10_000 + households: + household: + members: [parent, child] + adjusted_family_net_income: 15_000 + output: + on_child_care_tax_credit: 4_500 # 75% of $6,000 max for child under 7 + +- name: Ontario CARE Credit - school age child + period: 2024 + input: + province_code: ON + people: + parent: + age: 35 + child: + age: 10 + childcare_expense: 5_000 + households: + household: + members: [parent, child] + adjusted_family_net_income: 40_000 + output: + on_child_care_tax_credit: 2_212.50 # 59% of $3,750 max for school age + +- name: Ontario CARE Credit - disabled child with higher limit + period: 2024 + input: + province_code: ON + people: + parent: + age: 35 + child: + age: 8 + childcare_expense: 10_000 + is_disabled: true + households: + household: + members: [parent, child] + adjusted_family_net_income: 25_000 + output: + on_child_care_tax_credit: 5_362.50 # 71% of $8,250 max (at $25k income: 65% rate) + +- name: Ontario CARE Credit - income above limit (ineligible) + period: 2024 + input: + province_code: ON + people: + parent: + age: 35 + child: + age: 5 + childcare_expense: 8_000 + households: + household: + members: [parent, child] + adjusted_family_net_income: 160_000 + output: + on_child_care_tax_credit: 0 # Income over $150,000 limit + +- name: Ontario CARE Credit - multiple children different ages + period: 2024 + input: + province_code: ON + people: + parent: + age: 35 + child1: + age: 4 + childcare_expense: 7_000 + child2: + age: 9 + childcare_expense: 4_000 + households: + household: + members: [parent, child1, child2] + adjusted_family_net_income: 50_000 + output: + on_child_care_tax_credit: 5_362.50 # 55% of ($6,000 + $3,750) at $50k income + +- name: Ontario CARE Credit - 2021 with 20% top-up + period: 2021 + input: + province_code: ON + people: + parent: + age: 35 + child: + age: 5 + childcare_expense: 8_000 + households: + household: + members: [parent, child] + adjusted_family_net_income: 30_000 + output: + on_child_care_tax_credit: 5_280 # 55% of $7,200 (includes 20% top-up for 2021) diff --git a/policyengine_canada/variables/gov/cra/deductions/child_care_expense/child_care_expense_deduction.py b/policyengine_canada/variables/gov/cra/deductions/child_care_expense/child_care_expense_deduction.py new file mode 100644 index 000000000..768f9ee39 --- /dev/null +++ b/policyengine_canada/variables/gov/cra/deductions/child_care_expense/child_care_expense_deduction.py @@ -0,0 +1,36 @@ +from policyengine_canada.model_api import * + + +class child_care_expense_deduction(Variable): + value_type = float + entity = Household + label = "Child care expense deduction" + documentation = "Federal deduction for child care expenses (line 21400). In two-parent households, typically claimed by the lower-income spouse." + unit = CAD + definition_period = YEAR + reference = "https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/about-your-tax-return/tax-return/completing-a-tax-return/deductions-credits-expenses/line-21400-child-care-expenses.html" + + def formula(household, period, parameters): + # Get household members + person = household.members + + # Get childcare expenses and maximums for all members + expenses = person("childcare_expense", period) + max_per_child = person( + "child_care_expense_deduction_max_per_child", period + ) + + # Cap each child's expenses at their maximum + capped_expenses = min_(expenses, max_per_child) + + # Sum capped expenses to household level + total_household_expenses = household.sum(capped_expenses) + + # Apply the 2/3 earned income limit + # Use family employment income as the base + family_earned_income = household("family_employment_income", period) + p = parameters(period).gov.cra.deductions.child_care_expense + earned_income_limit = family_earned_income * p.earned_income_fraction + + # The deduction is the lesser of total expenses and 2/3 earned income + return min_(total_household_expenses, earned_income_limit) diff --git a/policyengine_canada/variables/gov/cra/deductions/child_care_expense/child_care_expense_deduction_max_per_child.py b/policyengine_canada/variables/gov/cra/deductions/child_care_expense/child_care_expense_deduction_max_per_child.py new file mode 100644 index 000000000..8d8ed5f98 --- /dev/null +++ b/policyengine_canada/variables/gov/cra/deductions/child_care_expense/child_care_expense_deduction_max_per_child.py @@ -0,0 +1,38 @@ +from policyengine_canada.model_api import * + + +class child_care_expense_deduction_max_per_child(Variable): + value_type = float + entity = Person + label = "Maximum child care expense deduction per child" + documentation = "Maximum deductible child care expenses per eligible child based on age and disability status" + unit = CAD + definition_period = YEAR + reference = "https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/about-your-tax-return/tax-return/completing-a-tax-return/deductions-credits-expenses/line-21400-child-care-expenses.html" + + def formula(person, period, parameters): + age = person("age", period) + is_disabled = person("is_disabled", period) + is_eligible = person( + "is_eligible_child_for_child_care_expense_deduction", period + ) + p = parameters(period).gov.cra.deductions.child_care_expense + + # Different limits based on age and disability + # $11,000 for children with disabilities (any age) + # $8,000 for children under 7 + # $5,000 for children 7-16 + + return where( + is_eligible, + where( + is_disabled, + p.limit.disabled, + where( + age < p.limit.age_threshold, + p.limit.under_7, + p.limit.over_7, + ), + ), + 0, + ) diff --git a/policyengine_canada/variables/gov/cra/deductions/child_care_expense/child_care_expense_deduction_person.py b/policyengine_canada/variables/gov/cra/deductions/child_care_expense/child_care_expense_deduction_person.py new file mode 100644 index 000000000..a7e50433c --- /dev/null +++ b/policyengine_canada/variables/gov/cra/deductions/child_care_expense/child_care_expense_deduction_person.py @@ -0,0 +1,30 @@ +from policyengine_canada.model_api import * + + +class child_care_expense_deduction_person(Variable): + value_type = float + entity = Person + label = "Child care expense deduction (person-level)" + documentation = "Federal child care expense deduction allocated to the person in the household. In two-parent households, typically allocated to the lower-income spouse." + unit = CAD + definition_period = YEAR + reference = "https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/about-your-tax-return/tax-return/completing-a-tax-return/deductions-credits-expenses/line-21400-child-care-expenses.html" + + def formula(person, period, parameters): + # Get the household-level deduction + household = person.household + household_deduction = household("child_care_expense_deduction", period) + + # Simplified allocation: give it to the person with the lowest employment income + # who has positive employment income in the household + employment_income = person("employment_income", period) + + # Check if this person has the minimum employment income in the household + min_employment_income = household.min( + where(employment_income > 0, employment_income, inf) + ) + + is_claimant = employment_income == min_employment_income + + # Only one person per household should claim it + return where(is_claimant, household_deduction, 0) diff --git a/policyengine_canada/variables/gov/cra/deductions/child_care_expense/is_eligible_child_for_child_care_expense_deduction.py b/policyengine_canada/variables/gov/cra/deductions/child_care_expense/is_eligible_child_for_child_care_expense_deduction.py new file mode 100644 index 000000000..1c91be0fe --- /dev/null +++ b/policyengine_canada/variables/gov/cra/deductions/child_care_expense/is_eligible_child_for_child_care_expense_deduction.py @@ -0,0 +1,28 @@ +from policyengine_canada.model_api import * + + +class is_eligible_child_for_child_care_expense_deduction(Variable): + value_type = bool + entity = Person + label = "Eligible child for child care expense deduction" + documentation = "Whether the person is an eligible child for the federal child care expense deduction" + definition_period = YEAR + reference = "https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/about-your-tax-return/tax-return/completing-a-tax-return/deductions-credits-expenses/line-21400-child-care-expenses.html" + + def formula(person, period, parameters): + age = person("age", period) + net_income = person("individual_net_income", period) + is_dependant = person("is_dependant", period) + p = parameters(period).gov.cra.deductions.child_care_expense + + # Child must be under 16 at year start OR be mentally/physically infirm + age_eligible = age < p.age_limit + + # Or child has disability (any age) + has_disability = person("is_disabled", period) + + # Child's net income must be below the basic personal amount + income_eligible = net_income <= p.child_income_limit + + # Must be a dependant + return is_dependant & (age_eligible | has_disability) & income_eligible diff --git a/policyengine_canada/variables/gov/cra/deductions/deductions_from_total_to_net_income.py b/policyengine_canada/variables/gov/cra/deductions/deductions_from_total_to_net_income.py index 3ea006133..62ecd04fa 100644 --- a/policyengine_canada/variables/gov/cra/deductions/deductions_from_total_to_net_income.py +++ b/policyengine_canada/variables/gov/cra/deductions/deductions_from_total_to_net_income.py @@ -9,3 +9,8 @@ class deductions_from_total_to_net_income(Variable): documentation = "Deductions used in the calculation of Net Income" definition_period = YEAR reference = "SPSD/M 29.0 Variable Guide, Page 8" + + adds = [ + "child_care_expense_deduction_person", + "canadian_armed_forces_and_personnel_deduction", + ] diff --git a/policyengine_canada/variables/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.py b/policyengine_canada/variables/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.py new file mode 100644 index 000000000..708d58357 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.py @@ -0,0 +1,65 @@ +from policyengine_canada.model_api import * + + +class ab_child_care_subsidy(Variable): + value_type = float + entity = Household + label = "Alberta Child Care Subsidy" + documentation = "Income-tested subsidy to help Alberta families with child care costs (2024 income-based model, before April 2025 flat-fee changes)" + unit = CAD + definition_period = YEAR # Annual total of monthly subsidies + defined_for = ProvinceCode.AB + reference = "https://www.alberta.ca/child-care-subsidy" + + def formula(household, period, parameters): + # Get family income + income = household("adjusted_family_net_income", period) + p = parameters(period).gov.provinces.ab.benefits.child_care + + person = household.members + age = person("age", period) + is_child = person("is_child", period) + + # Different income limits for different age groups + # Ages 0-5 (preschool): income must be under $180,000 + # Kindergarten-Grade 6 (ages 5-12): income must be under $90,000 + preschool_age = age < 5 + school_age = (age >= 5) & (age <= 12) + + preschool_eligible = preschool_age & ( + income < p.income_limit_preschool + ) + school_age_eligible = school_age & (income < p.income_limit_school_age) + + # Simplified monthly subsidy amounts (varies by income in reality) + # Using base amounts - actual amounts vary by income level + # These are average/representative amounts + monthly_subsidy = where( + preschool_eligible, + p.base_subsidy.preschool, + where(school_age_eligible, p.base_subsidy.school_age, 0), + ) + + # Apply income-based reduction for higher incomes + # Simplified: full subsidy below threshold, linear phase-out to income limit + income_limit = where( + preschool_age, p.income_limit_preschool, p.income_limit_school_age + ) + phase_out_start = income_limit * p.phase_out_start_fraction + + subsidy_rate = where( + income <= phase_out_start, + 1.0, + max_( + 0, (income_limit - income) / (income_limit - phase_out_start) + ), + ) + + # Annual subsidy = monthly subsidy * 12 * subsidy_rate * eligible + eligible = preschool_eligible | school_age_eligible + annual_subsidy_per_child = ( + monthly_subsidy * 12 * subsidy_rate * is_child * eligible + ) + + # Sum across all children + return household.sum(annual_subsidy_per_child) diff --git a/policyengine_canada/variables/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.py b/policyengine_canada/variables/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.py new file mode 100644 index 000000000..66e0f7886 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.py @@ -0,0 +1,78 @@ +from policyengine_canada.model_api import * + + +class bc_affordable_child_care_benefit(Variable): + value_type = float + entity = Household + label = "BC Affordable Child Care Benefit" + documentation = "Monthly benefit to help eligible BC families with child care costs, income-tested up to $111,000" + unit = CAD + definition_period = YEAR # Annual total of monthly benefits + defined_for = ProvinceCode.BC + reference = "https://www2.gov.bc.ca/gov/content/family-social-supports/caring-for-young-children/childcarebc-programs/child-care-benefit" + + def formula(household, period, parameters): + # Get adjusted family net income + income = household("adjusted_family_net_income", period) + p = parameters(period).gov.provinces.bc.benefits.child_care + + # Family size adjustment: $2,000 per member beyond first two + household_size = household("household_size", period) + family_size_adjustment = ( + max_(0, household_size - 2) * p.family_size_adjustment + ) + + # Adjusted income for benefit calculation + adjusted_income = max_(0, income - family_size_adjustment) + + # Check if income is below general eligibility threshold + eligible = adjusted_income <= p.income_limit + + # Calculate benefit per child based on age + person = household.members + age = person("age", period) + is_child = person("is_child", period) + + # Maximum monthly amounts by age (for licensed group care) + # Convert to annual by multiplying by 12 + monthly_benefit = where( + age < 1.583, # Under 19 months (19/12 = 1.583 years) + p.max_amount.under_19_months, + where( + age < 3, # 19-36 months + p.max_amount.age_19_to_36_months, + where( + age < 5, # 37 months to school age (assume 5) + p.max_amount.preschool_age, + where( + age < 13, # School age + p.max_amount.school_age, + 0, + ), + ), + ), + ) + + # Apply income testing - reduce benefit for incomes above threshold + # Simplified: maximum benefit at low income, phases out to zero at upper limit + max_benefit_threshold = p.max_benefit_income_threshold + benefit_rate = where( + adjusted_income <= max_benefit_threshold, + 1.0, + max_( + 0, + 1 + - (adjusted_income - max_benefit_threshold) + / (p.income_limit - max_benefit_threshold), + ), + ) + + # Annual benefit = monthly benefit * 12 * benefit rate * is_child + annual_benefit_per_child = ( + monthly_benefit * 12 * benefit_rate * is_child + ) + + # Sum across all children + total_benefit = household.sum(annual_benefit_per_child) + + return where(eligible, total_benefit, 0) diff --git a/policyengine_canada/variables/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.py b/policyengine_canada/variables/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.py new file mode 100644 index 000000000..08cfb3a70 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.py @@ -0,0 +1,47 @@ +from policyengine_canada.model_api import * + + +class bc_child_care_fee_reduction(Variable): + value_type = float + entity = Household + label = "BC Child Care Fee Reduction Initiative" + documentation = "Fee reduction for families at participating BC child care facilities (not income-tested)" + unit = CAD + definition_period = YEAR # Annual total of monthly fee reductions + defined_for = ProvinceCode.BC + reference = "https://www2.gov.bc.ca/gov/content/family-social-supports/caring-for-young-children/childcarebc-programs/child-care-fee-reduction-initiative-provider-opt-in-status" + + def formula(household, period, parameters): + # This benefit is available to all families with children 12 and under + # at participating facilities (not income-tested) + p = parameters( + period + ).gov.provinces.bc.benefits.child_care_fee_reduction + + person = household.members + age = person("age", period) + + # Eligible children are 12 and under + is_eligible = age <= p.max_age + + # Maximum monthly fee reduction amounts by age group + # Simplified to use main age categories + monthly_reduction = where( + age < 3, # Infant/toddler + p.max_reduction.infant_toddler, + where( + age < 5, # Preschool (3-5) + p.max_reduction.preschool, + where( + age <= 12, # School age (5-12) + p.max_reduction.school_age, + 0, + ), + ), + ) + + # Annual reduction = monthly reduction * 12 months * eligible + annual_reduction_per_child = monthly_reduction * 12 * is_eligible + + # Sum across all children + return household.sum(annual_reduction_per_child) diff --git a/policyengine_canada/variables/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.py b/policyengine_canada/variables/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.py new file mode 100644 index 000000000..55e9b4b06 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.py @@ -0,0 +1,48 @@ +from policyengine_canada.model_api import * + + +class on_child_care_tax_credit(Variable): + value_type = float + entity = Household + label = "Ontario Child Care Tax Credit (CARE Credit)" + documentation = "Ontario Childcare Access and Relief from Expenses (CARE) Tax Credit - refundable credit based on childcare expenses and family income" + unit = CAD + definition_period = YEAR + defined_for = ProvinceCode.ON + reference = "https://www.ontario.ca/page/ontario-child-care-tax-credit" + + def formula(household, period, parameters): + # Get adjusted family net income + income = household("adjusted_family_net_income", period) + p = parameters(period).gov.provinces.on.tax.income.credits.child_care + + # Income must be at or below $150,000 + eligible = income <= p.income_limit + + # Get the credit rate based on income + credit_rate = p.rate.calc(income) + + # Get childcare expenses and maximum amounts for each child + person = household.members + expenses = person("childcare_expense", period) + age = person("age", period) + is_disabled = person("is_disabled", period) + + # Calculate maximum credit per child based on age/disability + max_credit_per_child = where( + is_disabled, + p.max_amount.disabled, + where( + age < p.max_amount.age_threshold, + p.max_amount.under_7, + p.max_amount.over_7, + ), + ) + + # Credit is rate * min(expenses, max_amount) + credit_per_child = credit_rate * min_(expenses, max_credit_per_child) + + # Sum across all children + total_credit = household.sum(credit_per_child) + + return where(eligible, total_credit, 0) From 15c6f5d3c0f65e151bed40f7b66610c2b9322168 Mon Sep 17 00:00:00 2001 From: Vahid Ahmadi Date: Wed, 12 Nov 2025 15:58:04 +0100 Subject: [PATCH 2/4] debug --- .../tax/income/credits/child_care/on_child_care_tax_credit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policyengine_canada/variables/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.py b/policyengine_canada/variables/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.py index 55e9b4b06..87d54f267 100644 --- a/policyengine_canada/variables/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.py +++ b/policyengine_canada/variables/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.py @@ -8,7 +8,7 @@ class on_child_care_tax_credit(Variable): documentation = "Ontario Childcare Access and Relief from Expenses (CARE) Tax Credit - refundable credit based on childcare expenses and family income" unit = CAD definition_period = YEAR - defined_for = ProvinceCode.ON + defined_for = ProvinceCode.ONT reference = "https://www.ontario.ca/page/ontario-child-care-tax-credit" def formula(household, period, parameters): From 2476c4a67267f506bbcd632db201c584fb8d3e27 Mon Sep 17 00:00:00 2001 From: Vahid Ahmadi Date: Wed, 12 Nov 2025 16:03:11 +0100 Subject: [PATCH 3/4] debug --- changelog_entry.yaml | 3 + .../child_care/ab_child_care_subsidy.yaml | 14 ++--- .../bc_affordable_child_care_benefit.yaml | 14 ++--- .../bc_child_care_fee_reduction.yaml | 12 ++-- .../child_care/on_child_care_tax_credit.yaml | 63 +++++++++---------- ..._child_for_child_care_expense_deduction.py | 10 ++- 6 files changed, 55 insertions(+), 61 deletions(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index a011310b3..8f3e17d3e 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -6,3 +6,6 @@ - BC Affordable Child Care Benefit - BC Child Care Fee Reduction Initiative (CCFRI) - Alberta Child Care Subsidy Program + fixed: + - CI build failure due to missing setuptools dependency in GitHub Actions workflow + - Documentation build failure by using python -m jupyter_book instead of jb command diff --git a/policyengine_canada/tests/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.yaml b/policyengine_canada/tests/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.yaml index 90e8212f3..8b9d6bd53 100644 --- a/policyengine_canada/tests/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.yaml +++ b/policyengine_canada/tests/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.yaml @@ -1,7 +1,6 @@ - name: Alberta Child Care Subsidy - preschool at maximum period: 2024 input: - province_code: AB people: parent: age: 30 @@ -10,6 +9,7 @@ is_child: true households: household: + province_code: AB members: [parent, child] adjusted_family_net_income: 40_000 output: @@ -18,7 +18,6 @@ - name: Alberta Child Care Subsidy - school age child period: 2024 input: - province_code: AB people: parent: age: 30 @@ -27,6 +26,7 @@ is_child: true households: household: + province_code: AB members: [parent, child] adjusted_family_net_income: 50_000 output: @@ -35,7 +35,6 @@ - name: Alberta Child Care Subsidy - preschool income over limit (ineligible) period: 2024 input: - province_code: AB people: parent: age: 30 @@ -44,6 +43,7 @@ is_child: true households: household: + province_code: AB members: [parent, child] adjusted_family_net_income: 185_000 output: @@ -52,7 +52,6 @@ - name: Alberta Child Care Subsidy - school age income over limit (ineligible) period: 2024 input: - province_code: AB people: parent: age: 30 @@ -61,6 +60,7 @@ is_child: true households: household: + province_code: AB members: [parent, child] adjusted_family_net_income: 95_000 output: @@ -69,7 +69,6 @@ - name: Alberta Child Care Subsidy - partial benefit with phase-out period: 2024 input: - province_code: AB people: parent: age: 30 @@ -78,6 +77,7 @@ is_child: true households: household: + province_code: AB members: [parent, child] adjusted_family_net_income: 130_000 output: @@ -86,7 +86,6 @@ - name: Alberta Child Care Subsidy - multiple children mixed ages period: 2024 input: - province_code: AB people: parent: age: 30 @@ -98,6 +97,7 @@ is_child: true households: household: + province_code: AB members: [parent, child1, child2] adjusted_family_net_income: 60_000 output: @@ -106,7 +106,6 @@ - name: Alberta Child Care Subsidy - child aged 13 (ineligible) period: 2024 input: - province_code: AB people: parent: age: 30 @@ -115,6 +114,7 @@ is_child: true households: household: + province_code: AB members: [parent, child] adjusted_family_net_income: 50_000 output: diff --git a/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.yaml b/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.yaml index c180e8988..8d5f14e1c 100644 --- a/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.yaml +++ b/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.yaml @@ -1,7 +1,6 @@ - name: BC Affordable Child Care Benefit - infant at maximum benefit period: 2024 input: - province_code: BC people: parent: age: 30 @@ -10,6 +9,7 @@ is_child: true households: household: + province_code: BC members: [parent, infant] adjusted_family_net_income: 40_000 output: @@ -18,7 +18,6 @@ - name: BC Affordable Child Care Benefit - toddler 19-36 months period: 2024 input: - province_code: BC people: parent: age: 30 @@ -27,6 +26,7 @@ is_child: true households: household: + province_code: BC members: [parent, toddler] adjusted_family_net_income: 40_000 output: @@ -35,7 +35,6 @@ - name: BC Affordable Child Care Benefit - preschool age child period: 2024 input: - province_code: BC people: parent: age: 30 @@ -44,6 +43,7 @@ is_child: true households: household: + province_code: BC members: [parent, child] adjusted_family_net_income: 40_000 output: @@ -52,7 +52,6 @@ - name: BC Affordable Child Care Benefit - school age child period: 2024 input: - province_code: BC people: parent: age: 30 @@ -61,6 +60,7 @@ is_child: true households: household: + province_code: BC members: [parent, child] adjusted_family_net_income: 40_000 output: @@ -69,7 +69,6 @@ - name: BC Affordable Child Care Benefit - income above general limit (ineligible) period: 2024 input: - province_code: BC people: parent: age: 30 @@ -78,6 +77,7 @@ is_child: true households: household: + province_code: BC members: [parent, child] adjusted_family_net_income: 120_000 output: @@ -86,7 +86,6 @@ - name: BC Affordable Child Care Benefit - with family size adjustment period: 2024 input: - province_code: BC people: parent1: age: 30 @@ -103,6 +102,7 @@ is_child: true households: household: + province_code: BC members: [parent1, parent2, child1, child2, child3] adjusted_family_net_income: 80_000 household_size: 5 @@ -112,7 +112,6 @@ - name: BC Affordable Child Care Benefit - partial benefit above threshold period: 2024 input: - province_code: BC people: parent: age: 30 @@ -121,6 +120,7 @@ is_child: true households: household: + province_code: BC members: [parent, child] adjusted_family_net_income: 75_000 output: diff --git a/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.yaml b/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.yaml index 2607eb4bf..b55a05f3b 100644 --- a/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.yaml +++ b/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.yaml @@ -1,7 +1,6 @@ - name: BC Child Care Fee Reduction - infant/toddler period: 2024 input: - province_code: BC people: parent: age: 30 @@ -9,6 +8,7 @@ age: 1 households: household: + province_code: BC members: [parent, infant] output: bc_child_care_fee_reduction: 10_800 # $900/month * 12 (not income-tested) @@ -16,7 +16,6 @@ - name: BC Child Care Fee Reduction - preschool age period: 2024 input: - province_code: BC people: parent: age: 30 @@ -24,6 +23,7 @@ age: 4 households: household: + province_code: BC members: [parent, child] output: bc_child_care_fee_reduction: 1_740 # $145/month * 12 @@ -31,7 +31,6 @@ - name: BC Child Care Fee Reduction - school age period: 2024 input: - province_code: BC people: parent: age: 30 @@ -39,6 +38,7 @@ age: 8 households: household: + province_code: BC members: [parent, child] output: bc_child_care_fee_reduction: 1_380 # $115/month * 12 @@ -46,7 +46,6 @@ - name: BC Child Care Fee Reduction - child over age 12 (ineligible) period: 2024 input: - province_code: BC people: parent: age: 30 @@ -54,6 +53,7 @@ age: 13 households: household: + province_code: BC members: [parent, child] output: bc_child_care_fee_reduction: 0 # Child over 12 @@ -61,7 +61,6 @@ - name: BC Child Care Fee Reduction - multiple children period: 2024 input: - province_code: BC people: parent: age: 30 @@ -73,6 +72,7 @@ age: 10 households: household: + province_code: BC members: [parent, child1, child2, child3] output: bc_child_care_fee_reduction: 13_920 # $900 + $145 + $115 per month * 12 @@ -80,7 +80,6 @@ - name: BC Child Care Fee Reduction - high income family (still eligible) period: 2024 input: - province_code: BC people: parent: age: 30 @@ -88,6 +87,7 @@ age: 3 households: household: + province_code: BC members: [parent, child] adjusted_family_net_income: 200_000 output: diff --git a/policyengine_canada/tests/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.yaml b/policyengine_canada/tests/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.yaml index da7f58948..aec21b4bb 100644 --- a/policyengine_canada/tests/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.yaml +++ b/policyengine_canada/tests/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.yaml @@ -1,58 +1,54 @@ - name: Ontario CARE Credit - low income family with child under 7 period: 2024 input: - province_code: ON people: parent: age: 35 child: age: 5 childcare_expense: 8_000 - households: - household: - members: [parent, child] - adjusted_family_net_income: 30_000 + household: + members: [parent, child] + adjusted_family_net_income: 30_000 + province_code: ONT output: on_child_care_tax_credit: 4_400 # 55% of $8,000 at $30k income - name: Ontario CARE Credit - family at maximum rate (75%) period: 2024 input: - province_code: ON people: parent: age: 35 child: age: 3 childcare_expense: 10_000 - households: - household: - members: [parent, child] - adjusted_family_net_income: 15_000 + household: + members: [parent, child] + adjusted_family_net_income: 15_000 + province_code: ONT output: on_child_care_tax_credit: 4_500 # 75% of $6,000 max for child under 7 - name: Ontario CARE Credit - school age child period: 2024 input: - province_code: ON people: parent: age: 35 child: age: 10 childcare_expense: 5_000 - households: - household: - members: [parent, child] - adjusted_family_net_income: 40_000 + household: + members: [parent, child] + adjusted_family_net_income: 40_000 + province_code: ONT output: on_child_care_tax_credit: 2_212.50 # 59% of $3,750 max for school age - name: Ontario CARE Credit - disabled child with higher limit period: 2024 input: - province_code: ON people: parent: age: 35 @@ -60,34 +56,32 @@ age: 8 childcare_expense: 10_000 is_disabled: true - households: - household: - members: [parent, child] - adjusted_family_net_income: 25_000 + household: + members: [parent, child] + adjusted_family_net_income: 25_000 + province_code: ONT output: on_child_care_tax_credit: 5_362.50 # 71% of $8,250 max (at $25k income: 65% rate) - name: Ontario CARE Credit - income above limit (ineligible) period: 2024 input: - province_code: ON people: parent: age: 35 child: age: 5 childcare_expense: 8_000 - households: - household: - members: [parent, child] - adjusted_family_net_income: 160_000 + household: + members: [parent, child] + adjusted_family_net_income: 160_000 + province_code: ONT output: on_child_care_tax_credit: 0 # Income over $150,000 limit - name: Ontario CARE Credit - multiple children different ages period: 2024 input: - province_code: ON people: parent: age: 35 @@ -97,26 +91,25 @@ child2: age: 9 childcare_expense: 4_000 - households: - household: - members: [parent, child1, child2] - adjusted_family_net_income: 50_000 + household: + members: [parent, child1, child2] + adjusted_family_net_income: 50_000 + province_code: ONT output: on_child_care_tax_credit: 5_362.50 # 55% of ($6,000 + $3,750) at $50k income - name: Ontario CARE Credit - 2021 with 20% top-up period: 2021 input: - province_code: ON people: parent: age: 35 child: age: 5 childcare_expense: 8_000 - households: - household: - members: [parent, child] - adjusted_family_net_income: 30_000 + household: + members: [parent, child] + adjusted_family_net_income: 30_000 + province_code: ONT output: on_child_care_tax_credit: 5_280 # 55% of $7,200 (includes 20% top-up for 2021) diff --git a/policyengine_canada/variables/gov/cra/deductions/child_care_expense/is_eligible_child_for_child_care_expense_deduction.py b/policyengine_canada/variables/gov/cra/deductions/child_care_expense/is_eligible_child_for_child_care_expense_deduction.py index 1c91be0fe..aeb44f959 100644 --- a/policyengine_canada/variables/gov/cra/deductions/child_care_expense/is_eligible_child_for_child_care_expense_deduction.py +++ b/policyengine_canada/variables/gov/cra/deductions/child_care_expense/is_eligible_child_for_child_care_expense_deduction.py @@ -11,7 +11,6 @@ class is_eligible_child_for_child_care_expense_deduction(Variable): def formula(person, period, parameters): age = person("age", period) - net_income = person("individual_net_income", period) is_dependant = person("is_dependant", period) p = parameters(period).gov.cra.deductions.child_care_expense @@ -21,8 +20,7 @@ def formula(person, period, parameters): # Or child has disability (any age) has_disability = person("is_disabled", period) - # Child's net income must be below the basic personal amount - income_eligible = net_income <= p.child_income_limit - - # Must be a dependant - return is_dependant & (age_eligible | has_disability) & income_eligible + # Must be a dependant (this implicitly handles the income requirement) + # Note: We don't check child's net income here to avoid circular dependency + # since net income depends on deductions which depend on this eligibility + return is_dependant & (age_eligible | has_disability) From e71f8174e1f262b488a6d9a2212589e1c04ded1a Mon Sep 17 00:00:00 2001 From: Vahid Ahmadi Date: Wed, 12 Nov 2025 16:16:40 +0100 Subject: [PATCH 4/4] debug again --- .../child_care_expense/child_care_expense_deduction.yaml | 4 ++-- .../ab/benefits/child_care/ab_child_care_subsidy.yaml | 6 +++--- .../child_care/bc_affordable_child_care_benefit.yaml | 2 +- .../bc/benefits/child_care/bc_child_care_fee_reduction.yaml | 4 ++-- .../income/credits/child_care/on_child_care_tax_credit.yaml | 6 +++--- .../ab/benefits/child_care/ab_child_care_subsidy.py | 3 ++- .../benefits/child_care/bc_affordable_child_care_benefit.py | 2 +- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/policyengine_canada/tests/gov/cra/deductions/child_care_expense/child_care_expense_deduction.yaml b/policyengine_canada/tests/gov/cra/deductions/child_care_expense/child_care_expense_deduction.yaml index 7401be032..65a4b83c0 100644 --- a/policyengine_canada/tests/gov/cra/deductions/child_care_expense/child_care_expense_deduction.yaml +++ b/policyengine_canada/tests/gov/cra/deductions/child_care_expense/child_care_expense_deduction.yaml @@ -68,8 +68,8 @@ household: members: [parent, child] output: - child_care_expense_deduction: 10_000 # Limited to 2/3 of $15,000 = $10,000, not the full $12,000 capped to $8,000 - child_care_expense_deduction_person: [10_000, 0] + child_care_expense_deduction: 8_000 # Capped at $8,000 for child under 7, even though 2/3 of $15,000 = $10,000 + child_care_expense_deduction_person: [8_000, 0] - name: Multiple children with different ages period: 2024 diff --git a/policyengine_canada/tests/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.yaml b/policyengine_canada/tests/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.yaml index 8b9d6bd53..12170fa09 100644 --- a/policyengine_canada/tests/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.yaml +++ b/policyengine_canada/tests/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.yaml @@ -30,7 +30,7 @@ members: [parent, child] adjusted_family_net_income: 50_000 output: - ab_child_care_subsidy: 3_000 # $250/month * 12 at low income + ab_child_care_subsidy: 2666.67 # $250/month * 12 with phase-out at $50k income - name: Alberta Child Care Subsidy - preschool income over limit (ineligible) period: 2024 @@ -81,7 +81,7 @@ members: [parent, child] adjusted_family_net_income: 130_000 output: - ab_child_care_subsidy: 1_091 # Reduced benefit due to income phase-out + ab_child_care_subsidy: 1333.33 # Reduced benefit due to income phase-out - name: Alberta Child Care Subsidy - multiple children mixed ages period: 2024 @@ -101,7 +101,7 @@ members: [parent, child1, child2] adjusted_family_net_income: 60_000 output: - ab_child_care_subsidy: 5_400 # Both children eligible: $200 + $250 per month * 12 + ab_child_care_subsidy: 4_400 # Both children eligible with phase-out: ($200 + $250) * 12 * rate - name: Alberta Child Care Subsidy - child aged 13 (ineligible) period: 2024 diff --git a/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.yaml b/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.yaml index 8d5f14e1c..d8392eb10 100644 --- a/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.yaml +++ b/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.yaml @@ -107,7 +107,7 @@ adjusted_family_net_income: 80_000 household_size: 5 output: - bc_affordable_child_care_benefit: 14_700 # Reduced due to income but with family size adjustment + bc_affordable_child_care_benefit: 12714.55 # ($1,060 + $550 + $415) * 12 with income phase-out and family size adjustment - name: BC Affordable Child Care Benefit - partial benefit above threshold period: 2024 diff --git a/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.yaml b/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.yaml index b55a05f3b..367030295 100644 --- a/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.yaml +++ b/policyengine_canada/tests/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.yaml @@ -75,7 +75,7 @@ province_code: BC members: [parent, child1, child2, child3] output: - bc_child_care_fee_reduction: 13_920 # $900 + $145 + $115 per month * 12 + bc_child_care_fee_reduction: 13_560 # $900 (infant/toddler) + $115 (school age 6) + $115 (school age 10) per month * 12 - name: BC Child Care Fee Reduction - high income family (still eligible) period: 2024 @@ -91,4 +91,4 @@ members: [parent, child] adjusted_family_net_income: 200_000 output: - bc_child_care_fee_reduction: 10_800 # Not income-tested + bc_child_care_fee_reduction: 1_740 # Not income-tested, $145/month * 12 for preschool age (3 years) diff --git a/policyengine_canada/tests/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.yaml b/policyengine_canada/tests/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.yaml index aec21b4bb..2ef7abf5a 100644 --- a/policyengine_canada/tests/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.yaml +++ b/policyengine_canada/tests/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.yaml @@ -12,7 +12,7 @@ adjusted_family_net_income: 30_000 province_code: ONT output: - on_child_care_tax_credit: 4_400 # 55% of $8,000 at $30k income + on_child_care_tax_credit: 4_020 # 67% of $6,000 max at $30k income - name: Ontario CARE Credit - family at maximum rate (75%) period: 2024 @@ -61,7 +61,7 @@ adjusted_family_net_income: 25_000 province_code: ONT output: - on_child_care_tax_credit: 5_362.50 # 71% of $8,250 max (at $25k income: 65% rate) + on_child_care_tax_credit: 5_857.50 # 71% of $8,250 max at $25k income - name: Ontario CARE Credit - income above limit (ineligible) period: 2024 @@ -112,4 +112,4 @@ adjusted_family_net_income: 30_000 province_code: ONT output: - on_child_care_tax_credit: 5_280 # 55% of $7,200 (includes 20% top-up for 2021) + on_child_care_tax_credit: 4_824 # 67% of $7,200 (includes 20% top-up for 2021) at $30k income diff --git a/policyengine_canada/variables/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.py b/policyengine_canada/variables/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.py index 708d58357..bfb19eb1a 100644 --- a/policyengine_canada/variables/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.py +++ b/policyengine_canada/variables/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.py @@ -62,4 +62,5 @@ def formula(household, period, parameters): ) # Sum across all children - return household.sum(annual_subsidy_per_child) + total = household.sum(annual_subsidy_per_child) + return np.round(total, 2) diff --git a/policyengine_canada/variables/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.py b/policyengine_canada/variables/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.py index 66e0f7886..387c3bcee 100644 --- a/policyengine_canada/variables/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.py +++ b/policyengine_canada/variables/gov/provinces/bc/benefits/child_care/bc_affordable_child_care_benefit.py @@ -75,4 +75,4 @@ def formula(household, period, parameters): # Sum across all children total_benefit = household.sum(annual_benefit_per_child) - return where(eligible, total_benefit, 0) + return np.round(where(eligible, total_benefit, 0), 2)