From 4fe135286d4f79541a35eebbcb048db8cd8515f1 Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 13 Sep 2023 12:23:42 +0100 Subject: [PATCH] Add pages to subsections (2023) and update content --- .../form/lettings/pages/pscharge_value_check.rb | 9 +++++++-- .../form/lettings/pages/scharge_value_check.rb | 9 +++++++-- .../form/lettings/pages/supcharg_value_check.rb | 9 +++++++-- .../form/lettings/questions/pscharge_value_check.rb | 1 + .../form/lettings/questions/scharge_value_check.rb | 1 + .../form/lettings/questions/supcharg_value_check.rb | 1 + .../form/lettings/subsections/income_and_benefits.rb | 3 +++ config/locales/en.yml | 12 +++++++++++- .../lettings/subsections/income_and_benefits_spec.rb | 3 +++ 9 files changed, 41 insertions(+), 7 deletions(-) diff --git a/app/models/form/lettings/pages/pscharge_value_check.rb b/app/models/form/lettings/pages/pscharge_value_check.rb index a6a689376..89cca160e 100644 --- a/app/models/form/lettings/pages/pscharge_value_check.rb +++ b/app/models/form/lettings/pages/pscharge_value_check.rb @@ -4,9 +4,14 @@ class Form::Lettings::Pages::PschargeValueCheck < ::Form::Page @id = "pscharge_value_check" @depends_on = [{ "pscharge_over_soft_max?" => true }] @title_text = { - "translation" => "soft_validations.pscharge.title_text", + "translation" => "soft_validations.pscharge.over_soft_max_title", + "arguments" => [{ + "key" => "pscharge", + "label" => true, + "i18n_template" => "pscharge", + }], } - @informative_text = "" + @informative_text = I18n.t("soft_validations.charges.informative_text") end def questions diff --git a/app/models/form/lettings/pages/scharge_value_check.rb b/app/models/form/lettings/pages/scharge_value_check.rb index cf4b8ea01..72ad8039e 100644 --- a/app/models/form/lettings/pages/scharge_value_check.rb +++ b/app/models/form/lettings/pages/scharge_value_check.rb @@ -4,9 +4,14 @@ class Form::Lettings::Pages::SchargeValueCheck < ::Form::Page @id = "scharge_value_check" @depends_on = [{ "scharge_over_soft_max?" => true }] @title_text = { - "translation" => "soft_validations.scharge.title_text", + "translation" => "soft_validations.scharge.over_soft_max_title", + "arguments" => [{ + "key" => "scharge", + "label" => true, + "i18n_template" => "scharge", + }], } - @informative_text = "" + @informative_text = I18n.t("soft_validations.charges.informative_text") end def questions diff --git a/app/models/form/lettings/pages/supcharg_value_check.rb b/app/models/form/lettings/pages/supcharg_value_check.rb index 60e3f2e2a..8155a28bb 100644 --- a/app/models/form/lettings/pages/supcharg_value_check.rb +++ b/app/models/form/lettings/pages/supcharg_value_check.rb @@ -4,9 +4,14 @@ class Form::Lettings::Pages::SupchargValueCheck < ::Form::Page @id = "supcharg_value_check" @depends_on = [{ "supcharg_over_soft_max?" => true }] @title_text = { - "translation" => "soft_validations.supcharg.title_text", + "translation" => "soft_validations.supcharg.over_soft_max_title", + "arguments" => [{ + "key" => "supcharg", + "label" => true, + "i18n_template" => "supcharg", + }], } - @informative_text = "" + @informative_text = I18n.t("soft_validations.charges.informative_text") end def questions diff --git a/app/models/form/lettings/questions/pscharge_value_check.rb b/app/models/form/lettings/questions/pscharge_value_check.rb index 6cbaddd54..b44979ae1 100644 --- a/app/models/form/lettings/questions/pscharge_value_check.rb +++ b/app/models/form/lettings/questions/pscharge_value_check.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::PschargeValueCheck < ::Form::Question @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "pscharge_value_check" => 0 }, { "pscharge_value_check" => 1 }] } + @hint_text = I18n.t("soft_validations.charges.hint_text") end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/scharge_value_check.rb b/app/models/form/lettings/questions/scharge_value_check.rb index 883dcc70a..1946d603f 100644 --- a/app/models/form/lettings/questions/scharge_value_check.rb +++ b/app/models/form/lettings/questions/scharge_value_check.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::SchargeValueCheck < ::Form::Question @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "scharge_value_check" => 0 }, { "scharge_value_check" => 1 }] } + @hint_text = I18n.t("soft_validations.charges.hint_text") end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/supcharg_value_check.rb b/app/models/form/lettings/questions/supcharg_value_check.rb index 462f22b82..978c5e3ef 100644 --- a/app/models/form/lettings/questions/supcharg_value_check.rb +++ b/app/models/form/lettings/questions/supcharg_value_check.rb @@ -8,6 +8,7 @@ class Form::Lettings::Questions::SupchargValueCheck < ::Form::Question @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "supcharg_value_check" => 0 }, { "supcharg_value_check" => 1 }] } + @hint_text = I18n.t("soft_validations.charges.hint_text") end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/subsections/income_and_benefits.rb b/app/models/form/lettings/subsections/income_and_benefits.rb index 25f5d0ce4..1404ebf04 100644 --- a/app/models/form/lettings/subsections/income_and_benefits.rb +++ b/app/models/form/lettings/subsections/income_and_benefits.rb @@ -26,6 +26,9 @@ class Form::Lettings::Subsections::IncomeAndBenefits < ::Form::Subsection Form::Lettings::Pages::RentMonthly.new(nil, nil, self), Form::Lettings::Pages::MinRentValueCheck.new("brent_min_rent_value_check", nil, self, check_answers_card_number: 0), Form::Lettings::Pages::MaxRentValueCheck.new("brent_max_rent_value_check", nil, self, check_answers_card_number: 0), + Form::Lettings::Pages::SchargeValueCheck.new(nil, nil, self), + Form::Lettings::Pages::PschargeValueCheck.new(nil, nil, self), + Form::Lettings::Pages::SupchargValueCheck.new(nil, nil, self), Form::Lettings::Pages::Outstanding.new(nil, nil, self), Form::Lettings::Pages::OutstandingAmount.new(nil, nil, self), ].compact diff --git a/config/locales/en.yml b/config/locales/en.yml index 26ee39438..c982f9592 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -369,7 +369,7 @@ en: less_than_shortfall: "Enter an amount that is more than the shortfall in basic rent" scharge: private_registered_provider: - general_needs: "Enter a value for the service charge between £0 and £88 per week if the landlord is a private registered provider and it is a general needs letting" + general_needs: "Enter a value for the service charge between £0 and £800 per week if the landlord is a private registered provider and it is a general needs letting" supported_housing: "Enter a value for the service charge between £0 and £800 per week if the landlord is a private registered provider and it is a supported housing letting" local_authority: general_needs: "Enter a value for the service charge between £0 and £500 per week if the landlord is a local authority and it is a general needs letting" @@ -709,6 +709,16 @@ Make sure these answers are correct." referral: title_text: "Are you sure?" hint_text: "This is a general needs log, and this referral type is for supported housing." + scharge: + over_soft_max_title: "You told us the service charge is %{scharge}" + pscharge: + over_soft_max_title: "You told us the personal service charge is %{pscharge}" + supcharg: + over_soft_max_title: "You told us the support charge is %{supcharg}" + charges: + informative_text: "This is higher than we would expect." + hint_text: "Check the following:" + devise: email: diff --git a/spec/models/form/lettings/subsections/income_and_benefits_spec.rb b/spec/models/form/lettings/subsections/income_and_benefits_spec.rb index e914ccc6a..c260ff56d 100644 --- a/spec/models/form/lettings/subsections/income_and_benefits_spec.rb +++ b/spec/models/form/lettings/subsections/income_and_benefits_spec.rb @@ -32,6 +32,9 @@ RSpec.describe Form::Lettings::Subsections::IncomeAndBenefits, type: :model do rent_monthly brent_min_rent_value_check brent_max_rent_value_check + scharge_value_check + pscharge_value_check + supcharg_value_check outstanding outstanding_amount ],