Repository: PolicyEngine/policyengine-canada (language: python)

Issue:
Sk Senior Supplementary amount
Reference: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1sk/td1sk-23e.pdf


Discussion / hints:

Fix patch:
diff --git a/changelog_entry.yaml b/changelog_entry.yaml
index e69de29bb..c04a1cc1d 100644
--- a/changelog_entry.yaml
+++ b/changelog_entry.yaml
@@ -0,0 +1,4 @@
+- bump: minor
+  changes:
+    added:
+    - Saskatchewan Senior Supplementary amount Tax Credit.
diff --git a/policyengine_canada/parameters/gov/provinces/sk/tax/income/credits/sk_senior_supplementary/age_threshold.yaml b/policyengine_canada/parameters/gov/provinces/sk/tax/income/credits/sk_senior_supplementary/age_threshold.yaml
new file mode 100644
index 000000000..a4e49fa75
--- /dev/null
+++ b/policyengine_canada/parameters/gov/provinces/sk/tax/income/credits/sk_senior_supplementary/age_threshold.yaml
@@ -0,0 +1,14 @@
+description: Saskatchewan provides the senior supplementary amount for filers this age or older.
+values:
+  2022-01-01: 65
+metadata:
+  unit: year
+  label: Saskatchewan senior supplementary tax credit age threshold
+  reference:
+  - title: 2023 Saskatchewan TD1SK Personal Tax Credits Return, line 3
+    href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1sk/td1sk-23e.pdf#page=1
+  - title: Saskatchewan I2-01 The Income Tax Act, 2000, Senior supplementary credit
+    href: https://pubsaskdev.blob.core.windows.net/pubsask-prod/806/I2-01.pdf#page=24
+  - title: 2022 Saskatchewan TD1SK Personal Tax Credits Return, line 3
+    href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1sk/td1sk-22e.pdf#page=1
+
diff --git a/policyengine_canada/parameters/gov/provinces/sk/tax/income/credits/sk_senior_supplementary/amount.yaml b/policyengine_canada/parameters/gov/provinces/sk/tax/income/credits/sk_senior_supplementary/amount.yaml
new file mode 100644
index 000000000..0da5ed3fc
--- /dev/null
+++ b/policyengine_canada/parameters/gov/provinces/sk/tax/income/credits/sk_senior_supplementary/amount.yaml
@@ -0,0 +1,14 @@
+description: Saskatchewan provides this senior supplementary amount.
+values:
+  2022-01-01: 1_336
+  2023-01-01: 1_421
+metadata:
+  unit: currency-CAD
+  label: Saskatchewan Senior Supplementary tax credit amount
+  reference:
+  - title: 2023 Saskatchewan TD1SK Personal Tax Credits Return, line 3
+    href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1sk/td1sk-23e.pdf#page=1
+  - title: Saskatchewan I2-01 The Income Tax Act, 2000, Senior supplementary credit
+    href: https://pubsaskdev.blob.core.windows.net/pubsask-prod/806/I2-01.pdf#page=24
+  - title: 2022 Saskatchewan TD1SK Personal Tax Credits Return, line 3
+    href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1sk/td1sk-22e.pdf#page=1
diff --git a/policyengine_canada/variables/gov/provinces/sk/tax/income/credits/sk_senior_supplementary_credit/sk_senior_supplementary_credit.py b/policyengine_canada/variables/gov/provinces/sk/tax/income/credits/sk_senior_supplementary_credit/sk_senior_supplementary_credit.py
new file mode 100644
index 000000000..3115f73dc
--- /dev/null
+++ b/policyengine_canada/variables/gov/provinces/sk/tax/income/credits/sk_senior_supplementary_credit/sk_senior_supplementary_credit.py
@@ -0,0 +1,17 @@
+from policyengine_canada.model_api import *
+
+
+class sk_senior_supplementary_credit(Variable):
+    value_type = float
+    unit = CAD
+    entity = Person
+    label = "Sasktachewan senior supplementary tax credit"
+    definition_period = YEAR
+    defined_for = "sk_senior_supplementary_credit_eligible"
+
+    def formula(person, period, parameters):
+        p = parameters(
+            period
+        ).gov.provinces.sk.tax.income.credits.sk_senior_supplementary
+        eligibility = person("sk_senior_supplementary_credit_eligible", period)
+        return eligibility * p.amount
diff --git a/policyengine_canada/variables/gov/provinces/sk/tax/income/credits/sk_senior_supplementary_credit/sk_senior_supplementary_credit_eligible.py b/policyengine_canada/variables/gov/provinces/sk/tax/income/credits/sk_senior_supplementary_credit/sk_senior_supplementary_credit_eligible.py
new file mode 100644
index 000000000..862148040
--- /dev/null
+++ b/policyengine_canada/variables/gov/provinces/sk/tax/income/credits/sk_senior_supplementary_credit/sk_senior_supplementary_credit_eligible.py
@@ -0,0 +1,16 @@
+from policyengine_canada.model_api import *
+
+
+class sk_senior_supplementary_credit_eligible(Variable):
+    value_type = bool
+    entity = Person
+    label = "Sasktachewan senior supplementary tax credit eligibility"
+    definition_period = YEAR
+    defined_for = ProvinceCode.SK
+
+    def formula(person, period, parameters):
+        p = parameters(
+            period
+        ).gov.provinces.sk.tax.income.credits.sk_senior_supplementary
+        age = person("age", period)
+        return age >= p.age_threshold


Test patch:
diff --git a/policyengine_canada/tests/gov/provinces/sk/tax/income/credits/sk_senior_supplementary/sk_senior_supplementary_credit.yaml b/policyengine_canada/tests/gov/provinces/sk/tax/income/credits/sk_senior_supplementary/sk_senior_supplementary_credit.yaml
new file mode 100644
index 000000000..bed2d1879
--- /dev/null
+++ b/policyengine_canada/tests/gov/provinces/sk/tax/income/credits/sk_senior_supplementary/sk_senior_supplementary_credit.yaml
@@ -0,0 +1,31 @@
+- name: 2024 SK senior supplementary tax credit - non eligible
+  period: 2024
+  input:
+    province_code: SK
+    sk_senior_supplementary_credit_eligible: false
+  output:
+    sk_senior_supplementary_credit: 0
+
+- name: 2023 SK senior supplementary tax credit - eligible
+  period: 2023
+  input:
+    province_code: SK
+    sk_senior_supplementary_credit_eligible: true
+  output:
+    sk_senior_supplementary_credit: 1_421
+
+- name: 2024 SK senior supplementary tax credit - eligible
+  period: 2024
+  input:
+    province_code: SK
+    sk_senior_supplementary_credit_eligible: true
+  output:
+    sk_senior_supplementary_credit: 1_421
+
+- name: 2022 SK senior supplementary tax credit - eligible
+  period: 2022
+  input:
+    province_code: SK
+    sk_senior_supplementary_credit_eligible: true
+  output:
+    sk_senior_supplementary_credit: 1_336
diff --git a/policyengine_canada/tests/gov/provinces/sk/tax/income/credits/sk_senior_supplementary/sk_senior_supplementary_eligible.yaml b/policyengine_canada/tests/gov/provinces/sk/tax/income/credits/sk_senior_supplementary/sk_senior_supplementary_eligible.yaml
new file mode 100644
index 000000000..8a5612a3c
--- /dev/null
+++ b/policyengine_canada/tests/gov/provinces/sk/tax/income/credits/sk_senior_supplementary/sk_senior_supplementary_eligible.yaml
@@ -0,0 +1,23 @@
+- name: SK senior supplementary tax credit - Under age threshold
+  period: 2024
+  input:
+    province_code: SK
+    age: 64
+  output:
+    sk_senior_supplementary_credit_eligible: false
+
+- name: SK senior supplementary tax credit - At age threshold
+  period: 2023
+  input:
+    province_code: SK
+    age: 65
+  output:
+    sk_senior_supplementary_credit_eligible: true
+
+- name: SK senior supplementary tax credit - Above age threshold
+  period: 2024
+  input:
+    province_code: SK
+    age: 68
+  output:
+    sk_senior_supplementary_credit_eligible: true