Browse Source

Extract property information soft validations

pull/2735/head
Kat 2 years ago
parent
commit
50169ffd3e
  1. 5
      app/models/form/lettings/pages/property_major_repairs_value_check.rb
  2. 5
      app/models/form/lettings/pages/void_date_value_check.rb
  3. 3
      app/models/form/lettings/questions/major_repairs_date_value_check.rb
  4. 3
      app/models/form/lettings/questions/void_date_value_check.rb
  5. 6
      config/locales/en.yml
  6. 14
      config/locales/forms/2023/lettings/soft_validations.en.yml

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

@ -2,10 +2,11 @@ class Form::Lettings::Pages::PropertyMajorRepairsValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_major_repairs_value_check"
@copy_key = "lettings.soft_validations.major_repairs_date_value_check"
@depends_on = [{ "major_repairs_date_in_soft_range?" => true }]
@title_text = { "translation" => "soft_validations.major_repairs_date.title_text" }
@title_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text" }
@informative_text = {
"translation" => "soft_validations.major_repairs_date.hint_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [],
}
end

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

@ -2,10 +2,11 @@ class Form::Lettings::Pages::VoidDateValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "void_date_value_check"
@copy_key = "lettings.soft_validations.void_date_value_check"
@depends_on = [{ "voiddate_in_soft_range?" => true }]
@title_text = { "translation" => "soft_validations.void_date.title_text" }
@title_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text" }
@informative_text = {
"translation" => "soft_validations.void_date.hint_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end

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

@ -2,8 +2,7 @@ class Form::Lettings::Questions::MajorRepairsDateValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "major_repairs_date_value_check"
@check_answer_label = "Major repairs date confirmation"
@header = "Are you sure the property has been vacant for this long?"
@copy_key = "lettings.soft_validations.major_repairs_date_value_check"
@type = "interruption_screen"
@check_answers_card_number = 0
@answer_options = ANSWER_OPTIONS

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

@ -2,8 +2,7 @@ class Form::Lettings::Questions::VoidDateValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "void_date_value_check"
@check_answer_label = "Void date confirmation"
@header = "Are you sure the property has been vacant for this long?"
@copy_key = "lettings.soft_validations.void_date_value_check"
@type = "interruption_screen"
@check_answers_card_number = 0
@answer_options = ANSWER_OPTIONS

6
config/locales/en.yml

@ -651,12 +651,6 @@ Make sure these answers are correct."
extra_borrowing:
title_text: "You told us that the mortgage and deposit total is %{mortgage_and_deposit_total}."
hint_text: "This is higher than the purchase price minus the discount."
major_repairs_date:
title_text: "You told us the property has been vacant for 2 years."
hint_text: "This is higher than we would expect."
void_date:
title_text: "You told us that the property has been vacant for more than 2 years."
hint_text: "This is higher than we would expect."
shared_ownership_deposit:
title_text: "You told us that the %{mortgage_deposit_and_discount_error_fields} add up to %{mortgage_deposit_and_discount_total}."
staircase_bought_seems_high:

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

@ -114,4 +114,18 @@ en:
title_text: "You told us the support charge is %{supcharg}."
informative_text: "This is higher than we would expect."
void_date_value_check:
page_header: ""
check_answer_label: "Void date confirmation"
hint_text: ""
question_text: "Are you sure the property has been vacant for this long?"
title_text: "You told us that the property has been vacant for more than 2 years."
informative_text: "This is higher than we would expect."
major_repairs_date_value_check:
page_header: ""
check_answer_label: "Major repairs date confirmation"
hint_text: ""
question_text: "Are you sure the property has been vacant for this long?"
title_text: "You told us the property has been vacant for 2 years."
informative_text: "This is higher than we would expect."

Loading…
Cancel
Save