From de00a431e59ae428b0285393b38cd69585b3412b Mon Sep 17 00:00:00 2001 From: Kat Date: Mon, 10 Jan 2022 11:56:50 +0000 Subject: [PATCH] Update hb question options --- app/models/constants/case_log.rb | 14 ++--- .../validations/financial_validations.rb | 14 ++--- config/forms/2021_2022.json | 54 ++++++++++--------- docs/api/DLUHC-CORE-Data.v1.json | 2 +- spec/features/form/helpers.rb | 2 +- spec/fixtures/complete_case_log.json | 2 +- spec/fixtures/forms/2021_2022.json | 6 +-- spec/models/form/question_spec.rb | 2 +- 8 files changed, 51 insertions(+), 45 deletions(-) diff --git a/app/models/constants/case_log.rb b/app/models/constants/case_log.rb index 36b2d8cdb..7e4390d44 100644 --- a/app/models/constants/case_log.rb +++ b/app/models/constants/case_log.rb @@ -229,13 +229,13 @@ module Constants::CaseLog }.freeze HOUSING_BENEFIT = { - "Housing Benefit, but not Universal Credit" => 1, - "Universal Credit with housing element, but not Housing Benefit" => 6, - "Universal Credit without housing element and no Housing Benefit" => 7, - "Universal Credit and Housing Benefit" => 8, - "Not Housing Benefit or Universal Credit" => 9, - "Don’t know" => 3, - "Prefer not to say" => 100, + "1. Housing benefit" => 1, + "6. Universal Credit with housing element (excluding housing benefit)" => 6, + "7. Universal Credit (without housing element)" => 7, + "8. Housing benefit and Universal Credit (without housing element)" => 8, + "9. None" => 9, + "3. Don't know" => 3, + "10. Tenant prefers not to say" => 100, }.freeze REASON = { diff --git a/app/models/validations/financial_validations.rb b/app/models/validations/financial_validations.rb index e2b54bd5a..c626ff1f6 100644 --- a/app/models/validations/financial_validations.rb +++ b/app/models/validations/financial_validations.rb @@ -38,15 +38,15 @@ module Validations::FinancialValidations def validate_hbrentshortfall(record) is_present = record.hbrentshortfall.present? is_yes = record.hbrentshortfall == "Yes" - hb_donotknow = record.hb == "Don’t know" - hb_no_hb_or_uc = record.hb == "Not Housing Benefit or Universal Credit" - hb_uc_no_hb = record.hb == "Universal Credit without housing element and no Housing Benefit" - hb_no_uc = record.hb == "Housing Benefit, but not Universal Credit" - hb_uc_no_he_hb = record.hb == "Universal Credit with housing element, but not Housing Benefit" - hb_and_uc = record.hb == "Universal Credit and Housing Benefit" + hb_donotknow = record.hb == "3. Don't know" + hb_none = record.hb == "9. None" + hb_uc_no_hb = record.hb == "7. Universal Credit (without housing element)" + hb_no_uc = record.hb == "1. Housing benefit" + hb_uc_no_he_hb = record.hb == "6. Universal Credit with housing element (excluding housing benefit)" + hb_and_uc = record.hb == "8. Housing benefit and Universal Credit (without housing element)" conditions = [ - { condition: is_yes && (hb_donotknow || hb_no_hb_or_uc || hb_uc_no_hb), error: "Outstanding amount for basic rent and/or benefit eligible charges can not be 'Yes' if tenant is not in receipt of housing benefit or universal benefit or if benefit is unknown" }, + { condition: is_yes && (hb_donotknow || hb_none || hb_uc_no_hb), error: "Outstanding amount for basic rent and/or benefit eligible charges can not be 'Yes' if tenant is not in receipt of housing benefit or universal benefit or if benefit is unknown" }, { condition: (hb_no_uc || hb_uc_no_he_hb || hb_and_uc) && !is_present, error: "Must be completed if Universal credit and/or Housing Benefit received" }, ] diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index 559730ae5..7ff6ab57c 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -1799,10 +1799,10 @@ } }, "rent_and_charges": { - "label": "Rent and charges", + "label": "Finances", "subsections": { "income_and_benefits": { - "label": "Income and benefits", + "label": "Income, benefits and outgoings", "depends_on": { "about_this_log": "completed" }, "pages": { "net_income_known": { @@ -1826,7 +1826,9 @@ } }, "weekly_net_income": { - "depends_on": { "net_income_known": "Yes – the household has a weekly income" }, + "depends_on": { + "net_income_known": "Yes – the household has a weekly income" + }, "header": "", "description": "", "questions": { @@ -1852,7 +1854,9 @@ } }, "monthly_net_income": { - "depends_on": { "net_income_known": "Yes – the household has a monthly income" }, + "depends_on": { + "net_income_known": "Yes – the household has a monthly income" + }, "header": "", "description": "", "questions": { @@ -1878,7 +1882,9 @@ } }, "yearly_net_income": { - "depends_on": { "net_income_known": "Yes – the household has a yearly income" }, + "depends_on": { + "net_income_known": "Yes – the household has a yearly income" + }, "header": "", "description": "", "questions": { @@ -1903,43 +1909,43 @@ } } }, - "net_income_uc_proportion": { + "housing_benefit": { "header": "", "description": "", "questions": { - "benefits": { - "check_answer_label": "Benefits as a proportion of income", - "header": "How much of the tenant’s income is from Universal Credit, state pensions or benefits?", + "hb": { + "check_answer_label": "Universal Credit & Housing Benefit", + "header": "Is the household likely to be receiving any of these housing-related benefits?", "hint_text": "", "type": "radio", "answer_options": { - "0": "All", - "1": "Some", - "2": "None", + "0": "1. Housing benefit", + "1": "6. Universal Credit with housing element (excluding housing benefit)", + "2": "8. Housing benefit and Universal Credit (without housing element)", + "3": "7. Universal Credit (without housing element)", + "4": "9. None", "divider": true, - "3": "Don’t know" + "5": "3. Don't know", + "6": "10. Tenant prefers not to say" } } } }, - "housing_benefit": { + "net_income_uc_proportion": { "header": "", "description": "", "questions": { - "hb": { - "check_answer_label": "Housing-related benefits received", - "header": "Is the tenant likely to be in receipt of any of these housing-related benefits?", + "benefits": { + "check_answer_label": "Benefits as a proportion of income", + "header": "How much of the tenant’s income is from Universal Credit, state pensions or benefits?", "hint_text": "", "type": "radio", "answer_options": { - "0": "Housing Benefit, but not Universal Credit", - "1": "Universal Credit with housing element, but not Housing Benefit", - "2": "Universal Credit without housing element and no Housing Benefit", - "3": "Universal Credit and Housing Benefit", - "4": "Not Housing Benefit or Universal Credit", + "0": "All", + "1": "Some", + "2": "None", "divider": true, - "5": "Don’t know", - "6": "Prefer not to say" + "3": "Don’t know" } } } diff --git a/docs/api/DLUHC-CORE-Data.v1.json b/docs/api/DLUHC-CORE-Data.v1.json index 298d7ac1e..7af091291 100644 --- a/docs/api/DLUHC-CORE-Data.v1.json +++ b/docs/api/DLUHC-CORE-Data.v1.json @@ -323,7 +323,7 @@ "earnings": 1000, "incfreq": "Monthly", "benefits": "Some", - "hb": "Universal Credit with housing element, but not Housing Benefit", + "hb": "6. Universal Credit with housing element (excluding housing benefit)", "period": "Weekly", "brent": 200, "scharge": 50, diff --git a/spec/features/form/helpers.rb b/spec/features/form/helpers.rb index 8f43b76e6..260f4f659 100644 --- a/spec/features/form/helpers.rb +++ b/spec/features/form/helpers.rb @@ -12,7 +12,7 @@ module Helpers click_button("Save and continue") choose("case-log-benefits-all-field") click_button("Save and continue") - choose("case-log-hb-prefer-not-to-say-field") + choose("case-log-hb-10-tenant-prefers-not-to-say-field") click_button("Save and continue") end diff --git a/spec/fixtures/complete_case_log.json b/spec/fixtures/complete_case_log.json index 1c8b61097..2cd8e44a2 100644 --- a/spec/fixtures/complete_case_log.json +++ b/spec/fixtures/complete_case_log.json @@ -77,7 +77,7 @@ "net_income_known": "Yes – the household has a weekly income", "earnings": 150, "benefits": "Some", - "hb": "Universal Credit with housing element, but not Housing Benefit", + "hb": "6. Universal Credit with housing element (excluding housing benefit)", "period": "Fortnightly", "brent": 200, "scharge": 50, diff --git a/spec/fixtures/forms/2021_2022.json b/spec/fixtures/forms/2021_2022.json index 6edb3608b..e6c885a8a 100644 --- a/spec/fixtures/forms/2021_2022.json +++ b/spec/fixtures/forms/2021_2022.json @@ -417,11 +417,11 @@ "header": "Is the tenant likely to be in receipt of any of these housing-related benefits?", "type": "radio", "answer_options": { - "0": "Housing Benefit, but not Universal Credit", - "1": "Prefer not to say" + "0": "1. Housing benefit", + "1": "10. Tenant prefers not to say" }, "conditional_for": { - "conditional_question": ["Housing Benefit, but not Universal Credit"] + "conditional_question": ["1. Housing benefit"] } }, "conditional_question": { diff --git a/spec/models/form/question_spec.rb b/spec/models/form/question_spec.rb index cc35ba516..ead70c5ea 100644 --- a/spec/models/form/question_spec.rb +++ b/spec/models/form/question_spec.rb @@ -145,7 +145,7 @@ RSpec.describe Form::Question, type: :model do end it "knows whether it is enabled or not for met conditions" do - case_log.hb = "Housing Benefit, but not Universal Credit" + case_log.hb = "1. Housing benefit" expect(subject.enabled?(case_log)).to be true end end