-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from DTS-STN/Task-22-StudentLoan
Task 22 student loan & mortgage deferral
- Loading branch information
Showing
4 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
openfisca_canada/tests/mortgage_deferral/mortgage_deferral.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
- name: "Mortgage Deferral elegible" | ||
period: 2020-08 | ||
absolute_error_margin: 0 | ||
input: | ||
persons: | ||
mortgage_deferral: | ||
mortgage_deferral__has_mortgage_payments: true | ||
output: | ||
mortgage_deferral__is_eligible: true | ||
|
||
- name: "Mortgage not an issue" | ||
period: 2020-08 | ||
absolute_error_margin: 0 | ||
input: | ||
persons: | ||
mortgage_deferral: | ||
mortgage_deferral__has_mortgage_payments: false | ||
output: | ||
mortgage_deferral__is_eligible: false | ||
|
||
- name: "Mortagage tests by Name" | ||
period: 2018-08 | ||
absolute_error_margin: 0 | ||
input: | ||
persons: | ||
Sandra: | ||
mortgage_deferral__has_mortgage_payments: false | ||
Anne: | ||
mortgage_deferral__has_mortgage_payments: true | ||
output: | ||
mortgage_deferral__is_eligible: | ||
- false | ||
- true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
- name: "Student Loan Deferral elegible" | ||
period: 2020-08 | ||
absolute_error_margin: 0 | ||
input: | ||
persons: | ||
student_loan: | ||
student_loan__has_student_debt: true | ||
output: | ||
student_loan__is_eligible: true | ||
|
||
- name: "Student not in debt" | ||
period: 2020-08 | ||
absolute_error_margin: 0 | ||
input: | ||
persons: | ||
student_loan: | ||
student_loan__has_student_debt: false | ||
output: | ||
student_loan__is_eligible: false | ||
|
||
- name: "Student by Name" | ||
period: 2018-08 | ||
absolute_error_margin: 0 | ||
input: | ||
persons: | ||
Angelina: | ||
student_loan__has_student_debt: false | ||
Jennifer: | ||
student_loan__has_student_debt: true | ||
output: | ||
student_loan__is_eligible: | ||
- false | ||
- true |
22 changes: 22 additions & 0 deletions
22
openfisca_canada/variables/benefitfinder/mortgage_deferral/mortgage_payments.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from openfisca_core.model_api import * | ||
from openfisca_canada.entities import Person | ||
|
||
|
||
class mortgage_deferral__is_eligible(Variable): | ||
value_type = bool | ||
entity = Person | ||
definition_period = MONTH | ||
default_value = False | ||
label = u"Mortgage worries, talk to your bank to get 6 months deferral" | ||
reference = u"to be linked" | ||
|
||
def formula(persons, period, parameters): | ||
return persons("mortgage_deferral__has_mortgage_payments",period) | ||
|
||
class mortgage_deferral__has_mortgage_payments(Variable): | ||
value_type = bool | ||
entity = Person | ||
definition_period = MONTH | ||
default_value = False | ||
label = u"Mortgage worries, person is paying a mortgage" | ||
reference = u"to be linked" |
22 changes: 22 additions & 0 deletions
22
openfisca_canada/variables/benefitfinder/student_loan/student_loan.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from openfisca_core.model_api import * | ||
from openfisca_canada.entities import Person | ||
|
||
|
||
class student_loan__is_eligible(Variable): | ||
value_type = bool | ||
entity = Person | ||
definition_period = MONTH | ||
default_value = False | ||
label = u"Students is eligible for a 6 months deferral" | ||
reference = u"to be linked" | ||
|
||
def formula(persons, period, parameters): | ||
return persons("student_loan__has_student_debt",period) | ||
|
||
class student_loan__has_student_debt(Variable): | ||
value_type = bool | ||
entity = Person | ||
definition_period = MONTH | ||
default_value = False | ||
label = u"Person is paying an student loan" | ||
reference = u"to be linked" |