Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GST Spouse Allowance #438

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7bcbf44
initial commit
alex-rand Jan 12, 2023
5df6bd1
add gis_category template
alex-rand Jan 13, 2023
0e7d914
add is_widow.py
alex-rand Jan 14, 2023
ff38839
more eligibility categories
alex-rand Jan 16, 2023
0cdf46e
Add spouse_oas_eligible.py
alex-rand Jan 17, 2023
98b5c34
spa_eligibility_age.py and age_spouse.py
alex-rand Jan 18, 2023
e63ab6d
spa eligibility variables + tests + gis categories
alex-rand Jan 19, 2023
00b3d4a
fix the unit tests
alex-rand Feb 1, 2023
1bb6f0f
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
alex-rand Feb 3, 2023
ed3a1c9
add gis cap values
alex-rand Feb 3, 2023
33ef72f
add gis cap values
alex-rand Feb 3, 2023
5fdc417
Merge branch 'alex-rand/issue98' of https://github.com/alex-rand/poli…
alex-rand Feb 3, 2023
77a9bde
Merge branch 'alex-rand/issue98' of https://github.com/alex-rand/poli…
alex-rand Feb 3, 2023
58dfb7d
Merge branch 'alex-rand/issue98' of https://github.com/alex-rand/poli…
alex-rand Feb 4, 2023
81749fa
base amount and unit tests
alex-rand Feb 4, 2023
e161995
base amount and unit tests
alex-rand Feb 4, 2023
1a05aa8
Merge branch 'alex-rand/issue98' of https://github.com/alex-rand/poli…
alex-rand Feb 6, 2023
0575221
GIS reduction and unit tests
alex-rand Feb 12, 2023
af03957
Add the SPA amounts and reductions
alex-rand Feb 13, 2023
9ff2067
Add the SPA amounts and reductions
alex-rand Feb 13, 2023
a91bcc4
Merge branch 'alex-rand/issue98' of https://github.com/alex-rand/poli…
alex-rand Feb 14, 2023
d99197c
Merge branch 'alex-rand/issue98' of https://github.com/alex-rand/poli…
alex-rand Feb 14, 2023
c6115cb
Merge branch 'alex-rand/issue98' of https://github.com/alex-rand/poli…
alex-rand Feb 15, 2023
c22252e
Merge branch 'alex-rand/issue98' of https://github.com/alex-rand/poli…
alex-rand Feb 15, 2023
0ae0e55
Merge branch 'alex-rand/issue98' of https://github.com/alex-rand/poli…
alex-rand Feb 16, 2023
de4d21f
breakeven variables
alex-rand Feb 19, 2023
445ed44
update entities.py to include 'state'
alex-rand Feb 20, 2023
fe38e71
fix some years, add crossover variable
alex-rand Feb 21, 2023
6bc88e5
added gis-spa couples gis reduction plateau
alex-rand Feb 23, 2023
94d680a
added gis-spa couples gis reduction plateau
alex-rand Feb 23, 2023
c708393
Merge branch 'alex-rand/issue98' of https://github.com/alex-rand/poli…
alex-rand Feb 23, 2023
dc7bae1
add GIS/SPA top-up caps
alex-rand Mar 13, 2023
60f73f0
GIS top-up reduction var, params, test
alex-rand Mar 14, 2023
8dfe339
first full draft of gis/spa
alex-rand Mar 15, 2023
ef84c1b
make format
alex-rand Mar 15, 2023
f3e9f15
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
YiweiJ Aug 29, 2023
4915770
Add changelog
YiweiJ Aug 29, 2023
66dffc1
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
YiweiJ Sep 5, 2023
3e25fa2
Resolve previous comments
YiweiJ Sep 6, 2023
050152e
Resoslved Conversations and Revise Tests Files
YiweiJ Sep 14, 2023
78f5ae5
Resolved Conversations and Renamed Tests Files
YiweiJ Sep 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: minor
changes:
added:
- Guaranteed income supplement spouse allowance.
16 changes: 15 additions & 1 deletion policyengine_canada/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@

from policyengine_core.entities import build_entity

State = build_entity(
key="state",
plural="states",
label="State",
roles=[
{
"key": "member",
"plural": "members",
"label": "Member",
"doc": "A person who is a citizen of a country.",
}
],
)

Household = build_entity(
key="household",
plural="households",
Expand All @@ -32,4 +46,4 @@
)


entities = [Household, Person]
entities = [Household, Person, State]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
description: Guaranteed Income Supplement maximum benefit for single OAS pensioners or married pensioners whose spouse does not qualify for OAS or SPA. Corresponds to categories SINGLE_WITH_OAS or COUPLE_ONE_OAS_SPA_INELIGIBLE
values:
2021-01-01: 9_449.87
metadata:
period: year
label: GIS Cap for Single Pensioners and Married Pensioners whose spouse doesn't qualify for GIS or SPA
documentataion: Corresponds to BGISS in the SPSD/M Variable Guide
reference:
- title: SPSD/M Variable Guide

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
description: Guaranteed Income Supplement maximum rate in dollars for each OAS pensioner in a married couple. Corresponds to COUPLE_BOTH_OAS or COUPLE_ONE_OAS_SPA_ELIGIBLE
values:
2021-01-01: 6_240.18
metadata:
period: year
label: GIS Cap for pensioners married to a pensioner.
documentataion: Corresponds to BGISM in the SPSD/M Variable Guide
reference:
- title: SPSD/M Variable Guide

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
description: Percentage of income exempt from inclusion in calculating the GIS reduction.
brackets:
- threshold:
2021-01-01: 0
rate:
2021-01-01: 1
- threshold:
2021-01-01: 5_000 # GISEMPEXM
rate:
2021-01-01: 0.5 # GISPEMPEXP
- threshold:
2021-01-01: 15_000 # GISPEMPEXM + GISEMPEXM
rate:
2021-01-01: 0
metadata:
type: marginal_rate
rate_unit: /1
threshold_unit: currency-CAD
period: year
documentation: Corresponds to GISEMPEXP and GISEMPEXM
label: Percentage of income exempt from inclusion in calculating the GIS reduction.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
description: GIS reduction rate for the 'plateau' range for a GIS recipient married to a SPA recipient.
values:
2021-01-01: 0
metadata:
period: year
label: GIS reduction rate for the 'plateau' range for a GIS recipient married to a SPA recipient.
documentataion: Corresponds to GISRRM and GISRLM in the SPSD/M Variable Guide
reference:
- title: SPSD/M Variable Guide

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
description: Guaranteed Income Supplement reduction for single OAS pensioners or married pensioners whose spouse does not qualify for OAS or SPA. Corresponds to categories SINGLE_WITH_OAS or COUPLE_ONE_OAS_SPA_INELIGIBLE. Corresponds to GISRRS in the SPSD/M Variable Guide
brackets:
- threshold:
2021-01-01: 0
rate:
2021-01-01: 0
- threshold:
2021-01-01: 24
rate:
2021-01-01: 0.5
metadata:
type: marginal_rate
rate_unit: /1
threshold_unit: currency-CAD
period: year
documentation: Corresponds to GISRRS and GISRLS
label: GIS reduction for Single Pensioners and Married Pensioners whose spouse doesn't qualify for GIS or SPA
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
description: Reduction threshold and rate for pensioners married to pensioners. Applies to COUPLE_BOTH_OAS. Note that this calculates on couples combined income, whereas the other GIS cateogires calculate on the lone pensioner's income. Correponds to GISRRM in the SPSD/M.
brackets:
- threshold:
2021-01-01: 0
rate:
2021-01-01: 0
- threshold:
2021-01-01: 48
rate:
2021-01-01: 0.25
metadata:
period: year
label: GIS reduction for pensioners married to a pensioner.
documentataion: Corresponds to GISRRM and GISRLM in the SPSD/M Variable Guide
reference:
- title: SPSD/M Variable Guide

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
description: Maximum amount of the 'GIS-portion' of the SPA. By default equal to the GIS family amount.
values:
1999-12-31: 6_240.18
metadata:
period: year
label: Maximum amount of the GIS-portion of the SPA.
reference:
- title: SPSD/M Variable Guide

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
description: Maximum amount of the 'OAS-portion' of the SPA. By default equal to the OAS maximum amount.
values:
1999-12-31: 8_226
metadata:
period: year
label: Maximum amount of the OAS-portion of the SPA.
reference:
- title: SPSD/M Variable Guide

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
description: Canada reduces the GIS portion of the SPA at this rate.
values:
1999-12-31: 0.25
metadata:
period: year
label: Reduction rate for the GIS portion of the SPA.
reference:
- title: SPSD/M Algorithm Guide

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
description: Reduction rate for the OAS portion of the SPA. See SPARL in the SPSD/M Parameter Guide.
brackets:
- threshold:
2021-01-01: 0
rate:
2021-01-01: 0
- threshold:
2021-01-01: 48
rate:
2021-01-01: 0.75
metadata:
type: marginal_rate
rate_unit: /1
threshold_unit: currency-CAD
period: year
label: Reduction rate for the OAS portion of the SPA.
reference:
- title: SPSD/M Algorithm Guide

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
description: Number of years of canadian residency since the age of 18 required to recieve the Spousal Allowance
values:
2020-01-01: 10
metadata:
label: SPA Residency Requirement
reference:
- title: Government of Canada - Spousal Allowance
href: https://www.canada.ca/en/services/benefits/publicpensions/cpp/old-age-security/guaranteed-income-supplement/allowance/eligibility.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
description: Age at which the spouse of an OAS pensioner becomes eligible for the SPA
values:
2020-01-01: 60
metadata:
label: SPA Spouse Eligibility Age
reference:
- title: Government of Canada - Guaranteed Income Supplement
href: https://www.canada.ca/en/services/benefits/publicpensions/cpp/old-age-security/guaranteed-income-supplement/allowance-survivor.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
description: Age at which a widow becomes eligible for the SPA
values:
2020-01-01: 60
metadata:
label: SPA Widow Eligibility Age
reference:
- title: Government of Canada - Guaranteed Income Supplement
href: https://www.canada.ca/en/services/benefits/publicpensions/cpp/old-age-security/guaranteed-income-supplement/allowance-survivor.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
description: Guaranteed Income Supplement maximum top-up for married recipients of GIS or SPA. Corresponds to categories SINGLE_WITH_OAS or WIDOW_SPA_ELIGIBLE
values:
2021-01-01: 490.98
metadata:
period: year
label: GIS Top-up Cap for Married GIS or SPA Recipients
documentataion: Corresponds to GISTOPMAR in the SPSD/M Variable Guide
reference:
- title: SPSD/M Variable Guide

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: Guaranteed Income Supplement maximum top-up for single recipients of GIS or SPA. Corresponds to categories SINGLE_WITH_OAS or WIDOW_SPA_ELIGIBLE
values:
2021-01-01: 856.32
2021-07-01: 875.70
metadata:
period: year
label: GIS Top-up Cap for Single GIS or SPA Recipients
documentataion: Corresponds to GISTOPSNG1 and GISTOPSNG2 in the SPSD/M Variable Guide
reference:
- title: SPSD/M Variable Guide

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
description: Guaranteed Income Supplement Top-up turnaround point for categories SINGLE_WITH_OAS or WIDOW_SPA_ELIGIBLE
brackets:
- threshold:
2021-01-01: 0
rate:
2021-01-01: 0
- threshold:
2021-01-01: 4000
rate:
2021-01-01: 0.125
metadata:
period: year
label: GIS Top-up Income Exemption for Single GIS or SPA Recipients
documentataion: Corresponds to GISTOPMINGIS and GISTOPMRRGIS in the SPSD/M Variable Guide
reference:
- title: SPSD/M Variable Guide

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
description: Guaranteed Income Supplement Top-up turnaround point for categories SINGLE_WITH_OAS or WIDOW_SPA_ELIGIBLE
brackets:
- threshold:
2021-01-01: 0
rate:
2021-01-01: 0
- threshold:
2021-01-01: 2000
rate:
2021-01-01: 0.25
metadata:
period: year
label: GIS Top-up Income Exemption for Single GIS or SPA Recipients
documentataion: Corresponds to GISTOPSINGIS and GISTOPSRRGIS in the SPSD/M Variable Guide
reference:
- title: SPSD/M Variable Guide

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- name: Fixed Value for Breakeven SPA-Eligible
period: 2023
absolute_error_margin: 0.01
output:
breakeven_spa_eligible: 35_976.72
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- name: Fixed Value of Breakeven SPA-Ineligible
period: 2023
absolute_error_margin: 0.01
output:
breakeven_spa_ineligible: 46_025.98
48 changes: 48 additions & 0 deletions policyengine_canada/tests/gov/cra/benefits/gis_spa/gis_cap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
- name: Single Pensioner
period: 2022
input:
gis_spa_category: SINGLE_WITH_OAS
oas_eligible: true
output:
gis_cap: 9_449.87

- name: Widow
period: 2022
input:
gis_spa_category: WIDOW_SPA_ELIGIBLE
output:
gis_cap: 0

- name: OAS pensioner whose spouse is SPA eligible
period: 2022
input:
gis_spa_category: COUPLE_ONE_OAS_SPA_ELIGIBLE
oas_eligible: true
output:
gis_cap: 6_240.18

- name: OAS pensioner whose spouse is not SPA eligible
period: 2022
input:
gis_spa_category: COUPLE_ONE_OAS_SPA_INELIGIBLE
oas_eligible: true
output:
gis_cap: 9_449.87

- name: SPA-eligible person whose spouse has OAS
period: 2022
input:
gis_spa_category: COUPLE_ONE_OAS_SPA_ELIGIBLE
oas_eligible: false
output:
gis_cap: 0

- name: Person not eligible for OAS or SPA, but is married to an OAS pensioner
period: 2022
input:
gis_spa_category: COUPLE_ONE_OAS_SPA_INELIGIBLE
oas_eligible: false
output:
gis_cap: 0


Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
- name: Basic
period: 2023
input:
employment_income: 20_000
self_employment_income: 5_000
output:
gis_exemption: 10_000

- name: GIS Exemption with middle threshold
period: 2023
input:
employment_income: 15_000
self_employment_income: 5_000
output:
gis_exemption: 7_500

- name: GIS Exemption with lowest threshold
period: 2023
input:
employment_income: 10_000
self_employment_income: 5_000
output:
gis_exemption: 5_000

- name: GIS Exemption with highest threshold
period: 2023
input:
employment_income: 20_000
self_employment_income: 0
output:
gis_exemption: 10_000
16 changes: 16 additions & 0 deletions policyengine_canada/tests/gov/cra/benefits/gis_spa/gis_income.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- name: Basic
period: 2023
input:
employment_income: 20_000
self_employment_income: 5_000
gis_exemption: 5_000
output:
gis_income: 10_000

- name: Gis Income is 0
period: 2023
input:
employment_income: 1_000
self_employment_income: 5_000
output:
gis_income: 0
15 changes: 15 additions & 0 deletions policyengine_canada/tests/gov/cra/benefits/gis_spa/gis_net.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- name: Basic reduction
period: 2023
input:
gis_cap: 500
gis_reduction: 200
output:
gis_net: 300

- name: Negative reduction
period: 2023
input:
gis_cap: 300
gis_reduction: 500
output:
gis_net: 0
Loading