From f9922c1ba4cd20509b5362a527c182b6197013a1 Mon Sep 17 00:00:00 2001
From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com>
Date: Wed, 30 Oct 2024 16:25:20 +0000
Subject: [PATCH] CLDC-3654: Copy changes - Sales property information
questions (#2694)
---
app/helpers/formatting_helper.rb | 3 +-
.../form/lettings/pages/property_postcode.rb | 14 ---
.../form/lettings/questions/postcode_full.rb | 15 ---
.../form/lettings/questions/postcode_known.rb | 17 ----
.../subsections/property_information.rb | 6 +-
.../sales/pages/about_price_value_check.rb | 5 +-
app/models/form/sales/pages/address.rb | 2 +-
.../form/sales/pages/address_fallback.rb | 2 +-
.../form/sales/pages/address_matcher.rb | 2 +-
.../pages/monthly_charges_value_check.rb | 5 +-
.../form/sales/pages/no_address_found.rb | 5 +-
.../pages/percentage_discount_value_check.rb | 7 +-
app/models/form/sales/pages/postcode.rb | 13 ---
.../sales/pages/property_local_authority.rb | 9 +-
app/models/form/sales/pages/uprn.rb | 1 +
.../form/sales/pages/uprn_confirmation.rb | 1 -
app/models/form/sales/pages/uprn_selection.rb | 1 -
.../questions/about_price_value_check.rb | 3 +-
.../form/sales/questions/address_line1.rb | 3 +-
.../address_line1_for_address_matcher.rb | 3 +-
.../form/sales/questions/address_line2.rb | 2 +-
app/models/form/sales/questions/county.rb | 3 +-
.../questions/monthly_charges_value_check.rb | 3 +-
.../form/sales/questions/no_address_found.rb | 2 +-
.../percentage_discount_value_check.rb | 3 +-
app/models/form/sales/questions/postcode.rb | 22 -----
.../questions/postcode_for_address_matcher.rb | 2 +-
.../questions/postcode_for_full_address.rb | 3 +-
.../form/sales/questions/postcode_known.rb | 29 ------
.../sales/questions/property_building_type.rb | 3 +-
.../questions/property_local_authority.rb | 2 -
.../property_local_authority_known.rb | 26 ------
.../questions/property_number_of_bedrooms.rb | 4 +-
.../sales/questions/property_unit_type.rb | 3 +-
.../property_wheelchair_accessible.rb | 4 +-
.../form/sales/questions/town_or_city.rb | 3 +-
app/models/form/sales/questions/uprn.rb | 3 +-
.../form/sales/questions/uprn_confirmation.rb | 2 -
app/models/form/sales/questions/uprn_known.rb | 6 +-
.../form/sales/questions/uprn_selection.rb | 2 -
.../sales/subsections/property_information.rb | 12 ---
config/locales/en.yml | 14 +--
.../2023/sales/property_information.en.yml | 74 +++++++++++++++
.../forms/2023/sales/soft_validations.en.yml | 33 ++++++-
.../2024/sales/property_information.en.yml | 91 +++++++++++++++++++
.../forms/2024/sales/soft_validations.en.yml | 41 ++++++++-
.../pages/about_price_value_check_spec.rb | 7 +-
.../pages/monthly_charges_value_check_spec.rb | 7 +-
.../form/sales/pages/no_address_found_spec.rb | 7 +-
.../percentage_discount_value_check_spec.rb | 7 +-
spec/models/form/sales/pages/postcode_spec.rb | 29 ------
.../pages/property_local_authority_spec.rb | 13 ---
.../sales/questions/postcode_known_spec.rb | 47 ----------
.../form/sales/questions/postcode_spec.rb | 46 ----------
.../sales/questions/uprn_confirmation_spec.rb | 6 +-
.../form/sales/questions/uprn_known_spec.rb | 4 +-
.../subsections/property_information_spec.rb | 24 -----
57 files changed, 298 insertions(+), 408 deletions(-)
delete mode 100644 app/models/form/lettings/pages/property_postcode.rb
delete mode 100644 app/models/form/lettings/questions/postcode_full.rb
delete mode 100644 app/models/form/lettings/questions/postcode_known.rb
delete mode 100644 app/models/form/sales/pages/postcode.rb
delete mode 100644 app/models/form/sales/questions/postcode.rb
delete mode 100644 app/models/form/sales/questions/postcode_known.rb
delete mode 100644 app/models/form/sales/questions/property_local_authority_known.rb
create mode 100644 config/locales/forms/2023/sales/property_information.en.yml
create mode 100644 config/locales/forms/2024/sales/property_information.en.yml
delete mode 100644 spec/models/form/sales/pages/postcode_spec.rb
delete mode 100644 spec/models/form/sales/questions/postcode_known_spec.rb
delete mode 100644 spec/models/form/sales/questions/postcode_spec.rb
diff --git a/app/helpers/formatting_helper.rb b/app/helpers/formatting_helper.rb
index 0675d42ba..ffa8b05e9 100644
--- a/app/helpers/formatting_helper.rb
+++ b/app/helpers/formatting_helper.rb
@@ -2,7 +2,8 @@ module FormattingHelper
def format_ending(text)
return text if text.blank?
- modified_text = lowercase_first_letter(text)
+ first_word = text.split.first
+ modified_text = first_word == first_word.upcase ? text : lowercase_first_letter(text)
ensure_sentence_ending(modified_text)
end
diff --git a/app/models/form/lettings/pages/property_postcode.rb b/app/models/form/lettings/pages/property_postcode.rb
deleted file mode 100644
index a40d4140f..000000000
--- a/app/models/form/lettings/pages/property_postcode.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-class Form::Lettings::Pages::PropertyPostcode < ::Form::Page
- def initialize(id, hsh, subsection)
- super
- @id = "property_postcode"
- @depends_on = [{ "is_general_needs?" => true }]
- end
-
- def questions
- @questions ||= [
- Form::Lettings::Questions::PostcodeKnown.new(nil, nil, self),
- Form::Lettings::Questions::PostcodeFull.new(nil, nil, self),
- ]
- end
-end
diff --git a/app/models/form/lettings/questions/postcode_full.rb b/app/models/form/lettings/questions/postcode_full.rb
deleted file mode 100644
index fc7d7691b..000000000
--- a/app/models/form/lettings/questions/postcode_full.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-class Form::Lettings::Questions::PostcodeFull < ::Form::Question
- def initialize(id, hsh, page)
- super
- @id = "postcode_full"
- @check_answer_label = "Postcode"
- @header = "What is the property’s postcode?"
- @type = "text"
- @width = 5
- @inferred_check_answers_value = [{ "condition" => { "postcode_known" => 0 }, "value" => "Not known" }]
- @check_answers_card_number = 0
- @hint_text = ""
- @inferred_answers = { "la" => { "is_la_inferred" => true } }
- @disable_clearing_if_not_routed_or_dynamic_answer_options = true
- end
-end
diff --git a/app/models/form/lettings/questions/postcode_known.rb b/app/models/form/lettings/questions/postcode_known.rb
deleted file mode 100644
index ea9adb06b..000000000
--- a/app/models/form/lettings/questions/postcode_known.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-class Form::Lettings::Questions::PostcodeKnown < ::Form::Question
- def initialize(id, hsh, page)
- super
- @id = "postcode_known"
- @check_answer_label = "Do you know the property postcode?"
- @header = "Do you know the property’s postcode?"
- @type = "radio"
- @check_answers_card_number = 0
- @hint_text = ""
- @answer_options = ANSWER_OPTIONS
- @disable_clearing_if_not_routed_or_dynamic_answer_options = true
- @conditional_for = { "postcode_full" => [1] }
- @hidden_in_check_answers = { "depends_on" => [{ "postcode_known" => 0 }, { "postcode_known" => 1 }] }
- end
-
- ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "0" => { "value" => "No" } }.freeze
-end
diff --git a/app/models/form/lettings/subsections/property_information.rb b/app/models/form/lettings/subsections/property_information.rb
index 3068faf92..7b9aead2d 100644
--- a/app/models/form/lettings/subsections/property_information.rb
+++ b/app/models/form/lettings/subsections/property_information.rb
@@ -38,16 +38,12 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection
Form::Lettings::Pages::UprnSelection.new(nil, nil, self),
Form::Lettings::Pages::AddressFallback.new(nil, nil, self),
]
- elsif form.start_date.year == 2023
+ else
[
Form::Lettings::Pages::Uprn.new(nil, nil, self),
Form::Lettings::Pages::UprnConfirmation.new(nil, nil, self),
Form::Lettings::Pages::Address.new(nil, nil, self),
]
- else
- [
- Form::Lettings::Pages::PropertyPostcode.new(nil, nil, self),
- ]
end
end
diff --git a/app/models/form/sales/pages/about_price_value_check.rb b/app/models/form/sales/pages/about_price_value_check.rb
index 8b5cb45ab..41ae283dc 100644
--- a/app/models/form/sales/pages/about_price_value_check.rb
+++ b/app/models/form/sales/pages/about_price_value_check.rb
@@ -6,8 +6,9 @@ class Form::Sales::Pages::AboutPriceValueCheck < ::Form::Page
"purchase_price_out_of_soft_range?" => true,
},
]
+ @copy_key = "sales.soft_validations.value_value_check"
@title_text = {
- "translation" => "soft_validations.purchase_price.title_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "value",
@@ -17,7 +18,7 @@ class Form::Sales::Pages::AboutPriceValueCheck < ::Form::Page
],
}
@informative_text = {
- "translation" => "soft_validations.purchase_price.hint_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
diff --git a/app/models/form/sales/pages/address.rb b/app/models/form/sales/pages/address.rb
index 6bd74f8b7..be0ed9eae 100644
--- a/app/models/form/sales/pages/address.rb
+++ b/app/models/form/sales/pages/address.rb
@@ -2,7 +2,7 @@ class Form::Sales::Pages::Address < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "address"
- @header = "Q#{QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]} - What is the property's address?"
+ @copy_key = "sales.property_information.address"
@depends_on = [
{ "uprn_known" => nil },
{ "uprn_known" => 0 },
diff --git a/app/models/form/sales/pages/address_fallback.rb b/app/models/form/sales/pages/address_fallback.rb
index 3a69dabba..1f0a3f1e8 100644
--- a/app/models/form/sales/pages/address_fallback.rb
+++ b/app/models/form/sales/pages/address_fallback.rb
@@ -2,7 +2,7 @@ class Form::Sales::Pages::AddressFallback < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "address"
- @header = "Q12 - What is the property's address?"
+ @copy_key = "sales.property_information.address"
@depends_on = [
{ "uprn_known" => nil, "uprn_selection" => "uprn_not_listed" },
{ "uprn_known" => 0, "uprn_selection" => "uprn_not_listed" },
diff --git a/app/models/form/sales/pages/address_matcher.rb b/app/models/form/sales/pages/address_matcher.rb
index 5d2a38767..23b8c5c86 100644
--- a/app/models/form/sales/pages/address_matcher.rb
+++ b/app/models/form/sales/pages/address_matcher.rb
@@ -2,7 +2,7 @@ class Form::Sales::Pages::AddressMatcher < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "address_matcher"
- @header = "Find an address"
+ @copy_key = "sales.property_information.address_matcher"
@depends_on = [
{ "uprn_known" => nil },
{ "uprn_known" => 0 },
diff --git a/app/models/form/sales/pages/monthly_charges_value_check.rb b/app/models/form/sales/pages/monthly_charges_value_check.rb
index 662a048bb..f6aef088c 100644
--- a/app/models/form/sales/pages/monthly_charges_value_check.rb
+++ b/app/models/form/sales/pages/monthly_charges_value_check.rb
@@ -6,8 +6,9 @@ class Form::Sales::Pages::MonthlyChargesValueCheck < ::Form::Page
"monthly_charges_over_soft_max?" => true,
},
]
+ @copy_key = "sales.soft_validations.monthly_charges_value_check"
@title_text = {
- "translation" => "soft_validations.monthly_charges_over_soft_max.title_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
@@ -17,7 +18,7 @@ class Form::Sales::Pages::MonthlyChargesValueCheck < ::Form::Page
],
}
@informative_text = {
- "translation" => "soft_validations.monthly_charges_over_soft_max.hint_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end
diff --git a/app/models/form/sales/pages/no_address_found.rb b/app/models/form/sales/pages/no_address_found.rb
index 6e3b04f40..ae2663896 100644
--- a/app/models/form/sales/pages/no_address_found.rb
+++ b/app/models/form/sales/pages/no_address_found.rb
@@ -3,12 +3,13 @@ class Form::Sales::Pages::NoAddressFound < ::Form::Page
super
@id = "no_address_found"
@type = "interruption_screen"
+ @copy_key = "sales.soft_validations.address_search_value_check"
@title_text = {
- "translation" => "soft_validations.no_address_found.title_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [],
}
@informative_text = {
- "translation" => "soft_validations.no_address_found.informative_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
@depends_on = [
diff --git a/app/models/form/sales/pages/percentage_discount_value_check.rb b/app/models/form/sales/pages/percentage_discount_value_check.rb
index 37ff4eea4..aa8c20d75 100644
--- a/app/models/form/sales/pages/percentage_discount_value_check.rb
+++ b/app/models/form/sales/pages/percentage_discount_value_check.rb
@@ -1,15 +1,16 @@
class Form::Sales::Pages::PercentageDiscountValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
+ @depends_on = [{ "percentage_discount_invalid?" => true }]
+ @copy_key = "sales.soft_validations.percentage_discount_value_check"
@title_text = {
- "translation" => "soft_validations.percentage_discount_value.title_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "key" => "discount", "label" => true, "i18n_template" => "discount" }],
}
@informative_text = {
- "translation" => "soft_validations.percentage_discount_value.hint_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
- @depends_on = [{ "percentage_discount_invalid?" => true }]
end
def questions
diff --git a/app/models/form/sales/pages/postcode.rb b/app/models/form/sales/pages/postcode.rb
deleted file mode 100644
index c40a18845..000000000
--- a/app/models/form/sales/pages/postcode.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-class Form::Sales::Pages::Postcode < ::Form::Page
- def initialize(id, hsh, subsection)
- super
- @id = "property_postcode"
- end
-
- def questions
- @questions ||= [
- Form::Sales::Questions::PostcodeKnown.new(nil, nil, self),
- Form::Sales::Questions::Postcode.new(nil, nil, self),
- ]
- end
-end
diff --git a/app/models/form/sales/pages/property_local_authority.rb b/app/models/form/sales/pages/property_local_authority.rb
index e0289839d..649a445f9 100644
--- a/app/models/form/sales/pages/property_local_authority.rb
+++ b/app/models/form/sales/pages/property_local_authority.rb
@@ -10,14 +10,7 @@ class Form::Sales::Pages::PropertyLocalAuthority < ::Form::Page
def questions
@questions ||= [
- la_known_question,
Form::Sales::Questions::PropertyLocalAuthority.new(nil, nil, self),
- ].compact
- end
-
- def la_known_question
- if form.start_date.year < 2023
- Form::Sales::Questions::PropertyLocalAuthorityKnown.new(nil, nil, self)
- end
+ ]
end
end
diff --git a/app/models/form/sales/pages/uprn.rb b/app/models/form/sales/pages/uprn.rb
index d4c7e4d77..fce51e543 100644
--- a/app/models/form/sales/pages/uprn.rb
+++ b/app/models/form/sales/pages/uprn.rb
@@ -2,6 +2,7 @@ class Form::Sales::Pages::Uprn < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "uprn"
+ @copy_key = "sales.property_information.uprn"
end
def questions
diff --git a/app/models/form/sales/pages/uprn_confirmation.rb b/app/models/form/sales/pages/uprn_confirmation.rb
index d553972a3..9cc2ccf94 100644
--- a/app/models/form/sales/pages/uprn_confirmation.rb
+++ b/app/models/form/sales/pages/uprn_confirmation.rb
@@ -2,7 +2,6 @@ class Form::Sales::Pages::UprnConfirmation < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "uprn_confirmation"
- @header = "We found an address that might be this property"
end
def questions
diff --git a/app/models/form/sales/pages/uprn_selection.rb b/app/models/form/sales/pages/uprn_selection.rb
index 94f35540f..6dc5bb2bc 100644
--- a/app/models/form/sales/pages/uprn_selection.rb
+++ b/app/models/form/sales/pages/uprn_selection.rb
@@ -2,7 +2,6 @@ class Form::Sales::Pages::UprnSelection < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "uprn_selection"
- @header = "We found some addresses that might be this property"
@depends_on = [
{ "uprn_known" => nil, "address_options_present?" => true },
{ "uprn_known" => 0, "address_options_present?" => true },
diff --git a/app/models/form/sales/questions/about_price_value_check.rb b/app/models/form/sales/questions/about_price_value_check.rb
index 2b51cd7fb..52f7b156f 100644
--- a/app/models/form/sales/questions/about_price_value_check.rb
+++ b/app/models/form/sales/questions/about_price_value_check.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::AboutPriceValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "value_value_check"
- @check_answer_label = "Purchase price confirmation"
- @header = "Are you sure?"
+ @copy_key = "sales.soft_validations.value_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },
diff --git a/app/models/form/sales/questions/address_line1.rb b/app/models/form/sales/questions/address_line1.rb
index f72aaea96..f7a4c7c2d 100644
--- a/app/models/form/sales/questions/address_line1.rb
+++ b/app/models/form/sales/questions/address_line1.rb
@@ -2,11 +2,10 @@ class Form::Sales::Questions::AddressLine1 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "address_line1"
- @header = "Address line 1"
+ @copy_key = "sales.property_information.address.address_line1"
@error_label = "Address line 1"
@type = "text"
@plain_label = true
- @check_answer_label = "Address lines 1 and 2"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hide_question_number_on_page = true
diff --git a/app/models/form/sales/questions/address_line1_for_address_matcher.rb b/app/models/form/sales/questions/address_line1_for_address_matcher.rb
index fd1211b69..cfc086f7b 100644
--- a/app/models/form/sales/questions/address_line1_for_address_matcher.rb
+++ b/app/models/form/sales/questions/address_line1_for_address_matcher.rb
@@ -2,11 +2,10 @@ class Form::Sales::Questions::AddressLine1ForAddressMatcher < ::Form::Question
def initialize(id, hsh, page)
super
@id = "address_line1_input"
- @header = "Address line 1"
+ @copy_key = "sales.property_information.address_matcher.address_line1_input"
@error_label = "Address line 1"
@type = "text"
@plain_label = true
- @check_answer_label = "Find address"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
@hide_question_number_on_page = true
end
diff --git a/app/models/form/sales/questions/address_line2.rb b/app/models/form/sales/questions/address_line2.rb
index 94396a2af..521d1dc58 100644
--- a/app/models/form/sales/questions/address_line2.rb
+++ b/app/models/form/sales/questions/address_line2.rb
@@ -2,7 +2,7 @@ class Form::Sales::Questions::AddressLine2 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "address_line2"
- @header = "Address line 2 (optional)"
+ @copy_key = "sales.property_information.address.address_line2"
@type = "text"
@plain_label = true
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
diff --git a/app/models/form/sales/questions/county.rb b/app/models/form/sales/questions/county.rb
index d95d90e73..8f92a5480 100644
--- a/app/models/form/sales/questions/county.rb
+++ b/app/models/form/sales/questions/county.rb
@@ -2,10 +2,9 @@ class Form::Sales::Questions::County < ::Form::Question
def initialize(id, hsh, page)
super
@id = "county"
- @header = "County (optional)"
+ @copy_key = "sales.property_information.address.county"
@type = "text"
@plain_label = true
- @check_answer_label = "County"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hide_question_number_on_page = true
diff --git a/app/models/form/sales/questions/monthly_charges_value_check.rb b/app/models/form/sales/questions/monthly_charges_value_check.rb
index 90fcf4545..615238cda 100644
--- a/app/models/form/sales/questions/monthly_charges_value_check.rb
+++ b/app/models/form/sales/questions/monthly_charges_value_check.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::MonthlyChargesValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "monthly_charges_value_check"
- @check_answer_label = "Monthly charges confirmation"
- @header = "Are you sure this is correct?"
+ @copy_key = "sales.soft_validations.monthly_charges_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },
diff --git a/app/models/form/sales/questions/no_address_found.rb b/app/models/form/sales/questions/no_address_found.rb
index 0db041111..06d92b594 100644
--- a/app/models/form/sales/questions/no_address_found.rb
+++ b/app/models/form/sales/questions/no_address_found.rb
@@ -2,7 +2,7 @@ class Form::Sales::Questions::NoAddressFound < ::Form::Question
def initialize(id, hsh, page)
super
@id = "address_search_value_check"
- @header = "No address found"
+ @copy_key = "sales.soft_validations.address_search_value_check"
@type = "interruption_screen"
@hidden_in_check_answers = true
end
diff --git a/app/models/form/sales/questions/percentage_discount_value_check.rb b/app/models/form/sales/questions/percentage_discount_value_check.rb
index 9ac5547b4..5a1e7a045 100644
--- a/app/models/form/sales/questions/percentage_discount_value_check.rb
+++ b/app/models/form/sales/questions/percentage_discount_value_check.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::PercentageDiscountValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "percentage_discount_value_check"
- @check_answer_label = "Percentage discount confirmation"
- @header = "Are you sure this is correct?"
+ @copy_key = "sales.soft_validations.percentage_discount_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },
diff --git a/app/models/form/sales/questions/postcode.rb b/app/models/form/sales/questions/postcode.rb
deleted file mode 100644
index 55e33199a..000000000
--- a/app/models/form/sales/questions/postcode.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-class Form::Sales::Questions::Postcode < ::Form::Question
- def initialize(id, hsh, page)
- super
- @id = "postcode_full"
- @check_answer_label = "Property’s postcode"
- @header = "Postcode"
- @type = "text"
- @width = 5
- @inferred_check_answers_value = [{
- "condition" => {
- "pcodenk" => 1,
- },
- "value" => "Not known",
- }]
- @inferred_answers = {
- "la" => {
- "is_la_inferred" => true,
- },
- }
- @disable_clearing_if_not_routed_or_dynamic_answer_options = true
- end
-end
diff --git a/app/models/form/sales/questions/postcode_for_address_matcher.rb b/app/models/form/sales/questions/postcode_for_address_matcher.rb
index 421cdc4fc..945bdc2ad 100644
--- a/app/models/form/sales/questions/postcode_for_address_matcher.rb
+++ b/app/models/form/sales/questions/postcode_for_address_matcher.rb
@@ -2,7 +2,7 @@ class Form::Sales::Questions::PostcodeForAddressMatcher < ::Form::Question
def initialize(id, hsh, page)
super
@id = "postcode_full_input"
- @header = "Postcode"
+ @copy_key = "sales.property_information.address_matcher.postcode_full_input"
@type = "text"
@width = 5
@plain_label = true
diff --git a/app/models/form/sales/questions/postcode_for_full_address.rb b/app/models/form/sales/questions/postcode_for_full_address.rb
index 74c235ab7..34fbea00b 100644
--- a/app/models/form/sales/questions/postcode_for_full_address.rb
+++ b/app/models/form/sales/questions/postcode_for_full_address.rb
@@ -2,7 +2,7 @@ class Form::Sales::Questions::PostcodeForFullAddress < ::Form::Question
def initialize(id, hsh, page)
super
@id = "postcode_full"
- @header = "Postcode"
+ @copy_key = "sales.property_information.address.postcode_full"
@type = "text"
@width = 5
@inferred_check_answers_value = [{
@@ -17,7 +17,6 @@ class Form::Sales::Questions::PostcodeForFullAddress < ::Form::Question
},
}
@plain_label = true
- @check_answer_label = "Postcode"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hide_question_number_on_page = true
diff --git a/app/models/form/sales/questions/postcode_known.rb b/app/models/form/sales/questions/postcode_known.rb
deleted file mode 100644
index 10a3e2765..000000000
--- a/app/models/form/sales/questions/postcode_known.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-class Form::Sales::Questions::PostcodeKnown < ::Form::Question
- def initialize(id, hsh, page)
- super
- @id = "pcodenk"
- @check_answer_label = "Property’s postcode"
- @header = "Do you know the property’s postcode?"
- @type = "radio"
- @answer_options = ANSWER_OPTIONS
- @conditional_for = {
- "postcode_full" => [0],
- }
- @hidden_in_check_answers = {
- "depends_on" => [
- {
- "pcodenk" => 0,
- },
- {
- "pcodenk" => 1,
- },
- ],
- }
- @disable_clearing_if_not_routed_or_dynamic_answer_options = true
- end
-
- ANSWER_OPTIONS = {
- "0" => { "value" => "Yes" },
- "1" => { "value" => "No" },
- }.freeze
-end
diff --git a/app/models/form/sales/questions/property_building_type.rb b/app/models/form/sales/questions/property_building_type.rb
index f8f7e3905..42b65a57a 100644
--- a/app/models/form/sales/questions/property_building_type.rb
+++ b/app/models/form/sales/questions/property_building_type.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::PropertyBuildingType < ::Form::Question
def initialize(id, hsh, page)
super
@id = "builtype"
- @check_answer_label = "Type of building"
- @header = "What type of building is the property?"
+ @copy_key = "sales.property_information.builtype"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
diff --git a/app/models/form/sales/questions/property_local_authority.rb b/app/models/form/sales/questions/property_local_authority.rb
index 2a8d3cc69..053ee8fde 100644
--- a/app/models/form/sales/questions/property_local_authority.rb
+++ b/app/models/form/sales/questions/property_local_authority.rb
@@ -2,8 +2,6 @@ class Form::Sales::Questions::PropertyLocalAuthority < ::Form::Question
def initialize(id, hsh, page)
super
@id = "la"
- @check_answer_label = "Local authority"
- @header = "What is the property’s local authority?"
@type = "select"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
diff --git a/app/models/form/sales/questions/property_local_authority_known.rb b/app/models/form/sales/questions/property_local_authority_known.rb
deleted file mode 100644
index b18486c6a..000000000
--- a/app/models/form/sales/questions/property_local_authority_known.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-class Form::Sales::Questions::PropertyLocalAuthorityKnown < ::Form::Question
- def initialize(id, hsh, page)
- super
- @id = "la_known"
- @check_answer_label = "Local authority known"
- @header = "Do you know the property’s local authority?"
- @type = "radio"
- @answer_options = ANSWER_OPTIONS
- @conditional_for = { "la" => [1] }
- @hidden_in_check_answers = {
- "depends_on" => [
- {
- "la_known" => 1,
- },
- ],
- }
- @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
- end
-
- ANSWER_OPTIONS = {
- "1" => { "value" => "Yes" },
- "0" => { "value" => "No" },
- }.freeze
-
- QUESTION_NUMBER_FROM_YEAR = { 2023 => 16, 2024 => 17 }.freeze
-end
diff --git a/app/models/form/sales/questions/property_number_of_bedrooms.rb b/app/models/form/sales/questions/property_number_of_bedrooms.rb
index b8462b6fa..c394fe334 100644
--- a/app/models/form/sales/questions/property_number_of_bedrooms.rb
+++ b/app/models/form/sales/questions/property_number_of_bedrooms.rb
@@ -2,9 +2,7 @@ class Form::Sales::Questions::PropertyNumberOfBedrooms < ::Form::Question
def initialize(id, hsh, page)
super
@id = "beds"
- @check_answer_label = "Number of bedrooms"
- @header = "How many bedrooms does the property have?"
- @hint_text = "A bedsit has 1 bedroom"
+ @copy_key = "sales.property_information.beds"
@type = "numeric"
@width = 2
@min = 1
diff --git a/app/models/form/sales/questions/property_unit_type.rb b/app/models/form/sales/questions/property_unit_type.rb
index 1622473ec..45e935941 100644
--- a/app/models/form/sales/questions/property_unit_type.rb
+++ b/app/models/form/sales/questions/property_unit_type.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::PropertyUnitType < ::Form::Question
def initialize(id, hsh, page)
super
@id = "proptype"
- @check_answer_label = "Type of unit"
- @header = "What type of unit is the property?"
+ @copy_key = "sales.property_information.proptype"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
diff --git a/app/models/form/sales/questions/property_wheelchair_accessible.rb b/app/models/form/sales/questions/property_wheelchair_accessible.rb
index 1569725c5..fd79bda9e 100644
--- a/app/models/form/sales/questions/property_wheelchair_accessible.rb
+++ b/app/models/form/sales/questions/property_wheelchair_accessible.rb
@@ -2,12 +2,10 @@ class Form::Sales::Questions::PropertyWheelchairAccessible < ::Form::Question
def initialize(id, hsh, page)
super
@id = "wchair"
- @check_answer_label = "Property built or adapted to wheelchair-user standards"
- @header = "Is the property built or adapted to wheelchair-user standards?"
+ @copy_key = "sales.property_information.wchair"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
- @hint_text = form.start_year_after_2024? ? "This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property." : nil
end
ANSWER_OPTIONS = {
diff --git a/app/models/form/sales/questions/town_or_city.rb b/app/models/form/sales/questions/town_or_city.rb
index 18f6298f3..9536c024f 100644
--- a/app/models/form/sales/questions/town_or_city.rb
+++ b/app/models/form/sales/questions/town_or_city.rb
@@ -2,10 +2,9 @@ class Form::Sales::Questions::TownOrCity < ::Form::Question
def initialize(id, hsh, page)
super
@id = "town_or_city"
- @header = "Town or city"
+ @copy_key = "sales.property_information.address.town_or_city"
@type = "text"
@plain_label = true
- @check_answer_label = "Town or city"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hide_question_number_on_page = true
diff --git a/app/models/form/sales/questions/uprn.rb b/app/models/form/sales/questions/uprn.rb
index 94aaccb43..ea0df85ab 100644
--- a/app/models/form/sales/questions/uprn.rb
+++ b/app/models/form/sales/questions/uprn.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::Uprn < ::Form::Question
def initialize(id, hsh, page)
super
@id = "uprn"
- @check_answer_label = "UPRN"
- @header = "What is the property's UPRN?"
+ @copy_key = "sales.property_information.uprn.uprn"
@type = "text"
@width = 10
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
diff --git a/app/models/form/sales/questions/uprn_confirmation.rb b/app/models/form/sales/questions/uprn_confirmation.rb
index 6954a6ea5..94c1afa36 100644
--- a/app/models/form/sales/questions/uprn_confirmation.rb
+++ b/app/models/form/sales/questions/uprn_confirmation.rb
@@ -2,9 +2,7 @@ class Form::Sales::Questions::UprnConfirmation < ::Form::Question
def initialize(id, hsh, page)
super
@id = "uprn_confirmed"
- @header = "Is this the property address?"
@type = "radio"
- @check_answer_label = "Is this the right address?"
end
def answer_options
diff --git a/app/models/form/sales/questions/uprn_known.rb b/app/models/form/sales/questions/uprn_known.rb
index fdd0c9e9a..e35642bee 100644
--- a/app/models/form/sales/questions/uprn_known.rb
+++ b/app/models/form/sales/questions/uprn_known.rb
@@ -2,13 +2,9 @@ class Form::Sales::Questions::UprnKnown < ::Form::Question
def initialize(id, hsh, page)
super
@id = "uprn_known"
- @check_answer_label = "UPRN known?"
- @header = "Do you know the property's UPRN?"
+ @copy_key = "sales.property_information.uprn.uprn_known"
@type = "radio"
@answer_options = ANSWER_OPTIONS
- @hint_text = "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.
- The UPRN may not be the same as the property reference assigned by your organisation.
- If you don’t know the UPRN you can enter the address of the property instead on the next screen."
@conditional_for = { "uprn" => [1] }
@inferred_check_answers_value = [
{
diff --git a/app/models/form/sales/questions/uprn_selection.rb b/app/models/form/sales/questions/uprn_selection.rb
index f916dcd47..282aed353 100644
--- a/app/models/form/sales/questions/uprn_selection.rb
+++ b/app/models/form/sales/questions/uprn_selection.rb
@@ -2,9 +2,7 @@ class Form::Sales::Questions::UprnSelection < ::Form::Question
def initialize(id, hsh, page)
super
@id = "uprn_selection"
- @header = "Select the correct address"
@type = "radio"
- @check_answer_label = "Select the correct address"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
end
diff --git a/app/models/form/sales/subsections/property_information.rb b/app/models/form/sales/subsections/property_information.rb
index 2c530ab60..c59c159ae 100644
--- a/app/models/form/sales/subsections/property_information.rb
+++ b/app/models/form/sales/subsections/property_information.rb
@@ -16,7 +16,6 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection
Form::Sales::Pages::PercentageDiscountValueCheck.new("percentage_discount_proptype_value_check", nil, self),
Form::Sales::Pages::PropertyBuildingType.new(nil, nil, self),
(uprn_questions if form.start_date.year == 2023),
- (postcode_and_la_questions if form.start_date.year < 2023),
Form::Sales::Pages::PropertyWheelchairAccessible.new(nil, nil, self),
].flatten.compact
end
@@ -49,15 +48,4 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection
]
end
end
-
- def postcode_and_la_questions
- [
- Form::Sales::Pages::Postcode.new(nil, nil, self),
- Form::Sales::Pages::PropertyLocalAuthority.new(nil, nil, self),
- Form::Sales::Pages::Buyer1IncomeMaxValueCheck.new("local_authority_buyer_1_income_max_value_check", nil, self, check_answers_card_number: nil),
- Form::Sales::Pages::Buyer2IncomeMaxValueCheck.new("local_authority_buyer_2_income_max_value_check", nil, self, check_answers_card_number: nil),
- Form::Sales::Pages::CombinedIncomeMaxValueCheck.new("local_authority_combined_income_max_value_check", nil, self, check_answers_card_number: nil),
- Form::Sales::Pages::AboutPriceValueCheck.new("about_price_la_value_check", nil, self),
- ]
- end
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 7ed8f42e8..a0d31fee5 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -234,7 +234,7 @@ en:
scheme_deleted: "%{service_name} has been deleted."
user_deleted: "%{name} has been deleted."
organisation_deleted: "%{name} has been deleted."
- user_updated:
+ user_updated:
self: "Your account details have been updated."
other: "%{name}’s details have been updated."
@@ -650,9 +650,6 @@ en:
outside_range_title: "You told us the rent is %{brent}."
informative_text: "This is %{higher_or_lower} than we would expect."
hint_text: "Check the following: