Browse Source

Extract household situation soft validations

pull/2735/head
Kat 2 years ago
parent
commit
888ed3291c
  1. 5
      app/models/form/lettings/pages/reasonother_value_check.rb
  2. 5
      app/models/form/lettings/pages/referral_value_check.rb
  3. 3
      app/models/form/lettings/questions/reasonother_value_check.rb
  4. 3
      app/models/form/lettings/questions/referral_value_check.rb
  5. 8
      config/locales/en.yml
  6. 18
      config/locales/forms/2023/lettings/soft_validations.en.yml

5
app/models/form/lettings/pages/reasonother_value_check.rb

@ -2,13 +2,14 @@ class Form::Lettings::Pages::ReasonotherValueCheck < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "reasonother_value_check" @id = "reasonother_value_check"
@copy_key = "lettings.soft_validations.reasonother_value_check"
@depends_on = [{ "reasonother_might_be_existing_category?" => true }] @depends_on = [{ "reasonother_might_be_existing_category?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.reasonother.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "key" => "reasonother", "i18n_template" => "reasonother" }], "arguments" => [{ "key" => "reasonother", "i18n_template" => "reasonother" }],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.reasonother.informative_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
end end

5
app/models/form/lettings/pages/referral_value_check.rb

@ -2,12 +2,13 @@ class Form::Lettings::Pages::ReferralValueCheck < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "referral_value_check" @id = "referral_value_check"
@copy_key = "lettings.soft_validations.referral_value_check"
@depends_on = [{ "la_referral_for_general_needs?" => true }] @depends_on = [{ "la_referral_for_general_needs?" => true }]
@title_text = { @title_text = {
"translation" => "soft_validations.referral.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.referral.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
end end

3
app/models/form/lettings/questions/reasonother_value_check.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::ReasonotherValueCheck < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "reasonother_value_check" @id = "reasonother_value_check"
@check_answer_label = "Reason other confirmation" @copy_key = "lettings.soft_validations.reasonother_value_check"
@header = "Are you sure this doesn’t fit an existing category?"
@type = "interruption_screen" @type = "interruption_screen"
@check_answers_card_number = 0 @check_answers_card_number = 0
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS

3
app/models/form/lettings/questions/referral_value_check.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::ReferralValueCheck < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "referral_value_check" @id = "referral_value_check"
@check_answer_label = "Referral confirmation" @copy_key = "lettings.soft_validations.referral_value_check"
@header = "Are you sure?"
@type = "interruption_screen" @type = "interruption_screen"
@check_answers_card_number = 0 @check_answers_card_number = 0
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS

8
config/locales/en.yml

@ -687,9 +687,6 @@ Make sure these answers are correct."
grant: grant:
title_text: "You told us that the grant amount is %{grant}." title_text: "You told us that the grant amount is %{grant}."
hint_text: "Loans, grants and subsidies are usually between £9,000 and £16,000." hint_text: "Loans, grants and subsidies are usually between £9,000 and £16,000."
referral:
title_text: "Are you sure?"
hint_text: "This is a general needs log, and this referral type is for supported housing."
scharge: scharge:
over_soft_max_title: "You told us the service charge is %{scharge}." over_soft_max_title: "You told us the service charge is %{scharge}."
pscharge: pscharge:
@ -702,11 +699,6 @@ Make sure these answers are correct."
deposit_and_mortgage: deposit_and_mortgage:
title_text: "You told us the mortgage amount was %{mortgage}, the cash deposit was %{deposit} and the discount was %{discount}." title_text: "You told us the mortgage amount was %{mortgage}, the cash deposit was %{deposit} and the discount was %{discount}."
hint_text: "We would expect the mortgage amount and the deposit added together to be the same as the purchase price minus the discount." hint_text: "We would expect the mortgage amount and the deposit added together to be the same as the purchase price minus the discount."
reasonother:
title_text: "You told us that the tenant’s main reason for leaving their last settled home was %{reasonother}."
informative_text: "The reason you have entered looks very similar to one of the existing response categories.
Please check the categories and select the appropriate one.
If the existing categories are not suitable, please confirm here to move onto the next question."
hodate: hodate:
must_be_less_than_3_years_from_saledate: "You told us practical completion or handover date is more than 3 years before sale completion date." must_be_less_than_3_years_from_saledate: "You told us practical completion or handover date is more than 3 years before sale completion date."
saledate: saledate:

18
config/locales/forms/2023/lettings/soft_validations.en.yml

@ -49,3 +49,21 @@ en:
question_text: "Are you sure this is correct?" question_text: "Are you sure this is correct?"
title_text: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant." title_text: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant."
informative_text: "Are you sure this is correct?" informative_text: "Are you sure this is correct?"
reasonother_value_check:
page_header: ""
check_answer_label: "Reason other confirmation"
hint_text: ""
question_text: "Are you sure this doesn’t fit an existing category?"
title_text: "You told us that the tenant’s main reason for leaving their last settled home was %{reasonother}."
informative_text: "The reason you have entered looks very similar to one of the existing response categories. Please check the categories and select the appropriate one. If the existing categories are not suitable, please confirm here to move onto the next question."
referral_value_check:
page_header: ""
check_answer_label: "Referral confirmation"
hint_text: ""
question_text: "Are you sure?"
title_text: "Are you sure?"
informative_text: "This is a general needs log, and this referral type is for supported housing."
Loading…
Cancel
Save