From b6f3a24db735e1453a1c1842952cc1ea66f3e8e0 Mon Sep 17 00:00:00 2001
From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com>
Date: Wed, 30 Oct 2024 15:25:33 +0000
Subject: [PATCH 01/12] Update links from dluhcdigital to mhclgdigital (#2717)
---
app/constants/global_constants.rb | 2 +-
app/helpers/merge_requests_helper.rb | 2 +-
app/views/content/accessibility_statement.md | 4 ++--
.../data_protection_confirmation_banner_component_spec.rb | 4 ++--
spec/mailers/csv_download_mailer_spec.rb | 4 ++--
spec/requests/organisations_controller_spec.rb | 2 +-
spec/views/merge_requests/show.html.erb_spec.rb | 2 +-
7 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/app/constants/global_constants.rb b/app/constants/global_constants.rb
index f42af5253..4066fb1d4 100644
--- a/app/constants/global_constants.rb
+++ b/app/constants/global_constants.rb
@@ -1,5 +1,5 @@
module GlobalConstants
- HELPDESK_URL = "https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11".freeze
+ HELPDESK_URL = "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11".freeze
COUNTRIES_ANSWER_OPTIONS = {
"" => "Select an option",
diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb
index a342ca808..6283ef42e 100644
--- a/app/helpers/merge_requests_helper.rb
+++ b/app/helpers/merge_requests_helper.rb
@@ -9,7 +9,7 @@ module MergeRequestsHelper
def request_details(merge_request)
[
{ label: "Requester", value: display_value_or_placeholder(merge_request.requester&.name) },
- { label: "Helpdesk ticket", value: merge_request.helpdesk_ticket.present? ? link_to("#{merge_request.helpdesk_ticket} (opens in a new tab)", "https://dluhcdigital.atlassian.net/browse/#{merge_request.helpdesk_ticket}", target: "_blank", rel: "noopener noreferrer") : display_value_or_placeholder(nil), action: merge_request_action(merge_request, "helpdesk_ticket") },
+ { label: "Helpdesk ticket", value: merge_request.helpdesk_ticket.present? ? link_to("#{merge_request.helpdesk_ticket} (opens in a new tab)", "https://mhclgdigital.atlassian.net/browse/#{merge_request.helpdesk_ticket}", target: "_blank", rel: "noopener noreferrer") : display_value_or_placeholder(nil), action: merge_request_action(merge_request, "helpdesk_ticket") },
{ label: "Status", value: status_tag(merge_request.status) },
]
end
diff --git a/app/views/content/accessibility_statement.md b/app/views/content/accessibility_statement.md
index a49bd999c..1d861fdcf 100644
--- a/app/views/content/accessibility_statement.md
+++ b/app/views/content/accessibility_statement.md
@@ -32,11 +32,11 @@ If you need information on this website in a different format like accessible PD
We’ll consider your request and get back to you in 2 working days.
-You can also [contact us through the helpdesk](https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11).
+You can also [contact us through the helpdesk](https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11).
### Reporting accessibility problems with this website
-We’re always looking to improve the accessibility of this website. If you find any problems not listed on this page or think we’re not meeting accessibility requirements, [contact the helpdesk](https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11).
+We’re always looking to improve the accessibility of this website. If you find any problems not listed on this page or think we’re not meeting accessibility requirements, [contact the helpdesk](https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11).
### Enforcement procedure
diff --git a/spec/components/data_protection_confirmation_banner_component_spec.rb b/spec/components/data_protection_confirmation_banner_component_spec.rb
index 608628093..fb687f25c 100644
--- a/spec/components/data_protection_confirmation_banner_component_spec.rb
+++ b/spec/components/data_protection_confirmation_banner_component_spec.rb
@@ -27,7 +27,7 @@ RSpec.describe DataProtectionConfirmationBannerComponent, type: :component do
expect(component.display_banner?).to eq(true)
expect(render).to have_link(
"Contact helpdesk to assign a data protection officer",
- href: "https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11",
+ href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11",
)
expect(render).to have_selector("p", text: "To create logs your organisation must state a data protection officer. They must sign the Data Sharing Agreement.")
end
@@ -131,7 +131,7 @@ RSpec.describe DataProtectionConfirmationBannerComponent, type: :component do
expect(component.display_banner?).to eq(true)
expect(render).to have_link(
"Contact helpdesk to assign a data protection officer",
- href: "https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11",
+ href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11",
)
expect(render).to have_selector("p", text: "To create logs your organisation must state a data protection officer. They must sign the Data Sharing Agreement.")
end
diff --git a/spec/mailers/csv_download_mailer_spec.rb b/spec/mailers/csv_download_mailer_spec.rb
index 704d71e1e..138a0e4ce 100644
--- a/spec/mailers/csv_download_mailer_spec.rb
+++ b/spec/mailers/csv_download_mailer_spec.rb
@@ -42,7 +42,7 @@ RSpec.describe CsvDownloadMailer do
## Missing town or city
The town or city in some logs is missing. This data is required in the new version of CORE.\n",
how_to_fix: "You need to:\n
-- download [this spreadsheet for lettings logs](#{link}). This link will expire in one week. To request another link, [contact the CORE helpdesk](https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11).
+- download [this spreadsheet for lettings logs](#{link}). This link will expire in one week. To request another link, [contact the CORE helpdesk](https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11).
- fill in the missing address data
- check that the existing address data is correct\n",
duration: "20 minutes",
@@ -70,7 +70,7 @@ In some of your logs, the UPRN is the same as the purchaser code, but these are
If a log has the correct UPRN, leave the UPRN unchanged. If the UPRN is incorrect, clear the value and provide the full address instead. Alternatively, you can change the UPRN on the CORE system.\n",
how_to_fix: "You need to:\n
-- download [this spreadsheet for sales logs](#{link}). This link will expire in one week. To request another link, [contact the CORE helpdesk](https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11).
+- download [this spreadsheet for sales logs](#{link}). This link will expire in one week. To request another link, [contact the CORE helpdesk](https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11).
- check that the address data is correct
- correct any address errors\n",
duration: "20 minutes",
diff --git a/spec/requests/organisations_controller_spec.rb b/spec/requests/organisations_controller_spec.rb
index 223cc9e00..5a300c56c 100644
--- a/spec/requests/organisations_controller_spec.rb
+++ b/spec/requests/organisations_controller_spec.rb
@@ -497,7 +497,7 @@ RSpec.describe OrganisationsController, type: :request do
it "displays a link to merge organisations" do
expect(page).to have_content("To report a merge or update your organisation details, ")
- expect(page).to have_link("contact the helpdesk", href: "https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11")
+ expect(page).to have_link("contact the helpdesk", href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11")
end
it "does not display merge history if there is none" do
diff --git a/spec/views/merge_requests/show.html.erb_spec.rb b/spec/views/merge_requests/show.html.erb_spec.rb
index d03239d2a..c1dd47bfd 100644
--- a/spec/views/merge_requests/show.html.erb_spec.rb
+++ b/spec/views/merge_requests/show.html.erb_spec.rb
@@ -30,7 +30,7 @@ RSpec.describe "merge_requests/show.html.erb", type: :view do
it "displays the helpdesk ticket details" do
expect(rendered).to have_selector("dt", text: "Helpdesk ticket")
if merge_request.helpdesk_ticket.present?
- expect(rendered).to have_link(merge_request.helpdesk_ticket, href: "https://dluhcdigital.atlassian.net/browse/#{merge_request.helpdesk_ticket}")
+ expect(rendered).to have_link(merge_request.helpdesk_ticket, href: "https://mhclgdigital.atlassian.net/browse/#{merge_request.helpdesk_ticket}")
else
expect(rendered).to have_selector("dd", text: "You didn't answer this question")
end
From 3804a64b2e1f15fd0c3e6208bab4d4392a9fb0b4 Mon Sep 17 00:00:00 2001
From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com>
Date: Wed, 30 Oct 2024 15:45:14 +0000
Subject: [PATCH 02/12] Open links in new tab (#2722)
---
app/views/organisations/duplicate_schemes.html.erb | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/app/views/organisations/duplicate_schemes.html.erb b/app/views/organisations/duplicate_schemes.html.erb
index 427cf427c..79f7d435f 100644
--- a/app/views/organisations/duplicate_schemes.html.erb
+++ b/app/views/organisations/duplicate_schemes.html.erb
@@ -56,6 +56,8 @@
<% end %>
+
The links below open in a new tab.
+
<%= govuk_table do |table| %>
<%= table.with_head do |head| %>
<% head.with_row do |row| %>
@@ -69,7 +71,7 @@
<% duplicate_set.each do |scheme| %>
-
- <%= govuk_link_to scheme.service_name, scheme %>
+ <%= govuk_link_to scheme.service_name, scheme, target: "#" %>
<% end %>
@@ -93,6 +95,8 @@
<% end %>
+ The links below open in a new tab.
+
<%= govuk_table do |table| %>
<%= table.with_head do |head| %>
<% head.with_row do |row| %>
@@ -107,13 +111,13 @@
<% duplicate_set[:locations].each do |location| %>
-
- <%= govuk_link_to location.name, scheme_location_path(location) %>
+ <%= govuk_link_to location.name, scheme_location_path(location), target: "#" %>
<% end %>
<% end %>
<% row.with_cell do %>
- <%= govuk_link_to duplicate_set[:scheme].service_name, duplicate_set[:scheme] %>
+ <%= govuk_link_to duplicate_set[:scheme].service_name, duplicate_set[:scheme], target: "#" %>
<% end %>
<% end %>
<% end %>
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 03/12] 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:- the decimal point
- the frequency, for example every week or every calendar month
- the rent type is correct, for example affordable or social rent
"
- purchase_price:
- title_text: "You told us the purchase price is %{value}."
- hint_text: "This is %{higher_or_lower} than we would expect."
staircase_owned:
title_text:
one: "You told us that the buyer now owns %{stairowned} of the property."
@@ -684,17 +681,11 @@ Make sure these answers are correct."
staircase_bought_seems_high:
title_text: "You told us that %{percentage}% was bought in this staircasing transaction."
hint_text: "Most staircasing transactions are less than 50%"
- monthly_charges_over_soft_max:
- title_text: "You told us that the monthly charges were %{mscharge}."
- hint_text: "This is higher than we would expect."
discounted_sale_value:
title_text: "Mortgage, deposit, and grant total must equal %{value_with_discount}."
informative_text: "Your given mortgage, deposit and grant total is %{mortgage_deposit_and_grant_total}."
care_home_charges:
title_text: "Care home charges should be provided if this is a care home accommodation."
- percentage_discount_value:
- title_text: "You told us that the percentage discount is %{discount}."
- hint_text: "This is higher than we would expect."
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."
@@ -722,9 +713,6 @@ Make sure these answers are correct."
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:
must_be_less_than_3_years_from_hodate: "You told us sale completion date is more than 3 years after practical completion or handover date."
- no_address_found:
- title_text: "No address found."
- informative_text: "We could not find an address that matches your search. You can search again or continue to enter the address manually."
partner_under_16_lettings:
title: "You told us this person is aged %{age} years and has 'Partner' relationship to the lead tenant."
multiple_partners_lettings:
diff --git a/config/locales/forms/2023/sales/property_information.en.yml b/config/locales/forms/2023/sales/property_information.en.yml
new file mode 100644
index 000000000..c4dd84130
--- /dev/null
+++ b/config/locales/forms/2023/sales/property_information.en.yml
@@ -0,0 +1,74 @@
+en:
+ forms:
+ 2023:
+ sales:
+ property_information:
+ uprn:
+ page_header: ""
+ uprn_known:
+ check_answer_label: "UPRN known?"
+ 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."
+ question_text: "Do you know the property's UPRN?"
+ uprn:
+ check_answer_label: "UPRN"
+ hint_text: ""
+ question_text: "What is the property's UPRN?"
+
+ uprn_confirmed:
+ page_header: "We found an address that might be this property"
+ check_answer_label: "Is this the right address?"
+ hint_text: ""
+ question_text: "Is this the property address?"
+
+ address:
+ page_header: "Q15 - What is the property's address?"
+ address_line1:
+ check_answer_label: "Address lines 1 and 2"
+ hint_text: ""
+ question_text: "Address line 1"
+ address_line2:
+ check_answer_label: ""
+ hint_text: ""
+ question_text: "Address line 2 (optional)"
+ town_or_city:
+ check_answer_label: "Town or city"
+ hint_text: ""
+ question_text: "Town or city"
+ county:
+ check_answer_label: "County"
+ hint_text: ""
+ question_text: "County (optional)"
+ postcode_full:
+ check_answer_label: "Postcode"
+ hint_text: ""
+ question_text: "Postcode"
+
+ la:
+ page_header: ""
+ check_answer_label: "Local authority"
+ hint_text: ""
+ question_text: "What is the property’s local authority?"
+
+ beds:
+ page_header: ""
+ check_answer_label: "Number of bedrooms"
+ hint_text: "A bedsit has 1 bedroom."
+ question_text: "How many bedrooms does the property have?"
+
+ proptype:
+ page_header: ""
+ check_answer_label: "Type of unit"
+ hint_text: ""
+ question_text: "What type of unit is the property?"
+
+ builtype:
+ page_header: ""
+ check_answer_label: "Type of building"
+ hint_text: ""
+ question_text: "What type of building is the property?"
+
+ wchair:
+ page_header: ""
+ check_answer_label: "Property built or adapted to wheelchair-user standards"
+ hint_text: ""
+ question_text: "Is the property built or adapted to wheelchair-user standards?"
diff --git a/config/locales/forms/2023/sales/soft_validations.en.yml b/config/locales/forms/2023/sales/soft_validations.en.yml
index 3467b9432..11a7406e4 100644
--- a/config/locales/forms/2023/sales/soft_validations.en.yml
+++ b/config/locales/forms/2023/sales/soft_validations.en.yml
@@ -38,6 +38,7 @@ en:
max:
page_header: ""
title_text: "You told us the income of buyer 1 is %{income}. This seems high. Are you sure this is correct?"
+
income2_value_check:
check_answer_label: "Buyer 2 income confirmation"
hint_text: ""
@@ -49,12 +50,22 @@ en:
max:
page_header: ""
title_text: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?"
+
combined_income_value_check:
page_header: ""
check_answer_label: "Combined income confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us the combined income of this household is %{combined_income}. This seems high. Are you sure this is correct?"
+
+ value_value_check:
+ page_header: ""
+ check_answer_label: "Purchase price confirmation"
+ hint_text: ""
+ question_text: "Are you sure?"
+ title_text: "You told us the purchase price is %{value}."
+ informative_text: "This is %{higher_or_lower} than we would expect."
+
mortgage_value_check:
page_header: ""
check_answer_label: "Mortgage confirmation"
@@ -62,18 +73,36 @@ en:
question_text: "Are you sure that the mortgage is more than 5 times the income used for the mortgage application?"
title_text: "You told us that the mortgage amount is %{mortgage}."
informative_text: "This is more than 5 times the income, which is higher than we would expect."
+
+ monthly_charges_value_check:
+ page_header: ""
+ check_answer_label: "Monthly charges confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us that the monthly charges were %{mscharge}."
+ informative_text: "This is higher than we would expect."
+
+ percentage_discount_value_check:
+ page_header: ""
+ check_answer_label: "Percentage discount confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us that the percentage discount is %{discount}."
+ informative_text: "This is higher than we would expect."
+
savings_value_check:
page_header: ""
check_answer_label: "Savings confirmation"
hint_text: ""
question_text: "Are you sure the savings are higher than £100,000?"
joint_purchase:
- title_text: You told us the buyers’ savings were %{savings}."
+ title_text: "You told us the buyers’ savings were %{savings}."
informative_text: "This is higher than we would expect."
not_joint_purchase:
title_text: "You told us the buyer’s savings were %{savings}."
informative_text: "This is higher than we would expect."
- deposit_value_check::
+
+ deposit_value_check:
page_header: ""
check_answer_label: "Deposit confirmation"
hint_text: ""
diff --git a/config/locales/forms/2024/sales/property_information.en.yml b/config/locales/forms/2024/sales/property_information.en.yml
new file mode 100644
index 000000000..269f4fdca
--- /dev/null
+++ b/config/locales/forms/2024/sales/property_information.en.yml
@@ -0,0 +1,91 @@
+en:
+ forms:
+ 2024:
+ sales:
+ property_information:
+ uprn:
+ page_header: ""
+ uprn_known:
+ check_answer_label: "UPRN known?"
+ 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."
+ question_text: "Do you know the property's UPRN?"
+ uprn:
+ check_answer_label: "UPRN"
+ hint_text: ""
+ question_text: "What is the property's UPRN?"
+
+ uprn_confirmed:
+ page_header: "We found an address that might be this property"
+ check_answer_label: "Is this the right address?"
+ hint_text: ""
+ question_text: "Is this the property address?"
+
+ address_matcher:
+ page_header: "Find an address"
+ address_line1_input:
+ check_answer_label: "Find address"
+ hint_text: ""
+ question_text: "Address line 1"
+ postcode_full_input:
+ check_answer_label: ""
+ hint_text: ""
+ question_text: "Postcode"
+
+ uprn_selection:
+ page_header: "We found an address that might be this property"
+ check_answer_label: "Select the correct address"
+ hint_text: ""
+ question_text: "Select the correct address"
+
+ address:
+ page_header: "Q12 - What is the property's address?"
+ address_line1:
+ check_answer_label: "Address lines 1 and 2"
+ hint_text: ""
+ question_text: "Address line 1"
+ address_line2:
+ check_answer_label: ""
+ hint_text: ""
+ question_text: "Address line 2 (optional)"
+ town_or_city:
+ check_answer_label: "Town or city"
+ hint_text: ""
+ question_text: "Town or city"
+ county:
+ check_answer_label: "County"
+ hint_text: ""
+ question_text: "County (optional)"
+ postcode_full:
+ check_answer_label: "Postcode"
+ hint_text: ""
+ question_text: "Postcode"
+
+ la:
+ page_header: ""
+ check_answer_label: "Local authority"
+ hint_text: ""
+ question_text: "What is the property’s local authority?"
+
+ beds:
+ page_header: ""
+ check_answer_label: "Number of bedrooms"
+ hint_text: "A bedsit has 1 bedroom."
+ question_text: "How many bedrooms does the property have?"
+
+ proptype:
+ page_header: ""
+ check_answer_label: "Type of unit"
+ hint_text: ""
+ question_text: "What type of unit is the property?"
+
+ builtype:
+ page_header: ""
+ check_answer_label: "Type of building"
+ hint_text: ""
+ question_text: "What type of building is the property?"
+
+ wchair:
+ page_header: ""
+ check_answer_label: "Property built or adapted to wheelchair-user standards"
+ hint_text: "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."
+ question_text: "Is the property built or adapted to wheelchair-user standards?"
diff --git a/config/locales/forms/2024/sales/soft_validations.en.yml b/config/locales/forms/2024/sales/soft_validations.en.yml
index 39af6cb38..872db4679 100644
--- a/config/locales/forms/2024/sales/soft_validations.en.yml
+++ b/config/locales/forms/2024/sales/soft_validations.en.yml
@@ -38,6 +38,7 @@ en:
max:
page_header: ""
title_text: "You told us the income of buyer 1 is %{income}. This seems high. Are you sure this is correct?"
+
income2_value_check:
check_answer_label: "Buyer 2 income confirmation"
hint_text: ""
@@ -49,12 +50,23 @@ en:
max:
page_header: ""
title_text: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?"
+
combined_income_value_check:
page_header: ""
check_answer_label: "Combined income confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us the combined income of this household is %{combined_income}. This seems high. Are you sure this is correct?"
+ informative_text: ""
+
+ value_value_check:
+ page_header: ""
+ check_answer_label: "Purchase price confirmation"
+ hint_text: ""
+ question_text: "Are you sure?"
+ title_text: "You told us the purchase price is %{value}."
+ informative_text: "This is %{higher_or_lower} than we would expect."
+
mortgage_value_check:
page_header: ""
check_answer_label: "Mortgage confirmation"
@@ -62,17 +74,35 @@ en:
question_text: "Are you sure that the mortgage is more than 5 times the income used for the mortgage application?"
title_text: "You told us that the mortgage amount is %{mortgage}."
informative_text: "This is more than 5 times the income, which is higher than we would expect."
+
+ monthly_charges_value_check:
+ page_header: ""
+ check_answer_label: "Monthly charges confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us that the monthly charges were %{mscharge}."
+ informative_text: "This is higher than we would expect."
+
+ percentage_discount_value_check:
+ page_header: ""
+ check_answer_label: "Percentage discount confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us that the percentage discount is %{discount}."
+ informative_text: "This is higher than we would expect."
+
savings_value_check:
page_header: ""
check_answer_label: "Savings confirmation"
hint_text: ""
question_text: "Are you sure the savings are higher than £100,000?"
joint_purchase:
- title_text: You told us the buyers’ savings were %{savings}."
+ title_text: "You told us the buyers’ savings were %{savings}."
informative_text: "This is higher than we would expect."
not_joint_purchase:
title_text: "You told us the buyer’s savings were %{savings}."
informative_text: "This is higher than we would expect."
+
deposit_value_check:
page_header: ""
check_answer_label: "Deposit confirmation"
@@ -84,6 +114,15 @@ en:
not_joint_purchase:
title_text: "You told us the buyer’s deposit was %{deposit} and their savings were %{savings}."
informative_text: "The deposit amount is higher than we would expect for the amount of savings they have."
+
+ address_search_value_check:
+ page_header: ""
+ check_answer_label: ""
+ hint_text: ""
+ question_text: ""
+ title_text: "No address found."
+ informative_text: "We could not find an address that matches your search. You can search again or continue to enter the address manually."
+
wheel_value_check:
page_header: ""
check_answer_label: "Does anyone in the household use a wheelchair?"
diff --git a/spec/models/form/sales/pages/about_price_value_check_spec.rb b/spec/models/form/sales/pages/about_price_value_check_spec.rb
index 7d3c31537..1193768db 100644
--- a/spec/models/form/sales/pages/about_price_value_check_spec.rb
+++ b/spec/models/form/sales/pages/about_price_value_check_spec.rb
@@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::AboutPriceValueCheck, type: :model do
let(:page_id) { "savings_value_check" }
let(:page_definition) { nil }
- let(:subsection) { instance_double(Form::Subsection) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
+ let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
@@ -28,12 +29,12 @@ RSpec.describe Form::Sales::Pages::AboutPriceValueCheck, type: :model do
end
it "has the correct title_text" do
- expect(page.title_text).to eq({ "arguments" => [{ "i18n_template" => "value", "key" => "value", "label" => true }], "translation" => "soft_validations.purchase_price.title_text" })
+ expect(page.title_text).to eq({ "arguments" => [{ "i18n_template" => "value", "key" => "value", "label" => true }], "translation" => "forms.2024.sales.soft_validations.value_value_check.title_text" })
end
it "has the correct informative_text" do
expect(page.informative_text).to eq({
- "translation" => "soft_validations.purchase_price.hint_text",
+ "translation" => "forms.2024.sales.soft_validations.value_value_check.informative_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
diff --git a/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb b/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb
index cb187ecfd..ce72bbda8 100644
--- a/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb
+++ b/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb
@@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::MonthlyChargesValueCheck, type: :model do
let(:page_id) { "monthly_charges_value_check" }
let(:page_definition) { nil }
- let(:subsection) { instance_double(Form::Subsection) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
+ let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
@@ -33,13 +34,13 @@ RSpec.describe Form::Sales::Pages::MonthlyChargesValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.monthly_charges_over_soft_max.title_text",
+ "translation" => "forms.2024.sales.soft_validations.monthly_charges_value_check.title_text",
"arguments" => [{ "arguments_for_key" => "mscharge", "i18n_template" => "mscharge", "key" => "field_formatted_as_currency" }],
})
end
it "has correct informative_text" do
- expect(page.informative_text).to eq({ "arguments" => [], "translation" => "soft_validations.monthly_charges_over_soft_max.hint_text" })
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.monthly_charges_value_check.informative_text" })
end
it "has correct interruption_screen_question_ids" do
diff --git a/spec/models/form/sales/pages/no_address_found_spec.rb b/spec/models/form/sales/pages/no_address_found_spec.rb
index 1a40abba4..b6dbd677e 100644
--- a/spec/models/form/sales/pages/no_address_found_spec.rb
+++ b/spec/models/form/sales/pages/no_address_found_spec.rb
@@ -5,8 +5,9 @@ RSpec.describe Form::Sales::Pages::NoAddressFound, type: :model do
let(:page_id) { nil }
let(:page_definition) { nil }
- let(:subsection) { instance_double(Form::Subsection) }
let(:log) { create(:sales_log) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
+ let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
@@ -31,11 +32,11 @@ RSpec.describe Form::Sales::Pages::NoAddressFound, type: :model do
end
it "has the correct title_text" do
- expect(page.title_text).to eq({ "arguments" => [], "translation" => "soft_validations.no_address_found.title_text" })
+ expect(page.title_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.address_search_value_check.title_text" })
end
it "has the correct informative_text" do
- expect(page.informative_text).to eq({ "arguments" => [], "translation" => "soft_validations.no_address_found.informative_text" })
+ expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.address_search_value_check.informative_text" })
end
it "has the correct interruption_screen_question_ids" do
diff --git a/spec/models/form/sales/pages/percentage_discount_value_check_spec.rb b/spec/models/form/sales/pages/percentage_discount_value_check_spec.rb
index 5fc3e05ad..0b8cf0152 100644
--- a/spec/models/form/sales/pages/percentage_discount_value_check_spec.rb
+++ b/spec/models/form/sales/pages/percentage_discount_value_check_spec.rb
@@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::PercentageDiscountValueCheck, type: :model do
let(:page_id) { "percentage_discount_value_check" }
let(:page_definition) { nil }
- let(:subsection) { instance_double(Form::Subsection) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
+ let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
@@ -21,14 +22,14 @@ RSpec.describe Form::Sales::Pages::PercentageDiscountValueCheck, type: :model do
it "has the correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.percentage_discount_value.title_text",
+ "translation" => "forms.2024.sales.soft_validations.percentage_discount_value_check.title_text",
"arguments" => [{ "key" => "discount", "label" => true, "i18n_template" => "discount" }],
})
end
it "has the correct informative_text" do
expect(page.informative_text).to eq({
- "translation" => "soft_validations.percentage_discount_value.hint_text",
+ "translation" => "forms.2024.sales.soft_validations.percentage_discount_value_check.informative_text",
"arguments" => [],
})
end
diff --git a/spec/models/form/sales/pages/postcode_spec.rb b/spec/models/form/sales/pages/postcode_spec.rb
deleted file mode 100644
index 8f9c7273c..000000000
--- a/spec/models/form/sales/pages/postcode_spec.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-require "rails_helper"
-
-RSpec.describe Form::Sales::Pages::Postcode, type: :model do
- subject(:page) { described_class.new(page_id, page_definition, subsection) }
-
- let(:page_id) { nil }
- let(:page_definition) { nil }
- let(:subsection) { instance_double(Form::Subsection) }
-
- it "has correct subsection" do
- expect(page.subsection).to eq(subsection)
- end
-
- it "has correct questions" do
- expect(page.questions.map(&:id)).to eq(%w[pcodenk postcode_full])
- end
-
- it "has the correct id" do
- expect(page.id).to eq("property_postcode")
- end
-
- it "has the correct description" do
- expect(page.description).to be_nil
- end
-
- it "has correct depends_on" do
- expect(page.depends_on).to be_nil
- end
-end
diff --git a/spec/models/form/sales/pages/property_local_authority_spec.rb b/spec/models/form/sales/pages/property_local_authority_spec.rb
index 016d0534d..faba75665 100644
--- a/spec/models/form/sales/pages/property_local_authority_spec.rb
+++ b/spec/models/form/sales/pages/property_local_authority_spec.rb
@@ -18,19 +18,6 @@ RSpec.describe Form::Sales::Pages::PropertyLocalAuthority, type: :model do
end
describe "has correct questions" do
- context "when 2022" do
- let(:start_date) { Time.utc(2022, 2, 8) }
-
- it "has correct questions" do
- expect(page.questions.map(&:id)).to eq(
- %w[
- la_known
- la
- ],
- )
- end
- end
-
context "when 2023" do
let(:start_date) { Time.utc(2023, 2, 8) }
diff --git a/spec/models/form/sales/questions/postcode_known_spec.rb b/spec/models/form/sales/questions/postcode_known_spec.rb
deleted file mode 100644
index 794c981d4..000000000
--- a/spec/models/form/sales/questions/postcode_known_spec.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-require "rails_helper"
-
-RSpec.describe Form::Sales::Questions::PostcodeKnown, type: :model do
- subject(:question) { described_class.new(question_id, question_definition, page) }
-
- let(:question_id) { nil }
- let(:question_definition) { nil }
- let(:page) { instance_double(Form::Page) }
-
- it "has correct page" do
- expect(question.page).to eq(page)
- end
-
- it "has the correct id" do
- expect(question.id).to eq("pcodenk")
- end
-
- it "has the correct type" do
- expect(question.type).to eq("radio")
- end
-
- it "is not marked as derived" do
- expect(question.derived?(nil)).to be false
- end
-
- it "has the correct answer_options" do
- expect(question.answer_options).to eq({
- "0" => { "value" => "Yes" },
- "1" => { "value" => "No" },
- })
- end
-
- it "has correct conditional for" do
- expect(question.conditional_for).to eq({
- "postcode_full" => [0],
- })
- end
-
- it "has the correct hidden_in_check_answers" do
- expect(question.hidden_in_check_answers).to eq({
- "depends_on" => [
- { "pcodenk" => 0 },
- { "pcodenk" => 1 },
- ],
- })
- end
-end
diff --git a/spec/models/form/sales/questions/postcode_spec.rb b/spec/models/form/sales/questions/postcode_spec.rb
deleted file mode 100644
index 480d6af60..000000000
--- a/spec/models/form/sales/questions/postcode_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-require "rails_helper"
-
-RSpec.describe Form::Sales::Questions::Postcode, type: :model do
- subject(:question) { described_class.new(question_id, question_definition, page) }
-
- let(:question_id) { nil }
- let(:question_definition) { nil }
- let(:page) { instance_double(Form::Page) }
-
- it "has correct page" do
- expect(question.page).to eq(page)
- end
-
- it "has the correct id" do
- expect(question.id).to eq("postcode_full")
- end
-
- it "has the correct type" do
- expect(question.type).to eq("text")
- end
-
- it "is not marked as derived" do
- expect(question.derived?(nil)).to be false
- end
-
- it "has the correct width" do
- expect(question.width).to eq(5)
- end
-
- it "has the correct inferred_answers" do
- expect(question.inferred_answers).to eq({
- "la" => {
- "is_la_inferred" => true,
- },
- })
- end
-
- it "has the correct inferred_check_answers_value" do
- expect(question.inferred_check_answers_value).to eq([{
- "condition" => {
- "pcodenk" => 1,
- },
- "value" => "Not known",
- }])
- end
-end
diff --git a/spec/models/form/sales/questions/uprn_confirmation_spec.rb b/spec/models/form/sales/questions/uprn_confirmation_spec.rb
index ddb047937..0e54155b6 100644
--- a/spec/models/form/sales/questions/uprn_confirmation_spec.rb
+++ b/spec/models/form/sales/questions/uprn_confirmation_spec.rb
@@ -1,11 +1,13 @@
require "rails_helper"
RSpec.describe Form::Sales::Questions::UprnConfirmation, type: :model do
+ include FormattingHelper
+
subject(:question) { described_class.new(question_id, question_definition, page) }
let(:question_id) { nil }
let(:question_definition) { nil }
- let(:page) { instance_double(Form::Page) }
+ let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), type: "sales"), id: "property_information")) }
it "has correct page" do
expect(question.page).to eq(page)
@@ -24,7 +26,7 @@ RSpec.describe Form::Sales::Questions::UprnConfirmation, type: :model do
end
it "has the correct unanswered_error_message" do
- expect(question.unanswered_error_message).to eq("You must answer is this the right address?")
+ expect(question.unanswered_error_message).to eq("You must answer #{format_ending(I18n.t('forms.2023.sales.property_information.uprn_confirmed.check_answer_label'))}")
end
describe "notification_banner" do
diff --git a/spec/models/form/sales/questions/uprn_known_spec.rb b/spec/models/form/sales/questions/uprn_known_spec.rb
index d3a91a3ef..e551ca430 100644
--- a/spec/models/form/sales/questions/uprn_known_spec.rb
+++ b/spec/models/form/sales/questions/uprn_known_spec.rb
@@ -1,6 +1,8 @@
require "rails_helper"
RSpec.describe Form::Sales::Questions::UprnKnown, type: :model do
+ include FormattingHelper
+
subject(:question) { described_class.new(question_id, question_definition, page) }
let(:question_id) { nil }
@@ -35,7 +37,7 @@ RSpec.describe Form::Sales::Questions::UprnKnown, type: :model do
end
it "has the correct unanswered_error_message" do
- expect(question.unanswered_error_message).to eq("You must answer UPRN known?")
+ expect(question.unanswered_error_message).to eq("You must answer #{format_ending(I18n.t('forms.2023.sales.property_information.uprn.uprn_known.check_answer_label'))}")
end
it "has the correct hidden_in_check_answers" do
diff --git a/spec/models/form/sales/subsections/property_information_spec.rb b/spec/models/form/sales/subsections/property_information_spec.rb
index e0bf51e11..6e181f738 100644
--- a/spec/models/form/sales/subsections/property_information_spec.rb
+++ b/spec/models/form/sales/subsections/property_information_spec.rb
@@ -17,30 +17,6 @@ RSpec.describe Form::Sales::Subsections::PropertyInformation, type: :model do
allow(form).to receive(:start_year_after_2024?).and_return(false)
end
- context "when 2022" do
- let(:start_date) { Time.utc(2022, 2, 8) }
-
- it "has correct pages" do
- expect(property_information.pages.compact.map(&:id)).to eq(
- %w[
- property_number_of_bedrooms
- about_price_bedrooms_value_check
- property_unit_type
- monthly_charges_property_type_value_check
- percentage_discount_proptype_value_check
- property_building_type
- property_postcode
- property_local_authority
- local_authority_buyer_1_income_max_value_check
- local_authority_buyer_2_income_max_value_check
- local_authority_combined_income_max_value_check
- about_price_la_value_check
- property_wheelchair_accessible
- ],
- )
- end
- end
-
context "when 2023" do
let(:start_date) { Time.utc(2023, 2, 8) }
From 7f016f898fcda81a8e9eab6a3add6b26371f30e1 Mon Sep 17 00:00:00 2001
From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com>
Date: Wed, 30 Oct 2024 16:41:22 +0000
Subject: [PATCH 04/12] CLDC-3687: Extract copy - lettings date validations
(#2738)
---
app/models/validations/date_validations.rb | 22 ++++++++--------
config/locales/en.yml | 13 ----------
.../locales/validations/lettings/date.en.yml | 20 ++++++++++++++
.../validations/date_validations_spec.rb | 26 +++++++++----------
4 files changed, 44 insertions(+), 37 deletions(-)
create mode 100644 config/locales/validations/lettings/date.en.yml
diff --git a/app/models/validations/date_validations.rb b/app/models/validations/date_validations.rb
index dce5c1ef0..7462290b6 100644
--- a/app/models/validations/date_validations.rb
+++ b/app/models/validations/date_validations.rb
@@ -4,30 +4,30 @@ module Validations::DateValidations
def validate_property_major_repairs(record)
date_valid?("mrcdate", record)
if record["startdate"].present? && record["mrcdate"].present? && record["startdate"] < record["mrcdate"]
- record.errors.add :mrcdate, I18n.t("validations.property.mrcdate.before_tenancy_start")
+ record.errors.add :mrcdate, I18n.t("validations.lettings.date.mrcdate.before_tenancy_start")
end
if is_rsnvac_first_let?(record) && record["mrcdate"].present?
- record.errors.add :mrcdate, I18n.t("validations.property.mrcdate.not_first_let")
+ record.errors.add :mrcdate, I18n.t("validations.lettings.date.mrcdate.not_first_let")
end
if record["mrcdate"].present? && record["startdate"].present? && record["startdate"].to_date - record["mrcdate"].to_date > 3650
- record.errors.add :mrcdate, I18n.t("validations.property.mrcdate.ten_years_before_tenancy_start")
+ record.errors.add :mrcdate, I18n.t("validations.lettings.date.mrcdate.ten_years_before_tenancy_start")
end
end
def validate_property_void_date(record)
if record["voiddate"].present? && record["startdate"].present? && record["startdate"].to_date - record["voiddate"].to_date > 3650
- record.errors.add :voiddate, I18n.t("validations.property.void_date.ten_years_before_tenancy_start")
+ record.errors.add :voiddate, I18n.t("validations.lettings.date.void_date.ten_years_before_tenancy_start")
end
if record["voiddate"].present? && record["startdate"].present? && record["startdate"].to_date < record["voiddate"].to_date
- record.errors.add :voiddate, I18n.t("validations.property.void_date.before_tenancy_start")
+ record.errors.add :voiddate, I18n.t("validations.lettings.date.void_date.before_tenancy_start")
end
if record["voiddate"].present? && record["mrcdate"].present? && record["mrcdate"].to_date < record["voiddate"].to_date
- record.errors.add :voiddate, :after_mrcdate, message: I18n.t("validations.property.void_date.after_mrcdate")
- record.errors.add :mrcdate, I18n.t("validations.property.mrcdate.before_void_date")
+ record.errors.add :voiddate, :after_mrcdate, message: I18n.t("validations.lettings.date.void_date.after_mrcdate")
+ record.errors.add :mrcdate, I18n.t("validations.lettings.date.mrcdate.before_void_date")
end
end
@@ -35,19 +35,19 @@ module Validations::DateValidations
return unless record.startdate && date_valid?("startdate", record)
if record["voiddate"].present? && record.startdate < record["voiddate"]
- record.errors.add :startdate, I18n.t("validations.setup.startdate.after_void_date")
+ record.errors.add :startdate, I18n.t("validations.lettings.date.startdate.after_void_date")
end
if record["mrcdate"].present? && record.startdate < record["mrcdate"]
- record.errors.add :startdate, I18n.t("validations.setup.startdate.after_major_repair_date")
+ record.errors.add :startdate, I18n.t("validations.lettings.date.startdate.after_major_repair_date")
end
if record["voiddate"].present? && record["startdate"].to_date - record["voiddate"].to_date > 3650
- record.errors.add :startdate, I18n.t("validations.setup.startdate.ten_years_after_void_date")
+ record.errors.add :startdate, I18n.t("validations.lettings.date.startdate.ten_years_after_void_date")
end
if record["mrcdate"].present? && record["startdate"].to_date - record["mrcdate"].to_date > 3650
- record.errors.add :startdate, I18n.t("validations.setup.startdate.ten_years_after_mrc_date")
+ record.errors.add :startdate, I18n.t("validations.lettings.date.startdate.ten_years_after_mrc_date")
end
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index a0d31fee5..5baa98338 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -295,11 +295,7 @@ en:
"Enter a date within the %{previous_start_year_short} to %{previous_end_year_short} or %{previous_end_year_short} to %{current_end_year_short} collection years, which is between %{previous_start_year_long} and %{current_end_year_long}."
later_than_14_days_after: "The tenancy start date must not be later than 14 days from today’s date."
before_scheme_end_date: "The tenancy start date must be before the end date for this supported housing scheme."
- after_void_date: "Enter a tenancy start date that is after the void date."
- after_major_repair_date: "Enter a tenancy start date that is after the major repair date."
year_not_two_or_four_digits: "Tenancy start year must be 2 or 4 digits."
- ten_years_after_void_date: "Enter a tenancy start date that is no more than 10 years after the void date."
- ten_years_after_mrc_date: "Enter a tenancy start date that is no more than 10 years after the major repairs completion date."
invalid_merged_organisations_start_date:
same_organisation: "Enter a date when the owning and managing organisation was active. %{owning_organisation} became inactive on %{owning_organisation_merge_date} and was replaced by %{owning_absorbing_organisation}."
same_merge: "Enter a date when the owning and managing organisations were active. %{owning_organisation} and %{managing_organisation} became inactive on %{owning_organisation_merge_date} and were replaced by %{owning_absorbing_organisation}."
@@ -362,15 +358,6 @@ en:
invalid: "UPRN must be 12 digits or less."
uprn_known:
invalid: "You must answer UPRN known?"
- mrcdate:
- before_tenancy_start: "Enter a major repairs date that is before the tenancy start date."
- not_first_let: "Major repairs date must not be completed if the tenancy is a first let."
- ten_years_before_tenancy_start: "Enter a major repairs completion date that is no more than 10 years before the tenancy start date."
- before_void_date: "Major repairs date must be after the void date if provided."
- void_date:
- ten_years_before_tenancy_start: "Enter a void date no more than 10 years before the tenancy start date."
- before_tenancy_start: "Enter a void date that is before the tenancy start date."
- after_mrcdate: "Void date must be before the major repairs date if provided."
la:
la_invalid_for_org: "%{org_name} does not operate in %{la_name}."
postcode_invalid_for_org: "Enter a postcode in an area covered by %{org_name}."
diff --git a/config/locales/validations/lettings/date.en.yml b/config/locales/validations/lettings/date.en.yml
new file mode 100644
index 000000000..54c53996f
--- /dev/null
+++ b/config/locales/validations/lettings/date.en.yml
@@ -0,0 +1,20 @@
+en:
+ validations:
+ lettings:
+ date:
+ startdate:
+ after_void_date: "Enter a tenancy start date that is after the void date."
+ after_major_repair_date: "Enter a tenancy start date that is after the major repair date."
+ ten_years_after_void_date: "Enter a tenancy start date that is no more than 10 years after the void date."
+ ten_years_after_mrc_date: "Enter a tenancy start date that is no more than 10 years after the major repairs completion date."
+
+ mrcdate:
+ before_tenancy_start: "Enter a major repairs date that is before the tenancy start date."
+ not_first_let: "Major repairs date must not be completed if the tenancy is a first let."
+ ten_years_before_tenancy_start: "Enter a major repairs completion date that is no more than 10 years before the tenancy start date."
+ before_void_date: "Major repairs date must be after the void date if provided."
+
+ void_date:
+ ten_years_before_tenancy_start: "Enter a void date no more than 10 years before the tenancy start date."
+ before_tenancy_start: "Enter a void date that is before the tenancy start date."
+ after_mrcdate: "Void date must be before the major repairs date if provided."
diff --git a/spec/models/validations/date_validations_spec.rb b/spec/models/validations/date_validations_spec.rb
index 59be2537e..f6c81a088 100644
--- a/spec/models/validations/date_validations_spec.rb
+++ b/spec/models/validations/date_validations_spec.rb
@@ -26,7 +26,7 @@ RSpec.describe Validations::DateValidations do
record.voiddate = Time.zone.local(2022, 2, 1)
date_validator.validate_startdate(record)
expect(record.errors["startdate"])
- .to include(match I18n.t("validations.setup.startdate.after_void_date"))
+ .to include(match I18n.t("validations.lettings.date.startdate.after_void_date"))
end
it "validates that the tenancy start date is after the major repair date if it has a major repair date" do
@@ -34,7 +34,7 @@ RSpec.describe Validations::DateValidations do
record.mrcdate = Time.zone.local(2022, 2, 1)
date_validator.validate_startdate(record)
expect(record.errors["startdate"])
- .to include(match I18n.t("validations.setup.startdate.after_major_repair_date"))
+ .to include(match I18n.t("validations.lettings.date.startdate.after_major_repair_date"))
end
it "produces no error when the tenancy start date is before the end date of the chosen scheme if it has an end date" do
@@ -58,7 +58,7 @@ RSpec.describe Validations::DateValidations do
record.mrcdate = Time.zone.local(2022, 2, 1)
date_validator.validate_property_major_repairs(record)
expect(record.errors["mrcdate"])
- .to include(match I18n.t("validations.property.mrcdate.before_tenancy_start"))
+ .to include(match I18n.t("validations.lettings.date.mrcdate.before_tenancy_start"))
end
it "must be before the tenancy start date" do
@@ -74,9 +74,9 @@ RSpec.describe Validations::DateValidations do
date_validator.validate_property_major_repairs(record)
date_validator.validate_startdate(record)
expect(record.errors["mrcdate"])
- .to include(match I18n.t("validations.property.mrcdate.ten_years_before_tenancy_start"))
+ .to include(match I18n.t("validations.lettings.date.mrcdate.ten_years_before_tenancy_start"))
expect(record.errors["startdate"])
- .to include(match I18n.t("validations.setup.startdate.ten_years_after_mrc_date"))
+ .to include(match I18n.t("validations.lettings.date.startdate.ten_years_after_mrc_date"))
end
it "must be within 10 years of the tenancy start date" do
@@ -93,7 +93,7 @@ RSpec.describe Validations::DateValidations do
record.mrcdate = Time.zone.local(2022, 1, 1)
date_validator.validate_property_major_repairs(record)
expect(record.errors["mrcdate"])
- .to include(match I18n.t("validations.property.mrcdate.not_first_let"))
+ .to include(match I18n.t("validations.lettings.date.mrcdate.not_first_let"))
end
it "validates that no major repair date is provided for a conversion" do
@@ -101,7 +101,7 @@ RSpec.describe Validations::DateValidations do
record.mrcdate = Time.zone.local(2022, 1, 1)
date_validator.validate_property_major_repairs(record)
expect(record.errors["mrcdate"])
- .to include(match I18n.t("validations.property.mrcdate.not_first_let"))
+ .to include(match I18n.t("validations.lettings.date.mrcdate.not_first_let"))
end
it "validates that no major repair date is provided for a leased property" do
@@ -109,7 +109,7 @@ RSpec.describe Validations::DateValidations do
record.mrcdate = Time.zone.local(2022, 1, 1)
date_validator.validate_property_major_repairs(record)
expect(record.errors["mrcdate"])
- .to include(match I18n.t("validations.property.mrcdate.not_first_let"))
+ .to include(match I18n.t("validations.lettings.date.mrcdate.not_first_let"))
end
end
@@ -129,7 +129,7 @@ RSpec.describe Validations::DateValidations do
record.voiddate = Time.zone.local(2022, 2, 1)
date_validator.validate_property_void_date(record)
expect(record.errors["voiddate"])
- .to include(match I18n.t("validations.property.void_date.before_tenancy_start"))
+ .to include(match I18n.t("validations.lettings.date.void_date.before_tenancy_start"))
end
it "must be before the tenancy start date" do
@@ -145,9 +145,9 @@ RSpec.describe Validations::DateValidations do
date_validator.validate_property_void_date(record)
date_validator.validate_startdate(record)
expect(record.errors["voiddate"])
- .to include(match I18n.t("validations.property.void_date.ten_years_before_tenancy_start"))
+ .to include(match I18n.t("validations.lettings.date.void_date.ten_years_before_tenancy_start"))
expect(record.errors["startdate"])
- .to include(match I18n.t("validations.setup.startdate.ten_years_after_void_date"))
+ .to include(match I18n.t("validations.lettings.date.startdate.ten_years_after_void_date"))
end
it "must be within 10 years of the tenancy start date" do
@@ -164,9 +164,9 @@ RSpec.describe Validations::DateValidations do
record.voiddate = Time.zone.local(2022, 2, 1)
date_validator.validate_property_void_date(record)
expect(record.errors["voiddate"])
- .to include(match I18n.t("validations.property.void_date.after_mrcdate"))
+ .to include(match I18n.t("validations.lettings.date.void_date.after_mrcdate"))
expect(record.errors["mrcdate"])
- .to include(match I18n.t("validations.property.mrcdate.before_void_date"))
+ .to include(match I18n.t("validations.lettings.date.mrcdate.before_void_date"))
end
it "must be before major repairs date" do
From 47928f384295e629dcb1d8b67074bb97b2d84d8f Mon Sep 17 00:00:00 2001
From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com>
Date: Thu, 31 Oct 2024 09:09:37 +0000
Subject: [PATCH 05/12] CLDC-3680: Copy changes lettings property information
questions (#2726)
---
app/models/form/lettings/pages/address.rb | 2 +-
.../form/lettings/pages/address_fallback.rb | 2 +-
.../form/lettings/pages/address_matcher.rb | 2 +-
.../lettings/pages/property_major_repairs.rb | 1 +
app/models/form/lettings/pages/uprn.rb | 1 +
.../form/lettings/pages/uprn_selection.rb | 1 -
app/models/form/lettings/pages/void_date.rb | 1 -
.../form/lettings/questions/address_line1.rb | 3 +-
.../address_line1_for_address_matcher.rb | 3 +-
.../form/lettings/questions/address_line2.rb | 2 +-
app/models/form/lettings/questions/beds.rb | 6 -
.../form/lettings/questions/builtype.rb | 3 -
app/models/form/lettings/questions/county.rb | 3 +-
...rst_time_property_let_as_social_housing.rb | 3 -
app/models/form/lettings/questions/la.rb | 2 -
.../form/lettings/questions/majorrepairs.rb | 4 +-
app/models/form/lettings/questions/mrcdate.rb | 3 +-
app/models/form/lettings/questions/offered.rb | 2 -
.../questions/postcode_for_address_matcher.rb | 2 +-
.../questions/postcode_for_full_address.rb | 3 +-
.../lettings/questions/previous_let_type.rb | 3 -
app/models/form/lettings/questions/rsnvac.rb | 3 -
.../lettings/questions/rsnvac_first_let.rb | 3 -
.../form/lettings/questions/town_or_city.rb | 3 +-
.../form/lettings/questions/unittype_gn.rb | 3 -
app/models/form/lettings/questions/uprn.rb | 3 +-
.../form/lettings/questions/uprn_known.rb | 6 +-
.../form/lettings/questions/uprn_selection.rb | 2 -
.../form/lettings/questions/voiddate.rb | 2 -
.../form/lettings/questions/wheelchair.rb | 3 -
.../subsections/property_information.rb | 2 +-
config/locales/en.yml | 3 -
.../2023/lettings/property_information.en.yml | 104 ++++++++++++++
.../forms/2023/sales/soft_validations.en.yml | 7 +
.../2024/lettings/property_information.en.yml | 127 ++++++++++++++++++
.../duplicate_logs_controller_spec.rb | 7 -
36 files changed, 255 insertions(+), 75 deletions(-)
create mode 100644 config/locales/forms/2023/lettings/property_information.en.yml
create mode 100644 config/locales/forms/2024/lettings/property_information.en.yml
diff --git a/app/models/form/lettings/pages/address.rb b/app/models/form/lettings/pages/address.rb
index 9fe18d3ef..eadda7f46 100644
--- a/app/models/form/lettings/pages/address.rb
+++ b/app/models/form/lettings/pages/address.rb
@@ -2,7 +2,7 @@ class Form::Lettings::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 = "lettings.property_information.address"
@depends_on = [
{ "is_supported_housing?" => false, "uprn_known" => nil },
{ "is_supported_housing?" => false, "uprn_known" => 0 },
diff --git a/app/models/form/lettings/pages/address_fallback.rb b/app/models/form/lettings/pages/address_fallback.rb
index 67f8ef5b1..2d5249671 100644
--- a/app/models/form/lettings/pages/address_fallback.rb
+++ b/app/models/form/lettings/pages/address_fallback.rb
@@ -2,7 +2,7 @@ class Form::Lettings::Pages::AddressFallback < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "address"
- @header = "Q12 - What is the property's address?"
+ @copy_key = "lettings.property_information.address"
@depends_on = [
{ "is_supported_housing?" => false, "uprn_known" => nil, "uprn_selection" => "uprn_not_listed" },
{ "is_supported_housing?" => false, "uprn_known" => 0, "uprn_selection" => "uprn_not_listed" },
diff --git a/app/models/form/lettings/pages/address_matcher.rb b/app/models/form/lettings/pages/address_matcher.rb
index 859e31077..b1fc885be 100644
--- a/app/models/form/lettings/pages/address_matcher.rb
+++ b/app/models/form/lettings/pages/address_matcher.rb
@@ -2,7 +2,7 @@ class Form::Lettings::Pages::AddressMatcher < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "address_matcher"
- @header = "Find an address"
+ @copy_key = "lettings.property_information.address_matcher"
@depends_on = [
{ "is_supported_housing?" => false, "uprn_known" => nil },
{ "is_supported_housing?" => false, "uprn_known" => 0 },
diff --git a/app/models/form/lettings/pages/property_major_repairs.rb b/app/models/form/lettings/pages/property_major_repairs.rb
index 985b5dce1..92bbadc0b 100644
--- a/app/models/form/lettings/pages/property_major_repairs.rb
+++ b/app/models/form/lettings/pages/property_major_repairs.rb
@@ -2,6 +2,7 @@ class Form::Lettings::Pages::PropertyMajorRepairs < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_major_repairs"
+ @copy_key = "lettings.property_information.property_major_repairs"
@depends_on = [{ "is_renewal?" => false, "vacancy_reason_not_renewal_or_first_let?" => true }]
end
diff --git a/app/models/form/lettings/pages/uprn.rb b/app/models/form/lettings/pages/uprn.rb
index d3c744b8f..474928eb3 100644
--- a/app/models/form/lettings/pages/uprn.rb
+++ b/app/models/form/lettings/pages/uprn.rb
@@ -2,6 +2,7 @@ class Form::Lettings::Pages::Uprn < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "uprn"
+ @copy_key = "lettings.property_information.uprn"
@depends_on = [{ "is_supported_housing?" => false }]
end
diff --git a/app/models/form/lettings/pages/uprn_selection.rb b/app/models/form/lettings/pages/uprn_selection.rb
index 4c7ca4ae1..96bfe68e8 100644
--- a/app/models/form/lettings/pages/uprn_selection.rb
+++ b/app/models/form/lettings/pages/uprn_selection.rb
@@ -2,7 +2,6 @@ class Form::Lettings::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 = [
{ "is_supported_housing?" => false, "uprn_known" => nil, "address_options_present?" => true },
{ "is_supported_housing?" => false, "uprn_known" => 0, "address_options_present?" => true },
diff --git a/app/models/form/lettings/pages/void_date.rb b/app/models/form/lettings/pages/void_date.rb
index 2187ebe57..5ba80d41e 100644
--- a/app/models/form/lettings/pages/void_date.rb
+++ b/app/models/form/lettings/pages/void_date.rb
@@ -2,7 +2,6 @@ class Form::Lettings::Pages::VoidDate < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "void_date"
- @header = "Void date"
@depends_on = [{ "is_renewal?" => false }]
end
diff --git a/app/models/form/lettings/questions/address_line1.rb b/app/models/form/lettings/questions/address_line1.rb
index f90da8b26..7da9720eb 100644
--- a/app/models/form/lettings/questions/address_line1.rb
+++ b/app/models/form/lettings/questions/address_line1.rb
@@ -2,11 +2,10 @@ class Form::Lettings::Questions::AddressLine1 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "address_line1"
- @header = "Address line 1"
+ @copy_key = "lettings.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/lettings/questions/address_line1_for_address_matcher.rb b/app/models/form/lettings/questions/address_line1_for_address_matcher.rb
index b2247a8f0..0e8f59da3 100644
--- a/app/models/form/lettings/questions/address_line1_for_address_matcher.rb
+++ b/app/models/form/lettings/questions/address_line1_for_address_matcher.rb
@@ -2,11 +2,10 @@ class Form::Lettings::Questions::AddressLine1ForAddressMatcher < ::Form::Questio
def initialize(id, hsh, page)
super
@id = "address_line1_input"
- @header = "Address line 1"
+ @copy_key = "lettings.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/lettings/questions/address_line2.rb b/app/models/form/lettings/questions/address_line2.rb
index 3b2c36dbc..0d4d2a705 100644
--- a/app/models/form/lettings/questions/address_line2.rb
+++ b/app/models/form/lettings/questions/address_line2.rb
@@ -2,7 +2,7 @@ class Form::Lettings::Questions::AddressLine2 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "address_line2"
- @header = "Address line 2 (optional)"
+ @copy_key = "lettings.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/lettings/questions/beds.rb b/app/models/form/lettings/questions/beds.rb
index 8c0399a61..4661f5367 100644
--- a/app/models/form/lettings/questions/beds.rb
+++ b/app/models/form/lettings/questions/beds.rb
@@ -2,8 +2,6 @@ class Form::Lettings::Questions::Beds < ::Form::Question
def initialize(id, hsh, page)
super
@id = "beds"
- @check_answer_label = "Number of bedrooms"
- @header = "How many bedrooms does the property have?"
@type = "numeric"
@width = 2
@check_answers_card_number = 0
@@ -17,9 +15,5 @@ class Form::Lettings::Questions::Beds < ::Form::Question
log.is_bedsit?
end
- def hint_text
- form.start_year_after_2024? ? "If shared accommodation, enter the number of bedrooms occupied by this household." : "If shared accommodation, enter the number of bedrooms occupied by this household. A bedsit has 1 bedroom."
- end
-
QUESTION_NUMBER_FROM_YEAR = { 2023 => 22 }.freeze
end
diff --git a/app/models/form/lettings/questions/builtype.rb b/app/models/form/lettings/questions/builtype.rb
index a95d88b13..7df3c46dd 100644
--- a/app/models/form/lettings/questions/builtype.rb
+++ b/app/models/form/lettings/questions/builtype.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::Builtype < ::Form::Question
def initialize(id, hsh, page)
super
@id = "builtype"
- @check_answer_label = "Type of building"
- @header = "What type of building is the property?"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = ""
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/county.rb b/app/models/form/lettings/questions/county.rb
index f3c780257..27e17645e 100644
--- a/app/models/form/lettings/questions/county.rb
+++ b/app/models/form/lettings/questions/county.rb
@@ -2,10 +2,9 @@ class Form::Lettings::Questions::County < ::Form::Question
def initialize(id, hsh, page)
super
@id = "county"
- @header = "County (optional)"
+ @copy_key = "lettings.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/lettings/questions/first_time_property_let_as_social_housing.rb b/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb
index 6e36c9911..9d54cfcb3 100644
--- a/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb
+++ b/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing < ::Form::Q
def initialize(id, hsh, page)
super
@id = "first_time_property_let_as_social_housing"
- @check_answer_label = "First time being let as social-housing?"
- @header = "Is this the first time the property has been let as social housing?"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = ""
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/la.rb b/app/models/form/lettings/questions/la.rb
index 6038bc2ad..5e1c8ae2b 100644
--- a/app/models/form/lettings/questions/la.rb
+++ b/app/models/form/lettings/questions/la.rb
@@ -2,8 +2,6 @@ class Form::Lettings::Questions::La < ::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"
@check_answers_card_number = nil
@hint_text = ""
diff --git a/app/models/form/lettings/questions/majorrepairs.rb b/app/models/form/lettings/questions/majorrepairs.rb
index d2d94224e..ef33c1e01 100644
--- a/app/models/form/lettings/questions/majorrepairs.rb
+++ b/app/models/form/lettings/questions/majorrepairs.rb
@@ -2,11 +2,9 @@ class Form::Lettings::Questions::Majorrepairs < ::Form::Question
def initialize(id, hsh, page)
super
@id = "majorrepairs"
- @check_answer_label = "Major repairs carried out during void period"
- @header = "Were any major repairs carried out during the void period?"
+ @copy_key = "lettings.property_information.property_major_repairs.majorrepairs"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = "Major repairs are works that could not be reasonably carried out with a tenant living at the property. For example, structural repairs."
@answer_options = ANSWER_OPTIONS
@conditional_for = { "mrcdate" => [1] }
@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/lettings/questions/mrcdate.rb b/app/models/form/lettings/questions/mrcdate.rb
index 8bbd8223b..33c8f2c5f 100644
--- a/app/models/form/lettings/questions/mrcdate.rb
+++ b/app/models/form/lettings/questions/mrcdate.rb
@@ -2,8 +2,7 @@ class Form::Lettings::Questions::Mrcdate < ::Form::Question
def initialize(id, hsh, page)
super
@id = "mrcdate"
- @check_answer_label = "Completion date of repairs"
- @header = "When were the repairs completed?"
+ @copy_key = "lettings.property_information.property_major_repairs.mrcdate"
@type = "date"
@check_answers_card_number = 0
@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/lettings/questions/offered.rb b/app/models/form/lettings/questions/offered.rb
index 6d98f405c..701a6f737 100644
--- a/app/models/form/lettings/questions/offered.rb
+++ b/app/models/form/lettings/questions/offered.rb
@@ -2,8 +2,6 @@ class Form::Lettings::Questions::Offered < ::Form::Question
def initialize(id, hsh, page)
super
@id = "offered"
- @check_answer_label = I18n.t("check_answer_labels.offered")
- @header = I18n.t("questions.offered")
@type = "numeric"
@width = 2
@check_answers_card_number = 0
diff --git a/app/models/form/lettings/questions/postcode_for_address_matcher.rb b/app/models/form/lettings/questions/postcode_for_address_matcher.rb
index 2cac3ce92..9a7751904 100644
--- a/app/models/form/lettings/questions/postcode_for_address_matcher.rb
+++ b/app/models/form/lettings/questions/postcode_for_address_matcher.rb
@@ -2,7 +2,7 @@ class Form::Lettings::Questions::PostcodeForAddressMatcher < ::Form::Question
def initialize(id, hsh, page)
super
@id = "postcode_full_input"
- @header = "Postcode"
+ @copy_key = "lettings.property_information.address_matcher.postcode_full_input"
@type = "text"
@width = 5
@plain_label = true
diff --git a/app/models/form/lettings/questions/postcode_for_full_address.rb b/app/models/form/lettings/questions/postcode_for_full_address.rb
index ef93b003d..d6ee9859f 100644
--- a/app/models/form/lettings/questions/postcode_for_full_address.rb
+++ b/app/models/form/lettings/questions/postcode_for_full_address.rb
@@ -2,7 +2,7 @@ class Form::Lettings::Questions::PostcodeForFullAddress < ::Form::Question
def initialize(id, hsh, page)
super
@id = "postcode_full"
- @header = "Postcode"
+ @copy_key = "lettings.property_information.address.postcode_full"
@type = "text"
@width = 5
@inferred_check_answers_value = [{
@@ -17,7 +17,6 @@ class Form::Lettings::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/lettings/questions/previous_let_type.rb b/app/models/form/lettings/questions/previous_let_type.rb
index d9c018820..577571571 100644
--- a/app/models/form/lettings/questions/previous_let_type.rb
+++ b/app/models/form/lettings/questions/previous_let_type.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::PreviousLetType < ::Form::Question
def initialize(id, hsh, page)
super
@id = "unitletas"
- @check_answer_label = "Most recent let type"
- @header = "What type was the property most recently let as?"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = form.start_year_after_2024? ? "This is the rent type of the previous tenancy in this property." : ""
@answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_AFTER_2024 : ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/rsnvac.rb b/app/models/form/lettings/questions/rsnvac.rb
index 303f2ea48..935980712 100644
--- a/app/models/form/lettings/questions/rsnvac.rb
+++ b/app/models/form/lettings/questions/rsnvac.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::Rsnvac < ::Form::Question
def initialize(id, hsh, page)
super
@id = "rsnvac"
- @check_answer_label = "Vacancy reason"
- @header = "What is the reason for the property being vacant?"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = ""
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/rsnvac_first_let.rb b/app/models/form/lettings/questions/rsnvac_first_let.rb
index f03c64995..4b87d059f 100644
--- a/app/models/form/lettings/questions/rsnvac_first_let.rb
+++ b/app/models/form/lettings/questions/rsnvac_first_let.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::RsnvacFirstLet < ::Form::Question
def initialize(id, hsh, page)
super
@id = "rsnvac"
- @check_answer_label = "Vacancy reason"
- @header = "What is the reason for the property being vacant?"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = ""
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/town_or_city.rb b/app/models/form/lettings/questions/town_or_city.rb
index 745810893..14ed19dfc 100644
--- a/app/models/form/lettings/questions/town_or_city.rb
+++ b/app/models/form/lettings/questions/town_or_city.rb
@@ -2,10 +2,9 @@ class Form::Lettings::Questions::TownOrCity < ::Form::Question
def initialize(id, hsh, page)
super
@id = "town_or_city"
- @header = "Town or city"
+ @copy_key = "lettings.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/lettings/questions/unittype_gn.rb b/app/models/form/lettings/questions/unittype_gn.rb
index 501f25ee7..95a199b98 100644
--- a/app/models/form/lettings/questions/unittype_gn.rb
+++ b/app/models/form/lettings/questions/unittype_gn.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::UnittypeGn < ::Form::Question
def initialize(id, hsh, page)
super
@id = "unittype_gn"
- @check_answer_label = "Type of unit"
- @header = "What type of unit is the property?"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = ""
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/uprn.rb b/app/models/form/lettings/questions/uprn.rb
index 7c860e01b..53df6bcf2 100644
--- a/app/models/form/lettings/questions/uprn.rb
+++ b/app/models/form/lettings/questions/uprn.rb
@@ -2,8 +2,7 @@ class Form::Lettings::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 = "lettings.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/lettings/questions/uprn_known.rb b/app/models/form/lettings/questions/uprn_known.rb
index a9840667c..29d415134 100644
--- a/app/models/form/lettings/questions/uprn_known.rb
+++ b/app/models/form/lettings/questions/uprn_known.rb
@@ -2,13 +2,9 @@ class Form::Lettings::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 = "lettings.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/lettings/questions/uprn_selection.rb b/app/models/form/lettings/questions/uprn_selection.rb
index f6c71f498..90fa319b7 100644
--- a/app/models/form/lettings/questions/uprn_selection.rb
+++ b/app/models/form/lettings/questions/uprn_selection.rb
@@ -2,9 +2,7 @@ class Form::Lettings::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/lettings/questions/voiddate.rb b/app/models/form/lettings/questions/voiddate.rb
index 9d47fe1ea..1f5d2317a 100644
--- a/app/models/form/lettings/questions/voiddate.rb
+++ b/app/models/form/lettings/questions/voiddate.rb
@@ -2,8 +2,6 @@ class Form::Lettings::Questions::Voiddate < ::Form::Question
def initialize(id, hsh, page)
super
@id = "voiddate"
- @check_answer_label = "Void date"
- @header = "What is the void date?"
@type = "date"
@check_answers_card_number = 0
@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/lettings/questions/wheelchair.rb b/app/models/form/lettings/questions/wheelchair.rb
index 7d8dcfa25..f766a0e44 100644
--- a/app/models/form/lettings/questions/wheelchair.rb
+++ b/app/models/form/lettings/questions/wheelchair.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::Wheelchair < ::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?"
@type = "radio"
@check_answers_card_number = 0
- @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." : ""
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/subsections/property_information.rb b/app/models/form/lettings/subsections/property_information.rb
index 7b9aead2d..fa2ff0efa 100644
--- a/app/models/form/lettings/subsections/property_information.rb
+++ b/app/models/form/lettings/subsections/property_information.rb
@@ -34,7 +34,7 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection
Form::Lettings::Pages::Uprn.new(nil, nil, self),
Form::Lettings::Pages::UprnConfirmation.new(nil, nil, self),
Form::Lettings::Pages::AddressMatcher.new(nil, nil, self),
- Form::Lettings::Pages::NoAddressFound.new(nil, nil, self),
+ Form::Lettings::Pages::NoAddressFound.new(nil, nil, self), # soft validation
Form::Lettings::Pages::UprnSelection.new(nil, nil, self),
Form::Lettings::Pages::AddressFallback.new(nil, nil, self),
]
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 5baa98338..c78ba2463 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -741,7 +741,6 @@ Make sure these answers are correct."
stairowned:
one: "What percentage of the property does the buyer now own in total?"
other: "What percentage of the property do the buyers now own in total?"
- offered: "How many times was the property offered between becoming vacant and this letting?"
hints:
location:
@@ -754,7 +753,6 @@ Make sure these answers are correct."
toggle_active: "If the date is before %{date}, select ‘From the start of the open collection period’ because the previous period has now closed."
bulk_upload:
needstype: "General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing can include direct access hostels, group homes, residential care and nursing homes."
- offered: "Do not include the offer that led to this letting. This is after the last tenancy ended. If the property is being offered for let for the first time, enter 0."
check_answer_labels:
soctenant:
@@ -763,7 +761,6 @@ Make sure these answers are correct."
stairowned:
one: "Percentage the buyer now owns in total."
other: "Percentage the buyers now own in total."
- offered: "Times previously offered since becoming available."
warnings:
organisation:
diff --git a/config/locales/forms/2023/lettings/property_information.en.yml b/config/locales/forms/2023/lettings/property_information.en.yml
new file mode 100644
index 000000000..f1b652935
--- /dev/null
+++ b/config/locales/forms/2023/lettings/property_information.en.yml
@@ -0,0 +1,104 @@
+en:
+ forms:
+ 2023:
+ lettings:
+ property_information:
+ uprn:
+ page_header: ""
+ uprn_known:
+ check_answer_label: "UPRN known?"
+ 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."
+ question_text: "Do you know the property's UPRN?"
+ uprn:
+ check_answer_label: "UPRN"
+ hint_text: ""
+ question_text: "What is the property's UPRN?"
+
+ uprn_confirmed:
+ page_header: "We found an address that might be this property"
+ check_answer_label: "Is this the right address?"
+ hint_text: ""
+ question_text: "Is this the property address?"
+
+ address:
+ page_header: "Q12 - What is the property's address?"
+ address_line1:
+ check_answer_label: "Address lines 1 and 2"
+ hint_text: ""
+ question_text: "Address line 1"
+ address_line2:
+ check_answer_label: ""
+ hint_text: ""
+ question_text: "Address line 2 (optional)"
+ town_or_city:
+ check_answer_label: "Town or city"
+ hint_text: ""
+ question_text: "Town or city"
+ county:
+ check_answer_label: "County"
+ hint_text: ""
+ question_text: "County (optional)"
+ postcode_full:
+ check_answer_label: "Postcode"
+ hint_text: ""
+ question_text: "Postcode"
+
+ la:
+ page_header: ""
+ check_answer_label: "Local authority"
+ hint_text: ""
+ question_text: "What is the property’s local authority?"
+
+ first_time_property_let_as_social_housing:
+ page_header: ""
+ check_answer_label: "First time being let as social-housing?"
+ hint_text: ""
+ question_text: "Is this the first time the property has been let as social housing?"
+
+ unitletas:
+ page_header: ""
+ check_answer_label: "Most recent let type"
+ hint_text: ""
+ question_text: "What type was the property most recently let as?"
+
+ rsnvac:
+ page_header: ""
+ check_answer_label: "Vacancy reason"
+ hint_text: ""
+ question_text: "What is the reason for the property being vacant?"
+
+ offered:
+ page_header: ""
+ check_answer_label: "Times previously offered since becoming available."
+ hint_text: "Do not include the offer that led to this letting. This is after the last tenancy ended. If the property is being offered for let for the first time, enter 0."
+ question_text: "How many times was the property offered between becoming vacant and this letting?"
+
+ unittype_gn:
+ page_header: ""
+ check_answer_label: "Type of unit"
+ hint_text: ""
+ question_text: "What type of unit is the property?"
+
+ builtype:
+ page_header: ""
+ check_answer_label: "Type of building"
+ hint_text: ""
+ question_text: "What type of building is the property?"
+
+ wchair:
+ page_header: ""
+ check_answer_label: "Property built or adapted to wheelchair-user standards"
+ hint_text: ""
+ question_text: "Is the property built or adapted to wheelchair-user standards?"
+
+ beds:
+ page_header: ""
+ check_answer_label: "Number of bedrooms"
+ hint_text: "If shared accommodation, enter the number of bedrooms occupied by this household. A bedsit has 1 bedroom."
+ question_text: "How many bedrooms does the property have?"
+
+ voiddate:
+ page_header: "Void date"
+ check_answer_label: "Void date"
+ hint_text: ""
+ question_text: "What is the void date?"
diff --git a/config/locales/forms/2023/sales/soft_validations.en.yml b/config/locales/forms/2023/sales/soft_validations.en.yml
index 11a7406e4..1c3cd4955 100644
--- a/config/locales/forms/2023/sales/soft_validations.en.yml
+++ b/config/locales/forms/2023/sales/soft_validations.en.yml
@@ -18,6 +18,7 @@ en:
question_text: "Are you sure this person is retired?"
title_text: "You told us this person is aged %{age} years and retired."
informative_text: "The minimum expected retirement age in England is 66."
+
old_persons_shared_ownership_value_check:
page_header: ""
check_answer_label: "Shared ownership confirmation"
@@ -27,6 +28,7 @@ en:
joint_purchase: "You told us the buyers are using the Older Persons Shared Ownership scheme."
not_joint_purchase: "You told us the buyer is using the Older Persons Shared Ownership scheme."
informative_text: "At least one buyer must be aged 65 years and over to use this scheme."
+
income1_value_check:
check_answer_label: "Buyer 1 income confirmation"
hint_text: ""
@@ -113,12 +115,14 @@ en:
not_joint_purchase:
title_text: "You told us the buyer’s deposit was %{deposit} and their savings were %{savings}."
informative_text: "The deposit amount is higher than we would expect for the amount of savings they have."
+
wheel_value_check:
page_header: ""
check_answer_label: "Does anyone in the household use a wheelchair?"
hint_text: ""
question_text: "You told us that someone in the household uses a wheelchair."
title_text: "You told us that someone in the household uses a wheelchair."
+
buyer_livein_value_check:
buyer1:
page_header: ""
@@ -134,6 +138,7 @@ en:
question_text: "Are you sure this is correct?"
title_text: "You told us that buyer 2 will not live in the property."
informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property."
+
student_not_child_value_check:
page_header: ""
check_answer_label: "Student not a child confirmation"
@@ -141,6 +146,7 @@ en:
question_text: "Are you sure this person is not a child?"
title_text: "You told us this person is a student aged between 16 and 19."
informative_text: "Are you sure this person is not a child?"
+
partner_under_16_value_check:
page_header: ""
check_answer_label: "Partner under 16 confirmation"
@@ -148,6 +154,7 @@ en:
question_text: "Are you sure this is correct?"
title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to buyer 1."
informative_text: "Are you sure this is correct?"
+
multiple_partners_value_check:
page_header: ""
check_answer_label: "Multiple partners confirmation"
diff --git a/config/locales/forms/2024/lettings/property_information.en.yml b/config/locales/forms/2024/lettings/property_information.en.yml
new file mode 100644
index 000000000..012ff0e0d
--- /dev/null
+++ b/config/locales/forms/2024/lettings/property_information.en.yml
@@ -0,0 +1,127 @@
+en:
+ forms:
+ 2024:
+ lettings:
+ property_information:
+ first_time_property_let_as_social_housing:
+ page_header: ""
+ check_answer_label: "First time being let as social-housing?"
+ hint_text: ""
+ question_text: "Is this the first time the property has been let as social housing?"
+
+ uprn:
+ page_header: ""
+ uprn_known:
+ check_answer_label: "UPRN known?"
+ 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."
+ question_text: "Do you know the property's UPRN?"
+ uprn:
+ check_answer_label: "UPRN"
+ hint_text: ""
+ question_text: "What is the property's UPRN?"
+
+ uprn_confirmed:
+ page_header: "We found an address that might be this property"
+ check_answer_label: "Is this the right address?"
+ hint_text: ""
+ question_text: "Is this the property address?"
+
+ address_matcher:
+ page_header: "Find an address"
+ address_line1_input:
+ check_answer_label: "Find address"
+ hint_text: ""
+ question_text: "Address line 1"
+ postcode_full_input:
+ check_answer_label: ""
+ hint_text: ""
+ question_text: "Postcode"
+
+ uprn_selection:
+ page_header: "We found an address that might be this property"
+ check_answer_label: "Select the correct address"
+ hint_text: ""
+ question_text: "Select the correct address"
+
+ address:
+ page_header: "Q12 - What is the property's address?"
+ address_line1:
+ check_answer_label: "Address lines 1 and 2"
+ hint_text: ""
+ question_text: "Address line 1"
+ address_line2:
+ check_answer_label: ""
+ hint_text: ""
+ question_text: "Address line 2 (optional)"
+ town_or_city:
+ check_answer_label: "Town or city"
+ hint_text: ""
+ question_text: "Town or city"
+ county:
+ check_answer_label: "County"
+ hint_text: ""
+ question_text: "County (optional)"
+ postcode_full:
+ check_answer_label: "Postcode"
+ hint_text: ""
+ question_text: "Postcode"
+
+ la:
+ page_header: ""
+ check_answer_label: "Local authority"
+ hint_text: ""
+ question_text: "What is the property’s local authority?"
+
+
+ unitletas:
+ page_header: ""
+ check_answer_label: "Most recent let type"
+ hint_text: "This is the rent type of the previous tenancy in this property."
+ question_text: "What type was the property most recently let as?"
+
+ rsnvac:
+ page_header: ""
+ check_answer_label: "Vacancy reason"
+ hint_text: ""
+ question_text: "What is the reason for the property being vacant?"
+
+ unittype_gn:
+ page_header: ""
+ check_answer_label: "Type of unit"
+ hint_text: ""
+ question_text: "What type of unit is the property?"
+
+ builtype:
+ page_header: ""
+ check_answer_label: "Type of building"
+ hint_text: ""
+ question_text: "What type of building is the property?"
+
+ wchair:
+ page_header: ""
+ check_answer_label: "Property built or adapted to wheelchair-user standards"
+ hint_text: "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."
+ question_text: "Is the property built or adapted to wheelchair-user standards?"
+
+ beds:
+ page_header: ""
+ check_answer_label: "Number of bedrooms"
+ hint_text: "If shared accommodation, enter the number of bedrooms occupied by this household."
+ question_text: "How many bedrooms does the property have?"
+
+ voiddate:
+ page_header: "Void date"
+ check_answer_label: "Void date"
+ hint_text: ""
+ question_text: "What is the void date?"
+
+ property_major_repairs:
+ page_header: ""
+ majorrepairs:
+ check_answer_label: "Major repairs carried out during void period"
+ hint_text: "Major repairs are works that could not be reasonably carried out with a tenant living at the property. For example, structural repairs."
+ question_text: "Were any major repairs carried out during the void period?"
+ mrcdate:
+ check_answer_label: "Completion date of repairs"
+ hint_text: ""
+ question_text: "When were the repairs completed?"
diff --git a/spec/requests/duplicate_logs_controller_spec.rb b/spec/requests/duplicate_logs_controller_spec.rb
index c06d30baf..700964fcf 100644
--- a/spec/requests/duplicate_logs_controller_spec.rb
+++ b/spec/requests/duplicate_logs_controller_spec.rb
@@ -66,7 +66,6 @@ RSpec.describe DuplicateLogsController, type: :request do
it "displays check your answers for each log with correct questions" do
expect(page).to have_content("Q5 - Tenancy start date", count: 3)
expect(page).to have_content("Q7 - Tenant code", count: 3)
- expect(page).to have_content("Q12 - Postcode", count: 3)
expect(page).to have_content("Q32 - Lead tenant’s age", count: 3)
expect(page).to have_content("Q33 - Lead tenant’s gender identity", count: 3)
expect(page).to have_content("Q37 - Lead tenant’s working situation", count: 3)
@@ -84,7 +83,6 @@ RSpec.describe DuplicateLogsController, type: :request do
expect(page).to have_content("Q5 - Tenancy start date", count: 3)
expect(page).to have_content("Q7 - Tenant code", count: 3)
- expect(page).to have_content("Q12 - Postcode", count: 1)
expect(page).to have_content("Postcode (from UPRN)", count: 2)
expect(page).to have_content("Q32 - Lead tenant’s age", count: 3)
expect(page).to have_content("Q33 - Lead tenant’s gender identity", count: 3)
@@ -114,7 +112,6 @@ RSpec.describe DuplicateLogsController, type: :request do
it "displays check your answers for each log with correct questions" do
expect(page).to have_content("Q5 - Tenancy start date", count: 1)
expect(page).to have_content("Q7 - Tenant code", count: 1)
- expect(page).to have_content("Q12 - Postcode", count: 1)
expect(page).to have_content("Q32 - Lead tenant’s age", count: 1)
expect(page).to have_content("Q33 - Lead tenant’s gender identity", count: 1)
expect(page).to have_content("Q37 - Lead tenant’s working situation", count: 1)
@@ -141,7 +138,6 @@ RSpec.describe DuplicateLogsController, type: :request do
it "displays check your answers for each log with correct questions" do
expect(page).to have_content("Q5 - Tenancy start date", count: 1)
expect(page).to have_content("Q7 - Tenant code", count: 1)
- expect(page).to have_content("Q12 - Postcode", count: 1)
expect(page).to have_content("Q32 - Lead tenant’s age", count: 1)
expect(page).to have_content("Q33 - Lead tenant’s gender identity", count: 1)
expect(page).to have_content("Q37 - Lead tenant’s working situation", count: 1)
@@ -295,7 +291,6 @@ RSpec.describe DuplicateLogsController, type: :request do
it "displays check your answers for each log with correct questions" do
expect(page).to have_content("Q5 - Tenancy start date", count: 3)
expect(page).to have_content("Q7 - Tenant code", count: 3)
- expect(page).to have_content("Q12 - Postcode", count: 3)
expect(page).to have_content("Q32 - Lead tenant’s age", count: 3)
expect(page).to have_content("Q33 - Lead tenant’s gender identity", count: 3)
expect(page).to have_content("Q37 - Lead tenant’s working situation", count: 3)
@@ -324,7 +319,6 @@ RSpec.describe DuplicateLogsController, type: :request do
it "displays check your answers for each log with correct questions" do
expect(page).to have_content("Q5 - Tenancy start date", count: 1)
expect(page).to have_content("Q7 - Tenant code", count: 1)
- expect(page).to have_content("Q12 - Postcode", count: 1)
expect(page).to have_content("Q32 - Lead tenant’s age", count: 1)
expect(page).to have_content("Q33 - Lead tenant’s gender identity", count: 1)
expect(page).to have_content("Q37 - Lead tenant’s working situation", count: 1)
@@ -351,7 +345,6 @@ RSpec.describe DuplicateLogsController, type: :request do
it "displays check your answers for each log with correct questions" do
expect(page).to have_content("Q5 - Tenancy start date", count: 1)
expect(page).to have_content("Q7 - Tenant code", count: 1)
- expect(page).to have_content("Q12 - Postcode", count: 1)
expect(page).to have_content("Q32 - Lead tenant’s age", count: 1)
expect(page).to have_content("Q33 - Lead tenant’s gender identity", count: 1)
expect(page).to have_content("Q37 - Lead tenant’s working situation", count: 1)
From 576d0900fa63326e57f03a140cfa56d7030db5d4 Mon Sep 17 00:00:00 2001
From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com>
Date: Thu, 31 Oct 2024 09:44:51 +0000
Subject: [PATCH 06/12] CLDC-3691: Extract copy - lettings setup validations
(#2739)
---
app/models/validations/setup_validations.rb | 80 +++++++++----------
config/locales/en.yml | 34 --------
.../locales/validations/lettings/setup.en.yml | 53 ++++++++++++
.../validations/setup_validations_spec.rb | 18 ++---
4 files changed, 102 insertions(+), 83 deletions(-)
create mode 100644 config/locales/validations/lettings/setup.en.yml
diff --git a/app/models/validations/setup_validations.rb b/app/models/validations/setup_validations.rb
index 913cc9c96..d8e5dbf93 100644
--- a/app/models/validations/setup_validations.rb
+++ b/app/models/validations/setup_validations.rb
@@ -16,42 +16,42 @@ module Validations::SetupValidations
end
if record.startdate > Time.zone.today + 14.days
- record.errors.add :startdate, I18n.t("validations.setup.startdate.later_than_14_days_after")
+ record.errors.add :startdate, I18n.t("validations.lettings.setup.startdate.not_within.next_two_weeks")
end
end
def validate_organisation(record)
assigned_to, managing_organisation, owning_organisation = record.values_at("assigned_to", "managing_organisation", "owning_organisation")
unless [assigned_to, managing_organisation, owning_organisation].any?(&:blank?) || ((assigned_to.organisation.absorbed_organisations + [assigned_to.organisation]) & [managing_organisation, owning_organisation]).present?
- record.errors.add :assigned_to, I18n.t("validations.setup.assigned_to.invalid")
- record.errors.add :owning_organisation_id, I18n.t("validations.setup.owning_organisation.invalid")
- record.errors.add :managing_organisation_id, I18n.t("validations.setup.managing_organisation.invalid")
+ record.errors.add :assigned_to, I18n.t("validations.lettings.setup.assigned_to.invalid")
+ record.errors.add :owning_organisation_id, I18n.t("validations.lettings.setup.owning_organisation.invalid")
+ record.errors.add :managing_organisation_id, I18n.t("validations.lettings.setup.managing_organisation.invalid")
end
return unless record.startdate
if owning_organisation.present?
if owning_organisation&.merge_date.present? && owning_organisation.merge_date <= record.startdate
- record.errors.add :owning_organisation_id, I18n.t("validations.setup.owning_organisation.inactive_merged_organisation",
+ record.errors.add :owning_organisation_id, I18n.t("validations.lettings.setup.owning_organisation.inactive.merged_organisation",
owning_organisation: record.owning_organisation.name,
- owning_organisation_merge_date: record.owning_organisation.merge_date.to_formatted_s(:govuk_date),
- owning_absorbing_organisation: record.owning_organisation.absorbing_organisation.name)
+ merge_date: record.owning_organisation.merge_date.to_formatted_s(:govuk_date),
+ absorbing_organisation: record.owning_organisation.absorbing_organisation.name)
elsif owning_organisation&.absorbed_organisations.present? && owning_organisation.available_from.present? && owning_organisation.available_from.to_date > record.startdate.to_date
- record.errors.add :owning_organisation_id, I18n.t("validations.setup.owning_organisation.inactive_absorbing_organisation",
+ record.errors.add :owning_organisation_id, I18n.t("validations.lettings.setup.owning_organisation.inactive.absorbing_organisation",
owning_organisation: record.owning_organisation.name,
- owning_organisation_available_from: record.owning_organisation.available_from.to_formatted_s(:govuk_date))
+ available_from: record.owning_organisation.available_from.to_formatted_s(:govuk_date))
end
end
if managing_organisation.present?
if managing_organisation&.merge_date.present? && managing_organisation.merge_date <= record.startdate
- record.errors.add :managing_organisation_id, I18n.t("validations.setup.managing_organisation.inactive_merged_organisation",
+ record.errors.add :managing_organisation_id, I18n.t("validations.lettings.setup.managing_organisation.inactive.merged_organisation",
managing_organisation: record.managing_organisation.name,
- managing_organisation_merge_date: record.managing_organisation.merge_date.to_formatted_s(:govuk_date),
- managing_absorbing_organisation: record.managing_organisation.absorbing_organisation.name)
+ merge_date: record.managing_organisation.merge_date.to_formatted_s(:govuk_date),
+ absorbing_organisation: record.managing_organisation.absorbing_organisation.name)
elsif managing_organisation&.absorbed_organisations.present? && managing_organisation.available_from.present? && managing_organisation.available_from.to_date > record.startdate.to_date
- record.errors.add :managing_organisation_id, I18n.t("validations.setup.managing_organisation.inactive_absorbing_organisation",
+ record.errors.add :managing_organisation_id, I18n.t("validations.lettings.setup.managing_organisation.inactive.absorbing_organisation",
managing_organisation: record.managing_organisation.name,
- managing_organisation_available_from: record.managing_organisation.available_from.to_formatted_s(:govuk_date))
+ available_from: record.managing_organisation.available_from.to_formatted_s(:govuk_date))
end
end
end
@@ -68,7 +68,7 @@ module Validations::SetupValidations
def validate_irproduct_other(record)
if intermediate_product_rent_type?(record) && record.irproduct_other.blank?
- record.errors.add :irproduct_other, I18n.t("validations.setup.intermediate_rent_product_name.blank")
+ record.errors.add :irproduct_other, I18n.t("validations.lettings.setup.intermediate_rent_product_name.blank")
end
end
@@ -76,13 +76,13 @@ module Validations::SetupValidations
return unless record.scheme
unless record.scheme.locations.confirmed.any?
- record.errors.add :scheme_id, :no_completed_locations, message: I18n.t("validations.scheme.no_completed_locations")
+ record.errors.add :scheme_id, :no_completed_locations, message: I18n.t("validations.lettings.setup.scheme.no_completed_locations")
end
end
def validate_scheme(record)
if record.scheme&.status == :incomplete
- record.errors.add :scheme_id, :incomplete, message: I18n.t("validations.setup.scheme.incomplete")
+ record.errors.add :scheme_id, :incomplete, message: I18n.t("validations.lettings.setup.scheme.incomplete")
end
scheme_during_startdate_validation(record)
@@ -93,8 +93,8 @@ module Validations::SetupValidations
location_during_startdate_validation(record)
if record.location&.status == :incomplete
- record.errors.add :location_id, :incomplete, message: I18n.t("validations.setup.location.incomplete")
- record.errors.add :scheme_id, :incomplete, message: I18n.t("validations.setup.location.incomplete")
+ record.errors.add :location_id, :incomplete, message: I18n.t("validations.lettings.setup.location.incomplete")
+ record.errors.add :scheme_id, :incomplete, message: I18n.t("validations.lettings.setup.location.incomplete")
end
end
@@ -102,7 +102,7 @@ module Validations::SetupValidations
return if record.skip_dpo_validation
if record.managing_organisation_id_changed? && record.managing_organisation.present? && !record.managing_organisation.data_protection_confirmed?
- record.errors.add :managing_organisation_id, I18n.t("validations.setup.managing_organisation.data_sharing_agreement_not_signed")
+ record.errors.add :managing_organisation_id, I18n.t("validations.lettings.setup.managing_organisation.data_sharing_agreement_not_signed")
end
end
@@ -129,7 +129,7 @@ private
if FormHandler.instance.lettings_in_crossover_period?
I18n.t(
- "validations.setup.startdate.previous_and_current_collection_year",
+ "validations.lettings.setup.startdate.must_be_within.previous_and_current_collection_year",
previous_start_year_short: previous_collection_start_date.strftime("%Y"),
previous_end_year_short: previous_collection_end_date.strftime("%Y"),
previous_start_year_long: previous_collection_start_date.strftime("#{previous_collection_start_date.day.ordinalize} %B %Y"),
@@ -138,7 +138,7 @@ private
)
else
I18n.t(
- "validations.setup.startdate.current_collection_year",
+ "validations.lettings.setup.startdate.must_be_within.current_collection_year",
current_start_year_short: current_collection_start_date.strftime("%Y"),
current_end_year_short: current_collection_end_date.strftime("%Y"),
current_start_year_long: current_collection_start_date.strftime("#{current_collection_start_date.day.ordinalize} %B %Y"),
@@ -153,20 +153,20 @@ private
def add_same_merge_organisation_error(record)
if merged_owning_organisation_inactive?(record)
- record.errors.add :startdate, I18n.t("validations.setup.startdate.invalid_merged_organisations_start_date.same_organisation",
+ record.errors.add :startdate, I18n.t("validations.lettings.setup.startdate.invalid_merged_organisations_start_date.same_organisation",
owning_organisation: record.owning_organisation.name,
- owning_organisation_merge_date: record.owning_organisation.merge_date.to_formatted_s(:govuk_date),
- owning_absorbing_organisation: record.owning_organisation.absorbing_organisation.name)
+ merge_date: record.owning_organisation.merge_date.to_formatted_s(:govuk_date),
+ absorbing_organisation: record.owning_organisation.absorbing_organisation.name)
elsif absorbing_owning_organisation_inactive?(record)
- record.errors.add :startdate, I18n.t("validations.setup.startdate.invalid_absorbing_organisations_start_date.same_organisation",
+ record.errors.add :startdate, I18n.t("validations.lettings.setup.startdate.invalid_absorbing_organisations_start_date.same_organisation",
owning_organisation: record.owning_organisation.name,
- owning_organisation_available_from: record.owning_organisation.available_from.to_formatted_s(:govuk_date))
+ available_from: record.owning_organisation.available_from.to_formatted_s(:govuk_date))
end
end
def add_same_merge_error(record)
if merged_owning_organisation_inactive?(record)
- record.errors.add :startdate, I18n.t("validations.setup.startdate.invalid_merged_organisations_start_date.same_merge",
+ record.errors.add :startdate, I18n.t("validations.lettings.setup.startdate.invalid_merged_organisations_start_date.same_merge",
owning_organisation: record.owning_organisation.name,
managing_organisation: record.managing_organisation.name,
owning_organisation_merge_date: record.owning_organisation.merge_date.to_formatted_s(:govuk_date),
@@ -176,7 +176,7 @@ private
def add_merged_organisations_errors(record)
if merged_owning_organisation_inactive?(record) && merged_managing_organisation_inactive?(record)
- record.errors.add :startdate, I18n.t("validations.setup.startdate.invalid_merged_organisations_start_date.different_merge",
+ record.errors.add :startdate, I18n.t("validations.lettings.setup.startdate.invalid_merged_organisations_start_date.different_merge",
owning_organisation: record.owning_organisation.name,
owning_organisation_merge_date: record.owning_organisation.merge_date.to_formatted_s(:govuk_date),
owning_absorbing_organisation: record.owning_organisation.absorbing_organisation.name,
@@ -185,39 +185,39 @@ private
managing_absorbing_organisation: record.managing_organisation.absorbing_organisation.name)
else
if merged_owning_organisation_inactive?(record)
- record.errors.add :startdate, I18n.t("validations.setup.startdate.invalid_merged_organisations_start_date.owning_organisation",
+ record.errors.add :startdate, I18n.t("validations.lettings.setup.startdate.invalid_merged_organisations_start_date.owning_organisation",
owning_organisation: record.owning_organisation.name,
- owning_organisation_merge_date: record.owning_organisation.merge_date.to_formatted_s(:govuk_date),
- owning_absorbing_organisation: record.owning_organisation.absorbing_organisation.name)
+ merge_date: record.owning_organisation.merge_date.to_formatted_s(:govuk_date),
+ absorbing_organisation: record.owning_organisation.absorbing_organisation.name)
end
if merged_managing_organisation_inactive?(record)
- record.errors.add :startdate, I18n.t("validations.setup.startdate.invalid_merged_organisations_start_date.managing_organisation",
+ record.errors.add :startdate, I18n.t("validations.lettings.setup.startdate.invalid_merged_organisations_start_date.managing_organisation",
managing_organisation: record.managing_organisation.name,
- managing_organisation_merge_date: record.managing_organisation.merge_date.to_formatted_s(:govuk_date),
- managing_absorbing_organisation: record.managing_organisation.absorbing_organisation.name)
+ merge_date: record.managing_organisation.merge_date.to_formatted_s(:govuk_date),
+ absorbing_organisation: record.managing_organisation.absorbing_organisation.name)
end
end
end
def add_absorbing_organisations_errors(record)
if absorbing_owning_organisation_inactive?(record) && absorbing_managing_organisation_inactive?(record)
- record.errors.add :startdate, I18n.t("validations.setup.startdate.invalid_absorbing_organisations_start_date.different_organisations",
+ record.errors.add :startdate, I18n.t("validations.lettings.setup.startdate.invalid_absorbing_organisations_start_date.different_organisations",
owning_organisation: record.owning_organisation.name,
owning_organisation_active_from: record.owning_organisation.available_from.to_formatted_s(:govuk_date),
managing_organisation: record.managing_organisation.name,
managing_organisation_active_from: record.managing_organisation.available_from.to_formatted_s(:govuk_date))
else
if absorbing_owning_organisation_inactive?(record)
- record.errors.add :startdate, I18n.t("validations.setup.startdate.invalid_absorbing_organisations_start_date.owning_organisation",
+ record.errors.add :startdate, I18n.t("validations.lettings.setup.startdate.invalid_absorbing_organisations_start_date.owning_organisation",
owning_organisation: record.owning_organisation.name,
- owning_organisation_available_from: record.owning_organisation.available_from.to_formatted_s(:govuk_date))
+ available_from: record.owning_organisation.available_from.to_formatted_s(:govuk_date))
end
if absorbing_managing_organisation_inactive?(record)
- record.errors.add :startdate, I18n.t("validations.setup.startdate.invalid_absorbing_organisations_start_date.managing_organisation",
+ record.errors.add :startdate, I18n.t("validations.lettings.setup.startdate.invalid_absorbing_organisations_start_date.managing_organisation",
managing_organisation: record.managing_organisation.name,
- managing_organisation_available_from: record.managing_organisation.available_from.to_formatted_s(:govuk_date))
+ available_from: record.managing_organisation.available_from.to_formatted_s(:govuk_date))
end
end
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index c78ba2463..106ccb9fa 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -281,33 +281,14 @@ en:
invalid: "Role must be data accessor, data provider or data coordinator."
setup:
- intermediate_rent_product_name:
- blank: "Enter name of other intermediate rent product."
saledate:
year_not_two_or_four_digits: "Sale completion year must be 2 or 4 digits."
type:
percentage_bought_must_be_at_least_threshold: "The minimum increase in equity while staircasing is %{threshold}% for this shared ownership type."
startdate:
- current_collection_year:
- "Enter a date within the %{current_start_year_short} to %{current_end_year_short} collection year, which is between %{current_start_year_long} and %{current_end_year_long}."
- previous_and_current_collection_year:
- "Enter a date within the %{previous_start_year_short} to %{previous_end_year_short} or %{previous_end_year_short} to %{current_end_year_short} collection years, which is between %{previous_start_year_long} and %{current_end_year_long}."
- later_than_14_days_after: "The tenancy start date must not be later than 14 days from today’s date."
before_scheme_end_date: "The tenancy start date must be before the end date for this supported housing scheme."
year_not_two_or_four_digits: "Tenancy start year must be 2 or 4 digits."
- invalid_merged_organisations_start_date:
- same_organisation: "Enter a date when the owning and managing organisation was active. %{owning_organisation} became inactive on %{owning_organisation_merge_date} and was replaced by %{owning_absorbing_organisation}."
- same_merge: "Enter a date when the owning and managing organisations were active. %{owning_organisation} and %{managing_organisation} became inactive on %{owning_organisation_merge_date} and were replaced by %{owning_absorbing_organisation}."
- owning_organisation: "Enter a date when the owning organisation was active. %{owning_organisation} became inactive on %{owning_organisation_merge_date} and was replaced by %{owning_absorbing_organisation}."
- managing_organisation: "Enter a date when the managing organisation was active. %{managing_organisation} became inactive on %{managing_organisation_merge_date} and was replaced by %{managing_absorbing_organisation}."
- different_merge: "Enter a date when the owning and managing organisations were active. %{owning_organisation} became inactive on %{owning_organisation_merge_date} and was replaced by %{owning_absorbing_organisation}. %{managing_organisation} became inactive on %{managing_organisation_merge_date} and was replaced by %{managing_absorbing_organisation}."
- invalid_absorbing_organisations_start_date:
- same_organisation: "Enter a date when the owning and managing organisation was active. %{owning_organisation} became active on %{owning_organisation_available_from}."
- owning_organisation: "Enter a date when the owning organisation was active. %{owning_organisation} became active on %{owning_organisation_available_from}."
- managing_organisation: "Enter a date when the managing organisation was active. %{managing_organisation} became active on %{managing_organisation_available_from}."
- different_organisations: "Enter a date when the owning and managing organisations were active. %{owning_organisation} became active on %{owning_organisation_active_from}, and %{managing_organisation} became active on %{managing_organisation_active_from}."
-
location:
deactivated:
startdate: "The location %{postcode} is inactive on this date. Enter another date or choose another location."
@@ -329,17 +310,7 @@ en:
startdate: "The scheme %{name} has no locations that are active on this date. Enter another date or choose another scheme."
scheme_id: "The scheme %{name} has no locations that are active on this date. Enter another date or choose another scheme."
owning_organisation:
- invalid: "Please select the owning organisation or managing organisation that you belong to."
data_sharing_agreement_not_signed: "The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation."
- inactive_merged_organisation: "The owning organisation must be active on the tenancy start date. %{owning_organisation} became inactive on %{owning_organisation_merge_date} and was replaced by %{owning_absorbing_organisation}."
- inactive_absorbing_organisation: "The owning organisation must be active on the tenancy start date. %{owning_organisation} became active on %{owning_organisation_available_from}."
- managing_organisation:
- invalid: "Please select the owning organisation or managing organisation that you belong to."
- data_sharing_agreement_not_signed: "The organisation must accept the Data Sharing Agreement before it can be selected as the managing organisation."
- inactive_merged_organisation: "The managing organisation must be active on the tenancy start date. %{managing_organisation} became inactive on %{managing_organisation_merge_date} and was replaced by %{managing_absorbing_organisation}."
- inactive_absorbing_organisation: "The managing organisation must be active on the tenancy start date. %{managing_organisation} became active on %{managing_organisation_available_from}."
- assigned_to:
- invalid: "Please select the owning organisation or managing organisation that you belong to."
lettype:
general_needs_mismatch: "Lettings type must be a general needs type because you selected general needs when uploading the file."
supported_housing_mismatch: "Lettings type must be a supported housing type because you selected supported housing when uploading the file."
@@ -348,10 +319,6 @@ en:
needstype:
lettype_not_general_needs: "This letting type is supported housing, but the needs type is general needs. Change either the needs type or the letting type."
lettype_not_supported_housing: "This letting type is general needs, but the needs type is supported housing. Change either the needs type or the letting type."
- location:
- incomplete: "This location is incomplete. Select another location or update this one."
- scheme:
- incomplete: "This scheme is incomplete. Select another scheme or update this one."
property:
uprn:
@@ -603,7 +570,6 @@ en:
during_deactivated_period: "The scheme is already deactivated during this date, please enter a different date."
owning_organisation:
does_not_own_stock: "Enter an organisation that owns housing stock."
- no_completed_locations: "This scheme cannot be chosen as it has no completed locations."
location:
postcode_blank: "Enter a postcode."
diff --git a/config/locales/validations/lettings/setup.en.yml b/config/locales/validations/lettings/setup.en.yml
new file mode 100644
index 000000000..d2ee9bf0f
--- /dev/null
+++ b/config/locales/validations/lettings/setup.en.yml
@@ -0,0 +1,53 @@
+en:
+ validations:
+ lettings:
+ setup:
+ startdate:
+ not_within:
+ next_two_weeks: "The tenancy start date must not be later than 14 days from today’s date."
+ must_be_within:
+ current_collection_year:
+ "Enter a date within the %{current_start_year_short} to %{current_end_year_short} collection year, which is between %{current_start_year_long} and %{current_end_year_long}."
+ previous_and_current_collection_year:
+ "Enter a date within the %{previous_start_year_short} to %{previous_end_year_short} or %{previous_end_year_short} to %{current_end_year_short} collection years, which is between %{previous_start_year_long} and %{current_end_year_long}."
+ invalid_merged_organisations_start_date:
+ same_organisation: "Enter a date when the owning and managing organisation was active. %{owning_organisation} became inactive on %{merge_date} and was replaced by %{absorbing_organisation}."
+ same_merge: "Enter a date when the owning and managing organisations were active. %{owning_organisation} and %{managing_organisation} became inactive on %{owning_organisation_merge_date} and were replaced by %{owning_absorbing_organisation}."
+ owning_organisation: "Enter a date when the owning organisation was active. %{owning_organisation} became inactive on %{merge_date} and was replaced by %{absorbing_organisation}."
+ managing_organisation: "Enter a date when the managing organisation was active. %{managing_organisation} became inactive on %{merge_date} and was replaced by %{absorbing_organisation}."
+ different_merge: "Enter a date when the owning and managing organisations were active. %{owning_organisation} became inactive on %{owning_organisation_merge_date} and was replaced by %{owning_absorbing_organisation}. %{managing_organisation} became inactive on %{managing_organisation_merge_date} and was replaced by %{managing_absorbing_organisation}."
+ invalid_absorbing_organisations_start_date:
+ same_organisation: "Enter a date when the owning and managing organisation was active. %{owning_organisation} became active on %{available_from}."
+ owning_organisation: "Enter a date when the owning organisation was active. %{owning_organisation} became active on %{available_from}."
+ managing_organisation: "Enter a date when the managing organisation was active. %{managing_organisation} became active on %{available_from}."
+ different_organisations: "Enter a date when the owning and managing organisations were active. %{owning_organisation} became active on %{owning_organisation_active_from}, and %{managing_organisation} became active on %{managing_organisation_active_from}."
+
+ assigned_to:
+ invalid: "Please select the owning organisation or managing organisation that you belong to."
+
+ owning_organisation:
+ invalid: "Please select the owning organisation or managing organisation that you belong to."
+ inactive:
+ merged_organisation:
+ "The owning organisation must be active on the tenancy start date. %{owning_organisation} became inactive on %{merge_date} and was replaced by %{absorbing_organisation}."
+ absorbing_organisation:
+ "The owning organisation must be active on the tenancy start date. %{owning_organisation} became active on %{available_from}."
+
+ managing_organisation:
+ invalid: "Please select the owning organisation or managing organisation that you belong to."
+ data_sharing_agreement_not_signed: "The organisation must accept the Data Sharing Agreement before it can be selected as the managing organisation."
+ inactive:
+ merged_organisation:
+ "The managing organisation must be active on the tenancy start date. %{managing_organisation} became inactive on %{merge_date} and was replaced by %{absorbing_organisation}."
+ absorbing_organisation:
+ "The managing organisation must be active on the tenancy start date. %{managing_organisation} became active on %{available_from}."
+
+ intermediate_rent_product_name:
+ blank: "Enter name of other intermediate rent product."
+
+ scheme:
+ incomplete: "This scheme is incomplete. Select another scheme or update this one."
+ no_completed_locations: "This scheme cannot be chosen as it has no completed locations."
+
+ location:
+ incomplete: "This location is incomplete. Select another location or update this one."
diff --git a/spec/models/validations/setup_validations_spec.rb b/spec/models/validations/setup_validations_spec.rb
index f1e306a89..0c99d3628 100644
--- a/spec/models/validations/setup_validations_spec.rb
+++ b/spec/models/validations/setup_validations_spec.rb
@@ -149,7 +149,7 @@ RSpec.describe Validations::SetupValidations do
it "adds an error to startdate" do
record.startdate = Time.zone.local(2024, 3, 31)
setup_validator.validate_startdate_setup(record)
- expect(record.errors["startdate"]).to include(match I18n.t("validations.setup.startdate.later_than_14_days_after"))
+ expect(record.errors["startdate"]).to include(match I18n.t("validations.lettings.setup.startdate.not_within.next_two_weeks"))
end
context "and the attempted startdate is in a future collection year" do
@@ -158,7 +158,7 @@ RSpec.describe Validations::SetupValidations do
setup_validator.validate_startdate_setup(record)
expect(record.errors["startdate"].length).to be >= 2
expect(record.errors["startdate"][0]).to eq("Enter a date within the 2023 to 2024 collection year, which is between 1st April 2023 and 31st March 2024.")
- expect(record.errors["startdate"][1]).to eq(I18n.t("validations.setup.startdate.later_than_14_days_after"))
+ expect(record.errors["startdate"][1]).to eq(I18n.t("validations.lettings.setup.startdate.not_within.next_two_weeks"))
end
end
end
@@ -401,7 +401,7 @@ RSpec.describe Validations::SetupValidations do
record.irproduct_other = nil
setup_validator.validate_irproduct_other(record)
expect(record.errors["irproduct_other"])
- .to include(match I18n.t("validations.setup.intermediate_rent_product_name.blank"))
+ .to include(match I18n.t("validations.lettings.setup.intermediate_rent_product_name.blank"))
end
it "adds an error when the intermediate rent product name is blank but the rent type was given as other intermediate rent product" do
@@ -409,7 +409,7 @@ RSpec.describe Validations::SetupValidations do
record.irproduct_other = ""
setup_validator.validate_irproduct_other(record)
expect(record.errors["irproduct_other"])
- .to include(match I18n.t("validations.setup.intermediate_rent_product_name.blank"))
+ .to include(match I18n.t("validations.lettings.setup.intermediate_rent_product_name.blank"))
end
it "Does not add an error when the intermediate rent product name is provided and the rent type was given as other intermediate rent product" do
@@ -572,7 +572,7 @@ RSpec.describe Validations::SetupValidations do
it "adds an error to scheme_id" do
record.scheme = scheme
setup_validator.validate_scheme(record)
- expect(record.errors["scheme_id"]).to include(I18n.t("validations.setup.scheme.incomplete"))
+ expect(record.errors["scheme_id"]).to include(I18n.t("validations.lettings.setup.scheme.incomplete"))
end
end
end
@@ -748,9 +748,9 @@ RSpec.describe Validations::SetupValidations do
record.managing_organisation = other_organisation
setup_validator.validate_organisation(record)
- expect(record.errors["assigned_to"]).to include(I18n.t("validations.setup.assigned_to.invalid"))
- expect(record.errors["owning_organisation_id"]).to include(I18n.t("validations.setup.owning_organisation.invalid"))
- expect(record.errors["managing_organisation_id"]).to include(I18n.t("validations.setup.managing_organisation.invalid"))
+ expect(record.errors["assigned_to"]).to include(I18n.t("validations.lettings.setup.assigned_to.invalid"))
+ expect(record.errors["owning_organisation_id"]).to include(I18n.t("validations.lettings.setup.owning_organisation.invalid"))
+ expect(record.errors["managing_organisation_id"]).to include(I18n.t("validations.lettings.setup.managing_organisation.invalid"))
end
it "does not validate if either managing or owning organisation is the same as current user organisation" do
@@ -902,7 +902,7 @@ RSpec.describe Validations::SetupValidations do
record.scheme = scheme
setup_validator.validate_scheme_has_confirmed_locations_validation(record)
expect(record.errors["scheme_id"])
- .to include(match I18n.t("validations.scheme.no_completed_locations"))
+ .to include(match I18n.t("validations.lettings.setup.scheme.no_completed_locations"))
end
end
From 625b0c757c70dcb8b212386a31083d259feb6eed Mon Sep 17 00:00:00 2001
From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com>
Date: Thu, 31 Oct 2024 16:29:55 +0000
Subject: [PATCH 07/12] CLDC-3668 Extract guidance copy (#2737)
* Extract guidance copy
* Update tests and lint
---
.../form/lettings/questions/declaration.rb | 2 +-
.../form/lettings/questions/rent_type.rb | 2 +-
.../form/sales/questions/privacy_notice.rb | 6 +-
.../sales/questions/shared_ownership_type.rb | 10 +--
..._discounted_ownership_type_definitions.erb | 28 ++-------
app/views/form/guidance/_finding_location.erb | 10 +--
app/views/form/guidance/_finding_scheme.erb | 13 ++--
.../form/guidance/_mortgage_lender.html.erb | 8 +--
.../_outright_sale_type_definitions.erb | 13 ++--
.../form/guidance/_privacy_notice_buyer.erb | 4 +-
.../guidance/_privacy_notice_buyer_2024.erb | 1 -
...ivacy_notice_buyer_2024_joint_purchase.erb | 1 -
.../_privacy_notice_buyer_joint_purchase.erb | 4 +-
.../form/guidance/_privacy_notice_tenant.erb | 4 +-
.../guidance/_privacy_notice_tenant_2024.erb | 1 -
.../form/guidance/_rent_type_definitions.erb | 26 ++------
.../guidance/_rent_type_definitions_2024.erb | 21 -------
.../form/guidance/_scheme_selection.html.erb | 4 +-
.../_shared_ownership_type_definitions.erb | 31 ++-------
...shared_ownership_type_definitions_2024.erb | 26 --------
app/views/form/guidance/_void_date.html.erb | 14 ++---
.../guidance/_what_counts_as_income.html.erb | 21 ++-----
.../forms/2023/lettings/guidance.en.yml | 63 +++++++++++++++++++
.../locales/forms/2023/sales/guidance.en.yml | 47 ++++++++++++++
.../forms/2024/lettings/guidance.en.yml | 63 +++++++++++++++++++
.../locales/forms/2024/sales/guidance.en.yml | 46 ++++++++++++++
.../lettings/questions/declaration_spec.rb | 2 +-
.../form/lettings/questions/rent_type_spec.rb | 2 +-
.../sales/questions/privacy_notice_spec.rb | 4 +-
.../questions/shared_ownership_type_spec.rb | 2 +-
spec/requests/form_controller_spec.rb | 2 +-
spec/views/form/page_view_spec.rb | 2 +-
32 files changed, 286 insertions(+), 197 deletions(-)
delete mode 100644 app/views/form/guidance/_privacy_notice_buyer_2024.erb
delete mode 100644 app/views/form/guidance/_privacy_notice_buyer_2024_joint_purchase.erb
delete mode 100644 app/views/form/guidance/_privacy_notice_tenant_2024.erb
delete mode 100644 app/views/form/guidance/_rent_type_definitions_2024.erb
delete mode 100644 app/views/form/guidance/_shared_ownership_type_definitions_2024.erb
create mode 100644 config/locales/forms/2023/lettings/guidance.en.yml
create mode 100644 config/locales/forms/2023/sales/guidance.en.yml
create mode 100644 config/locales/forms/2024/lettings/guidance.en.yml
create mode 100644 config/locales/forms/2024/sales/guidance.en.yml
diff --git a/app/models/form/lettings/questions/declaration.rb b/app/models/form/lettings/questions/declaration.rb
index c88c7cf3c..0e2fd5b2c 100644
--- a/app/models/form/lettings/questions/declaration.rb
+++ b/app/models/form/lettings/questions/declaration.rb
@@ -4,7 +4,7 @@ class Form::Lettings::Questions::Declaration < ::Form::Question
@id = "declaration"
@type = "checkbox"
@check_answers_card_number = 0 unless form.start_year_after_2024?
- @top_guidance_partial = form.start_year_after_2024? ? "privacy_notice_tenant_2024" : "privacy_notice_tenant"
+ @top_guidance_partial = "privacy_notice_tenant"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/rent_type.rb b/app/models/form/lettings/questions/rent_type.rb
index 818ead98a..bc6934200 100644
--- a/app/models/form/lettings/questions/rent_type.rb
+++ b/app/models/form/lettings/questions/rent_type.rb
@@ -4,7 +4,7 @@ class Form::Lettings::Questions::RentType < ::Form::Question
@id = "rent_type"
@copy_key = "lettings.setup.rent_type.rent_type"
@type = "radio"
- @top_guidance_partial = form.start_year_after_2024? ? "rent_type_definitions_2024" : "rent_type_definitions"
+ @top_guidance_partial = "rent_type_definitions"
@answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_2024 : ANSWER_OPTIONS
@conditional_for = { "irproduct_other" => [5] }
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present?
diff --git a/app/models/form/sales/questions/privacy_notice.rb b/app/models/form/sales/questions/privacy_notice.rb
index 95921737f..57f77041b 100644
--- a/app/models/form/sales/questions/privacy_notice.rb
+++ b/app/models/form/sales/questions/privacy_notice.rb
@@ -29,11 +29,7 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question
end
def guidance
- if form.start_year_after_2024?
- @joint_purchase ? "privacy_notice_buyer_2024_joint_purchase" : "privacy_notice_buyer_2024"
- else
- @joint_purchase ? "privacy_notice_buyer_joint_purchase" : "privacy_notice_buyer"
- end
+ @joint_purchase ? "privacy_notice_buyer_joint_purchase" : "privacy_notice_buyer"
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 19, 2024 => 14 }.freeze
diff --git a/app/models/form/sales/questions/shared_ownership_type.rb b/app/models/form/sales/questions/shared_ownership_type.rb
index 1ede14a4d..9ac998313 100644
--- a/app/models/form/sales/questions/shared_ownership_type.rb
+++ b/app/models/form/sales/questions/shared_ownership_type.rb
@@ -3,7 +3,7 @@ class Form::Sales::Questions::SharedOwnershipType < ::Form::Question
super
@id = "type"
@copy_key = "sales.setup.type.shared_ownership"
- @top_guidance_partial = guidance_partial
+ @top_guidance_partial = "shared_ownership_type_definitions"
@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]
@@ -34,13 +34,5 @@ class Form::Sales::Questions::SharedOwnershipType < ::Form::Question
end
end
- def guidance_partial
- if form.start_year_after_2024?
- "shared_ownership_type_definitions_2024"
- elsif form.start_date.year >= 2023
- "shared_ownership_type_definitions"
- end
- end
-
QUESTION_NUMBER_FROM_YEAR = { 2023 => 4, 2024 => 6 }.freeze
end
diff --git a/app/views/form/guidance/_discounted_ownership_type_definitions.erb b/app/views/form/guidance/_discounted_ownership_type_definitions.erb
index 0102a836a..2895e751d 100644
--- a/app/views/form/guidance/_discounted_ownership_type_definitions.erb
+++ b/app/views/form/guidance/_discounted_ownership_type_definitions.erb
@@ -1,23 +1,5 @@
-<%= govuk_details(summary_text: "Discounted ownership type definitions") do %>
-
- Right to Acquire (RTA): a discounted sale of a property built or purchased after 31 March 1997 to tenants of a private registered provider.
-
-
- Preserved Right to Buy (PRTB): a discounted sale of a property that used to be owned by a council to tenants of a private registered provider.
-
-
- Voluntary Right to Buy (VRTB): a discounted sale to tenants in this PRP owned property, as part of a pilot scheme.
-
-
- Right to Buy (RTB): a discounted sale to tenants in this council owned property.
-
-
- Rent to Buy full ownership: a sale on full ownership terms following a period of discounted rent.
-
-
- Social HomeBuy for outright purchase: a discounted sale to tenants of a private registered provider on full ownership terms.
-
-
- Any other equity loan scheme: any scheme, not covered elsewhere, in which a loan is used to purchase equity.
-
-<% end %>
+
+ <%= govuk_details(summary_text: I18n.t("forms.#{@log.form.start_date.year}.sales.guidance.discounted_ownership_type_definitions.title")) do %>
+ <%= I18n.t("forms.#{@log.form.start_date.year}.sales.guidance.discounted_ownership_type_definitions.content").html_safe %>
+ <% end %>
+
diff --git a/app/views/form/guidance/_finding_location.erb b/app/views/form/guidance/_finding_location.erb
index b50d1802a..41c9bd0ab 100644
--- a/app/views/form/guidance/_finding_location.erb
+++ b/app/views/form/guidance/_finding_location.erb
@@ -1,4 +1,6 @@
-<%= govuk_details(summary_text: "What is a location?") do %>
- A location is a postcode area where supported housing is provided under a scheme. A scheme can have multiple locations, and a location can have multiple units at the same postcode.
- <%= govuk_link_to("Read more about schemes and locations", scheme_changes_path) %>
-<% end %>
+
+ <%= govuk_details(summary_text: I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.finding_location.title")) do %>
+
<%= I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.finding_location.content").html_safe %>
+
<%= govuk_link_to(I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.finding_location.scheme_changes_link_text"), scheme_changes_path) %>
+ <% end %>
+
diff --git a/app/views/form/guidance/_finding_scheme.erb b/app/views/form/guidance/_finding_scheme.erb
index 8101c5a6d..40b6fe823 100644
--- a/app/views/form/guidance/_finding_scheme.erb
+++ b/app/views/form/guidance/_finding_scheme.erb
@@ -1,6 +1,7 @@
-<%= govuk_details(summary_text: "Can’t find your scheme?") do %>
- Schemes are attached to the organisation that owns the property. Check you have correctly answered question 1 "Which organisation owns this property?"
- If your organisation’s schemes were migrated from old CORE, they may have new names and codes. Search by postcode to find your scheme.
- <%= govuk_link_to("View your organisation’s schemes", clear_filters_url(filter_type: "schemes")) %>
- <%= govuk_link_to("Read more about how schemes have changed", scheme_changes_path) %>
-<% end %>
+
+ <%= govuk_details(summary_text: I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.finding_scheme.title")) do %>
+ <%= I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.finding_scheme.content").html_safe %>
+
<%= govuk_link_to(I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.finding_scheme.view_schemes_link_text"), clear_filters_url(filter_type: "schemes")) %>
+
<%= govuk_link_to(I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.finding_scheme.scheme_changes_link_text"), scheme_changes_path) %>
+ <% end %>
+
diff --git a/app/views/form/guidance/_mortgage_lender.html.erb b/app/views/form/guidance/_mortgage_lender.html.erb
index 7991182ed..c3f016a82 100644
--- a/app/views/form/guidance/_mortgage_lender.html.erb
+++ b/app/views/form/guidance/_mortgage_lender.html.erb
@@ -1,7 +1,3 @@
-<%= govuk_details(summary_text: "Can’t find the mortgage lender you’re looking for?") do %>
-
- - Double check the spelling and try again
- - Type the first few letters to see the suggestions
- - Type Other and continue - we’ll ask you to type in your answer in the next question
-
+<%= govuk_details(summary_text: I18n.t("forms.#{@log.form.start_date.year}.sales.guidance.mortgage_lender.title")) do %>
+ <%= I18n.t("forms.#{@log.form.start_date.year}.sales.guidance.mortgage_lender.content").html_safe %>
<% end %>
diff --git a/app/views/form/guidance/_outright_sale_type_definitions.erb b/app/views/form/guidance/_outright_sale_type_definitions.erb
index 01e5253d0..c0e4eb1c3 100644
--- a/app/views/form/guidance/_outright_sale_type_definitions.erb
+++ b/app/views/form/guidance/_outright_sale_type_definitions.erb
@@ -1,8 +1,5 @@
-<%= govuk_details(summary_text: "Outright sale type definitions") do %>
-
- Outright sale: the full purchase of a property, usually with a mortgage or cash.
-
-
- Other sale: any sale which does not fit the criteria of any of the remaining options.
-
-<% end %>
+
+ <%= govuk_details(summary_text: I18n.t("forms.#{@log.form.start_date.year}.sales.guidance.outright_sale_type_definitions.title")) do %>
+ <%= I18n.t("forms.#{@log.form.start_date.year}.sales.guidance.outright_sale_type_definitions.content").html_safe %>
+ <% end %>
+
diff --git a/app/views/form/guidance/_privacy_notice_buyer.erb b/app/views/form/guidance/_privacy_notice_buyer.erb
index 599574a06..88dfdda41 100644
--- a/app/views/form/guidance/_privacy_notice_buyer.erb
+++ b/app/views/form/guidance/_privacy_notice_buyer.erb
@@ -1 +1,3 @@
-Make sure the buyer has seen <%= govuk_link_to "the Ministry of Housing, Communities and Local Government (MHCLG) privacy notice", privacy_notice_path, target: :_blank %> before completing this log.
+
+ <%= I18n.t("forms.#{@log.form.start_date.year}.sales.guidance.privacy_notice_buyer.content", privacy_notice_link: "#{govuk_link_to I18n.t("forms.#{@log.form.start_date.year}.sales.guidance.privacy_notice_buyer.privacy_notice_link_text"), privacy_notice_path, target: :_blank}").html_safe %>
+
diff --git a/app/views/form/guidance/_privacy_notice_buyer_2024.erb b/app/views/form/guidance/_privacy_notice_buyer_2024.erb
deleted file mode 100644
index 1ed6e683e..000000000
--- a/app/views/form/guidance/_privacy_notice_buyer_2024.erb
+++ /dev/null
@@ -1 +0,0 @@
-Make sure the buyer has seen or been given access to <%= govuk_link_to "the Ministry of Housing, Communities and Local Government (MHCLG) privacy notice", privacy_notice_path, target: :_blank %> before completing this log. This is a legal requirement under data protection legislation.
diff --git a/app/views/form/guidance/_privacy_notice_buyer_2024_joint_purchase.erb b/app/views/form/guidance/_privacy_notice_buyer_2024_joint_purchase.erb
deleted file mode 100644
index 74ce54a3d..000000000
--- a/app/views/form/guidance/_privacy_notice_buyer_2024_joint_purchase.erb
+++ /dev/null
@@ -1 +0,0 @@
-Make sure the buyers have seen or been given access to <%= govuk_link_to "the Ministry of Housing, Communities and Local Government (MHCLG) privacy notice", privacy_notice_path, target: :_blank %> before completing this log. This is a legal requirement under data protection legislation.
diff --git a/app/views/form/guidance/_privacy_notice_buyer_joint_purchase.erb b/app/views/form/guidance/_privacy_notice_buyer_joint_purchase.erb
index edab9e1e9..c23f5fd52 100644
--- a/app/views/form/guidance/_privacy_notice_buyer_joint_purchase.erb
+++ b/app/views/form/guidance/_privacy_notice_buyer_joint_purchase.erb
@@ -1 +1,3 @@
-Make sure the buyers have seen <%= govuk_link_to "the Ministry of Housing, Communities and Local Government (MHCLG) privacy notice", privacy_notice_path, target: :_blank %> before completing this log.
+
+ <%= I18n.t("forms.#{@log.form.start_date.year}.sales.guidance.privacy_notice_buyer_joint_purchase.content", privacy_notice_link: "#{govuk_link_to I18n.t("forms.#{@log.form.start_date.year}.sales.guidance.privacy_notice_buyer_joint_purchase.privacy_notice_link_text"), privacy_notice_path, target: :_blank}").html_safe %>
+
diff --git a/app/views/form/guidance/_privacy_notice_tenant.erb b/app/views/form/guidance/_privacy_notice_tenant.erb
index 7df685448..8b557c992 100644
--- a/app/views/form/guidance/_privacy_notice_tenant.erb
+++ b/app/views/form/guidance/_privacy_notice_tenant.erb
@@ -1 +1,3 @@
-Make sure the tenant has seen <%= govuk_link_to "the Ministry of Housing, Communities and Local Government (MHCLG) privacy notice", privacy_notice_path, target: :_blank %> before completing this log.
+
+ <%= I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.privacy_notice_tenant.content", privacy_notice_link: "#{govuk_link_to I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.privacy_notice_tenant.privacy_notice_link_text"), privacy_notice_path, target: :_blank}").html_safe %>
+
diff --git a/app/views/form/guidance/_privacy_notice_tenant_2024.erb b/app/views/form/guidance/_privacy_notice_tenant_2024.erb
deleted file mode 100644
index 12de7baba..000000000
--- a/app/views/form/guidance/_privacy_notice_tenant_2024.erb
+++ /dev/null
@@ -1 +0,0 @@
-Make sure the lead tenant has seen or been given access to <%= govuk_link_to "the Ministry of Housing, Communities and Local Government (MHCLG) privacy notice", privacy_notice_path, target: :_blank %> before completing this log. This is a legal requirement under data protection legislation.
diff --git a/app/views/form/guidance/_rent_type_definitions.erb b/app/views/form/guidance/_rent_type_definitions.erb
index 1e008ee60..1c3b038e8 100644
--- a/app/views/form/guidance/_rent_type_definitions.erb
+++ b/app/views/form/guidance/_rent_type_definitions.erb
@@ -1,21 +1,5 @@
-<%= govuk_details(summary_text: "Rent type definitions") do %>
-
- Affordable Rent: where up to 80% of market rent can be charged. A new supply agreement is signed with Homes England or the Greater London Authority (GLA).
-
-
- London Affordable Rent: a tenure of affordable housing available in London by the GLA. It is an affordable rent which must be set in accordance with the Regulator of Social Housing’s Affordable Rent guidance. The landlord of these homes must be registered with the Regulator of Social Housing. These are a type of Affordable Rent lettings.
-
-
- London Living Rent: a tenure of affordable housing available in London by the GLA. It was introduced in Affordable Homes Programme 2016 to 2021. These are a type of Intermediate Rent lettings.
-
-
- Rent to Buy: a discount of up to 20% market rent is charged for a single rental period for a minimum of 5 years. After that period, the tenant is offered first chance to purchase the property (either shared ownership or outright) at full market value. These are a type of Intermediate Rent lettings.
-
-
- Social Rent: where target rents are determined through the national rent regime. This is sometimes also known as 'formula rent'.
-
-
-
- Other intermediate rent: any other specific scheme where up to 80% of market rent can be charged. This includes schemes with reduced rent so tenants can save towards a house purchasing deposit and schemes with an in-built future opportunity to buy the property being rented.
-
-<% end %>
+
+ <%= govuk_details(summary_text: I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.rent_type_definitions.title")) do %>
+ <%= I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.rent_type_definitions.content").html_safe %>
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/form/guidance/_rent_type_definitions_2024.erb b/app/views/form/guidance/_rent_type_definitions_2024.erb
deleted file mode 100644
index ee835b4a0..000000000
--- a/app/views/form/guidance/_rent_type_definitions_2024.erb
+++ /dev/null
@@ -1,21 +0,0 @@
-<%= govuk_details(summary_text: "Rent type definitions") do %>
-
- Social Rent: where target rents are determined through the national rent regime. This is sometimes also known as 'formula rent'.
-
-
- Affordable Rent: where up to 80% of market rent can be charged. A new supply agreement is signed with Homes England or the Greater London Authority (GLA).
-
-
- London Affordable Rent: a tenure of affordable housing available in London by the GLA. It is an affordable rent which must be set in accordance with the Regulator of Social Housing’s Affordable Rent guidance. The landlord of these homes must be registered with the Regulator of Social Housing. These are a type of Affordable Rent lettings.
-
-
- Rent to Buy: a discount of up to 20% market rent is charged for a single rental period for a minimum of 5 years. After that period, the tenant is offered first chance to purchase the property (either shared ownership or outright) at full market value. These are a type of Intermediate Rent lettings.
-
-
- London Living Rent: a tenure of affordable housing available in London by the GLA. It was introduced in Affordable Homes Programme 2016 to 2021. These are a type of Intermediate Rent lettings.
-
-
-
- Other intermediate rent: any other specific scheme where up to 80% of market rent can be charged. This includes schemes with reduced rent so tenants can save towards a house purchasing deposit and schemes with an in-built future opportunity to buy the property being rented.
-
-<% end %>
diff --git a/app/views/form/guidance/_scheme_selection.html.erb b/app/views/form/guidance/_scheme_selection.html.erb
index c13edb05b..3aaff4a4a 100644
--- a/app/views/form/guidance/_scheme_selection.html.erb
+++ b/app/views/form/guidance/_scheme_selection.html.erb
@@ -1,5 +1,5 @@
<% if current_user.data_provider? %>
- If you’re not sure which scheme to choose, ask a data coordinator. Find your data coordinators on the <%= govuk_link_to("users page", users_path) %>.
+ <%= I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.scheme_selection.data_provider.content", users_page_link: govuk_link_to(I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.scheme_selection.data_provider.users_page_link_text"), users_path).to_s).html_safe %>
<% elsif current_user.data_coordinator? %>
- <%= govuk_link_to "Create a new supported housing scheme", new_scheme_path %>
+ <%= govuk_link_to I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.scheme_selection.data_coordinator.create_scheme_link_text"), new_scheme_path %>
<% end %>
diff --git a/app/views/form/guidance/_shared_ownership_type_definitions.erb b/app/views/form/guidance/_shared_ownership_type_definitions.erb
index 95cd65533..06c5f864e 100644
--- a/app/views/form/guidance/_shared_ownership_type_definitions.erb
+++ b/app/views/form/guidance/_shared_ownership_type_definitions.erb
@@ -1,26 +1,5 @@
-<%= govuk_details(summary_text: "Shared ownership type definitions") do %>
-
- Shared ownership: Cannot be used for homes funded through the Affordable Homes Programme 2021 to 2026. Use the 2021 model lease for these properties.
-
-
- Shared ownership 2021 model lease: Homes bought using the Affordable Homes Programme 2021 to 2026.
-
-
- Older Persons Shared Ownership: A type of shared ownership for those 55 years and over.
-
-
- Social HomeBuy shared ownership purchase: Tenants of private registered providers purchase their home at discount on Shared Ownership terms.
-
-
- Home Ownership for people with Long-Term Disabilities (HOLD): A shared ownership sale for those with long term disabilities.
-
-
- Rent to Buy shared ownership: A sale following a period of discounted rent.
-
-
- Right to Shared Ownership: A sale of a share of a rented home to a tenant using this scheme.
-
-
- London Living Rent shared ownership: A shared ownership sale following a period of discounted rent as part of the London Living Rent scheme.
-
-<% end %>
+
+ <%= govuk_details(summary_text: I18n.t("forms.#{@log.form.start_date.year}.sales.guidance.shared_ownership_type_definitions.title")) do %>
+ <%= I18n.t("forms.#{@log.form.start_date.year}.sales.guidance.shared_ownership_type_definitions.content").html_safe %>
+ <% end %>
+
diff --git a/app/views/form/guidance/_shared_ownership_type_definitions_2024.erb b/app/views/form/guidance/_shared_ownership_type_definitions_2024.erb
deleted file mode 100644
index bce41c43b..000000000
--- a/app/views/form/guidance/_shared_ownership_type_definitions_2024.erb
+++ /dev/null
@@ -1,26 +0,0 @@
-<%= govuk_details(summary_text: "Shared ownership type definitions") do %>
-
- Shared Ownership (old model lease): Cannot be used for homes funded through the Affordable Homes Programme 2021 to 2026. Use the new model lease for these properties.
-
-
- Shared Ownership (new model lease): Homes bought using the Affordable Homes Programme 2021 to 2026.
-
-
- Social HomeBuy — shared ownership purchase: Tenants of private registered providers purchase their home at discount on Shared Ownership terms.
-
-
- Home Ownership for people with Long-Term Disabilities (HOLD): A shared ownership sale for those with long term disabilities.
-
-
- Older Persons Shared Ownership: A type of shared ownership for those 55 years and over.
-
-
- Rent to Buy — Shared Ownership: A sale following a period of discounted rent.
-
-
- Right to Shared Ownership (RtSO): A sale of a share of a rented home to a tenant using this scheme.
-
-
- London Living Rent — Shared Ownership: A shared ownership sale following a period of discounted rent as part of the London Living Rent scheme.
-
-<% end %>
diff --git a/app/views/form/guidance/_void_date.html.erb b/app/views/form/guidance/_void_date.html.erb
index 69ea9384f..76e9e22e2 100644
--- a/app/views/form/guidance/_void_date.html.erb
+++ b/app/views/form/guidance/_void_date.html.erb
@@ -1,9 +1,5 @@
-<%= govuk_details(summary_text: "What is a void date?") do %>
- Date the property was (legally or contractually) available to let, or for:
-
- - re-lets: the day after the previous tenant's contract ended
- - new builds: the day the landlord legally first owned the property (‘completion date’)
- - new conversions or acquisitions: completion date, or the day after rehabilitation work ended
- - new leases: the day the landlord got contractual property rights and could let it out to tenants
-
-<% end %>
+
+ <%= govuk_details(summary_text: I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.void_date.title")) do %>
+ <%= I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.void_date.content").html_safe %>
+ <% end %>
+
diff --git a/app/views/form/guidance/_what_counts_as_income.html.erb b/app/views/form/guidance/_what_counts_as_income.html.erb
index 55362d941..2ebeda481 100644
--- a/app/views/form/guidance/_what_counts_as_income.html.erb
+++ b/app/views/form/guidance/_what_counts_as_income.html.erb
@@ -1,16 +1,5 @@
-<%= govuk_details(summary_text: "What counts as income?") do %>
- You should include any income after tax from:
-
- - employment
- - pensions
- - Universal Credit
-
-
- Don’t include:
-
- - National Insurance (NI) contributions and tax
- - housing benefit
- - child benefit
- - council tax support
-
-<% end %>
+
+ <%= govuk_details(summary_text: I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.what_counts_as_income.title")) do %>
+ <%= I18n.t("forms.#{@log.form.start_date.year}.lettings.guidance.what_counts_as_income.content").html_safe %>
+ <% end %>
+
diff --git a/config/locales/forms/2023/lettings/guidance.en.yml b/config/locales/forms/2023/lettings/guidance.en.yml
new file mode 100644
index 000000000..1ce7e8a0c
--- /dev/null
+++ b/config/locales/forms/2023/lettings/guidance.en.yml
@@ -0,0 +1,63 @@
+en:
+ forms:
+ 2023:
+ lettings:
+ guidance:
+ finding_location:
+ title: "What is a location?"
+ content: "A location is a postcode area where supported housing is provided under a scheme. A scheme can have multiple locations, and a location can have multiple units at the same postcode."
+ scheme_changes_link_text: "Read more about schemes and locations"
+
+ finding_scheme:
+ title: "Can’t find your scheme?"
+ content: "Schemes are attached to the organisation that owns the property. Check you have correctly answered question 1 \"Which organisation owns this property?\"
+ If your organisation’s schemes were migrated from old CORE, they may have new names and codes. Search by postcode to find your scheme.
"
+ scheme_changes_link_text: "Read more about how schemes have changed"
+ view_schemes_link_text: "View your organisation’s schemes"
+
+ privacy_notice_tenant:
+ content: "Make sure the tenant has seen %{privacy_notice_link} before completing this log."
+ privacy_notice_link_text: "the Ministry of Housing, Communities and Local Government (MHCLG) privacy notice"
+
+ rent_type_definitions:
+ title: "Rent type definitions"
+ content: "Affordable Rent: where up to 80% of market rent can be charged. A new supply agreement is signed with Homes England or the Greater London Authority (GLA).
+ London Affordable Rent: a tenure of affordable housing available in London by the GLA. It is an affordable rent which must be set in accordance with the Regulator of Social Housing’s Affordable Rent guidance. The landlord of these homes must be registered with the Regulator of Social Housing. These are a type of Affordable Rent lettings.
+ London Living Rent: a tenure of affordable housing available in London by the GLA. It was introduced in Affordable Homes Programme 2016 to 2021. These are a type of Intermediate Rent lettings.
+ Rent to Buy: a discount of up to 20% market rent is charged for a single rental period for a minimum of 5 years. After that period, the tenant is offered first chance to purchase the property (either shared ownership or outright) at full market value. These are a type of Intermediate Rent lettings.
+ Social Rent: where target rents are determined through the national rent regime. This is sometimes also known as 'formula rent'.
+ Other intermediate rent: any other specific scheme where up to 80% of market rent can be charged. This includes schemes with reduced rent so tenants can save towards a house purchasing deposit and schemes with an in-built future opportunity to buy the property being rented.
"
+
+ scheme_selection:
+ data_provider:
+ content: "If you’re not sure which scheme to choose, ask a data coordinator. Find your data coordinators on the %{users_page_link}."
+ users_page_link_text: "users page"
+ data_coordinator:
+ create_scheme_link_text: "Create a new supported housing scheme"
+
+ void_date:
+ title: "What is a void date?"
+ content: "Date the property was (legally or contractually) available to let, or for:
+
+ - re-lets: the day after the previous tenant's contract ended
+ - new builds: the day the landlord legally first owned the property (‘completion date’)
+ - new conversions or acquisitions: completion date, or the day after rehabilitation work ended
+ - new leases: the day the landlord got contractual property rights and could let it out to tenants
+
"
+
+ what_counts_as_income:
+ title: "What counts as income?"
+ content: "You should include any income after tax from:
+
+ - employment
+ - pensions
+ - Universal Credit
+
+
+ Don’t include:
+
+ - National Insurance (NI) contributions and tax
+ - housing benefit
+ - child benefit
+ - council tax support
+
"
\ No newline at end of file
diff --git a/config/locales/forms/2023/sales/guidance.en.yml b/config/locales/forms/2023/sales/guidance.en.yml
new file mode 100644
index 000000000..22e953521
--- /dev/null
+++ b/config/locales/forms/2023/sales/guidance.en.yml
@@ -0,0 +1,47 @@
+en:
+ forms:
+ 2023:
+ sales:
+ guidance:
+ shared_ownership_type_definitions:
+ title: "Shared Ownership Type Definitions"
+ content: "Shared ownership: Cannot be used for homes funded through the Affordable Homes Programme 2021 to 2026. Use the 2021 model lease for these properties.
+ Shared ownership 2021 model lease: Homes bought using the Affordable Homes Programme 2021 to 2026.
+ Older Persons Shared Ownership: A type of shared ownership for those 55 years and over.
+ Social HomeBuy shared ownership purchase: Tenants of private registered providers purchase their home at discount on Shared Ownership terms.
+ >Home Ownership for people with Long-Term Disabilities (HOLD): A shared ownership sale for those with long term disabilities.
+ Rent to Buy shared ownership: A sale following a period of discounted rent.
+ Right to Shared Ownership: A sale of a share of a rented home to a tenant using this scheme.
+ London Living Rent shared ownership: A shared ownership sale following a period of discounted rent as part of the London Living Rent scheme.
"
+
+ discounted_ownership_type_definitions:
+ title: "Discounted Ownership Type Definitions"
+ content: "Right to Acquire (RTA): a discounted sale of a property built or purchased after 31 March 1997 to tenants of a private registered provider.
+ Preserved Right to Buy (PRTB): a discounted sale of a property that used to be owned by a council to tenants of a private registered provider.
+ Voluntary Right to Buy (VRTB): a discounted sale to tenants in this PRP owned property, as part of a pilot scheme.
+ Right to Buy (RTB): a discounted sale to tenants in this council owned property.
+ Rent to Buy full ownership: a sale on full ownership terms following a period of discounted rent.
+ Social HomeBuy for outright purchase: a discounted sale to tenants of a private registered provider on full ownership terms.
+ Any other equity loan scheme: any scheme, not covered elsewhere, in which a loan is used to purchase equity.
"
+
+ mortgage_lender:
+ title: "Can’t find the mortgage lender you’re looking for?"
+ content: "
+ - Double check the spelling and try again
+ - Type the first few letters to see the suggestions
+ - Type Other and continue - we’ll ask you to type in your answer in the next question
+
"
+
+ outright_sale_type_definitions:
+ title: "Outright sale type definitions"
+ content: "Outright sale: the full purchase of a property, usually with a mortgage or cash.
+ Other sale: any sale which does not fit the criteria of any of the remaining options.
"
+
+ privacy_notice_buyer_joint_purchase:
+ content: "Make sure the buyers have seen %{privacy_notice_link} before completing this log."
+ privacy_notice_link_text: "the Ministry of Housing, Communities and Local Government (MHCLG) privacy notice"
+
+ privacy_notice_buyer:
+ content: "Make sure the buyer has seen %{privacy_notice_link} before completing this log."
+ privacy_notice_link_text: "the Ministry of Housing, Communities and Local Government (MHCLG) privacy notice"
+
\ No newline at end of file
diff --git a/config/locales/forms/2024/lettings/guidance.en.yml b/config/locales/forms/2024/lettings/guidance.en.yml
new file mode 100644
index 000000000..922124a94
--- /dev/null
+++ b/config/locales/forms/2024/lettings/guidance.en.yml
@@ -0,0 +1,63 @@
+en:
+ forms:
+ 2024:
+ lettings:
+ guidance:
+ finding_location:
+ title: "What is a location?"
+ content: "A location is a postcode area where supported housing is provided under a scheme. A scheme can have multiple locations, and a location can have multiple units at the same postcode."
+ scheme_changes_link_text: "Read more about schemes and locations"
+
+ finding_scheme:
+ title: "Can’t find your scheme?"
+ content: "Schemes are attached to the organisation that owns the property. Check you have correctly answered question 1 \"Which organisation owns this property?\"
+ If your organisation’s schemes were migrated from old CORE, they may have new names and codes. Search by postcode to find your scheme.
"
+ scheme_changes_link_text: "Read more about how schemes have changed"
+ view_schemes_link_text: "View your organisation’s schemes"
+
+ privacy_notice_tenant:
+ content: "Make sure the lead tenant has seen or been given access to %{privacy_notice_link} before completing this log. This is a legal requirement under data protection legislation."
+ privacy_notice_link_text: "the Ministry of Housing, Communities and Local Government (MHCLG) privacy notice"
+
+ rent_type_definitions:
+ title: "Rent type definitions"
+ content: "Social Rent: where target rents are determined through the national rent regime. This is sometimes also known as 'formula rent'.
+ Affordable Rent: where up to 80% of market rent can be charged. A new supply agreement is signed with Homes England or the Greater London Authority (GLA).
+ London Affordable Rent: a tenure of affordable housing available in London by the GLA. It is an affordable rent which must be set in accordance with the Regulator of Social Housing’s Affordable Rent guidance. The landlord of these homes must be registered with the Regulator of Social Housing. These are a type of Affordable Rent lettings.
+ Rent to Buy: a discount of up to 20% market rent is charged for a single rental period for a minimum of 5 years. After that period, the tenant is offered first chance to purchase the property (either shared ownership or outright) at full market value. These are a type of Intermediate Rent lettings.
+ London Living Rent: a tenure of affordable housing available in London by the GLA. It was introduced in Affordable Homes Programme 2016 to 2021. These are a type of Intermediate Rent lettings.
+ Other intermediate rent: any other specific scheme where up to 80% of market rent can be charged. This includes schemes with reduced rent so tenants can save towards a house purchasing deposit and schemes with an in-built future opportunity to buy the property being rented.
"
+
+ scheme_selection:
+ data_provider:
+ content: "If you’re not sure which scheme to choose, ask a data coordinator. Find your data coordinators on the %{users_page_link}."
+ users_page_link_text: "users page"
+ data_coordinator:
+ create_scheme_link_text: "Create a new supported housing scheme"
+
+ void_date:
+ title: "What is a void date?"
+ content: "Date the property was (legally or contractually) available to let, or for:
+
+ - re-lets: the day after the previous tenant's contract ended
+ - new builds: the day the landlord legally first owned the property (‘completion date’)
+ - new conversions or acquisitions: completion date, or the day after rehabilitation work ended
+ - new leases: the day the landlord got contractual property rights and could let it out to tenants
+
"
+
+ what_counts_as_income:
+ title: "What counts as income?"
+ content: "You should include any income after tax from:
+
+ - employment
+ - pensions
+ - Universal Credit
+
+
+ Don’t include:
+
+ - National Insurance (NI) contributions and tax
+ - housing benefit
+ - child benefit
+ - council tax support
+
"
\ No newline at end of file
diff --git a/config/locales/forms/2024/sales/guidance.en.yml b/config/locales/forms/2024/sales/guidance.en.yml
new file mode 100644
index 000000000..801c43a5c
--- /dev/null
+++ b/config/locales/forms/2024/sales/guidance.en.yml
@@ -0,0 +1,46 @@
+en:
+ forms:
+ 2024:
+ sales:
+ guidance:
+ shared_ownership_type_definitions:
+ title: "Shared Ownership Type Definitions"
+ content: "Shared Ownership (old model lease): Cannot be used for homes funded through the Affordable Homes Programme 2021 to 2026. Use the new model lease for these properties.
+ Shared Ownership (new model lease): Homes bought using the Affordable Homes Programme 2021 to 2026.
+ Social HomeBuy — shared ownership purchase: Tenants of private registered providers purchase their home at discount on Shared Ownership terms.
+ Home Ownership for people with Long-Term Disabilities (HOLD): A shared ownership sale for those with long term disabilities.
+ Older Persons Shared Ownership: A type of shared ownership for those 55 years and over.
+ Rent to Buy — Shared Ownership: A sale following a period of discounted rent.
+ Right to Shared Ownership (RtSO): A sale of a share of a rented home to a tenant using this scheme.
+ London Living Rent — Shared Ownership: A shared ownership sale following a period of discounted rent as part of the London Living Rent scheme.
"
+
+ discounted_ownership_type_definitions:
+ title: "Discounted Ownership Type Definitions"
+ content: "Right to Acquire (RTA): a discounted sale of a property built or purchased after 31 March 1997 to tenants of a private registered provider.
+ Preserved Right to Buy (PRTB): a discounted sale of a property that used to be owned by a council to tenants of a private registered provider.
+ Voluntary Right to Buy (VRTB): a discounted sale to tenants in this PRP owned property, as part of a pilot scheme.
+ Right to Buy (RTB): a discounted sale to tenants in this council owned property.
+ Rent to Buy full ownership: a sale on full ownership terms following a period of discounted rent.
+ Social HomeBuy for outright purchase: a discounted sale to tenants of a private registered provider on full ownership terms.
+ Any other equity loan scheme: any scheme, not covered elsewhere, in which a loan is used to purchase equity.
"
+
+ mortgage_lender:
+ title: "Can’t find the mortgage lender you’re looking for?"
+ content: "
+ - Double check the spelling and try again
+ - Type the first few letters to see the suggestions
+ - Type Other and continue - we’ll ask you to type in your answer in the next question
+
"
+
+ outright_sale_type_definitions:
+ title: "Outright sale type definitions"
+ content: "Outright sale: the full purchase of a property, usually with a mortgage or cash.
+ Other sale: any sale which does not fit the criteria of any of the remaining options.
"
+
+ privacy_notice_buyer_joint_purchase:
+ content: "Make sure the buyers have seen or been given access to %{privacy_notice_link} before completing this log. This is a legal requirement under data protection legislation."
+ privacy_notice_link_text: "the Ministry of Housing, Communities and Local Government (MHCLG) privacy notice"
+
+ privacy_notice_buyer:
+ content: "Make sure the buyer has seen or been given access to %{privacy_notice_link} before completing this log. This is a legal requirement under data protection legislation."
+ privacy_notice_link_text: "the Ministry of Housing, Communities and Local Government (MHCLG) privacy notice"
diff --git a/spec/models/form/lettings/questions/declaration_spec.rb b/spec/models/form/lettings/questions/declaration_spec.rb
index bf8743520..fe1ae882d 100644
--- a/spec/models/form/lettings/questions/declaration_spec.rb
+++ b/spec/models/form/lettings/questions/declaration_spec.rb
@@ -67,7 +67,7 @@ RSpec.describe Form::Lettings::Questions::Declaration, type: :model do
end
it "uses the expected top guidance partial" do
- expect(question.top_guidance_partial).to eq("privacy_notice_tenant_2024")
+ expect(question.top_guidance_partial).to eq("privacy_notice_tenant")
end
it "has check_answers_card_number nil" do
diff --git a/spec/models/form/lettings/questions/rent_type_spec.rb b/spec/models/form/lettings/questions/rent_type_spec.rb
index 15183ce6b..0716cdbf7 100644
--- a/spec/models/form/lettings/questions/rent_type_spec.rb
+++ b/spec/models/form/lettings/questions/rent_type_spec.rb
@@ -73,7 +73,7 @@ RSpec.describe Form::Lettings::Questions::RentType, type: :model do
end
it "has the correct guidance partial" do
- expect(question.top_guidance_partial).to eq("rent_type_definitions_2024")
+ expect(question.top_guidance_partial).to eq("rent_type_definitions")
end
end
end
diff --git a/spec/models/form/sales/questions/privacy_notice_spec.rb b/spec/models/form/sales/questions/privacy_notice_spec.rb
index 48de6056f..3f8c030b0 100644
--- a/spec/models/form/sales/questions/privacy_notice_spec.rb
+++ b/spec/models/form/sales/questions/privacy_notice_spec.rb
@@ -94,7 +94,7 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
end
it "uses the expected top guidance partial" do
- expect(question.top_guidance_partial).to eq("privacy_notice_buyer_2024")
+ expect(question.top_guidance_partial).to eq("privacy_notice_buyer")
end
it "returns correct unanswered_error_message" do
@@ -116,7 +116,7 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do
end
it "uses the expected top guidance partial" do
- expect(question.top_guidance_partial).to eq("privacy_notice_buyer_2024_joint_purchase")
+ expect(question.top_guidance_partial).to eq("privacy_notice_buyer_joint_purchase")
end
it "returns correct unanswered_error_message" do
diff --git a/spec/models/form/sales/questions/shared_ownership_type_spec.rb b/spec/models/form/sales/questions/shared_ownership_type_spec.rb
index 19cae6e89..91cf6da9e 100644
--- a/spec/models/form/sales/questions/shared_ownership_type_spec.rb
+++ b/spec/models/form/sales/questions/shared_ownership_type_spec.rb
@@ -63,7 +63,7 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do
end
it "shows shows correct top_guidance_partial" do
- expect(question.top_guidance_partial).to eq("shared_ownership_type_definitions_2024")
+ expect(question.top_guidance_partial).to eq("shared_ownership_type_definitions")
end
end
end
diff --git a/spec/requests/form_controller_spec.rb b/spec/requests/form_controller_spec.rb
index 94f6595c7..13d711c20 100644
--- a/spec/requests/form_controller_spec.rb
+++ b/spec/requests/form_controller_spec.rb
@@ -412,7 +412,7 @@ RSpec.describe FormController, type: :request do
context "with a form page that has custom guidance" do
it "displays the correct partial" do
get "/lettings-logs/#{lettings_log.id}/net-income", headers: headers, params: {}
- expect(response.body).to match("What counts as income?")
+ expect(response.body).to match(I18n.t("forms.2021.lettings.guidance.what_counts_as_income.title"))
end
end
diff --git a/spec/views/form/page_view_spec.rb b/spec/views/form/page_view_spec.rb
index 16c4c0672..a95c98e93 100644
--- a/spec/views/form/page_view_spec.rb
+++ b/spec/views/form/page_view_spec.rb
@@ -100,7 +100,7 @@ RSpec.describe "form/page" do
end
context "with a question containing extra guidance" do
- let(:expected_guidance) { /What counts as income?/ }
+ let(:expected_guidance) { /#{I18n.t("forms.2021.lettings.guidance.what_counts_as_income.content")}/ }
context "with radio type" do
let(:question_attributes) { { type: "radio", answer_options: { "1": "A", "2": "B" } } }
From 3cda5adf5c83608c9e9ead13447b2d05491760c1 Mon Sep 17 00:00:00 2001
From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com>
Date: Thu, 31 Oct 2024 16:47:40 +0000
Subject: [PATCH 08/12] CLDC-3683 Extract lettings household situation copy
(#2730)
* Extract lettings household situation copy
* Update wrong copy, remove duplicate keys
---
.../pages/previous_housing_situation.rb | 1 +
.../previous_housing_situation_renewal.rb | 1 +
.../pages/previous_local_authority.rb | 1 +
.../form/lettings/pages/previous_postcode.rb | 1 +
.../reason_for_leaving_last_settled_home.rb | 1 +
...n_for_leaving_last_settled_home_renewal.rb | 1 +
app/models/form/lettings/pages/referral.rb | 1 +
.../form/lettings/pages/referral_prp.rb | 1 +
.../pages/referral_supported_housing.rb | 1 +
.../pages/referral_supported_housing_prp.rb | 1 +
.../form/lettings/questions/homeless.rb | 3 -
app/models/form/lettings/questions/layear.rb | 3 -
.../lettings/questions/letting_allocation.rb | 3 -
.../form/lettings/questions/ppcodenk.rb | 4 +-
.../form/lettings/questions/ppostcode_full.rb | 4 +-
.../lettings/questions/previous_la_known.rb | 4 +-
.../lettings/questions/previous_tenure.rb | 4 +-
.../questions/previous_tenure_renewal.rb | 5 +-
app/models/form/lettings/questions/prevloc.rb | 4 +-
app/models/form/lettings/questions/reason.rb | 4 +-
.../form/lettings/questions/reason_renewal.rb | 4 +-
.../questions/reasonable_preference_reason.rb | 3 -
.../form/lettings/questions/reasonother.rb | 4 +-
.../form/lettings/questions/reasonpref.rb | 3 -
.../form/lettings/questions/referral.rb | 4 +-
.../form/lettings/questions/referral_prp.rb | 4 +-
.../questions/referral_supported_housing.rb | 4 +-
.../referral_supported_housing_prp.rb | 4 +-
.../form/lettings/questions/waityear.rb | 3 -
.../2023/lettings/household_situation.en.yml | 120 ++++++++++++++++++
.../2024/lettings/household_situation.en.yml | 120 ++++++++++++++++++
.../form/lettings/questions/homeless_spec.rb | 2 +-
.../lettings/questions/reason_renewal_spec.rb | 2 +-
.../form/lettings/questions/reason_spec.rb | 2 +-
34 files changed, 266 insertions(+), 61 deletions(-)
create mode 100644 config/locales/forms/2023/lettings/household_situation.en.yml
create mode 100644 config/locales/forms/2024/lettings/household_situation.en.yml
diff --git a/app/models/form/lettings/pages/previous_housing_situation.rb b/app/models/form/lettings/pages/previous_housing_situation.rb
index aafabe7f3..8fc907435 100644
--- a/app/models/form/lettings/pages/previous_housing_situation.rb
+++ b/app/models/form/lettings/pages/previous_housing_situation.rb
@@ -2,6 +2,7 @@ class Form::Lettings::Pages::PreviousHousingSituation < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "previous_housing_situation"
+ @copy_key = "lettings.household_situation.prevten.not_renewal"
@depends_on = [{ "is_renewal?" => false }]
end
diff --git a/app/models/form/lettings/pages/previous_housing_situation_renewal.rb b/app/models/form/lettings/pages/previous_housing_situation_renewal.rb
index 317350911..62d37bf33 100644
--- a/app/models/form/lettings/pages/previous_housing_situation_renewal.rb
+++ b/app/models/form/lettings/pages/previous_housing_situation_renewal.rb
@@ -2,6 +2,7 @@ class Form::Lettings::Pages::PreviousHousingSituationRenewal < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "previous_housing_situation_renewal"
+ @copy_key = "lettings.household_situation.prevten.renewal"
@depends_on = [{ "is_renewal?" => true, "is_supported_housing?" => true }]
end
diff --git a/app/models/form/lettings/pages/previous_local_authority.rb b/app/models/form/lettings/pages/previous_local_authority.rb
index 48233e64a..30a17448f 100644
--- a/app/models/form/lettings/pages/previous_local_authority.rb
+++ b/app/models/form/lettings/pages/previous_local_authority.rb
@@ -2,6 +2,7 @@ class Form::Lettings::Pages::PreviousLocalAuthority < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "previous_local_authority"
+ @copy_key = "lettings.household_situation.previous_local_authority"
@depends_on = [{ "is_previous_la_inferred" => false, "renewal" => 0 }]
end
diff --git a/app/models/form/lettings/pages/previous_postcode.rb b/app/models/form/lettings/pages/previous_postcode.rb
index 61d08f3a9..0bf0d108f 100644
--- a/app/models/form/lettings/pages/previous_postcode.rb
+++ b/app/models/form/lettings/pages/previous_postcode.rb
@@ -2,6 +2,7 @@ class Form::Lettings::Pages::PreviousPostcode < ::Form::Page
def initialize(id, hsh, page)
super
@depends_on = [{ "renewal" => 0 }]
+ @copy_key = "lettings.household_situation.previous_postcode"
end
def questions
diff --git a/app/models/form/lettings/pages/reason_for_leaving_last_settled_home.rb b/app/models/form/lettings/pages/reason_for_leaving_last_settled_home.rb
index f5e3a24d1..a32dab9a2 100644
--- a/app/models/form/lettings/pages/reason_for_leaving_last_settled_home.rb
+++ b/app/models/form/lettings/pages/reason_for_leaving_last_settled_home.rb
@@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReasonForLeavingLastSettledHome < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "reason_for_leaving_last_settled_home"
+ @copy_key = "lettings.household_situation.reason.reason_for_leaving_last_settled_home"
@depends_on = [{ "renewal" => 0 }]
end
diff --git a/app/models/form/lettings/pages/reason_for_leaving_last_settled_home_renewal.rb b/app/models/form/lettings/pages/reason_for_leaving_last_settled_home_renewal.rb
index acc8e7045..0a052b300 100644
--- a/app/models/form/lettings/pages/reason_for_leaving_last_settled_home_renewal.rb
+++ b/app/models/form/lettings/pages/reason_for_leaving_last_settled_home_renewal.rb
@@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReasonForLeavingLastSettledHomeRenewal < ::Form::Pa
def initialize(id, hsh, subsection)
super
@id = "reason_for_leaving_last_settled_home_renewal"
+ @copy_key = "lettings.household_situation.reason.reason_for_leaving_last_settled_home_renewal"
@depends_on = [{ "renewal" => 1 }]
end
diff --git a/app/models/form/lettings/pages/referral.rb b/app/models/form/lettings/pages/referral.rb
index 9bda8c77e..8b6fcadbb 100644
--- a/app/models/form/lettings/pages/referral.rb
+++ b/app/models/form/lettings/pages/referral.rb
@@ -2,6 +2,7 @@ class Form::Lettings::Pages::Referral < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "referral"
+ @copy_key = "lettings.household_situation.referral.general_needs.la"
@depends_on = [{ "owning_organisation_provider_type" => "LA", "needstype" => 1, "renewal" => 0 }]
end
diff --git a/app/models/form/lettings/pages/referral_prp.rb b/app/models/form/lettings/pages/referral_prp.rb
index d9c37b6d6..baeb01784 100644
--- a/app/models/form/lettings/pages/referral_prp.rb
+++ b/app/models/form/lettings/pages/referral_prp.rb
@@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReferralPrp < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "referral_prp"
+ @copy_key = "lettings.household_situation.referral.general_needs.prp"
@depends_on = [{ "owning_organisation_provider_type" => "PRP", "needstype" => 1, "renewal" => 0 }]
end
diff --git a/app/models/form/lettings/pages/referral_supported_housing.rb b/app/models/form/lettings/pages/referral_supported_housing.rb
index 8464ae366..a3e915e26 100644
--- a/app/models/form/lettings/pages/referral_supported_housing.rb
+++ b/app/models/form/lettings/pages/referral_supported_housing.rb
@@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReferralSupportedHousing < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "referral_supported_housing"
+ @copy_key = "lettings.household_situation.referral.supported_housing.la"
@depends_on = [{ "owning_organisation_provider_type" => "LA", "needstype" => 2, "renewal" => 0 }]
end
diff --git a/app/models/form/lettings/pages/referral_supported_housing_prp.rb b/app/models/form/lettings/pages/referral_supported_housing_prp.rb
index 289ae5eb6..66b6f370e 100644
--- a/app/models/form/lettings/pages/referral_supported_housing_prp.rb
+++ b/app/models/form/lettings/pages/referral_supported_housing_prp.rb
@@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReferralSupportedHousingPrp < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "referral_supported_housing_prp"
+ @copy_key = "lettings.household_situation.referral.supported_housing.prp"
@depends_on = [{ "owning_organisation_provider_type" => "PRP", "needstype" => 2, "renewal" => 0 }]
end
diff --git a/app/models/form/lettings/questions/homeless.rb b/app/models/form/lettings/questions/homeless.rb
index 081e1a8cf..1194fa929 100644
--- a/app/models/form/lettings/questions/homeless.rb
+++ b/app/models/form/lettings/questions/homeless.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::Homeless < ::Form::Question
def initialize(id, hsh, page)
super
@id = "homeless"
- @check_answer_label = "Household homeless immediately before letting"
- @header = "Did the household experience homelessness immediately before this letting?"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = ""
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/layear.rb b/app/models/form/lettings/questions/layear.rb
index 5c2e9c195..63f99c36f 100644
--- a/app/models/form/lettings/questions/layear.rb
+++ b/app/models/form/lettings/questions/layear.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::Layear < ::Form::Question
def initialize(id, hsh, page)
super
@id = "layear"
- @check_answer_label = "Length of time in local authority area"
- @header = "How long has the household continuously lived in the local authority area of the new letting?"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = ""
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/letting_allocation.rb b/app/models/form/lettings/questions/letting_allocation.rb
index c9742e97f..0ae7b740d 100644
--- a/app/models/form/lettings/questions/letting_allocation.rb
+++ b/app/models/form/lettings/questions/letting_allocation.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::LettingAllocation < ::Form::Question
def initialize(id, hsh, page)
super
@id = "letting_allocation"
- @check_answer_label = "Allocation system"
- @header = "How was this letting allocated?"
@type = "checkbox"
@check_answers_card_number = 0
- @hint_text = "Select all that apply."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/ppcodenk.rb b/app/models/form/lettings/questions/ppcodenk.rb
index 4af3b17f0..5eec607eb 100644
--- a/app/models/form/lettings/questions/ppcodenk.rb
+++ b/app/models/form/lettings/questions/ppcodenk.rb
@@ -2,11 +2,9 @@ class Form::Lettings::Questions::Ppcodenk < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ppcodenk"
- @check_answer_label = ""
- @header = "Do you know the postcode of the household’s last settled accommodation?"
+ @copy_key = "lettings.household_situation.previous_postcode.ppcodenk"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = form.start_year_after_2024? ? "This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless." : "This is also known as the household’s ‘last settled home’."
@answer_options = ANSWER_OPTIONS
@conditional_for = { "ppostcode_full" => [0] }
@hidden_in_check_answers = { "depends_on" => [{ "ppcodenk" => 0 }, { "ppcodenk" => 1 }] }
diff --git a/app/models/form/lettings/questions/ppostcode_full.rb b/app/models/form/lettings/questions/ppostcode_full.rb
index ed0439805..804576ca1 100644
--- a/app/models/form/lettings/questions/ppostcode_full.rb
+++ b/app/models/form/lettings/questions/ppostcode_full.rb
@@ -2,8 +2,7 @@ class Form::Lettings::Questions::PpostcodeFull < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ppostcode_full"
- @check_answer_label = "Postcode of household’s last settled accommodation"
- @header = "Postcode for the previous accommodation"
+ @copy_key = "lettings.household_situation.previous_postcode.ppostcode_full"
@type = "text"
@width = 5
@inferred_check_answers_value = [{
@@ -13,7 +12,6 @@ class Form::Lettings::Questions::PpostcodeFull < ::Form::Question
"value" => "Not known",
}]
@check_answers_card_number = 0
- @hint_text = ""
@inferred_answers = { "prevloc" => { "is_previous_la_inferred" => true } }
@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/lettings/questions/previous_la_known.rb b/app/models/form/lettings/questions/previous_la_known.rb
index d99c1e057..2145e9d1f 100644
--- a/app/models/form/lettings/questions/previous_la_known.rb
+++ b/app/models/form/lettings/questions/previous_la_known.rb
@@ -2,11 +2,9 @@ class Form::Lettings::Questions::PreviousLaKnown < ::Form::Question
def initialize(id, hsh, page)
super
@id = "previous_la_known"
- @check_answer_label = "Do you know the local authority of the household’s last settled accommodation?"
- @header = "Do you know the local authority of the household’s last settled accommodation?"
+ @copy_key = "lettings.household_situation.previous_local_authority.previous_la_known"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = form.start_year_after_2024? ? "This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless." : "This is also known as the household’s ‘last settled home’."
@answer_options = ANSWER_OPTIONS
@conditional_for = { "prevloc" => [1] }
@hidden_in_check_answers = { "depends_on" => [{ "previous_la_known" => 0 }, { "previous_la_known" => 1 }] }
diff --git a/app/models/form/lettings/questions/previous_tenure.rb b/app/models/form/lettings/questions/previous_tenure.rb
index a9ed5202a..360f1960a 100644
--- a/app/models/form/lettings/questions/previous_tenure.rb
+++ b/app/models/form/lettings/questions/previous_tenure.rb
@@ -2,11 +2,9 @@ class Form::Lettings::Questions::PreviousTenure < ::Form::Question
def initialize(id, hsh, page)
super
@id = "prevten"
- @check_answer_label = "Where was the household immediately before this letting?"
- @header = "Where was the household immediately before this letting?"
+ @copy_key = "lettings.household_situation.prevten.not_renewal"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = "This is where the household was the night before they moved into this new let."
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/previous_tenure_renewal.rb b/app/models/form/lettings/questions/previous_tenure_renewal.rb
index d4849d3c2..c882eb6fe 100644
--- a/app/models/form/lettings/questions/previous_tenure_renewal.rb
+++ b/app/models/form/lettings/questions/previous_tenure_renewal.rb
@@ -2,12 +2,9 @@ class Form::Lettings::Questions::PreviousTenureRenewal < ::Form::Question
def initialize(id, hsh, page)
super
@id = "prevten"
- @check_answer_label = "Where was the household immediately before this letting?"
- @header = "Where was the household immediately before this letting?"
+ @copy_key = "lettings.household_situation.prevten.renewal"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = "You told us this letting is a renewal. We have removed some options because of this.
- This is where the household was the night before they moved into this new let."
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/prevloc.rb b/app/models/form/lettings/questions/prevloc.rb
index 7f9c0db8b..4ad7dbf11 100644
--- a/app/models/form/lettings/questions/prevloc.rb
+++ b/app/models/form/lettings/questions/prevloc.rb
@@ -2,12 +2,10 @@ class Form::Lettings::Questions::Prevloc < ::Form::Question
def initialize(id, hsh, page)
super
@id = "prevloc"
- @check_answer_label = "Location of household’s last settled accommodation"
- @header = "Select a local authority"
+ @copy_key = "lettings.household_situation.previous_local_authority.prevloc"
@type = "select"
@inferred_check_answers_value = [{ "condition" => { "previous_la_known" => 0 }, "value" => "Not known" }]
@check_answers_card_number = 0
- @hint_text = "Select ‘Northern Ireland’, ‘Scotland’, ‘Wales’ or ‘Outside the UK’ if the household’s last settled home was outside England."
@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
end
diff --git a/app/models/form/lettings/questions/reason.rb b/app/models/form/lettings/questions/reason.rb
index 223d68634..4bc00ce43 100644
--- a/app/models/form/lettings/questions/reason.rb
+++ b/app/models/form/lettings/questions/reason.rb
@@ -2,11 +2,9 @@ class Form::Lettings::Questions::Reason < ::Form::Question
def initialize(id, hsh, page)
super
@id = "reason"
- @check_answer_label = "Reason for leaving last settled home"
- @header = "What is the tenant’s main reason for the household leaving their last settled home?"
+ @copy_key = "lettings.household_situation.reason.#{page.id}.reason"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = form.start_year_after_2024? ? "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living previously." : "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation or sleeping rough, their last settled home is where they were living previously."
@conditional_for = {
"reasonother" => [
20,
diff --git a/app/models/form/lettings/questions/reason_renewal.rb b/app/models/form/lettings/questions/reason_renewal.rb
index 7f32b0bba..9a9ee72de 100644
--- a/app/models/form/lettings/questions/reason_renewal.rb
+++ b/app/models/form/lettings/questions/reason_renewal.rb
@@ -2,11 +2,9 @@ class Form::Lettings::Questions::ReasonRenewal < ::Form::Question
def initialize(id, hsh, page)
super
@id = "reason"
- @check_answer_label = "Reason for leaving last settled home"
- @header = "What is the tenant’s main reason for the household leaving their last settled home?"
@type = "radio"
+ @copy_key = "lettings.household_situation.reason.#{page.id}.reason"
@check_answers_card_number = 0
- @hint_text = "You told us this letting is a renewal. We have removed some options because of this."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@conditional_for = {
"reasonother" => [
diff --git a/app/models/form/lettings/questions/reasonable_preference_reason.rb b/app/models/form/lettings/questions/reasonable_preference_reason.rb
index 235cf6342..75b450b91 100644
--- a/app/models/form/lettings/questions/reasonable_preference_reason.rb
+++ b/app/models/form/lettings/questions/reasonable_preference_reason.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::ReasonablePreferenceReason < ::Form::Question
def initialize(id, hsh, page)
super
@id = "reasonable_preference_reason"
- @check_answer_label = "Reason for reasonable preference"
- @header = "Why was the household given ‘reasonable preference’?"
@type = "checkbox"
@check_answers_card_number = 0
- @hint_text = "Select all that apply."
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/reasonother.rb b/app/models/form/lettings/questions/reasonother.rb
index 37bfd8c7b..7e600916b 100644
--- a/app/models/form/lettings/questions/reasonother.rb
+++ b/app/models/form/lettings/questions/reasonother.rb
@@ -2,11 +2,9 @@ class Form::Lettings::Questions::Reasonother < ::Form::Question
def initialize(id, hsh, page)
super
@id = "reasonother"
- @check_answer_label = ""
- @header = "What is the reason?"
+ @copy_key = "lettings.household_situation.reason.#{@page.id}.reasonother"
@type = "text"
@check_answers_card_number = 0
- @hint_text = ""
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/reasonpref.rb b/app/models/form/lettings/questions/reasonpref.rb
index 522576ec6..e63f65584 100644
--- a/app/models/form/lettings/questions/reasonpref.rb
+++ b/app/models/form/lettings/questions/reasonpref.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::Reasonpref < ::Form::Question
def initialize(id, hsh, page)
super
@id = "reasonpref"
- @check_answer_label = "Household given reasonable preference"
- @header = "Was the household given ‘reasonable preference’ by the local authority?"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = form.start_year_after_2024? ? "Households may be given ‘reasonable preference’ for social housing under one or more specific categories by the local authority. This is also known as ‘priority need’." : "Households may be given ‘reasonable preference’ for social housing, also known as ‘priority need’, by the local authority."
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/referral.rb b/app/models/form/lettings/questions/referral.rb
index feb0082f4..904668a4b 100644
--- a/app/models/form/lettings/questions/referral.rb
+++ b/app/models/form/lettings/questions/referral.rb
@@ -2,11 +2,9 @@ class Form::Lettings::Questions::Referral < ::Form::Question
def initialize(id, hsh, page)
super
@id = "referral"
- @check_answer_label = "Source of referral for letting"
- @header = "What was the source of referral for this letting?"
+ @copy_key = "lettings.household_situation.referral.general_needs.la"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = "You told us that you are a local authority and that the needs type is general needs. We have removed some options because of this."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/referral_prp.rb b/app/models/form/lettings/questions/referral_prp.rb
index 6a8fa63de..76ad3fbf8 100644
--- a/app/models/form/lettings/questions/referral_prp.rb
+++ b/app/models/form/lettings/questions/referral_prp.rb
@@ -2,11 +2,9 @@ class Form::Lettings::Questions::ReferralPrp < ::Form::Question
def initialize(id, hsh, page)
super
@id = "referral"
- @check_answer_label = "Source of referral for letting"
- @header = "What was the source of referral for this letting?"
+ @copy_key = "lettings.household_situation.referral.general_needs.prp"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = "You told us that the needs type is general needs. We have removed some options because of this."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/referral_supported_housing.rb b/app/models/form/lettings/questions/referral_supported_housing.rb
index d9ede5a83..50822705e 100644
--- a/app/models/form/lettings/questions/referral_supported_housing.rb
+++ b/app/models/form/lettings/questions/referral_supported_housing.rb
@@ -2,11 +2,9 @@ class Form::Lettings::Questions::ReferralSupportedHousing < ::Form::Question
def initialize(id, hsh, page)
super
@id = "referral"
- @check_answer_label = "Source of referral for letting"
- @header = "What was the source of referral for this letting?"
+ @copy_key = "lettings.household_situation.referral.supported_housing.la"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = "You told us that you are a local authority. We have removed some options because of this."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/referral_supported_housing_prp.rb b/app/models/form/lettings/questions/referral_supported_housing_prp.rb
index ffdd7eafb..cab8fbbc9 100644
--- a/app/models/form/lettings/questions/referral_supported_housing_prp.rb
+++ b/app/models/form/lettings/questions/referral_supported_housing_prp.rb
@@ -2,11 +2,9 @@ class Form::Lettings::Questions::ReferralSupportedHousingPrp < ::Form::Question
def initialize(id, hsh, page)
super
@id = "referral"
- @check_answer_label = "Source of referral for letting"
- @header = "What was the source of referral for this letting?"
+ @copy_key = "lettings.household_situation.referral.supported_housing.prp"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = ""
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/waityear.rb b/app/models/form/lettings/questions/waityear.rb
index 94187e62b..045765951 100644
--- a/app/models/form/lettings/questions/waityear.rb
+++ b/app/models/form/lettings/questions/waityear.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::Waityear < ::Form::Question
def initialize(id, hsh, page)
super
@id = "waityear"
- @check_answer_label = "Length of time on local authority waiting list"
- @header = form.start_year_after_2024? ? "How long has the household been on the local authority waiting list for the area of the new letting?" : "How long has the household been on the local authority waiting list for the new letting?"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = ""
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/config/locales/forms/2023/lettings/household_situation.en.yml b/config/locales/forms/2023/lettings/household_situation.en.yml
new file mode 100644
index 000000000..9e5e50918
--- /dev/null
+++ b/config/locales/forms/2023/lettings/household_situation.en.yml
@@ -0,0 +1,120 @@
+en:
+ forms:
+ 2023:
+ lettings:
+ household_situation:
+ layear:
+ page_header: ""
+ check_answer_label: "Length of time in local authority area"
+ hint_text: ""
+ question_text: "How long has the household continuously lived in the local authority area of the new letting?"
+
+ waityear:
+ page_header: ""
+ check_answer_label: "Length of time on local authority waiting list"
+ hint_text: ""
+ question_text: "How long has the household been on the local authority waiting list for the new letting?"
+
+ reason:
+ reason_for_leaving_last_settled_home_renewal:
+ page_header: ""
+ reason:
+ check_answer_label: "Reason for leaving last settled home"
+ hint_text: "You told us this letting is a renewal. We have removed some options because of this."
+ question_text: "What is the tenant’s main reason for the household leaving their last settled home?"
+ reasonother:
+ check_answer_label: "Length of time on local authority waiting list"
+ hint_text: ""
+ question_text: "How long has the household been on the local authority waiting list for the new letting?"
+ reason_for_leaving_last_settled_home:
+ page_header: ""
+ reason:
+ check_answer_label: "Reason for leaving last settled home"
+ hint_text: "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation or sleeping rough, their last settled home is where they were living previously."
+ question_text: "What is the tenant’s main reason for the household leaving their last settled home?"
+ reasonother:
+ check_answer_label: ""
+ hint_text: ""
+ question_text: "What is the reason?"
+
+ prevten:
+ renewal:
+ page_header: ""
+ check_answer_label: "Where was the household immediately before this letting?"
+ hint_text: "You told us this letting is a renewal. We have removed some options because of this.
This is where the household was the night before they moved into this new let."
+ question_text: "Where was the household immediately before this letting?"
+ not_renewal:
+ page_header: ""
+ check_answer_label: "Where was the household immediately before this letting?"
+ hint_text: "This is where the household was the night before they moved into this new let."
+ question_text: "Where was the household immediately before this letting?"
+
+ homeless:
+ page_header: ""
+ check_answer_label: "Household homeless immediately before letting"
+ hint_text: ""
+ question_text: "Did the household experience homelessness immediately before this letting?"
+
+ previous_postcode:
+ page_header: ""
+ ppcodenk:
+ check_answer_label: ""
+ hint_text: "This is also known as the household’s ‘last settled home’."
+ question_text: "Do you know the postcode of the household’s last settled accommodation?"
+ ppostcode_full:
+ check_answer_label: "Postcode of household’s last settled accommodation"
+ hint_text: ""
+ question_text: "Postcode for the previous accommodation"
+
+ previous_local_authority:
+ page_header: ""
+ previous_la_known:
+ check_answer_label: ""
+ hint_text: "This is also known as the household’s ‘last settled home’."
+ question_text: "Do you know the local authority of the household’s last settled accommodation?"
+ prevloc:
+ check_answer_label: "Location of household’s last settled accommodation"
+ hint_text: "Select ‘Northern Ireland’, ‘Scotland’, ‘Wales’ or ‘Outside the UK’ if the household’s last settled home was outside England."
+ question_text: "Select a local authority"
+
+ reasonpref:
+ page_header: ""
+ check_answer_label: "Household given reasonable preference"
+ hint_text: "Households may be given ‘reasonable preference’ for social housing, also known as ‘priority need’, by the local authority."
+ question_text: "Was the household given ‘reasonable preference’ by the local authority?"
+
+ reasonable_preference_reason:
+ page_header: ""
+ check_answer_label: "Reason for reasonable preference"
+ hint_text: "Select all that apply."
+ question_text: "Why was the household given ‘reasonable preference’?"
+
+ letting_allocation:
+ page_header: ""
+ check_answer_label: "Allocation system"
+ hint_text: "Select all that apply."
+ question_text: "How was this letting allocated?"
+
+ referral:
+ supported_housing:
+ prp:
+ page_header: ""
+ check_answer_label: "Source of referral for letting"
+ hint_text: ""
+ question_text: "What was the source of referral for this letting?"
+ la:
+ page_header: ""
+ check_answer_label: "Source of referral for letting"
+ hint_text: "You told us that you are a local authority. We have removed some options because of this."
+ question_text: "What was the source of referral for this letting?"
+ general_needs:
+ prp:
+ page_header: ""
+ check_answer_label: "Source of referral for letting"
+ hint_text: "You told us that the needs type is general needs. We have removed some options because of this."
+ question_text: "What was the source of referral for this letting?"
+ la:
+ page_header: ""
+ check_answer_label: "Source of referral for letting"
+ hint_text: "You told us that you are a local authority and that the needs type is general needs. We have removed some options because of this."
+ question_text: "What was the source of referral for this letting?"
\ No newline at end of file
diff --git a/config/locales/forms/2024/lettings/household_situation.en.yml b/config/locales/forms/2024/lettings/household_situation.en.yml
new file mode 100644
index 000000000..e1bf4c0ce
--- /dev/null
+++ b/config/locales/forms/2024/lettings/household_situation.en.yml
@@ -0,0 +1,120 @@
+en:
+ forms:
+ 2024:
+ lettings:
+ household_situation:
+ layear:
+ page_header: ""
+ check_answer_label: "Length of time in local authority area"
+ hint_text: ""
+ question_text: "How long has the household continuously lived in the local authority area of the new letting?"
+
+ waityear:
+ page_header: ""
+ check_answer_label: "Length of time on local authority waiting list"
+ hint_text: ""
+ question_text: "How long has the household been on the local authority waiting list for the area of the new letting?"
+
+ reason:
+ reason_for_leaving_last_settled_home_renewal:
+ page_header: ""
+ reason:
+ check_answer_label: "Reason for leaving last settled home"
+ hint_text: "You told us this letting is a renewal. We have removed some options because of this."
+ question_text: "What is the tenant’s main reason for the household leaving their last settled home?"
+ reasonother:
+ check_answer_label: "Length of time on local authority waiting list"
+ hint_text: ""
+ question_text: "How long has the household been on the local authority waiting list for the area of the new letting?"
+ reason_for_leaving_last_settled_home:
+ page_header: ""
+ reason:
+ check_answer_label: "Reason for leaving last settled home"
+ hint_text: "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living previously."
+ question_text: "What is the tenant’s main reason for the household leaving their last settled home?"
+ reasonother:
+ check_answer_label: ""
+ hint_text: ""
+ question_text: "What is the reason?"
+
+ prevten:
+ renewal:
+ page_header: ""
+ check_answer_label: "Where was the household immediately before this letting?"
+ hint_text: "You told us this letting is a renewal. We have removed some options because of this.
This is where the household was the night before they moved into this new let."
+ question_text: "Where was the household immediately before this letting?"
+ not_renewal:
+ page_header: ""
+ check_answer_label: "Where was the household immediately before this letting?"
+ hint_text: "This is where the household was the night before they moved into this new let."
+ question_text: "Where was the household immediately before this letting?"
+
+ homeless:
+ page_header: ""
+ check_answer_label: "Household homeless immediately before letting"
+ hint_text: ""
+ question_text: "Did the household experience homelessness immediately before this letting?"
+
+ previous_postcode:
+ page_header: ""
+ ppcodenk:
+ check_answer_label: ""
+ hint_text: "This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless."
+ question_text: "Do you know the postcode of the household’s last settled accommodation?"
+ ppostcode_full:
+ check_answer_label: "Postcode of household’s last settled accommodation"
+ hint_text: ""
+ question_text: "Postcode for the previous accommodation"
+
+ previous_local_authority:
+ page_header: ""
+ previous_la_known:
+ check_answer_label: ""
+ hint_text: "This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless."
+ question_text: "Do you know the local authority of the household’s last settled accommodation?"
+ prevloc:
+ check_answer_label: "Location of household’s last settled accommodation"
+ hint_text: "Select ‘Northern Ireland’, ‘Scotland’, ‘Wales’ or ‘Outside the UK’ if the household’s last settled home was outside England."
+ question_text: "Select a local authority"
+
+ reasonpref:
+ page_header: ""
+ check_answer_label: "Household given reasonable preference"
+ hint_text: "Households may be given ‘reasonable preference’ for social housing under one or more specific categories by the local authority. This is also known as ‘priority need’."
+ question_text: "Was the household given ‘reasonable preference’ by the local authority?"
+
+ reasonable_preference_reason:
+ page_header: ""
+ check_answer_label: "Reason for reasonable preference"
+ hint_text: "Select all that apply."
+ question_text: "Why was the household given ‘reasonable preference’?"
+
+ letting_allocation:
+ page_header: ""
+ check_answer_label: "Allocation system"
+ hint_text: "Select all that apply."
+ question_text: "How was this letting allocated?"
+
+ referral:
+ supported_housing:
+ prp:
+ page_header: ""
+ check_answer_label: "Source of referral for letting"
+ hint_text: ""
+ question_text: "What was the source of referral for this letting?"
+ la:
+ page_header: ""
+ check_answer_label: "Source of referral for letting"
+ hint_text: "You told us that you are a local authority. We have removed some options because of this."
+ question_text: "What was the source of referral for this letting?"
+ general_needs:
+ prp:
+ page_header: ""
+ check_answer_label: "Source of referral for letting"
+ hint_text: "You told us that the needs type is general needs. We have removed some options because of this."
+ question_text: "What was the source of referral for this letting?"
+ la:
+ page_header: ""
+ check_answer_label: "Source of referral for letting"
+ hint_text: "You told us that you are a local authority and that the needs type is general needs. We have removed some options because of this."
+ question_text: "What was the source of referral for this letting?"
\ No newline at end of file
diff --git a/spec/models/form/lettings/questions/homeless_spec.rb b/spec/models/form/lettings/questions/homeless_spec.rb
index 40beb9698..f18a8ece7 100644
--- a/spec/models/form/lettings/questions/homeless_spec.rb
+++ b/spec/models/form/lettings/questions/homeless_spec.rb
@@ -3,7 +3,7 @@ require "rails_helper"
RSpec.describe Form::Lettings::Questions::Homeless, type: :model do
subject(:question) { described_class.new(nil, nil, page) }
- let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4)))) }
+ let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), type: "lettings"), id: "household_situation")) }
it "has correct page" do
expect(question.page).to eq(page)
diff --git a/spec/models/form/lettings/questions/reason_renewal_spec.rb b/spec/models/form/lettings/questions/reason_renewal_spec.rb
index 02abe1527..3cdff75e7 100644
--- a/spec/models/form/lettings/questions/reason_renewal_spec.rb
+++ b/spec/models/form/lettings/questions/reason_renewal_spec.rb
@@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Questions::ReasonRenewal, type: :model do
let(:question_id) { nil }
let(:question_definition) { nil }
- let(:page) { instance_double(Form::Page) }
+ let(:page) { instance_double(Form::Page, id: "reason_renewal") }
let(:subsection) { instance_double(Form::Subsection) }
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
diff --git a/spec/models/form/lettings/questions/reason_spec.rb b/spec/models/form/lettings/questions/reason_spec.rb
index 81fd7a5c1..0b82eca42 100644
--- a/spec/models/form/lettings/questions/reason_spec.rb
+++ b/spec/models/form/lettings/questions/reason_spec.rb
@@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Questions::Reason, type: :model do
let(:question_id) { nil }
let(:question_definition) { nil }
- let(:page) { instance_double(Form::Page) }
+ let(:page) { instance_double(Form::Page, id: "reason") }
let(:subsection) { instance_double(Form::Subsection) }
let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) }
From 85859407698db9c29211a176e33d5d89283b629c Mon Sep 17 00:00:00 2001
From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com>
Date: Thu, 31 Oct 2024 17:07:50 +0000
Subject: [PATCH 09/12] CLDC-3365 Validate BU file size (#2725)
* Validate BU file size
* Rebase update
* Update error messages
---
.../bulk_upload_lettings/upload_your_file.rb | 11 ++++++++++
.../bulk_upload_sales/upload_your_file.rb | 11 ++++++++++
config/locales/en.yml | 2 ++
.../bulk_upload_lettings_logs_spec.rb | 19 ++++++++++++++++++
spec/features/bulk_upload_sales_logs_spec.rb | 20 +++++++++++++++++++
5 files changed, 63 insertions(+)
diff --git a/app/models/forms/bulk_upload_lettings/upload_your_file.rb b/app/models/forms/bulk_upload_lettings/upload_your_file.rb
index 82b5c75d5..552710885 100644
--- a/app/models/forms/bulk_upload_lettings/upload_your_file.rb
+++ b/app/models/forms/bulk_upload_lettings/upload_your_file.rb
@@ -15,6 +15,7 @@ module Forms
validates :file, presence: true
validate :validate_file_is_csv
+ validate :validate_file_size
def view_path
"bulk_upload_lettings_logs/forms/upload_your_file"
@@ -73,6 +74,16 @@ module Forms
errors.add(:file, :not_csv)
end
end
+
+ MAX_FILE_SIZE = 10.megabytes
+
+ def validate_file_size
+ return unless file
+
+ if file.size > MAX_FILE_SIZE
+ errors.add(:file, :file_too_large)
+ end
+ end
end
end
end
diff --git a/app/models/forms/bulk_upload_sales/upload_your_file.rb b/app/models/forms/bulk_upload_sales/upload_your_file.rb
index 83ce04e10..447574d1a 100644
--- a/app/models/forms/bulk_upload_sales/upload_your_file.rb
+++ b/app/models/forms/bulk_upload_sales/upload_your_file.rb
@@ -14,6 +14,7 @@ module Forms
validates :file, presence: true
validate :validate_file_is_csv
+ validate :validate_file_size
def view_path
"bulk_upload_sales_logs/forms/upload_your_file"
@@ -67,6 +68,16 @@ module Forms
errors.add(:file, :not_csv)
end
end
+
+ MAX_FILE_SIZE = 10.megabytes
+
+ def validate_file_size
+ return unless file
+
+ if file.size > MAX_FILE_SIZE
+ errors.add(:file, :file_too_large)
+ end
+ end
end
end
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 106ccb9fa..4ef35d19e 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -90,11 +90,13 @@ en:
file:
blank: "Select which file to upload."
not_csv: "Your file must be in CSV format."
+ file_too_large: "File must be 10MB or less. Check your file and delete data that does not need to be uploaded."
forms/bulk_upload_sales/upload_your_file:
attributes:
file:
blank: "Select which file to upload."
not_csv: "Your file must be in CSV format."
+ file_too_large: "File must be 10MB or less. Check your file and delete data that does not need to be uploaded."
forms/bulk_upload_lettings/needstype:
attributes:
needstype:
diff --git a/spec/features/bulk_upload_lettings_logs_spec.rb b/spec/features/bulk_upload_lettings_logs_spec.rb
index 315e1461e..b3e403cbf 100644
--- a/spec/features/bulk_upload_lettings_logs_spec.rb
+++ b/spec/features/bulk_upload_lettings_logs_spec.rb
@@ -74,6 +74,25 @@ RSpec.describe "Bulk upload lettings log" do
expect(page).to have_content("Upload lettings logs in bulk")
end
+
+ it "shows file to large error" do
+ stub_const("Forms::BulkUploadLettings::UploadYourFile::MAX_FILE_SIZE", 1.bytes)
+ visit("/lettings-logs")
+
+ click_link("Upload lettings logs in bulk")
+ expect(page).to have_content("Which year")
+ click_button("Continue")
+ choose(current_formatted_year)
+ click_button("Continue")
+ click_button("Continue")
+
+ allow_any_instance_of(Forms::BulkUploadLettings::UploadYourFile).to receive(:`).and_return("text/csv")
+
+ attach_file "file", file_fixture("2023_24_lettings_bulk_upload.xlsx")
+ click_button("Upload")
+
+ expect(page).to have_content("File must be 10MB or less. Check your file and delete data that does not need to be uploaded.")
+ end
end
# rubocop:enable RSpec/AnyInstance
diff --git a/spec/features/bulk_upload_sales_logs_spec.rb b/spec/features/bulk_upload_sales_logs_spec.rb
index b7098999d..b32df43e1 100644
--- a/spec/features/bulk_upload_sales_logs_spec.rb
+++ b/spec/features/bulk_upload_sales_logs_spec.rb
@@ -71,6 +71,26 @@ RSpec.describe "Bulk upload sales log" do
expect(page).to have_content("Upload sales logs in bulk")
end
+
+ it "shows file to large error" do
+ stub_const("Forms::BulkUploadSales::UploadYourFile::MAX_FILE_SIZE", 1.bytes)
+ visit("/sales-logs")
+ click_link("Upload sales logs in bulk")
+
+ expect(page).to have_content("Which year")
+ click_button("Continue")
+ click_button("Continue")
+ choose("2023 to 2024")
+ click_button("Continue")
+ click_button("Continue")
+
+ allow_any_instance_of(Forms::BulkUploadSales::UploadYourFile).to receive(:`).and_return("text/csv")
+
+ attach_file "file", file_fixture("2023_24_lettings_bulk_upload.xlsx")
+ click_button("Upload")
+
+ expect(page).to have_content("File must be 10MB or less. Check your file and delete data that does not need to be uploaded.")
+ end
end
# rubocop:enable RSpec/AnyInstance
From 51bc0cffeb55d1f0c8f4734e4b0cabad241be5e0 Mon Sep 17 00:00:00 2001
From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com>
Date: Thu, 31 Oct 2024 19:04:18 +0000
Subject: [PATCH 10/12] CLDC-3665 Extract sale information copy (#2711)
* Extract shared ownership copy
* Extract discounted ownership copy
* rename files
* CLDC-3665 Extract sale information soft validations (#2712)
* Extract shared ownership copy
* Extract shared ownership soft validations
* Extract discounted ownership validations
* Fix mappings
* Update some translations
* Remove full stops
---
app/helpers/interruption_screen_helper.rb | 1 +
.../form/sales/pages/about_staircase.rb | 2 +-
app/models/form/sales/pages/buyer_previous.rb | 1 +
app/models/form/sales/pages/deposit.rb | 2 +-
.../pages/deposit_and_mortgage_value_check.rb | 5 +-
.../form/sales/pages/deposit_discount.rb | 2 +-
.../form/sales/pages/deposit_value_check.rb | 2 +-
app/models/form/sales/pages/discount.rb | 2 +-
.../pages/discounted_sale_value_check.rb | 5 +-
app/models/form/sales/pages/equity.rb | 2 +-
app/models/form/sales/pages/exchange_date.rb | 1 +
.../form/sales/pages/extra_borrowing.rb | 2 +-
.../pages/extra_borrowing_value_check.rb | 5 +-
app/models/form/sales/pages/grant.rb | 2 +-
.../form/sales/pages/grant_value_check.rb | 5 +-
app/models/form/sales/pages/handover_date.rb | 1 +
.../form/sales/pages/handover_date_check.rb | 3 +-
app/models/form/sales/pages/la_nominations.rb | 1 +
.../form/sales/pages/leasehold_charges.rb | 1 +
.../sales/pages/living_before_purchase.rb | 3 +-
app/models/form/sales/pages/monthly_rent.rb | 1 +
.../form/sales/pages/mortgage_amount.rb | 2 +-
.../form/sales/pages/mortgage_lender.rb | 2 +-
.../form/sales/pages/mortgage_lender_other.rb | 2 +-
.../form/sales/pages/mortgage_length.rb | 1 +
app/models/form/sales/pages/mortgageused.rb | 2 +-
.../form/sales/pages/previous_bedrooms.rb | 2 +-
.../sales/pages/previous_property_type.rb | 2 +-
.../form/sales/pages/previous_tenure.rb | 1 +
app/models/form/sales/pages/purchase_price.rb | 2 +-
.../purchase_price_outright_ownership.rb | 12 +-
app/models/form/sales/pages/resale.rb | 1 +
.../shared_ownership_deposit_value_check.rb | 4 +-
app/models/form/sales/pages/staircase.rb | 1 +
.../pages/staircase_bought_value_check.rb | 5 +-
.../pages/staircase_owned_value_check.rb | 7 +-
.../sales/pages/value_shared_ownership.rb | 2 +-
.../form/sales/questions/buyer_previous.rb | 3 +-
.../form/sales/questions/deposit_amount.rb | 11 +-
.../deposit_and_mortgage_value_check.rb | 3 +-
.../form/sales/questions/deposit_discount.rb | 4 +-
.../sales/questions/deposit_value_check.rb | 6 +-
app/models/form/sales/questions/discount.rb | 6 +-
.../questions/discounted_sale_value_check.rb | 3 +-
app/models/form/sales/questions/equity.rb | 4 +-
.../form/sales/questions/exchange_date.rb | 3 +-
.../form/sales/questions/extra_borrowing.rb | 4 +-
.../questions/extra_borrowing_value_check.rb | 3 +-
app/models/form/sales/questions/fromprop.rb | 4 +-
app/models/form/sales/questions/grant.rb | 4 +-
.../form/sales/questions/grant_value_check.rb | 3 +-
.../form/sales/questions/handover_date.rb | 4 +-
.../sales/questions/handover_date_check.rb | 3 +-
.../sales/questions/has_leasehold_charges.rb | 4 +-
.../form/sales/questions/la_nominations.rb | 4 +-
.../form/sales/questions/leasehold_charges.rb | 3 +-
.../sales/questions/living_before_purchase.rb | 4 +-
.../questions/living_before_purchase_years.rb | 22 +-
.../form/sales/questions/monthly_rent.rb | 4 +-
.../form/sales/questions/mortgage_amount.rb | 4 +-
.../form/sales/questions/mortgage_lender.rb | 4 +-
.../sales/questions/mortgage_lender_other.rb | 3 +-
.../form/sales/questions/mortgage_length.rb | 4 +-
.../form/sales/questions/mortgageused.rb | 3 +-
.../form/sales/questions/previous_bedrooms.rb | 4 +-
.../form/sales/questions/previous_tenure.rb | 4 +-
.../form/sales/questions/purchase_price.rb | 14 +-
app/models/form/sales/questions/resale.rb | 4 +-
.../shared_ownership_deposit_value_check.rb | 3 +-
app/models/form/sales/questions/staircase.rb | 4 +-
.../form/sales/questions/staircase_bought.rb | 3 +-
.../questions/staircase_bought_value_check.rb | 3 +-
.../form/sales/questions/staircase_owned.rb | 3 +-
.../questions/staircase_owned_value_check.rb | 7 +-
.../form/sales/questions/staircase_sale.rb | 3 +-
app/models/form/sales/questions/value.rb | 4 +-
config/locales/en.yml | 41 ----
.../forms/2023/sales/sale_information.en.yml | 208 ++++++++++++++++++
.../forms/2023/sales/soft_validations.en.yml | 130 ++++++++---
.../forms/2024/sales/sale_information.en.yml | 207 +++++++++++++++++
.../forms/2024/sales/soft_validations.en.yml | 133 ++++++++---
.../subsections/tenancy_information_spec.rb | 2 +-
.../pages/discounted_sale_value_check_spec.rb | 7 +-
.../sales/pages/handover_date_check_spec.rb | 5 +-
...ared_ownership_deposit_value_check_spec.rb | 9 +-
.../pages/staircase_owned_value_check_spec.rb | 9 +-
.../questions/deposit_value_check_spec.rb | 2 +-
.../living_before_purchase_years_spec.rb | 2 +-
.../staircase_owned_value_check_spec.rb | 2 +-
89 files changed, 754 insertions(+), 283 deletions(-)
create mode 100644 config/locales/forms/2023/sales/sale_information.en.yml
create mode 100644 config/locales/forms/2024/sales/sale_information.en.yml
diff --git a/app/helpers/interruption_screen_helper.rb b/app/helpers/interruption_screen_helper.rb
index b28c7eaa9..7d9a38ddf 100644
--- a/app/helpers/interruption_screen_helper.rb
+++ b/app/helpers/interruption_screen_helper.rb
@@ -1,6 +1,7 @@
module InterruptionScreenHelper
def display_informative_text(informative_text, log)
return informative_text if informative_text.is_a? String
+ return "" if informative_text.nil?
return "" unless informative_text["arguments"]
translation_params = {}
diff --git a/app/models/form/sales/pages/about_staircase.rb b/app/models/form/sales/pages/about_staircase.rb
index 4d5882916..d736bae15 100644
--- a/app/models/form/sales/pages/about_staircase.rb
+++ b/app/models/form/sales/pages/about_staircase.rb
@@ -2,7 +2,7 @@ class Form::Sales::Pages::AboutStaircase < ::Form::Page
def initialize(id, hsh, subsection, joint_purchase:)
super(id, hsh, subsection)
@joint_purchase = joint_purchase
- @header = "About the staircasing transaction"
+ @copy_key = "sales.sale_information.about_staircasing"
@depends_on = [{
"staircase" => 1,
"joint_purchase?" => joint_purchase,
diff --git a/app/models/form/sales/pages/buyer_previous.rb b/app/models/form/sales/pages/buyer_previous.rb
index 87f87b66b..0d20207a3 100644
--- a/app/models/form/sales/pages/buyer_previous.rb
+++ b/app/models/form/sales/pages/buyer_previous.rb
@@ -2,6 +2,7 @@ class Form::Sales::Pages::BuyerPrevious < ::Form::Page
def initialize(id, hsh, subsection, joint_purchase:)
super(id, hsh, subsection)
@joint_purchase = joint_purchase
+ @copy_key = "sales.sale_information.soctenant.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@depends_on = [{ "joint_purchase?" => joint_purchase, "soctenant_is_inferred?" => false }]
end
diff --git a/app/models/form/sales/pages/deposit.rb b/app/models/form/sales/pages/deposit.rb
index 3e298e4f6..f0bbda05c 100644
--- a/app/models/form/sales/pages/deposit.rb
+++ b/app/models/form/sales/pages/deposit.rb
@@ -3,7 +3,7 @@ class Form::Sales::Pages::Deposit < ::Form::Page
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@optional = optional
- @header = "About the deposit"
+ @copy_key = "sales.sale_information.deposit"
end
def questions
diff --git a/app/models/form/sales/pages/deposit_and_mortgage_value_check.rb b/app/models/form/sales/pages/deposit_and_mortgage_value_check.rb
index fe5ad4acb..142c79cb5 100644
--- a/app/models/form/sales/pages/deposit_and_mortgage_value_check.rb
+++ b/app/models/form/sales/pages/deposit_and_mortgage_value_check.rb
@@ -6,8 +6,9 @@ class Form::Sales::Pages::DepositAndMortgageValueCheck < ::Form::Page
"mortgage_plus_deposit_less_than_discounted_value?" => true,
},
]
+ @copy_key = "sales.soft_validations.deposit_and_mortgage_value_check"
@title_text = {
- "translation" => "soft_validations.deposit_and_mortgage.title_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "mortgage",
@@ -27,7 +28,7 @@ class Form::Sales::Pages::DepositAndMortgageValueCheck < ::Form::Page
],
}
@informative_text = {
- "translation" => "soft_validations.deposit_and_mortgage.hint_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end
diff --git a/app/models/form/sales/pages/deposit_discount.rb b/app/models/form/sales/pages/deposit_discount.rb
index 6931a7510..caf726460 100644
--- a/app/models/form/sales/pages/deposit_discount.rb
+++ b/app/models/form/sales/pages/deposit_discount.rb
@@ -2,7 +2,7 @@ class Form::Sales::Pages::DepositDiscount < ::Form::Page
def initialize(id, hsh, subsection, optional:)
super(id, hsh, subsection)
@optional = optional
- @header = "About the deposit"
+ @copy_key = "sales.sale_information.cashdis"
end
def questions
diff --git a/app/models/form/sales/pages/deposit_value_check.rb b/app/models/form/sales/pages/deposit_value_check.rb
index cbec4b031..fea99b28b 100644
--- a/app/models/form/sales/pages/deposit_value_check.rb
+++ b/app/models/form/sales/pages/deposit_value_check.rb
@@ -26,7 +26,7 @@ class Form::Sales::Pages::DepositValueCheck < ::Form::Page
def questions
@questions ||= [
- Form::Sales::Questions::DepositValueCheck.new(nil, nil, self),
+ Form::Sales::Questions::DepositValueCheck.new(nil, nil, self, joint_purchase: @joint_purchase),
]
end
diff --git a/app/models/form/sales/pages/discount.rb b/app/models/form/sales/pages/discount.rb
index 56670075b..2d632985e 100644
--- a/app/models/form/sales/pages/discount.rb
+++ b/app/models/form/sales/pages/discount.rb
@@ -2,7 +2,7 @@ class Form::Sales::Pages::Discount < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "discount"
- @header = "About the price of the property"
+ @copy_key = "sales.sale_information.discount"
@depends_on = [{
"right_to_buy?" => true,
}]
diff --git a/app/models/form/sales/pages/discounted_sale_value_check.rb b/app/models/form/sales/pages/discounted_sale_value_check.rb
index dcb820e49..4fbff90c6 100644
--- a/app/models/form/sales/pages/discounted_sale_value_check.rb
+++ b/app/models/form/sales/pages/discounted_sale_value_check.rb
@@ -2,8 +2,9 @@ class Form::Sales::Pages::DiscountedSaleValueCheck < ::Form::Page
def initialize(id, hsh, subsection, person_index = nil)
super(id, hsh, subsection)
@depends_on = depends_on
+ @copy_key = "sales.soft_validations.discounted_sale_value_check"
@title_text = {
- "translation" => "soft_validations.discounted_sale_value.title_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
@@ -13,7 +14,7 @@ class Form::Sales::Pages::DiscountedSaleValueCheck < ::Form::Page
],
}
@informative_text = {
- "translation" => "soft_validations.discounted_sale_value.informative_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/equity.rb b/app/models/form/sales/pages/equity.rb
index 018ba6f79..9bf3050a0 100644
--- a/app/models/form/sales/pages/equity.rb
+++ b/app/models/form/sales/pages/equity.rb
@@ -2,7 +2,7 @@ class Form::Sales::Pages::Equity < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "equity"
- @header = "About the price of the property"
+ @copy_key = "sales.sale_information.equity"
end
def questions
diff --git a/app/models/form/sales/pages/exchange_date.rb b/app/models/form/sales/pages/exchange_date.rb
index ec71b0647..4317c39e0 100644
--- a/app/models/form/sales/pages/exchange_date.rb
+++ b/app/models/form/sales/pages/exchange_date.rb
@@ -2,6 +2,7 @@ class Form::Sales::Pages::ExchangeDate < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "exchange_contracts"
+ @copy_key = "sales.sale_information.exchange_date"
@depends_on = [{
"resale" => 2,
}]
diff --git a/app/models/form/sales/pages/extra_borrowing.rb b/app/models/form/sales/pages/extra_borrowing.rb
index 4bb8d0530..c6ddb705a 100644
--- a/app/models/form/sales/pages/extra_borrowing.rb
+++ b/app/models/form/sales/pages/extra_borrowing.rb
@@ -2,7 +2,7 @@ class Form::Sales::Pages::ExtraBorrowing < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
- @header = ""
+ @copy_key = "sales.sale_information.extrabor"
@description = ""
@subsection = subsection
@depends_on = [{
diff --git a/app/models/form/sales/pages/extra_borrowing_value_check.rb b/app/models/form/sales/pages/extra_borrowing_value_check.rb
index b3cf0b2db..9fc621611 100644
--- a/app/models/form/sales/pages/extra_borrowing_value_check.rb
+++ b/app/models/form/sales/pages/extra_borrowing_value_check.rb
@@ -6,8 +6,9 @@ class Form::Sales::Pages::ExtraBorrowingValueCheck < Form::Page
"extra_borrowing_expected_but_not_reported?" => true,
},
]
+ @copy_key = "sales.soft_validations.extra_borrowing_value_check"
@title_text = {
- "translation" => "soft_validations.extra_borrowing.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::ExtraBorrowingValueCheck < Form::Page
],
}
@informative_text = {
- "translation" => "soft_validations.extra_borrowing.hint_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end
diff --git a/app/models/form/sales/pages/grant.rb b/app/models/form/sales/pages/grant.rb
index 7c7d2a625..2f96701c5 100644
--- a/app/models/form/sales/pages/grant.rb
+++ b/app/models/form/sales/pages/grant.rb
@@ -2,7 +2,7 @@ class Form::Sales::Pages::Grant < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "grant"
- @header = "About the price of the property"
+ @copy_key = "sales.sale_information.grant"
@depends_on = [{
"right_to_buy?" => false,
"rent_to_buy_full_ownership?" => false,
diff --git a/app/models/form/sales/pages/grant_value_check.rb b/app/models/form/sales/pages/grant_value_check.rb
index 6b53d74ee..0c5d50901 100644
--- a/app/models/form/sales/pages/grant_value_check.rb
+++ b/app/models/form/sales/pages/grant_value_check.rb
@@ -2,13 +2,14 @@ class Form::Sales::Pages::GrantValueCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "grant_value_check"
+ @copy_key = "sales.soft_validations.grant_value_check"
@depends_on = [
{
"grant_outside_common_range?" => true,
},
]
@title_text = {
- "translation" => "soft_validations.grant.title_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
@@ -18,7 +19,7 @@ class Form::Sales::Pages::GrantValueCheck < ::Form::Page
],
}
@informative_text = {
- "translation" => "soft_validations.grant.hint_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end
diff --git a/app/models/form/sales/pages/handover_date.rb b/app/models/form/sales/pages/handover_date.rb
index 35fbe7822..c40effc8e 100644
--- a/app/models/form/sales/pages/handover_date.rb
+++ b/app/models/form/sales/pages/handover_date.rb
@@ -2,6 +2,7 @@ class Form::Sales::Pages::HandoverDate < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "handover_date"
+ @copy_key = "sales.sale_information.handover_date"
@depends_on = [
{ "ownershipsch" => 1, "resale" => 2 },
]
diff --git a/app/models/form/sales/pages/handover_date_check.rb b/app/models/form/sales/pages/handover_date_check.rb
index e8d666f60..690c3dde7 100644
--- a/app/models/form/sales/pages/handover_date_check.rb
+++ b/app/models/form/sales/pages/handover_date_check.rb
@@ -2,11 +2,12 @@ class Form::Sales::Pages::HandoverDateCheck < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "handover_date_check"
+ @copy_key = "sales.soft_validations.hodate_check"
@depends_on = [{ "saledate_check" => nil, "hodate_3_years_or_more_saledate?" => true },
{ "saledate_check" => 1, "hodate_3_years_or_more_saledate?" => true }]
@informative_text = {}
@title_text = {
- "translation" => "soft_validations.hodate.must_be_less_than_3_years_from_saledate",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [],
}
end
diff --git a/app/models/form/sales/pages/la_nominations.rb b/app/models/form/sales/pages/la_nominations.rb
index fc3f39f6a..6adda533d 100644
--- a/app/models/form/sales/pages/la_nominations.rb
+++ b/app/models/form/sales/pages/la_nominations.rb
@@ -2,6 +2,7 @@ class Form::Sales::Pages::LaNominations < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "la_nominations"
+ @copy_key = "sales.sale_information.la_nominations"
end
def questions
diff --git a/app/models/form/sales/pages/leasehold_charges.rb b/app/models/form/sales/pages/leasehold_charges.rb
index a8ce52805..72b2eeea3 100644
--- a/app/models/form/sales/pages/leasehold_charges.rb
+++ b/app/models/form/sales/pages/leasehold_charges.rb
@@ -2,6 +2,7 @@ class Form::Sales::Pages::LeaseholdCharges < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
+ @copy_key = "sales.sale_information.leaseholdcharges"
end
def questions
diff --git a/app/models/form/sales/pages/living_before_purchase.rb b/app/models/form/sales/pages/living_before_purchase.rb
index c5dd64330..3bb5510ce 100644
--- a/app/models/form/sales/pages/living_before_purchase.rb
+++ b/app/models/form/sales/pages/living_before_purchase.rb
@@ -3,12 +3,13 @@ class Form::Sales::Pages::LivingBeforePurchase < ::Form::Page
super(id, hsh, subsection)
@ownershipsch = ownershipsch
@joint_purchase = joint_purchase
+ @copy_key = "sales.sale_information.living_before_purchase.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
end
def questions
@questions ||= [
living_before_purchase,
- Form::Sales::Questions::LivingBeforePurchaseYears.new(nil, nil, self, ownershipsch: @ownershipsch),
+ Form::Sales::Questions::LivingBeforePurchaseYears.new(nil, nil, self, ownershipsch: @ownershipsch, joint_purchase: @joint_purchase),
].compact
end
diff --git a/app/models/form/sales/pages/monthly_rent.rb b/app/models/form/sales/pages/monthly_rent.rb
index 29f0d895f..943e47cff 100644
--- a/app/models/form/sales/pages/monthly_rent.rb
+++ b/app/models/form/sales/pages/monthly_rent.rb
@@ -2,6 +2,7 @@ class Form::Sales::Pages::MonthlyRent < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "monthly_rent"
+ @copy_key = "sales.sale_information.mrent"
end
def questions
diff --git a/app/models/form/sales/pages/mortgage_amount.rb b/app/models/form/sales/pages/mortgage_amount.rb
index 73e306c2a..41fba167c 100644
--- a/app/models/form/sales/pages/mortgage_amount.rb
+++ b/app/models/form/sales/pages/mortgage_amount.rb
@@ -2,7 +2,7 @@ class Form::Sales::Pages::MortgageAmount < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
- @header = "Mortgage Amount"
+ @copy_key = "sales.sale_information.mortgage"
@depends_on = [{ "mortgage_used?" => true }]
end
diff --git a/app/models/form/sales/pages/mortgage_lender.rb b/app/models/form/sales/pages/mortgage_lender.rb
index f187815b1..87646a514 100644
--- a/app/models/form/sales/pages/mortgage_lender.rb
+++ b/app/models/form/sales/pages/mortgage_lender.rb
@@ -2,7 +2,7 @@ class Form::Sales::Pages::MortgageLender < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
- @header = ""
+ @copy_key = "sales.sale_information.mortgagelender"
@description = ""
@subsection = subsection
@depends_on = [{
diff --git a/app/models/form/sales/pages/mortgage_lender_other.rb b/app/models/form/sales/pages/mortgage_lender_other.rb
index 903a7dba8..903d6518f 100644
--- a/app/models/form/sales/pages/mortgage_lender_other.rb
+++ b/app/models/form/sales/pages/mortgage_lender_other.rb
@@ -2,7 +2,7 @@ class Form::Sales::Pages::MortgageLenderOther < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
- @header = ""
+ @copy_key = "sales.sale_information.mortgagelenderother"
@description = ""
@subsection = subsection
@depends_on = [{
diff --git a/app/models/form/sales/pages/mortgage_length.rb b/app/models/form/sales/pages/mortgage_length.rb
index dbc01a695..76c46694a 100644
--- a/app/models/form/sales/pages/mortgage_length.rb
+++ b/app/models/form/sales/pages/mortgage_length.rb
@@ -2,6 +2,7 @@ class Form::Sales::Pages::MortgageLength < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@ownershipsch = ownershipsch
+ @copy_key = "sales.sale_information.mortlen"
@depends_on = [{
"mortgageused" => 1,
}]
diff --git a/app/models/form/sales/pages/mortgageused.rb b/app/models/form/sales/pages/mortgageused.rb
index a4912b12d..ab48b0c2d 100644
--- a/app/models/form/sales/pages/mortgageused.rb
+++ b/app/models/form/sales/pages/mortgageused.rb
@@ -1,7 +1,7 @@
class Form::Sales::Pages::Mortgageused < ::Form::Page
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
- @header = "Mortgage Amount"
+ @copy_key = "sales.sale_information.mortgageused"
@ownershipsch = ownershipsch
end
diff --git a/app/models/form/sales/pages/previous_bedrooms.rb b/app/models/form/sales/pages/previous_bedrooms.rb
index 722822c2d..26b3ef050 100644
--- a/app/models/form/sales/pages/previous_bedrooms.rb
+++ b/app/models/form/sales/pages/previous_bedrooms.rb
@@ -2,7 +2,7 @@ class Form::Sales::Pages::PreviousBedrooms < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "previous_bedrooms"
- @header = "About the buyers’ previous property"
+ @copy_key = "sales.sale_information.frombeds"
@depends_on = [
{
"soctenant" => 1,
diff --git a/app/models/form/sales/pages/previous_property_type.rb b/app/models/form/sales/pages/previous_property_type.rb
index 8c46963d0..c5dd4f66a 100644
--- a/app/models/form/sales/pages/previous_property_type.rb
+++ b/app/models/form/sales/pages/previous_property_type.rb
@@ -2,7 +2,7 @@ class Form::Sales::Pages::PreviousPropertyType < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "previous_property_type"
- @header = ""
+ @copy_key = "sales.sale_information.fromprop"
@description = ""
@subsection = subsection
@depends_on = [
diff --git a/app/models/form/sales/pages/previous_tenure.rb b/app/models/form/sales/pages/previous_tenure.rb
index 0f4a4b250..c35b6bd67 100644
--- a/app/models/form/sales/pages/previous_tenure.rb
+++ b/app/models/form/sales/pages/previous_tenure.rb
@@ -2,6 +2,7 @@ class Form::Sales::Pages::PreviousTenure < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "shared_ownership_previous_tenure"
+ @copy_key = "sales.sale_information.socprevten"
@header = ""
@description = ""
@subsection = subsection
diff --git a/app/models/form/sales/pages/purchase_price.rb b/app/models/form/sales/pages/purchase_price.rb
index 2203375ef..0bb1da53e 100644
--- a/app/models/form/sales/pages/purchase_price.rb
+++ b/app/models/form/sales/pages/purchase_price.rb
@@ -2,7 +2,7 @@ class Form::Sales::Pages::PurchasePrice < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "purchase_price"
- @header = "About the price of the property"
+ @copy_key = "sales.sale_information.purchase_price.discounted_ownership"
@depends_on = [{ "right_to_buy?" => true },
{
"right_to_buy?" => false,
diff --git a/app/models/form/sales/pages/purchase_price_outright_ownership.rb b/app/models/form/sales/pages/purchase_price_outright_ownership.rb
index 897a19c2e..ea42a7001 100644
--- a/app/models/form/sales/pages/purchase_price_outright_ownership.rb
+++ b/app/models/form/sales/pages/purchase_price_outright_ownership.rb
@@ -4,11 +4,21 @@ class Form::Sales::Pages::PurchasePriceOutrightOwnership < ::Form::Page
@depends_on = [
{ "outright_sale_or_discounted_with_full_ownership?" => true },
]
- @header = "About the price of the property"
@top_guidance_partial = "financial_calculations_outright_sale"
@ownershipsch = ownershipsch
end
+ def copy_key
+ case @ownershipsch
+ when 1
+ "sales.sale_information.purchase_price.shared_ownership"
+ when 2
+ "sales.sale_information.purchase_price.discounted_ownership"
+ when 3
+ "sales.sale_information.purchase_price.outright_sale"
+ end
+ end
+
def questions
@questions ||= [
Form::Sales::Questions::PurchasePrice.new(nil, nil, self, ownershipsch: @ownershipsch),
diff --git a/app/models/form/sales/pages/resale.rb b/app/models/form/sales/pages/resale.rb
index ffdbbc046..6f4cd24e2 100644
--- a/app/models/form/sales/pages/resale.rb
+++ b/app/models/form/sales/pages/resale.rb
@@ -2,6 +2,7 @@ class Form::Sales::Pages::Resale < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "resale"
+ @copy_key = "sales.sale_information.resale"
@depends_on = [
{
"staircase" => 2,
diff --git a/app/models/form/sales/pages/shared_ownership_deposit_value_check.rb b/app/models/form/sales/pages/shared_ownership_deposit_value_check.rb
index bc8df6743..e56db3e38 100644
--- a/app/models/form/sales/pages/shared_ownership_deposit_value_check.rb
+++ b/app/models/form/sales/pages/shared_ownership_deposit_value_check.rb
@@ -6,9 +6,9 @@ class Form::Sales::Pages::SharedOwnershipDepositValueCheck < ::Form::Page
"shared_ownership_deposit_invalid?" => true,
},
]
- @informative_text = {}
+ @copy_key = "sales.soft_validations.shared_ownership_deposit_value_check"
@title_text = {
- "translation" => "soft_validations.shared_ownership_deposit.title_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "mortgage_deposit_and_discount_error_fields",
diff --git a/app/models/form/sales/pages/staircase.rb b/app/models/form/sales/pages/staircase.rb
index 6ab76e2bf..28b0d6b38 100644
--- a/app/models/form/sales/pages/staircase.rb
+++ b/app/models/form/sales/pages/staircase.rb
@@ -2,6 +2,7 @@ class Form::Sales::Pages::Staircase < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "staircasing"
+ @copy_key = "sales.sale_information.staircasing"
end
def questions
diff --git a/app/models/form/sales/pages/staircase_bought_value_check.rb b/app/models/form/sales/pages/staircase_bought_value_check.rb
index 283261a53..3b505f3cc 100644
--- a/app/models/form/sales/pages/staircase_bought_value_check.rb
+++ b/app/models/form/sales/pages/staircase_bought_value_check.rb
@@ -7,8 +7,9 @@ class Form::Sales::Pages::StaircaseBoughtValueCheck < ::Form::Page
"staircase_bought_above_fifty?" => true,
},
]
+ @copy_key = "sales.soft_validations.staircase_bought_value_check"
@title_text = {
- "translation" => "soft_validations.staircase_bought_seems_high.title_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "stairbought",
@@ -17,7 +18,7 @@ class Form::Sales::Pages::StaircaseBoughtValueCheck < ::Form::Page
],
}
@informative_text = {
- "translation" => "soft_validations.staircase_bought_seems_high.hint_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end
diff --git a/app/models/form/sales/pages/staircase_owned_value_check.rb b/app/models/form/sales/pages/staircase_owned_value_check.rb
index d83bf7d5d..1a26215e3 100644
--- a/app/models/form/sales/pages/staircase_owned_value_check.rb
+++ b/app/models/form/sales/pages/staircase_owned_value_check.rb
@@ -8,8 +8,9 @@ class Form::Sales::Pages::StaircaseOwnedValueCheck < ::Form::Page
"joint_purchase?" => joint_purchase,
},
]
+ @copy_key = "sales.soft_validations.stairowned_value_check.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@title_text = {
- "translation" => joint_purchase ? "soft_validations.staircase_owned.title_text.two" : "soft_validations.staircase_owned.title_text.one",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [
{
"key" => "stairowned",
@@ -19,14 +20,14 @@ class Form::Sales::Pages::StaircaseOwnedValueCheck < ::Form::Page
],
}
@informative_text = {
- "translation" => "soft_validations.staircase_owned.hint_text",
+ "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
end
def questions
@questions ||= [
- Form::Sales::Questions::StaircaseOwnedValueCheck.new(nil, nil, self),
+ Form::Sales::Questions::StaircaseOwnedValueCheck.new(nil, nil, self, joint_purchase: @joint_purchase),
]
end
diff --git a/app/models/form/sales/pages/value_shared_ownership.rb b/app/models/form/sales/pages/value_shared_ownership.rb
index a4f6dbe1c..c2212c787 100644
--- a/app/models/form/sales/pages/value_shared_ownership.rb
+++ b/app/models/form/sales/pages/value_shared_ownership.rb
@@ -2,7 +2,7 @@ class Form::Sales::Pages::ValueSharedOwnership < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "value_shared_ownership"
- @header = "About the price of the property"
+ @copy_key = "sales.sale_information.value"
end
def questions
diff --git a/app/models/form/sales/questions/buyer_previous.rb b/app/models/form/sales/questions/buyer_previous.rb
index b35a67c5e..dfc0c2fd2 100644
--- a/app/models/form/sales/questions/buyer_previous.rb
+++ b/app/models/form/sales/questions/buyer_previous.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::BuyerPrevious < ::Form::Question
def initialize(id, hsh, page, joint_purchase:)
super(id, hsh, page)
@id = "soctenant"
- @check_answer_label = I18n.t("check_answer_labels.soctenant", count: joint_purchase ? 2 : 1)
- @header = I18n.t("questions.soctenant", count: joint_purchase ? 2 : 1)
+ @copy_key = "sales.sale_information.soctenant.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@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/deposit_amount.rb b/app/models/form/sales/questions/deposit_amount.rb
index c1d91cc12..41586cd94 100644
--- a/app/models/form/sales/questions/deposit_amount.rb
+++ b/app/models/form/sales/questions/deposit_amount.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::DepositAmount < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:, optional:)
super(id, hsh, subsection)
@id = "deposit"
- @check_answer_label = "Cash deposit"
- @header = "How much cash deposit was paid on the property?"
+ @copy_key = "sales.sale_information.deposit"
@type = "numeric"
@min = 0
@max = 999_999
@@ -25,14 +24,6 @@ class Form::Sales::Questions::DepositAmount < ::Form::Question
2024 => { 1 => 96, 2 => 109, 3 => 116 },
}.freeze
- def hint_text
- if @optional
- "Enter the total cash sum paid by the buyer towards the property that was not funded by the mortgage. This excludes any grant or loan. As this is a fully staircased sale this question is optional. If you do not have the information available click save and continue"
- else
- "Enter the total cash sum paid by the buyer towards the property that was not funded by the mortgage. This excludes any grant or loan"
- end
- end
-
def top_guidance_partial
return "financial_calculations_shared_ownership" if @ownershipsch == 1
return "financial_calculations_discounted_ownership" if @ownershipsch == 2
diff --git a/app/models/form/sales/questions/deposit_and_mortgage_value_check.rb b/app/models/form/sales/questions/deposit_and_mortgage_value_check.rb
index 263cf4342..3a60e2afa 100644
--- a/app/models/form/sales/questions/deposit_and_mortgage_value_check.rb
+++ b/app/models/form/sales/questions/deposit_and_mortgage_value_check.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::DepositAndMortgageValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "deposit_and_mortgage_value_check"
- @check_answer_label = "Deposit and mortgage against discount confirmation"
- @header = "Are you sure? Mortgage and deposit usually equal or are more than (value - discount)"
+ @copy_key = "sales.soft_validations.deposit_and_mortgage_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },
diff --git a/app/models/form/sales/questions/deposit_discount.rb b/app/models/form/sales/questions/deposit_discount.rb
index faf8d76f7..289e3962c 100644
--- a/app/models/form/sales/questions/deposit_discount.rb
+++ b/app/models/form/sales/questions/deposit_discount.rb
@@ -2,15 +2,13 @@ class Form::Sales::Questions::DepositDiscount < ::Form::Question
def initialize(id, hsh, page)
super
@id = "cashdis"
- @check_answer_label = "Cash discount through SocialHomeBuy"
- @header = "How much cash discount was given through Social HomeBuy?"
+ @copy_key = "sales.sale_information.cashdis"
@type = "numeric"
@min = 0
@max = 999_999
@step = 1
@width = 5
@prefix = "£"
- @hint_text = "Enter the total cash discount given on the property being purchased through the Social HomeBuy scheme"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@top_guidance_partial = "financial_calculations_shared_ownership"
end
diff --git a/app/models/form/sales/questions/deposit_value_check.rb b/app/models/form/sales/questions/deposit_value_check.rb
index f8d403d9c..71560fa84 100644
--- a/app/models/form/sales/questions/deposit_value_check.rb
+++ b/app/models/form/sales/questions/deposit_value_check.rb
@@ -1,8 +1,8 @@
class Form::Sales::Questions::DepositValueCheck < ::Form::Question
- def initialize(id, hsh, page)
- super
+ def initialize(id, hsh, page, joint_purchase:)
+ super(id, hsh, page)
@id = "deposit_value_check"
- @copy_key = "sales.soft_validations.deposit_value_check"
+ @copy_key = "sales.soft_validations.deposit_value_check.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },
diff --git a/app/models/form/sales/questions/discount.rb b/app/models/form/sales/questions/discount.rb
index f99203ebe..1d8c5a46b 100644
--- a/app/models/form/sales/questions/discount.rb
+++ b/app/models/form/sales/questions/discount.rb
@@ -2,17 +2,13 @@ class Form::Sales::Questions::Discount < ::Form::Question
def initialize(id, hsh, page)
super
@id = "discount"
- @check_answer_label = "Percentage discount"
- @header = "What was the percentage discount?"
@type = "numeric"
+ @copy_key = "sales.sale_information.discount"
@min = 0
@max = form.start_year_after_2024? ? 70 : 100
@step = 0.1
@width = 5
@suffix = "%"
- @hint_text = "For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)
- If discount capped, enter capped %
- If the property is being sold to an existing tenant under the RTB, PRTB, or VRTB schemes, enter the % discount from the full market value that is being given."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@top_guidance_partial = "financial_calculations_discounted_ownership"
end
diff --git a/app/models/form/sales/questions/discounted_sale_value_check.rb b/app/models/form/sales/questions/discounted_sale_value_check.rb
index 1d86b2f32..a02aaac72 100644
--- a/app/models/form/sales/questions/discounted_sale_value_check.rb
+++ b/app/models/form/sales/questions/discounted_sale_value_check.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::DiscountedSaleValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "discounted_sale_value_check"
- @check_answer_label = "Discounted sale value confirmation"
- @header = "Are you sure this is correct?"
+ @copy_key = "sales.soft_validations.discounted_sale_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },
diff --git a/app/models/form/sales/questions/equity.rb b/app/models/form/sales/questions/equity.rb
index 2e1ad4dee..dd1a14227 100644
--- a/app/models/form/sales/questions/equity.rb
+++ b/app/models/form/sales/questions/equity.rb
@@ -2,15 +2,13 @@ class Form::Sales::Questions::Equity < ::Form::Question
def initialize(id, hsh, page)
super
@id = "equity"
- @check_answer_label = "Initial percentage equity stake"
- @header = "What was the initial percentage equity stake purchased?"
+ @copy_key = "sales.sale_information.equity"
@type = "numeric"
@min = 0
@max = 100
@step = 1
@width = 5
@suffix = "%"
- @hint_text = "Enter the amount of initial equity held by the purchaser (for example, 25% or 50%)"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@top_guidance_partial = "financial_calculations_shared_ownership"
end
diff --git a/app/models/form/sales/questions/exchange_date.rb b/app/models/form/sales/questions/exchange_date.rb
index 8e9dd4691..a29a7a6c7 100644
--- a/app/models/form/sales/questions/exchange_date.rb
+++ b/app/models/form/sales/questions/exchange_date.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::ExchangeDate < ::Form::Question
def initialize(id, hsh, page)
super
@id = "exdate"
- @check_answer_label = "Exchange of contracts date"
- @header = "What is the exchange of contracts date?"
+ @copy_key = "sales.sale_information.exchange_date"
@type = "date"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/sales/questions/extra_borrowing.rb b/app/models/form/sales/questions/extra_borrowing.rb
index 2b4303423..e3cd0ff7e 100644
--- a/app/models/form/sales/questions/extra_borrowing.rb
+++ b/app/models/form/sales/questions/extra_borrowing.rb
@@ -2,12 +2,10 @@ class Form::Sales::Questions::ExtraBorrowing < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@id = "extrabor"
- @check_answer_label = "Any other borrowing?"
- @header = "Does this include any extra borrowing?"
+ @copy_key = "sales.sale_information.extrabor"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@page = page
- @hint_text = ""
@ownershipsch = ownershipsch
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end
diff --git a/app/models/form/sales/questions/extra_borrowing_value_check.rb b/app/models/form/sales/questions/extra_borrowing_value_check.rb
index 0f12ce110..7a251fab8 100644
--- a/app/models/form/sales/questions/extra_borrowing_value_check.rb
+++ b/app/models/form/sales/questions/extra_borrowing_value_check.rb
@@ -2,7 +2,7 @@ class Form::Sales::Questions::ExtraBorrowingValueCheck < ::Form::Question
def initialize(id, hsh, page)
super(id, hsh, page)
@id = "extrabor_value_check"
- @check_answer_label = "Extra borrowing confirmation"
+ @copy_key = "sales.soft_validations.extra_borrowing_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },
@@ -18,6 +18,5 @@ class Form::Sales::Questions::ExtraBorrowingValueCheck < ::Form::Question
},
],
}
- @header = "Are you sure there is no extra borrowing?"
end
end
diff --git a/app/models/form/sales/questions/fromprop.rb b/app/models/form/sales/questions/fromprop.rb
index ec17e5939..1a3393b7a 100644
--- a/app/models/form/sales/questions/fromprop.rb
+++ b/app/models/form/sales/questions/fromprop.rb
@@ -2,10 +2,8 @@ class Form::Sales::Questions::Fromprop < ::Form::Question
def initialize(id, hsh, page)
super
@id = "fromprop"
- @check_answer_label = "Previous property type"
- @header = "What was the previous property type?"
+ @copy_key = "sales.sale_information.fromprop"
@type = "radio"
- @hint_text = ""
@page = page
@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/grant.rb b/app/models/form/sales/questions/grant.rb
index 45b70d61f..17361fe9c 100644
--- a/app/models/form/sales/questions/grant.rb
+++ b/app/models/form/sales/questions/grant.rb
@@ -2,15 +2,13 @@ class Form::Sales::Questions::Grant < ::Form::Question
def initialize(id, hsh, page)
super
@id = "grant"
- @check_answer_label = "Amount of any loan, grant or subsidy"
- @header = "What was the amount of any loan, grant, discount or subsidy given?"
+ @copy_key = "sales.sale_information.grant"
@type = "numeric"
@min = 0
@max = 999_999
@step = 1
@width = 5
@prefix = "£"
- @hint_text = "For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@top_guidance_partial = "financial_calculations_discounted_ownership"
end
diff --git a/app/models/form/sales/questions/grant_value_check.rb b/app/models/form/sales/questions/grant_value_check.rb
index a7efdbaee..63dbb7bac 100644
--- a/app/models/form/sales/questions/grant_value_check.rb
+++ b/app/models/form/sales/questions/grant_value_check.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::GrantValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "grant_value_check"
- @check_answer_label = "Grant value confirmation"
- @header = "Are you sure? Grants are usually £9,000 - £16,000"
+ @copy_key = "sales.soft_validations.grant_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },
diff --git a/app/models/form/sales/questions/handover_date.rb b/app/models/form/sales/questions/handover_date.rb
index 5fb55e5c8..8994ecc40 100644
--- a/app/models/form/sales/questions/handover_date.rb
+++ b/app/models/form/sales/questions/handover_date.rb
@@ -2,10 +2,8 @@ class Form::Sales::Questions::HandoverDate < ::Form::Question
def initialize(id, hsh, page)
super
@id = "hodate"
- @check_answer_label = "Practical completion or handover date"
- @header = "What is the practical completion or handover date?"
+ @copy_key = "sales.sale_information.handover_date"
@type = "date"
- @hint_text = "This is the date on which the building contractor hands over responsibility for the completed property to the private registered provider (PRP)"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/sales/questions/handover_date_check.rb b/app/models/form/sales/questions/handover_date_check.rb
index f19ee0196..233c449bb 100644
--- a/app/models/form/sales/questions/handover_date_check.rb
+++ b/app/models/form/sales/questions/handover_date_check.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::HandoverDateCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "hodate_check"
- @check_answer_label = "Practical completion or handover date check"
- @header = "Are you sure?"
+ @copy_key = "sales.soft_validations.hodate_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },
diff --git a/app/models/form/sales/questions/has_leasehold_charges.rb b/app/models/form/sales/questions/has_leasehold_charges.rb
index 3e021daa0..fced1d3da 100644
--- a/app/models/form/sales/questions/has_leasehold_charges.rb
+++ b/app/models/form/sales/questions/has_leasehold_charges.rb
@@ -2,9 +2,7 @@ class Form::Sales::Questions::HasLeaseholdCharges < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@id = "has_mscharge"
- @check_answer_label = "Does the property have any monthly leasehold charges?"
- @header = "Does the property have any monthly leasehold charges?"
- @hint_text = "For example, service and management charges"
+ @copy_key = "sales.sale_information.leaseholdcharges.has_mscharge"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@conditional_for = {
diff --git a/app/models/form/sales/questions/la_nominations.rb b/app/models/form/sales/questions/la_nominations.rb
index 0d6e9e249..34540677f 100644
--- a/app/models/form/sales/questions/la_nominations.rb
+++ b/app/models/form/sales/questions/la_nominations.rb
@@ -2,11 +2,9 @@ class Form::Sales::Questions::LaNominations < ::Form::Question
def initialize(id, hsh, page)
super
@id = "lanomagr"
- @check_answer_label = "Household rehoused under a local authority nominations agreement?"
- @header = "Was the household rehoused under a 'local authority nominations agreement'?"
+ @copy_key = "sales.sale_information.la_nominations"
@type = "radio"
@answer_options = ANSWER_OPTIONS
- @hint_text = "A local authority nominations agreement is a written agreement between a local authority and private registered provider (PRP) that some or all of its sales vacancies are offered to local authorities for rehousing"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/sales/questions/leasehold_charges.rb b/app/models/form/sales/questions/leasehold_charges.rb
index 2561ccc1d..73d57b1e4 100644
--- a/app/models/form/sales/questions/leasehold_charges.rb
+++ b/app/models/form/sales/questions/leasehold_charges.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::LeaseholdCharges < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@id = "mscharge"
- @check_answer_label = "Monthly leasehold charges"
- @header = "Enter the total monthly charge"
+ @copy_key = "sales.sale_information.leaseholdcharges.mscharge"
@type = "numeric"
@min = 1
@step = 0.01
diff --git a/app/models/form/sales/questions/living_before_purchase.rb b/app/models/form/sales/questions/living_before_purchase.rb
index 9f28d61ee..c4337e38d 100644
--- a/app/models/form/sales/questions/living_before_purchase.rb
+++ b/app/models/form/sales/questions/living_before_purchase.rb
@@ -2,9 +2,7 @@ class Form::Sales::Questions::LivingBeforePurchase < ::Form::Question
def initialize(id, hsh, page, ownershipsch:, joint_purchase:)
super(id, hsh, page)
@id = "proplen_asked"
- @check_answer_label = "#{joint_purchase ? 'Buyers' : 'Buyer'} lived in the property before purchasing"
- @header = "Did the #{joint_purchase ? 'buyers' : 'buyer'} live in the property before purchasing it?"
- @hint_text = nil
+ @copy_key = "sales.sale_information.living_before_purchase.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}.proplen_asked"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@conditional_for = {
diff --git a/app/models/form/sales/questions/living_before_purchase_years.rb b/app/models/form/sales/questions/living_before_purchase_years.rb
index 4ef92a46c..465ba9877 100644
--- a/app/models/form/sales/questions/living_before_purchase_years.rb
+++ b/app/models/form/sales/questions/living_before_purchase_years.rb
@@ -1,10 +1,8 @@
class Form::Sales::Questions::LivingBeforePurchaseYears < ::Form::Question
- def initialize(id, hsh, page, ownershipsch:)
+ def initialize(id, hsh, page, ownershipsch:, joint_purchase:)
super(id, hsh, page)
@id = "proplen"
- @check_answer_label = "Number of years living in the property before purchase"
- @header = header_text
- @hint_text = hint_text
+ @copy_key = "sales.sale_information.living_before_purchase.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}.proplen"
@type = "numeric"
@min = 0
@max = 80
@@ -14,22 +12,6 @@ class Form::Sales::Questions::LivingBeforePurchaseYears < ::Form::Question
@question_number = question_number
end
- def header_text
- if form.start_date.year >= 2023
- "How long did they live there?"
- else
- "How long did the buyer(s) live in the property before purchase?"
- end
- end
-
- def hint_text
- if form.start_date.year >= 2023
- "You should round up to the nearest year"
- else
- "You should round this up to the nearest year. If the buyers haven't been living in the property, enter '0'"
- end
- end
-
def suffix_label(log)
" #{'year'.pluralize(log[id])}"
end
diff --git a/app/models/form/sales/questions/monthly_rent.rb b/app/models/form/sales/questions/monthly_rent.rb
index c53f1b7e6..7e64d8571 100644
--- a/app/models/form/sales/questions/monthly_rent.rb
+++ b/app/models/form/sales/questions/monthly_rent.rb
@@ -2,14 +2,12 @@ class Form::Sales::Questions::MonthlyRent < ::Form::Question
def initialize(id, hsh, page)
super
@id = "mrent"
- @check_answer_label = "Monthly rent"
- @header = "What is the basic monthly rent?"
+ @copy_key = "sales.sale_information.mrent"
@type = "numeric"
@min = 0
@step = 0.01
@width = 5
@prefix = "£"
- @hint_text = "Amount paid before any charges"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/sales/questions/mortgage_amount.rb b/app/models/form/sales/questions/mortgage_amount.rb
index cfd031f27..a6ffcf26a 100644
--- a/app/models/form/sales/questions/mortgage_amount.rb
+++ b/app/models/form/sales/questions/mortgage_amount.rb
@@ -2,14 +2,12 @@ class Form::Sales::Questions::MortgageAmount < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@id = "mortgage"
- @check_answer_label = "Mortgage amount"
- @header = "What is the mortgage amount?"
+ @copy_key = "sales.sale_information.mortgage"
@type = "numeric"
@min = 1
@step = 1
@width = 5
@prefix = "£"
- @hint_text = "Enter the amount of mortgage agreed with the mortgage lender. Exclude any deposits or cash payments. Numeric in pounds. Rounded to the nearest pound."
@ownershipsch = ownershipsch
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
@top_guidance_partial = top_guidance_partial
diff --git a/app/models/form/sales/questions/mortgage_lender.rb b/app/models/form/sales/questions/mortgage_lender.rb
index bf4c93b55..c5a10efb4 100644
--- a/app/models/form/sales/questions/mortgage_lender.rb
+++ b/app/models/form/sales/questions/mortgage_lender.rb
@@ -2,10 +2,8 @@ class Form::Sales::Questions::MortgageLender < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@id = "mortgagelender"
- @check_answer_label = "Mortgage Lender"
- @header = "What is the name of the mortgage lender?"
+ @copy_key = "sales.sale_information.mortgagelender"
@type = "select"
- @hint_text = ""
@page = page
@bottom_guidance_partial = "mortgage_lender"
@ownershipsch = ownershipsch
diff --git a/app/models/form/sales/questions/mortgage_lender_other.rb b/app/models/form/sales/questions/mortgage_lender_other.rb
index 677b1c117..49876efb0 100644
--- a/app/models/form/sales/questions/mortgage_lender_other.rb
+++ b/app/models/form/sales/questions/mortgage_lender_other.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::MortgageLenderOther < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@id = "mortgagelenderother"
- @check_answer_label = "Other Mortgage Lender"
- @header = "What is the other mortgage lender?"
+ @copy_key = "sales.sale_information.mortgagelenderother"
@type = "text"
@page = page
@ownershipsch = ownershipsch
diff --git a/app/models/form/sales/questions/mortgage_length.rb b/app/models/form/sales/questions/mortgage_length.rb
index e1bda4ea0..877818b98 100644
--- a/app/models/form/sales/questions/mortgage_length.rb
+++ b/app/models/form/sales/questions/mortgage_length.rb
@@ -2,14 +2,12 @@ class Form::Sales::Questions::MortgageLength < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@id = "mortlen"
- @check_answer_label = "Length of mortgage"
- @header = "What is the length of the mortgage?"
+ @copy_key = "sales.sale_information.mortlen"
@type = "numeric"
@min = 0
@max = 60
@step = 1
@width = 5
- @hint_text = "You should round up to the nearest year. Value should not exceed 60 years."
@ownershipsch = ownershipsch
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
end
diff --git a/app/models/form/sales/questions/mortgageused.rb b/app/models/form/sales/questions/mortgageused.rb
index 4ece2544e..341d3ff60 100644
--- a/app/models/form/sales/questions/mortgageused.rb
+++ b/app/models/form/sales/questions/mortgageused.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question
def initialize(id, hsh, subsection, ownershipsch:)
super(id, hsh, subsection)
@id = "mortgageused"
- @check_answer_label = "Mortgage used"
- @header = "Was a mortgage used for the purchase of this property?"
+ @copy_key = "sales.sale_information.mortgageused"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@ownershipsch = ownershipsch
diff --git a/app/models/form/sales/questions/previous_bedrooms.rb b/app/models/form/sales/questions/previous_bedrooms.rb
index 50970bc89..d29da208a 100644
--- a/app/models/form/sales/questions/previous_bedrooms.rb
+++ b/app/models/form/sales/questions/previous_bedrooms.rb
@@ -2,14 +2,12 @@ class Form::Sales::Questions::PreviousBedrooms < ::Form::Question
def initialize(id, hsh, page)
super
@id = "frombeds"
- @check_answer_label = "Number of bedrooms in previous property"
- @header = "How many bedrooms did the property have?"
+ @copy_key = "sales.sale_information.frombeds"
@type = "numeric"
@width = 5
@min = 1
@max = 6
@step = 1
- @hint_text = "For bedsits enter 1"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/sales/questions/previous_tenure.rb b/app/models/form/sales/questions/previous_tenure.rb
index 7227fa00e..55b103f0d 100644
--- a/app/models/form/sales/questions/previous_tenure.rb
+++ b/app/models/form/sales/questions/previous_tenure.rb
@@ -2,10 +2,8 @@ class Form::Sales::Questions::PreviousTenure < ::Form::Question
def initialize(id, hsh, page)
super
@id = "socprevten"
- @check_answer_label = "Previous property tenure"
- @header = "What was the previous tenure of the buyer?"
+ @copy_key = "sales.sale_information.socprevten"
@type = "radio"
- @hint_text = ""
@page = page
@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/purchase_price.rb b/app/models/form/sales/questions/purchase_price.rb
index 3a9bd4ee7..44497b727 100644
--- a/app/models/form/sales/questions/purchase_price.rb
+++ b/app/models/form/sales/questions/purchase_price.rb
@@ -2,14 +2,11 @@ class Form::Sales::Questions::PurchasePrice < ::Form::Question
def initialize(id, hsh, page, ownershipsch:)
super(id, hsh, page)
@id = "value"
- @check_answer_label = "Purchase price"
- @header = "What is the full purchase price?"
@type = "numeric"
@min = 0
@step = 0.01
@width = 5
@prefix = "£"
- @hint_text = hint_text
@ownership_sch = ownershipsch
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
@top_guidance_partial = top_guidance_partial
@@ -20,10 +17,13 @@ class Form::Sales::Questions::PurchasePrice < ::Form::Question
2024 => { 2 => 101, 3 => 111 },
}.freeze
- def hint_text
- return if @ownership_sch == 3 # outright sale
-
- "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount"
+ def copy_key
+ case @ownership_sch
+ when 2
+ "sales.sale_information.purchase_price.discounted_ownership"
+ when 3
+ "sales.sale_information.purchase_price.outright_sale"
+ end
end
def top_guidance_partial
diff --git a/app/models/form/sales/questions/resale.rb b/app/models/form/sales/questions/resale.rb
index be4e5535d..0026adb48 100644
--- a/app/models/form/sales/questions/resale.rb
+++ b/app/models/form/sales/questions/resale.rb
@@ -2,11 +2,9 @@ class Form::Sales::Questions::Resale < ::Form::Question
def initialize(id, hsh, page)
super
@id = "resale"
- @check_answer_label = "Is this a resale?"
- @header = "Is this a resale?"
+ @copy_key = "sales.sale_information.resale"
@type = "radio"
@answer_options = ANSWER_OPTIONS
- @hint_text = "If the social landlord has previously sold the property to another buyer and is now reselling the property, select 'yes'. If this is the first time the property has been sold, select 'no'."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/sales/questions/shared_ownership_deposit_value_check.rb b/app/models/form/sales/questions/shared_ownership_deposit_value_check.rb
index 3f8111881..e7f520b43 100644
--- a/app/models/form/sales/questions/shared_ownership_deposit_value_check.rb
+++ b/app/models/form/sales/questions/shared_ownership_deposit_value_check.rb
@@ -2,9 +2,8 @@ class Form::Sales::Questions::SharedOwnershipDepositValueCheck < ::Form::Questio
def initialize(id, hsh, page)
super
@id = "shared_ownership_deposit_value_check"
- @check_answer_label = "Shared ownership deposit confirmation"
+ @copy_key = "sales.soft_validations.shared_ownership_deposit_value_check"
@type = "interruption_screen"
- @header = "Are you sure this is correct?"
@answer_options = {
"0" => { "value" => "Yes" },
"1" => { "value" => "No" },
diff --git a/app/models/form/sales/questions/staircase.rb b/app/models/form/sales/questions/staircase.rb
index 1eb84bfb5..9fc969735 100644
--- a/app/models/form/sales/questions/staircase.rb
+++ b/app/models/form/sales/questions/staircase.rb
@@ -2,11 +2,9 @@ class Form::Sales::Questions::Staircase < ::Form::Question
def initialize(id, hsh, page)
super
@id = "staircase"
- @check_answer_label = "Staircasing transaction"
- @header = "Is this a staircasing transaction?"
+ @copy_key = "sales.sale_information.staircasing"
@type = "radio"
@answer_options = ANSWER_OPTIONS
- @hint_text = "A staircasing transaction is when the household purchases more shares in their property, increasing the proportion they own and decreasing the proportion the housing association owns. Once the household purchases 100% of the shares, they own the property"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/sales/questions/staircase_bought.rb b/app/models/form/sales/questions/staircase_bought.rb
index 0a6343db4..8a3e88347 100644
--- a/app/models/form/sales/questions/staircase_bought.rb
+++ b/app/models/form/sales/questions/staircase_bought.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::StaircaseBought < ::Form::Question
def initialize(id, hsh, page)
super
@id = "stairbought"
- @check_answer_label = "Percentage bought in this staircasing transaction"
- @header = "What percentage of the property has been bought in this staircasing transaction?"
+ @copy_key = "sales.sale_information.about_staircasing.stairbought"
@type = "numeric"
@width = 5
@min = 0
diff --git a/app/models/form/sales/questions/staircase_bought_value_check.rb b/app/models/form/sales/questions/staircase_bought_value_check.rb
index 65fe02e66..146e89dfd 100644
--- a/app/models/form/sales/questions/staircase_bought_value_check.rb
+++ b/app/models/form/sales/questions/staircase_bought_value_check.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::StaircaseBoughtValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "staircase_bought_value_check"
- @check_answer_label = "Percentage bought confirmation"
- @header = "Are you sure this is correct?"
+ @copy_key = "sales.soft_validations.staircase_bought_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },
diff --git a/app/models/form/sales/questions/staircase_owned.rb b/app/models/form/sales/questions/staircase_owned.rb
index 64614e608..dc8daaf20 100644
--- a/app/models/form/sales/questions/staircase_owned.rb
+++ b/app/models/form/sales/questions/staircase_owned.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::StaircaseOwned < ::Form::Question
def initialize(id, hsh, page, joint_purchase:)
super(id, hsh, page)
@id = "stairowned"
- @check_answer_label = I18n.t("check_answer_labels.stairowned", count: joint_purchase ? 2 : 1)
- @header = I18n.t("questions.stairowned", count: joint_purchase ? 2 : 1)
+ @copy_key = "sales.sale_information.about_staircasing.stairowned.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@type = "numeric"
@width = 5
@min = 0
diff --git a/app/models/form/sales/questions/staircase_owned_value_check.rb b/app/models/form/sales/questions/staircase_owned_value_check.rb
index eb742b196..3457d60fe 100644
--- a/app/models/form/sales/questions/staircase_owned_value_check.rb
+++ b/app/models/form/sales/questions/staircase_owned_value_check.rb
@@ -1,9 +1,8 @@
class Form::Sales::Questions::StaircaseOwnedValueCheck < ::Form::Question
- def initialize(id, hsh, page)
- super
+ def initialize(id, hsh, page, joint_purchase:)
+ super(id, hsh, page)
@id = "stairowned_value_check"
- @check_answer_label = "Percentage owned confirmation"
- @header = "Are you sure?"
+ @copy_key = "sales.soft_validations.stairowned_value_check.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },
diff --git a/app/models/form/sales/questions/staircase_sale.rb b/app/models/form/sales/questions/staircase_sale.rb
index de1c8305a..ac54084f5 100644
--- a/app/models/form/sales/questions/staircase_sale.rb
+++ b/app/models/form/sales/questions/staircase_sale.rb
@@ -2,8 +2,7 @@ class Form::Sales::Questions::StaircaseSale < ::Form::Question
def initialize(id, hsh, page)
super
@id = "staircasesale"
- @check_answer_label = "Part of a back-to-back staircasing transaction"
- @header = "Is this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?"
+ @copy_key = "sales.sale_information.about_staircasing.staircasesale"
@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/value.rb b/app/models/form/sales/questions/value.rb
index 3ec96e76e..257344fa2 100644
--- a/app/models/form/sales/questions/value.rb
+++ b/app/models/form/sales/questions/value.rb
@@ -2,14 +2,12 @@ class Form::Sales::Questions::Value < ::Form::Question
def initialize(id, hsh, page)
super
@id = "value"
- @check_answer_label = "Full purchase price"
- @header = "What was the full purchase price?"
+ @copy_key = "sales.sale_information.value"
@type = "numeric"
@min = 0
@step = 1
@width = 5
@prefix = "£"
- @hint_text = "Enter the full purchase price of the property before any discounts are applied. For shared ownership, enter the full purchase price paid for 100% equity (this is equal to the value of the share owned by the PRP plus the value bought by the purchaser)"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@top_guidance_partial = "financial_calculations_shared_ownership"
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 4ef35d19e..52e2c18e9 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -605,12 +605,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:- the decimal point
- the frequency, for example every week or every calendar month
- the rent type is correct, for example affordable or social rent
"
- staircase_owned:
- title_text:
- one: "You told us that the buyer now owns %{stairowned} of the property."
- two: "You told us that the buyers now own %{stairowned} of the property."
- hint_text: "The maximum percentage that can be owned under the Older Persons Shared Ownership scheme is 75%, unless the property was funded outside the Affordable Homes Programme.
-Make sure these answers are correct."
retirement:
min:
title: "You told us this person is aged %{age} years and retired."
@@ -618,9 +612,6 @@ Make sure these answers are correct."
max:
title: "You told us this person is over 66 and not retired."
hint_text: "The minimum expected retirement age in England is 66."
- 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."
pregnancy:
title: "You told us somebody in the household is pregnant."
all_male_tenants: "You also told us that all the tenants living at the property are male."
@@ -631,19 +622,6 @@ Make sure these answers are correct."
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:
- title_text: "You told us that %{percentage}% was bought in this staircasing transaction."
- hint_text: "Most staircasing transactions are less than 50%"
- discounted_sale_value:
- title_text: "Mortgage, deposit, and grant total must equal %{value_with_discount}."
- informative_text: "Your given mortgage, deposit and grant total is %{mortgage_deposit_and_grant_total}."
- care_home_charges:
- title_text: "Care home charges should be provided if this is a care home accommodation."
- 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."
referral:
title_text: "Are you sure?"
hint_text: "This is a general needs log, and this referral type is for supported housing."
@@ -656,16 +634,11 @@ Make sure these answers are correct."
charges:
informative_text: "This is higher than we would expect."
hint_text: "Check the following:- the decimal point
- the frequency, for example every week or every calendar month
- the needs type
"
- deposit_and_mortgage:
- 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."
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:
- 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:
must_be_less_than_3_years_from_hodate: "You told us sale completion date is more than 3 years after practical completion or handover date."
partner_under_16_lettings:
@@ -703,12 +676,6 @@ Make sure these answers are correct."
W: "Suitable for someone who uses a wheelchair and offers the full use of all rooms and facilities."
A: "Fitted with stairlifts, ramps, level access showers or grab rails."
N: "Not designed to wheelchair-user standards or fitted with any equipment or adaptations."
- soctenant:
- one: "Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?"
- other: "Were any of the buyers private registered providers, housing association or local authority tenants immediately before this sale?"
- stairowned:
- one: "What percentage of the property does the buyer now own in total?"
- other: "What percentage of the property do the buyers now own in total?"
hints:
location:
@@ -722,14 +689,6 @@ Make sure these answers are correct."
bulk_upload:
needstype: "General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing can include direct access hostels, group homes, residential care and nursing homes."
- check_answer_labels:
- soctenant:
- one: "Buyer was a registered provider, housing association or local authority tenant immediately before this sale?"
- other: "Any buyers were registered providers, housing association or local authority tenants immediately before this sale?"
- stairowned:
- one: "Percentage the buyer now owns in total."
- other: "Percentage the buyers now own in total."
-
warnings:
organisation:
deactivate: "All schemes and users at this organisation will be deactivated. All the organisation's relationships will be removed. It will no longer be possible to create logs for this organisation."
diff --git a/config/locales/forms/2023/sales/sale_information.en.yml b/config/locales/forms/2023/sales/sale_information.en.yml
new file mode 100644
index 000000000..318d7c7db
--- /dev/null
+++ b/config/locales/forms/2023/sales/sale_information.en.yml
@@ -0,0 +1,208 @@
+en:
+ forms:
+ 2023:
+ sales:
+ sale_information:
+ living_before_purchase:
+ joint_purchase:
+ page_header: ""
+ proplen:
+ check_answer_label: "Number of years living in the property before purchase"
+ hint_text: "You should round up to the nearest year"
+ question_text: "How long did they live there?"
+ proplen_asked:
+ check_answer_label: "Buyers lived in the property before purchasing"
+ hint_text: ""
+ question_text: "Did the buyers live in the property before purchasing it?"
+ not_joint_purchase:
+ page_header: ""
+ proplen:
+ check_answer_label: "Number of years living in the property before purchase"
+ hint_text: "You should round up to the nearest year"
+ question_text: "How long did they live there?"
+ proplen_asked:
+ check_answer_label: "Buyer lived in the property before purchasing"
+ hint_text: ""
+ question_text: "Did the buyer live in the property before purchasing it?"
+
+ staircasing:
+ page_header: ""
+ check_answer_label: "Staircasing transaction"
+ hint_text: "A staircasing transaction is when the household purchases more shares in their property, increasing the proportion they own and decreasing the proportion the housing association owns. Once the household purchases 100% of the shares, they own the property"
+ question_text: "Is this a staircasing transaction?"
+ about_staircasing:
+ page_header: "About the staircasing transaction"
+ stairbought:
+ check_answer_label: "Percentage bought in this staircasing transaction"
+ hint_text: ""
+ question_text: "What percentage of the property has been bought in this staircasing transaction?"
+ stairowned:
+ joint_purchase:
+ check_answer_label: "Percentage the buyers now own in total"
+ hint_text: ""
+ question_text: "What percentage of the property do the buyers now own in total?"
+ not_joint_purchase:
+ check_answer_label: "Percentage the buyer now owns in total"
+ hint_text: ""
+ question_text: "What percentage of the property does the buyer now own in total?"
+
+ resale:
+ page_header: ""
+ check_answer_label: "Is this a resale?"
+ hint_text: "If the social landlord has previously sold the property to another buyer and is now reselling the property, select 'yes'. If this is the first time the property has been sold, select 'no'."
+ question_text: "Is this a resale?"
+
+ exchange_date:
+ page_header: ""
+ check_answer_label: "Exchange of contracts date"
+ hint_text: ""
+ question_text: "What is the exchange of contracts date?"
+
+ handover_date:
+ page_header: ""
+ check_answer_label: "Practical completion or handover date"
+ hint_text: "This is the date on which the building contractor hands over responsibility for the completed property to the private registered provider (PRP)"
+ question_text: "What is the practical completion or handover date?"
+
+ la_nominations:
+ page_header: ""
+ check_answer_label: "Household rehoused under a local authority nominations agreement?"
+ hint_text: "A local authority nominations agreement is a written agreement between a local authority and private registered provider (PRP) that some or all of its sales vacancies are offered to local authorities for rehousing"
+ question_text: "Was the household rehoused under a 'local authority nominations agreement'?"
+
+ soctenant:
+ joint_purchase:
+ page_header: ""
+ check_answer_label: "Any buyers were registered providers, housing association or local authority tenants immediately before this sale?"
+ hint_text: ""
+ question_text: "Were any of the buyers private registered providers, housing association or local authority tenants immediately before this sale?"
+ not_joint_purchase:
+ page_header: ""
+ check_answer_label: "Buyer was a registered provider, housing association or local authority tenant immediately before this sale?"
+ hint_text: ""
+ question_text: "Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?"
+
+ frombeds:
+ page_header: "About the buyers’ previous property"
+ check_answer_label: "Number of bedrooms in previous property"
+ hint_text: "For bedsits enter 1"
+ question_text: "How many bedrooms did the property have?"
+
+ fromprop:
+ page_header: ""
+ check_answer_label: "Previous property type"
+ hint_text: ""
+ question_text: "What was the previous property type?"
+
+ socprevten:
+ page_header: ""
+ check_answer_label: "Previous property tenure"
+ hint_text: ""
+ question_text: "What was the previous tenure of the buyer?"
+
+ value:
+ page_header: "About the price of the property"
+ check_answer_label: "Full purchase price"
+ hint_text: "Enter the full purchase price of the property before any discounts are applied. For shared ownership, enter the full purchase price paid for 100% equity (this is equal to the value of the share owned by the PRP plus the value bought by the purchaser)"
+ question_text: "What was the full purchase price?"
+
+ equity:
+ page_header: "About the price of the property"
+ check_answer_label: "Initial percentage equity stake"
+ hint_text: "Enter the amount of initial equity held by the purchaser (for example, 25% or 50%)"
+ question_text: "What was the initial percentage equity stake purchased?"
+
+ mortgageused:
+ page_header: "Mortgage Amount"
+ check_answer_label: "Mortgage used"
+ hint_text: ""
+ question_text: "Was a mortgage used for the purchase of this property?"
+
+ mortgage:
+ page_header: "Mortgage Amount"
+ check_answer_label: "Mortgage amount"
+ hint_text: "Enter the amount of mortgage agreed with the mortgage lender. Exclude any deposits or cash payments. Numeric in pounds. Rounded to the nearest pound."
+ question_text: "What is the mortgage amount?"
+
+ mortgagelender:
+ page_header: ""
+ check_answer_label: "Mortgage lender"
+ hint_text: ""
+ question_text: "What is the name of the mortgage lender?"
+
+ mortgagelenderother:
+ page_header: ""
+ check_answer_label: "Other Mortgage Lender"
+ hint_text: ""
+ question_text: "What is the other mortgage lender?"
+
+ mortlen:
+ page_header: ""
+ check_answer_label: "Length of mortgage"
+ hint_text: "You should round up to the nearest year. Value should not exceed 60 years."
+ question_text: "What is the length of the mortgage?"
+
+ extrabor:
+ page_header: ""
+ check_answer_label: "Any other borrowing?"
+ hint_text: ""
+ question_text: "Does this include any extra borrowing?"
+
+ deposit:
+ page_header: "About the deposit"
+ check_answer_label: "Deposit amount"
+ hint_text: "Enter the total cash sum paid by the buyer towards the property that was not funded by the mortgage. This excludes any grant or loan"
+ question_text: "How much cash deposit was paid on the property?"
+
+ cashdis:
+ page_header: "About the deposit"
+ check_answer_label: "Cash discount through SocialHomeBuy"
+ hint_text: "Enter the total cash discount given on the property being purchased through the Social HomeBuy scheme"
+ question_text: "How much cash discount was given through Social HomeBuy?"
+
+ mrent:
+ page_header: ""
+ check_answer_label: "Monthly rent"
+ hint_text: "Amount paid before any charges"
+ question_text: "What is the basic monthly rent?"
+
+ leaseholdcharges:
+ page_header: ""
+ has_mscharge:
+ check_answer_label: "Does the property have any monthly leasehold charges?"
+ hint_text: "For example, service and management charges"
+ question_text: "Does the property have any monthly leasehold charges?"
+ mscharge:
+ check_answer_label: "Monthly leasehold charges"
+ hint_text: ""
+ question_text: "Enter the total monthly charge"
+
+ purchase_price:
+ shared_ownership:
+ page_header: "About the price of the property"
+ check_answer_label: "Purchase price"
+ hint_text: "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount"
+ question_text: "What is the full purchase price?"
+ discounted_ownership:
+ page_header: "About the price of the property"
+ check_answer_label: "Purchase price"
+ hint_text: "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount"
+ question_text: "What is the full purchase price?"
+ outright_sale:
+ page_header: "About the price of the property"
+ check_answer_label: "Purchase price"
+ hint_text: ""
+ question_text: "What is the full purchase price?"
+
+ discount:
+ page_header: "About the price of the property"
+ check_answer_label: "Percentage discount"
+ hint_text: "For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)If discount capped, enter capped %If the property is being sold to an existing tenant under the RTB, PRTB, or VRTB schemes, enter the % discount from the full market value that is being given."
+ question_text: "What was the percentage discount?"
+
+ grant:
+ page_header: "About the price of the property"
+ check_answer_label: "Amount of any loan, grant or subsidy"
+ hint_text: "For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy"
+ question_text: "What was the amount of any loan, grant, discount or subsidy given?"
+
\ No newline at end of file
diff --git a/config/locales/forms/2023/sales/soft_validations.en.yml b/config/locales/forms/2023/sales/soft_validations.en.yml
index 1c3cd4955..20f131e90 100644
--- a/config/locales/forms/2023/sales/soft_validations.en.yml
+++ b/config/locales/forms/2023/sales/soft_validations.en.yml
@@ -40,7 +40,7 @@ en:
max:
page_header: ""
title_text: "You told us the income of buyer 1 is %{income}. This seems high. Are you sure this is correct?"
-
+
income2_value_check:
check_answer_label: "Buyer 2 income confirmation"
hint_text: ""
@@ -60,14 +60,6 @@ en:
question_text: "Are you sure this is correct?"
title_text: "You told us the combined income of this household is %{combined_income}. This seems high. Are you sure this is correct?"
- value_value_check:
- page_header: ""
- check_answer_label: "Purchase price confirmation"
- hint_text: ""
- question_text: "Are you sure?"
- title_text: "You told us the purchase price is %{value}."
- informative_text: "This is %{higher_or_lower} than we would expect."
-
mortgage_value_check:
page_header: ""
check_answer_label: "Mortgage confirmation"
@@ -76,22 +68,6 @@ en:
title_text: "You told us that the mortgage amount is %{mortgage}."
informative_text: "This is more than 5 times the income, which is higher than we would expect."
- monthly_charges_value_check:
- page_header: ""
- check_answer_label: "Monthly charges confirmation"
- hint_text: ""
- question_text: "Are you sure this is correct?"
- title_text: "You told us that the monthly charges were %{mscharge}."
- informative_text: "This is higher than we would expect."
-
- percentage_discount_value_check:
- page_header: ""
- check_answer_label: "Percentage discount confirmation"
- hint_text: ""
- question_text: "Are you sure this is correct?"
- title_text: "You told us that the percentage discount is %{discount}."
- informative_text: "This is higher than we would expect."
-
savings_value_check:
page_header: ""
check_answer_label: "Savings confirmation"
@@ -104,15 +80,65 @@ en:
title_text: "You told us the buyer’s savings were %{savings}."
informative_text: "This is higher than we would expect."
- deposit_value_check:
+ staircase_bought_value_check:
page_header: ""
- check_answer_label: "Deposit confirmation"
+ check_answer_label: "Percentage bought confirmation"
hint_text: ""
- question_text: "Are you sure that the deposit is this much higher than the buyer's savings?"
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us that %{percentage}% was bought in this staircasing transaction."
+ informative_text: "Most staircasing transactions are less than 50%"
+
+ stairowned_value_check:
joint_purchase:
+ page_header: ""
+ check_answer_label: "Percentage owned confirmation"
+ hint_text: ""
+ question_text: "Are you sure?"
+ title_text: "You told us that the buyers now own %{stairowned} of the property."
+ informative_text: "The maximum percentage that can be owned under the Older Persons Shared Ownership scheme is 75%, unless the property was funded outside the Affordable Homes Programme. Make sure these answers are correct."
+ not_joint_purchase:
+ page_header: ""
+ check_answer_label: "Percentage owned confirmation"
+ hint_text: ""
+ question_text: "Are you sure?"
+ title_text: "You told us that the buyer now owns %{stairowned} of the property."
+ informative_text: "The maximum percentage that can be owned under the Older Persons Shared Ownership scheme is 75%, unless the property was funded outside the Affordable Homes Programme. Make sure these answers are correct."
+
+ hodate_check:
+ page_header: ""
+ check_answer_label: "Practical completion or handover date check"
+ hint_text: ""
+ question_text: "Are you sure?"
+ title_text: "You told us practical completion or handover date is more than 3 years before sale completion date."
+
+ value_value_check:
+ page_header: ""
+ check_answer_label: "Purchase price confirmation"
+ hint_text: ""
+ question_text: "Are you sure?"
+ title_text: "You told us the purchase price is %{value}."
+ informative_text: "This is %{higher_or_lower} than we would expect."
+
+ shared_ownership_deposit_value_check:
+ page_header: ""
+ check_answer_label: "Shared ownership deposit confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us that the %{mortgage_deposit_and_discount_error_fields} add up to %{mortgage_deposit_and_discount_total}."
+
+ deposit_value_check:
+ joint_purchase:
+ page_header: ""
+ check_answer_label: "Deposit confirmation"
+ hint_text: ""
+ question_text: "Are you sure that the deposit is this much higher than the buyer's savings?"
title_text: "You told us the buyers’ deposit was %{deposit} and their savings were %{savings}."
informative_text: "The deposit amount is higher than we would expect for the amount of savings they have."
not_joint_purchase:
+ page_header: ""
+ check_answer_label: "Deposit confirmation"
+ hint_text: ""
+ question_text: "Are you sure that the deposit is this much higher than the buyer's savings?"
title_text: "You told us the buyer’s deposit was %{deposit} and their savings were %{savings}."
informative_text: "The deposit amount is higher than we would expect for the amount of savings they have."
@@ -162,3 +188,51 @@ en:
question_text: "Are you sure this is correct?"
title_text: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1."
informative_text: "Are you sure this is correct?"
+
+ monthly_charges_value_check:
+ page_header: ""
+ check_answer_label: "Monthly charges confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us that the monthly charges were %{mscharge}."
+ informative_text: "This is higher than we would expect."
+
+ extra_borrowing_value_check:
+ page_header: ""
+ check_answer_label: "Extra borrowing confirmation"
+ hint_text: ""
+ question_text: "Are you sure there is no extra borrowing?"
+ title_text: "You told us that the mortgage and deposit total is %{mortgage_and_deposit_total}."
+ informative_text: "This is higher than the purchase price minus the discount."
+
+ percentage_discount_value_check:
+ page_header: ""
+ check_answer_label: "Percentage discount confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us that the percentage discount is %{discount}."
+ informative_text: "This is higher than we would expect."
+
+ grant_value_check:
+ page_header: ""
+ check_answer_label: "Grant value confirmation"
+ hint_text: ""
+ question_text: "Are you sure? Grants are usually £9,000 - £16,000"
+ title_text: "You told us that the grant amount is %{grant}."
+ informative_text: "Loans, grants and subsidies are usually between £9,000 and £16,000."
+
+ discounted_sale_value_check:
+ page_header: ""
+ check_answer_label: "Discounted sale value confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "Mortgage, deposit, and grant total must equal %{value_with_discount}."
+ informative_text: "Your given mortgage, deposit and grant total is %{mortgage_deposit_and_grant_total}."
+
+ deposit_and_mortgage_value_check:
+ page_header: ""
+ check_answer_label: "Deposit and mortgage against discount confirmation"
+ hint_text: ""
+ question_text: "Are you sure? Mortgage and deposit usually equal or are more than (value - discount)"
+ title_text: "You told us the mortgage amount was %{mortgage}, the cash deposit was %{deposit} and the discount was %{discount}."
+ informative_text: "We would expect the mortgage amount and the deposit added together to be the same as the purchase price minus the discount."
diff --git a/config/locales/forms/2024/sales/sale_information.en.yml b/config/locales/forms/2024/sales/sale_information.en.yml
new file mode 100644
index 000000000..d0031416e
--- /dev/null
+++ b/config/locales/forms/2024/sales/sale_information.en.yml
@@ -0,0 +1,207 @@
+en:
+ forms:
+ 2024:
+ sales:
+ sale_information:
+ living_before_purchase:
+ joint_purchase:
+ page_header: ""
+ proplen:
+ check_answer_label: "Number of years living in the property before purchase"
+ hint_text: "You should round up to the nearest year"
+ question_text: "How long did they live there?"
+ proplen_asked:
+ check_answer_label: "Buyers lived in the property before purchasing"
+ hint_text: ""
+ question_text: "Did the buyers live in the property before purchasing it?"
+ not_joint_purchase:
+ page_header: ""
+ proplen:
+ check_answer_label: "Number of years living in the property before purchase"
+ hint_text: "You should round up to the nearest year"
+ question_text: "How long did they live there?"
+ proplen_asked:
+ check_answer_label: "Buyer lived in the property before purchasing"
+ hint_text: ""
+ question_text: "Did the buyer live in the property before purchasing it?"
+
+ staircasing:
+ page_header: ""
+ check_answer_label: "Staircasing transaction"
+ hint_text: "A staircasing transaction is when the household purchases more shares in their property, increasing the proportion they own and decreasing the proportion the housing association owns. Once the household purchases 100% of the shares, they own the property"
+ question_text: "Is this a staircasing transaction?"
+ about_staircasing:
+ page_header: "About the staircasing transaction"
+ stairbought:
+ check_answer_label: "Percentage bought in this staircasing transaction"
+ hint_text: ""
+ question_text: "What percentage of the property has been bought in this staircasing transaction?"
+ stairowned:
+ joint_purchase:
+ check_answer_label: "Percentage the buyers now own in total"
+ hint_text: ""
+ question_text: "What percentage of the property do the buyers now own in total?"
+ not_joint_purchase:
+ check_answer_label: "Percentage the buyer now owns in total"
+ hint_text: ""
+ question_text: "What percentage of the property does the buyer now own in total?"
+ staircasesale:
+ check_answer_label: "Part of a back-to-back staircasing transaction"
+ hint_text: ""
+ question_text: "Is this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?"
+
+ resale:
+ page_header: ""
+ check_answer_label: "Is this a resale?"
+ hint_text: "If the social landlord has previously sold the property to another buyer and is now reselling the property, select 'yes'. If this is the first time the property has been sold, select 'no'."
+ question_text: "Is this a resale?"
+
+ exchange_date:
+ page_header: ""
+ check_answer_label: "Exchange of contracts date"
+ hint_text: ""
+ question_text: "What is the exchange of contracts date?"
+
+ handover_date:
+ page_header: ""
+ check_answer_label: "Practical completion or handover date"
+ hint_text: "This is the date on which the building contractor hands over responsibility for the completed property to the private registered provider (PRP)"
+ question_text: "What is the practical completion or handover date?"
+
+ la_nominations:
+ page_header: ""
+ check_answer_label: "Household rehoused under a local authority nominations agreement?"
+ hint_text: "A local authority nominations agreement is a written agreement between a local authority and private registered provider (PRP) that some or all of its sales vacancies are offered to local authorities for rehousing"
+ question_text: "Was the household rehoused under a 'local authority nominations agreement'?"
+
+ soctenant:
+ joint_purchase:
+ page_header: ""
+ check_answer_label: "Any buyers were registered providers, housing association or local authority tenants immediately before this sale?"
+ hint_text: ""
+ question_text: "Were any of the buyers private registered providers, housing association or local authority tenants immediately before this sale?"
+ not_joint_purchase:
+ page_header: ""
+ check_answer_label: "Buyer was a registered provider, housing association or local authority tenant immediately before this sale?"
+ hint_text: ""
+ question_text: "Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?"
+
+ frombeds:
+ page_header: "About the buyers’ previous property"
+ check_answer_label: "Number of bedrooms in previous property"
+ hint_text: "For bedsits enter 1"
+ question_text: "How many bedrooms did the property have?"
+
+ fromprop:
+ page_header: ""
+ check_answer_label: "Previous property type"
+ hint_text: ""
+ question_text: "What was the previous property type?"
+
+ socprevten:
+ page_header: ""
+ check_answer_label: "Previous property tenure"
+ hint_text: ""
+ question_text: "What was the previous tenure of the buyer?"
+
+ value:
+ page_header: "About the price of the property"
+ check_answer_label: "Full purchase price"
+ hint_text: "Enter the full purchase price of the property before any discounts are applied. For shared ownership, enter the full purchase price paid for 100% equity (this is equal to the value of the share owned by the PRP plus the value bought by the purchaser)"
+ question_text: "What was the full purchase price?"
+
+ equity:
+ page_header: "About the price of the property"
+ check_answer_label: "Initial percentage equity stake"
+ hint_text: "Enter the amount of initial equity held by the purchaser (for example, 25% or 50%)"
+ question_text: "What was the initial percentage equity stake purchased?"
+
+ mortgageused:
+ page_header: "Mortgage Amount"
+ check_answer_label: "Mortgage used"
+ hint_text: ""
+ question_text: "Was a mortgage used for the purchase of this property?"
+
+ mortgage:
+ page_header: "Mortgage Amount"
+ check_answer_label: "Mortgage amount"
+ hint_text: "Enter the amount of mortgage agreed with the mortgage lender. Exclude any deposits or cash payments. Numeric in pounds. Rounded to the nearest pound."
+ question_text: "What is the mortgage amount?"
+
+ mortgagelender:
+ page_header: ""
+ check_answer_label: "Mortgage lender"
+ hint_text: ""
+ question_text: "What is the name of the mortgage lender?"
+
+ mortgagelenderother:
+ page_header: ""
+ check_answer_label: "Other Mortgage Lender"
+ hint_text: ""
+ question_text: "What is the other mortgage lender?"
+
+ mortlen:
+ page_header: ""
+ check_answer_label: "Length of mortgage"
+ hint_text: "You should round up to the nearest year. Value should not exceed 60 years."
+ question_text: "What is the length of the mortgage?"
+
+ extrabor:
+ page_header: ""
+ check_answer_label: "Any other borrowing?"
+ hint_text: ""
+ question_text: "Does this include any extra borrowing?"
+
+ deposit:
+ page_header: "About the deposit"
+ check_answer_label: "Deposit amount"
+ hint_text: "Enter the total cash sum paid by the buyer towards the property that was not funded by the mortgage. This excludes any grant or loan. As this is a fully staircased sale this question is optional. If you do not have the information available click save and continue"
+ question_text: "How much cash deposit was paid on the property?"
+
+ cashdis:
+ page_header: "About the deposit"
+ check_answer_label: "Cash discount through SocialHomeBuy"
+ hint_text: "Enter the total cash discount given on the property being purchased through the Social HomeBuy scheme"
+ question_text: "How much cash discount was given through Social HomeBuy?"
+
+ mrent:
+ page_header: ""
+ check_answer_label: "Monthly rent"
+ hint_text: "Amount paid before any charges"
+ question_text: "What is the basic monthly rent?"
+
+ leaseholdcharges:
+ page_header: ""
+ has_mscharge:
+ check_answer_label: "Does the property have any monthly leasehold charges?"
+ hint_text: "For example, service and management charges"
+ question_text: "Does the property have any monthly leasehold charges?"
+ mscharge:
+ check_answer_label: "Monthly leasehold charges"
+ hint_text: ""
+ question_text: "Enter the total monthly charge"
+
+ purchase_price:
+ discounted_ownership:
+ page_header: "About the price of the property"
+ check_answer_label: "Purchase price"
+ hint_text: "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount"
+ question_text: "What is the full purchase price?"
+ outright_sale:
+ page_header: "About the price of the property"
+ check_answer_label: "Purchase price"
+ hint_text: ""
+ question_text: "What is the full purchase price?"
+
+ discount:
+ page_header: "About the price of the property"
+ check_answer_label: "Percentage discount"
+ hint_text: "For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)If discount capped, enter capped %If the property is being sold to an existing tenant under the RTB, PRTB, or VRTB schemes, enter the % discount from the full market value that is being given."
+ question_text: "What was the percentage discount?"
+
+ grant:
+ page_header: "About the price of the property"
+ check_answer_label: "Amount of any loan, grant or subsidy"
+ hint_text: "For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy"
+ question_text: "What was the amount of any loan, grant, discount or subsidy given?"
+
\ No newline at end of file
diff --git a/config/locales/forms/2024/sales/soft_validations.en.yml b/config/locales/forms/2024/sales/soft_validations.en.yml
index 872db4679..b9b1ad479 100644
--- a/config/locales/forms/2024/sales/soft_validations.en.yml
+++ b/config/locales/forms/2024/sales/soft_validations.en.yml
@@ -57,15 +57,6 @@ en:
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us the combined income of this household is %{combined_income}. This seems high. Are you sure this is correct?"
- informative_text: ""
-
- value_value_check:
- page_header: ""
- check_answer_label: "Purchase price confirmation"
- hint_text: ""
- question_text: "Are you sure?"
- title_text: "You told us the purchase price is %{value}."
- informative_text: "This is %{higher_or_lower} than we would expect."
mortgage_value_check:
page_header: ""
@@ -75,22 +66,6 @@ en:
title_text: "You told us that the mortgage amount is %{mortgage}."
informative_text: "This is more than 5 times the income, which is higher than we would expect."
- monthly_charges_value_check:
- page_header: ""
- check_answer_label: "Monthly charges confirmation"
- hint_text: ""
- question_text: "Are you sure this is correct?"
- title_text: "You told us that the monthly charges were %{mscharge}."
- informative_text: "This is higher than we would expect."
-
- percentage_discount_value_check:
- page_header: ""
- check_answer_label: "Percentage discount confirmation"
- hint_text: ""
- question_text: "Are you sure this is correct?"
- title_text: "You told us that the percentage discount is %{discount}."
- informative_text: "This is higher than we would expect."
-
savings_value_check:
page_header: ""
check_answer_label: "Savings confirmation"
@@ -103,15 +78,65 @@ en:
title_text: "You told us the buyer’s savings were %{savings}."
informative_text: "This is higher than we would expect."
- deposit_value_check:
+ staircase_bought_value_check:
page_header: ""
- check_answer_label: "Deposit confirmation"
+ check_answer_label: "Percentage bought confirmation"
hint_text: ""
- question_text: "Are you sure that the deposit is this much higher than the buyer's savings?"
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us that %{percentage}% was bought in this staircasing transaction."
+ informative_text: "Most staircasing transactions are less than 50%"
+
+ stairowned_value_check:
joint_purchase:
+ page_header: ""
+ check_answer_label: "Percentage owned confirmation"
+ hint_text: ""
+ question_text: "Are you sure?"
+ title_text: "You told us that the buyers now own %{stairowned} of the property."
+ informative_text: "The maximum percentage that can be owned under the Older Persons Shared Ownership scheme is 75%, unless the property was funded outside the Affordable Homes Programme. Make sure these answers are correct."
+ not_joint_purchase:
+ page_header: ""
+ check_answer_label: "Percentage owned confirmation"
+ hint_text: ""
+ question_text: "Are you sure?"
+ title_text: "You told us that the buyer now owns %{stairowned} of the property."
+ informative_text: "The maximum percentage that can be owned under the Older Persons Shared Ownership scheme is 75%, unless the property was funded outside the Affordable Homes Programme. Make sure these answers are correct."
+
+ hodate_check:
+ page_header: ""
+ check_answer_label: "Practical completion or handover date check"
+ hint_text: ""
+ question_text: "Are you sure?"
+ title_text: "You told us practical completion or handover date is more than 3 years before sale completion date."
+
+ value_value_check:
+ page_header: ""
+ check_answer_label: "Purchase price confirmation"
+ hint_text: ""
+ question_text: "Are you sure?"
+ title_text: "You told us the purchase price is %{value}."
+ informative_text: "This is %{higher_or_lower} than we would expect."
+
+ shared_ownership_deposit_value_check:
+ page_header: ""
+ check_answer_label: "Shared ownership deposit confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us that the %{mortgage_deposit_and_discount_error_fields} add up to %{mortgage_deposit_and_discount_total}."
+
+ deposit_value_check:
+ joint_purchase:
+ page_header: ""
+ check_answer_label: "Deposit confirmation"
+ hint_text: ""
+ question_text: "Are you sure that the deposit is this much higher than the buyer's savings?"
title_text: "You told us the buyers’ deposit was %{deposit} and their savings were %{savings}."
informative_text: "The deposit amount is higher than we would expect for the amount of savings they have."
not_joint_purchase:
+ page_header: ""
+ check_answer_label: "Deposit confirmation"
+ hint_text: ""
+ question_text: "Are you sure that the deposit is this much higher than the buyer's savings?"
title_text: "You told us the buyer’s deposit was %{deposit} and their savings were %{savings}."
informative_text: "The deposit amount is higher than we would expect for the amount of savings they have."
@@ -129,6 +154,7 @@ en:
hint_text: ""
question_text: "You told us that someone in the household uses a wheelchair."
title_text: "You told us that someone in the household uses a wheelchair."
+
buyer_livein_value_check:
buyer1:
page_header: ""
@@ -144,6 +170,7 @@ en:
question_text: "Are you sure this is correct?"
title_text: "You told us that buyer 2 will not live in the property."
informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property."
+
student_not_child_value_check:
page_header: ""
check_answer_label: "Student not a child confirmation"
@@ -151,6 +178,7 @@ en:
question_text: "Are you sure this person is not a child?"
title_text: "You told us this person is a student aged between 16 and 19."
informative_text: "Are you sure this person is not a child?"
+
partner_under_16_value_check:
page_header: ""
check_answer_label: "Partner under 16 confirmation"
@@ -158,6 +186,7 @@ en:
question_text: "Are you sure this is correct?"
title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to buyer 1."
informative_text: "Are you sure this is correct?"
+
multiple_partners_value_check:
page_header: ""
check_answer_label: "Multiple partners confirmation"
@@ -165,3 +194,51 @@ en:
question_text: "Are you sure this is correct?"
title_text: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1."
informative_text: "Are you sure this is correct?"
+
+ monthly_charges_value_check:
+ page_header: ""
+ check_answer_label: "Monthly charges confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us that the monthly charges were %{mscharge}."
+ informative_text: "This is higher than we would expect."
+
+ extra_borrowing_value_check:
+ page_header: ""
+ check_answer_label: "Extra borrowing confirmation"
+ hint_text: ""
+ question_text: "Are you sure there is no extra borrowing?"
+ title_text: "You told us that the mortgage and deposit total is %{mortgage_and_deposit_total}."
+ informative_text: "This is higher than the purchase price minus the discount."
+
+ percentage_discount_value_check:
+ page_header: ""
+ check_answer_label: "Percentage discount confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "You told us that the percentage discount is %{discount}."
+ informative_text: "This is higher than we would expect."
+
+ grant_value_check:
+ page_header: ""
+ check_answer_label: "Grant value confirmation"
+ hint_text: ""
+ question_text: "Are you sure? Grants are usually £9,000 - £16,000"
+ title_text: "You told us that the grant amount is %{grant}."
+ informative_text: "Loans, grants and subsidies are usually between £9,000 and £16,000."
+
+ discounted_sale_value_check:
+ page_header: ""
+ check_answer_label: "Discounted sale value confirmation"
+ hint_text: ""
+ question_text: "Are you sure this is correct?"
+ title_text: "Mortgage, deposit, and grant total must equal %{value_with_discount}."
+ informative_text: "Your given mortgage, deposit and grant total is %{mortgage_deposit_and_grant_total}."
+
+ deposit_and_mortgage_value_check:
+ page_header: ""
+ check_answer_label: "Deposit and mortgage against discount confirmation"
+ hint_text: ""
+ question_text: "Are you sure? Mortgage and deposit usually equal or are more than (value - discount)"
+ title_text: "You told us the mortgage amount was %{mortgage}, the cash deposit was %{deposit} and the discount was %{discount}."
+ informative_text: "We would expect the mortgage amount and the deposit added together to be the same as the purchase price minus the discount."
diff --git a/spec/models/form/lettings/subsections/tenancy_information_spec.rb b/spec/models/form/lettings/subsections/tenancy_information_spec.rb
index 96770ea78..0c69f89ab 100644
--- a/spec/models/form/lettings/subsections/tenancy_information_spec.rb
+++ b/spec/models/form/lettings/subsections/tenancy_information_spec.rb
@@ -12,7 +12,7 @@ RSpec.describe Form::Lettings::Subsections::TenancyInformation, type: :model do
end
describe "pages" do
- let(:section) { instance_double(Form::Sales::Sections::Household, form:) }
+ let(:section) { instance_double(Form::Lettings::Sections::TenancyAndProperty, form:) }
let(:form) { instance_double(Form, start_date:) }
before do
diff --git a/spec/models/form/sales/pages/discounted_sale_value_check_spec.rb b/spec/models/form/sales/pages/discounted_sale_value_check_spec.rb
index 38a5f69ae..3b51ec744 100644
--- a/spec/models/form/sales/pages/discounted_sale_value_check_spec.rb
+++ b/spec/models/form/sales/pages/discounted_sale_value_check_spec.rb
@@ -6,7 +6,8 @@ RSpec.describe Form::Sales::Pages::DiscountedSaleValueCheck, type: :model do
let(:page_id) { "discounted_sale_value_check" }
let(:page_definition) { nil }
let(:index) { 1 }
- let(:subsection) { instance_double(Form::Subsection) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
+ let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
@@ -22,14 +23,14 @@ RSpec.describe Form::Sales::Pages::DiscountedSaleValueCheck, type: :model do
it "has the correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.discounted_sale_value.title_text",
+ "translation" => "forms.2024.sales.soft_validations.discounted_sale_value_check.title_text",
"arguments" => [{ "arguments_for_key" => "value_with_discount", "i18n_template" => "value_with_discount", "key" => "field_formatted_as_currency" }],
})
end
it "has the correct informative_text" do
expect(page.informative_text).to eq({
- "translation" => "soft_validations.discounted_sale_value.informative_text",
+ "translation" => "forms.2024.sales.soft_validations.discounted_sale_value_check.informative_text",
"arguments" => [{ "arguments_for_key" => "mortgage_deposit_and_grant_total", "i18n_template" => "mortgage_deposit_and_grant_total", "key" => "field_formatted_as_currency" }],
})
end
diff --git a/spec/models/form/sales/pages/handover_date_check_spec.rb b/spec/models/form/sales/pages/handover_date_check_spec.rb
index f245675d5..ae465da16 100644
--- a/spec/models/form/sales/pages/handover_date_check_spec.rb
+++ b/spec/models/form/sales/pages/handover_date_check_spec.rb
@@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::HandoverDateCheck, type: :model do
let(:page_id) { "" }
let(:page_definition) { nil }
- let(:subsection) { instance_double(Form::Subsection) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
+ let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
@@ -21,7 +22,7 @@ RSpec.describe Form::Sales::Pages::HandoverDateCheck, type: :model do
it "has the correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.hodate.must_be_less_than_3_years_from_saledate",
+ "translation" => "forms.2024.sales.soft_validations.hodate_check.title_text",
"arguments" => [],
})
end
diff --git a/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb b/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb
index 3a1c22f24..bca971fe5 100644
--- a/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb
+++ b/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb
@@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::SharedOwnershipDepositValueCheck, type: :mode
let(:page_id) { "shared_ownership_deposit_value_check" }
let(:page_definition) { nil }
- let(:subsection) { instance_double(Form::Subsection) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
+ let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
@@ -29,7 +30,7 @@ RSpec.describe Form::Sales::Pages::SharedOwnershipDepositValueCheck, type: :mode
it "has the correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.shared_ownership_deposit.title_text",
+ "translation" => "forms.2024.sales.soft_validations.shared_ownership_deposit_value_check.title_text",
"arguments" => [
{ "i18n_template" => "mortgage_deposit_and_discount_error_fields", "key" => "mortgage_deposit_and_discount_error_fields" },
{ "arguments_for_key" => "mortgage_deposit_and_discount_total", "i18n_template" => "mortgage_deposit_and_discount_total", "key" => "field_formatted_as_currency" },
@@ -37,10 +38,6 @@ RSpec.describe Form::Sales::Pages::SharedOwnershipDepositValueCheck, type: :mode
})
end
- it "has the correct informative_text" do
- expect(page.informative_text).to eq({})
- end
-
it "has the correct interruption_screen_question_ids" do
expect(page.interruption_screen_question_ids).to eq(%w[mortgage mortgageused cashdis type deposit value equity])
end
diff --git a/spec/models/form/sales/pages/staircase_owned_value_check_spec.rb b/spec/models/form/sales/pages/staircase_owned_value_check_spec.rb
index 95e59ea4e..5fa65fd8d 100644
--- a/spec/models/form/sales/pages/staircase_owned_value_check_spec.rb
+++ b/spec/models/form/sales/pages/staircase_owned_value_check_spec.rb
@@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::StaircaseOwnedValueCheck, type: :model do
let(:page_id) { "an_id" }
let(:page_definition) { nil }
- let(:subsection) { instance_double(Form::Subsection) }
+ let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
+ let(:subsection) { instance_double(Form::Subsection, form:) }
let(:joint_purchase) { false }
it "has correct subsection" do
@@ -33,7 +34,7 @@ RSpec.describe Form::Sales::Pages::StaircaseOwnedValueCheck, type: :model do
it "has the correct informative_text" do
expect(page.informative_text).to eq({
- "translation" => "soft_validations.staircase_owned.hint_text",
+ "translation" => "forms.2024.sales.soft_validations.stairowned_value_check.not_joint_purchase.informative_text",
"arguments" => [],
})
end
@@ -45,7 +46,7 @@ RSpec.describe Form::Sales::Pages::StaircaseOwnedValueCheck, type: :model do
context "when not a joint purchase" do
it "has the correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.staircase_owned.title_text.one",
+ "translation" => "forms.2024.sales.soft_validations.stairowned_value_check.not_joint_purchase.title_text",
"arguments" => [
{
"key" => "stairowned",
@@ -62,7 +63,7 @@ RSpec.describe Form::Sales::Pages::StaircaseOwnedValueCheck, type: :model do
it "has the correct title_text" do
expect(page.title_text).to eq({
- "translation" => "soft_validations.staircase_owned.title_text.two",
+ "translation" => "forms.2024.sales.soft_validations.stairowned_value_check.joint_purchase.title_text",
"arguments" => [
{
"key" => "stairowned",
diff --git a/spec/models/form/sales/questions/deposit_value_check_spec.rb b/spec/models/form/sales/questions/deposit_value_check_spec.rb
index 2e861110a..077c2e6a6 100644
--- a/spec/models/form/sales/questions/deposit_value_check_spec.rb
+++ b/spec/models/form/sales/questions/deposit_value_check_spec.rb
@@ -1,7 +1,7 @@
require "rails_helper"
RSpec.describe Form::Sales::Questions::DepositValueCheck, type: :model do
- subject(:question) { described_class.new(question_id, question_definition, page) }
+ subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: true) }
let(:question_id) { nil }
let(:question_definition) { nil }
diff --git a/spec/models/form/sales/questions/living_before_purchase_years_spec.rb b/spec/models/form/sales/questions/living_before_purchase_years_spec.rb
index c9893dece..ddf5abd8f 100644
--- a/spec/models/form/sales/questions/living_before_purchase_years_spec.rb
+++ b/spec/models/form/sales/questions/living_before_purchase_years_spec.rb
@@ -1,7 +1,7 @@
require "rails_helper"
RSpec.describe Form::Sales::Questions::LivingBeforePurchaseYears, type: :model do
- subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 1) }
+ subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 1, joint_purchase: true) }
let(:question_id) { nil }
let(:question_definition) { nil }
diff --git a/spec/models/form/sales/questions/staircase_owned_value_check_spec.rb b/spec/models/form/sales/questions/staircase_owned_value_check_spec.rb
index 4298e40b8..cbff9cec1 100644
--- a/spec/models/form/sales/questions/staircase_owned_value_check_spec.rb
+++ b/spec/models/form/sales/questions/staircase_owned_value_check_spec.rb
@@ -1,7 +1,7 @@
require "rails_helper"
RSpec.describe Form::Sales::Questions::StaircaseOwnedValueCheck, type: :model do
- subject(:question) { described_class.new(question_id, question_definition, page) }
+ subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: true) }
let(:question_id) { nil }
let(:question_definition) { nil }
From f3d709f6c84660f8396752c69da66ad7e9e9ed4d Mon Sep 17 00:00:00 2001
From: Rachael Booth
Date: Fri, 1 Nov 2024 09:49:44 +0000
Subject: [PATCH 11/12] Add paper_trail to bulk upload objects (#2745)
---
app/models/bulk_upload.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/models/bulk_upload.rb b/app/models/bulk_upload.rb
index 93f661225..a0ed265c9 100644
--- a/app/models/bulk_upload.rb
+++ b/app/models/bulk_upload.rb
@@ -32,6 +32,8 @@ class BulkUpload < ApplicationRecord
scope :filter_by_user, ->(user_id, _user = nil) { user_id.present? ? where(user_id:) : all }
scope :filter_by_uploading_organisation, ->(organisation_id, _user = nil) { where(organisation_id:) }
+ has_paper_trail
+
def completed?
incomplete_logs = logs.where.not(status: "completed")
!incomplete_logs.exists?
From fa83f3abc2c8ed49d4022d8ac565feaf2274b892 Mon Sep 17 00:00:00 2001
From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com>
Date: Fri, 1 Nov 2024 12:18:24 +0000
Subject: [PATCH 12/12] CLDC-3685: Copy changes lettings income and benefits
(#2732)
---
.../form/lettings/pages/care_home_weekly.rb | 1 +
.../form/lettings/pages/income_amount.rb | 2 +-
.../form/lettings/pages/income_known.rb | 1 -
.../form/lettings/pages/rent_4_weekly.rb | 2 +-
.../form/lettings/pages/rent_bi_weekly.rb | 2 +-
.../form/lettings/pages/rent_monthly.rb | 2 +-
app/models/form/lettings/pages/rent_weekly.rb | 2 +-
.../form/lettings/questions/benefits.rb | 3 -
.../form/lettings/questions/brent_4_weekly.rb | 4 +-
.../lettings/questions/brent_bi_weekly.rb | 4 +-
.../form/lettings/questions/brent_monthly.rb | 4 +-
.../form/lettings/questions/brent_weekly.rb | 4 +-
.../lettings/questions/chcharge_4_weekly.rb | 4 +-
.../lettings/questions/chcharge_bi_weekly.rb | 4 +-
.../lettings/questions/chcharge_monthly.rb | 4 +-
.../lettings/questions/chcharge_weekly.rb | 4 +-
.../form/lettings/questions/earnings.rb | 4 +-
app/models/form/lettings/questions/hb.rb | 3 -
.../lettings/questions/hbrentshortfall.rb | 3 -
.../lettings/questions/household_charge.rb | 3 -
app/models/form/lettings/questions/incfreq.rb | 4 +-
.../form/lettings/questions/is_carehome.rb | 4 +-
.../lettings/questions/net_income_known.rb | 3 -
app/models/form/lettings/questions/period.rb | 3 -
.../lettings/questions/pscharge_4_weekly.rb | 4 +-
.../lettings/questions/pscharge_bi_weekly.rb | 4 +-
.../lettings/questions/pscharge_monthly.rb | 4 +-
.../lettings/questions/pscharge_weekly.rb | 4 +-
.../lettings/questions/scharge_4_weekly.rb | 4 +-
.../lettings/questions/scharge_bi_weekly.rb | 4 +-
.../lettings/questions/scharge_monthly.rb | 4 +-
.../form/lettings/questions/scharge_weekly.rb | 4 +-
.../lettings/questions/supcharg_4_weekly.rb | 4 +-
.../lettings/questions/supcharg_bi_weekly.rb | 4 +-
.../lettings/questions/supcharg_monthly.rb | 4 +-
.../lettings/questions/supcharg_weekly.rb | 4 +-
.../lettings/questions/tcharge_4_weekly.rb | 4 +-
.../lettings/questions/tcharge_bi_weekly.rb | 4 +-
.../lettings/questions/tcharge_monthly.rb | 4 +-
.../form/lettings/questions/tcharge_weekly.rb | 4 +-
.../form/lettings/questions/tshortfall.rb | 3 +-
.../lettings/questions/tshortfall_known.rb | 4 +-
.../2023/lettings/income_and_benefits.en.yml | 108 ++++++++++++++++++
.../2024/lettings/income_and_benefits.en.yml | 108 ++++++++++++++++++
44 files changed, 251 insertions(+), 110 deletions(-)
create mode 100644 config/locales/forms/2023/lettings/income_and_benefits.en.yml
create mode 100644 config/locales/forms/2024/lettings/income_and_benefits.en.yml
diff --git a/app/models/form/lettings/pages/care_home_weekly.rb b/app/models/form/lettings/pages/care_home_weekly.rb
index 56165ce62..ef0ca01c3 100644
--- a/app/models/form/lettings/pages/care_home_weekly.rb
+++ b/app/models/form/lettings/pages/care_home_weekly.rb
@@ -2,6 +2,7 @@ class Form::Lettings::Pages::CareHomeWeekly < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "care_home_weekly"
+ @copy_key = "lettings.income_and_benefits.care_home"
@depends_on = [
{ "rent_and_charges_paid_weekly?" => true, "is_supported_housing?" => true, "household_charge" => 0 },
{ "rent_and_charges_paid_weekly?" => true, "is_supported_housing?" => true, "household_charge" => nil },
diff --git a/app/models/form/lettings/pages/income_amount.rb b/app/models/form/lettings/pages/income_amount.rb
index 589ae463a..71151e695 100644
--- a/app/models/form/lettings/pages/income_amount.rb
+++ b/app/models/form/lettings/pages/income_amount.rb
@@ -2,7 +2,7 @@ class Form::Lettings::Pages::IncomeAmount < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "income_amount"
- @header = "Total household income"
+ @copy_key = "lettings.income_and_benefits.income_amount"
@depends_on = [{ "net_income_known" => 0 }]
end
diff --git a/app/models/form/lettings/pages/income_known.rb b/app/models/form/lettings/pages/income_known.rb
index c031b1521..ba026d93f 100644
--- a/app/models/form/lettings/pages/income_known.rb
+++ b/app/models/form/lettings/pages/income_known.rb
@@ -2,7 +2,6 @@ class Form::Lettings::Pages::IncomeKnown < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "income_known"
- @header = "Household’s combined income after tax"
end
def questions
diff --git a/app/models/form/lettings/pages/rent_4_weekly.rb b/app/models/form/lettings/pages/rent_4_weekly.rb
index e71cd7ffa..aa6441f6e 100644
--- a/app/models/form/lettings/pages/rent_4_weekly.rb
+++ b/app/models/form/lettings/pages/rent_4_weekly.rb
@@ -2,7 +2,7 @@ class Form::Lettings::Pages::Rent4Weekly < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "rent_4_weekly"
- @header = "Household rent and charges"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges"
@depends_on = [
{ "household_charge" => 0, "rent_and_charges_paid_every_4_weeks?" => true, "is_carehome?" => false },
{ "household_charge" => nil, "rent_and_charges_paid_every_4_weeks?" => true, "is_carehome?" => false },
diff --git a/app/models/form/lettings/pages/rent_bi_weekly.rb b/app/models/form/lettings/pages/rent_bi_weekly.rb
index 0b1b9c884..7eab8daf4 100644
--- a/app/models/form/lettings/pages/rent_bi_weekly.rb
+++ b/app/models/form/lettings/pages/rent_bi_weekly.rb
@@ -2,7 +2,7 @@ class Form::Lettings::Pages::RentBiWeekly < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "rent_bi_weekly"
- @header = "Household rent and charges"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges"
@depends_on = [
{ "household_charge" => nil, "rent_and_charges_paid_every_2_weeks?" => true, "is_carehome?" => false },
{ "household_charge" => 0, "rent_and_charges_paid_every_2_weeks?" => true, "is_carehome?" => false },
diff --git a/app/models/form/lettings/pages/rent_monthly.rb b/app/models/form/lettings/pages/rent_monthly.rb
index d6af7a08c..9a3cd6a7e 100644
--- a/app/models/form/lettings/pages/rent_monthly.rb
+++ b/app/models/form/lettings/pages/rent_monthly.rb
@@ -2,7 +2,7 @@ class Form::Lettings::Pages::RentMonthly < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "rent_monthly"
- @header = "Household rent and charges"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges"
@depends_on = [
{ "household_charge" => nil, "rent_and_charges_paid_monthly?" => true, "is_carehome?" => false },
{ "household_charge" => 0, "rent_and_charges_paid_monthly?" => true, "is_carehome?" => false },
diff --git a/app/models/form/lettings/pages/rent_weekly.rb b/app/models/form/lettings/pages/rent_weekly.rb
index 4f1709820..86106cfe3 100644
--- a/app/models/form/lettings/pages/rent_weekly.rb
+++ b/app/models/form/lettings/pages/rent_weekly.rb
@@ -2,7 +2,7 @@ class Form::Lettings::Pages::RentWeekly < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "rent_weekly"
- @header = "Household rent and charges"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges"
@depends_on = [
{ "rent_and_charges_paid_weekly?" => true, "household_charge" => 0, "is_carehome?" => false },
{ "rent_and_charges_paid_weekly?" => true, "household_charge" => nil, "is_carehome?" => false },
diff --git a/app/models/form/lettings/questions/benefits.rb b/app/models/form/lettings/questions/benefits.rb
index bc17396fb..f5f2a3ee1 100644
--- a/app/models/form/lettings/questions/benefits.rb
+++ b/app/models/form/lettings/questions/benefits.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::Benefits < ::Form::Question
def initialize(id, hsh, page)
super
@id = "benefits"
- @check_answer_label = "Household income from Universal Credit, state pension or benefits"
- @header = "How much of the household’s income is from Universal Credit, state pensions or benefits?"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = "This excludes child and housing benefit, council tax support and tax credits."
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/brent_4_weekly.rb b/app/models/form/lettings/questions/brent_4_weekly.rb
index 436b628ad..2dc18ba56 100644
--- a/app/models/form/lettings/questions/brent_4_weekly.rb
+++ b/app/models/form/lettings/questions/brent_4_weekly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::Brent4Weekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "brent"
- @check_answer_label = "Basic rent"
- @header = "What is the basic rent?"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.brent"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"
diff --git a/app/models/form/lettings/questions/brent_bi_weekly.rb b/app/models/form/lettings/questions/brent_bi_weekly.rb
index 8dc27b610..d8bcfa136 100644
--- a/app/models/form/lettings/questions/brent_bi_weekly.rb
+++ b/app/models/form/lettings/questions/brent_bi_weekly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::BrentBiWeekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "brent"
- @check_answer_label = "Basic rent"
- @header = "What is the basic rent?"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.brent"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"
diff --git a/app/models/form/lettings/questions/brent_monthly.rb b/app/models/form/lettings/questions/brent_monthly.rb
index 7b567736b..a96239d7a 100644
--- a/app/models/form/lettings/questions/brent_monthly.rb
+++ b/app/models/form/lettings/questions/brent_monthly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::BrentMonthly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "brent"
- @check_answer_label = "Basic rent"
- @header = "What is the basic rent?"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.brent"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"
diff --git a/app/models/form/lettings/questions/brent_weekly.rb b/app/models/form/lettings/questions/brent_weekly.rb
index e604e5f34..155addfec 100644
--- a/app/models/form/lettings/questions/brent_weekly.rb
+++ b/app/models/form/lettings/questions/brent_weekly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::BrentWeekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "brent"
- @check_answer_label = "Basic rent"
- @header = "What is the basic rent?"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.brent"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"
diff --git a/app/models/form/lettings/questions/chcharge_4_weekly.rb b/app/models/form/lettings/questions/chcharge_4_weekly.rb
index b42bbe052..1cf3adae4 100644
--- a/app/models/form/lettings/questions/chcharge_4_weekly.rb
+++ b/app/models/form/lettings/questions/chcharge_4_weekly.rb
@@ -2,12 +2,10 @@ class Form::Lettings::Questions::Chcharge4Weekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "chcharge"
- @check_answer_label = "Care home charges"
- @header = "How much does the household pay every 4 weeks?"
+ @copy_key = "lettings.income_and_benefits.care_home.chcharge_4_weekly"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
- @hint_text = ""
@step = 0.01
@prefix = "£"
@suffix = " every 4 weeks"
diff --git a/app/models/form/lettings/questions/chcharge_bi_weekly.rb b/app/models/form/lettings/questions/chcharge_bi_weekly.rb
index 72de6d32b..c2abc4bdd 100644
--- a/app/models/form/lettings/questions/chcharge_bi_weekly.rb
+++ b/app/models/form/lettings/questions/chcharge_bi_weekly.rb
@@ -2,12 +2,10 @@ class Form::Lettings::Questions::ChchargeBiWeekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "chcharge"
- @check_answer_label = "Care home charges"
- @header = "How much does the household pay every 2 weeks?"
+ @copy_key = "lettings.income_and_benefits.care_home.chcharge_bi_weekly"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
- @hint_text = ""
@step = 0.01
@prefix = "£"
@suffix = " every 2 weeks"
diff --git a/app/models/form/lettings/questions/chcharge_monthly.rb b/app/models/form/lettings/questions/chcharge_monthly.rb
index c640085d2..d76a4ae1f 100644
--- a/app/models/form/lettings/questions/chcharge_monthly.rb
+++ b/app/models/form/lettings/questions/chcharge_monthly.rb
@@ -2,12 +2,10 @@ class Form::Lettings::Questions::ChchargeMonthly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "chcharge"
- @check_answer_label = "Care home charges"
- @header = "How much does the household pay every month?"
+ @copy_key = "lettings.income_and_benefits.care_home.chcharge_monthly"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
- @hint_text = ""
@step = 0.01
@prefix = "£"
@suffix = " every month"
diff --git a/app/models/form/lettings/questions/chcharge_weekly.rb b/app/models/form/lettings/questions/chcharge_weekly.rb
index 484da8b5b..ab7f64622 100644
--- a/app/models/form/lettings/questions/chcharge_weekly.rb
+++ b/app/models/form/lettings/questions/chcharge_weekly.rb
@@ -2,12 +2,10 @@ class Form::Lettings::Questions::ChchargeWeekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "chcharge"
- @check_answer_label = "Care home charges"
- @header = "How much does the household pay every week?"
+ @copy_key = "lettings.income_and_benefits.care_home.chcharge_weekly"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
- @hint_text = ""
@step = 0.01
@prefix = "£"
@suffix = " every week"
diff --git a/app/models/form/lettings/questions/earnings.rb b/app/models/form/lettings/questions/earnings.rb
index 2ebb3e30b..9dc070e6a 100644
--- a/app/models/form/lettings/questions/earnings.rb
+++ b/app/models/form/lettings/questions/earnings.rb
@@ -2,14 +2,12 @@ class Form::Lettings::Questions::Earnings < ::Form::Question
def initialize(id, hsh, page)
super
@id = "earnings"
- @check_answer_label = "Total household income"
- @header = "How much income does the household have in total?"
+ @copy_key = "lettings.income_and_benefits.income_amount.earnings"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
@top_guidance_partial = "what_counts_as_income"
- @hint_text = ""
@step = 0.01
@prefix = "£"
@suffix = [
diff --git a/app/models/form/lettings/questions/hb.rb b/app/models/form/lettings/questions/hb.rb
index a3feba77a..4f4703993 100644
--- a/app/models/form/lettings/questions/hb.rb
+++ b/app/models/form/lettings/questions/hb.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::Hb < ::Form::Question
def initialize(id, hsh, page)
super
@id = "hb"
- @check_answer_label = "Housing-related benefits received"
- @header = "Is the household likely to be receiving any of these housing-related benefits?"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = form.start_year_after_2024? ? "This is about when the tenant is in their new let. If they are unsure about the situation for their new let and their financial and working situation hasn’t changed significantly, answer based on what housing-related benefits they currently receive." : ""
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/hbrentshortfall.rb b/app/models/form/lettings/questions/hbrentshortfall.rb
index ee9546e73..a34df70e0 100644
--- a/app/models/form/lettings/questions/hbrentshortfall.rb
+++ b/app/models/form/lettings/questions/hbrentshortfall.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::Hbrentshortfall < ::Form::Question
def initialize(id, hsh, page)
super
@id = "hbrentshortfall"
- @check_answer_label = "Any outstanding amount for basic rent and charges"
- @header = "After the household has received any housing-related benefits, will they still need to pay for rent and charges?"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = "Also known as the ‘outstanding amount’."
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/household_charge.rb b/app/models/form/lettings/questions/household_charge.rb
index 7f89aa548..60fee977d 100644
--- a/app/models/form/lettings/questions/household_charge.rb
+++ b/app/models/form/lettings/questions/household_charge.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::HouseholdCharge < ::Form::Question
def initialize(id, hsh, page)
super
@id = "household_charge"
- @check_answer_label = "Does the household pay rent or charges?"
- @header = "Does the household pay rent or other charges for the accommodation?"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = "If rent is charged on the property then answer Yes to this question, even if the tenants do not pay it themselves."
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/incfreq.rb b/app/models/form/lettings/questions/incfreq.rb
index 3067c5c98..d4384218e 100644
--- a/app/models/form/lettings/questions/incfreq.rb
+++ b/app/models/form/lettings/questions/incfreq.rb
@@ -2,11 +2,9 @@ class Form::Lettings::Questions::Incfreq < ::Form::Question
def initialize(id, hsh, page)
super
@id = "incfreq"
- @check_answer_label = "How often does the household receive this amount?"
- @header = "How often does the household receive this amount?"
+ @copy_key = "lettings.income_and_benefits.income_amount.incfreq"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = ""
@answer_options = ANSWER_OPTIONS
@hidden_in_check_answers = true
@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/lettings/questions/is_carehome.rb b/app/models/form/lettings/questions/is_carehome.rb
index 41996b4f0..efb29a817 100644
--- a/app/models/form/lettings/questions/is_carehome.rb
+++ b/app/models/form/lettings/questions/is_carehome.rb
@@ -2,11 +2,9 @@ class Form::Lettings::Questions::IsCarehome < ::Form::Question
def initialize(id, hsh, page)
super
@id = "is_carehome"
- @check_answer_label = "Care home accommodation"
- @header = "Is this accommodation a care home?"
+ @copy_key = "lettings.income_and_benefits.care_home.is_carehome"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = ""
@conditional_for = { "chcharge" => [1] }
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/net_income_known.rb b/app/models/form/lettings/questions/net_income_known.rb
index 5858d4d26..01c3bcaa3 100644
--- a/app/models/form/lettings/questions/net_income_known.rb
+++ b/app/models/form/lettings/questions/net_income_known.rb
@@ -2,12 +2,9 @@ class Form::Lettings::Questions::NetIncomeKnown < ::Form::Question
def initialize(id, hsh, page)
super
@id = "net_income_known"
- @check_answer_label = "Do you know the household’s combined total income after tax?"
- @header = "Do you know the household’s combined income after tax?"
@type = "radio"
@check_answers_card_number = 0
@top_guidance_partial = "what_counts_as_income"
- @hint_text = ""
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/period.rb b/app/models/form/lettings/questions/period.rb
index aefe8be84..6f98bd2a8 100644
--- a/app/models/form/lettings/questions/period.rb
+++ b/app/models/form/lettings/questions/period.rb
@@ -2,11 +2,8 @@ class Form::Lettings::Questions::Period < ::Form::Question
def initialize(id, hsh, page)
super
@id = "period"
- @check_answer_label = "Frequency of household rent and charges"
- @header = "How often does the household pay rent and other charges?"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = "Select how often the household is charged. This may be different to how often they pay."
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
diff --git a/app/models/form/lettings/questions/pscharge_4_weekly.rb b/app/models/form/lettings/questions/pscharge_4_weekly.rb
index 0340e55b8..56d2e60b8 100644
--- a/app/models/form/lettings/questions/pscharge_4_weekly.rb
+++ b/app/models/form/lettings/questions/pscharge_4_weekly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::Pscharge4Weekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "pscharge"
- @check_answer_label = "Personal service charge"
- @header = "What is the personal service charge?"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.pscharge"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"
diff --git a/app/models/form/lettings/questions/pscharge_bi_weekly.rb b/app/models/form/lettings/questions/pscharge_bi_weekly.rb
index db4e040f0..6022f6019 100644
--- a/app/models/form/lettings/questions/pscharge_bi_weekly.rb
+++ b/app/models/form/lettings/questions/pscharge_bi_weekly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::PschargeBiWeekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "pscharge"
- @check_answer_label = "Personal service charge"
- @header = "What is the personal service charge?"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.pscharge"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"
diff --git a/app/models/form/lettings/questions/pscharge_monthly.rb b/app/models/form/lettings/questions/pscharge_monthly.rb
index e96cd32d4..225db53d3 100644
--- a/app/models/form/lettings/questions/pscharge_monthly.rb
+++ b/app/models/form/lettings/questions/pscharge_monthly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::PschargeMonthly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "pscharge"
- @check_answer_label = "Personal service charge"
- @header = "What is the personal service charge?"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.pscharge"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"
diff --git a/app/models/form/lettings/questions/pscharge_weekly.rb b/app/models/form/lettings/questions/pscharge_weekly.rb
index 6b5fa9889..2ff06301c 100644
--- a/app/models/form/lettings/questions/pscharge_weekly.rb
+++ b/app/models/form/lettings/questions/pscharge_weekly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::PschargeWeekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "pscharge"
- @check_answer_label = "Personal service charge"
- @header = "What is the personal service charge?"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.pscharge"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"
diff --git a/app/models/form/lettings/questions/scharge_4_weekly.rb b/app/models/form/lettings/questions/scharge_4_weekly.rb
index a2f81c6ef..e91dadab3 100644
--- a/app/models/form/lettings/questions/scharge_4_weekly.rb
+++ b/app/models/form/lettings/questions/scharge_4_weekly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::Scharge4Weekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "scharge"
- @check_answer_label = "Service charge"
- @header = "What is the service charge?"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.scharge"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"
diff --git a/app/models/form/lettings/questions/scharge_bi_weekly.rb b/app/models/form/lettings/questions/scharge_bi_weekly.rb
index a19acbab5..59138835d 100644
--- a/app/models/form/lettings/questions/scharge_bi_weekly.rb
+++ b/app/models/form/lettings/questions/scharge_bi_weekly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::SchargeBiWeekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "scharge"
- @check_answer_label = "Service charge"
- @header = "What is the service charge?"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.scharge"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"
diff --git a/app/models/form/lettings/questions/scharge_monthly.rb b/app/models/form/lettings/questions/scharge_monthly.rb
index eb399b0de..33404a8ce 100644
--- a/app/models/form/lettings/questions/scharge_monthly.rb
+++ b/app/models/form/lettings/questions/scharge_monthly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::SchargeMonthly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "scharge"
- @check_answer_label = "Service charge"
- @header = "What is the service charge?"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.scharge"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"
diff --git a/app/models/form/lettings/questions/scharge_weekly.rb b/app/models/form/lettings/questions/scharge_weekly.rb
index faf854b82..d8e16986e 100644
--- a/app/models/form/lettings/questions/scharge_weekly.rb
+++ b/app/models/form/lettings/questions/scharge_weekly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::SchargeWeekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "scharge"
- @check_answer_label = "Service charge"
- @header = "What is the service charge?"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.scharge"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"
diff --git a/app/models/form/lettings/questions/supcharg_4_weekly.rb b/app/models/form/lettings/questions/supcharg_4_weekly.rb
index 292578d56..cd3b7beed 100644
--- a/app/models/form/lettings/questions/supcharg_4_weekly.rb
+++ b/app/models/form/lettings/questions/supcharg_4_weekly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::Supcharg4Weekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "supcharg"
- @check_answer_label = "Support charge"
- @header = "What is the support charge?"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.supcharg"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "Any charges made to fund support services included in tenancy agreement."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"
diff --git a/app/models/form/lettings/questions/supcharg_bi_weekly.rb b/app/models/form/lettings/questions/supcharg_bi_weekly.rb
index 4f6daf141..dba861ebe 100644
--- a/app/models/form/lettings/questions/supcharg_bi_weekly.rb
+++ b/app/models/form/lettings/questions/supcharg_bi_weekly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::SupchargBiWeekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "supcharg"
- @check_answer_label = "Support charge"
- @header = "What is the support charge?"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.supcharg"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "Any charges made to fund support services included in tenancy agreement."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"
diff --git a/app/models/form/lettings/questions/supcharg_monthly.rb b/app/models/form/lettings/questions/supcharg_monthly.rb
index 9dd1c669b..3b5b3e41c 100644
--- a/app/models/form/lettings/questions/supcharg_monthly.rb
+++ b/app/models/form/lettings/questions/supcharg_monthly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::SupchargMonthly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "supcharg"
- @check_answer_label = "Support charge"
- @header = "What is the support charge?"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.supcharg"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "Any charges made to fund support services included in tenancy agreement."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"
diff --git a/app/models/form/lettings/questions/supcharg_weekly.rb b/app/models/form/lettings/questions/supcharg_weekly.rb
index 54a9743b6..f48a8ccfe 100644
--- a/app/models/form/lettings/questions/supcharg_weekly.rb
+++ b/app/models/form/lettings/questions/supcharg_weekly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::SupchargWeekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "supcharg"
- @check_answer_label = "Support charge"
- @header = "What is the support charge?"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.supcharg"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "Any charges made to fund support services included in tenancy agreement."
@step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge"
diff --git a/app/models/form/lettings/questions/tcharge_4_weekly.rb b/app/models/form/lettings/questions/tcharge_4_weekly.rb
index 3a353efe8..6475adab0 100644
--- a/app/models/form/lettings/questions/tcharge_4_weekly.rb
+++ b/app/models/form/lettings/questions/tcharge_4_weekly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::Tcharge4Weekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "tcharge"
- @check_answer_label = "Household rent and charges"
- @header = "Total charge"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.tcharge"
@type = "numeric_output"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "This is the total for rent and all charges."
@step = 0.01
@readonly = true
@prefix = "£"
diff --git a/app/models/form/lettings/questions/tcharge_bi_weekly.rb b/app/models/form/lettings/questions/tcharge_bi_weekly.rb
index 42fd9398b..446886d9d 100644
--- a/app/models/form/lettings/questions/tcharge_bi_weekly.rb
+++ b/app/models/form/lettings/questions/tcharge_bi_weekly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::TchargeBiWeekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "tcharge"
- @check_answer_label = "Household rent and charges"
- @header = "Total charge"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.tcharge"
@type = "numeric_output"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "This is the total for rent and all charges."
@step = 0.01
@readonly = true
@prefix = "£"
diff --git a/app/models/form/lettings/questions/tcharge_monthly.rb b/app/models/form/lettings/questions/tcharge_monthly.rb
index 3fcabdace..2c52f4c92 100644
--- a/app/models/form/lettings/questions/tcharge_monthly.rb
+++ b/app/models/form/lettings/questions/tcharge_monthly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::TchargeMonthly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "tcharge"
- @check_answer_label = "Household rent and charges"
- @header = "Total charge"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.tcharge"
@type = "numeric_output"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "This is the total for rent and all charges."
@step = 0.01
@readonly = true
@prefix = "£"
diff --git a/app/models/form/lettings/questions/tcharge_weekly.rb b/app/models/form/lettings/questions/tcharge_weekly.rb
index d1ac7cb34..0c0ee5d8e 100644
--- a/app/models/form/lettings/questions/tcharge_weekly.rb
+++ b/app/models/form/lettings/questions/tcharge_weekly.rb
@@ -2,13 +2,11 @@ class Form::Lettings::Questions::TchargeWeekly < ::Form::Question
def initialize(id, hsh, page)
super
@id = "tcharge"
- @check_answer_label = "Household rent and charges"
- @header = "Total charge"
+ @copy_key = "lettings.income_and_benefits.rent_and_charges.tcharge"
@type = "numeric_output"
@width = 5
@check_answers_card_number = 0
@min = 0
- @hint_text = "This is the total for rent and all charges."
@step = 0.01
@readonly = true
@prefix = "£"
diff --git a/app/models/form/lettings/questions/tshortfall.rb b/app/models/form/lettings/questions/tshortfall.rb
index 75583008c..3219c7689 100644
--- a/app/models/form/lettings/questions/tshortfall.rb
+++ b/app/models/form/lettings/questions/tshortfall.rb
@@ -2,8 +2,7 @@ class Form::Lettings::Questions::Tshortfall < ::Form::Question
def initialize(id, hsh, page)
super
@id = "tshortfall"
- @check_answer_label = "Estimated outstanding amount"
- @header = "Estimated outstanding amount"
+ @copy_key = "lettings.income_and_benefits.outstanding_amount.tshortfall"
@type = "numeric"
@width = 5
@check_answers_card_number = 0
diff --git a/app/models/form/lettings/questions/tshortfall_known.rb b/app/models/form/lettings/questions/tshortfall_known.rb
index 600736077..7a5da7127 100644
--- a/app/models/form/lettings/questions/tshortfall_known.rb
+++ b/app/models/form/lettings/questions/tshortfall_known.rb
@@ -2,11 +2,9 @@ class Form::Lettings::Questions::TshortfallKnown < ::Form::Question
def initialize(id, hsh, page)
super
@id = "tshortfall_known"
- @check_answer_label = "Do you know the outstanding amount?"
- @header = "Can you estimate the outstanding amount?"
+ @copy_key = "lettings.income_and_benefits.outstanding_amount.tshortfall_known"
@type = "radio"
@check_answers_card_number = 0
- @hint_text = "You only need to give an approximate figure."
@answer_options = ANSWER_OPTIONS
@conditional_for = { "tshortfall" => [0] }
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
diff --git a/config/locales/forms/2023/lettings/income_and_benefits.en.yml b/config/locales/forms/2023/lettings/income_and_benefits.en.yml
new file mode 100644
index 000000000..bc19c7954
--- /dev/null
+++ b/config/locales/forms/2023/lettings/income_and_benefits.en.yml
@@ -0,0 +1,108 @@
+en:
+ forms:
+ 2023:
+ lettings:
+ income_and_benefits:
+ net_income_known:
+ page_header: "Household’s combined income after tax"
+ check_answer_label: "Do you know the household’s combined total income after tax?"
+ hint_text: ""
+ question_text: "Do you know the household’s combined income after tax?"
+
+ income_amount:
+ page_header: "Total household income"
+ incfreq:
+ check_answer_label: "How often does the household receive this amount?"
+ hint_text: ""
+ question_text: "How often does the household receive this amount?"
+ earnings:
+ check_answer_label: "Total household income"
+ hint_text: ""
+ question_text: "How much income does the household have in total?"
+
+ hb:
+ page_header: ""
+ check_answer_label: "Housing-related benefits received"
+ hint_text: ""
+ question_text: "Is the household likely to be receiving any of these housing-related benefits?"
+
+ benefits:
+ page_header: ""
+ check_answer_label: "Household income from Universal Credit, state pension or benefit"
+ hint_text: "This excludes child and housing benefit, council tax support and tax credits."
+ question_text: "How much of the household’s income is from Universal Credit, state pensions or benefits?"
+
+ household_charge:
+ page_header: ""
+ check_answer_label: "Does the household pay rent or charges"
+ hint_text: "If rent is charged on the property then answer Yes to this question, even if the tenants do not pay it themselves."
+ question_text: "Does the household pay rent or other charges for the accommodation?"
+
+ period:
+ page_header: ""
+ check_answer_label: "Frequency of household rent and charges"
+ hint_text: "Select how often the household is charged. This may be different to how often they pay."
+ question_text: "How often does the household pay rent and other charges?"
+
+ care_home:
+ page_header: ""
+ is_carehome:
+ check_answer_label: "Care home accommodation"
+ hint_text: ""
+ question_text: "Is this accommodation a care home?"
+ chcharge_weekly:
+ check_answer_label: "Care home charges"
+ hint_text: ""
+ question_text: "How much does the household pay every week?"
+ chcharge_bi_weekly:
+ check_answer_label: "Care home charges"
+ hint_text: ""
+ question_text: "How much does the household pay every 2 weeks?"
+ chcharge_4_weekly:
+ check_answer_label: "Care home charges"
+ hint_text: ""
+ question_text: "How much does the household pay every 4 weeks?"
+ chcharge_monthly:
+ check_answer_label: "Care home charges"
+ hint_text: ""
+ question_text: "How much does the household pay every month?"
+
+ rent_and_charges:
+ page_header: "Household rent and charges"
+ brent:
+ check_answer_label: "Basic rent"
+ hint_text: "This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent."
+ question_text: "What is the basic rent?"
+ scharge:
+ check_answer_label: "Service charge"
+ hint_text: "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge."
+ question_text: "What is the service charge?"
+ pscharge:
+ check_answer_label: "Personal service charge"
+ hint_text: "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
+ question_text: "What is the personal service charge?"
+ supcharg:
+ check_answer_label: "Support charge"
+ hint_text: "Any charges made to fund support services included in tenancy agreement."
+ question_text: "What is the support charge?"
+ tcharge:
+ check_answer_label: "Household rent and charges"
+ hint_text: "This is the total for rent and all charges."
+ question_text: "Total charge"
+
+ hbrentshortfall:
+ page_header: ""
+ check_answer_label: "Any outstanding amount for basic rent and charges"
+ hint_text: "Also known as the ‘outstanding amount’."
+ question_text: "After the household has received any housing-related benefits, will they still need to pay for rent and charges?"
+
+ outstanding_amount:
+ page_header: ""
+ tshortfall_known:
+ check_answer_label: "Do you know the outstanding amount?"
+ hint_text: "You only need to give an approximate figure."
+ question_text: "Can you estimate the outstanding amount?"
+ tshortfall:
+ check_answer_label: "Estimated outstanding amountt"
+ hint_text: "Also known as the ‘outstanding amount’."
+ question_text: "Estimated outstanding amount"
diff --git a/config/locales/forms/2024/lettings/income_and_benefits.en.yml b/config/locales/forms/2024/lettings/income_and_benefits.en.yml
new file mode 100644
index 000000000..bb3cc320e
--- /dev/null
+++ b/config/locales/forms/2024/lettings/income_and_benefits.en.yml
@@ -0,0 +1,108 @@
+en:
+ forms:
+ 2024:
+ lettings:
+ income_and_benefits:
+ net_income_known:
+ page_header: "Household’s combined income after tax"
+ check_answer_label: "Do you know the household’s combined total income after tax?"
+ hint_text: ""
+ question_text: "Do you know the household’s combined income after tax?"
+
+ income_amount:
+ page_header: "Total household income"
+ incfreq:
+ check_answer_label: "How often does the household receive this amount?"
+ hint_text: ""
+ question_text: "How often does the household receive this amount?"
+ earnings:
+ check_answer_label: "Total household income"
+ hint_text: ""
+ question_text: "How much income does the household have in total?"
+
+ hb:
+ page_header: ""
+ check_answer_label: "Housing-related benefits received"
+ hint_text: "This is about when the tenant is in their new let. If they are unsure about the situation for their new let and their financial and working situation hasn’t changed significantly, answer based on what housing-related benefits they currently receive."
+ question_text: "Is the household likely to be receiving any of these housing-related benefits?"
+
+ benefits:
+ page_header: ""
+ check_answer_label: "Household income from Universal Credit, state pension or benefit"
+ hint_text: "This excludes child and housing benefit, council tax support and tax credits."
+ question_text: "How much of the household’s income is from Universal Credit, state pensions or benefits?"
+
+ household_charge:
+ page_header: ""
+ check_answer_label: "Does the household pay rent or charges"
+ hint_text: "If rent is charged on the property then answer Yes to this question, even if the tenants do not pay it themselves."
+ question_text: "Does the household pay rent or other charges for the accommodation?"
+
+ period:
+ page_header: ""
+ check_answer_label: "Frequency of household rent and charges"
+ hint_text: "Select how often the household is charged. This may be different to how often they pay."
+ question_text: "How often does the household pay rent and other charges?"
+
+ care_home:
+ page_header: ""
+ is_carehome:
+ check_answer_label: "Care home accommodation"
+ hint_text: ""
+ question_text: "Is this accommodation a care home?"
+ chcharge_weekly:
+ check_answer_label: "Care home charges"
+ hint_text: ""
+ question_text: "How much does the household pay every week?"
+ chcharge_bi_weekly:
+ check_answer_label: "Care home charges"
+ hint_text: ""
+ question_text: "How much does the household pay every 2 weeks?"
+ chcharge_4_weekly:
+ check_answer_label: "Care home charges"
+ hint_text: ""
+ question_text: "How much does the household pay every 4 weeks?"
+ chcharge_monthly:
+ check_answer_label: "Care home charges"
+ hint_text: ""
+ question_text: "How much does the household pay every month?"
+
+ rent_and_charges:
+ page_header: "Household rent and charges"
+ brent:
+ check_answer_label: "Basic rent"
+ hint_text: "This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent."
+ question_text: "What is the basic rent?"
+ scharge:
+ check_answer_label: "Service charge"
+ hint_text: "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge."
+ question_text: "What is the service charge?"
+ pscharge:
+ check_answer_label: "Personal service charge"
+ hint_text: "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
+ question_text: "What is the personal service charge?"
+ supcharg:
+ check_answer_label: "Support charge"
+ hint_text: "Any charges made to fund support services included in tenancy agreement."
+ question_text: "What is the support charge?"
+ tcharge:
+ check_answer_label: "Household rent and charges"
+ hint_text: "This is the total for rent and all charges."
+ question_text: "Total charge"
+
+ hbrentshortfall:
+ page_header: ""
+ check_answer_label: "Any outstanding amount for basic rent and charges"
+ hint_text: "Also known as the ‘outstanding amount’."
+ question_text: "After the household has received any housing-related benefits, will they still need to pay for rent and charges?"
+
+ outstanding_amount:
+ page_header: ""
+ tshortfall_known:
+ check_answer_label: "Do you know the outstanding amount?"
+ hint_text: "You only need to give an approximate figure."
+ question_text: "Can you estimate the outstanding amount?"
+ tshortfall:
+ check_answer_label: "Estimated outstanding amountt"
+ hint_text: "Also known as the ‘outstanding amount’."
+ question_text: "Estimated outstanding amount"