From fd351c0bef9608d8f1353f17fbf9a2c4d3ffcd22 Mon Sep 17 00:00:00 2001 From: ariannedee Date: Mon, 5 Oct 2020 12:49:34 -0700 Subject: [PATCH 1/4] DIV-1170: Update requirements for when questions should be hidden --- edivorce/apps/core/utils/conditional_logic.py | 54 ++++- edivorce/apps/core/utils/derived.py | 3 +- edivorce/fixtures/Question.json | 200 +++++++++++------- 3 files changed, 170 insertions(+), 87 deletions(-) diff --git a/edivorce/apps/core/utils/conditional_logic.py b/edivorce/apps/core/utils/conditional_logic.py index 94a1d373..c01009a7 100644 --- a/edivorce/apps/core/utils/conditional_logic.py +++ b/edivorce/apps/core/utils/conditional_logic.py @@ -1,7 +1,24 @@ +import functools import json import re +def no_children(return_val): + def decorator_no_children(func): + @functools.wraps(func) + def inner(questions_dict, *args, **kwargs): + if questions_dict.get('children_of_marriage', '') != 'YES': + return return_val + return func(questions_dict, *args, **kwargs) + return inner + return decorator_no_children + + +def determine_has_children_of_marriage(questions_dict): + return questions_dict.get('children_of_marriage', '') == 'YES' + + +@no_children([]) def get_children(questions_dict): children_json = questions_dict.get('claimant_children', '[]') if isinstance(children_json, dict): @@ -9,25 +26,32 @@ def get_children(questions_dict): return json.loads(children_json) +@no_children('0') def get_num_children_living_with(questions_dict, living_arrangement): assert living_arrangement in ['Lives with you', 'Lives with spouse', 'Lives with both'] children = get_children(questions_dict) return str(len([child for child in children if child['child_live_with'] == living_arrangement])) +@no_children(False) def determine_sole_custody(questions_dict): + """ Return True if all children live with one parent """ child_list = get_children(questions_dict) return (all([child['child_live_with'] == 'Lives with you' for child in child_list]) or all([child['child_live_with'] == 'Lives with spouse' for child in child_list])) +@no_children(False) def determine_shared_custody(questions_dict): + """ Return True if any children live with both parents """ child_list = get_children(questions_dict) return any([child['child_live_with'] == 'Lives with both' for child in child_list]) +@no_children(False) def determine_split_custody(questions_dict): + """ Return True if at least one child lives with one parent and at least one lives with the other (or both) """ child_list = get_children(questions_dict) with_you = 0 with_spouse = 0 @@ -43,14 +67,15 @@ def determine_split_custody(questions_dict): with_spouse > 0 and (with_you + with_both > 0)) +@no_children(False) def determine_child_over_19_supported(questions_dict): - has_children_of_marriage = questions_dict.get('children_of_marriage', '') == 'YES' has_children_over_19 = questions_dict.get('has_children_over_19', '') == 'YES' support = json.loads(questions_dict.get('children_financial_support', '[]')) supporting_children = len(support) > 0 and 'NO' not in support - return has_children_of_marriage and has_children_over_19 and supporting_children + return has_children_over_19 and supporting_children +@no_children(False) def determine_missing_undue_hardship_reasons(questions_dict): claiming_undue_hardship = questions_dict.get('claiming_undue_hardship', '') == 'YES' if claiming_undue_hardship: @@ -73,6 +98,7 @@ def determine_missing_undue_hardship_reasons(questions_dict): return False +@no_children('') def determine_child_support_payor(questions_dict): payor = questions_dict.get('child_support_payor', '') if payor == 'Myself (Claimant 1)': @@ -84,6 +110,7 @@ def determine_child_support_payor(questions_dict): return '' +@no_children(False) def determine_show_fact_sheet_f_you(questions_dict): """ If claimant 1 (you) is a payor and makes over $150,000/year, show fact sheet F for claimant 1 @@ -96,6 +123,7 @@ def determine_show_fact_sheet_f_you(questions_dict): return (payor == 'Claimant 1' or payor == 'both Claimant 1 and Claimant 2') and annual > 150000 +@no_children(False) def determine_show_fact_sheet_f_spouse(questions_dict): """ If claimant 2 (spouse) is a payor and makes over $150,000/year, show fact sheet F for claimant 2 @@ -110,11 +138,13 @@ def determine_show_fact_sheet_f_spouse(questions_dict): return (payor == 'Claimant 2' or payor == 'both Claimant 1 and Claimant 2') and annual > 150000 +@no_children(False) def determine_child_support_act_requirement(questions_dict): orders_wanted = json.loads(questions_dict.get('want_which_orders', '[]')) return 'Child support' in orders_wanted +@no_children(False) def determine_missing_extraordinary_expenses(questions_dict): special_expenses_keys = ["child_care_expenses", "children_healthcare_premiums", @@ -137,11 +167,27 @@ def determine_missing_extraordinary_expenses(questions_dict): return False +@no_children(False) def determine_show_children_live_with_others(questions_dict): - has_children_of_marriage = questions_dict.get('children_of_marriage', '') == 'YES' has_children_under_19 = questions_dict.get('has_children_under_19', '') == 'YES' child_over_19_supported = determine_child_over_19_supported(questions_dict) - return has_children_of_marriage and (has_children_under_19 or child_over_19_supported) + return has_children_under_19 or child_over_19_supported + + +def orders_wanted(questions_dict): + return json.loads(questions_dict.get('want_which_orders', '[]')) + + +def determine_spousal_support_orders_wanted(questions_dict): + return 'Spousal support' in orders_wanted(questions_dict) + + +def determine_property_debt_orders_wanted(questions_dict): + return 'Division of property and debts' in orders_wanted(questions_dict) + + +def determine_other_orders_wanted(questions_dict): + return 'Other orders' in orders_wanted(questions_dict) def get_cleaned_response_value(response): diff --git a/edivorce/apps/core/utils/derived.py b/edivorce/apps/core/utils/derived.py index 2bd720f4..b8a1907e 100644 --- a/edivorce/apps/core/utils/derived.py +++ b/edivorce/apps/core/utils/derived.py @@ -106,8 +106,7 @@ def get_derived_data(responses): def orders_wanted(responses, derived): """ Return a list of orders the user has indicated """ - - return json.loads(responses.get('want_which_orders', '[]')) + return conditional_logic.orders_wanted(responses) def children(responses, derived): diff --git a/edivorce/fixtures/Question.json b/edivorce/fixtures/Question.json index fd29115c..0134835a 100644 --- a/edivorce/fixtures/Question.json +++ b/edivorce/fixtures/Question.json @@ -492,7 +492,9 @@ "name": "You and your spouse are asking for an order for spousal support as follows", "description": "For step 6, Form 1 5. Spousal support", "summary_order": 47, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_spousal_support_orders_wanted", + "reveal_response": "True" }, "model": "core.question", "pk": "spouse_support_details" @@ -502,7 +504,9 @@ "name": "Please indicate which act you are asking for support under.", "description": "For step 6, Form 1 5. Spousal support", "summary_order": 48, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_spousal_support_orders_wanted", + "reveal_response": "True" }, "model": "core.question", "pk": "spouse_support_act" @@ -512,7 +516,9 @@ "name": "Your children", "description": "For Step 6, Your children - Children details", "summary_order": 49, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_has_children_of_marriage", + "reveal_response": "True" }, "model": "core.question", "pk": "claimant_children" @@ -522,7 +528,9 @@ "name": "How will you and your spouse be determining your income?", "description": "For Step 6, Your children - Income & expenses", "summary_order": 50, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_has_children_of_marriage", + "reveal_response": "True" }, "model": "core.question", "pk": "how_will_calculate_income" @@ -532,7 +540,9 @@ "name": "What is your annual gross income as determined above?", "description": "For Step 6, Your children - Income & expenses", "summary_order": 51, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_has_children_of_marriage", + "reveal_response": "True" }, "model": "core.question", "pk": "annual_gross_income" @@ -542,7 +552,9 @@ "name": "What is your spouse's annual gross income as determined above?", "description": "For Step 6, Your children - Income & expenses", "summary_order": 52, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_has_children_of_marriage", + "reveal_response": "True" }, "model": "core.question", "pk": "spouse_annual_gross_income" @@ -564,7 +576,9 @@ "name": "Are you claiming any special and extraordinary expenses?", "description": "For Step 6, Your children - Income & expenses", "summary_order": 54, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_has_children_of_marriage", + "reveal_response": "True" }, "model": "core.question", "pk": "special_extraordinary_expenses" @@ -778,7 +792,9 @@ "name": "Who is the payor?", "description": "For Step 6, Your children - Payor & fact sheets", "summary_order": 74, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_has_children_of_marriage", + "reveal_response": "True" }, "model": "core.question", "pk": "child_support_payor" @@ -938,7 +954,9 @@ "name": "Are you or your spouse claiming undue hardship?", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet E - Undue hardship", "summary_order": 88, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_has_children_of_marriage", + "reveal_response": "True" }, "model": "core.question", "pk": "claiming_undue_hardship" @@ -1210,7 +1228,9 @@ "name": "Is medical coverage available for the children?", "description": "For Step 6, Your children - Payor & medical expenses", "summary_order": 112, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_has_children_of_marriage", + "reveal_response": "True" }, "model": "core.question", "pk": "medical_coverage_available" @@ -1232,7 +1252,9 @@ "name": "Are there any child support payments (in arrears) that have not been paid (as of today's date) under an existing order or written agreement?", "description": "For Step 6, Your children - Payor & medical expenses", "summary_order": 114, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_has_children_of_marriage", + "reveal_response": "True" }, "model": "core.question", "pk": "child_support_payments_in_arrears" @@ -1254,7 +1276,9 @@ "name": "What is the monthly child support amount proposed in the order to be paid by", "description": "For Step 6, Your children - What are you asking for", "summary_order": 116, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_has_children_of_marriage", + "reveal_response": "True" }, "model": "core.question", "pk": "child_support_in_order" @@ -1312,7 +1336,9 @@ "name": "Do you have a separation agreement that sets out what you've agreed to around parenting and child support?", "description": "For Step 6, Your children - What are you asking for", "summary_order": 121, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_has_children_of_marriage", + "reveal_response": "True" }, "model": "core.question", "pk": "have_separation_agreement" @@ -1322,7 +1348,9 @@ "name": "Do you have an order about support of the children?", "description": "For Step 6, Your children - What are you asking for", "summary_order": 122, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_has_children_of_marriage", + "reveal_response": "YES" }, "model": "core.question", "pk": "have_court_order" @@ -1332,7 +1360,9 @@ "name": "The court needs to know what the current parenting arrangements are for the children of the marriage. Please describe below.", "description": "For Step 6, Your children - What are you asking for", "summary_order": 123, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_has_children_of_marriage", + "reveal_response": "True" }, "model": "core.question", "pk": "what_parenting_arrangements" @@ -1342,7 +1372,9 @@ "name": "Are you asking the court for an order about parenting arrangements or contact with a child?", "description": "For Step 6, Your children - What are you asking for", "summary_order": 124, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_has_children_of_marriage", + "reveal_response": "True" }, "model": "core.question", "pk": "want_parenting_arrangements" @@ -1388,7 +1420,9 @@ "name": "How have you and your spouse agreed to deal with your property and debt?", "description": "For step 7, Form 1 6. Property and debt", "summary_order": 128, - "required": "Required" + "required": "Conditional", + "conditional_target": "determine_property_debt_orders_wanted", + "reveal_response": "True" }, "model": "core.question", "pk": "deal_with_property_debt" @@ -1415,11 +1449,59 @@ "model": "core.question", "pk": "other_property_claims" }, +{ + "fields": { + "name": "Are you asking for a name change?", + "description": "For Step 10, Forms 38 and 52's Orders sections", + "summary_order": 131, + "required": "Conditional", + "conditional_target": "determine_other_orders_wanted", + "reveal_response": "True" + }, + "model": "core.question", + "pk": "name_change_you" +}, +{ + "fields": { + "name": "Please enter the full name", + "description": "For Step 10, Forms 38 and 52's Orders sections", + "summary_order": 132, + "required": "Conditional", + "conditional_target": "name_change_you", + "reveal_response": "YES" + }, + "model": "core.question", + "pk": "name_change_you_fullname" +}, +{ + "fields": { + "name": "Is your spouse asking for a name change?", + "description": "For Step 10, Forms 38 and 52's Orders sections", + "summary_order": 133, + "required": "Conditional", + "conditional_target": "determine_other_orders_wanted", + "reveal_response": "True" + }, + "model": "core.question", + "pk": "name_change_spouse" +}, +{ + "fields": { + "name": "Please enter the full name", + "description": "For Step 10, Forms 38 and 52's Orders sections", + "summary_order": 134, + "required": "Conditional", + "conditional_target": "name_change_spouse", + "reveal_response": "YES" + }, + "model": "core.question", + "pk": "name_change_spouse_fullname" +}, { "fields": { "name": "Please enter the details for any other orders that you are asking for.", "description": "For step 8 other orders, Form 1 7. Other", - "summary_order": 131, + "summary_order": 135, "required": "" }, "model": "core.question", @@ -1429,7 +1511,7 @@ "fields": { "name": "What is the best address to send you official court documents?", "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", - "summary_order": 132, + "summary_order": 136, "required": "Required" }, "model": "core.question", @@ -1439,7 +1521,7 @@ "fields": { "name": "City", "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", - "summary_order": 133, + "summary_order": 137, "required": "Required" }, "model": "core.question", @@ -1449,7 +1531,7 @@ "fields": { "name": "Prov", "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", - "summary_order": 134, + "summary_order": 138, "required": "" }, "model": "core.question", @@ -1459,7 +1541,7 @@ "fields": { "name": "Country", "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", - "summary_order": 135, + "summary_order": 139, "required": "Required" }, "model": "core.question", @@ -1469,7 +1551,7 @@ "fields": { "name": "Other Country", "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", - "summary_order": 136, + "summary_order": 140, "required": "Conditional", "conditional_target": "address_to_send_official_document_country_you", "reveal_response": "Other" @@ -1481,7 +1563,7 @@ "fields": { "name": "Postal code", "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", - "summary_order": 137, + "summary_order": 141, "required": "" }, "model": "core.question", @@ -1491,7 +1573,7 @@ "fields": { "name": "Fax number", "description": "For step 9, Form 1 8. Claimants' addresses for service", - "summary_order": 138, + "summary_order": 142, "required": "" }, "model": "core.question", @@ -1501,7 +1583,7 @@ "fields": { "name": "Email", "description": "For step 9, Form 1 8. Claimants' addresses for service", - "summary_order": 139, + "summary_order": 143, "required": "" }, "model": "core.question", @@ -1511,7 +1593,7 @@ "fields": { "name": "What is the best address to send your spouse official court documents?", "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", - "summary_order": 140, + "summary_order": 144, "required": "Required" }, "model": "core.question", @@ -1521,7 +1603,7 @@ "fields": { "name": "City", "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", - "summary_order": 141, + "summary_order": 145, "required": "Required" }, "model": "core.question", @@ -1531,7 +1613,7 @@ "fields": { "name": "Prov", "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", - "summary_order": 142, + "summary_order": 146, "required": "" }, "model": "core.question", @@ -1541,7 +1623,7 @@ "fields": { "name": "Country", "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", - "summary_order": 143, + "summary_order": 147, "required": "Required" }, "model": "core.question", @@ -1551,7 +1633,7 @@ "fields": { "name": "Other Country", "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", - "summary_order": 144, + "summary_order": 148, "required": "Conditional", "conditional_target": "address_to_send_official_document_country_spouse", "reveal_response": "Other" @@ -1563,7 +1645,7 @@ "fields": { "name": "Postal code", "description": "For step 9, Form 1 8. Claimants' addresses for service", - "summary_order": 145, + "summary_order": 149, "required": "" }, "model": "core.question", @@ -1573,7 +1655,7 @@ "fields": { "name": "Fax number", "description": "For step 9, Form 1 8. Claimants' addresses for service", - "summary_order": 146, + "summary_order": 150, "required": "" }, "model": "core.question", @@ -1583,7 +1665,7 @@ "fields": { "name": "Email", "description": "For step 9, Form 1 8. Claimants' addresses for service", - "summary_order": 147, + "summary_order": 151, "required": "" }, "model": "core.question", @@ -1593,7 +1675,7 @@ "fields": { "name": "Divorce is to take effect on", "description": "For step 9, Form 52 This Court Orders that", - "summary_order": 148, + "summary_order": 152, "required": "Required" }, "model": "core.question", @@ -1603,7 +1685,7 @@ "fields": { "name": "Divorce is to take effect on specific date", "description": "For step 9 - specific date, Form 52 This Court Orders that", - "summary_order": 149, + "summary_order": 153, "required": "Conditional", "conditional_target": "divorce_take_effect_on", "reveal_response": "specific date" @@ -1615,56 +1697,12 @@ "fields": { "name": "Where will you be filing for divorce?", "description": "For step 10, Form 1 court registry, Form 35 court registry, Form 36 court registry, Form 38(joint and sole) court registry, Form 52 court registry", - "summary_order": 150, + "summary_order": 154, "required": "Required" }, "model": "core.question", "pk": "court_registry_for_filing" }, -{ - "fields": { - "name": "Are you asking for a name change?", - "description": "For Step 10, Forms 38 and 52's Orders sections", - "summary_order": 151, - "required": "Required" - }, - "model": "core.question", - "pk": "name_change_you" -}, -{ - "fields": { - "name": "Please enter the full name", - "description": "For Step 10, Forms 38 and 52's Orders sections", - "summary_order": 152, - "required": "Conditional", - "conditional_target": "name_change_you", - "reveal_response": "YES" - }, - "model": "core.question", - "pk": "name_change_you_fullname" -}, -{ - "fields": { - "name": "Is your spouse asking for a name change?", - "description": "For Step 10, Forms 38 and 52's Orders sections", - "summary_order": 153, - "required": "Required" - }, - "model": "core.question", - "pk": "name_change_spouse" -}, -{ - "fields": { - "name": "Please enter the full name", - "description": "For Step 10, Forms 38 and 52's Orders sections", - "summary_order": 154, - "required": "Conditional", - "conditional_target": "name_change_spouse", - "reveal_response": "YES" - }, - "model": "core.question", - "pk": "name_change_spouse_fullname" -}, { "fields": { "name": "Select how you would like to swear/affirm your affidavit(s)?", From bd3be0388fb7995a94cff7045f1a99d52466185a Mon Sep 17 00:00:00 2001 From: ariannedee Date: Mon, 5 Oct 2020 12:49:57 -0700 Subject: [PATCH 2/4] DIV-1170: Update tests. Refactor status strings. --- edivorce/apps/core/tests/test_logic.py | 57 +++++++---- .../apps/core/tests/test_step_completeness.py | 95 +++++++++++++++---- edivorce/apps/core/utils/step_completeness.py | 24 ++++- 3 files changed, 137 insertions(+), 39 deletions(-) diff --git a/edivorce/apps/core/tests/test_logic.py b/edivorce/apps/core/tests/test_logic.py index 94dc2b37..ef05a79b 100644 --- a/edivorce/apps/core/tests/test_logic.py +++ b/edivorce/apps/core/tests/test_logic.py @@ -3,7 +3,7 @@ import json from django.test import TestCase from edivorce.apps.core.models import BceidUser, UserResponse -from edivorce.apps.core.utils.conditional_logic import get_cleaned_response_value, get_num_children_living_with +from edivorce.apps.core.utils import conditional_logic as logic from edivorce.apps.core.utils.user_response import get_data_for_user from edivorce.apps.core.models import Document @@ -27,31 +27,54 @@ class ConditionalLogicTestCase(TestCase): return get_data_for_user(self.user) def test_get_cleaned_response_no_value(self): - self.assertIsNone(get_cleaned_response_value(None)) - self.assertIsNone(get_cleaned_response_value('')) - self.assertIsNone(get_cleaned_response_value(' ')) - self.assertIsNone(get_cleaned_response_value('[]')) - self.assertIsNone(get_cleaned_response_value('[[""," "]]')) - self.assertIsNone(get_cleaned_response_value('[["also known as",""]]')) - self.assertIsNone(get_cleaned_response_value('[["also known as",""],["also known as",""]]')) + self.assertIsNone(logic.get_cleaned_response_value(None)) + self.assertIsNone(logic.get_cleaned_response_value('')) + self.assertIsNone(logic.get_cleaned_response_value(' ')) + self.assertIsNone(logic.get_cleaned_response_value('[]')) + self.assertIsNone(logic.get_cleaned_response_value('[[""," "]]')) + self.assertIsNone(logic.get_cleaned_response_value('[["also known as",""]]')) + self.assertIsNone(logic.get_cleaned_response_value('[["also known as",""],["also known as",""]]')) def test_get_cleaned_response_with_value(self): - self.assertIsNotNone(get_cleaned_response_value('0')) - self.assertIsNotNone(get_cleaned_response_value('["hi"]')) - self.assertIsNotNone(get_cleaned_response_value('[["also known as","a"]]')) + self.assertIsNotNone(logic.get_cleaned_response_value('0')) + self.assertIsNotNone(logic.get_cleaned_response_value('["hi"]')) + self.assertIsNotNone(logic.get_cleaned_response_value('[["also known as","a"]]')) def test_num_children(self): - self.assertEqual(get_num_children_living_with(self.questions_dict, 'Lives with you'), '0') - self.assertEqual(get_num_children_living_with(self.questions_dict, 'Lives with spouse'), '0') - self.assertEqual(get_num_children_living_with(self.questions_dict, 'Lives with both'), '0') + # No children + self.assertEqual(logic.get_num_children_living_with(self.questions_dict, 'Lives with you'), '0') + self.assertEqual(logic.get_num_children_living_with(self.questions_dict, 'Lives with spouse'), '0') + self.assertEqual(logic.get_num_children_living_with(self.questions_dict, 'Lives with both'), '0') children = [self.child_live_with_you, self.child_live_with_spouse, self.child_live_with_spouse, self.child_live_with_both, self.child_live_with_both, self.child_live_with_both] self.create_response('claimant_children', json.dumps(children)) - self.assertEqual(get_num_children_living_with(self.questions_dict, 'Lives with you'), '1') - self.assertEqual(get_num_children_living_with(self.questions_dict, 'Lives with spouse'), '2') - self.assertEqual(get_num_children_living_with(self.questions_dict, 'Lives with both'), '3') + # Has children, but marked no children of marriage in prequal + self.assertEqual(logic.get_num_children_living_with(self.questions_dict, 'Lives with you'), '0') + self.assertEqual(logic.get_num_children_living_with(self.questions_dict, 'Lives with spouse'), '0') + self.assertEqual(logic.get_num_children_living_with(self.questions_dict, 'Lives with both'), '0') + + # Has children, and marked YES to children of marriage in prequal + self.create_response('children_of_marriage', 'YES') + self.assertEqual(logic.get_num_children_living_with(self.questions_dict, 'Lives with you'), '1') + self.assertEqual(logic.get_num_children_living_with(self.questions_dict, 'Lives with spouse'), '2') + self.assertEqual(logic.get_num_children_living_with(self.questions_dict, 'Lives with both'), '3') + + def test_shared_custody(self): + self.create_response('children_of_marriage', 'NO') + self.assertFalse(logic.determine_shared_custody(self.questions_dict)) + + children = [self.child_live_with_both, self.child_live_with_you] + self.create_response('claimant_children', json.dumps(children)) + self.assertFalse(logic.determine_shared_custody(self.questions_dict)) + + self.create_response('children_of_marriage', 'YES') + self.assertTrue(logic.determine_shared_custody(self.questions_dict)) + + children = [self.child_live_with_spouse, self.child_live_with_you] + self.create_response('claimant_children', json.dumps(children)) + self.assertFalse(logic.determine_shared_custody(self.questions_dict)) class ViewLogic(TestCase): diff --git a/edivorce/apps/core/tests/test_step_completeness.py b/edivorce/apps/core/tests/test_step_completeness.py index 51d808f7..af2ccd44 100644 --- a/edivorce/apps/core/tests/test_step_completeness.py +++ b/edivorce/apps/core/tests/test_step_completeness.py @@ -3,7 +3,7 @@ import json from django.test import TestCase from edivorce.apps.core.models import UserResponse, Question, BceidUser from edivorce.apps.core.utils.derived import get_derived_data -from edivorce.apps.core.utils.step_completeness import get_error_dict, get_step_completeness, is_complete +from edivorce.apps.core.utils.step_completeness import Status, get_error_dict, get_step_completeness, is_complete from edivorce.apps.core.utils.user_response import get_data_for_user, get_step_responses @@ -19,6 +19,12 @@ class StepCompletenessTestCase(TestCase): responses_dict_by_step = get_step_responses(responses_dict) return is_complete(responses_dict_by_step[step]) + def check_step_status(self, step): + responses_dict = get_data_for_user(self.user) + responses_dict_by_step = get_step_responses(responses_dict) + step_completeness = get_step_completeness(responses_dict_by_step) + return step_completeness[step] + def create_response(self, question, value): UserResponse.objects.create(bceid_user=self.user, question=Question.objects.get(key=question), value=value) @@ -27,6 +33,7 @@ class StepCompletenessTestCase(TestCase): # No response should be False self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.NOT_STARTED) # Testing required questions # Missing few required questions @@ -40,10 +47,12 @@ class StepCompletenessTestCase(TestCase): self.create_response('marriage_certificate_in_english', 'YES') self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.STARTED) # All required questions with one checking question with hidden question not shown self.create_response('divorce_reason', 'live separate') self.assertEqual(self.check_completeness(step), True) + self.assertEqual(self.check_step_status(step), Status.COMPLETED) # Reconciliation UserResponse.objects.filter(question_id='try_reconcile_after_separated').update(value="YES") @@ -86,10 +95,12 @@ class StepCompletenessTestCase(TestCase): # No response should be False self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.NOT_STARTED) # All required question self.create_response('want_which_orders', '["nothing"]') self.assertEqual(self.check_completeness(step), True) + self.assertEqual(self.check_step_status(step), Status.COMPLETED) # Put empty response UserResponse.objects.filter(question_id='want_which_orders').update(value="[]") @@ -100,6 +111,7 @@ class StepCompletenessTestCase(TestCase): # No response should be False self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.NOT_STARTED) # Testing required questions # Missing few required questions @@ -107,6 +119,7 @@ class StepCompletenessTestCase(TestCase): self.create_response('last_name_before_married_you', 'Jackson') self.create_response('birthday_you', '11/11/1111') self.create_response('occupation_you', 'Plumber') + self.assertEqual(self.check_step_status(step), Status.STARTED) self.assertEqual(self.check_completeness(step), False) @@ -128,6 +141,7 @@ class StepCompletenessTestCase(TestCase): # All required questions with two checking question with one hidden and one shown self.create_response('any_other_name_you', 'NO') self.assertEqual(self.check_completeness(step), True) + self.assertEqual(self.check_step_status(step), Status.COMPLETED) # All required questions with two checking question with one hidden question missing UserResponse.objects.filter(question_id='any_other_name_you').update(value="YES") @@ -146,6 +160,7 @@ class StepCompletenessTestCase(TestCase): # No response should be False self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.NOT_STARTED) # Testing required questions # Missing few required questions @@ -155,6 +170,7 @@ class StepCompletenessTestCase(TestCase): self.create_response('occupation_spouse', 'Electrician') self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.STARTED) # Few required questions with one checking question with hidden question not shown self.create_response('any_other_name_spouse', 'NO') @@ -175,6 +191,7 @@ class StepCompletenessTestCase(TestCase): # All required questions with two checking question with one hidden and one shown self.create_response('other_name_spouse', '[["also known as","Smith"]]') self.assertEqual(self.check_completeness(step), True) + self.assertEqual(self.check_step_status(step), Status.COMPLETED) # All required questions with two checking question with one hidden question missing UserResponse.objects.filter(question_id='lived_in_bc_spouse').update(value="Moved to B.C. on") @@ -197,10 +214,12 @@ class StepCompletenessTestCase(TestCase): # No response should be False self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.NOT_STARTED) # Some required questions self.create_response('when_were_you_live_married_like', '12/12/2007') self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.STARTED) self.create_response('when_were_you_married', '12/12/2008') self.assertEqual(self.check_completeness(step), False) @@ -228,15 +247,23 @@ class StepCompletenessTestCase(TestCase): # All required questions self.create_response('where_were_you_married_other_country', 'Peru') self.assertEqual(self.check_completeness(step), True) + self.assertEqual(self.check_step_status(step), Status.COMPLETED) def test_your_separation(self): step = 'your_separation' # No response should be False self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.NOT_STARTED) - # All required question + # One required question self.create_response('no_reconciliation_possible', 'I agree') self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.STARTED) + + # All required question + self.create_response('no_collusion', 'I agree') + self.assertEqual(self.check_completeness(step), True) + self.assertEqual(self.check_step_status(step), Status.COMPLETED) # Put empty response UserResponse.objects.filter(question_id='no_reconciliation_possible').update(value="") @@ -245,61 +272,79 @@ class StepCompletenessTestCase(TestCase): def test_spousal_support(self): step = 'spousal_support' + # Step not required if spousal support not wanted + self.assertEqual(self.check_completeness(step), True) + self.assertEqual(self.check_step_status(step), Status.HIDDEN) + # No response should be False + self.create_response('want_which_orders', '["Spousal support"]') self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.NOT_STARTED) # One required question self.create_response('spouse_support_details', 'I will support you') self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.STARTED) # Two required questions self.create_response('spouse_support_act', 'Family Law') self.assertEqual(self.check_completeness(step), True) + self.assertEqual(self.check_step_status(step), Status.COMPLETED) # Remove first added required response to test the second required question UserResponse.objects.get(question_id='spouse_support_details').delete() - self.assertEqual(self.check_completeness(step), False) - # Put empty response + # Empty response doesn't count as answered UserResponse.objects.filter(question_id='spouse_support_details').update(value="") - self.assertEqual(self.check_completeness(step), False) def test_property_and_debt(self): step = 'property_and_debt' + # Step not required if property and debt orders not wanted + self.assertEqual(self.check_completeness(step), True) + self.assertEqual(self.check_step_status(step), Status.HIDDEN) + # No response should be False + self.create_response('want_which_orders', '["Division of property and debts"]') self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.NOT_STARTED) # All required question with no hidden shown self.create_response('deal_with_property_debt', 'Equal division') - self.assertEqual(self.check_completeness(step), True) # All required question with hidden shown but no response UserResponse.objects.filter(question_id='deal_with_property_debt').update(value="Unequal division") - self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.STARTED) # Only one required question with hidden shown and answered self.create_response('how_to_divide_property_debt', 'Do not divide them') - self.assertEqual(self.check_completeness(step), True) # All required question with optional fields self.create_response('other_property_claims', 'Want these property claims') self.assertEqual(self.check_completeness(step), True) + self.assertEqual(self.check_step_status(step), Status.COMPLETED) def test_other_orders(self): step = 'other_orders' + # Step not required if other orders not wanted + self.assertEqual(self.check_completeness(step), True) + self.assertEqual(self.check_step_status(step), Status.HIDDEN) + # No response should be False + self.create_response('want_which_orders', '["Other orders"]') self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.NOT_STARTED) # All required question self.create_response('name_change_you', 'NO') self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.STARTED) self.create_response('name_change_spouse', 'NO') self.create_response('other_orders_detail', 'I want more orders') @@ -316,16 +361,19 @@ class StepCompletenessTestCase(TestCase): # Put empty response UserResponse.objects.filter(question_id='other_orders_detail').update(value="") self.assertEqual(self.check_completeness(step), True) + self.assertEqual(self.check_step_status(step), Status.COMPLETED) def test_other_questions(self): step = 'other_questions' # No response should be False self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.NOT_STARTED) # Some required question self.create_response('address_to_send_official_document_street_you', '123 Cambie st') self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.STARTED) self.create_response('address_to_send_official_document_city_you', 'Vancouver') self.assertEqual(self.check_completeness(step), False) @@ -384,6 +432,7 @@ class StepCompletenessTestCase(TestCase): # All required questions self.create_response('address_to_send_official_document_other_country_spouse', 'Mexico') self.assertEqual(self.check_completeness(step), True) + self.assertEqual(self.check_step_status(step), Status.COMPLETED) # Set Specific date on to empty UserResponse.objects.filter(question_id='divorce_take_effect_on_specific_date').update(value="") @@ -394,10 +443,12 @@ class StepCompletenessTestCase(TestCase): # No response should be False self.assertEqual(self.check_completeness(step), False) + self.assertEqual(self.check_step_status(step), Status.NOT_STARTED) # All required question self.create_response('court_registry_for_filing', 'Vancouver') self.assertEqual(self.check_completeness(step), True) + self.assertEqual(self.check_step_status(step), Status.COMPLETED) # Put empty response UserResponse.objects.filter(question_id='court_registry_for_filing').update(value="") @@ -412,8 +463,9 @@ class ChildrenStepCompletenessTestCase(TestCase): self.child_live_with_you = {"child_name": "Child with you", "child_birth_date": "Dec 30, 2018", "child_live_with": "Lives with you", "child_relationship_to_you": "Natural child", "child_relationship_to_spouse": "Natural child", "child_live_with_other_details": ""} self.child_live_with_spouse = {"child_name": "Child with spouse", "child_birth_date": "Jan 4, 2009", "child_live_with": "Lives with spouse", "child_relationship_to_you": "Adopted child", "child_relationship_to_spouse": "Adopted child", "child_live_with_other_details": ""} self.child_live_with_both = {"child_name": "Child with both", "child_birth_date": "Jan 4, 2009", "child_live_with": "Lives with both", "child_relationship_to_you": "Adopted child", "child_relationship_to_spouse": "Adopted child", "child_live_with_other_details": ""} + self.create_response('children_of_marriage', 'YES') - def get_children_step_status(self, substep): + def get_children_step_status(self, substep=None): responses_dict = get_data_for_user(self.user) responses_dict_by_step = get_step_responses(responses_dict) step_completeness = get_step_completeness(responses_dict_by_step) @@ -424,7 +476,7 @@ class ChildrenStepCompletenessTestCase(TestCase): return step_completeness[key] def is_step_complete(self, substep): - return self.get_children_step_status(substep) == 'Completed' + return self.get_children_step_status(substep) == Status.COMPLETED def create_response(self, question, value): response, _ = UserResponse.objects.get_or_create(bceid_user=self.user, question_id=question) @@ -443,12 +495,21 @@ class ChildrenStepCompletenessTestCase(TestCase): derived_data = get_derived_data(responses_dict) return derived_data[derived_key] + def test_no_children(self): + self.create_response('children_of_marriage', 'NO') + self.assertEqual(self.get_children_step_status(), 'Hidden') + self.assertEqual(self.get_children_step_status('your_children'), 'Hidden') + self.assertEqual(self.get_children_step_status('income_expenses'), 'Hidden') + self.assertEqual(self.get_children_step_status('facts'), 'Hidden') + self.assertEqual(self.get_children_step_status('payor_medical'), 'Hidden') + self.assertEqual(self.get_children_step_status('what_for'), 'Hidden') + def test_children_details(self): substep = 'your_children' # No response status is Not Started self.assertFalse(self.is_step_complete(substep)) - self.assertEqual(self.get_children_step_status(substep), 'Not started') + self.assertEqual(self.get_children_step_status(substep), Status.NOT_STARTED) # Empty list doesn't count as answered self.create_response('claimant_children', '[]') @@ -456,7 +517,7 @@ class ChildrenStepCompletenessTestCase(TestCase): # Future question answered means status is Skipped self.create_response('have_separation_agreement', 'YES') - self.assertEqual(self.get_children_step_status(substep), 'Skipped') + self.assertEqual(self.get_children_step_status(substep), Status.SKIPPED) # Has valid value children = [self.child_live_with_you] @@ -468,12 +529,12 @@ class ChildrenStepCompletenessTestCase(TestCase): children = [self.child_live_with_you, self.child_live_with_spouse] self.create_response('claimant_children', json.dumps(children)) - self.assertEqual(self.get_children_step_status(substep), 'Not started') + self.assertEqual(self.get_children_step_status(substep), Status.NOT_STARTED) self.assertFalse(self.is_step_complete(substep)) # All basic required fields self.create_response('how_will_calculate_income', 'entered agreement') - self.assertEqual(self.get_children_step_status(substep), 'Started') + self.assertEqual(self.get_children_step_status(substep), Status.STARTED) self.create_response('annual_gross_income', '100') self.create_response('spouse_annual_gross_income', '100') self.create_response('special_extraordinary_expenses', 'NO') @@ -500,7 +561,7 @@ class ChildrenStepCompletenessTestCase(TestCase): children = [self.child_live_with_you] self.create_response('claimant_children', json.dumps(children)) self.create_response('annual_gross_income', '0') - self.assertEqual(self.get_children_step_status(substep), 'Not started') + self.assertEqual(self.get_children_step_status(substep), Status.NOT_STARTED) self.assertFalse(self.is_step_complete(substep)) # All basic required fields if there is only sole custody of children and payor makes less than $150,000 @@ -645,7 +706,7 @@ class ChildrenStepCompletenessTestCase(TestCase): substep = 'payor_medical' self.assertFalse(self.is_step_complete(substep)) - self.assertEqual(self.get_children_step_status(substep), 'Not started') + self.assertEqual(self.get_children_step_status(substep), Status.NOT_STARTED) # All basic required fields self.create_response('medical_coverage_available', 'NO') @@ -665,7 +726,7 @@ class ChildrenStepCompletenessTestCase(TestCase): substep = 'what_for' self.assertFalse(self.is_step_complete(substep)) - self.assertEqual(self.get_children_step_status(substep), 'Not started') + self.assertEqual(self.get_children_step_status(substep), Status.NOT_STARTED) # All basic required fields self.create_response('child_support_in_order', 'MATCH') diff --git a/edivorce/apps/core/utils/step_completeness.py b/edivorce/apps/core/utils/step_completeness.py index 8c98f16e..2e256229 100644 --- a/edivorce/apps/core/utils/step_completeness.py +++ b/edivorce/apps/core/utils/step_completeness.py @@ -5,6 +5,14 @@ from edivorce.apps.core.utils.question_step_mapping import children_substep_ques from edivorce.apps.core.utils.conditional_logic import get_cleaned_response_value +class Status: + STARTED = "Started" + COMPLETED = "Completed" + SKIPPED = "Skipped" + NOT_STARTED = "Not started" + HIDDEN = "Hidden" + + def evaluate_numeric_condition(target, reveal_response): """ Tests whether the reveal_response contains a numeric condition. If so, it will @@ -56,19 +64,25 @@ def get_step_completeness(questions_by_step): return status_dict +def has_required_questions(question_dicts): + return any([question for question in question_dicts if question['question__required'] != '']) + + def _get_step_status(question_dicts, has_responses): if not step_started(question_dicts): - if not has_responses: - status = "Not started" + if not has_required_questions(question_dicts): + status = Status.HIDDEN + elif not has_responses: + status = Status.NOT_STARTED else: - status = "Skipped" + status = Status.SKIPPED else: has_responses = True complete = is_complete(question_dicts) if complete: - status = "Completed" + status = Status.COMPLETED else: - status = "Started" + status = Status.STARTED return status, has_responses From 96bd89eb67235d157ddc578fe0a1ff79a789d840 Mon Sep 17 00:00:00 2001 From: ariannedee Date: Mon, 5 Oct 2020 17:19:14 -0700 Subject: [PATCH 3/4] DIV-1170: Update Question.json and add management commands to generate it --- .../management/commands/questions_to_csv.py | 35 +++ .../management/commands/questions_to_json.py | 40 +++ edivorce/apps/core/utils/user_response.py | 2 +- edivorce/fixtures/Question.json | 260 +++++++++--------- 4 files changed, 206 insertions(+), 131 deletions(-) create mode 100644 edivorce/apps/core/management/commands/questions_to_csv.py create mode 100644 edivorce/apps/core/management/commands/questions_to_json.py diff --git a/edivorce/apps/core/management/commands/questions_to_csv.py b/edivorce/apps/core/management/commands/questions_to_csv.py new file mode 100644 index 00000000..74bbf3b6 --- /dev/null +++ b/edivorce/apps/core/management/commands/questions_to_csv.py @@ -0,0 +1,35 @@ +import csv +import json +import os + +from django.conf import settings +from django.core.management.base import BaseCommand + + +class Command(BaseCommand): + help = 'Export Questions.json as Questions.csv' + + def handle(self, *args, **options): + json_path = os.path.join(settings.PROJECT_ROOT, 'edivorce/fixtures/Question.json') + with open(json_path, 'r') as file: + all_lines = [line for line in file.readlines()] + questions = json.loads('\n'.join(all_lines)) + print(questions) + + csv_path = os.path.join(settings.PROJECT_ROOT.parent, 'Question.csv') + with open(csv_path, 'w') as file: + field_names = ['description', 'key', 'name', 'summary_order', 'required', 'conditional_target', 'reveal_response'] + writer = csv.DictWriter(file, field_names) + writer.writeheader() + dicts = [] + for question in questions: + dicts.append({ + 'description': question['fields']['description'], + 'key': question['pk'], + 'name': question['fields']['name'], + 'summary_order': question['fields']['summary_order'], + 'required': question['fields'].get('required', ''), + 'conditional_target': question['fields'].get('conditional_target', ''), + 'reveal_response': question['fields'].get('reveal_response', ''), + }) + writer.writerows(dicts) diff --git a/edivorce/apps/core/management/commands/questions_to_json.py b/edivorce/apps/core/management/commands/questions_to_json.py new file mode 100644 index 00000000..1421cfbe --- /dev/null +++ b/edivorce/apps/core/management/commands/questions_to_json.py @@ -0,0 +1,40 @@ +import csv +import json +import os + +from django.conf import settings +from django.core.management.base import BaseCommand + + +class Command(BaseCommand): + help = 'Export Questions.csv as Questions.json' + + def handle(self, *args, **options): + csv_path = os.path.join(settings.PROJECT_ROOT.parent, 'Question.csv') + with open(csv_path, 'r') as file: + reader = csv.DictReader(file) + dicts = [line for line in reader] + + json_path = os.path.join(settings.PROJECT_ROOT, 'edivorce/fixtures/Question.json') + with open(json_path, 'w') as file: + json_questions = [] + for line in dicts: + question_dict = { + "fields": { + "name": line['name'], + "description": line['description'], + "summary_order": int(line['summary_order']), + "required": line['required'], + }, + "model": "core.question", + "pk": line['key'] + } + if line['conditional_target']: + question_dict["fields"]["conditional_target"] = line['conditional_target'] + reveal_response = line['reveal_response'] + if reveal_response.lower() == 'true': + reveal_response = reveal_response.capitalize() + question_dict["fields"]["reveal_response"] = reveal_response + json_questions.append(question_dict) + file.write(json.dumps(json_questions, indent=4)) + file.write('\n') diff --git a/edivorce/apps/core/utils/user_response.py b/edivorce/apps/core/utils/user_response.py index 177e4bba..e1016c34 100644 --- a/edivorce/apps/core/utils/user_response.py +++ b/edivorce/apps/core/utils/user_response.py @@ -73,7 +73,7 @@ def _condition_met(target_response, reveal_response): if reveal_response.startswith('!'): if target_response == "" or target_response.lower() == reveal_response[1:].lower(): return False - elif str(target_response) != reveal_response: + elif str(target_response).lower() != reveal_response.lower(): return False elif numeric_condition_met is False: return False diff --git a/edivorce/fixtures/Question.json b/edivorce/fixtures/Question.json index 0134835a..a8703823 100644 --- a/edivorce/fixtures/Question.json +++ b/edivorce/fixtures/Question.json @@ -487,35 +487,11 @@ "model": "core.question", "pk": "no_collusion" }, -{ - "fields": { - "name": "You and your spouse are asking for an order for spousal support as follows", - "description": "For step 6, Form 1 5. Spousal support", - "summary_order": 47, - "required": "Conditional", - "conditional_target": "determine_spousal_support_orders_wanted", - "reveal_response": "True" - }, - "model": "core.question", - "pk": "spouse_support_details" -}, -{ - "fields": { - "name": "Please indicate which act you are asking for support under.", - "description": "For step 6, Form 1 5. Spousal support", - "summary_order": 48, - "required": "Conditional", - "conditional_target": "determine_spousal_support_orders_wanted", - "reveal_response": "True" - }, - "model": "core.question", - "pk": "spouse_support_act" -}, { "fields": { "name": "Your children", "description": "For Step 6, Your children - Children details", - "summary_order": 49, + "summary_order": 47, "required": "Conditional", "conditional_target": "determine_has_children_of_marriage", "reveal_response": "True" @@ -527,7 +503,7 @@ "fields": { "name": "How will you and your spouse be determining your income?", "description": "For Step 6, Your children - Income & expenses", - "summary_order": 50, + "summary_order": 48, "required": "Conditional", "conditional_target": "determine_has_children_of_marriage", "reveal_response": "True" @@ -539,7 +515,7 @@ "fields": { "name": "What is your annual gross income as determined above?", "description": "For Step 6, Your children - Income & expenses", - "summary_order": 51, + "summary_order": 49, "required": "Conditional", "conditional_target": "determine_has_children_of_marriage", "reveal_response": "True" @@ -551,7 +527,7 @@ "fields": { "name": "What is your spouse's annual gross income as determined above?", "description": "For Step 6, Your children - Income & expenses", - "summary_order": 52, + "summary_order": 50, "required": "Conditional", "conditional_target": "determine_has_children_of_marriage", "reveal_response": "True" @@ -563,7 +539,7 @@ "fields": { "name": "What is the monthly child support amount (as per Schedule 1 of the guidelines) that is payable?", "description": "For Step 6, Your children - Income & expenses", - "summary_order": 53, + "summary_order": 51, "required": "Conditional", "conditional_target": "determine_sole_custody", "reveal_response": "True" @@ -575,7 +551,7 @@ "fields": { "name": "Are you claiming any special and extraordinary expenses?", "description": "For Step 6, Your children - Income & expenses", - "summary_order": 54, + "summary_order": 52, "required": "Conditional", "conditional_target": "determine_has_children_of_marriage", "reveal_response": "True" @@ -587,7 +563,7 @@ "fields": { "name": "Child care expenses for when the recipient works or goes to school", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 55, + "summary_order": 53, "required": "Conditional", "conditional_target": "determine_missing_extraordinary_expenses", "reveal_response": "True" @@ -599,7 +575,7 @@ "fields": { "name": "Annual child care expenses for when the recipient works or goes to school", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 56, + "summary_order": 54, "required": "Conditional" }, "model": "core.question", @@ -609,7 +585,7 @@ "fields": { "name": "Any healthcare premiums you pay to your employer or other provider to provide the coverage to your children rather than yourself", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 57, + "summary_order": 55, "required": "Conditional", "conditional_target": "determine_missing_extraordinary_expenses", "reveal_response": "True" @@ -621,7 +597,7 @@ "fields": { "name": "Any annual healthcare premiums you pay to your employer or other provider to provide the coverage to your children rather than yourself", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 58, + "summary_order": 56, "required": "" }, "model": "core.question", @@ -631,7 +607,7 @@ "fields": { "name": "Health related expenses that exceed insurance reimbursement by at least $100", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 59, + "summary_order": 57, "required": "Conditional", "conditional_target": "determine_missing_extraordinary_expenses", "reveal_response": "True" @@ -643,7 +619,7 @@ "fields": { "name": "Annual health related expenses that exceed insurance reimbursement by at least $100", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 60, + "summary_order": 58, "required": "" }, "model": "core.question", @@ -653,7 +629,7 @@ "fields": { "name": "Extraordinary primary, secondary or other educational expenses", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 61, + "summary_order": 59, "required": "Conditional", "conditional_target": "determine_missing_extraordinary_expenses", "reveal_response": "True" @@ -665,7 +641,7 @@ "fields": { "name": "Annual extraordinary primary, secondary or other educational expenses", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 62, + "summary_order": 60, "required": "" }, "model": "core.question", @@ -675,7 +651,7 @@ "fields": { "name": "Post-secondary school expenses", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 63, + "summary_order": 61, "required": "Conditional", "conditional_target": "determine_missing_extraordinary_expenses", "reveal_response": "True" @@ -687,7 +663,7 @@ "fields": { "name": "Annual Post-secondary school expenses", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 64, + "summary_order": 62, "required": "" }, "model": "core.question", @@ -697,7 +673,7 @@ "fields": { "name": "Extraordinary extracurricular activities expenses", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 65, + "summary_order": 63, "required": "Conditional", "conditional_target": "determine_missing_extraordinary_expenses", "reveal_response": "True" @@ -709,7 +685,7 @@ "fields": { "name": "Annual extraordinary extracurricular activities expenses", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 66, + "summary_order": 64, "required": "" }, "model": "core.question", @@ -719,7 +695,7 @@ "fields": { "name": "Total section 7 expenses", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 67, + "summary_order": 65, "required": "" }, "model": "core.question", @@ -729,7 +705,7 @@ "fields": { "name": "Annual total section 7 expenses", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 68, + "summary_order": 66, "required": "" }, "model": "core.question", @@ -739,7 +715,7 @@ "fields": { "name": "Your proportionate share", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 69, + "summary_order": 67, "required": "" }, "model": "core.question", @@ -749,7 +725,7 @@ "fields": { "name": "Your proportionate share", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 70, + "summary_order": 68, "required": "" }, "model": "core.question", @@ -759,7 +735,7 @@ "fields": { "name": "Spouse's proportionate share", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 71, + "summary_order": 69, "required": "" }, "model": "core.question", @@ -769,7 +745,7 @@ "fields": { "name": "Spouse's proportionate share", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 72, + "summary_order": 70, "required": "" }, "model": "core.question", @@ -779,7 +755,7 @@ "fields": { "name": "Please describe the order you are asking for regarding Special and Extraordinary Expenses", "description": "For Step 6, Your children - Income & expenses - Fact Sheet A - Extraordinary Expenses", - "summary_order": 73, + "summary_order": 71, "required": "Conditional", "conditional_target": "special_extraordinary_expenses", "reveal_response": "YES" @@ -791,7 +767,7 @@ "fields": { "name": "Who is the payor?", "description": "For Step 6, Your children - Payor & fact sheets", - "summary_order": 74, + "summary_order": 72, "required": "Conditional", "conditional_target": "determine_has_children_of_marriage", "reveal_response": "True" @@ -803,7 +779,7 @@ "fields": { "name": "What is the approximate amount of time the children spend with each parent?", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet B Shared Custody", - "summary_order": 75, + "summary_order": 73, "required": "Conditional", "conditional_target": "determine_shared_custody", "reveal_response": "True" @@ -815,7 +791,7 @@ "fields": { "name": "What is the approximate amount of time the children spend with each parent?", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet B Shared Custody", - "summary_order": 76, + "summary_order": 74, "required": "Conditional", "conditional_target": "determine_shared_custody", "reveal_response": "True" @@ -827,7 +803,7 @@ "fields": { "name": "What is the 'Guideline' amount for child support?", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet B Shared Custody", - "summary_order": 77, + "summary_order": 75, "required": "Conditional", "conditional_target": "determine_shared_custody", "reveal_response": "True" @@ -839,7 +815,7 @@ "fields": { "name": "What is the 'Guideline' amount for child support?", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet B Shared Custody", - "summary_order": 78, + "summary_order": 76, "required": "Conditional", "conditional_target": "determine_shared_custody", "reveal_response": "True" @@ -851,7 +827,7 @@ "fields": { "name": "Any other relevant information regarding the conditions, means, needs and other circumstances of each spouse or of any child for whom support is sought?", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet B Shared Custody", - "summary_order": 79, + "summary_order": 77, "required": "" }, "model": "core.question", @@ -861,7 +837,7 @@ "fields": { "name": "Difference between Guidelines table amounts", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet B Shared Custody", - "summary_order": 80, + "summary_order": 78, "required": "" }, "model": "core.question", @@ -871,7 +847,7 @@ "fields": { "name": "What is the 'Guideline' amount for child support payable by you (as per Federal Child Support Tables)?", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet C Split Custody", - "summary_order": 81, + "summary_order": 79, "required": "Conditional", "conditional_target": "determine_split_custody", "reveal_response": "True" @@ -883,7 +859,7 @@ "fields": { "name": "What is the 'Guideline' amount for child support payable by your spouse (as per Federal Child Support Tables)?", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet C Split Custody", - "summary_order": 82, + "summary_order": 80, "required": "Conditional", "conditional_target": "determine_split_custody", "reveal_response": "True" @@ -895,7 +871,7 @@ "fields": { "name": "Difference between Guidelines table amounts", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet C Split Custody", - "summary_order": 83, + "summary_order": 81, "required": "" }, "model": "core.question", @@ -905,7 +881,7 @@ "fields": { "name": "How many child(ren) are 19 years or older for whom you are asking for support?", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet D Child(ren) 19 Years or Older", - "summary_order": 84, + "summary_order": 82, "required": "Conditional", "conditional_target": "determine_child_over_19_supported", "reveal_response": "True" @@ -917,7 +893,7 @@ "fields": { "name": "Do you and your spouse agree that the monthly Guidelines table amount for child support is appropriate?", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet D Child(ren) 19 Years or Older", - "summary_order": 85, + "summary_order": 83, "required": "Conditional", "conditional_target": "determine_child_over_19_supported", "reveal_response": "True" @@ -929,7 +905,7 @@ "fields": { "name": "What would be the appropriate amount?", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet D Child(ren) 19 Years or Older", - "summary_order": 86, + "summary_order": 84, "required": "Conditional", "conditional_target": "agree_to_guideline_child_support_amount", "reveal_response": "NO" @@ -941,7 +917,7 @@ "fields": { "name": "Please describe - Why do you think the court should approve your proposed amount?", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet D Child(ren) 19 Years or Older", - "summary_order": 87, + "summary_order": 85, "required": "Conditional", "conditional_target": "agree_to_guideline_child_support_amount", "reveal_response": "NO" @@ -953,7 +929,7 @@ "fields": { "name": "Are you or your spouse claiming undue hardship?", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet E - Undue hardship", - "summary_order": 88, + "summary_order": 86, "required": "Conditional", "conditional_target": "determine_has_children_of_marriage", "reveal_response": "True" @@ -965,7 +941,7 @@ "fields": { "name": "Unusual or excessive debts", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet E - Undue hardship", - "summary_order": 89, + "summary_order": 87, "required": "" }, "model": "core.question", @@ -975,7 +951,7 @@ "fields": { "name": "Unusually high expenses for parenting time, contact with, or access to a child.", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet E - Undue hardship", - "summary_order": 90, + "summary_order": 88, "required": "" }, "model": "core.question", @@ -985,7 +961,7 @@ "fields": { "name": "Supporting another person", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet E - Undue hardship", - "summary_order": 91, + "summary_order": 89, "required": "" }, "model": "core.question", @@ -995,7 +971,7 @@ "fields": { "name": "Supporting dependent child/children from another relationship.", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet E - Undue hardship", - "summary_order": 92, + "summary_order": 90, "required": "" }, "model": "core.question", @@ -1005,7 +981,7 @@ "fields": { "name": "Support for a disabled or ill person.", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet E - Undue hardship", - "summary_order": 93, + "summary_order": 91, "required": "" }, "model": "core.question", @@ -1015,7 +991,7 @@ "fields": { "name": "Other undue hardship circumstances", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet E - Undue hardship", - "summary_order": 94, + "summary_order": 92, "required": "" }, "model": "core.question", @@ -1025,7 +1001,7 @@ "fields": { "name": "Income of Other Persons in Household", "description": "For Step 6, Your children - Payor & fact sheets - Fact Sheet E - Undue hardship", - "summary_order": 95, + "summary_order": 93, "required": "" }, "model": "core.question", @@ -1035,7 +1011,7 @@ "fields": { "name": "How many child(ren) are you asking for support?", "description": "For Step 6, Your children - Payor & fact sheets - Your Fact Sheet F", - "summary_order": 96, + "summary_order": 94, "required": "Conditional", "conditional_target": "determine_show_fact_sheet_f_you", "reveal_response": "True" @@ -1047,7 +1023,7 @@ "fields": { "name": "How many child(ren) are you asking for support?", "description": "For Step 6, Your children - Payor & fact sheets - Your Fact Sheet F", - "summary_order": 97, + "summary_order": 95, "required": "Conditional", "conditional_target": "determine_show_fact_sheet_f_spouse", "reveal_response": "True" @@ -1059,7 +1035,7 @@ "fields": { "name": "What is the Child Support Guidelines amount for $150,000?", "description": "For Step 6, Your children - Payor & fact sheets - Your Fact Sheet F", - "summary_order": 98, + "summary_order": 96, "required": "Conditional", "conditional_target": "determine_show_fact_sheet_f_you", "reveal_response": "True" @@ -1071,7 +1047,7 @@ "fields": { "name": "What is the Child Support Guidelines amount for $150,000?", "description": "For Step 6, Your children - Payor & fact sheets - Your Fact Sheet F", - "summary_order": 99, + "summary_order": 97, "required": "Conditional", "conditional_target": "determine_show_fact_sheet_f_spouse", "reveal_response": "True" @@ -1083,7 +1059,7 @@ "fields": { "name": "What is the % of income over $150,000 from the Child Support Guidlines?", "description": "For Step 6, Your children - Payor & fact sheets - Your Fact Sheet F", - "summary_order": 100, + "summary_order": 98, "required": "Conditional", "conditional_target": "determine_show_fact_sheet_f_you", "reveal_response": "True" @@ -1095,7 +1071,7 @@ "fields": { "name": "What is the % of income over $150,000 from the Child Support Guidlines?", "description": "For Step 6, Your children - Payor & fact sheets - Your Fact Sheet F", - "summary_order": 101, + "summary_order": 99, "required": "Conditional", "conditional_target": "determine_show_fact_sheet_f_spouse", "reveal_response": "True" @@ -1107,7 +1083,7 @@ "fields": { "name": "What is the child support amount to be paid on the portion of income over $150,000?", "description": "For Step 6, Your children - Payor & fact sheets - Your Fact Sheet F", - "summary_order": 102, + "summary_order": 100, "required": "Conditional", "conditional_target": "determine_show_fact_sheet_f_you", "reveal_response": "True" @@ -1119,7 +1095,7 @@ "fields": { "name": "What is the child support amount to be paid on the portion of income over $150,000?", "description": "For Step 6, Your children - Payor & fact sheets - Your Fact Sheet F", - "summary_order": 103, + "summary_order": 101, "required": "Conditional", "conditional_target": "determine_show_fact_sheet_f_spouse", "reveal_response": "True" @@ -1131,7 +1107,7 @@ "fields": { "name": "Guidelines table amount", "description": "For Step 6, Your children - Payor & fact sheets - Your Fact Sheet F", - "summary_order": 104, + "summary_order": 102, "required": "Conditional", "conditional_target": "determine_show_fact_sheet_f_you", "reveal_response": "True" @@ -1143,7 +1119,7 @@ "fields": { "name": "Guidelines table amount", "description": "For Step 6, Your children - Payor & fact sheets - Your Fact Sheet F", - "summary_order": 105, + "summary_order": 103, "required": "Conditional", "conditional_target": "determine_show_fact_sheet_f_spouse", "reveal_response": "True" @@ -1155,7 +1131,7 @@ "fields": { "name": "Do you and your spouse agree that amount is he child support amount?", "description": "For Step 6, Your children - Payor & fact sheets - Your Fact Sheet F", - "summary_order": 106, + "summary_order": 104, "required": "Conditional", "conditional_target": "determine_show_fact_sheet_f_you", "reveal_response": "True" @@ -1167,7 +1143,7 @@ "fields": { "name": "Do you and your spouse agree that amount is he child support amount?", "description": "For Step 6, Your children - Payor & fact sheets - Your Fact Sheet F", - "summary_order": 107, + "summary_order": 105, "required": "Conditional", "conditional_target": "determine_show_fact_sheet_f_spouse", "reveal_response": "True" @@ -1179,7 +1155,7 @@ "fields": { "name": "What is the amount that you and your spouse have agreed to (that differs from the Child Support Guidelines table amount)?", "description": "For Step 6, Your children - Payor & fact sheets - Your Fact Sheet F", - "summary_order": 108, + "summary_order": 106, "required": "Conditional", "conditional_target": "agree_to_child_support_amount_you", "reveal_response": "NO" @@ -1191,7 +1167,7 @@ "fields": { "name": "What is the amount that you and your spouse have agreed to (that differs from the Child Support Guidelines table amount)?", "description": "For Step 6, Your children - Payor & fact sheets - Your Fact Sheet F", - "summary_order": 109, + "summary_order": 107, "required": "Conditional", "conditional_target": "agree_to_child_support_amount_spouse", "reveal_response": "NO" @@ -1203,7 +1179,7 @@ "fields": { "name": "Why do you think the court should approve your proposed amount?", "description": "For Step 6, Your children - Payor & fact sheets - Your Fact Sheet F", - "summary_order": 110, + "summary_order": 108, "required": "Conditional", "conditional_target": "agree_to_child_support_amount_you", "reveal_response": "NO" @@ -1215,7 +1191,7 @@ "fields": { "name": "Why do you think the court should approve your proposed amount?", "description": "For Step 6, Your children - Payor & fact sheets - Your Fact Sheet F", - "summary_order": 111, + "summary_order": 109, "required": "Conditional", "conditional_target": "agree_to_child_support_amount_spouse", "reveal_response": "NO" @@ -1227,7 +1203,7 @@ "fields": { "name": "Is medical coverage available for the children?", "description": "For Step 6, Your children - Payor & medical expenses", - "summary_order": 112, + "summary_order": 110, "required": "Conditional", "conditional_target": "determine_has_children_of_marriage", "reveal_response": "True" @@ -1239,7 +1215,7 @@ "fields": { "name": "Whose plan is the coverage under?", "description": "For Step 6, Your children - Payor & medical expenses", - "summary_order": 113, + "summary_order": 111, "required": "Conditional", "conditional_target": "medical_coverage_available", "reveal_response": "YES" @@ -1251,7 +1227,7 @@ "fields": { "name": "Are there any child support payments (in arrears) that have not been paid (as of today's date) under an existing order or written agreement?", "description": "For Step 6, Your children - Payor & medical expenses", - "summary_order": 114, + "summary_order": 112, "required": "Conditional", "conditional_target": "determine_has_children_of_marriage", "reveal_response": "True" @@ -1263,7 +1239,7 @@ "fields": { "name": "What is the amount as of today's date?", "description": "For Step 6, Your children - Payor & medical expenses", - "summary_order": 115, + "summary_order": 113, "required": "Conditional", "conditional_target": "child_support_payments_in_arrears", "reveal_response": "YES" @@ -1275,7 +1251,7 @@ "fields": { "name": "What is the monthly child support amount proposed in the order to be paid by", "description": "For Step 6, Your children - What are you asking for", - "summary_order": 116, + "summary_order": 114, "required": "Conditional", "conditional_target": "determine_has_children_of_marriage", "reveal_response": "True" @@ -1287,7 +1263,7 @@ "fields": { "name": "What is the monthly child support amount proposed in the order to be paid by", "description": "For Step 6, Your children - What are you asking for", - "summary_order": 117, + "summary_order": 115, "required": "Conditional", "conditional_target": "child_support_in_order", "reveal_response": "DIFF" @@ -1299,7 +1275,7 @@ "fields": { "name": "We are not asking for child support to be included in the order", "description": "For Step 6, Your children - What are you asking for", - "summary_order": 118, + "summary_order": 116, "required": "Conditional", "conditional_target": "child_support_in_order", "reveal_response": "NO" @@ -1311,7 +1287,7 @@ "fields": { "name": "Do you and the other parent agree (have consented) on the child support amount?", "description": "For Step 6, Your children - What are you asking for", - "summary_order": 119, + "summary_order": 117, "required": "Conditional", "conditional_target": "child_support_in_order", "reveal_response": "DIFF" @@ -1323,7 +1299,7 @@ "fields": { "name": "What special provisions have been made?", "description": "For Step 6, Your children - What are you asking for", - "summary_order": 120, + "summary_order": 118, "required": "Conditional", "conditional_target": "claimants_agree_to_child_support_amount", "reveal_response": "NO" @@ -1335,7 +1311,7 @@ "fields": { "name": "Do you have a separation agreement that sets out what you've agreed to around parenting and child support?", "description": "For Step 6, Your children - What are you asking for", - "summary_order": 121, + "summary_order": 119, "required": "Conditional", "conditional_target": "determine_has_children_of_marriage", "reveal_response": "True" @@ -1347,7 +1323,7 @@ "fields": { "name": "Do you have an order about support of the children?", "description": "For Step 6, Your children - What are you asking for", - "summary_order": 122, + "summary_order": 120, "required": "Conditional", "conditional_target": "determine_has_children_of_marriage", "reveal_response": "YES" @@ -1359,7 +1335,7 @@ "fields": { "name": "The court needs to know what the current parenting arrangements are for the children of the marriage. Please describe below.", "description": "For Step 6, Your children - What are you asking for", - "summary_order": 123, + "summary_order": 121, "required": "Conditional", "conditional_target": "determine_has_children_of_marriage", "reveal_response": "True" @@ -1371,7 +1347,7 @@ "fields": { "name": "Are you asking the court for an order about parenting arrangements or contact with a child?", "description": "For Step 6, Your children - What are you asking for", - "summary_order": 124, + "summary_order": 122, "required": "Conditional", "conditional_target": "determine_has_children_of_marriage", "reveal_response": "True" @@ -1383,7 +1359,7 @@ "fields": { "name": "Please indicate the parenting arrangements you are asking for below.", "description": "For Step 6, Your children - What are you asking for", - "summary_order": 125, + "summary_order": 123, "required": "Conditional", "conditional_target": "want_parenting_arrangements", "reveal_response": "YES" @@ -1395,7 +1371,7 @@ "fields": { "name": "If you are asking for an order for child support please describe what you are asking for.", "description": "For Step 6, Your children - What are you asking for", - "summary_order": 126, + "summary_order": 124, "required": "Conditional", "conditional_target": "child_support_in_order", "reveal_response": "!NO" @@ -1407,7 +1383,7 @@ "fields": { "name": "Please indicate which act you are asking for support under.", "description": "For Step 6, Your children - What are you asking for", - "summary_order": 127, + "summary_order": 125, "required": "Conditional", "conditional_target": "determine_child_support_act_requirement", "reveal_response": "True" @@ -1415,10 +1391,34 @@ "model": "core.question", "pk": "child_support_act" }, +{ + "fields": { + "name": "You and your spouse are asking for an order for spousal support as follows", + "description": "For step 7, Form 1 5. Spousal support", + "summary_order": 126, + "required": "Conditional", + "conditional_target": "determine_spousal_support_orders_wanted", + "reveal_response": "True" + }, + "model": "core.question", + "pk": "spouse_support_details" +}, +{ + "fields": { + "name": "Please indicate which act you are asking for support under.", + "description": "For step 7, Form 1 5. Spousal support", + "summary_order": 127, + "required": "Conditional", + "conditional_target": "determine_spousal_support_orders_wanted", + "reveal_response": "True" + }, + "model": "core.question", + "pk": "spouse_support_act" +}, { "fields": { "name": "How have you and your spouse agreed to deal with your property and debt?", - "description": "For step 7, Form 1 6. Property and debt", + "description": "For step 8, Form 1 6. Property and debt", "summary_order": 128, "required": "Conditional", "conditional_target": "determine_property_debt_orders_wanted", @@ -1430,7 +1430,7 @@ { "fields": { "name": "Please describe how you and your spouse plan to divide your property, assets and your debts.", - "description": "For step 7, Form 1 6. Property and debt", + "description": "For step 8, Form 1 6. Property and debt", "summary_order": 129, "required": "Conditional", "conditional_target": "deal_with_property_debt", @@ -1442,7 +1442,7 @@ { "fields": { "name": "Please list any other property claims.", - "description": "For step 7, Form 1 6. Property and debt", + "description": "For step 8, Form 1 6. Property and debt", "summary_order": 130, "required": "" }, @@ -1452,7 +1452,7 @@ { "fields": { "name": "Are you asking for a name change?", - "description": "For Step 10, Forms 38 and 52's Orders sections", + "description": "For Step 9, Forms 38 and 52's Orders sections", "summary_order": 131, "required": "Conditional", "conditional_target": "determine_other_orders_wanted", @@ -1464,7 +1464,7 @@ { "fields": { "name": "Please enter the full name", - "description": "For Step 10, Forms 38 and 52's Orders sections", + "description": "For Step 9, Forms 38 and 52's Orders sections", "summary_order": 132, "required": "Conditional", "conditional_target": "name_change_you", @@ -1476,7 +1476,7 @@ { "fields": { "name": "Is your spouse asking for a name change?", - "description": "For Step 10, Forms 38 and 52's Orders sections", + "description": "For Step 9, Forms 38 and 52's Orders sections", "summary_order": 133, "required": "Conditional", "conditional_target": "determine_other_orders_wanted", @@ -1488,7 +1488,7 @@ { "fields": { "name": "Please enter the full name", - "description": "For Step 10, Forms 38 and 52's Orders sections", + "description": "For Step 9, Forms 38 and 52's Orders sections", "summary_order": 134, "required": "Conditional", "conditional_target": "name_change_spouse", @@ -1500,7 +1500,7 @@ { "fields": { "name": "Please enter the details for any other orders that you are asking for.", - "description": "For step 8 other orders, Form 1 7. Other", + "description": "For step 9, other orders, Form 1 7. Other", "summary_order": 135, "required": "" }, @@ -1510,7 +1510,7 @@ { "fields": { "name": "What is the best address to send you official court documents?", - "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", + "description": "For step 10, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", "summary_order": 136, "required": "Required" }, @@ -1520,7 +1520,7 @@ { "fields": { "name": "City", - "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", + "description": "For step 10, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", "summary_order": 137, "required": "Required" }, @@ -1530,7 +1530,7 @@ { "fields": { "name": "Prov", - "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", + "description": "For step 10, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", "summary_order": 138, "required": "" }, @@ -1540,7 +1540,7 @@ { "fields": { "name": "Country", - "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", + "description": "For step 10, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", "summary_order": 139, "required": "Required" }, @@ -1550,7 +1550,7 @@ { "fields": { "name": "Other Country", - "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", + "description": "For step 10, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", "summary_order": 140, "required": "Conditional", "conditional_target": "address_to_send_official_document_country_you", @@ -1562,7 +1562,7 @@ { "fields": { "name": "Postal code", - "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", + "description": "For step 10, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", "summary_order": 141, "required": "" }, @@ -1572,7 +1572,7 @@ { "fields": { "name": "Fax number", - "description": "For step 9, Form 1 8. Claimants' addresses for service", + "description": "For step 10, Form 1 8. Claimants' addresses for service", "summary_order": 142, "required": "" }, @@ -1582,7 +1582,7 @@ { "fields": { "name": "Email", - "description": "For step 9, Form 1 8. Claimants' addresses for service", + "description": "For step 10, Form 1 8. Claimants' addresses for service", "summary_order": 143, "required": "" }, @@ -1592,7 +1592,7 @@ { "fields": { "name": "What is the best address to send your spouse official court documents?", - "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", + "description": "For step 10, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", "summary_order": 144, "required": "Required" }, @@ -1602,7 +1602,7 @@ { "fields": { "name": "City", - "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", + "description": "For step 10, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", "summary_order": 145, "required": "Required" }, @@ -1612,7 +1612,7 @@ { "fields": { "name": "Prov", - "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", + "description": "For step 10, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", "summary_order": 146, "required": "" }, @@ -1622,7 +1622,7 @@ { "fields": { "name": "Country", - "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", + "description": "For step 10, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", "summary_order": 147, "required": "Required" }, @@ -1632,7 +1632,7 @@ { "fields": { "name": "Other Country", - "description": "For step 9, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", + "description": "For step 10, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", "summary_order": 148, "required": "Conditional", "conditional_target": "address_to_send_official_document_country_spouse", @@ -1644,7 +1644,7 @@ { "fields": { "name": "Postal code", - "description": "For step 9, Form 1 8. Claimants' addresses for service", + "description": "For step 10, Form 1 8. Claimants' addresses for service, Form 38(joint) Affidavit section", "summary_order": 149, "required": "" }, @@ -1654,7 +1654,7 @@ { "fields": { "name": "Fax number", - "description": "For step 9, Form 1 8. Claimants' addresses for service", + "description": "For step 10, Form 1 8. Claimants' addresses for service", "summary_order": 150, "required": "" }, @@ -1664,7 +1664,7 @@ { "fields": { "name": "Email", - "description": "For step 9, Form 1 8. Claimants' addresses for service", + "description": "For step 10, Form 1 8. Claimants' addresses for service", "summary_order": 151, "required": "" }, @@ -1674,7 +1674,7 @@ { "fields": { "name": "Divorce is to take effect on", - "description": "For step 9, Form 52 This Court Orders that", + "description": "For step 10, Form 52 This Court Orders that", "summary_order": 152, "required": "Required" }, @@ -1684,7 +1684,7 @@ { "fields": { "name": "Divorce is to take effect on specific date", - "description": "For step 9 - specific date, Form 52 This Court Orders that", + "description": "For step 10 - specific date, Form 52 This Court Orders that", "summary_order": 153, "required": "Conditional", "conditional_target": "divorce_take_effect_on", @@ -1696,7 +1696,7 @@ { "fields": { "name": "Where will you be filing for divorce?", - "description": "For step 10, Form 1 court registry, Form 35 court registry, Form 36 court registry, Form 38(joint and sole) court registry, Form 52 court registry", + "description": "For step 11, Form 1 court registry, Form 35 court registry, Form 36 court registry, Form 38(joint and sole) court registry, Form 52 court registry", "summary_order": 154, "required": "Required" }, From e2e5cb03b26ab65c60f779d63586ad4ab32ccb15 Mon Sep 17 00:00:00 2001 From: ariannedee Date: Tue, 6 Oct 2020 11:28:24 -0700 Subject: [PATCH 4/4] Make no_children decorator more clear --- edivorce/apps/core/utils/conditional_logic.py | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/edivorce/apps/core/utils/conditional_logic.py b/edivorce/apps/core/utils/conditional_logic.py index c01009a7..49859454 100644 --- a/edivorce/apps/core/utils/conditional_logic.py +++ b/edivorce/apps/core/utils/conditional_logic.py @@ -3,7 +3,7 @@ import json import re -def no_children(return_val): +def if_no_children(return_val): def decorator_no_children(func): @functools.wraps(func) def inner(questions_dict, *args, **kwargs): @@ -18,7 +18,7 @@ def determine_has_children_of_marriage(questions_dict): return questions_dict.get('children_of_marriage', '') == 'YES' -@no_children([]) +@if_no_children(return_val=[]) def get_children(questions_dict): children_json = questions_dict.get('claimant_children', '[]') if isinstance(children_json, dict): @@ -26,14 +26,14 @@ def get_children(questions_dict): return json.loads(children_json) -@no_children('0') +@if_no_children(return_val='0') def get_num_children_living_with(questions_dict, living_arrangement): assert living_arrangement in ['Lives with you', 'Lives with spouse', 'Lives with both'] children = get_children(questions_dict) return str(len([child for child in children if child['child_live_with'] == living_arrangement])) -@no_children(False) +@if_no_children(return_val=False) def determine_sole_custody(questions_dict): """ Return True if all children live with one parent """ child_list = get_children(questions_dict) @@ -41,7 +41,7 @@ def determine_sole_custody(questions_dict): all([child['child_live_with'] == 'Lives with spouse' for child in child_list])) -@no_children(False) +@if_no_children(return_val=False) def determine_shared_custody(questions_dict): """ Return True if any children live with both parents """ child_list = get_children(questions_dict) @@ -49,7 +49,7 @@ def determine_shared_custody(questions_dict): for child in child_list]) -@no_children(False) +@if_no_children(return_val=False) def determine_split_custody(questions_dict): """ Return True if at least one child lives with one parent and at least one lives with the other (or both) """ child_list = get_children(questions_dict) @@ -67,7 +67,7 @@ def determine_split_custody(questions_dict): with_spouse > 0 and (with_you + with_both > 0)) -@no_children(False) +@if_no_children(return_val=False) def determine_child_over_19_supported(questions_dict): has_children_over_19 = questions_dict.get('has_children_over_19', '') == 'YES' support = json.loads(questions_dict.get('children_financial_support', '[]')) @@ -75,7 +75,7 @@ def determine_child_over_19_supported(questions_dict): return has_children_over_19 and supporting_children -@no_children(False) +@if_no_children(return_val=False) def determine_missing_undue_hardship_reasons(questions_dict): claiming_undue_hardship = questions_dict.get('claiming_undue_hardship', '') == 'YES' if claiming_undue_hardship: @@ -98,7 +98,7 @@ def determine_missing_undue_hardship_reasons(questions_dict): return False -@no_children('') +@if_no_children(return_val='') def determine_child_support_payor(questions_dict): payor = questions_dict.get('child_support_payor', '') if payor == 'Myself (Claimant 1)': @@ -110,7 +110,7 @@ def determine_child_support_payor(questions_dict): return '' -@no_children(False) +@if_no_children(return_val=False) def determine_show_fact_sheet_f_you(questions_dict): """ If claimant 1 (you) is a payor and makes over $150,000/year, show fact sheet F for claimant 1 @@ -123,7 +123,7 @@ def determine_show_fact_sheet_f_you(questions_dict): return (payor == 'Claimant 1' or payor == 'both Claimant 1 and Claimant 2') and annual > 150000 -@no_children(False) +@if_no_children(return_val=False) def determine_show_fact_sheet_f_spouse(questions_dict): """ If claimant 2 (spouse) is a payor and makes over $150,000/year, show fact sheet F for claimant 2 @@ -138,13 +138,13 @@ def determine_show_fact_sheet_f_spouse(questions_dict): return (payor == 'Claimant 2' or payor == 'both Claimant 1 and Claimant 2') and annual > 150000 -@no_children(False) +@if_no_children(return_val=False) def determine_child_support_act_requirement(questions_dict): orders_wanted = json.loads(questions_dict.get('want_which_orders', '[]')) return 'Child support' in orders_wanted -@no_children(False) +@if_no_children(return_val=False) def determine_missing_extraordinary_expenses(questions_dict): special_expenses_keys = ["child_care_expenses", "children_healthcare_premiums", @@ -167,7 +167,7 @@ def determine_missing_extraordinary_expenses(questions_dict): return False -@no_children(False) +@if_no_children(return_val=False) def determine_show_children_live_with_others(questions_dict): has_children_under_19 = questions_dict.get('has_children_under_19', '') == 'YES' child_over_19_supported = determine_child_over_19_supported(questions_dict)