Browse Source

Update validation message: extra borrowing

pull/1584/head
Kat 3 years ago
parent
commit
e2d7a361c0
  1. 14
      app/models/form/sales/pages/extra_borrowing_value_check.rb
  2. 6
      app/models/sales_log.rb
  3. 3
      config/locales/en.yml

14
app/models/form/sales/pages/extra_borrowing_value_check.rb

@ -7,9 +7,19 @@ class Form::Sales::Pages::ExtraBorrowingValueCheck < Form::Page
},
]
@title_text = {
"translation" => "soft_validations.extra_borrowing.title",
"translation" => "soft_validations.extra_borrowing.title_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
"arguments_for_key" => "mortgage_and_deposit_total",
"i18n_template" => "mortgage_and_deposit_total",
},
],
}
@informative_text = {
"translation" => "soft_validations.extra_borrowing.hint_text",
"arguments" => [],
}
@informative_text = {}
end
def questions

6
app/models/sales_log.rb

@ -219,6 +219,12 @@ class SalesLog < Log
value * equity / 100
end
def mortgage_and_deposit_total
return unless mortgage && deposit
mortgage + deposit
end
def process_postcode(postcode, postcode_known_key, la_inferred_key, la_key)
return if postcode.blank?

3
config/locales/en.yml

@ -543,7 +543,8 @@ en:
title: "You told us this person is %{age} or over and not retired"
hint_text: "The minimum expected retirement age for %{gender} in England is %{age}."
extra_borrowing:
title: "The mortgage and deposit are higher than the purchase minus the discount"
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."
pregnancy:
title: "You told us somebody in the household is pregnant"
no_females: "You also told us there are no female tenants living at the property."

Loading…
Cancel
Save