diff --git a/app/components/create_log_actions_component.html.erb b/app/components/create_log_actions_component.html.erb index 8af78b169..53e2bb57b 100644 --- a/app/components/create_log_actions_component.html.erb +++ b/app/components/create_log_actions_component.html.erb @@ -1,11 +1,11 @@ +
"> <% if display_actions? %> -
- <%= govuk_button_to create_button_copy, create_button_href, class: "govuk-!-margin-right-6" %> + <%= govuk_button_to create_button_copy, create_button_href, class: "govuk-!-margin-right-3" %> <% unless user.support? %> <%= govuk_button_link_to upload_button_copy, upload_button_href, secondary: true %> <% end %> <% if user.support? %> <%= govuk_button_link_to view_uploads_button_copy, view_uploads_button_href, secondary: true %> <% end %> -
<% end %> +
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/filters_helper.rb b/app/helpers/filters_helper.rb index 35fea17e9..3a4c337ea 100644 --- a/app/helpers/filters_helper.rb +++ b/app/helpers/filters_helper.rb @@ -143,7 +143,11 @@ module FiltersHelper } if FormHandler.instance.in_crossover_period? - return years.merge({ archived_collection_start_year.to_s => year_combo(archived_collection_start_year) }) + years = years.merge({ archived_collection_start_year.to_s => year_combo(archived_collection_start_year) }) + end + + if FeatureToggle.allow_future_form_use? + years = { next_collection_start_year.to_s => year_combo(next_collection_start_year) }.merge(years) end years 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/helpers/interruption_screen_helper.rb b/app/helpers/interruption_screen_helper.rb index b28c7eaa9..e4c09a050 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.blank? return "" unless informative_text["arguments"] translation_params = {} 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/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? diff --git a/app/models/derived_variables/lettings_log_variables.rb b/app/models/derived_variables/lettings_log_variables.rb index e50161188..9219392f7 100644 --- a/app/models/derived_variables/lettings_log_variables.rb +++ b/app/models/derived_variables/lettings_log_variables.rb @@ -65,7 +65,7 @@ module DerivedVariables::LettingsLogVariables self.has_benefits = get_has_benefits self.tshortfall_known = 0 if tshortfall self.nocharge = household_charge&.zero? ? 1 : 0 - if form.start_year_after_2024? && is_bedsit? + if form.start_year_2024_or_later? && is_bedsit? self.beds = 1 end @@ -186,7 +186,7 @@ private self.wchair = nil self.location_id = nil end - if form.start_year_after_2024? && (unittype_gn_changed? && unittype_gn_was == 2) + if form.start_year_2024_or_later? && (unittype_gn_changed? && unittype_gn_was == 2) self.beds = nil end end diff --git a/app/models/derived_variables/sales_log_variables.rb b/app/models/derived_variables/sales_log_variables.rb index f23f9eb28..e182c2158 100644 --- a/app/models/derived_variables/sales_log_variables.rb +++ b/app/models/derived_variables/sales_log_variables.rb @@ -29,7 +29,7 @@ module DerivedVariables::SalesLogVariables end end - if saledate && form.start_year_after_2024? && discounted_ownership_sale? + if saledate && form.start_year_2024_or_later? && discounted_ownership_sale? self.ppostcode_full = postcode_full self.ppcodenk = pcodenk self.prevloc = la @@ -44,7 +44,7 @@ module DerivedVariables::SalesLogVariables self.hhmemb = number_of_household_members self.hhtype = household_type - if saledate && form.start_year_after_2024? + if saledate && form.start_year_2024_or_later? self.soctenant = soctenant_from_prevten_values child_under_16_constraints! end diff --git a/app/models/form.rb b/app/models/form.rb index 4336376e6..ce77378ca 100644 --- a/app/models/form.rb +++ b/app/models/form.rb @@ -334,7 +334,11 @@ class Form type == "sales" || (start_year && start_year.to_i > 2022) end - def start_year_after_2024? + def start_year_2024_or_later? start_date && start_date.year >= 2024 end + + def start_year_2025_or_later? + start_date && start_date.year >= 2025 + end end 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/care_home_charges_value_check.rb b/app/models/form/lettings/pages/care_home_charges_value_check.rb index 2cf253bf6..78e598e86 100644 --- a/app/models/form/lettings/pages/care_home_charges_value_check.rb +++ b/app/models/form/lettings/pages/care_home_charges_value_check.rb @@ -2,11 +2,15 @@ class Form::Lettings::Pages::CareHomeChargesValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "care_home_charges_value_check" + @copy_key = "lettings.soft_validations.care_home_charges_value_check" @depends_on = [{ "care_home_charge_expected_not_provided?" => true }] @title_text = { - "translation" => "soft_validations.care_home_charges.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + } + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } - @informative_text = "" end def questions 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/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb index d91794525..5b06d6a28 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadAgeValu def initialize(id, hsh, subsection) super(id, hsh, subsection) @id = "females_in_soft_age_range_in_pregnant_household_lead_age_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb index 6fc8bdd16..3e961b283 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadHhmembV def initialize(id, hsh, subsection) super(id, hsh, subsection) @id = "females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb index 9a2b707b3..af568b039 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadValueCh def initialize(id, hsh, subsection) super @id = "females_in_soft_age_range_in_pregnant_household_lead_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb index 0b2e2451f..ddc8789f9 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeVa def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @id = "females_in_soft_age_range_in_pregnant_household_person_#{person_index}_age_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" @depends_on = [ { "female_in_pregnant_household_in_soft_validation_range?" => true, @@ -9,24 +10,12 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeVa }, ] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } @person_index = person_index end diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb index c8d484bf4..099bea5d9 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb @@ -2,6 +2,8 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValue def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @id = "females_in_soft_age_range_in_pregnant_household_person_#{person_index}_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" + @depends_on = [ { "female_in_pregnant_household_in_soft_validation_range?" => true, @@ -9,24 +11,12 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValue }, ] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } @person_index = person_index end diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb index c816fb0b2..3822ec940 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdValueCheck def initialize(id, hsh, subsection) super @id = "females_in_soft_age_range_in_pregnant_household_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end 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/lead_tenant_age.rb b/app/models/form/lettings/pages/lead_tenant_age.rb index 640d23142..3058d8a77 100644 --- a/app/models/form/lettings/pages/lead_tenant_age.rb +++ b/app/models/form/lettings/pages/lead_tenant_age.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantAge < ::Form::Page def initialize(id, hsh, subsection) super @id = "lead_tenant_age" + @copy_key = "lettings.household_characteristics.age1" @depends_on = [{ "declaration" => 1 }] end diff --git a/app/models/form/lettings/pages/lead_tenant_ethnic_background_arab.rb b/app/models/form/lettings/pages/lead_tenant_ethnic_background_arab.rb index 89d73fd34..fe038aa78 100644 --- a/app/models/form/lettings/pages/lead_tenant_ethnic_background_arab.rb +++ b/app/models/form/lettings/pages/lead_tenant_ethnic_background_arab.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundArab < ::Form::Page def initialize(id, hsh, subsection) super @id = "lead_tenant_ethnic_background_arab" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_arab" @depends_on = [{ "ethnic_group" => 4 }] end diff --git a/app/models/form/lettings/pages/lead_tenant_ethnic_background_asian.rb b/app/models/form/lettings/pages/lead_tenant_ethnic_background_asian.rb index d55ce9837..9f01300d1 100644 --- a/app/models/form/lettings/pages/lead_tenant_ethnic_background_asian.rb +++ b/app/models/form/lettings/pages/lead_tenant_ethnic_background_asian.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundAsian < ::Form::Page def initialize(id, hsh, subsection) super @id = "lead_tenant_ethnic_background_asian" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_asian" @depends_on = [{ "ethnic_group" => 2 }] end diff --git a/app/models/form/lettings/pages/lead_tenant_ethnic_background_black.rb b/app/models/form/lettings/pages/lead_tenant_ethnic_background_black.rb index 7ce2ef9c4..68bcffb1c 100644 --- a/app/models/form/lettings/pages/lead_tenant_ethnic_background_black.rb +++ b/app/models/form/lettings/pages/lead_tenant_ethnic_background_black.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundBlack < ::Form::Page def initialize(id, hsh, subsection) super @id = "lead_tenant_ethnic_background_black" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_black" @depends_on = [{ "ethnic_group" => 3 }] end diff --git a/app/models/form/lettings/pages/lead_tenant_ethnic_background_mixed.rb b/app/models/form/lettings/pages/lead_tenant_ethnic_background_mixed.rb index a4c225083..fd1e52c11 100644 --- a/app/models/form/lettings/pages/lead_tenant_ethnic_background_mixed.rb +++ b/app/models/form/lettings/pages/lead_tenant_ethnic_background_mixed.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundMixed < ::Form::Page def initialize(id, hsh, subsection) super @id = "lead_tenant_ethnic_background_mixed" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_mixed" @depends_on = [{ "ethnic_group" => 1 }] end diff --git a/app/models/form/lettings/pages/lead_tenant_ethnic_background_white.rb b/app/models/form/lettings/pages/lead_tenant_ethnic_background_white.rb index 994e6e159..e457c39fe 100644 --- a/app/models/form/lettings/pages/lead_tenant_ethnic_background_white.rb +++ b/app/models/form/lettings/pages/lead_tenant_ethnic_background_white.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundWhite < ::Form::Page def initialize(id, hsh, subsection) super @id = "lead_tenant_ethnic_background_white" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_white" @depends_on = [{ "ethnic_group" => 0 }] end diff --git a/app/models/form/lettings/pages/lead_tenant_nationality.rb b/app/models/form/lettings/pages/lead_tenant_nationality.rb index 9fc78644f..410a6320f 100644 --- a/app/models/form/lettings/pages/lead_tenant_nationality.rb +++ b/app/models/form/lettings/pages/lead_tenant_nationality.rb @@ -2,11 +2,12 @@ class Form::Lettings::Pages::LeadTenantNationality < ::Form::Page def initialize(id, hsh, subsection) super @id = "lead_tenant_nationality" + @copy_key = "lettings.household_characteristics.#{form.start_year_2024_or_later? ? 'nationality_all' : 'national'}" @depends_on = [{ "declaration" => 1 }] end def questions - @questions ||= if form.start_year_after_2024? + @questions ||= if form.start_year_2024_or_later? [ Form::Lettings::Questions::NationalityAllGroup.new(nil, nil, self), Form::Lettings::Questions::NationalityAll.new(nil, nil, self), diff --git a/app/models/form/lettings/pages/lead_tenant_over_retirement_value_check.rb b/app/models/form/lettings/pages/lead_tenant_over_retirement_value_check.rb index b5add868b..43b00844c 100644 --- a/app/models/form/lettings/pages/lead_tenant_over_retirement_value_check.rb +++ b/app/models/form/lettings/pages/lead_tenant_over_retirement_value_check.rb @@ -2,11 +2,13 @@ class Form::Lettings::Pages::LeadTenantOverRetirementValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @depends_on = [{ "person_1_not_retired_over_soft_max_age?" => true }] + @copy_key = "lettings.soft_validations.retirement_value_check" @title_text = { - "translation" => "soft_validations.retirement.max.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", } @informative_text = { - "translation" => "soft_validations.retirement.max.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/lead_tenant_under_retirement_value_check.rb b/app/models/form/lettings/pages/lead_tenant_under_retirement_value_check.rb index 0c7a3ed2e..66a87c2bf 100644 --- a/app/models/form/lettings/pages/lead_tenant_under_retirement_value_check.rb +++ b/app/models/form/lettings/pages/lead_tenant_under_retirement_value_check.rb @@ -2,8 +2,9 @@ class Form::Lettings::Pages::LeadTenantUnderRetirementValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @depends_on = [{ "person_1_retired_under_soft_min_age?" => true }] + @copy_key = "lettings.soft_validations.no_retirement_value_check" @title_text = { - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "age1", @@ -12,7 +13,10 @@ class Form::Lettings::Pages::LeadTenantUnderRetirementValueCheck < ::Form::Page }, ], } - @informative_text = {} + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } end def questions diff --git a/app/models/form/lettings/pages/max_rent_value_check.rb b/app/models/form/lettings/pages/max_rent_value_check.rb deleted file mode 100644 index f3280420b..000000000 --- a/app/models/form/lettings/pages/max_rent_value_check.rb +++ /dev/null @@ -1,24 +0,0 @@ -class Form::Lettings::Pages::MaxRentValueCheck < ::Form::Page - def initialize(id, hsh, subsection, check_answers_card_number: nil) - super(id, hsh, subsection) - @depends_on = [{ "rent_in_soft_max_range?" => true }] - @title_text = { - "translation" => "soft_validations.rent.outside_range_title", - "arguments" => [{ - "key" => "brent", - "label" => true, - "i18n_template" => "brent", - }], - } - @informative_text = I18n.t("soft_validations.rent.informative_text", higher_or_lower: "higher") - @check_answers_card_number = check_answers_card_number - end - - def questions - @questions ||= [Form::Lettings::Questions::MaxRentValueCheck.new(nil, nil, self, check_answers_card_number: @check_answers_card_number)] - end - - def interruption_screen_question_ids - %w[brent period startdate uprn postcode_full la beds rent_type needstype] - end -end diff --git a/app/models/form/lettings/pages/min_rent_value_check.rb b/app/models/form/lettings/pages/min_rent_value_check.rb deleted file mode 100644 index ee26b4d7e..000000000 --- a/app/models/form/lettings/pages/min_rent_value_check.rb +++ /dev/null @@ -1,24 +0,0 @@ -class Form::Lettings::Pages::MinRentValueCheck < ::Form::Page - def initialize(id, hsh, subsection, check_answers_card_number: nil) - super(id, hsh, subsection) - @depends_on = [{ "rent_in_soft_min_range?" => true }] - @title_text = { - "translation" => "soft_validations.rent.outside_range_title", - "arguments" => [{ - "key" => "brent", - "label" => true, - "i18n_template" => "brent", - }], - } - @informative_text = I18n.t("soft_validations.rent.informative_text", higher_or_lower: "lower") - @check_answers_card_number = check_answers_card_number - end - - def questions - @questions ||= [Form::Lettings::Questions::MinRentValueCheck.new(nil, nil, self, check_answers_card_number: @check_answers_card_number)] - end - - def interruption_screen_question_ids - %w[brent period startdate uprn postcode_full la beds rent_type needstype] - end -end diff --git a/app/models/form/lettings/pages/multiple_partners_value_check.rb b/app/models/form/lettings/pages/multiple_partners_value_check.rb index 3f9cdb3ae..4e9167a12 100644 --- a/app/models/form/lettings/pages/multiple_partners_value_check.rb +++ b/app/models/form/lettings/pages/multiple_partners_value_check.rb @@ -6,12 +6,16 @@ class Form::Lettings::Pages::MultiplePartnersValueCheck < Form::Page "multiple_partners?" => true, }, ] + @copy_key = "lettings.soft_validations.multiple_partners_value_check" @person_index = person_index @title_text = { - "translation" => "soft_validations.multiple_partners_lettings.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], + } + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } - @informative_text = {} end def questions diff --git a/app/models/form/lettings/pages/net_income_value_check.rb b/app/models/form/lettings/pages/net_income_value_check.rb index ccb2b2a08..9bdce131d 100644 --- a/app/models/form/lettings/pages/net_income_value_check.rb +++ b/app/models/form/lettings/pages/net_income_value_check.rb @@ -2,9 +2,10 @@ class Form::Lettings::Pages::NetIncomeValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "net_income_value_check" + @copy_key = "lettings.soft_validations.net_income_value_check" @depends_on = [{ "net_income_soft_validation_triggered?" => true }] @title_text = { - "translation" => "soft_validations.net_income.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "incfreq", @@ -20,7 +21,7 @@ class Form::Lettings::Pages::NetIncomeValueCheck < ::Form::Page } @informative_text = { - "translation" => "soft_validations.net_income.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [ { "key" => "net_income_higher_or_lower_text", diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_lead_age_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_lead_age_value_check.rb index 68b1c7f09..7e530a9ad 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_lead_age_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_lead_age_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadAgeValueCheck < ::For def initialize(id, hsh, subsection) super(id, hsh, subsection) @id = "no_females_pregnant_household_lead_age_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_lead_hhmemb_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_lead_hhmemb_value_check.rb index e1d1235ef..47ac7493b 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_lead_hhmemb_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_lead_hhmemb_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadHhmembValueCheck < :: def initialize(id, hsh, subsection) super @id = "no_females_pregnant_household_lead_hhmemb_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_lead_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_lead_value_check.rb index 416845735..edfe2c631 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_lead_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_lead_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadValueCheck < ::Form:: def initialize(id, hsh, subsection) super @id = "no_females_pregnant_household_lead_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check.rb index 12db3a08e..5e808b853 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck < ::F def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @id = "no_females_pregnant_household_person_#{person_index}_age_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true, "age#{person_index}_known" => 0 }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } @person_index = person_index end diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_person_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_person_value_check.rb index f04333ec0..fb77eec18 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_person_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_person_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck < ::Form def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @id = "no_females_pregnant_household_person_#{person_index}_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true, "details_known_#{person_index}" => 0 }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } @person_index = person_index end diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_value_check.rb index 9c84a953f..bce8a87ae 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "no_females_pregnant_household_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/partner_under_16_value_check.rb b/app/models/form/lettings/pages/partner_under_16_value_check.rb index 87d5865c4..b33a827d4 100644 --- a/app/models/form/lettings/pages/partner_under_16_value_check.rb +++ b/app/models/form/lettings/pages/partner_under_16_value_check.rb @@ -6,9 +6,10 @@ class Form::Lettings::Pages::PartnerUnder16ValueCheck < Form::Page "person_#{person_index}_partner_under_16?" => true, }, ] + @copy_key = "lettings.soft_validations.partner_under_16_value_check" @person_index = person_index @title_text = { - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "age#{person_index}", @@ -17,7 +18,10 @@ class Form::Lettings::Pages::PartnerUnder16ValueCheck < Form::Page }, ], } - @informative_text = {} + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } end def questions diff --git a/app/models/form/lettings/pages/person_age.rb b/app/models/form/lettings/pages/person_age.rb index bbb5da01e..3e6a73e14 100644 --- a/app/models/form/lettings/pages/person_age.rb +++ b/app/models/form/lettings/pages/person_age.rb @@ -1,13 +1,12 @@ class Form::Lettings::Pages::PersonAge < ::Form::Page - def initialize(id, hsh, subsection, person_index:, person_type: "non_child") + def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) - @id = "person_#{person_index}_age_#{person_type}" + @id = "person_#{person_index}_age" + @copy_key = "lettings.household_characteristics.age#{person_index}" @person_index = person_index - @person_type = person_type @depends_on = [ { "details_known_#{person_index}" => 0, - "person_#{person_index}_child_relation?" => (person_type == "child"), }, ] end @@ -15,7 +14,7 @@ class Form::Lettings::Pages::PersonAge < ::Form::Page def questions @questions ||= [ Form::Lettings::Questions::AgeKnown.new(nil, nil, self, person_index: @person_index), - Form::Lettings::Questions::Age.new(nil, nil, self, person_index: @person_index, person_type: @person_type), + Form::Lettings::Questions::Age.new(nil, nil, self, person_index: @person_index), ] end end diff --git a/app/models/form/lettings/pages/person_known.rb b/app/models/form/lettings/pages/person_known.rb index b864ab708..6e699926d 100644 --- a/app/models/form/lettings/pages/person_known.rb +++ b/app/models/form/lettings/pages/person_known.rb @@ -2,7 +2,6 @@ class Form::Lettings::Pages::PersonKnown < ::Form::Page def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @id = "person_#{person_index}_known" - @header = "You’ve given us the details for #{person_index - 1} person in the household" @depends_on = (person_index..8).map { |index| { "hhmemb" => index } } @person_index = person_index end diff --git a/app/models/form/lettings/pages/person_over_retirement_value_check.rb b/app/models/form/lettings/pages/person_over_retirement_value_check.rb index dbaf2d2e2..c094d4a93 100644 --- a/app/models/form/lettings/pages/person_over_retirement_value_check.rb +++ b/app/models/form/lettings/pages/person_over_retirement_value_check.rb @@ -2,11 +2,13 @@ class Form::Lettings::Pages::PersonOverRetirementValueCheck < ::Form::Page def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @depends_on = [{ "person_#{person_index}_not_retired_over_soft_max_age?" => true }] + @copy_key = "lettings.soft_validations.retirement_value_check" @title_text = { - "translation" => "soft_validations.retirement.max.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", } @informative_text = { - "translation" => "soft_validations.retirement.max.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } @person_index = person_index end diff --git a/app/models/form/lettings/pages/person_under_retirement_value_check.rb b/app/models/form/lettings/pages/person_under_retirement_value_check.rb index ab9c81beb..853afafe0 100644 --- a/app/models/form/lettings/pages/person_under_retirement_value_check.rb +++ b/app/models/form/lettings/pages/person_under_retirement_value_check.rb @@ -2,8 +2,9 @@ class Form::Lettings::Pages::PersonUnderRetirementValueCheck < ::Form::Page def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @depends_on = [{ "person_#{person_index}_retired_under_soft_min_age?" => true }] + @copy_key = "lettings.soft_validations.no_retirement_value_check" @title_text = { - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "age#{person_index}", @@ -12,7 +13,10 @@ class Form::Lettings::Pages::PersonUnderRetirementValueCheck < ::Form::Page }, ], } - @informative_text = {} + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } @person_index = person_index end 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/property_local_authority.rb b/app/models/form/lettings/pages/property_local_authority.rb index 1e3d34bd2..339ccb4d8 100644 --- a/app/models/form/lettings/pages/property_local_authority.rb +++ b/app/models/form/lettings/pages/property_local_authority.rb @@ -3,8 +3,8 @@ class Form::Lettings::Pages::PropertyLocalAuthority < ::Form::Page super @id = "property_local_authority" @depends_on = [ - { "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_after_2024?" => false }, - { "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_after_2024?" => true, "address_search_given?" => true }, + { "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_2024_or_later?" => false }, + { "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_2024_or_later?" => true, "address_search_given?" => true }, ] end 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/property_major_repairs_value_check.rb b/app/models/form/lettings/pages/property_major_repairs_value_check.rb index 08672aff6..d1c7be34c 100644 --- a/app/models/form/lettings/pages/property_major_repairs_value_check.rb +++ b/app/models/form/lettings/pages/property_major_repairs_value_check.rb @@ -2,10 +2,11 @@ class Form::Lettings::Pages::PropertyMajorRepairsValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "property_major_repairs_value_check" + @copy_key = "lettings.soft_validations.major_repairs_date_value_check" @depends_on = [{ "major_repairs_date_in_soft_range?" => true }] - @title_text = { "translation" => "soft_validations.major_repairs_date.title_text" } + @title_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text" } @informative_text = { - "translation" => "soft_validations.major_repairs_date.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } 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/pages/pscharge_value_check.rb b/app/models/form/lettings/pages/pscharge_value_check.rb index 6c8ada196..8ff953afd 100644 --- a/app/models/form/lettings/pages/pscharge_value_check.rb +++ b/app/models/form/lettings/pages/pscharge_value_check.rb @@ -2,16 +2,20 @@ class Form::Lettings::Pages::PschargeValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "pscharge_value_check" + @copy_key = "lettings.soft_validations.pscharge_value_check" @depends_on = [{ "pscharge_in_soft_max_range?" => true }] @title_text = { - "translation" => "soft_validations.pscharge.over_soft_max_title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [{ "key" => "pscharge", "label" => true, "i18n_template" => "pscharge", }], } - @informative_text = I18n.t("soft_validations.charges.informative_text") + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } 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/reasonother_value_check.rb b/app/models/form/lettings/pages/reasonother_value_check.rb index ccda997a7..ccc6be70d 100644 --- a/app/models/form/lettings/pages/reasonother_value_check.rb +++ b/app/models/form/lettings/pages/reasonother_value_check.rb @@ -2,13 +2,14 @@ class Form::Lettings::Pages::ReasonotherValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "reasonother_value_check" + @copy_key = "lettings.soft_validations.reasonother_value_check" @depends_on = [{ "reasonother_might_be_existing_category?" => true }] @title_text = { - "translation" => "soft_validations.reasonother.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [{ "key" => "reasonother", "i18n_template" => "reasonother" }], } @informative_text = { - "translation" => "soft_validations.reasonother.informative_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } 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/pages/referral_value_check.rb b/app/models/form/lettings/pages/referral_value_check.rb index 55f6f3e8b..aa3a34200 100644 --- a/app/models/form/lettings/pages/referral_value_check.rb +++ b/app/models/form/lettings/pages/referral_value_check.rb @@ -2,12 +2,13 @@ class Form::Lettings::Pages::ReferralValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "referral_value_check" + @copy_key = "lettings.soft_validations.referral_value_check" @depends_on = [{ "la_referral_for_general_needs?" => true }] @title_text = { - "translation" => "soft_validations.referral.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", } @informative_text = { - "translation" => "soft_validations.referral.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } end 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_value_check.rb b/app/models/form/lettings/pages/rent_value_check.rb new file mode 100644 index 000000000..5a1ecc847 --- /dev/null +++ b/app/models/form/lettings/pages/rent_value_check.rb @@ -0,0 +1,36 @@ +class Form::Lettings::Pages::RentValueCheck < ::Form::Page + def initialize(id, hsh, subsection, check_answers_card_number: nil) + super(id, hsh, subsection) + @depends_on = [{ "rent_soft_validation_triggered?" => true }] + @copy_key = "lettings.soft_validations.rent_value_check" + @title_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [ + { + "key" => "brent", + "label" => true, + "i18n_template" => "brent", + }, + ], + } + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [ + { + "key" => "rent_soft_validation_higher_or_lower_text", + "label" => false, + "i18n_template" => "higher_or_lower", + }, + ], + } + @check_answers_card_number = check_answers_card_number + end + + def questions + @questions ||= [Form::Lettings::Questions::RentValueCheck.new(nil, nil, self, check_answers_card_number: @check_answers_card_number)] + end + + def interruption_screen_question_ids + %w[brent period startdate uprn postcode_full la beds rent_type needstype] + end +end 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/pages/scharge_value_check.rb b/app/models/form/lettings/pages/scharge_value_check.rb index 73ee41920..bd9accfc1 100644 --- a/app/models/form/lettings/pages/scharge_value_check.rb +++ b/app/models/form/lettings/pages/scharge_value_check.rb @@ -2,16 +2,20 @@ class Form::Lettings::Pages::SchargeValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "scharge_value_check" + @copy_key = "lettings.soft_validations.scharge_value_check" @depends_on = [{ "scharge_in_soft_max_range?" => true }] @title_text = { - "translation" => "soft_validations.scharge.over_soft_max_title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [{ "key" => "scharge", "label" => true, "i18n_template" => "scharge", }], } - @informative_text = I18n.t("soft_validations.charges.informative_text") + @title_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } end def questions diff --git a/app/models/form/lettings/pages/starter_tenancy_type.rb b/app/models/form/lettings/pages/starter_tenancy_type.rb index fe147bc77..462d4fb37 100644 --- a/app/models/form/lettings/pages/starter_tenancy_type.rb +++ b/app/models/form/lettings/pages/starter_tenancy_type.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::StarterTenancyType < ::Form::Page def initialize(id, hsh, subsection) super @id = "starter_tenancy_type" + @copy_key = "lettings.tenancy_information.tenancy.starter_tenancy_type" @depends_on = [{ "starter_tenancy?" => true }] end diff --git a/app/models/form/lettings/pages/supcharg_value_check.rb b/app/models/form/lettings/pages/supcharg_value_check.rb index a974a8f89..89dcc89c1 100644 --- a/app/models/form/lettings/pages/supcharg_value_check.rb +++ b/app/models/form/lettings/pages/supcharg_value_check.rb @@ -2,16 +2,20 @@ class Form::Lettings::Pages::SupchargValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "supcharg_value_check" + @copy_key = "lettings.soft_validations.supcharg_value_check" @depends_on = [{ "supcharg_in_soft_max_range?" => true }] @title_text = { - "translation" => "soft_validations.supcharg.over_soft_max_title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [{ "key" => "supcharg", "label" => true, "i18n_template" => "supcharg", }], } - @informative_text = I18n.t("soft_validations.charges.informative_text") + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } end def questions diff --git a/app/models/form/lettings/pages/tenancy_length.rb b/app/models/form/lettings/pages/tenancy_length.rb index 006cd8e42..b855133bf 100644 --- a/app/models/form/lettings/pages/tenancy_length.rb +++ b/app/models/form/lettings/pages/tenancy_length.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::TenancyLength < ::Form::Page def initialize(id, hsh, subsection) super @id = "tenancy_length" + @copy_key = "lettings.tenancy_information.tenancylength.tenancy_length" @depends_on = [{ "tenancy_type_fixed_term?" => true, "needstype" => 2 }] end diff --git a/app/models/form/lettings/pages/tenancy_length_affordable_rent.rb b/app/models/form/lettings/pages/tenancy_length_affordable_rent.rb index aa88d81f9..cb292823a 100644 --- a/app/models/form/lettings/pages/tenancy_length_affordable_rent.rb +++ b/app/models/form/lettings/pages/tenancy_length_affordable_rent.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::TenancyLengthAffordableRent < ::Form::Page def initialize(id, hsh, subsection) super @id = "tenancy_length_affordable_rent" + @copy_key = "lettings.tenancy_information.tenancylength.tenancy_length_affordable_rent" @depends_on = [{ "tenancy_type_fixed_term?" => true, "affordable_or_social_rent?" => true, "needstype" => 1 }] end diff --git a/app/models/form/lettings/pages/tenancy_length_intermediate_rent.rb b/app/models/form/lettings/pages/tenancy_length_intermediate_rent.rb index 070d0abe1..a693a6f3d 100644 --- a/app/models/form/lettings/pages/tenancy_length_intermediate_rent.rb +++ b/app/models/form/lettings/pages/tenancy_length_intermediate_rent.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::TenancyLengthIntermediateRent < ::Form::Page def initialize(id, hsh, subsection) super @id = "tenancy_length_intermediate_rent" + @copy_key = "lettings.tenancy_information.tenancylength.tenancy_length_intermediate_rent" @depends_on = [{ "tenancy_type_fixed_term?" => true, "affordable_or_social_rent?" => false, "needstype" => 1 }] end diff --git a/app/models/form/lettings/pages/tenancy_length_periodic.rb b/app/models/form/lettings/pages/tenancy_length_periodic.rb index 9ea6553af..82972e796 100644 --- a/app/models/form/lettings/pages/tenancy_length_periodic.rb +++ b/app/models/form/lettings/pages/tenancy_length_periodic.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::TenancyLengthPeriodic < ::Form::Page def initialize(id, hsh, subsection) super @id = "tenancy_length_periodic" + @copy_key = "lettings.tenancy_information.tenancylength.tenancy_length_periodic" @depends_on = [{ "tenancy_type_periodic?" => true }] end diff --git a/app/models/form/lettings/pages/tenancy_type.rb b/app/models/form/lettings/pages/tenancy_type.rb index c15f6f27a..2d7eceb5f 100644 --- a/app/models/form/lettings/pages/tenancy_type.rb +++ b/app/models/form/lettings/pages/tenancy_type.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::TenancyType < ::Form::Page def initialize(id, hsh, subsection) super @id = "tenancy_type" + @copy_key = "lettings.tenancy_information.tenancy.tenancy_type" @depends_on = [{ "starter_tenancy?" => false }] end diff --git a/app/models/form/lettings/pages/uprn.rb b/app/models/form/lettings/pages/uprn.rb index d3c744b8f..b9a3a4e94 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 @@ -13,7 +14,7 @@ class Form::Lettings::Pages::Uprn < ::Form::Page end def skip_text - if form.start_year_after_2024? + if form.start_year_2024_or_later? "Search for address instead" else "Enter address instead" @@ -23,7 +24,7 @@ class Form::Lettings::Pages::Uprn < ::Form::Page def skip_href(log = nil) return unless log - if form.start_year_after_2024? + if form.start_year_2024_or_later? "address-matcher" else "address" 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/pages/void_date_value_check.rb b/app/models/form/lettings/pages/void_date_value_check.rb index 6ebd3a175..b5d7fdadd 100644 --- a/app/models/form/lettings/pages/void_date_value_check.rb +++ b/app/models/form/lettings/pages/void_date_value_check.rb @@ -2,10 +2,11 @@ class Form::Lettings::Pages::VoidDateValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "void_date_value_check" + @copy_key = "lettings.soft_validations.void_date_value_check" @depends_on = [{ "voiddate_in_soft_range?" => true }] - @title_text = { "translation" => "soft_validations.void_date.title_text" } + @title_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text" } @informative_text = { - "translation" => "soft_validations.void_date.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } end 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/age.rb b/app/models/form/lettings/questions/age.rb index 0a457203c..f35abe61e 100644 --- a/app/models/form/lettings/questions/age.rb +++ b/app/models/form/lettings/questions/age.rb @@ -1,9 +1,8 @@ class Form::Lettings::Questions::Age < ::Form::Question - def initialize(id, hsh, page, person_index:, person_type:) + def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "age#{person_index}" - @check_answer_label = "Person #{person_index}’s age" - @header = "Age" + @copy_key = "lettings.household_characteristics.age#{person_index}.age#{person_index}" @type = "numeric" @width = 2 @inferred_check_answers_value = [{ "condition" => { "age#{person_index}_known" => 1 }, "value" => "Not known" }] @@ -13,7 +12,6 @@ class Form::Lettings::Questions::Age < ::Form::Question @step = 1 @person_index = person_index @question_number = question_number - @person_type = person_type @hint_text = hint_text end @@ -29,10 +27,8 @@ class Form::Lettings::Questions::Age < ::Form::Question end def hint_text - if form.start_year_after_2024? + if form.start_year_2024_or_later? "Answer 1 for children aged under 1 year old" - elsif @person_type == "child" - "For a child under 1, enter 1" end end end diff --git a/app/models/form/lettings/questions/age1.rb b/app/models/form/lettings/questions/age1.rb index 922345e65..72d89096c 100644 --- a/app/models/form/lettings/questions/age1.rb +++ b/app/models/form/lettings/questions/age1.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::Age1 < ::Form::Question def initialize(id, hsh, page) super @id = "age1" - @check_answer_label = "Lead tenant’s age" - @header = "Age" + @copy_key = "lettings.household_characteristics.age1.age1" @type = "numeric" @width = 2 @inferred_check_answers_value = [{ "condition" => { "age1_known" => 1 }, "value" => "Not known" }] diff --git a/app/models/form/lettings/questions/age1_known.rb b/app/models/form/lettings/questions/age1_known.rb index 27c185de4..e54d7993b 100644 --- a/app/models/form/lettings/questions/age1_known.rb +++ b/app/models/form/lettings/questions/age1_known.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::Age1Known < ::Form::Question def initialize(id, hsh, page) super @id = "age1_known" - @check_answer_label = "" - @header = "Do you know the lead tenant’s age?" + @copy_key = "lettings.household_characteristics.age1.age1_known" @type = "radio" @check_answers_card_number = 1 @answer_options = ANSWER_OPTIONS @@ -14,13 +13,5 @@ class Form::Lettings::Questions::Age1Known < ::Form::Question ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze - def hint_text - if form.start_year_after_2024? - "The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same amount of paid work, the lead tenant is whoever is the oldest." - else - "The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 32, 2024 => 31 }.freeze end diff --git a/app/models/form/lettings/questions/age_known.rb b/app/models/form/lettings/questions/age_known.rb index 10ae7dad5..2f5d7ce0b 100644 --- a/app/models/form/lettings/questions/age_known.rb +++ b/app/models/form/lettings/questions/age_known.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::AgeKnown < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "age#{person_index}_known" - @check_answer_label = "" - @header = "Do you know person #{person_index}’s age?" + @copy_key = "lettings.household_characteristics.age#{person_index}.age#{person_index}_known" @type = "radio" @check_answers_card_number = person_index - @hint_text = "" @answer_options = ANSWER_OPTIONS @conditional_for = { "age#{person_index}" => [0] } @hidden_in_check_answers = { 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/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/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/care_home_charges_value_check.rb b/app/models/form/lettings/questions/care_home_charges_value_check.rb index fdb5aabbd..a5f0d2522 100644 --- a/app/models/form/lettings/questions/care_home_charges_value_check.rb +++ b/app/models/form/lettings/questions/care_home_charges_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::CareHomeChargesValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "carehome_charges_value_check" - @check_answer_label = "Care home charges confirmation" - @header = "Are you sure there are no care home charges?" + @copy_key = "lettings.soft_validations.care_home_charges_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS 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/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/declaration.rb b/app/models/form/lettings/questions/declaration.rb index 5d3f6d76b..3261452cd 100644 --- a/app/models/form/lettings/questions/declaration.rb +++ b/app/models/form/lettings/questions/declaration.rb @@ -2,16 +2,14 @@ class Form::Lettings::Questions::Declaration < ::Form::Question def initialize(id, hsh, page) super @id = "declaration" - @check_answer_label = "Tenant has seen the privacy notice" - @header = "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" + @check_answers_card_number = 0 unless form.start_year_2024_or_later? + @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 def answer_options - declaration_text = if form.start_year_after_2024? + declaration_text = if form.start_year_2024_or_later? "The tenant has seen or been given access to the MHCLG privacy notice" else "The tenant has seen the MHCLG privacy notice" @@ -21,7 +19,7 @@ class Form::Lettings::Questions::Declaration < ::Form::Question end def unanswered_error_message - if form.start_year_after_2024? + if form.start_year_2024_or_later? I18n.t("validations.declaration.missing.post_2024") else I18n.t("validations.declaration.missing.pre_2024") diff --git a/app/models/form/lettings/questions/details_known.rb b/app/models/form/lettings/questions/details_known.rb index f2850b65e..fda7a2eb7 100644 --- a/app/models/form/lettings/questions/details_known.rb +++ b/app/models/form/lettings/questions/details_known.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::DetailsKnown < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "details_known_#{person_index}" - @check_answer_label = "Details known for person #{person_index}" - @header = "Do you know details for person #{person_index}?" @type = "radio" @check_answers_card_number = person_index - @hint_text = "You must provide details for everyone in the household if you know them." @answer_options = ANSWER_OPTIONS end 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/ethnic_arab.rb b/app/models/form/lettings/questions/ethnic_arab.rb index 380de645f..d642c1a1b 100644 --- a/app/models/form/lettings/questions/ethnic_arab.rb +++ b/app/models/form/lettings/questions/ethnic_arab.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicArab < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic" - @check_answer_label = "Lead tenant’s ethnic background" - @header = "Which of the following best describes the lead tenant’s Arab background?" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_arab" @type = "radio" @check_answers_card_number = 1 - @hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @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/ethnic_asian.rb b/app/models/form/lettings/questions/ethnic_asian.rb index 33002533b..7fb309bba 100644 --- a/app/models/form/lettings/questions/ethnic_asian.rb +++ b/app/models/form/lettings/questions/ethnic_asian.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicAsian < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic" - @check_answer_label = "Lead tenant’s ethnic background" - @header = "Which of the following best describes the lead tenant’s Asian or Asian British background?" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_asian" @type = "radio" @check_answers_card_number = 1 - @hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @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/ethnic_black.rb b/app/models/form/lettings/questions/ethnic_black.rb index 16a886eb3..e3a88259e 100644 --- a/app/models/form/lettings/questions/ethnic_black.rb +++ b/app/models/form/lettings/questions/ethnic_black.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicBlack < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic" - @check_answer_label = "Lead tenant’s ethnic background" - @header = "Which of the following best describes the lead tenant’s Black, African, Caribbean or Black British background?" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_black" @type = "radio" @check_answers_card_number = 1 - @hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @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/ethnic_group.rb b/app/models/form/lettings/questions/ethnic_group.rb index c3093d48e..16bdfc4ba 100644 --- a/app/models/form/lettings/questions/ethnic_group.rb +++ b/app/models/form/lettings/questions/ethnic_group.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::EthnicGroup < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic_group" - @check_answer_label = "Lead tenant’s ethnic group" - @header = "What is the lead tenant’s ethnic group?" @type = "radio" @check_answers_card_number = 1 - @hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @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/ethnic_mixed.rb b/app/models/form/lettings/questions/ethnic_mixed.rb index cd7d7a4bb..14d1f213b 100644 --- a/app/models/form/lettings/questions/ethnic_mixed.rb +++ b/app/models/form/lettings/questions/ethnic_mixed.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicMixed < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic" - @check_answer_label = "Lead tenant’s ethnic background" - @header = "Which of the following best describes the lead tenant’s Mixed or Multiple ethnic groups background?" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_mixed" @type = "radio" @check_answers_card_number = 1 - @hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @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/ethnic_white.rb b/app/models/form/lettings/questions/ethnic_white.rb index 9c042b576..74430d840 100644 --- a/app/models/form/lettings/questions/ethnic_white.rb +++ b/app/models/form/lettings/questions/ethnic_white.rb @@ -2,16 +2,14 @@ class Form::Lettings::Questions::EthnicWhite < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic" - @check_answer_label = "Lead tenant’s ethnic background" - @header = "Which of the following best describes the lead tenant’s White background?" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_white" @type = "radio" @check_answers_card_number = 1 - @hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "English, Welsh, Northern Irish, Scottish or British" }, "2" => { "value" => "Irish" }, 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..bc1c66cb4 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 @@ -18,11 +15,11 @@ class Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing < ::Form::Q end def yes_hint - form.start_year_after_2024? ? "This property was previously used for other purposes or is a new-build." : "This is a new let." + form.start_year_2024_or_later? ? "This property was previously used for other purposes or is a new-build." : "This is a new let." end def no_hint - form.start_year_after_2024? ? "This is a re-let of existing social housing stock." : "This is a re-let of existing social housing." + form.start_year_2024_or_later? ? "This is a re-let of existing social housing stock." : "This is a re-let of existing social housing." end QUESTION_NUMBER_FROM_YEAR = { 2023 => 14, 2024 => 15 }.freeze diff --git a/app/models/form/lettings/questions/gender_identity1.rb b/app/models/form/lettings/questions/gender_identity1.rb index eefe20e15..411bcd3d0 100644 --- a/app/models/form/lettings/questions/gender_identity1.rb +++ b/app/models/form/lettings/questions/gender_identity1.rb @@ -2,8 +2,6 @@ class Form::Lettings::Questions::GenderIdentity1 < ::Form::Question def initialize(id, hsh, page) super @id = "sex1" - @check_answer_label = "Lead tenant’s gender identity" - @header = "Which of these best describes the lead tenant’s gender identity?" @type = "radio" @check_answers_card_number = 1 @answer_options = ANSWER_OPTIONS @@ -18,13 +16,5 @@ class Form::Lettings::Questions::GenderIdentity1 < ::Form::Question "R" => { "value" => "Tenant prefers not to say" }, }.freeze - def hint_text - if form.start_year_after_2024? - "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." - else - "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 33, 2024 => 32 }.freeze end 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/hhmemb.rb b/app/models/form/lettings/questions/hhmemb.rb index bd874d544..61fad98ef 100644 --- a/app/models/form/lettings/questions/hhmemb.rb +++ b/app/models/form/lettings/questions/hhmemb.rb @@ -2,14 +2,11 @@ class Form::Lettings::Questions::Hhmemb < ::Form::Question def initialize(id, hsh, page) super @id = "hhmemb" - @check_answer_label = "Number of household members" - @header = "How many people live in the household for this letting?" @type = "numeric" @width = 2 @check_answers_card_number = 0 @max = 8 @min = 1 - @hint_text = "You can provide details for a maximum of 8 people." @step = 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/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/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/housingneeds_other.rb b/app/models/form/lettings/questions/housingneeds_other.rb index 75834d3bb..fc403d00c 100644 --- a/app/models/form/lettings/questions/housingneeds_other.rb +++ b/app/models/form/lettings/questions/housingneeds_other.rb @@ -9,7 +9,7 @@ class Form::Lettings::Questions::HousingneedsOther < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Yes" }, "0" => { "value" => "No" }, 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..25dae3fc6 100644 --- a/app/models/form/lettings/questions/is_carehome.rb +++ b/app/models/form/lettings/questions/is_carehome.rb @@ -2,17 +2,15 @@ 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 def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Yes" }, "0" => { "value" => "No" }, diff --git a/app/models/form/lettings/questions/joint.rb b/app/models/form/lettings/questions/joint.rb index 5f3379c5d..e28a0085c 100644 --- a/app/models/form/lettings/questions/joint.rb +++ b/app/models/form/lettings/questions/joint.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Joint < ::Form::Question def initialize(id, hsh, page) super @id = "joint" - @check_answer_label = "Is this a joint tenancy?" - @header = "Is this a joint tenancy?" @type = "radio" @check_answers_card_number = 0 - @hint_text = form.start_year_after_2024? ? "This is where two or more people are named on the tenancy agreement" : "" @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/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/layear.rb b/app/models/form/lettings/questions/layear.rb index 5c2e9c195..fdaad6c22 100644 --- a/app/models/form/lettings/questions/layear.rb +++ b/app/models/form/lettings/questions/layear.rb @@ -2,16 +2,13 @@ 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 def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Just moved to local authority area with this new let" }, "2" => { "value" => "Less than 1 year" }, diff --git a/app/models/form/lettings/questions/letting_allocation.rb b/app/models/form/lettings/questions/letting_allocation.rb index c9742e97f..08310da13 100644 --- a/app/models/form/lettings/questions/letting_allocation.rb +++ b/app/models/form/lettings/questions/letting_allocation.rb @@ -2,16 +2,13 @@ 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 def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "cbl" => { "value" => "Choice-based lettings (CBL)", "hint" => "Where available vacant properties are advertised and applicants are able to bid for specific properties." }, "cap" => { "value" => "Common Allocation Policy (CAP)", "hint" => "Where a common system agreed between a group of housing providers is used to determine applicant’s priority for housing." }, diff --git a/app/models/form/lettings/questions/major_repairs_date_value_check.rb b/app/models/form/lettings/questions/major_repairs_date_value_check.rb index d024f1a8d..0e9cb4171 100644 --- a/app/models/form/lettings/questions/major_repairs_date_value_check.rb +++ b/app/models/form/lettings/questions/major_repairs_date_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::MajorRepairsDateValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "major_repairs_date_value_check" - @check_answer_label = "Major repairs date confirmation" - @header = "Are you sure the property has been vacant for this long?" + @copy_key = "lettings.soft_validations.major_repairs_date_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS 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/max_rent_value_check.rb b/app/models/form/lettings/questions/max_rent_value_check.rb deleted file mode 100644 index 6936e9e36..000000000 --- a/app/models/form/lettings/questions/max_rent_value_check.rb +++ /dev/null @@ -1,15 +0,0 @@ -class Form::Lettings::Questions::MaxRentValueCheck < ::Form::Question - def initialize(id, hsh, page, check_answers_card_number:) - super(id, hsh, page) - @id = "rent_value_check" - @check_answer_label = "Total rent confirmation" - @header = "Are you sure this is correct?" - @type = "interruption_screen" - @hint_text = I18n.t("soft_validations.rent.hint_text", higher_or_lower: "higher") - @check_answers_card_number = check_answers_card_number - @answer_options = ANSWER_OPTIONS - @hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] } - end - - ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze -end 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/multiple_partners_value_check.rb b/app/models/form/lettings/questions/multiple_partners_value_check.rb index 65320ffdf..9dd9f7015 100644 --- a/app/models/form/lettings/questions/multiple_partners_value_check.rb +++ b/app/models/form/lettings/questions/multiple_partners_value_check.rb @@ -2,7 +2,7 @@ class Form::Lettings::Questions::MultiplePartnersValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "multiple_partners_value_check" - @check_answer_label = "Multiple partners confirmation" + @copy_key = "lettings.soft_validations.multiple_partners_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Lettings::Questions::MultiplePartnersValueCheck < ::Form::Question ], } @check_answers_card_number = person_index - @header = "Are you sure this is correct?" end end diff --git a/app/models/form/lettings/questions/nationality.rb b/app/models/form/lettings/questions/nationality.rb index 51cbec936..8c4a700c1 100644 --- a/app/models/form/lettings/questions/nationality.rb +++ b/app/models/form/lettings/questions/nationality.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Nationality < ::Form::Question def initialize(id, hsh, page) super @id = "national" - @check_answer_label = "Lead tenant’s nationality" - @header = "What is the nationality of the lead tenant?" @type = "radio" @check_answers_card_number = 1 - @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @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/nationality_all.rb b/app/models/form/lettings/questions/nationality_all.rb index a8324595f..8a0e3d1d9 100644 --- a/app/models/form/lettings/questions/nationality_all.rb +++ b/app/models/form/lettings/questions/nationality_all.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::NationalityAll < ::Form::Question def initialize(id, hsh, page) super @id = "nationality_all" - @check_answer_label = "Lead tenant’s nationality" - @header = "Enter a nationality" + @copy_key = "lettings.household_characteristics.nationality_all.nationality_all" @type = "select" @check_answers_card_number = 1 @answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/nationality_all_group.rb b/app/models/form/lettings/questions/nationality_all_group.rb index 53534851b..559b1c9a0 100644 --- a/app/models/form/lettings/questions/nationality_all_group.rb +++ b/app/models/form/lettings/questions/nationality_all_group.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::NationalityAllGroup < ::Form::Question def initialize(id, hsh, page) super @id = "nationality_all_group" - @check_answer_label = "Lead tenant’s nationality" - @header = "What is the nationality of the lead tenant?" + @copy_key = "lettings.household_characteristics.nationality_all.nationality_all_group" @type = "radio" @check_answers_card_number = 1 - @hint_text = "If the lead tenant is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the tenant should decide which country to enter." @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @conditional_for = { "nationality_all" => [12] } 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/net_income_value_check.rb b/app/models/form/lettings/questions/net_income_value_check.rb index 8267b3b22..4e85fee90 100644 --- a/app/models/form/lettings/questions/net_income_value_check.rb +++ b/app/models/form/lettings/questions/net_income_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::NetIncomeValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "net_income_value_check" - @check_answer_label = "Net income confirmation" - @header = "Are you sure this is correct?" + @copy_key = "lettings.soft_validations.net_income_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/no_retirement_value_check.rb b/app/models/form/lettings/questions/no_retirement_value_check.rb index 0e2033c61..82784dec8 100644 --- a/app/models/form/lettings/questions/no_retirement_value_check.rb +++ b/app/models/form/lettings/questions/no_retirement_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::NoRetirementValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "retirement_value_check" - @check_answer_label = "Retirement confirmation" - @header = "Are you sure this person is retired?" + @copy_key = "lettings.soft_validations.no_retirement_value_check" @type = "interruption_screen" @check_answers_card_number = person_index @answer_options = ANSWER_OPTIONS 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/partner_under_16_value_check.rb b/app/models/form/lettings/questions/partner_under_16_value_check.rb index 7cda45cb5..bc11aec47 100644 --- a/app/models/form/lettings/questions/partner_under_16_value_check.rb +++ b/app/models/form/lettings/questions/partner_under_16_value_check.rb @@ -2,7 +2,7 @@ class Form::Lettings::Questions::PartnerUnder16ValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "partner_under_16_value_check" - @check_answer_label = "Partner under 16 confirmation" + @copy_key = "lettings.soft_validations.partner_under_16_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Lettings::Questions::PartnerUnder16ValueCheck < ::Form::Question ], } @check_answers_card_number = person_index - @header = "Are you sure this is correct?" end 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/person_gender_identity.rb b/app/models/form/lettings/questions/person_gender_identity.rb index 21244938d..0d76d23e3 100644 --- a/app/models/form/lettings/questions/person_gender_identity.rb +++ b/app/models/form/lettings/questions/person_gender_identity.rb @@ -2,8 +2,6 @@ class Form::Lettings::Questions::PersonGenderIdentity < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "sex#{person_index}" - @check_answer_label = "Person #{person_index}’s gender identity" - @header = "Which of these best describes person #{person_index}’s gender identity?" @type = "radio" @check_answers_card_number = person_index @answer_options = ANSWER_OPTIONS @@ -19,14 +17,6 @@ class Form::Lettings::Questions::PersonGenderIdentity < ::Form::Question "R" => { "value" => "Person prefers not to say" }, }.freeze - def hint_text - if form.start_year_after_2024? - "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." - else - "" - end - end - def question_number base_question_number = case form.start_date.year when 2023 diff --git a/app/models/form/lettings/questions/person_relationship.rb b/app/models/form/lettings/questions/person_relationship.rb index c20ec9f2c..d39cb49ff 100644 --- a/app/models/form/lettings/questions/person_relationship.rb +++ b/app/models/form/lettings/questions/person_relationship.rb @@ -2,18 +2,15 @@ class Form::Lettings::Questions::PersonRelationship < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "relat#{person_index}" - @check_answer_label = "Person #{person_index}’s relationship to the lead tenant" - @header = "What is person #{person_index}’s relationship to the lead tenant?" @type = "radio" @check_answers_card_number = person_index - @hint_text = "" @answer_options = answer_options @person_index = person_index @question_number = question_number end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "P" => { "value" => "Partner" }, "C" => { "value" => "Child" }, diff --git a/app/models/form/lettings/questions/person_working_situation.rb b/app/models/form/lettings/questions/person_working_situation.rb index 3d223a943..cc4644f48 100644 --- a/app/models/form/lettings/questions/person_working_situation.rb +++ b/app/models/form/lettings/questions/person_working_situation.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::PersonWorkingSituation < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "ecstat#{person_index}" - @check_answer_label = "Person #{person_index}’s working situation" - @header = "Which of these best describes person #{person_index}’s working situation?" @type = "radio" @check_answers_card_number = person_index - @hint_text = "" @person_index = person_index @question_number = question_number @answer_options = answer_options 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/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/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/pregnancy_value_check.rb b/app/models/form/lettings/questions/pregnancy_value_check.rb index 9ef1778c2..0ddddecec 100644 --- a/app/models/form/lettings/questions/pregnancy_value_check.rb +++ b/app/models/form/lettings/questions/pregnancy_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::PregnancyValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "pregnancy_value_check" - @check_answer_label = "Pregnancy confirmation" - @header = "Are you sure this is correct?" + @copy_key = page.copy_key @type = "interruption_screen" @check_answers_card_number = person_index @answer_options = ANSWER_OPTIONS 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_let_type.rb b/app/models/form/lettings/questions/previous_let_type.rb index d9c018820..8c50cb41a 100644 --- a/app/models/form/lettings/questions/previous_let_type.rb +++ b/app/models/form/lettings/questions/previous_let_type.rb @@ -2,12 +2,9 @@ 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 + @answer_options = form.start_year_2024_or_later? ? 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/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/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_value_check.rb b/app/models/form/lettings/questions/pscharge_value_check.rb index b44979ae1..efb94fb53 100644 --- a/app/models/form/lettings/questions/pscharge_value_check.rb +++ b/app/models/form/lettings/questions/pscharge_value_check.rb @@ -2,13 +2,11 @@ class Form::Lettings::Questions::PschargeValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "pscharge_value_check" - @check_answer_label = "Personal service charge confirmation" - @header = "Are you sure?" + @copy_key = "lettings.soft_validations.pscharge_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "pscharge_value_check" => 0 }, { "pscharge_value_check" => 1 }] } - @hint_text = I18n.t("soft_validations.charges.hint_text") end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze 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/reason.rb b/app/models/form/lettings/questions/reason.rb index 223d68634..3a659fc5c 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, @@ -16,7 +14,7 @@ class Form::Lettings::Questions::Reason < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "50" => { "value" => "End of social or private sector tenancy - no fault" }, "51" => { "value" => "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)" }, diff --git a/app/models/form/lettings/questions/reason_renewal.rb b/app/models/form/lettings/questions/reason_renewal.rb index 7f32b0bba..c00bd2581 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" => [ @@ -16,7 +14,7 @@ class Form::Lettings::Questions::ReasonRenewal < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "50" => { "value" => "End of social or private sector tenancy - no fault" }, "51" => { "value" => "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)" }, 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/reasonother_value_check.rb b/app/models/form/lettings/questions/reasonother_value_check.rb index 865f38764..9fb5618fc 100644 --- a/app/models/form/lettings/questions/reasonother_value_check.rb +++ b/app/models/form/lettings/questions/reasonother_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::ReasonotherValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "reasonother_value_check" - @check_answer_label = "Reason other confirmation" - @header = "Are you sure this doesn’t fit an existing category?" + @copy_key = "lettings.soft_validations.reasonother_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS 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..98e5a9186 100644 --- a/app/models/form/lettings/questions/referral.rb +++ b/app/models/form/lettings/questions/referral.rb @@ -2,16 +2,14 @@ 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 def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Internal transfer", diff --git a/app/models/form/lettings/questions/referral_prp.rb b/app/models/form/lettings/questions/referral_prp.rb index 6a8fa63de..96da2cba3 100644 --- a/app/models/form/lettings/questions/referral_prp.rb +++ b/app/models/form/lettings/questions/referral_prp.rb @@ -2,16 +2,14 @@ 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 def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Internal transfer", diff --git a/app/models/form/lettings/questions/referral_supported_housing.rb b/app/models/form/lettings/questions/referral_supported_housing.rb index d9ede5a83..d8d05fade 100644 --- a/app/models/form/lettings/questions/referral_supported_housing.rb +++ b/app/models/form/lettings/questions/referral_supported_housing.rb @@ -2,16 +2,14 @@ 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 def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Internal transfer", 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..75cc218fe 100644 --- a/app/models/form/lettings/questions/referral_supported_housing_prp.rb +++ b/app/models/form/lettings/questions/referral_supported_housing_prp.rb @@ -2,16 +2,14 @@ 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 def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Internal transfer", diff --git a/app/models/form/lettings/questions/referral_value_check.rb b/app/models/form/lettings/questions/referral_value_check.rb index 30aa45f4c..04dfadd9e 100644 --- a/app/models/form/lettings/questions/referral_value_check.rb +++ b/app/models/form/lettings/questions/referral_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::ReferralValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "referral_value_check" - @check_answer_label = "Referral confirmation" - @header = "Are you sure?" + @copy_key = "lettings.soft_validations.referral_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/rent_type.rb b/app/models/form/lettings/questions/rent_type.rb index 818ead98a..b941dfcc3 100644 --- a/app/models/form/lettings/questions/rent_type.rb +++ b/app/models/form/lettings/questions/rent_type.rb @@ -4,8 +4,8 @@ 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" - @answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_2024 : ANSWER_OPTIONS + @top_guidance_partial = "rent_type_definitions" + @answer_options = form.start_year_2024_or_later? ? 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? end diff --git a/app/models/form/lettings/questions/min_rent_value_check.rb b/app/models/form/lettings/questions/rent_value_check.rb similarity index 64% rename from app/models/form/lettings/questions/min_rent_value_check.rb rename to app/models/form/lettings/questions/rent_value_check.rb index ad4111c61..fb7ac8d16 100644 --- a/app/models/form/lettings/questions/min_rent_value_check.rb +++ b/app/models/form/lettings/questions/rent_value_check.rb @@ -1,11 +1,9 @@ -class Form::Lettings::Questions::MinRentValueCheck < ::Form::Question +class Form::Lettings::Questions::RentValueCheck < ::Form::Question def initialize(id, hsh, page, check_answers_card_number:) super(id, hsh, page) @id = "rent_value_check" - @check_answer_label = "Total rent confirmation" - @header = "Are you sure this is correct?" + @copy_key = "lettings.soft_validations.rent_value_check" @type = "interruption_screen" - @hint_text = I18n.t("soft_validations.rent.hint_text", higher_or_lower: "lower") @check_answers_card_number = check_answers_card_number @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] } diff --git a/app/models/form/lettings/questions/retirement_value_check.rb b/app/models/form/lettings/questions/retirement_value_check.rb index 63a286d61..23d077fbf 100644 --- a/app/models/form/lettings/questions/retirement_value_check.rb +++ b/app/models/form/lettings/questions/retirement_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::RetirementValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "retirement_value_check" - @check_answer_label = "Retirement confirmation" - @header = "Are you sure this person isn’t retired?" + @copy_key = "lettings.soft_validations.retirement_value_check" @type = "interruption_screen" @check_answers_card_number = person_index @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/rsnvac.rb b/app/models/form/lettings/questions/rsnvac.rb index 303f2ea48..3f767d311 100644 --- a/app/models/form/lettings/questions/rsnvac.rb +++ b/app/models/form/lettings/questions/rsnvac.rb @@ -2,16 +2,13 @@ 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 def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "14" => { "value" => "Renewal of fixed-term tenancy", 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/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_value_check.rb b/app/models/form/lettings/questions/scharge_value_check.rb index 1946d603f..0f761b7aa 100644 --- a/app/models/form/lettings/questions/scharge_value_check.rb +++ b/app/models/form/lettings/questions/scharge_value_check.rb @@ -2,13 +2,11 @@ class Form::Lettings::Questions::SchargeValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "scharge_value_check" - @check_answer_label = "Service charge confirmation" - @header = "Are you sure?" + @copy_key = "lettings.soft_validations.scharge_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "scharge_value_check" => 0 }, { "scharge_value_check" => 1 }] } - @hint_text = I18n.t("soft_validations.charges.hint_text") end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze 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/sheltered.rb b/app/models/form/lettings/questions/sheltered.rb index 7b78a9b30..458772675 100644 --- a/app/models/form/lettings/questions/sheltered.rb +++ b/app/models/form/lettings/questions/sheltered.rb @@ -2,16 +2,13 @@ class Form::Lettings::Questions::Sheltered < ::Form::Question def initialize(id, hsh, page) super @id = "sheltered" - @check_answer_label = "Is this letting in sheltered accommodation?" - @header = "Is this letting in sheltered accommodation?" @type = "radio" @check_answers_card_number = 0 - @hint_text = "Sheltered housing and special retirement housing are for tenants with low-level care and support needs. This typically provides some limited support to enable independent living, such as alarm-based assistance or a scheme manager.

Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission." @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Yes – specialist retirement housing" }, "2" => { "value" => "Yes – extra care housing" }, "5" => { "value" => "Yes – sheltered housing for adults aged under 55 years" }, diff --git a/app/models/form/lettings/questions/starter_tenancy_type.rb b/app/models/form/lettings/questions/starter_tenancy_type.rb index 9157c8e18..03d3fee88 100644 --- a/app/models/form/lettings/questions/starter_tenancy_type.rb +++ b/app/models/form/lettings/questions/starter_tenancy_type.rb @@ -2,17 +2,15 @@ class Form::Lettings::Questions::StarterTenancyType < ::Form::Question def initialize(id, hsh, page) super @id = "tenancy" - @check_answer_label = form.start_year_after_2024? ? "Type of main tenancy after the starter or introductory period has ended" : "Type of main tenancy after the starter period has ended" - @header = form.start_year_after_2024? ? "What is the type of tenancy after the starter or introductory period has ended?" : "What is the type of tenancy after the starter period has ended?" + @copy_key = "lettings.tenancy_information.tenancy.#{page.id}.tenancy" @type = "radio" @check_answers_card_number = 0 - @hint_text = form.start_year_after_2024? ? "" : "This is also known as an ‘introductory period’." @conditional_for = { "tenancyother" => [3] } @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "4" => { "value" => "Assured Shorthold Tenancy (AST) – Fixed term", diff --git a/app/models/form/lettings/questions/startertenancy.rb b/app/models/form/lettings/questions/startertenancy.rb index 0e461a25e..44b592cd6 100644 --- a/app/models/form/lettings/questions/startertenancy.rb +++ b/app/models/form/lettings/questions/startertenancy.rb @@ -2,8 +2,6 @@ class Form::Lettings::Questions::Startertenancy < ::Form::Question def initialize(id, hsh, page) super @id = "startertenancy" - @check_answer_label = "Is this a starter or introductory tenancy?" - @header = "Is this a starter tenancy?" @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS @@ -12,14 +10,5 @@ class Form::Lettings::Questions::Startertenancy < ::Form::Question ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "2" => { "value" => "No" } }.freeze - def hint_text - if form.start_year_after_2024? - "If the tenancy has an ‘introductory period’ answer ‘yes’.

- You should submit a CORE log at the beginning of the starter tenancy or introductory period, with the best information you have at the time. You do not need to submit a log when a tenant later rolls onto the main tenancy." - else - "This is also known as an ‘introductory period’." - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 26 }.freeze end 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_value_check.rb b/app/models/form/lettings/questions/supcharg_value_check.rb index 978c5e3ef..10fd6562c 100644 --- a/app/models/form/lettings/questions/supcharg_value_check.rb +++ b/app/models/form/lettings/questions/supcharg_value_check.rb @@ -2,13 +2,11 @@ class Form::Lettings::Questions::SupchargValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "supcharg_value_check" - @check_answer_label = "Support charge confirmation" - @header = "Are you sure?" + @copy_key = "lettings.soft_validations.supcharg_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "supcharg_value_check" => 0 }, { "supcharg_value_check" => 1 }] } - @hint_text = I18n.t("soft_validations.charges.hint_text") end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze 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/tenancy_length.rb b/app/models/form/lettings/questions/tenancy_length.rb index b94d41af5..1bf868377 100644 --- a/app/models/form/lettings/questions/tenancy_length.rb +++ b/app/models/form/lettings/questions/tenancy_length.rb @@ -2,14 +2,12 @@ class Form::Lettings::Questions::TenancyLength < ::Form::Question def initialize(id, hsh, page) super @id = "tenancylength" - @check_answer_label = "Length of fixed-term tenancy" - @header = "What is the length of the fixed-term tenancy to the nearest year?" + @copy_key = "lettings.tenancy_information.tenancylength.#{page.id}" @type = "numeric" @width = 2 @check_answers_card_number = 0 @max = 150 @min = 0 - @hint_text = "Do not include the starter or introductory period." @step = 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/tenancy_length_affordable_rent.rb b/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb index bea745ae1..8e79924aa 100644 --- a/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb +++ b/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::TenancyLengthAffordableRent < ::Form::Question def initialize(id, hsh, page) super @id = "tenancylength" - @check_answer_label = "Length of fixed-term tenancy" - @header = "What is the length of the fixed-term tenancy to the nearest year?" + @copy_key = "lettings.tenancy_information.tenancylength.#{page.id}" @type = "numeric" @width = 2 @check_answers_card_number = 0 @@ -13,13 +12,5 @@ class Form::Lettings::Questions::TenancyLengthAffordableRent < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - def hint_text - if form.start_year_after_2024? - "Do not include the starter or introductory period.
The minimum period is 2 years for social or affordable rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 2 years." - else - "Do not include the starter or introductory period.
The minimum period is 2 years for social or affordable rent general needs logs and you do not need a log for shorter tenancies." - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb b/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb index 835efd429..1bf3bd7cc 100644 --- a/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb +++ b/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::TenancyLengthIntermediateRent < ::Form::Questio def initialize(id, hsh, page) super @id = "tenancylength" - @check_answer_label = "Length of fixed-term tenancy" - @header = "What is the length of the fixed-term tenancy to the nearest year?" + @copy_key = "lettings.tenancy_information.tenancylength.#{page.id}" @type = "numeric" @width = 2 @check_answers_card_number = 0 @@ -13,13 +12,5 @@ class Form::Lettings::Questions::TenancyLengthIntermediateRent < ::Form::Questio @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - def hint_text - if form.start_year_after_2024? - "Do not include the starter or introductory period.
The minimum period is 1 year for intermediate rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 1 year." - else - "Do not include the starter or introductory period.
The minimum period is 1 year for intermediate rent general needs logs and you do not need a log for shorter tenancies." - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length_periodic.rb b/app/models/form/lettings/questions/tenancy_length_periodic.rb index 113435dd6..c65f41399 100644 --- a/app/models/form/lettings/questions/tenancy_length_periodic.rb +++ b/app/models/form/lettings/questions/tenancy_length_periodic.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::TenancyLengthPeriodic < ::Form::Question def initialize(id, hsh, page) super @id = "tenancylength" - @check_answer_label = "Length of periodic tenancy" - @header = "What is the length of the periodic tenancy to the nearest year?" + @copy_key = "lettings.tenancy_information.tenancylength.#{page.id}" @type = "numeric" @width = 2 @check_answers_card_number = 0 @@ -11,7 +10,6 @@ class Form::Lettings::Questions::TenancyLengthPeriodic < ::Form::Question @min = 0 @step = 1 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] - @hint_text = "As this is a periodic tenancy, this question is optional. If you do not have the information available click save and continue" end QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze diff --git a/app/models/form/lettings/questions/tenancy_other.rb b/app/models/form/lettings/questions/tenancy_other.rb index 21e932250..3fb3469ee 100644 --- a/app/models/form/lettings/questions/tenancy_other.rb +++ b/app/models/form/lettings/questions/tenancy_other.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::TenancyOther < ::Form::Question def initialize(id, hsh, page) super @id = "tenancyother" - @check_answer_label = "" - @header = "Please state the tenancy type" + @copy_key = "lettings.tenancy_information.tenancy.#{page.id}.tenancyother" @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/tenancy_type.rb b/app/models/form/lettings/questions/tenancy_type.rb index b4ed6aca4..c67895bef 100644 --- a/app/models/form/lettings/questions/tenancy_type.rb +++ b/app/models/form/lettings/questions/tenancy_type.rb @@ -2,17 +2,15 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question def initialize(id, hsh, page) super @id = "tenancy" - @check_answer_label = "Type of main tenancy" - @header = "What is the type of tenancy?" + @copy_key = "lettings.tenancy_information.tenancy.#{page.id}.tenancy" @type = "radio" @check_answers_card_number = 0 - @hint_text = "" @conditional_for = { "tenancyother" => [3] } @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "4" => { "value" => "Assured Shorthold Tenancy (AST) – Fixed term", 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/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/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_confirmation.rb b/app/models/form/lettings/questions/uprn_confirmation.rb index 1c31485b6..2f03cb357 100644 --- a/app/models/form/lettings/questions/uprn_confirmation.rb +++ b/app/models/form/lettings/questions/uprn_confirmation.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::UprnConfirmation < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Yes" }, "0" => { "value" => "No, I want to search for the address instead" }, 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/void_date_value_check.rb b/app/models/form/lettings/questions/void_date_value_check.rb index 22446061f..faf507a1b 100644 --- a/app/models/form/lettings/questions/void_date_value_check.rb +++ b/app/models/form/lettings/questions/void_date_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::VoidDateValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "void_date_value_check" - @check_answer_label = "Void date confirmation" - @header = "Are you sure the property has been vacant for this long?" + @copy_key = "lettings.soft_validations.void_date_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS 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/waityear.rb b/app/models/form/lettings/questions/waityear.rb index 94187e62b..67a560167 100644 --- a/app/models/form/lettings/questions/waityear.rb +++ b/app/models/form/lettings/questions/waityear.rb @@ -2,16 +2,13 @@ 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 def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "2" => { "value" => "Less than 1 year" }, "7" => { "value" => "1 year but under 2 years" }, 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/questions/working_situation1.rb b/app/models/form/lettings/questions/working_situation1.rb index b2facdf01..dbaf4fc7a 100644 --- a/app/models/form/lettings/questions/working_situation1.rb +++ b/app/models/form/lettings/questions/working_situation1.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::WorkingSituation1 < ::Form::Question def initialize(id, hsh, page) super @id = "ecstat1" - @check_answer_label = "Lead tenant’s working situation" - @header = "Which of these best describes the lead tenant’s working situation?" @type = "radio" @check_answers_card_number = 1 - @hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @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/household_characteristics.rb b/app/models/form/lettings/subsections/household_characteristics.rb index b74cc3792..61334d84c 100644 --- a/app/models/form/lettings/subsections/household_characteristics.rb +++ b/app/models/form/lettings/subsections/household_characteristics.rb @@ -8,7 +8,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection def pages @pages ||= [ - (Form::Lettings::Pages::Declaration.new(nil, nil, self) unless form.start_year_after_2024?), + (Form::Lettings::Pages::Declaration.new(nil, nil, self) unless form.start_year_2024_or_later?), Form::Lettings::Pages::HouseholdMembers.new(nil, nil, self), Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadHhmembValueCheck.new(nil, nil, self), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadHhmembValueCheck.new(nil, nil, self), @@ -33,9 +33,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::LeadTenantOverRetirementValueCheck.new("working_situation_lead_tenant_over_retirement_value_check", nil, self), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 2), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), - (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), - Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 2, person_type: "child"), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), + (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 2), @@ -43,7 +42,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection person_index: 2), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_2_under_retirement_value_check", nil, self, person_index: 2), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_2_over_retirement_value_check", nil, self, person_index: 2), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -54,9 +53,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_2_over_retirement_value_check", nil, self, person_index: 2), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 3), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), - (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), - Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 3, person_type: "child"), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?), + (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 3), @@ -64,7 +62,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection person_index: 3), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_3_under_retirement_value_check", nil, self, person_index: 3), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_3_over_retirement_value_check", nil, self, person_index: 3), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -75,9 +73,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_3_over_retirement_value_check", nil, self, person_index: 3), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 4), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), - (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), - Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 4, person_type: "child"), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?), + (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 4), @@ -85,7 +82,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection person_index: 4), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_4_under_retirement_value_check", nil, self, person_index: 4), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_4_over_retirement_value_check", nil, self, person_index: 4), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -96,9 +93,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_4_over_retirement_value_check", nil, self, person_index: 4), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 5), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), - (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), - Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 5, person_type: "child"), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?), + (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 5), @@ -106,7 +102,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection person_index: 5), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_5_under_retirement_value_check", nil, self, person_index: 5), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_5_over_retirement_value_check", nil, self, person_index: 5), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -117,9 +113,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_5_over_retirement_value_check", nil, self, person_index: 5), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 6), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), - (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), - Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 6, person_type: "child"), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?), + (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 6), @@ -127,7 +122,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection person_index: 6), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_6_under_retirement_value_check", nil, self, person_index: 6), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_6_over_retirement_value_check", nil, self, person_index: 6), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -138,9 +133,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_6_over_retirement_value_check", nil, self, person_index: 6), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 7), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_after_2024?), - (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_7_multiple_partners_value_check", nil, self, person_index: 7) if form.start_year_after_2024?), - Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 7, person_type: "child"), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_2024_or_later?), + (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_7_multiple_partners_value_check", nil, self, person_index: 7) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 7), @@ -148,7 +142,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection person_index: 7), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_7_under_retirement_value_check", nil, self, person_index: 7), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_7_over_retirement_value_check", nil, self, person_index: 7), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -159,9 +153,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_7_over_retirement_value_check", nil, self, person_index: 7), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 8), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_after_2024?), - (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_8_multiple_partners_value_check", nil, self, person_index: 8) if form.start_year_after_2024?), - Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 8, person_type: "child"), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_2024_or_later?), + (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_8_multiple_partners_value_check", nil, self, person_index: 8) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 8), @@ -169,7 +162,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection person_index: 8), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_8_under_retirement_value_check", nil, self, person_index: 8), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_8_over_retirement_value_check", nil, self, person_index: 8), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, diff --git a/app/models/form/lettings/subsections/household_situation.rb b/app/models/form/lettings/subsections/household_situation.rb index 6646d7230..dc3fd608b 100644 --- a/app/models/form/lettings/subsections/household_situation.rb +++ b/app/models/form/lettings/subsections/household_situation.rb @@ -12,7 +12,7 @@ class Form::Lettings::Subsections::HouseholdSituation < ::Form::Subsection Form::Lettings::Pages::TimeOnWaitingList.new(nil, nil, self), Form::Lettings::Pages::ReasonForLeavingLastSettledHome.new(nil, nil, self), Form::Lettings::Pages::ReasonForLeavingLastSettledHomeRenewal.new(nil, nil, self), - (Form::Lettings::Pages::ReasonotherValueCheck.new(nil, nil, self) if form.start_year_after_2024?), + (Form::Lettings::Pages::ReasonotherValueCheck.new(nil, nil, self) if form.start_year_2024_or_later?), Form::Lettings::Pages::PreviousHousingSituation.new(nil, nil, self), Form::Lettings::Pages::PreviousHousingSituationRenewal.new(nil, nil, self), Form::Lettings::Pages::Homelessness.new("homelessness", nil, self), diff --git a/app/models/form/lettings/subsections/income_and_benefits.rb b/app/models/form/lettings/subsections/income_and_benefits.rb index 1404ebf04..2be2fb9a5 100644 --- a/app/models/form/lettings/subsections/income_and_benefits.rb +++ b/app/models/form/lettings/subsections/income_and_benefits.rb @@ -24,8 +24,7 @@ class Form::Lettings::Subsections::IncomeAndBenefits < ::Form::Subsection Form::Lettings::Pages::RentBiWeekly.new(nil, nil, self), Form::Lettings::Pages::Rent4Weekly.new(nil, nil, self), Form::Lettings::Pages::RentMonthly.new(nil, nil, self), - Form::Lettings::Pages::MinRentValueCheck.new("brent_min_rent_value_check", nil, self, check_answers_card_number: 0), - Form::Lettings::Pages::MaxRentValueCheck.new("brent_max_rent_value_check", nil, self, check_answers_card_number: 0), + Form::Lettings::Pages::RentValueCheck.new("brent_rent_value_check", nil, self, check_answers_card_number: 0), Form::Lettings::Pages::SchargeValueCheck.new(nil, nil, self), Form::Lettings::Pages::PschargeValueCheck.new(nil, nil, self), Form::Lettings::Pages::SupchargValueCheck.new(nil, nil, self), diff --git a/app/models/form/lettings/subsections/property_information.rb b/app/models/form/lettings/subsections/property_information.rb index 67a22c7f5..c80e49e84 100644 --- a/app/models/form/lettings/subsections/property_information.rb +++ b/app/models/form/lettings/subsections/property_information.rb @@ -10,8 +10,7 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection @pages ||= [ uprn_questions, Form::Lettings::Pages::PropertyLocalAuthority.new(nil, nil, self), - Form::Lettings::Pages::MinRentValueCheck.new("local_authority_min_rent_value_check", nil, self, check_answers_card_number: nil), - Form::Lettings::Pages::MaxRentValueCheck.new("local_authority_max_rent_value_check", nil, self, check_answers_card_number: nil), + Form::Lettings::Pages::RentValueCheck.new("local_authority_rent_value_check", nil, self, check_answers_card_number: nil), Form::Lettings::Pages::FirstTimePropertyLetAsSocialHousing.new(nil, nil, self), Form::Lettings::Pages::PropertyLetType.new(nil, nil, self), Form::Lettings::Pages::PropertyVacancyReasonNotFirstLet.new(nil, nil, self), @@ -21,8 +20,7 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection Form::Lettings::Pages::PropertyBuildingType.new(nil, nil, self), Form::Lettings::Pages::PropertyWheelchairAccessible.new(nil, nil, self), Form::Lettings::Pages::PropertyNumberOfBedrooms.new(nil, nil, self), - Form::Lettings::Pages::MinRentValueCheck.new("beds_min_rent_value_check", nil, self, check_answers_card_number: 0), - Form::Lettings::Pages::MaxRentValueCheck.new("beds_max_rent_value_check", nil, self, check_answers_card_number: 0), + Form::Lettings::Pages::RentValueCheck.new("beds_rent_value_check", nil, self, check_answers_card_number: 0), Form::Lettings::Pages::VoidDate.new(nil, nil, self), Form::Lettings::Pages::VoidDateValueCheck.new(nil, nil, self), Form::Lettings::Pages::PropertyMajorRepairs.new(nil, nil, self), @@ -31,30 +29,26 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection end def uprn_questions - if form.start_year_after_2024? + if form.start_year_2024_or_later? [ 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), ] - 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 def number_of_times_relet - Form::Lettings::Pages::PropertyNumberOfTimesRelet.new(nil, nil, self) unless form.start_year_after_2024? + Form::Lettings::Pages::PropertyNumberOfTimesRelet.new(nil, nil, self) unless form.start_year_2024_or_later? end def displayed_in_tasklist?(log) diff --git a/app/models/form/lettings/subsections/setup.rb b/app/models/form/lettings/subsections/setup.rb index 1970149ed..0e65c2f13 100644 --- a/app/models/form/lettings/subsections/setup.rb +++ b/app/models/form/lettings/subsections/setup.rb @@ -20,7 +20,7 @@ class Form::Lettings::Subsections::Setup < ::Form::Subsection Form::Lettings::Pages::RentType.new(nil, nil, self), Form::Lettings::Pages::TenantCode.new(nil, nil, self), Form::Lettings::Pages::PropertyReference.new(nil, nil, self), - (Form::Lettings::Pages::Declaration.new(nil, nil, self) if form.start_year_after_2024?), + (Form::Lettings::Pages::Declaration.new(nil, nil, self) if form.start_year_2024_or_later?), ].compact end diff --git a/app/models/form/lettings/subsections/tenancy_information.rb b/app/models/form/lettings/subsections/tenancy_information.rb index 5525c182f..f0b7f4bef 100644 --- a/app/models/form/lettings/subsections/tenancy_information.rb +++ b/app/models/form/lettings/subsections/tenancy_information.rb @@ -15,7 +15,7 @@ class Form::Lettings::Subsections::TenancyInformation < ::Form::Subsection Form::Lettings::Pages::TenancyLength.new(nil, nil, self), Form::Lettings::Pages::TenancyLengthAffordableRent.new(nil, nil, self), Form::Lettings::Pages::TenancyLengthIntermediateRent.new(nil, nil, self), - (Form::Lettings::Pages::TenancyLengthPeriodic.new(nil, nil, self) if form.start_year_after_2024?), + (Form::Lettings::Pages::TenancyLengthPeriodic.new(nil, nil, self) if form.start_year_2024_or_later?), Form::Lettings::Pages::ShelteredAccommodation.new(nil, nil, self), ].flatten.compact 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/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/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/buyer1_nationality.rb b/app/models/form/sales/pages/buyer1_nationality.rb index 6bcf12952..791ecafac 100644 --- a/app/models/form/sales/pages/buyer1_nationality.rb +++ b/app/models/form/sales/pages/buyer1_nationality.rb @@ -13,7 +13,7 @@ class Form::Sales::Pages::Buyer1Nationality < ::Form::Page end def questions - @questions ||= if form.start_year_after_2024? + @questions ||= if form.start_year_2024_or_later? [ Form::Sales::Questions::NationalityAllGroup.new("nationality_all_group", nil, self, 1), Form::Sales::Questions::NationalityAll.new("nationality_all", nil, self, 1), diff --git a/app/models/form/sales/pages/buyer2_nationality.rb b/app/models/form/sales/pages/buyer2_nationality.rb index bbec2a105..30790fd63 100644 --- a/app/models/form/sales/pages/buyer2_nationality.rb +++ b/app/models/form/sales/pages/buyer2_nationality.rb @@ -15,7 +15,7 @@ class Form::Sales::Pages::Buyer2Nationality < ::Form::Page end def questions - @questions ||= if form.start_year_after_2024? + @questions ||= if form.start_year_2024_or_later? [ Form::Sales::Questions::NationalityAllGroup.new("nationality_all_buyer2_group", nil, self, 2), Form::Sales::Questions::NationalityAll.new("nationality_all_buyer2", nil, self, 2), diff --git a/app/models/form/sales/pages/buyer_previous.rb b/app/models/form/sales/pages/buyer_previous.rb index 87f87b66b..197a68971 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 @@ -12,7 +13,7 @@ class Form::Sales::Pages::BuyerPrevious < ::Form::Page end def routed_to?(log, _current_user) - return false if log.is_staircase? && form.start_year_after_2024? + return false if log.is_staircase? && form.start_year_2024_or_later? super end diff --git a/app/models/form/sales/pages/deposit.rb b/app/models/form/sales/pages/deposit.rb index 3e298e4f6..4870a3c35 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 @@ -15,7 +15,7 @@ class Form::Sales::Pages::Deposit < ::Form::Page def routed_to?(log, _user) return false unless super return true if log.ownershipsch == 2 || (log.ownershipsch == 3 && log.mortgageused == 1) - return false if log.stairowned_100? != @optional && form.start_year_after_2024? + return false if log.stairowned_100? != @optional && form.start_year_2024_or_later? log.ownershipsch == 1 end 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..84fcbb45f 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 @@ -12,7 +12,7 @@ class Form::Sales::Pages::DepositDiscount < ::Form::Page end def depends_on - if form.start_year_after_2024? + if form.start_year_2024_or_later? [{ "social_homebuy?" => true, "stairowned_100?" => @optional }] else [{ "social_homebuy?" => true }] 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..e86e0374a 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 @@ -11,7 +12,7 @@ class Form::Sales::Pages::LaNominations < ::Form::Page end def routed_to?(log, _current_user) - return false if log.staircase == 1 && form.start_year_after_2024? + return false if log.staircase == 1 && form.start_year_2024_or_later? super end diff --git a/app/models/form/sales/pages/last_accommodation.rb b/app/models/form/sales/pages/last_accommodation.rb index 457da99b1..42620038b 100644 --- a/app/models/form/sales/pages/last_accommodation.rb +++ b/app/models/form/sales/pages/last_accommodation.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::LastAccommodation < ::Form::Page def initialize(id, hsh, subsection) super @id = "last_accommodation" + @copy_key = "sales.household_situation.last_accommodation" end def questions @@ -12,7 +13,7 @@ class Form::Sales::Pages::LastAccommodation < ::Form::Page end def routed_to?(log, _user) - return false if form.start_year_after_2024? && log.discounted_ownership_sale? + return false if form.start_year_2024_or_later? && log.discounted_ownership_sale? super end diff --git a/app/models/form/sales/pages/last_accommodation_la.rb b/app/models/form/sales/pages/last_accommodation_la.rb index 1c126a28d..ceb5b272c 100644 --- a/app/models/form/sales/pages/last_accommodation_la.rb +++ b/app/models/form/sales/pages/last_accommodation_la.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::LastAccommodationLa < ::Form::Page def initialize(id, hsh, subsection) super @id = "last_accommodation_la" + @copy_key = "sales.household_situation.last_accommodation_la" @depends_on = [{ "is_previous_la_inferred" => false, }] @@ -15,7 +16,7 @@ class Form::Sales::Pages::LastAccommodationLa < ::Form::Page end def routed_to?(log, _user) - return false if form.start_year_after_2024? && log.discounted_ownership_sale? + return false if form.start_year_2024_or_later? && log.discounted_ownership_sale? super end 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/managing_organisation.rb b/app/models/form/sales/pages/managing_organisation.rb index 3d8e59383..bf51602a4 100644 --- a/app/models/form/sales/pages/managing_organisation.rb +++ b/app/models/form/sales/pages/managing_organisation.rb @@ -13,7 +13,7 @@ class Form::Sales::Pages::ManagingOrganisation < ::Form::Page def routed_to?(log, current_user) return false unless current_user - if form.start_year_after_2024? + if form.start_year_2024_or_later? organisation = current_user.support? ? log.owning_organisation : current_user.organisation return false unless organisation 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/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/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/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/property_local_authority.rb b/app/models/form/sales/pages/property_local_authority.rb index e0289839d..fe9ad1bc0 100644 --- a/app/models/form/sales/pages/property_local_authority.rb +++ b/app/models/form/sales/pages/property_local_authority.rb @@ -3,21 +3,14 @@ class Form::Sales::Pages::PropertyLocalAuthority < ::Form::Page super @id = "property_local_authority" @depends_on = [ - { "is_la_inferred" => false, "form.start_year_after_2024?" => false }, - { "is_la_inferred" => false, "form.start_year_after_2024?" => true, "address_search_given?" => true }, + { "is_la_inferred" => false, "form.start_year_2024_or_later?" => false }, + { "is_la_inferred" => false, "form.start_year_2024_or_later?" => true, "address_search_given?" => true }, ] end 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/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/uprn.rb b/app/models/form/sales/pages/uprn.rb index d4c7e4d77..a78b87c2f 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 @@ -12,7 +13,7 @@ class Form::Sales::Pages::Uprn < ::Form::Page end def skip_text - if form.start_year_after_2024? + if form.start_year_2024_or_later? "Search for address instead" else "Enter address instead" @@ -22,7 +23,7 @@ class Form::Sales::Pages::Uprn < ::Form::Page def skip_href(log = nil) return unless log - if form.start_year_after_2024? + if form.start_year_2024_or_later? "address-matcher" else "address" 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/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/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/buyer1_ethnic_background_white.rb b/app/models/form/sales/questions/buyer1_ethnic_background_white.rb index 2bbe4939f..619c958f9 100644 --- a/app/models/form/sales/questions/buyer1_ethnic_background_white.rb +++ b/app/models/form/sales/questions/buyer1_ethnic_background_white.rb @@ -9,7 +9,7 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundWhite < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "English, Welsh, Northern Irish, Scottish or British" }, "2" => { "value" => "Irish" }, diff --git a/app/models/form/sales/questions/buyer1_previous_tenure.rb b/app/models/form/sales/questions/buyer1_previous_tenure.rb index 4f560f10d..aea90af30 100644 --- a/app/models/form/sales/questions/buyer1_previous_tenure.rb +++ b/app/models/form/sales/questions/buyer1_previous_tenure.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::Buyer1PreviousTenure < ::Form::Question def initialize(id, hsh, page) super @id = "prevten" - @check_answer_label = "Buyer 1’s previous tenure" - @header = "What was buyer 1’s previous tenure?" @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/buyer2_ethnic_background_white.rb b/app/models/form/sales/questions/buyer2_ethnic_background_white.rb index 232e0f99e..be3e3ccff 100644 --- a/app/models/form/sales/questions/buyer2_ethnic_background_white.rb +++ b/app/models/form/sales/questions/buyer2_ethnic_background_white.rb @@ -9,7 +9,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundWhite < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "English, Welsh, Northern Irish, Scottish or British" }, "2" => { "value" => "Irish" }, diff --git a/app/models/form/sales/questions/buyer2_living_in.rb b/app/models/form/sales/questions/buyer2_living_in.rb index 83b1712fe..0939d119f 100644 --- a/app/models/form/sales/questions/buyer2_living_in.rb +++ b/app/models/form/sales/questions/buyer2_living_in.rb @@ -2,10 +2,7 @@ class Form::Sales::Questions::Buyer2LivingIn < ::Form::Question def initialize(id, hsh, page) super @id = "buy2living" - @check_answer_label = "Buyer 2 living at the same address" - @header = "At the time of purchase, was buyer 2 living at the same address as buyer 1?" @type = "radio" - @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/sales/questions/buyer2_relationship_to_buyer1.rb b/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb index 3f0fc299c..9520ace67 100644 --- a/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb +++ b/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb @@ -16,7 +16,7 @@ class Form::Sales::Questions::Buyer2RelationshipToBuyer1 < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "P" => { "value" => "Partner" }, diff --git a/app/models/form/sales/questions/buyer_previous.rb b/app/models/form/sales/questions/buyer_previous.rb index b35a67c5e..4daf963bf 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] @@ -23,7 +22,7 @@ class Form::Sales::Questions::BuyerPrevious < ::Form::Question end def derived?(_log) - form.start_year_after_2024? + form.start_year_2024_or_later? end QUESTION_NUMBER_FROM_YEAR = { 2023 => 84 }.freeze diff --git a/app/models/form/sales/questions/buyers_organisations.rb b/app/models/form/sales/questions/buyers_organisations.rb index 714f7a2e3..727a65ad0 100644 --- a/app/models/form/sales/questions/buyers_organisations.rb +++ b/app/models/form/sales/questions/buyers_organisations.rb @@ -2,10 +2,7 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question def initialize(id, hsh, page) super @id = "buyers_organisations" - @check_answer_label = "Organisations buyers were registered with" - @header = "What organisations were the buyers registered with?" @type = "checkbox" - @hint_text = "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue." @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 @@ -27,9 +24,5 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question } end - def unanswered_error_message - "At least one option must be selected of these four" - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 59, 2024 => 61 }.freeze end 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/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..3807a8cfc 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 + @max = form.start_year_2024_or_later? ? 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_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/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..a4aa55f17 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 @@ -62,7 +60,7 @@ class Form::Sales::Questions::MortgageLender < ::Form::Question OPTIONS_NOT_DISPLAYED = %w[0].freeze def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? ANSWER_OPTIONS else ANSWER_OPTIONS.dup.reject { |k, _v| OPTIONS_INTRODUCED_2024.include?(k) } 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..e4a101072 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 @@ -12,7 +11,7 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question end def displayed_answer_options(log, _user = nil) - if log.outright_sale? && log.saledate && !form.start_year_after_2024? + if log.outright_sale? && log.saledate && !form.start_year_2024_or_later? answer_options_without_dont_know elsif log.stairowned == 100 || log.outright_sale? ANSWER_OPTIONS 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/ownership_scheme.rb b/app/models/form/sales/questions/ownership_scheme.rb index 6b33a2566..f42f03f37 100644 --- a/app/models/form/sales/questions/ownership_scheme.rb +++ b/app/models/form/sales/questions/ownership_scheme.rb @@ -7,7 +7,7 @@ class Form::Sales::Questions::OwnershipScheme < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Yes - a shared ownership scheme", "hint" => "When the purchaser buys an initial share of up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion, or a subsequent staircasing transaction" }, "2" => { "value" => "Yes - a discounted ownership scheme" }, 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/person_relationship_to_buyer_1.rb b/app/models/form/sales/questions/person_relationship_to_buyer_1.rb index af3f2a78b..9ac0791a4 100644 --- a/app/models/form/sales/questions/person_relationship_to_buyer_1.rb +++ b/app/models/form/sales/questions/person_relationship_to_buyer_1.rb @@ -16,7 +16,7 @@ class Form::Sales::Questions::PersonRelationshipToBuyer1 < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "P" => { "value" => "Partner" }, "C" => { "value" => "Child" }, 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/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_la_known.rb b/app/models/form/sales/questions/previous_la_known.rb index 7a31fbd74..a54a98d11 100644 --- a/app/models/form/sales/questions/previous_la_known.rb +++ b/app/models/form/sales/questions/previous_la_known.rb @@ -2,11 +2,9 @@ class Form::Sales::Questions::PreviousLaKnown < ::Form::Question def initialize(id, hsh, page) super @id = "previous_la_known" - @check_answer_label = "Local authority of buyer 1’s last settled accommodation" - @header = "Do you know the local authority of buyer 1’s last settled accommodation?" + @copy_key = "sales.household_situation.last_accommodation_la.previous_la_known" @type = "radio" @answer_options = ANSWER_OPTIONS - @hint_text = "This is also known as the household’s 'last settled home'" @hidden_in_check_answers = { "depends_on" => [ { diff --git a/app/models/form/sales/questions/previous_postcode.rb b/app/models/form/sales/questions/previous_postcode.rb index a0a4fe725..32b4e153e 100644 --- a/app/models/form/sales/questions/previous_postcode.rb +++ b/app/models/form/sales/questions/previous_postcode.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::PreviousPostcode < ::Form::Question def initialize(id, hsh, page) super @id = "ppostcode_full" - @check_answer_label = "Postcode of buyer 1’s last settled accommodation" - @header = "Postcode" + @copy_key = "sales.household_situation.last_accommodation.ppostcode_full" @type = "text" @width = 5 @inferred_check_answers_value = [{ diff --git a/app/models/form/sales/questions/previous_postcode_known.rb b/app/models/form/sales/questions/previous_postcode_known.rb index d9df53f6c..c2156b887 100644 --- a/app/models/form/sales/questions/previous_postcode_known.rb +++ b/app/models/form/sales/questions/previous_postcode_known.rb @@ -2,14 +2,12 @@ class Form::Sales::Questions::PreviousPostcodeKnown < ::Form::Question def initialize(id, hsh, page) super @id = "ppcodenk" - @check_answer_label = "Buyer 1’s last settled accommodation" - @header = "Do you know the postcode of buyer 1’s last settled accommodation?" + @copy_key = "sales.household_situation.last_accommodation.ppcodenk" @type = "radio" @answer_options = ANSWER_OPTIONS @conditional_for = { "ppostcode_full" => [0], } - @hint_text = "This is also known as the household’s 'last settled home'" @hidden_in_check_answers = { "depends_on" => [ { 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/previous_tenure_buyer2.rb b/app/models/form/sales/questions/previous_tenure_buyer2.rb index 2873b8dc5..db606e254 100644 --- a/app/models/form/sales/questions/previous_tenure_buyer2.rb +++ b/app/models/form/sales/questions/previous_tenure_buyer2.rb @@ -2,10 +2,7 @@ class Form::Sales::Questions::PreviousTenureBuyer2 < ::Form::Question def initialize(id, hsh, page) super @id = "prevtenbuy2" - @check_answer_label = "Buyer 2’s previous tenure" - @header = "What was buyer 2’s previous tenure?" @type = "radio" - @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/sales/questions/prevloc.rb b/app/models/form/sales/questions/prevloc.rb index b8c46f427..5deb48877 100644 --- a/app/models/form/sales/questions/prevloc.rb +++ b/app/models/form/sales/questions/prevloc.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::Prevloc < ::Form::Question def initialize(id, hsh, page) super @id = "prevloc" - @check_answer_label = "Local authority of buyer 1’s last settled accommodation" - @header = "Select a local authority" + @copy_key = "sales.household_situation.last_accommodation_la.prevloc" @type = "select" @inferred_check_answers_value = [{ "condition" => { diff --git a/app/models/form/sales/questions/privacy_notice.rb b/app/models/form/sales/questions/privacy_notice.rb index 95921737f..5e73e7a3a 100644 --- a/app/models/form/sales/questions/privacy_notice.rb +++ b/app/models/form/sales/questions/privacy_notice.rb @@ -10,7 +10,7 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question end def answer_options - declaration_text = if form.start_year_after_2024? + declaration_text = if form.start_year_2024_or_later? "The #{@joint_purchase ? 'buyers have' : 'buyer has'} seen or been given access to the MHCLG privacy notice" else "The #{@joint_purchase ? 'buyers have' : 'buyer has'} seen the MHCLG privacy notice" @@ -21,7 +21,7 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question def unanswered_error_message buyer_or_buyers = @joint_purchase ? "buyers" : "buyer" - if form.start_year_after_2024? + if form.start_year_2024_or_later? I18n.t("validations.privacynotice.missing.post_2024", buyer_or_buyers:) else I18n.t("validations.privacynotice.missing.pre_2024", buyer_or_buyers:) @@ -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/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/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/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/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/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..fed35f665 100644 --- a/app/models/form/sales/questions/uprn_confirmation.rb +++ b/app/models/form/sales/questions/uprn_confirmation.rb @@ -2,13 +2,11 @@ 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 - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Yes" }, "0" => { "value" => "No, I want to search for the address instead" }, 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/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/app/models/form/sales/subsections/household_characteristics.rb b/app/models/form/sales/subsections/household_characteristics.rb index afbbe4278..f1f01ba62 100644 --- a/app/models/form/sales/subsections/household_characteristics.rb +++ b/app/models/form/sales/subsections/household_characteristics.rb @@ -8,13 +8,13 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection def pages @pages ||= [ - (Form::Sales::Pages::BuyerInterview.new("buyer_interview_joint_purchase", nil, self, joint_purchase: true) unless form.start_year_after_2024?), - (Form::Sales::Pages::BuyerInterview.new("buyer_interview", nil, self, joint_purchase: false) unless form.start_year_after_2024?), - (Form::Sales::Pages::PrivacyNotice.new("privacy_notice_joint_purchase", nil, self, joint_purchase: true) unless form.start_year_after_2024?), - (Form::Sales::Pages::PrivacyNotice.new("privacy_notice", nil, self, joint_purchase: false) unless form.start_year_after_2024?), + (Form::Sales::Pages::BuyerInterview.new("buyer_interview_joint_purchase", nil, self, joint_purchase: true) unless form.start_year_2024_or_later?), + (Form::Sales::Pages::BuyerInterview.new("buyer_interview", nil, self, joint_purchase: false) unless form.start_year_2024_or_later?), + (Form::Sales::Pages::PrivacyNotice.new("privacy_notice_joint_purchase", nil, self, joint_purchase: true) unless form.start_year_2024_or_later?), + (Form::Sales::Pages::PrivacyNotice.new("privacy_notice", nil, self, joint_purchase: false) unless form.start_year_2024_or_later?), Form::Sales::Pages::Age1.new(nil, nil, self), Form::Sales::Pages::RetirementValueCheck.new("age_1_retirement_value_check", nil, self, person_index: 1), - (Form::Sales::Pages::NotRetiredValueCheck.new("age_1_not_retired_value_check", nil, self, person_index: 1) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("age_1_not_retired_value_check", nil, self, person_index: 1) if form.start_year_2024_or_later?), Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck.new("age_1_old_persons_shared_ownership_joint_purchase_value_check", nil, self, joint_purchase: true), Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck.new("age_1_old_persons_shared_ownership_value_check", nil, self, joint_purchase: false), Form::Sales::Pages::GenderIdentity1.new(nil, nil, self), @@ -27,7 +27,7 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Sales::Pages::Buyer1Nationality.new(nil, nil, self), Form::Sales::Pages::Buyer1WorkingSituation.new(nil, nil, self), Form::Sales::Pages::RetirementValueCheck.new("working_situation_1_retirement_value_check", nil, self, person_index: 1), - (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_1_not_retired_value_check", nil, self, person_index: 1) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_1_not_retired_value_check", nil, self, person_index: 1) if form.start_year_2024_or_later?), Form::Sales::Pages::Buyer1IncomeMinValueCheck.new("working_situation_buyer_1_income_min_value_check", nil, self), Form::Sales::Pages::Buyer1LiveInProperty.new(nil, nil, self), Form::Sales::Pages::BuyerLiveInValueCheck.new("buyer_1_live_in_property_value_check", nil, self, person_index: 1), @@ -37,13 +37,13 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck.new("age_2_old_persons_shared_ownership_joint_purchase_value_check", nil, self, joint_purchase: true), Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck.new("age_2_old_persons_shared_ownership_value_check", nil, self, joint_purchase: false), Form::Sales::Pages::RetirementValueCheck.new("age_2_buyer_retirement_value_check", nil, self, person_index: 2), - (Form::Sales::Pages::NotRetiredValueCheck.new("age_2_buyer_not_retired_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("age_2_buyer_not_retired_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("buyer_2_age_student_not_child_value_check", nil, self, person_index: 2), Form::Sales::Pages::GenderIdentity2.new(nil, nil, self), buyer_2_ethnicity_nationality_pages, Form::Sales::Pages::Buyer2WorkingSituation.new(nil, nil, self), Form::Sales::Pages::RetirementValueCheck.new("working_situation_2_retirement_value_check_joint_purchase", nil, self, person_index: 2), - (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_2_not_retired_value_check_joint_purchase", nil, self, person_index: 2) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_2_not_retired_value_check_joint_purchase", nil, self, person_index: 2) if form.start_year_2024_or_later?), Form::Sales::Pages::Buyer2IncomeMinValueCheck.new("working_situation_buyer_2_income_min_value_check", nil, self), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("buyer_2_working_situation_student_not_child_value_check", nil, self, person_index: 2), Form::Sales::Pages::Buyer2LiveInProperty.new(nil, nil, self), @@ -52,78 +52,78 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Sales::Pages::NumberOfOthersInProperty.new("number_of_others_in_property_joint_purchase", nil, self, joint_purchase: true), Form::Sales::Pages::PersonKnown.new("person_2_known", nil, self, person_index: 2), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_2_relationship_to_buyer_1", nil, self, person_index: 2), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), - (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), + (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_2_student_not_child_value_check", nil, self, person_index: 2), Form::Sales::Pages::PersonAge.new("person_2_age", nil, self, person_index: 2), Form::Sales::Pages::RetirementValueCheck.new("age_2_retirement_value_check", nil, self, person_index: 2), - (Form::Sales::Pages::NotRetiredValueCheck.new("age_2_not_retired_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("age_2_not_retired_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_2_student_not_child_value_check", nil, self, person_index: 2), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonGenderIdentity.new("person_2_gender_identity", nil, self, person_index: 2), Form::Sales::Pages::PersonWorkingSituation.new("person_2_working_situation", nil, self, person_index: 2), Form::Sales::Pages::RetirementValueCheck.new("working_situation_2_retirement_value_check", nil, self, person_index: 2), - (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_2_not_retired_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_2_not_retired_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_2_student_not_child_value_check", nil, self, person_index: 2), Form::Sales::Pages::PersonKnown.new("person_3_known", nil, self, person_index: 3), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_3_relationship_to_buyer_1", nil, self, person_index: 3), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), - (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?), + (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_3_student_not_child_value_check", nil, self, person_index: 3), Form::Sales::Pages::PersonAge.new("person_3_age", nil, self, person_index: 3), Form::Sales::Pages::RetirementValueCheck.new("age_3_retirement_value_check", nil, self, person_index: 3), - (Form::Sales::Pages::NotRetiredValueCheck.new("age_3_not_retired_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("age_3_not_retired_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_3_student_not_child_value_check", nil, self, person_index: 3), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonGenderIdentity.new("person_3_gender_identity", nil, self, person_index: 3), Form::Sales::Pages::PersonWorkingSituation.new("person_3_working_situation", nil, self, person_index: 3), Form::Sales::Pages::RetirementValueCheck.new("working_situation_3_retirement_value_check", nil, self, person_index: 3), - (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_3_not_retired_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_3_not_retired_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_3_student_not_child_value_check", nil, self, person_index: 3), Form::Sales::Pages::PersonKnown.new("person_4_known", nil, self, person_index: 4), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_4_relationship_to_buyer_1", nil, self, person_index: 4), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), - (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?), + (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_4_student_not_child_value_check", nil, self, person_index: 4), Form::Sales::Pages::PersonAge.new("person_4_age", nil, self, person_index: 4), Form::Sales::Pages::RetirementValueCheck.new("age_4_retirement_value_check", nil, self, person_index: 4), - (Form::Sales::Pages::NotRetiredValueCheck.new("age_4_not_retired_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("age_4_not_retired_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_4_student_not_child_value_check", nil, self, person_index: 4), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonGenderIdentity.new("person_4_gender_identity", nil, self, person_index: 4), Form::Sales::Pages::PersonWorkingSituation.new("person_4_working_situation", nil, self, person_index: 4), Form::Sales::Pages::RetirementValueCheck.new("working_situation_4_retirement_value_check", nil, self, person_index: 4), - (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_4_not_retired_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_4_not_retired_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_4_student_not_child_value_check", nil, self, person_index: 4), Form::Sales::Pages::PersonKnown.new("person_5_known", nil, self, person_index: 5), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_5_relationship_to_buyer_1", nil, self, person_index: 5), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), - (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?), + (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_5_student_not_child_value_check", nil, self, person_index: 5), Form::Sales::Pages::PersonAge.new("person_5_age", nil, self, person_index: 5), Form::Sales::Pages::RetirementValueCheck.new("age_5_retirement_value_check", nil, self, person_index: 5), - (Form::Sales::Pages::NotRetiredValueCheck.new("age_5_not_retired_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("age_5_not_retired_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_5_student_not_child_value_check", nil, self, person_index: 5), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonGenderIdentity.new("person_5_gender_identity", nil, self, person_index: 5), Form::Sales::Pages::PersonWorkingSituation.new("person_5_working_situation", nil, self, person_index: 5), Form::Sales::Pages::RetirementValueCheck.new("working_situation_5_retirement_value_check", nil, self, person_index: 5), - (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_5_not_retired_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_5_not_retired_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_5_student_not_child_value_check", nil, self, person_index: 5), Form::Sales::Pages::PersonKnown.new("person_6_known", nil, self, person_index: 6), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_6_relationship_to_buyer_1", nil, self, person_index: 6), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), - (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?), + (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_6_student_not_child_value_check", nil, self, person_index: 6), Form::Sales::Pages::PersonAge.new("person_6_age", nil, self, person_index: 6), Form::Sales::Pages::RetirementValueCheck.new("age_6_retirement_value_check", nil, self, person_index: 6), - (Form::Sales::Pages::NotRetiredValueCheck.new("age_6_not_retired_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("age_6_not_retired_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_6_student_not_child_value_check", nil, self, person_index: 6), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonGenderIdentity.new("person_6_gender_identity", nil, self, person_index: 6), Form::Sales::Pages::PersonWorkingSituation.new("person_6_working_situation", nil, self, person_index: 6), Form::Sales::Pages::RetirementValueCheck.new("working_situation_6_retirement_value_check", nil, self, person_index: 6), - (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_6_not_retired_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_6_not_retired_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_6_student_not_child_value_check", nil, self, person_index: 6), ].flatten.compact end diff --git a/app/models/form/sales/subsections/outright_sale.rb b/app/models/form/sales/subsections/outright_sale.rb index 6b29313a1..af63c8179 100644 --- a/app/models/form/sales/subsections/outright_sale.rb +++ b/app/models/form/sales/subsections/outright_sale.rb @@ -14,8 +14,8 @@ class Form::Sales::Subsections::OutrightSale < ::Form::Subsection Form::Sales::Pages::MortgageValueCheck.new("outright_sale_mortgage_used_mortgage_value_check", nil, self), Form::Sales::Pages::MortgageAmount.new("mortgage_amount_outright_sale", nil, self, ownershipsch: 3), Form::Sales::Pages::MortgageValueCheck.new("outright_sale_mortgage_amount_mortgage_value_check", nil, self), - (Form::Sales::Pages::MortgageLender.new("mortgage_lender_outright_sale", nil, self, ownershipsch: 3) unless form.start_year_after_2024?), - (Form::Sales::Pages::MortgageLenderOther.new("mortgage_lender_other_outright_sale", nil, self, ownershipsch: 3) unless form.start_year_after_2024?), + (Form::Sales::Pages::MortgageLender.new("mortgage_lender_outright_sale", nil, self, ownershipsch: 3) unless form.start_year_2024_or_later?), + (Form::Sales::Pages::MortgageLenderOther.new("mortgage_lender_other_outright_sale", nil, self, ownershipsch: 3) unless form.start_year_2024_or_later?), Form::Sales::Pages::MortgageLength.new("mortgage_length_outright_sale", nil, self, ownershipsch: 3), Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_outright_sale", nil, self, ownershipsch: 3), Form::Sales::Pages::Deposit.new("deposit_outright_sale", nil, self, ownershipsch: 3, optional: false), diff --git a/app/models/form/sales/subsections/property_information.rb b/app/models/form/sales/subsections/property_information.rb index 2c530ab60..32df98af5 100644 --- a/app/models/form/sales/subsections/property_information.rb +++ b/app/models/form/sales/subsections/property_information.rb @@ -16,13 +16,12 @@ 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 def uprn_questions - if form.start_year_after_2024? + if form.start_year_2024_or_later? [ Form::Sales::Pages::Uprn.new(nil, nil, self), Form::Sales::Pages::UprnConfirmation.new(nil, nil, self), @@ -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/app/models/form/sales/subsections/setup.rb b/app/models/form/sales/subsections/setup.rb index f954e24e6..de623e769 100644 --- a/app/models/form/sales/subsections/setup.rb +++ b/app/models/form/sales/subsections/setup.rb @@ -20,10 +20,10 @@ class Form::Sales::Subsections::Setup < ::Form::Subsection Form::Sales::Pages::BuyerLive.new(nil, nil, self), Form::Sales::Pages::JointPurchase.new(nil, nil, self), Form::Sales::Pages::NumberJointBuyers.new(nil, nil, self), - (Form::Sales::Pages::BuyerInterview.new("buyer_interview_joint_purchase", nil, self, joint_purchase: true) if form.start_year_after_2024?), - (Form::Sales::Pages::BuyerInterview.new("buyer_interview", nil, self, joint_purchase: false) if form.start_year_after_2024?), - (Form::Sales::Pages::PrivacyNotice.new("privacy_notice_joint_purchase", nil, self, joint_purchase: true) if form.start_year_after_2024?), - (Form::Sales::Pages::PrivacyNotice.new("privacy_notice", nil, self, joint_purchase: false) if form.start_year_after_2024?), + (Form::Sales::Pages::BuyerInterview.new("buyer_interview_joint_purchase", nil, self, joint_purchase: true) if form.start_year_2024_or_later?), + (Form::Sales::Pages::BuyerInterview.new("buyer_interview", nil, self, joint_purchase: false) if form.start_year_2024_or_later?), + (Form::Sales::Pages::PrivacyNotice.new("privacy_notice_joint_purchase", nil, self, joint_purchase: true) if form.start_year_2024_or_later?), + (Form::Sales::Pages::PrivacyNotice.new("privacy_notice", nil, self, joint_purchase: false) if form.start_year_2024_or_later?), ].flatten.compact end end diff --git a/app/models/form/sales/subsections/shared_ownership_scheme.rb b/app/models/form/sales/subsections/shared_ownership_scheme.rb index c955929dc..3fba8ef70 100644 --- a/app/models/form/sales/subsections/shared_ownership_scheme.rb +++ b/app/models/form/sales/subsections/shared_ownership_scheme.rb @@ -40,11 +40,11 @@ class Form::Sales::Subsections::SharedOwnershipScheme < ::Form::Subsection Form::Sales::Pages::MortgageLength.new("mortgage_length_shared_ownership", nil, self, ownershipsch: 1), Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_shared_ownership", nil, self, ownershipsch: 1), Form::Sales::Pages::Deposit.new("deposit_shared_ownership", nil, self, ownershipsch: 1, optional: false), - (Form::Sales::Pages::Deposit.new("deposit_shared_ownership_optional", nil, self, ownershipsch: 1, optional: true) if form.start_year_after_2024?), + (Form::Sales::Pages::Deposit.new("deposit_shared_ownership_optional", nil, self, ownershipsch: 1, optional: true) if form.start_year_2024_or_later?), Form::Sales::Pages::DepositValueCheck.new("deposit_joint_purchase_value_check", nil, self, joint_purchase: true), Form::Sales::Pages::DepositValueCheck.new("deposit_value_check", nil, self, joint_purchase: false), Form::Sales::Pages::DepositDiscount.new("deposit_discount", nil, self, optional: false), - (Form::Sales::Pages::DepositDiscount.new("deposit_discount_optional", nil, self, optional: true) if form.start_year_after_2024?), + (Form::Sales::Pages::DepositDiscount.new("deposit_discount_optional", nil, self, optional: true) if form.start_year_2024_or_later?), Form::Sales::Pages::SharedOwnershipDepositValueCheck.new("shared_ownership_deposit_value_check", nil, self), Form::Sales::Pages::MonthlyRent.new(nil, nil, self), Form::Sales::Pages::LeaseholdCharges.new("leasehold_charges_shared_ownership", nil, self, ownershipsch: 1), 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/app/models/lettings_log.rb b/app/models/lettings_log.rb index 4fda881ec..d1ff6f738 100644 --- a/app/models/lettings_log.rb +++ b/app/models/lettings_log.rb @@ -391,7 +391,7 @@ class LettingsLog < Log end def is_beds_inferred? - form.start_year_after_2024? && is_bedsit? + form.start_year_2024_or_later? && is_bedsit? end def is_shared_housing? @@ -893,7 +893,7 @@ private def should_process_address_change? return unless uprn_selection || select_best_address_match return unless startdate - return unless form.start_year_after_2024? + return unless form.start_year_2024_or_later? if select_best_address_match address_line1_input.present? && postcode_full_input.present? diff --git a/app/models/sales_log.rb b/app/models/sales_log.rb index aca80ef94..23438142f 100644 --- a/app/models/sales_log.rb +++ b/app/models/sales_log.rb @@ -131,7 +131,7 @@ class SalesLog < Log not_required << "proplen" if proplen_optional? not_required << "mortlen" if mortlen_optional? not_required << "frombeds" if frombeds_optional? - not_required << "deposit" if form.start_year_after_2024? && stairowned_100? + not_required << "deposit" if form.start_year_2024_or_later? && stairowned_100? not_required |= %w[address_line2 county postcode_full] if saledate && collection_start_year_for_date(saledate) >= 2023 @@ -453,7 +453,7 @@ class SalesLog < Log def should_process_address_change? return unless uprn_selection || select_best_address_match return unless saledate - return unless form.start_year_after_2024? + return unless form.start_year_2024_or_later? if select_best_address_match address_line1_input.present? && postcode_full_input.present? @@ -515,7 +515,7 @@ class SalesLog < Log end def soctenant_is_inferred? - form.start_year_after_2024? + form.start_year_2024_or_later? end def duplicates 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/app/models/validations/household_validations.rb b/app/models/validations/household_validations.rb index 8fe940ae5..626925631 100644 --- a/app/models/validations/household_validations.rb +++ b/app/models/validations/household_validations.rb @@ -35,7 +35,7 @@ module Validations::HouseholdValidations record.errors.add :reason, I18n.t("validations.household.reason.not_internal_transfer") end - return unless record.form.start_year_after_2024? + return unless record.form.start_year_2024_or_later? if record.reason == 20 && PHRASES_INDICATING_HOMELESSNESS_REGEX.match?(record.reasonother) record.errors.add :reason, I18n.t("validations.household.reason.other_not_settled") @@ -56,7 +56,7 @@ module Validations::HouseholdValidations end def validate_person_1_economic(record) - return unless record.age1 && record.ecstat1 && !record.form.start_year_after_2024? + return unless record.age1 && record.ecstat1 && !record.form.start_year_2024_or_later? if record.age1 < 16 && !economic_status_is_child_other_or_refused?(record.ecstat1) record.errors.add "ecstat1", I18n.t("validations.household.ecstat.child_under_16", person_num: 1) @@ -74,7 +74,7 @@ module Validations::HouseholdValidations economic_status = record.public_send("ecstat#{person_num}") next unless age && economic_status - if age < 16 && !economic_status_is_child_other_or_refused?(economic_status) && !record.form.start_year_after_2024? + if age < 16 && !economic_status_is_child_other_or_refused?(economic_status) && !record.form.start_year_2024_or_later? record.errors.add "ecstat#{person_num}", I18n.t("validations.household.ecstat.child_under_16", person_num:) record.errors.add "age#{person_num}", I18n.t("validations.household.age.child_under_16_ecstat", person_num:) end @@ -86,7 +86,7 @@ module Validations::HouseholdValidations end def validate_person_age_matches_relationship(record) - return unless record.startdate && !record.form.start_year_after_2024? + return unless record.startdate && !record.form.start_year_2024_or_later? (2..8).each do |person_num| age = record.public_send("age#{person_num}") @@ -101,7 +101,7 @@ module Validations::HouseholdValidations end def validate_person_age_and_relationship_matches_economic_status(record) - return unless record.startdate && !record.form.start_year_after_2024? + return unless record.startdate && !record.form.start_year_2024_or_later? (2..8).each do |person_num| age = record.public_send("age#{person_num}") diff --git a/app/models/validations/property_validations.rb b/app/models/validations/property_validations.rb index 52afecb49..e0246ff1f 100644 --- a/app/models/validations/property_validations.rb +++ b/app/models/validations/property_validations.rb @@ -35,7 +35,7 @@ module Validations::PropertyValidations def validate_shared_housing_rooms(record) return unless record.unittype_gn - if record.is_bedsit? && record.beds != 1 && record.beds.present? && !record.form.start_year_after_2024? + if record.is_bedsit? && record.beds != 1 && record.beds.present? && !record.form.start_year_2024_or_later? record.errors.add :unittype_gn, I18n.t("validations.property.unittype_gn.one_bedroom_bedsit") record.errors.add :beds, I18n.t("validations.property.unittype_gn.one_bedroom_bedsit") end diff --git a/app/models/validations/sales/financial_validations.rb b/app/models/validations/sales/financial_validations.rb index 9a119475f..c1046e035 100644 --- a/app/models/validations/sales/financial_validations.rb +++ b/app/models/validations/sales/financial_validations.rb @@ -54,7 +54,7 @@ module Validations::Sales::FinancialValidations def validate_percentage_bought_not_equal_percentage_owned(record) return unless record.stairbought && record.stairowned - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? if record.stairbought == record.stairowned record.errors.add :stairbought, I18n.t("validations.financial.staircasing.percentage_bought_equal_percentage_owned", stairbought: sprintf("%g", record.stairbought), stairowned: sprintf("%g", record.stairowned)) @@ -105,7 +105,7 @@ module Validations::Sales::FinancialValidations def validate_equity_less_than_staircase_difference(record) return unless record.equity && record.stairbought && record.stairowned - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? if record.equity > record.stairowned - record.stairbought formatted_equity = sprintf("%g", record.equity) diff --git a/app/models/validations/sales/household_validations.rb b/app/models/validations/sales/household_validations.rb index fb1ea65c2..23b2e9ee1 100644 --- a/app/models/validations/sales/household_validations.rb +++ b/app/models/validations/sales/household_validations.rb @@ -16,7 +16,7 @@ module Validations::Sales::HouseholdValidations end def validate_buyer1_previous_tenure(record) - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? return unless record.discounted_ownership_sale? && record.prevten if [3, 4, 5, 6, 7, 9, 0].include?(record.prevten) @@ -26,7 +26,7 @@ module Validations::Sales::HouseholdValidations end def validate_person_age_matches_relationship(record) - return unless record.saledate && !record.form.start_year_after_2024? + return unless record.saledate && !record.form.start_year_2024_or_later? (2..6).each do |person_num| age = record.public_send("age#{person_num}") @@ -44,7 +44,7 @@ module Validations::Sales::HouseholdValidations end def validate_person_age_and_relationship_matches_economic_status(record) - return unless record.saledate && !record.form.start_year_after_2024? + return unless record.saledate && !record.form.start_year_2024_or_later? (2..6).each do |person_num| age = record.public_send("age#{person_num}") @@ -77,7 +77,7 @@ module Validations::Sales::HouseholdValidations economic_status = record.public_send("ecstat#{person_num}") next unless age && economic_status - if age < 16 && !economic_status_is_child_other_or_refused?(economic_status) && !record.form.start_year_after_2024? + if age < 16 && !economic_status_is_child_other_or_refused?(economic_status) && !record.form.start_year_2024_or_later? record.errors.add "ecstat#{person_num}", I18n.t("validations.sales.household.ecstat.child_under_16", person_num:) record.errors.add "age#{person_num}", I18n.t("validations.sales.household.age.child_under_16_ecstat", person_num:) end @@ -89,7 +89,7 @@ module Validations::Sales::HouseholdValidations end def validate_child_12_years_younger(record) - return unless record.saledate && !record.form.start_year_after_2024? + return unless record.saledate && !record.form.start_year_2024_or_later? (2..6).each do |person_num| buyer_1_age = record.public_send("age1") @@ -106,7 +106,7 @@ module Validations::Sales::HouseholdValidations end def validate_buyer_not_child(record) - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? record.errors.add "ecstat1", I18n.t("validations.sales.household.ecstat1.buyer_cannot_be_child") if person_is_economic_child?(record.ecstat1) record.errors.add "ecstat2", I18n.t("validations.sales.household.ecstat2.buyer_cannot_be_child") if person_is_economic_child?(record.ecstat2) && record.joint_purchase? diff --git a/app/models/validations/sales/property_validations.rb b/app/models/validations/sales/property_validations.rb index 59d616c9a..c4a42c630 100644 --- a/app/models/validations/sales/property_validations.rb +++ b/app/models/validations/sales/property_validations.rb @@ -1,6 +1,6 @@ module Validations::Sales::PropertyValidations def validate_postcodes_match_if_discounted_ownership(record) - return unless record.saledate && !record.form.start_year_after_2024? + return unless record.saledate && !record.form.start_year_2024_or_later? return unless record.ppostcode_full.present? && record.postcode_full.present? if record.discounted_ownership_sale? && record.ppostcode_full != record.postcode_full diff --git a/app/models/validations/sales/sale_information_validations.rb b/app/models/validations/sales/sale_information_validations.rb index 700867e66..3c5e3f2b9 100644 --- a/app/models/validations/sales/sale_information_validations.rb +++ b/app/models/validations/sales/sale_information_validations.rb @@ -12,7 +12,7 @@ module Validations::Sales::SaleInformationValidations record.errors.add :saledate, I18n.t("validations.sales.sale_information.saledate.must_be_after_hodate") end - if record.saledate - record.hodate >= 3.years && record.form.start_year_after_2024? + if record.saledate - record.hodate >= 3.years && record.form.start_year_2024_or_later? record.errors.add :hodate, I18n.t("validations.sales.sale_information.hodate.must_be_less_than_3_years_from_saledate") record.errors.add :saledate, I18n.t("validations.sales.sale_information.saledate.must_be_less_than_3_years_from_hodate") end @@ -42,7 +42,7 @@ module Validations::Sales::SaleInformationValidations end def validate_discounted_ownership_value(record) - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? return unless record.value && record.deposit && record.ownershipsch return unless record.mortgage || record.mortgageused == 2 || record.mortgageused == 3 return unless record.discount || record.grant || record.type == 29 @@ -65,7 +65,7 @@ module Validations::Sales::SaleInformationValidations end def validate_outright_sale_value_matches_mortgage_plus_deposit(record) - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? return unless record.outright_sale? return unless record.mortgage_used? && record.mortgage return unless record.deposit && record.value @@ -96,7 +96,7 @@ module Validations::Sales::SaleInformationValidations end def validate_grant_amount(record) - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? return unless record.grant && (record.type == 8 || record.type == 21) unless record.grant.between?(9_000, 16_000) @@ -106,7 +106,7 @@ module Validations::Sales::SaleInformationValidations def validate_stairbought(record) return unless record.stairbought && record.type - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? max_stairbought = case record.type when 30, 16, 28, 31, 32 @@ -124,7 +124,7 @@ module Validations::Sales::SaleInformationValidations end def validate_discount_and_value(record) - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? return unless record.discount && record.value && record.la if record.london_property? && record.discount_value > 136_400 @@ -139,7 +139,7 @@ module Validations::Sales::SaleInformationValidations end def validate_non_staircasing_mortgage(record) - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? return unless record.value && record.deposit && record.equity return unless record.shared_ownership_scheme? && record.type && record.mortgageused && record.is_not_staircasing? @@ -151,7 +151,7 @@ module Validations::Sales::SaleInformationValidations end def validate_staircasing_mortgage(record) - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? return unless record.value && record.deposit && record.stairbought return unless record.shared_ownership_scheme? && record.type && record.mortgageused && record.is_staircase? @@ -334,7 +334,7 @@ module Validations::Sales::SaleInformationValidations if record.discounted_ownership_sale? record.errors.add :mortgageused, I18n.t("validations.invalid_option", question: "was a mortgage used for the purchase of this property?") end - if record.outright_sale? && record.saledate && !record.form.start_year_after_2024? + if record.outright_sale? && record.saledate && !record.form.start_year_2024_or_later? record.errors.add :mortgageused, I18n.t("validations.invalid_option", question: "was a mortgage used for the purchase of this property?") record.errors.add :saledate, I18n.t("validations.sales.sale_information.saledate.mortgage_used_year") end diff --git a/app/models/validations/sales/soft_validations.rb b/app/models/validations/sales/soft_validations.rb index fccd9bf83..fe05ec13c 100644 --- a/app/models/validations/sales/soft_validations.rb +++ b/app/models/validations/sales/soft_validations.rb @@ -68,7 +68,7 @@ module Validations::Sales::SoftValidations end def extra_borrowing_expected_but_not_reported? - return unless saledate && !form.start_year_after_2024? + return unless saledate && !form.start_year_2024_or_later? return unless extrabor && mortgage && deposit && value && discount extrabor != 1 && mortgage + deposit > value - value * discount / 100 @@ -118,7 +118,7 @@ module Validations::Sales::SoftValidations def grant_outside_common_range? return unless grant && type && saledate - return if form.start_year_after_2024? && (type == 21 || type == 8) + return if form.start_year_2024_or_later? && (type == 21 || type == 8) !grant.between?(9_000, 16_000) end 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/app/models/validations/shared_validations.rb b/app/models/validations/shared_validations.rb index a2ae916c1..2eb5fff5a 100644 --- a/app/models/validations/shared_validations.rb +++ b/app/models/validations/shared_validations.rb @@ -126,7 +126,7 @@ module Validations::SharedValidations end def shared_validate_partner_count(record, max_people) - return if record.form.start_year_after_2024? + return if record.form.start_year_2024_or_later? partner_numbers = (2..max_people).select { |n| person_is_partner?(record["relat#{n}"]) } if partner_numbers.count > 1 diff --git a/app/models/validations/soft_validations.rb b/app/models/validations/soft_validations.rb index 41309cef0..0b76f792b 100644 --- a/app/models/validations/soft_validations.rb +++ b/app/models/validations/soft_validations.rb @@ -27,6 +27,14 @@ module Validations::SoftValidations weekly_net_income.between?(applicable_income_range.hard_min, applicable_income_range.soft_min) end + def rent_soft_validation_triggered? + rent_in_soft_min_range? || rent_in_soft_max_range? + end + + def rent_soft_validation_higher_or_lower_text + rent_in_soft_min_range? ? "lower" : "higher" + end + def rent_in_soft_min_range? return unless brent && weekly_value(brent) && startdate diff --git a/app/models/validations/tenancy_validations.rb b/app/models/validations/tenancy_validations.rb index bd55203fb..d08f8a071 100644 --- a/app/models/validations/tenancy_validations.rb +++ b/app/models/validations/tenancy_validations.rb @@ -10,10 +10,9 @@ module Validations::TenancyValidations min_tenancy_length = 1 return if record.tenancylength.to_i.between?(min_tenancy_length, 99) - message = I18n.t("validations.tenancy.length.invalid_fixed", min_tenancy_length:) - record.errors.add :needstype, message - record.errors.add :tenancylength, :tenancylength_invalid, message: message - record.errors.add :tenancy, message + record.errors.add :needstype, I18n.t("validations.lettings.tenancy.needstype.invalid_fixed_tenancylength", min_tenancy_length:) + record.errors.add :tenancylength, :tenancylength_invalid, message: I18n.t("validations.lettings.tenancy.tenancylength.invalid_fixed_tenancylength", min_tenancy_length:) + record.errors.add :tenancy, I18n.t("validations.lettings.tenancy.tenancy.invalid_fixed_tenancylength", min_tenancy_length:) end def validate_general_needs_fixed_tenancy_length_affordable_social_rent(record) @@ -23,11 +22,10 @@ module Validations::TenancyValidations min_tenancy_length = 2 return if record.tenancylength.to_i.between?(min_tenancy_length, 99) - message = I18n.t("validations.tenancy.length.invalid_fixed", min_tenancy_length:) - record.errors.add :needstype, message - record.errors.add :rent_type, message - record.errors.add :tenancylength, :tenancylength_invalid, message: message - record.errors.add :tenancy, message + record.errors.add :needstype, I18n.t("validations.lettings.tenancy.needstype.invalid_fixed_tenancylength", min_tenancy_length:) + record.errors.add :rent_type, I18n.t("validations.lettings.tenancy.rent_type.invalid_fixed_tenancylength", min_tenancy_length:) + record.errors.add :tenancylength, :tenancylength_invalid, message: I18n.t("validations.lettings.tenancy.tenancylength.invalid_fixed_tenancylength", min_tenancy_length:) + record.errors.add :tenancy, I18n.t("validations.lettings.tenancy.tenancy.invalid_fixed_tenancylength", min_tenancy_length:) end def validate_general_needs_fixed_tenancy_length_intermediate_rent(record) @@ -37,11 +35,10 @@ module Validations::TenancyValidations min_tenancy_length = 1 return if record.tenancylength.to_i.between?(min_tenancy_length, 99) - message = I18n.t("validations.tenancy.length.invalid_fixed", min_tenancy_length:) - record.errors.add :needstype, message - record.errors.add :rent_type, message - record.errors.add :tenancylength, :tenancylength_invalid, message: message - record.errors.add :tenancy, message + record.errors.add :needstype, I18n.t("validations.lettings.tenancy.needstype.invalid_fixed_tenancylength", min_tenancy_length:) + record.errors.add :rent_type, I18n.t("validations.lettings.tenancy.rent_type.invalid_fixed_tenancylength", min_tenancy_length:) + record.errors.add :tenancylength, :tenancylength_invalid, message: I18n.t("validations.lettings.tenancy.tenancylength.invalid_fixed_tenancylength", min_tenancy_length:) + record.errors.add :tenancy, I18n.t("validations.lettings.tenancy.tenancy.invalid_fixed_tenancylength", min_tenancy_length:) end def validate_periodic_tenancy_length(record) @@ -50,18 +47,16 @@ module Validations::TenancyValidations min_tenancy_length = 1 return if record.tenancylength.to_i.between?(min_tenancy_length, 99) - message = I18n.t("validations.tenancy.length.invalid_periodic", min_tenancy_length:) - record.errors.add :tenancylength, :tenancylength_invalid, message: message - record.errors.add :tenancy, message + record.errors.add :tenancylength, :tenancylength_invalid, message: I18n.t("validations.lettings.tenancy.tenancylength.invalid_periodic_tenancylength", min_tenancy_length:) + record.errors.add :tenancy, I18n.t("validations.lettings.tenancy.tenancy.invalid_periodic_tenancylength", min_tenancy_length:) end def validate_tenancy_length_blank_when_not_required(record) return if record.tenancylength.blank? return if record.tenancy_type_fixed_term? || record.is_periodic_tenancy? - message = I18n.t("validations.tenancy.length.fixed_term_not_required") - record.errors.add :tenancylength, :tenancylength_invalid, message: message - record.errors.add :tenancy, message + record.errors.add :tenancylength, :tenancylength_invalid, message: I18n.t("validations.lettings.tenancy.tenancylength.fixed_term_not_required") + record.errors.add :tenancy, I18n.t("validations.lettings.tenancy.tenancy.fixed_term_not_required") end def validate_other_tenancy_type(record) @@ -72,8 +67,8 @@ module Validations::TenancyValidations return unless record.collection_start_year && record.joint if record.hhmemb == 1 && record.joint == 1 && record.collection_start_year >= 2022 - record.errors.add :joint, :not_joint_tenancy, message: I18n.t("validations.tenancy.not_joint") - record.errors.add :hhmemb, I18n.t("validations.tenancy.joint_more_than_one_member") + record.errors.add :joint, :not_joint_tenancy, message: I18n.t("validations.lettings.tenancy.joint.sole_tenancy") + record.errors.add :hhmemb, I18n.t("validations.lettings.tenancy.joint.multiple_members_required") end end end diff --git a/app/services/bulk_upload/lettings/validator.rb b/app/services/bulk_upload/lettings/validator.rb index 4da5b2c40..116c3b745 100644 --- a/app/services/bulk_upload/lettings/validator.rb +++ b/app/services/bulk_upload/lettings/validator.rb @@ -158,7 +158,7 @@ private def validate_file_not_empty if File.size(path).zero? || csv_parser.body_rows.flatten.compact.empty? - errors.add(:base, :blank_file) + errors.add(:base, I18n.t("validations.lettings.#{@bulk_upload.year}.bulk_upload.blank_file")) halt_validations! end @@ -168,7 +168,7 @@ private return if halt_validations? unless csv_parser.correct_field_count? - errors.add(:base, :wrong_field_numbers_count) + errors.add(:base, I18n.t("validations.lettings.#{@bulk_upload.year}.bulk_upload.wrong_template.wrong_field_numbers_count")) halt_validations! end end @@ -177,7 +177,7 @@ private return if halt_validations? if csv_parser.too_many_columns? - errors.add(:base, :over_max_column_count) + errors.add(:base, I18n.t("validations.lettings.#{@bulk_upload.year}.bulk_upload.wrong_template.over_max_column_count")) halt_validations! end end @@ -185,14 +185,14 @@ private def validate_correct_template return if halt_validations? - errors.add(:base, :wrong_template) if csv_parser.wrong_template_for_year? + errors.add(:base, I18n.t("validations.lettings.#{@bulk_upload.year}.bulk_upload.wrong_template.wrong_template")) if csv_parser.wrong_template_for_year? end def validate_missing_required_headers return if halt_validations? if csv_parser.missing_required_headers? - errors.add :base, I18n.t("activemodel.errors.models.bulk_upload/lettings/validator.attributes.base.no_headers", guidance_link: bulk_upload_lettings_log_url(id: "guidance", form: { year: bulk_upload.year }, host: ENV["APP_HOST"], anchor: "using-the-bulk-upload-template")) + errors.add :base, I18n.t("validations.lettings.#{@bulk_upload.year}.bulk_upload.wrong_template.no_headers", guidance_link: bulk_upload_lettings_log_url(id: "guidance", form: { year: bulk_upload.year }, host: ENV["APP_HOST"], anchor: "using-the-bulk-upload-template")) halt_validations! end end diff --git a/app/services/bulk_upload/lettings/year2023/row_parser.rb b/app/services/bulk_upload/lettings/year2023/row_parser.rb index 59cf7ea34..3424e0608 100644 --- a/app/services/bulk_upload/lettings/year2023/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2023/row_parser.rb @@ -141,6 +141,8 @@ class BulkUpload::Lettings::Year2023::RowParser field_134: "What do you expect the outstanding amount to be?", }.freeze + ERROR_BASE_KEY = "validations.lettings.2023.bulk_upload".freeze + attribute :bulk_upload attribute :block_log_creation, :boolean, default: -> { false } @@ -285,12 +287,12 @@ class BulkUpload::Lettings::Year2023::RowParser validates :field_5, presence: { - message: I18n.t("validations.not_answered", question: "letting type."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "letting type."), category: :setup, }, inclusion: { in: (1..12).to_a, - message: I18n.t("validations.invalid_option", question: "letting type."), + message: I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: "letting type."), unless: -> { field_5.blank? }, category: :setup, }, @@ -298,33 +300,33 @@ class BulkUpload::Lettings::Year2023::RowParser validates :field_6, presence: { - message: I18n.t("validations.not_answered", question: "property renewal."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "property renewal."), category: :setup, }, on: :after_log validates :field_7, presence: { - message: I18n.t("validations.not_answered", question: "tenancy start date (day)."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "tenancy start date (day)."), category: :setup, }, on: :after_log validates :field_8, presence: { - message: I18n.t("validations.not_answered", question: "tenancy start date (month)."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "tenancy start date (month)."), category: :setup, }, on: :after_log validates :field_9, presence: { - message: I18n.t("validations.not_answered", question: "tenancy start date (year)."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "tenancy start date (year)."), category: :setup, }, format: { with: /\A(\d{2}|\d{4})\z/, - message: I18n.t("validations.setup.startdate.year_not_two_or_four_digits"), + message: I18n.t("#{ERROR_BASE_KEY}.startdate.year_not_two_or_four_digits"), category: :setup, unless: -> { field_9.blank? }, }, @@ -333,55 +335,55 @@ class BulkUpload::Lettings::Year2023::RowParser validates :field_16, presence: { if: proc { supported_housing? }, - message: I18n.t("validations.not_answered", question: "scheme code."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "scheme code."), category: :setup, }, on: :after_log validates :field_116, presence: { - message: I18n.t("validations.not_answered", question: "was the letting made under the Choice-Based Lettings (CBL)?"), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "was the letting made under the Choice-Based Lettings (CBL)?"), category: :not_answered, }, inclusion: { in: [1, 2], - message: I18n.t("validations.invalid_option", question: "was the letting made under the Choice-Based Lettings (CBL)?"), + message: I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: "was the letting made under the Choice-Based Lettings (CBL)?"), if: -> { field_116.present? }, }, on: :after_log validates :field_117, presence: { - message: I18n.t("validations.not_answered", question: "was the letting made under the Common Allocation Policy (CAP)?"), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "was the letting made under the Common Allocation Policy (CAP)?"), category: :not_answered, }, inclusion: { in: [1, 2], - message: I18n.t("validations.invalid_option", question: "was the letting made under the Common Allocation Policy (CAP)?"), + message: I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: "was the letting made under the Common Allocation Policy (CAP)?"), if: -> { field_117.present? }, }, on: :after_log validates :field_118, presence: { - message: I18n.t("validations.not_answered", question: "was the letting made under the Common Housing Register (CHR)?"), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "was the letting made under the Common Housing Register (CHR)?"), category: :not_answered, }, inclusion: { in: [1, 2], - message: I18n.t("validations.invalid_option", question: "was the letting made under the Common Housing Register (CHR)?"), + message: I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: "was the letting made under the Common Housing Register (CHR)?"), if: -> { field_118.present? }, }, on: :after_log - validates :field_46, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 1 must be a number or the letter R" }, on: :after_log - validates :field_52, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 2 must be a number or the letter R" }, on: :after_log, if: proc { details_known?(2).zero? } - validates :field_56, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 3 must be a number or the letter R" }, on: :after_log, if: proc { details_known?(3).zero? } - validates :field_60, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 4 must be a number or the letter R" }, on: :after_log, if: proc { details_known?(4).zero? } - validates :field_64, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 5 must be a number or the letter R" }, on: :after_log, if: proc { details_known?(5).zero? } - validates :field_68, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 6 must be a number or the letter R" }, on: :after_log, if: proc { details_known?(6).zero? } - validates :field_72, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 7 must be a number or the letter R" }, on: :after_log, if: proc { details_known?(7).zero? } - validates :field_76, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 8 must be a number or the letter R" }, on: :after_log, if: proc { details_known?(8).zero? } + validates :field_46, format: { with: /\A\d{1,3}\z|\AR\z/, message: I18n.t("#{ERROR_BASE_KEY}.age.invalid", person_num: 1) }, on: :after_log + validates :field_52, format: { with: /\A\d{1,3}\z|\AR\z/, message: I18n.t("#{ERROR_BASE_KEY}.age.invalid", person_num: 2) }, on: :after_log, if: proc { details_known?(2).zero? } + validates :field_56, format: { with: /\A\d{1,3}\z|\AR\z/, message: I18n.t("#{ERROR_BASE_KEY}.age.invalid", person_num: 3) }, on: :after_log, if: proc { details_known?(3).zero? } + validates :field_60, format: { with: /\A\d{1,3}\z|\AR\z/, message: I18n.t("#{ERROR_BASE_KEY}.age.invalid", person_num: 4) }, on: :after_log, if: proc { details_known?(4).zero? } + validates :field_64, format: { with: /\A\d{1,3}\z|\AR\z/, message: I18n.t("#{ERROR_BASE_KEY}.age.invalid", person_num: 5) }, on: :after_log, if: proc { details_known?(5).zero? } + validates :field_68, format: { with: /\A\d{1,3}\z|\AR\z/, message: I18n.t("#{ERROR_BASE_KEY}.age.invalid", person_num: 6) }, on: :after_log, if: proc { details_known?(6).zero? } + validates :field_72, format: { with: /\A\d{1,3}\z|\AR\z/, message: I18n.t("#{ERROR_BASE_KEY}.age.invalid", person_num: 7) }, on: :after_log, if: proc { details_known?(7).zero? } + validates :field_76, format: { with: /\A\d{1,3}\z|\AR\z/, message: I18n.t("#{ERROR_BASE_KEY}.age.invalid", person_num: 8) }, on: :after_log, if: proc { details_known?(8).zero? } validate :validate_needs_type_present, on: :after_log validate :validate_data_types, on: :after_log @@ -521,7 +523,7 @@ class BulkUpload::Lettings::Year2023::RowParser def add_duplicate_found_in_spreadsheet_errors spreadsheet_duplicate_hash.each_key do |field| - errors.add(field, :spreadsheet_dupe, category: :setup) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.spreadsheet_dupe"), category: :setup) end end @@ -529,7 +531,7 @@ private def validate_declaration_acceptance unless field_45 == 1 - errors.add(:field_45, I18n.t("validations.declaration.missing.pre_2024"), category: :setup) + errors.add(:field_45, I18n.t("#{ERROR_BASE_KEY}.declaration.missing"), category: :setup) end end @@ -544,9 +546,9 @@ private fields.each do |field| if setup_question?(question) - errors.add(field, I18n.t("validations.invalid_option", question: format_ending(QUESTIONS[field])), category: :setup) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: format_ending(QUESTIONS[field])), category: :setup) else - errors.add(field, I18n.t("validations.invalid_option", question: format_ending(QUESTIONS[field]))) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: format_ending(QUESTIONS[field]))) end end end @@ -556,7 +558,7 @@ private return if field_3.blank? unless assigned_to - errors.add(:field_3, "User with the specified email could not be found.") + errors.add(:field_3, I18n.t("#{ERROR_BASE_KEY}.assigned_to.not_found")) end end @@ -566,7 +568,7 @@ private return if assigned_to.organisation == owning_organisation&.absorbing_organisation || assigned_to.organisation == managing_organisation&.absorbing_organisation block_log_creation! - errors.add(:field_3, "User must be related to owning organisation or managing organisation.") + errors.add(:field_3, I18n.t("#{ERROR_BASE_KEY}.assigned_to.organisation_not_related")) end def assigned_to @@ -575,7 +577,7 @@ private def validate_uprn_exists_if_any_key_address_fields_are_blank if field_18.blank? && (field_19.blank? || field_21.blank?) - errors.add(:field_18, I18n.t("validations.not_answered", question: "UPRN."), category: :not_answered) + errors.add(:field_18, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "UPRN."), category: :not_answered) end end @@ -614,21 +616,21 @@ private def validate_needs_type_present if field_4.blank? - errors.add(:field_4, I18n.t("validations.not_answered", question: "needs type."), category: :setup) + errors.add(:field_4, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "needs type."), category: :setup) end end def validate_no_and_dont_know_disabled_needs_conjunction if field_87 == 1 && field_88 == 1 - errors.add(:field_87, I18n.t("validations.household.housingneeds.no_and_dont_know_disabled_needs_conjunction")) - errors.add(:field_88, I18n.t("validations.household.housingneeds.no_and_dont_know_disabled_needs_conjunction")) + errors.add(:field_87, I18n.t("#{ERROR_BASE_KEY}.housingneeds.no_and_dont_know_disabled_needs_conjunction")) + errors.add(:field_88, I18n.t("#{ERROR_BASE_KEY}.housingneeds.no_and_dont_know_disabled_needs_conjunction")) end end def validate_dont_know_disabled_needs_conjunction if field_88 == 1 && [field_83, field_84, field_85, field_86].count(1).positive? %i[field_88 field_83 field_84 field_85 field_86].each do |field| - errors.add(field, I18n.t("validations.household.housingneeds.dont_know_disabled_needs_conjunction")) if send(field) == 1 + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.housingneeds.dont_know_disabled_needs_conjunction")) if send(field) == 1 end end end @@ -636,7 +638,7 @@ private def validate_no_disabled_needs_conjunction if field_87 == 1 && [field_83, field_84, field_85, field_86].count(1).positive? %i[field_87 field_83 field_84 field_85 field_86].each do |field| - errors.add(field, I18n.t("validations.household.housingneeds.no_disabled_needs_conjunction")) if send(field) == 1 + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.housingneeds.no_disabled_needs_conjunction")) if send(field) == 1 end end end @@ -644,17 +646,17 @@ private def validate_only_one_housing_needs_type if [field_83, field_84, field_85].count(1) > 1 %i[field_83 field_84 field_85].each do |field| - errors.add(field, I18n.t("validations.household.housingneeds_type.only_one_option_permitted")) if send(field) == 1 + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.housingneeds_type.only_one_option_permitted")) if send(field) == 1 end end end def validate_no_housing_needs_questions_answered if [field_83, field_84, field_85, field_86, field_87, field_88].all?(&:blank?) - errors.add(:field_87, I18n.t("validations.not_answered", question: "anybody with disabled access needs."), category: :not_answered) - errors.add(:field_86, I18n.t("validations.not_answered", question: "other access needs."), category: :not_answered) + errors.add(:field_87, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "anybody with disabled access needs."), category: :not_answered) + errors.add(:field_86, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "other access needs."), category: :not_answered) %i[field_83 field_84 field_85].each do |field| - errors.add(field, I18n.t("validations.not_answered", question: "disabled access needs type."), category: :not_answered) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "disabled access needs type."), category: :not_answered) end end end @@ -663,7 +665,7 @@ private reason_fields = %i[field_111 field_112 field_113 field_114 field_115] if field_110 == 1 && reason_fields.all? { |field| attributes[field.to_s].blank? } reason_fields.each do |field| - errors.add(field, I18n.t("validations.not_answered", question: "reason for reasonable preference."), category: :not_answered) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "reason for reasonable preference."), category: :not_answered) end end end @@ -673,12 +675,12 @@ private if household_no_illness? illness_option_fields.each do |field| if attributes[field.to_s] == 1 - errors.add(field, I18n.t("validations.household.condition_effects.no_choices")) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.condition_effects.no_choices")) end end elsif illness_option_fields.all? { |field| attributes[field.to_s].blank? } illness_option_fields.each do |field| - errors.add(field, I18n.t("validations.not_answered", question: "how is person affected by condition or illness."), category: :not_answered) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "how is person affected by condition or illness."), category: :not_answered) end end end @@ -690,20 +692,20 @@ private def validate_lettings_type_matches_bulk_upload if [1, 3, 5, 7, 9, 11].include?(field_5) && !general_needs? block_log_creation! - errors.add(:field_4, I18n.t("validations.setup.needstype.lettype_not_supported_housing"), category: :setup) - errors.add(:field_5, I18n.t("validations.setup.lettype.needstype_supported_housing"), category: :setup) + errors.add(:field_4, I18n.t("#{ERROR_BASE_KEY}.needstype.lettype_not_supported_housing"), category: :setup) + errors.add(:field_5, I18n.t("#{ERROR_BASE_KEY}.lettype.needstype_supported_housing"), category: :setup) end if [2, 4, 6, 8, 10, 12].include?(field_5) && !supported_housing? block_log_creation! - errors.add(:field_4, I18n.t("validations.setup.needstype.lettype_not_general_needs"), category: :setup) - errors.add(:field_5, I18n.t("validations.setup.lettype.needstype_general_needs"), category: :setup) + errors.add(:field_4, I18n.t("#{ERROR_BASE_KEY}.needstype.lettype_not_general_needs"), category: :setup) + errors.add(:field_5, I18n.t("#{ERROR_BASE_KEY}.lettype.needstype_general_needs"), category: :setup) end end def validate_leaving_reason_for_renewal if field_6 == 1 && ![40, 42].include?(field_102) - errors.add(:field_102, I18n.t("validations.household.reason.renewal_reason_needed")) + errors.add(:field_102, I18n.t("#{ERROR_BASE_KEY}.reason.renewal_reason_needed")) end end @@ -717,13 +719,13 @@ private def validate_cannot_be_la_referral_if_general_needs_and_la if field_119 == 4 && general_needs? && owning_organisation && owning_organisation.la? - errors.add :field_119, I18n.t("validations.household.referral.la_general_needs.prp_referred_by_la") + errors.add :field_119, I18n.t("#{ERROR_BASE_KEY}.referral.general_needs_prp_referred_by_la") end end def validate_la_with_local_housing_referral if field_119 == 3 && owning_organisation && owning_organisation.la? - errors.add(:field_119, I18n.t("validations.household.referral.nominated_by_local_ha_but_la")) + errors.add(:field_119, I18n.t("#{ERROR_BASE_KEY}.referral.nominated_by_local_ha_but_la")) end end @@ -731,15 +733,15 @@ private return if startdate.blank? || bulk_upload.form.blank? unless bulk_upload.form.valid_start_date_for_form?(startdate) - errors.add(:field_7, I18n.t("validations.date.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) - errors.add(:field_8, I18n.t("validations.date.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) - errors.add(:field_9, I18n.t("validations.date.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) + errors.add(:field_7, I18n.t("#{ERROR_BASE_KEY}.startdate.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) + errors.add(:field_8, I18n.t("#{ERROR_BASE_KEY}.startdate.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) + errors.add(:field_9, I18n.t("#{ERROR_BASE_KEY}.startdate.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) end end def validate_data_types unless attribute_set["field_5"].value_before_type_cast&.match?(/^\d+\.?0*$/) - errors.add(:field_5, I18n.t("validations.invalid_number", question: "letting type.")) + errors.add(:field_5, I18n.t("#{ERROR_BASE_KEY}.invalid_number", question: "letting type.")) end end @@ -756,14 +758,14 @@ private fields.each do |field| if errors.select { |e| fields.include?(e.attribute) }.none? question_text = question.error_display_label.presence || "this question." - errors.add(field, I18n.t("validations.not_answered", question: format_ending(question_text)), category: :setup) if field.present? + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: format_ending(question_text)), category: :setup) if field.present? end end else fields.each do |field| unless errors.any? { |e| fields.include?(e.attribute) } question_text = question.error_display_label.presence || "this question." - errors.add(field, I18n.t("validations.not_answered", question: format_ending(question_text)), category: :not_answered) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: format_ending(question_text)), category: :not_answered) end end end @@ -773,28 +775,28 @@ private def validate_related_location_exists if scheme && location_id.present? && location.nil? && location_field.present? block_log_creation! - errors.add(location_field, "#{location_or_scheme.capitalize} code must relate to a #{location_or_scheme} that is owned by the owning organisation or managing organisation.", category: :setup) + errors.add(location_field, I18n.t("#{ERROR_BASE_KEY}.scheme.must_relate_to_org", capitalised_location_or_scheme: location_or_scheme.capitalize, location_or_scheme:), category: :setup) end end def validate_location_data_given if supported_housing? && location_id.blank? && location_field.present? block_log_creation! - errors.add(location_field, I18n.t("validations.not_answered", question: "#{location_or_scheme} code."), category: :setup) + errors.add(location_field, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "#{location_or_scheme} code."), category: :setup) end end def validate_related_scheme_exists if scheme_id.present? && scheme_field.present? && owning_organisation.present? && managing_organisation.present? && scheme.nil? block_log_creation! - errors.add(scheme_field, "This #{scheme_or_management_group} code does not belong to the owning organisation or managing organisation.", category: :setup) + errors.add(scheme_field, I18n.t("#{ERROR_BASE_KEY}.scheme.does_not_belong_to_org", scheme_or_management_group:), category: :setup) end end def validate_scheme_data_given if supported_housing? && scheme_field.present? && scheme_id.blank? block_log_creation! - errors.add(scheme_field, I18n.t("validations.not_answered", question: "#{scheme_or_management_group} code."), category: :setup) + errors.add(scheme_field, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "#{scheme_or_management_group} code."), category: :setup) end end @@ -803,7 +805,7 @@ private block_log_creation! if errors[:field_2].blank? - errors.add(:field_2, "This managing organisation does not have a relationship with the owning organisation.", category: :setup) + errors.add(:field_2, I18n.t("#{ERROR_BASE_KEY}.managing_organisation.no_relationship"), category: :setup) end end end @@ -813,7 +815,7 @@ private block_log_creation! if errors[:field_2].blank? - errors.add(:field_2, "The managing organisation code is incorrect.", category: :setup) + errors.add(:field_2, I18n.t("#{ERROR_BASE_KEY}.managing_organisation.not_found"), category: :setup) end end end @@ -821,7 +823,7 @@ private def validate_managing_org_data_given if field_2.blank? block_log_creation! - errors.add(:field_2, "The managing organisation code is incorrect.", category: :setup) + errors.add(:field_2, I18n.t("#{ERROR_BASE_KEY}.managing_organisation.not_answered"), category: :setup) end end @@ -830,7 +832,7 @@ private block_log_creation! if errors[:field_1].blank? - errors.add(:field_1, "The owning organisation code provided is for an organisation that does not own stock.", category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.owning_organisation.not_stock_owner"), category: :setup) end end end @@ -840,7 +842,7 @@ private block_log_creation! if errors[:field_1].blank? - errors.add(:field_1, "The owning organisation code is incorrect.", category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.owning_organisation.not_found"), category: :setup) end end end @@ -848,7 +850,7 @@ private def validate_owning_org_data_given if field_1.blank? block_log_creation! - errors.add(:field_1, I18n.t("validations.not_answered", question: "owning organisation."), category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "owning organisation."), category: :setup) end end @@ -857,20 +859,20 @@ private block_log_creation! if errors[:field_1].blank? - errors.add(:field_1, "You do not have permission to add logs for this owning organisation.", category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.owning_organisation.not_permitted"), category: :setup) end end end def validate_correct_intermediate_rent_type if field_11.blank? || ![1, 2, 3].include?(field_11.to_i) - errors.add(:field_11, I18n.t("validations.not_answered", question: "intermediate rent type."), category: :setup) + errors.add(:field_11, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "intermediate rent type."), category: :setup) end end def validate_correct_affordable_rent_type if field_10.blank? || ![1, 2, 3].include?(field_10.to_i) - errors.add(:field_10, I18n.t("validations.not_answered", question: "is this a London Affordable Rent letting."), category: :setup) + errors.add(:field_10, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "is this a London Affordable Rent letting."), category: :setup) end end @@ -880,7 +882,7 @@ private def validate_if_log_already_exists if log_already_exists? - error_message = "This is a duplicate log." + error_message = I18n.t("#{ERROR_BASE_KEY}.duplicate") errors.add(:field_1, error_message) # owning_organisation errors.add(:field_7, error_message) # startdate diff --git a/app/services/bulk_upload/lettings/year2024/row_parser.rb b/app/services/bulk_upload/lettings/year2024/row_parser.rb index 312a5472a..ef7433614 100644 --- a/app/services/bulk_upload/lettings/year2024/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2024/row_parser.rb @@ -146,6 +146,8 @@ class BulkUpload::Lettings::Year2024::RowParser 6 => 5, }.freeze + ERROR_BASE_KEY = "validations.lettings.2024.bulk_upload".freeze + attribute :bulk_upload attribute :block_log_creation, :boolean, default: -> { false } @@ -286,12 +288,12 @@ class BulkUpload::Lettings::Year2024::RowParser validates :field_11, presence: { - message: I18n.t("validations.not_answered", question: "rent type."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "rent type."), category: :setup, }, inclusion: { in: (1..6).to_a, - message: I18n.t("validations.invalid_option", question: "rent type."), + message: I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: "rent type."), unless: -> { field_11.blank? }, category: :setup, }, @@ -299,33 +301,33 @@ class BulkUpload::Lettings::Year2024::RowParser validates :field_7, presence: { - message: I18n.t("validations.not_answered", question: "property renewal."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "property renewal."), category: :setup, }, on: :after_log validates :field_8, presence: { - message: I18n.t("validations.not_answered", question: "tenancy start date (day)."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "tenancy start date (day)."), category: :setup, }, on: :after_log validates :field_9, presence: { - message: I18n.t("validations.not_answered", question: "tenancy start date (month)."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "tenancy start date (month)."), category: :setup, }, on: :after_log validates :field_10, presence: { - message: I18n.t("validations.not_answered", question: "tenancy start date (year)."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "tenancy start date (year)."), category: :setup, }, format: { with: /\A(\d{2}|\d{4})\z/, - message: I18n.t("validations.setup.startdate.year_not_two_or_four_digits"), + message: I18n.t("#{ERROR_BASE_KEY}.startdate.year_not_two_or_four_digits"), category: :setup, unless: -> { field_10.blank? }, }, @@ -334,7 +336,7 @@ class BulkUpload::Lettings::Year2024::RowParser validates :field_5, presence: { if: proc { supported_housing? }, - message: I18n.t("validations.not_answered", question: "scheme code."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "scheme code."), category: :setup, }, on: :after_log @@ -342,67 +344,67 @@ class BulkUpload::Lettings::Year2024::RowParser validates :field_6, presence: { if: proc { supported_housing? }, - message: I18n.t("validations.not_answered", question: "location code."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "location code."), category: :setup, }, on: :after_log validates :field_112, presence: { - message: I18n.t("validations.not_answered", question: "was the letting made under the Choice-Based Lettings (CBL)?"), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "was the letting made under the Choice-Based Lettings (CBL)?"), category: :not_answered, }, inclusion: { in: [1, 2], - message: I18n.t("validations.invalid_option", question: "was the letting made under the Choice-Based Lettings (CBL)?"), + message: I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: "was the letting made under the Choice-Based Lettings (CBL)?"), if: -> { field_112.present? }, }, on: :after_log validates :field_113, presence: { - message: I18n.t("validations.not_answered", question: "was the letting made under the Common Allocation Policy (CAP)?"), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "was the letting made under the Common Allocation Policy (CAP)?"), category: :not_answered, }, inclusion: { in: [1, 2], - message: I18n.t("validations.invalid_option", question: "was the letting made under the Common Allocation Policy (CAP)?"), + message: I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: "was the letting made under the Common Allocation Policy (CAP)?"), if: -> { field_113.present? }, }, on: :after_log validates :field_114, presence: { - message: I18n.t("validations.not_answered", question: "was the letting made under the Common Housing Register (CHR)?"), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "was the letting made under the Common Housing Register (CHR)?"), category: :not_answered, }, inclusion: { in: [1, 2], - message: I18n.t("validations.invalid_option", question: "was the letting made under the Common Housing Register (CHR)?"), + message: I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: "was the letting made under the Common Housing Register (CHR)?"), if: -> { field_114.present? }, }, on: :after_log validates :field_115, presence: { - message: I18n.t("validations.not_answered", question: "was the letting made under the Accessible Register?"), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "was the letting made under the Accessible Register?"), category: :not_answered, }, inclusion: { in: [1, 2], - message: I18n.t("validations.invalid_option", question: "was the letting made under the Accessible Register?"), + message: I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: "was the letting made under the Accessible Register?"), if: -> { field_115.present? }, }, on: :after_log - validates :field_42, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 1 must be a number or the letter R" }, on: :after_log - validates :field_48, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 2 must be a number or the letter R" }, on: :after_log, if: proc { details_known?(2).zero? } - validates :field_52, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 3 must be a number or the letter R" }, on: :after_log, if: proc { details_known?(3).zero? } - validates :field_56, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 4 must be a number or the letter R" }, on: :after_log, if: proc { details_known?(4).zero? } - validates :field_60, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 5 must be a number or the letter R" }, on: :after_log, if: proc { details_known?(5).zero? } - validates :field_64, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 6 must be a number or the letter R" }, on: :after_log, if: proc { details_known?(6).zero? } - validates :field_68, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 7 must be a number or the letter R" }, on: :after_log, if: proc { details_known?(7).zero? } - validates :field_72, format: { with: /\A\d{1,3}\z|\AR\z/, message: "Age of person 8 must be a number or the letter R" }, on: :after_log, if: proc { details_known?(8).zero? } + validates :field_42, format: { with: /\A\d{1,3}\z|\AR\z/, message: I18n.t("#{ERROR_BASE_KEY}.age.invalid", person_num: 1) }, on: :after_log + validates :field_48, format: { with: /\A\d{1,3}\z|\AR\z/, message: I18n.t("#{ERROR_BASE_KEY}.age.invalid", person_num: 2) }, on: :after_log, if: proc { details_known?(2).zero? } + validates :field_52, format: { with: /\A\d{1,3}\z|\AR\z/, message: I18n.t("#{ERROR_BASE_KEY}.age.invalid", person_num: 3) }, on: :after_log, if: proc { details_known?(3).zero? } + validates :field_56, format: { with: /\A\d{1,3}\z|\AR\z/, message: I18n.t("#{ERROR_BASE_KEY}.age.invalid", person_num: 4) }, on: :after_log, if: proc { details_known?(4).zero? } + validates :field_60, format: { with: /\A\d{1,3}\z|\AR\z/, message: I18n.t("#{ERROR_BASE_KEY}.age.invalid", person_num: 5) }, on: :after_log, if: proc { details_known?(5).zero? } + validates :field_64, format: { with: /\A\d{1,3}\z|\AR\z/, message: I18n.t("#{ERROR_BASE_KEY}.age.invalid", person_num: 6) }, on: :after_log, if: proc { details_known?(6).zero? } + validates :field_68, format: { with: /\A\d{1,3}\z|\AR\z/, message: I18n.t("#{ERROR_BASE_KEY}.age.invalid", person_num: 7) }, on: :after_log, if: proc { details_known?(7).zero? } + validates :field_72, format: { with: /\A\d{1,3}\z|\AR\z/, message: I18n.t("#{ERROR_BASE_KEY}.age.invalid", person_num: 8) }, on: :after_log, if: proc { details_known?(8).zero? } validate :validate_needs_type_present, on: :after_log validate :validate_data_types, on: :after_log @@ -547,10 +549,10 @@ class BulkUpload::Lettings::Year2024::RowParser spreadsheet_duplicate_hash.each_key do |field| if field == "tcharge" %w[field_125 field_126 field_127 field_128].each do |sub_field| - errors.add(sub_field, :spreadsheet_dupe, category: :setup) + errors.add(sub_field, I18n.t("#{ERROR_BASE_KEY}.spreadsheet_dupe"), category: :setup) end else - errors.add(field, :spreadsheet_dupe, category: :setup) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.spreadsheet_dupe"), category: :setup) end end end @@ -568,9 +570,9 @@ private fields.each do |field| if setup_question?(question) - errors.add(field, I18n.t("validations.invalid_option", question: format_ending(QUESTIONS[field])), category: :setup) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: format_ending(QUESTIONS[field])), category: :setup) else - errors.add(field, I18n.t("validations.invalid_option", question: format_ending(QUESTIONS[field]))) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: format_ending(QUESTIONS[field]))) end end end @@ -580,13 +582,13 @@ private return if field_3.blank? unless assigned_to - errors.add(:field_3, "User with the specified email could not be found.") + errors.add(:field_3, I18n.t("#{ERROR_BASE_KEY}.assigned_to.not_found")) end end def validate_assigned_to_when_support if field_3.blank? && bulk_upload.user.support? - errors.add(:field_3, category: :setup, message: I18n.t("validations.not_answered", question: "what is the CORE username of the account this letting log should be assigned to?")) + errors.add(:field_3, category: :setup, message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "what is the CORE username of the account this letting log should be assigned to?")) end end @@ -596,7 +598,7 @@ private return if assigned_to.organisation == owning_organisation&.absorbing_organisation || assigned_to.organisation == managing_organisation&.absorbing_organisation block_log_creation! - errors.add(:field_3, "User must be related to owning organisation or managing organisation.") + errors.add(:field_3, I18n.t("#{ERROR_BASE_KEY}.assigned_to.organisation_not_related")) end def assigned_to @@ -605,14 +607,14 @@ private def validate_uprn_exists_if_any_key_address_fields_are_blank if field_16.blank? && !key_address_fields_provided? - errors.add(:field_16, I18n.t("validations.not_answered", question: "UPRN.")) + errors.add(:field_16, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "UPRN.")) end end def validate_address_option_found if log.uprn.nil? && field_16.blank? && key_address_fields_provided? %i[field_17 field_18 field_19 field_20 field_21 field_22].each do |field| - errors.add(field, I18n.t("validations.no_address_found")) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.address.not_found")) end end end @@ -624,19 +626,19 @@ private def validate_address_fields if field_16.blank? || log.errors.attribute_names.include?(:uprn) if field_17.blank? - errors.add(:field_17, I18n.t("validations.not_answered", question: "address line 1.")) + errors.add(:field_17, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "address line 1.")) end if field_19.blank? - errors.add(:field_19, I18n.t("validations.not_answered", question: "town or city.")) + errors.add(:field_19, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "town or city.")) end if field_21.blank? - errors.add(:field_21, I18n.t("validations.not_answered", question: "part 1 of postcode.")) + errors.add(:field_21, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "part 1 of postcode.")) end if field_22.blank? - errors.add(:field_22, I18n.t("validations.not_answered", question: "part 2 of postcode.")) + errors.add(:field_22, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "part 2 of postcode.")) end end end @@ -661,7 +663,7 @@ private def validate_nationality if field_45.present? && !valid_nationality_options.include?(field_45.to_s) - errors.add(:field_45, I18n.t("validations.household.nationality")) + errors.add(:field_45, I18n.t("#{ERROR_BASE_KEY}.nationality.invalid")) end end @@ -682,21 +684,21 @@ private def validate_needs_type_present if field_4.blank? - errors.add(:field_4, I18n.t("validations.not_answered", question: "needs type."), category: :setup) + errors.add(:field_4, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "needs type."), category: :setup) end end def validate_no_and_dont_know_disabled_needs_conjunction if field_83 == 1 && field_84 == 1 - errors.add(:field_83, I18n.t("validations.household.housingneeds.no_and_dont_know_disabled_needs_conjunction")) - errors.add(:field_84, I18n.t("validations.household.housingneeds.no_and_dont_know_disabled_needs_conjunction")) + errors.add(:field_83, I18n.t("#{ERROR_BASE_KEY}.housingneeds.no_and_dont_know_disabled_needs_conjunction")) + errors.add(:field_84, I18n.t("#{ERROR_BASE_KEY}.housingneeds.no_and_dont_know_disabled_needs_conjunction")) end end def validate_dont_know_disabled_needs_conjunction if field_84 == 1 && [field_79, field_80, field_81, field_82].count(1).positive? %i[field_84 field_79 field_80 field_81 field_82].each do |field| - errors.add(field, I18n.t("validations.household.housingneeds.dont_know_disabled_needs_conjunction")) if send(field) == 1 + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.housingneeds.dont_know_disabled_needs_conjunction")) if send(field) == 1 end end end @@ -704,7 +706,7 @@ private def validate_no_disabled_needs_conjunction if field_83 == 1 && [field_79, field_80, field_81, field_82].count(1).positive? %i[field_83 field_79 field_80 field_81 field_82].each do |field| - errors.add(field, I18n.t("validations.household.housingneeds.no_disabled_needs_conjunction")) if send(field) == 1 + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.housingneeds.no_disabled_needs_conjunction")) if send(field) == 1 end end end @@ -712,17 +714,17 @@ private def validate_only_one_housing_needs_type if [field_79, field_80, field_81].count(1) > 1 %i[field_79 field_80 field_81].each do |field| - errors.add(field, I18n.t("validations.household.housingneeds_type.only_one_option_permitted")) if send(field) == 1 + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.housingneeds_type.only_one_option_permitted")) if send(field) == 1 end end end def validate_no_housing_needs_questions_answered if [field_79, field_80, field_81, field_82, field_83, field_84].all?(&:blank?) - errors.add(:field_83, I18n.t("validations.not_answered", question: "anybody with disabled access needs.")) - errors.add(:field_82, I18n.t("validations.not_answered", question: "other access needs.")) + errors.add(:field_83, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "anybody with disabled access needs.")) + errors.add(:field_82, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "other access needs.")) %i[field_79 field_80 field_81].each do |field| - errors.add(field, I18n.t("validations.not_answered", question: "disabled access needs type.")) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "disabled access needs type.")) end end end @@ -731,7 +733,7 @@ private reason_fields = %i[field_107 field_108 field_109 field_110 field_111] if field_106 == 1 && reason_fields.all? { |field| attributes[field.to_s].blank? } reason_fields.each do |field| - errors.add(field, I18n.t("validations.not_answered", question: "reason for reasonable preference.")) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "reason for reasonable preference.")) end end end @@ -741,12 +743,12 @@ private if household_no_illness? illness_option_fields.each do |field| if attributes[field.to_s] == 1 - errors.add(field, I18n.t("validations.household.condition_effects.no_choices")) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.condition_effects.no_choices")) end end elsif illness_option_fields.all? { |field| attributes[field.to_s].blank? } illness_option_fields.each do |field| - errors.add(field, I18n.t("validations.not_answered", question: "how is person affected by condition or illness.")) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "how is person affected by condition or illness.")) end end end @@ -757,7 +759,7 @@ private def validate_leaving_reason_for_renewal if field_7 == 1 && ![50, 51, 52, 53].include?(field_98) - errors.add(:field_98, I18n.t("validations.household.reason.renewal_reason_needed_2024")) + errors.add(:field_98, I18n.t("#{ERROR_BASE_KEY}.reason.renewal_reason_needed")) end end @@ -771,13 +773,13 @@ private def validate_cannot_be_la_referral_if_general_needs_and_la if field_116 == 4 && general_needs? && owning_organisation && owning_organisation.la? - errors.add :field_116, I18n.t("validations.household.referral.la_general_needs.prp_referred_by_la") + errors.add :field_116, I18n.t("#{ERROR_BASE_KEY}.referral.general_needs_prp_referred_by_la") end end def validate_la_with_local_housing_referral if field_116 == 3 && owning_organisation && owning_organisation.la? - errors.add(:field_116, I18n.t("validations.household.referral.nominated_by_local_ha_but_la")) + errors.add(:field_116, I18n.t("#{ERROR_BASE_KEY}.referral.nominated_by_local_ha_but_la")) end end @@ -785,15 +787,15 @@ private return if startdate.blank? || bulk_upload.form.blank? unless bulk_upload.form.valid_start_date_for_form?(startdate) - errors.add(:field_8, I18n.t("validations.date.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) - errors.add(:field_9, I18n.t("validations.date.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) - errors.add(:field_10, I18n.t("validations.date.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) + errors.add(:field_8, I18n.t("#{ERROR_BASE_KEY}.startdate.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) + errors.add(:field_9, I18n.t("#{ERROR_BASE_KEY}.startdate.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) + errors.add(:field_10, I18n.t("#{ERROR_BASE_KEY}.startdate.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) end end def validate_data_types unless attribute_set["field_11"].value_before_type_cast&.match?(/^\d+\.?0*$/) - errors.add(:field_11, I18n.t("validations.invalid_number", question: "rent type.")) + errors.add(:field_11, I18n.t("#{ERROR_BASE_KEY}.invalid_number", question: "rent type.")) end end @@ -825,14 +827,14 @@ private def validate_related_location_exists if scheme && field_6.present? && location.nil? && :field_6.present? block_log_creation! - errors.add(:field_6, "Location code must relate to a location that is owned by the owning organisation or managing organisation.", category: :setup) + errors.add(:field_6, I18n.t("#{ERROR_BASE_KEY}.location.must_relate_to_org"), category: :setup) end end def validate_related_scheme_exists if field_5.present? && :field_5.present? && owning_organisation.present? && managing_organisation.present? && scheme.nil? block_log_creation! - errors.add(:field_5, "This scheme code does not belong to the owning organisation or managing organisation.", category: :setup) + errors.add(:field_5, I18n.t("#{ERROR_BASE_KEY}.scheme.must_relate_to_org"), category: :setup) end end @@ -841,7 +843,7 @@ private block_log_creation! if errors[:field_2].blank? - errors.add(:field_2, "This managing organisation does not have a relationship with the owning organisation.", category: :setup) + errors.add(:field_2, I18n.t("#{ERROR_BASE_KEY}.managing_organisation.no_relationship"), category: :setup) end end end @@ -851,7 +853,7 @@ private block_log_creation! if field_2.present? && errors[:field_2].blank? - errors.add(:field_2, "The managing organisation code is incorrect.", category: :setup) + errors.add(:field_2, I18n.t("#{ERROR_BASE_KEY}.managing_organisation.not_found"), category: :setup) end end end @@ -859,7 +861,7 @@ private def validate_managing_org_data_given if field_2.blank? block_log_creation! - errors.add(:field_2, I18n.t("validations.not_answered", question: "managing organisation."), category: :setup) + errors.add(:field_2, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "managing organisation."), category: :setup) end end @@ -868,7 +870,7 @@ private block_log_creation! if errors[:field_1].blank? - errors.add(:field_1, "The owning organisation code provided is for an organisation that does not own stock.", category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.owning_organisation.not_stock_owner"), category: :setup) end end end @@ -878,7 +880,7 @@ private block_log_creation! if field_1.present? && errors[:field_1].blank? - errors.add(:field_1, "The owning organisation code is incorrect.", category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.owning_organisation.not_found"), category: :setup) end end end @@ -886,7 +888,7 @@ private def validate_owning_org_data_given if field_1.blank? block_log_creation! - errors.add(:field_1, I18n.t("validations.not_answered", question: "owning organisation."), category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "owning organisation."), category: :setup) end end @@ -899,9 +901,9 @@ private return if errors[:field_1].present? if bulk_upload.user.support? - errors.add(:field_1, "This owning organisation is not affiliated with #{bulk_upload_organisation.name}.", category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.owning_organisation.not_permitted.support", org_name: bulk_upload_organisation.name), category: :setup) else - errors.add(:field_1, "You do not have permission to add logs for this owning organisation.", category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.owning_organisation.not_permitted.not_support"), category: :setup) end end @@ -916,12 +918,12 @@ private }.partition { |field, _| public_send(field).blank? }.map(&:to_h) blank_charge_fields.each do |field, charge| - errors.add(field, I18n.t("validations.financial.charges.missing_charges", sentence_fragment: charge)) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.charges.missing_charges", sentence_fragment: charge)) end other_charge_fields.each do |field, _charge| blank_charge_fields.each do |_blank_field, blank_charge| - errors.add(field, I18n.t("validations.financial.charges.missing_charges", sentence_fragment: blank_charge)) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.charges.missing_charges", sentence_fragment: blank_charge)) end end end @@ -936,7 +938,7 @@ private def validate_if_log_already_exists if log_already_exists? - error_message = "This is a duplicate log." + error_message = I18n.t("#{ERROR_BASE_KEY}.duplicate") errors.add(:field_1, error_message) # owning_organisation errors.add(:field_8, error_message) # startdate diff --git a/app/services/bulk_upload/processor.rb b/app/services/bulk_upload/processor.rb index 83a8d1ca0..38f67ede4 100644 --- a/app/services/bulk_upload/processor.rb +++ b/app/services/bulk_upload/processor.rb @@ -1,15 +1,24 @@ class BulkUpload::Processor + include CollectionTimeHelper attr_reader :bulk_upload - BLANK_TEMPLATE_ERRORS = [ - I18n.t("activemodel.errors.models.bulk_upload/lettings/validator.attributes.base.blank_file"), - I18n.t("activemodel.errors.models.bulk_upload/sales/validator.attributes.base.blank_file"), - ].freeze + def blank_template_errors + [ + I18n.t("validations.lettings.#{current_collection_start_year}.bulk_upload.blank_file"), + I18n.t("validations.lettings.#{previous_collection_start_year}.bulk_upload.blank_file"), + I18n.t("validations.sales.#{current_collection_start_year}.bulk_upload.blank_file"), + I18n.t("validations.sales.#{previous_collection_start_year}.bulk_upload.blank_file"), + ].freeze + end - WRONG_TEMPLATE_ERRORS = [ - *I18n.t("activemodel.errors.models.bulk_upload/lettings/validator.attributes.base", default: {}).values, - *I18n.t("activemodel.errors.models.bulk_upload/sales/validator.attributes.base", default: {}).values, - ].freeze + def wrong_template_errors + [ + *I18n.t("validations.lettings.#{current_collection_start_year}.bulk_upload.wrong_template", default: {}).values, + *I18n.t("validations.lettings.#{previous_collection_start_year}.bulk_upload.wrong_template", default: {}).values, + *I18n.t("validations.sales.#{current_collection_start_year}.bulk_upload.wrong_template", default: {}).values, + *I18n.t("validations.sales.#{previous_collection_start_year}.bulk_upload.wrong_template", default: {}).values, + ].freeze + end def initialize(bulk_upload:) @bulk_upload = bulk_upload @@ -157,9 +166,9 @@ private end def handle_invalid_validator - if BLANK_TEMPLATE_ERRORS.any? { |error| validator.errors.full_messages.include?(error) } + if blank_template_errors.any? { |error| validator.errors.full_messages.include?(error) } @bulk_upload.update!(failure_reason: "blank_template") - elsif WRONG_TEMPLATE_ERRORS.any? { |error| validator.errors.full_messages.include?(error) } + elsif wrong_template_errors.any? { |error| validator.errors.full_messages.include?(error) } @bulk_upload.update!(failure_reason: "wrong_template") end diff --git a/app/services/bulk_upload/sales/validator.rb b/app/services/bulk_upload/sales/validator.rb index a473a6461..76fb6f1ae 100644 --- a/app/services/bulk_upload/sales/validator.rb +++ b/app/services/bulk_upload/sales/validator.rb @@ -153,7 +153,7 @@ private def validate_file_not_empty if File.size(path).zero? || csv_parser.body_rows.flatten.compact.empty? - errors.add(:base, :blank_file) + errors.add(:base, I18n.t("validations.sales.#{@bulk_upload.year}.bulk_upload.blank_file")) halt_validations! end @@ -164,20 +164,20 @@ private column_count = rows.map(&:size).max - errors.add(:base, :over_max_column_count) if column_count > csv_parser.class::MAX_COLUMNS + errors.add(:base, I18n.t("validations.sales.#{@bulk_upload.year}.bulk_upload.wrong_template.over_max_column_count")) if column_count > csv_parser.class::MAX_COLUMNS end def validate_correct_template return if halt_validations? - errors.add(:base, :wrong_template) if csv_parser.wrong_template_for_year? + errors.add(:base, I18n.t("validations.sales.#{@bulk_upload.year}.bulk_upload.wrong_template.wrong_template")) if csv_parser.wrong_template_for_year? end def validate_missing_required_headers return if halt_validations? if csv_parser.missing_required_headers? - errors.add :base, I18n.t("activemodel.errors.models.bulk_upload/sales/validator.attributes.base.no_headers", guidance_link: bulk_upload_sales_log_url(id: "guidance", form: { year: bulk_upload.year }, host: ENV["APP_HOST"], anchor: "using-the-bulk-upload-template")) + errors.add :base, I18n.t("validations.sales.#{@bulk_upload.year}.bulk_upload.wrong_template.no_headers", guidance_link: bulk_upload_sales_log_url(id: "guidance", form: { year: bulk_upload.year }, host: ENV["APP_HOST"], anchor: "using-the-bulk-upload-template")) end end @@ -185,7 +185,7 @@ private return if halt_validations? unless csv_parser.correct_field_count? - errors.add(:base, :wrong_field_numbers_count) + errors.add(:base, I18n.t("validations.sales.#{@bulk_upload.year}.bulk_upload.wrong_template.wrong_field_numbers_count")) halt_validations! end end diff --git a/app/services/bulk_upload/sales/year2023/row_parser.rb b/app/services/bulk_upload/sales/year2023/row_parser.rb index d87c94dce..39fb41d6b 100644 --- a/app/services/bulk_upload/sales/year2023/row_parser.rb +++ b/app/services/bulk_upload/sales/year2023/row_parser.rb @@ -155,6 +155,8 @@ class BulkUpload::Sales::Year2023::RowParser field_135: "What are the total monthly leasehold charges for the property?", }.freeze + ERROR_BASE_KEY = "validations.sales.2023.bulk_upload".freeze + attribute :bulk_upload attribute :block_log_creation, :boolean, default: -> { false } @@ -311,32 +313,32 @@ class BulkUpload::Sales::Year2023::RowParser validates :field_3, presence: { - message: I18n.t("validations.not_answered", question: "sale completion date (day)."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "sale completion date (day)."), category: :setup, }, on: :after_log validates :field_4, presence: { - message: I18n.t("validations.not_answered", question: "sale completion date (month)."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "sale completion date (month)."), category: :setup, }, on: :after_log validates :field_5, presence: { - message: I18n.t("validations.not_answered", question: "sale completion date (year)."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "sale completion date (year)."), category: :setup, }, format: { with: /\A(\d{2}|\d{4})\z/, - message: I18n.t("validations.setup.saledate.year_not_two_or_four_digits"), + message: I18n.t("#{ERROR_BASE_KEY}.saledate.year_not_two_or_four_digits"), category: :setup, if: proc { field_5.present? }, }, on: :after_log validates :field_7, presence: { - message: I18n.t("validations.not_answered", question: "purchase made under ownership scheme."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "purchase made under ownership scheme."), category: :setup, }, on: :after_log @@ -352,7 +354,7 @@ class BulkUpload::Sales::Year2023::RowParser validates :field_8, presence: { - message: I18n.t("validations.not_answered", question: "type of shared ownership sale."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "type of shared ownership sale."), category: :setup, if: :shared_ownership?, }, @@ -369,7 +371,7 @@ class BulkUpload::Sales::Year2023::RowParser validates :field_9, presence: { - message: I18n.t("validations.not_answered", question: "type of discounted ownership sale."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "type of discounted ownership sale."), category: :setup, if: :discounted_ownership?, }, @@ -386,7 +388,7 @@ class BulkUpload::Sales::Year2023::RowParser validates :field_10, presence: { - message: I18n.t("validations.not_answered", question: "type of outright sale."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "type of outright sale."), category: :setup, if: :outright_sale?, }, @@ -394,7 +396,7 @@ class BulkUpload::Sales::Year2023::RowParser validates :field_11, presence: { - message: I18n.t("validations.not_answered", question: "type of outright sale."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "type of outright sale."), category: :setup, if: proc { field_10 == 12 }, }, @@ -411,7 +413,7 @@ class BulkUpload::Sales::Year2023::RowParser validates :field_12, presence: { - message: I18n.t("validations.not_answered", question: "company buyer."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "company buyer."), category: :setup, if: :outright_sale?, }, @@ -428,7 +430,7 @@ class BulkUpload::Sales::Year2023::RowParser validates :field_13, presence: { - message: I18n.t("validations.not_answered", question: "buyers living in property."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "buyers living in property."), category: :setup, if: :outright_sale?, }, @@ -436,7 +438,7 @@ class BulkUpload::Sales::Year2023::RowParser validates :field_14, presence: { - message: I18n.t("validations.not_answered", question: "joint purchase."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "joint purchase."), category: :setup, if: :joint_purchase_asked?, }, @@ -444,7 +446,7 @@ class BulkUpload::Sales::Year2023::RowParser validates :field_15, presence: { - message: I18n.t("validations.not_answered", question: "more than 2 joint buyers."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "more than 2 joint buyers."), category: :setup, if: :joint_purchase?, }, @@ -560,7 +562,7 @@ class BulkUpload::Sales::Year2023::RowParser def add_duplicate_found_in_spreadsheet_errors spreadsheet_duplicate_hash.each_key do |field| - errors.add(field, :spreadsheet_dupe, category: :setup) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.spreadsheet_dupe"), category: :setup) end end @@ -568,7 +570,7 @@ private def validate_data_protection_answered unless field_29 == 1 - errors.add(:field_29, I18n.t("validations.not_answered", question: "Data Protection question."), category: :setup) + errors.add(:field_29, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "Data Protection question."), category: :setup) end end @@ -600,18 +602,19 @@ private def validate_uprn_exists_if_any_key_address_fields_are_blank if field_19.blank? && (field_20.blank? || field_22.blank?) - errors.add(:field_19, I18n.t("validations.not_answered", question: "UPRN."), category: :not_answered) + # I18n.t("#{ERROR_BASE_KEY}.not_answered", question: question.error_display_label) + errors.add(:field_19, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "UPRN."), category: :not_answered) end end def validate_address_fields if field_19.blank? || log.errors.attribute_names.include?(:uprn) if field_20.blank? - errors.add(:field_20, I18n.t("validations.not_answered", question: "address line 1."), category: :not_answered) + errors.add(:field_20, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "address line 1."), category: :not_answered) end if field_22.blank? - errors.add(:field_22, I18n.t("validations.not_answered", question: "town or city."), category: :not_answered) + errors.add(:field_22, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "town or city."), category: :not_answered) end end end @@ -1162,7 +1165,7 @@ private block_log_creation! if errors[:field_1].blank? - errors.add(:field_1, "The owning organisation code is incorrect.", category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.owning_organisation.not_answered"), category: :setup) end end end @@ -1172,7 +1175,7 @@ private block_log_creation! if errors[:field_1].blank? - errors.add(:field_1, "The owning organisation code is incorrect.", category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.owning_organisation.not_found"), category: :setup) end end end @@ -1182,7 +1185,7 @@ private block_log_creation! if errors[:field_1].blank? - errors.add(:field_1, "The owning organisation code provided is for an organisation that does not own stock.", category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.owning_organisation.not_stock_owner"), category: :setup) end end end @@ -1192,7 +1195,7 @@ private block_log_creation! if errors[:field_1].blank? - errors.add(:field_1, "You do not have permission to add logs for this owning organisation.", category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.owning_organisation.not_permitted"), category: :setup) end end end @@ -1201,7 +1204,7 @@ private return if field_2.blank? unless assigned_to - errors.add(:field_2, "User with the specified email could not be found.") + errors.add(:field_2, I18n.t("#{ERROR_BASE_KEY}.assigned_to.not_found")) end end @@ -1211,7 +1214,7 @@ private return if assigned_to.organisation == owning_organisation&.absorbing_organisation || assigned_to.organisation == managing_organisation&.absorbing_organisation block_log_creation! - errors.add(:field_2, "User must be related to owning organisation or managing organisation.", category: :setup) + errors.add(:field_2, I18n.t("#{ERROR_BASE_KEY}.assigned_to.organisation_not_related"), category: :setup) end def managing_organisation @@ -1225,7 +1228,7 @@ private block_log_creation! if errors[:field_2].blank? - errors.add(:field_2, "This user belongs to an organisation that does not have a relationship with the owning organisation.", category: :setup) + errors.add(:field_2, I18n.t("#{ERROR_BASE_KEY}.assigned_to.managing_organisation_not_related"), category: :setup) end end end @@ -1246,13 +1249,13 @@ private if setup_question?(question) fields.each do |field| unless errors.any? { |e| fields.include?(e.attribute) } - errors.add(field, I18n.t("validations.not_answered", question: question.error_display_label), category: :setup) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: question.error_display_label), category: :setup) end end else fields.each do |field| unless errors.any? { |e| fields.include?(e.attribute) } - errors.add(field, I18n.t("validations.not_answered", question: question.error_display_label), category: :not_answered) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: question.error_display_label), category: :not_answered) end end end @@ -1272,15 +1275,15 @@ private if setup_question?(question) fields.each do |field| - if errors[field].none? - block_log_creation! - errors.add(field, I18n.t("validations.invalid_option", question: format_ending(QUESTIONS[field])), category: :setup) - end + next unless errors[field].none? + + block_log_creation! + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: format_ending(QUESTIONS[field])), category: :setup) end else fields.each do |field| unless errors.any? { |e| fields.include?(e.attribute) } - errors.add(field, I18n.t("validations.invalid_option", question: format_ending(QUESTIONS[field]))) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: format_ending(QUESTIONS[field]))) end end end @@ -1292,15 +1295,15 @@ private return if errors.key?(:field_3) || errors.key?(:field_4) || errors.key?(:field_5) unless bulk_upload.form.valid_start_date_for_form?(saledate) - errors.add(:field_3, I18n.t("validations.date.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) - errors.add(:field_4, I18n.t("validations.date.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) - errors.add(:field_5, I18n.t("validations.date.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) + errors.add(:field_3, I18n.t("#{ERROR_BASE_KEY}.saledate.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) + errors.add(:field_4, I18n.t("#{ERROR_BASE_KEY}.saledate.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) + errors.add(:field_5, I18n.t("#{ERROR_BASE_KEY}.saledate.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) end end def validate_if_log_already_exists if log_already_exists? - error_message = "This is a duplicate log." + error_message = I18n.t("#{ERROR_BASE_KEY}.duplicate") errors.add(:field_1, error_message) # Owning org errors.add(:field_3, error_message) # Sale completion date @@ -1335,7 +1338,7 @@ private def validate_buyer1_economic_status if field_35 == 9 - errors.add(:field_35, "Buyer 1 cannot be a child under 16.") + errors.add(:field_35, I18n.t("#{ERROR_BASE_KEY}.ecstat1.child_under_16")) end end end diff --git a/app/services/bulk_upload/sales/year2024/row_parser.rb b/app/services/bulk_upload/sales/year2024/row_parser.rb index 7b72eef5c..fdef65aec 100644 --- a/app/services/bulk_upload/sales/year2024/row_parser.rb +++ b/app/services/bulk_upload/sales/year2024/row_parser.rb @@ -151,6 +151,8 @@ class BulkUpload::Sales::Year2024::RowParser field_131: "What are the total monthly leasehold charges for the property?", }.freeze + ERROR_BASE_KEY = "validations.sales.2024.bulk_upload".freeze + attribute :bulk_upload attribute :block_log_creation, :boolean, default: -> { false } @@ -303,32 +305,32 @@ class BulkUpload::Sales::Year2024::RowParser validates :field_4, presence: { - message: I18n.t("validations.not_answered", question: "sale completion date (day)."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "sale completion date (day)."), category: :setup, }, on: :after_log validates :field_5, presence: { - message: I18n.t("validations.not_answered", question: "sale completion date (month)."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "sale completion date (month)."), category: :setup, }, on: :after_log validates :field_6, presence: { - message: I18n.t("validations.not_answered", question: "sale completion date (year)."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "sale completion date (year)."), category: :setup, }, format: { with: /\A(\d{2}|\d{4})\z/, - message: I18n.t("validations.setup.saledate.year_not_two_or_four_digits"), + message: I18n.t("#{ERROR_BASE_KEY}.saledate.year_not_two_or_four_digits"), category: :setup, if: proc { field_6.present? }, }, on: :after_log validates :field_8, presence: { - message: I18n.t("validations.not_answered", question: "purchase made under ownership scheme."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "purchase made under ownership scheme."), category: :setup, }, on: :after_log @@ -344,7 +346,7 @@ class BulkUpload::Sales::Year2024::RowParser validates :field_9, presence: { - message: I18n.t("validations.not_answered", question: "type of shared ownership sale."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "type of shared ownership sale."), category: :setup, if: :shared_ownership?, }, @@ -361,7 +363,7 @@ class BulkUpload::Sales::Year2024::RowParser validates :field_10, presence: { - message: I18n.t("validations.not_answered", question: "type of discounted ownership sale."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "type of discounted ownership sale."), category: :setup, if: :discounted_ownership?, }, @@ -369,7 +371,7 @@ class BulkUpload::Sales::Year2024::RowParser validates :field_116, numericality: { - message: I18n.t("validations.numeric.within_range", field: "Percentage discount", min: "0%", max: "70%"), + message: I18n.t("#{ERROR_BASE_KEY}.numeric.within_range", field: "Percentage discount", min: "0%", max: "70%"), greater_than_or_equal_to: 0, less_than_or_equal_to: 70, if: :discounted_ownership?, @@ -387,7 +389,7 @@ class BulkUpload::Sales::Year2024::RowParser validates :field_11, presence: { - message: I18n.t("validations.not_answered", question: "type of outright sale."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "type of outright sale."), category: :setup, if: :outright_sale?, }, @@ -395,7 +397,7 @@ class BulkUpload::Sales::Year2024::RowParser validates :field_12, presence: { - message: I18n.t("validations.not_answered", question: "type of outright sale."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "type of outright sale."), category: :setup, if: proc { field_11 == 12 }, }, @@ -412,7 +414,7 @@ class BulkUpload::Sales::Year2024::RowParser validates :field_13, presence: { - message: I18n.t("validations.not_answered", question: "company buyer."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "company buyer."), category: :setup, if: :outright_sale?, }, @@ -429,7 +431,7 @@ class BulkUpload::Sales::Year2024::RowParser validates :field_14, presence: { - message: I18n.t("validations.not_answered", question: "buyers living in property."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "buyers living in property."), category: :setup, if: :outright_sale?, }, @@ -437,7 +439,7 @@ class BulkUpload::Sales::Year2024::RowParser validates :field_15, presence: { - message: I18n.t("validations.not_answered", question: "joint purchase."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "joint purchase."), category: :setup, if: :joint_purchase_asked?, }, @@ -445,7 +447,7 @@ class BulkUpload::Sales::Year2024::RowParser validates :field_16, presence: { - message: I18n.t("validations.not_answered", question: "more than 2 joint buyers."), + message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "more than 2 joint buyers."), category: :setup, if: :joint_purchase?, }, @@ -569,7 +571,7 @@ class BulkUpload::Sales::Year2024::RowParser def add_duplicate_found_in_spreadsheet_errors spreadsheet_duplicate_hash.each_key do |field| - errors.add(field, :spreadsheet_dupe, category: :setup) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.spreadsheet_dupe"), category: :setup) end end @@ -603,14 +605,14 @@ private def validate_uprn_exists_if_any_key_address_fields_are_blank if field_22.blank? && !key_address_fields_provided? - errors.add(:field_22, I18n.t("validations.not_answered", question: "UPRN.")) + errors.add(:field_22, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "UPRN.")) end end def validate_address_option_found if log.uprn.nil? && field_22.blank? && key_address_fields_provided? %i[field_23 field_24 field_25 field_26 field_27 field_28].each do |field| - errors.add(field, I18n.t("validations.no_address_found")) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.address.not_found")) end end end @@ -622,19 +624,19 @@ private def validate_address_fields if field_22.blank? || log.errors.attribute_names.include?(:uprn) if field_23.blank? - errors.add(:field_23, I18n.t("validations.not_answered", question: "address line 1.")) + errors.add(:field_23, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "address line 1.")) end if field_25.blank? - errors.add(:field_25, I18n.t("validations.not_answered", question: "town or city.")) + errors.add(:field_25, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "town or city.")) end if field_27.blank? - errors.add(:field_27, I18n.t("validations.not_answered", question: "part 1 of postcode.")) + errors.add(:field_27, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "part 1 of postcode.")) end if field_28.blank? - errors.add(:field_28, I18n.t("validations.not_answered", question: "part 2 of postcode.")) + errors.add(:field_28, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "part 2 of postcode.")) end end end @@ -1281,7 +1283,7 @@ private block_log_creation! if errors[:field_1].blank? - errors.add(:field_1, I18n.t("validations.not_answered", question: "owning organisation."), category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "owning organisation."), category: :setup) end end end @@ -1291,7 +1293,7 @@ private block_log_creation! if field_1.present? && errors[:field_1].blank? - errors.add(:field_1, "The owning organisation code is incorrect.", category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.owning_organisation.not_found"), category: :setup) end end end @@ -1301,7 +1303,7 @@ private block_log_creation! if errors[:field_1].blank? - errors.add(:field_1, "The owning organisation code provided is for an organisation that does not own stock.", category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.owning_organisation.not_stock_owner"), category: :setup) end end end @@ -1315,9 +1317,9 @@ private return if errors[:field_1].present? if bulk_upload.user.support? - errors.add(:field_1, "This owning organisation is not affiliated with #{bulk_upload_organisation.name}.", category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.owning_organisation.not_permitted.support", name: bulk_upload_organisation.name), category: :setup) else - errors.add(:field_1, "You do not have permission to add logs for this owning organisation.", category: :setup) + errors.add(:field_1, I18n.t("#{ERROR_BASE_KEY}.owning_organisation.not_permitted.not_support"), category: :setup) end end @@ -1325,13 +1327,13 @@ private return if field_3.blank? unless assigned_to - errors.add(:field_3, "User with the specified email could not be found.") + errors.add(:field_3, I18n.t("#{ERROR_BASE_KEY}.assigned_to.not_found")) end end def validate_assigned_to_when_support if field_3.blank? && bulk_upload.user.support? - errors.add(:field_3, category: :setup, message: I18n.t("validations.not_answered", question: "what is the CORE username of the account this sales log should be assigned to?")) + errors.add(:field_3, category: :setup, message: I18n.t("#{ERROR_BASE_KEY}.not_answered", question: "what is the CORE username of the account this sales log should be assigned to?")) end end @@ -1341,7 +1343,7 @@ private return if assigned_to.organisation == owning_organisation&.absorbing_organisation || assigned_to.organisation == managing_organisation&.absorbing_organisation block_log_creation! - errors.add(:field_3, "User must be related to owning organisation or managing organisation.", category: :setup) + errors.add(:field_3, I18n.t("#{ERROR_BASE_KEY}.assigned_to.organisation_not_related"), category: :setup) end def managing_organisation @@ -1361,7 +1363,7 @@ private block_log_creation! if errors[:field_2].blank? - errors.add(:field_2, "This organisation does not have a relationship with the owning organisation.", category: :setup) + errors.add(:field_2, I18n.t("#{ERROR_BASE_KEY}.assigned_to.managing_organisation_not_related"), category: :setup) end end end @@ -1410,13 +1412,13 @@ private fields.each do |field| if errors[field].none? block_log_creation! - errors.add(field, I18n.t("validations.invalid_option", question: format_ending(QUESTIONS[field])), category: :setup) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: format_ending(QUESTIONS[field])), category: :setup) end end else fields.each do |field| unless errors.any? { |e| fields.include?(e.attribute) } - errors.add(field, I18n.t("validations.invalid_option", question: format_ending(QUESTIONS[field]))) + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.invalid_option", question: format_ending(QUESTIONS[field]))) end end end @@ -1428,15 +1430,15 @@ private return if errors.key?(:field_4) || errors.key?(:field_5) || errors.key?(:field_6) unless bulk_upload.form.valid_start_date_for_form?(saledate) - errors.add(:field_4, I18n.t("validations.date.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) - errors.add(:field_5, I18n.t("validations.date.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) - errors.add(:field_6, I18n.t("validations.date.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) + errors.add(:field_4, I18n.t("#{ERROR_BASE_KEY}.saledate.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) + errors.add(:field_5, I18n.t("#{ERROR_BASE_KEY}.saledate.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) + errors.add(:field_6, I18n.t("#{ERROR_BASE_KEY}.saledate.outside_collection_window", year_combo: bulk_upload.year_combo, start_year: bulk_upload.year, end_year: bulk_upload.end_year), category: :setup) end end def validate_if_log_already_exists if log_already_exists? - error_message = "This is a duplicate log." + error_message = I18n.t("#{ERROR_BASE_KEY}.duplicate") errors.add(:field_1, error_message) # Owning org errors.add(:field_4, error_message) # Sale completion date @@ -1472,10 +1474,10 @@ private def validate_buyer1_economic_status if field_35 == 9 if field_31.present? && field_31.to_i >= 16 - errors.add(:field_35, I18n.t("validations.sales.household.ecstat.buyer_cannot_be_over_16_and_child", buyer_index: "1")) - errors.add(:field_31, I18n.t("validations.sales.household.ecstat.buyer_cannot_be_over_16_and_child", buyer_index: "1")) + errors.add(:field_35, I18n.t("#{ERROR_BASE_KEY}.ecstat1.buyer_cannot_be_over_16_and_child")) + errors.add(:field_31, I18n.t("#{ERROR_BASE_KEY}.age1.buyer_cannot_be_over_16_and_child")) else - errors.add(:field_35, I18n.t("validations.sales.household.ecstat1.buyer_cannot_be_child")) + errors.add(:field_35, I18n.t("#{ERROR_BASE_KEY}.ecstat1.buyer_cannot_be_child")) end end end @@ -1485,23 +1487,23 @@ private if field_42 == 9 if field_38.present? && field_38.to_i >= 16 - errors.add(:field_42, I18n.t("validations.sales.household.ecstat.buyer_cannot_be_over_16_and_child", buyer_index: "2")) - errors.add(:field_38, I18n.t("validations.sales.household.ecstat.buyer_cannot_be_over_16_and_child", buyer_index: "2")) + errors.add(:field_42, I18n.t("#{ERROR_BASE_KEY}.ecstat2.buyer_cannot_be_over_16_and_child")) + errors.add(:field_38, I18n.t("#{ERROR_BASE_KEY}.age2.buyer_cannot_be_over_16_and_child")) else - errors.add(:field_42, I18n.t("validations.sales.household.ecstat2.buyer_cannot_be_child")) + errors.add(:field_42, I18n.t("#{ERROR_BASE_KEY}.ecstat2.buyer_cannot_be_child")) end end end def validate_nationality if field_34.present? && !valid_nationality_options.include?(field_34.to_s) - errors.add(:field_34, I18n.t("validations.household.nationality")) + errors.add(:field_34, I18n.t("#{ERROR_BASE_KEY}.nationality.invalid")) end end def validate_buyer_2_nationality if field_41.present? && !valid_nationality_options.include?(field_41.to_s) - errors.add(:field_41, I18n.t("validations.household.nationality")) + errors.add(:field_41, I18n.t("#{ERROR_BASE_KEY}.nationality.invalid")) end end diff --git a/app/services/exports/lettings_log_export_service.rb b/app/services/exports/lettings_log_export_service.rb index b21099a06..97f495e0c 100644 --- a/app/services/exports/lettings_log_export_service.rb +++ b/app/services/exports/lettings_log_export_service.rb @@ -146,8 +146,8 @@ module Exports field_name.starts_with?(details_known_prefix) || pattern_age.match(field_name) || !EXPORT_FIELDS.include?(field_name) || - (lettings_log.form.start_year_after_2024? && PRE_2024_EXPORT_FIELDS.include?(field_name)) || - (!lettings_log.form.start_year_after_2024? && POST_2024_EXPORT_FIELDS.include?(field_name)) + (lettings_log.form.start_year_2024_or_later? && PRE_2024_EXPORT_FIELDS.include?(field_name)) || + (!lettings_log.form.start_year_2024_or_later? && POST_2024_EXPORT_FIELDS.include?(field_name)) end def build_export_xml(lettings_logs) diff --git a/app/services/feature_toggle.rb b/app/services/feature_toggle.rb index 5312d1964..1b67b8b37 100644 --- a/app/services/feature_toggle.rb +++ b/app/services/feature_toggle.rb @@ -1,6 +1,6 @@ class FeatureToggle def self.allow_future_form_use? - false + Rails.env.development? || Rails.env.review? || Rails.env.staging? end def self.bulk_upload_duplicate_log_check_enabled? 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/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 %> - +<%= 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:

- -<% 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:

- - -

Don’t include:

- -<% 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/app/views/logs/_create_for_org_actions.html.erb b/app/views/logs/_create_for_org_actions.html.erb index 9b5935cb0..76b8f7d0d 100644 --- a/app/views/logs/_create_for_org_actions.html.erb +++ b/app/views/logs/_create_for_org_actions.html.erb @@ -1,13 +1,13 @@ -
+
<% if @organisation.data_protection_confirmed? %> <% if current_page?(controller: 'organisations', action: 'lettings_logs') %> - <%= govuk_button_to "Create a new lettings log", lettings_logs_path(lettings_log: { owning_organisation_id: @organisation.id }, method: :post), class: "govuk-!-margin-right-6" %> - <%= govuk_button_link_to "Upload lettings logs in bulk", bulk_upload_lettings_log_path(id: "start", organisation_id: @organisation.id), secondary: true, class: "govuk-!-margin-right-6" %> + <%= govuk_button_to "Create a new lettings log", lettings_logs_path(lettings_log: { owning_organisation_id: @organisation.id }, method: :post), class: "govuk-!-margin-right-3" %> + <%= govuk_button_link_to "Upload lettings logs in bulk", bulk_upload_lettings_log_path(id: "start", organisation_id: @organisation.id), secondary: true, class: "govuk-!-margin-right-3" %> <%= govuk_button_link_to "View lettings bulk uploads", bulk_uploads_lettings_logs_path(organisation_id: @organisation.id, clear_old_filters: true), secondary: true %> <% end %> <% if current_page?(controller: 'organisations', action: 'sales_logs') %> - <%= govuk_button_to "Create a new sales log", sales_logs_path(sales_log: { owning_organisation_id: @organisation.id }, method: :post), class: "govuk-!-margin-right-6" %> - <%= govuk_button_link_to "Upload sales logs in bulk", bulk_upload_sales_log_path(id: "start", organisation_id: @organisation.id), secondary: true, class: "govuk-!-margin-right-6" %> + <%= govuk_button_to "Create a new sales log", sales_logs_path(sales_log: { owning_organisation_id: @organisation.id }, method: :post), class: "govuk-!-margin-right-3" %> + <%= govuk_button_link_to "Upload sales logs in bulk", bulk_upload_sales_log_path(id: "start", organisation_id: @organisation.id), secondary: true, class: "govuk-!-margin-right-3" %> <%= govuk_button_link_to "View sales bulk uploads", bulk_uploads_sales_logs_path(organisation_id: @organisation.id, clear_old_filters: true), secondary: true %> <% end %> <% end %> 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| %>
  1. - <%= govuk_link_to scheme.service_name, scheme %> + <%= govuk_link_to scheme.service_name, scheme, target: "#" %>
  2. <% 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| %>
  1. - <%= govuk_link_to location.name, scheme_location_path(location) %> + <%= govuk_link_to location.name, scheme_location_path(location), target: "#" %>
  2. <% 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 %> diff --git a/app/views/organisations/schemes.html.erb b/app/views/organisations/schemes.html.erb index b9706d4db..a6f225bd8 100644 --- a/app/views/organisations/schemes.html.erb +++ b/app/views/organisations/schemes.html.erb @@ -22,9 +22,12 @@ <% end %>
- <% if SchemePolicy.new(current_user, nil).create? %> - <%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %> - <% end %> + <% display_actions = SchemePolicy.new(current_user, nil).create? %> +
"> + <% if display_actions %> + <%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %> + <% end %> +
<%= govuk_details( classes: "govuk-!-width-two-thirds", diff --git a/app/views/organisations/users.html.erb b/app/views/organisations/users.html.erb index f1a6336ce..109d8c24a 100644 --- a/app/views/organisations/users.html.erb +++ b/app/views/organisations/users.html.erb @@ -12,10 +12,13 @@

Users

<% end %> -<% if current_user.data_coordinator? || current_user.support? %> - <%= govuk_button_link_to "Invite user", new_user_path(organisation_id: @organisation.id), html: { method: :get } %> -<% end %>
+ <% display_actions = current_user.data_coordinator? || current_user.support? %> +
"> + <% if display_actions %> + <%= govuk_button_link_to "Invite user", new_user_path(organisation_id: @organisation.id), html: { method: :get } %> + <% end %> +
<%= render partial: "users/user_filters" %>
diff --git a/app/views/schemes/index.html.erb b/app/views/schemes/index.html.erb index edaed6212..1ca69691e 100644 --- a/app/views/schemes/index.html.erb +++ b/app/views/schemes/index.html.erb @@ -5,12 +5,13 @@ <%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Supported housing schemes", sub: nil } : { main: "Supported housing schemes", sub: current_user.organisation.name } %> -<% if SchemePolicy.new(current_user, nil).create? %> -
- <%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %> -
-<% end %>
+ <% display_actions = SchemePolicy.new(current_user, nil).create? %> +
"> + <% if display_actions %> + <%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %> + <% end %> +
<%= render partial: "schemes/scheme_filters" %>
<%= render SearchComponent.new(current_user:, search_label: "Search by postcode, scheme name, scheme code or location name", value: @searched) %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 4e5053563..47d714dbc 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -5,12 +5,13 @@ <%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Users", sub: nil } : { main: "Users", sub: current_user.organisation.name } %> -<% if current_user.data_coordinator? || current_user.support? %> -
- <%= govuk_button_link_to "Invite user", new_user_path, html: { method: :get } %> -
-<% end %>
+ <% display_actions = current_user.data_coordinator? || current_user.support? %> +
"> + <% if display_actions %> + <%= govuk_button_link_to "Invite user", new_user_path, html: { method: :get } %> + <% end %> +
<%= render partial: "users/user_filters" %>
<%= render SearchComponent.new(current_user:, search_label: "Search by name or email address", value: @searched) %> diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index 6ebc090b6..ac615b0e2 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -7411,10 +7411,10 @@ } ], "title_text": { - "translation": "soft_validations.net_income.title_text" + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.title_text" }, "informative_text": { - "translation": "soft_validations.net_income.hint_text", + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.informative_text", "arguments": [ { "key": "ecstat1", diff --git a/config/forms/2022_2023.json b/config/forms/2022_2023.json index 54cd67fd4..7d6f44b20 100644 --- a/config/forms/2022_2023.json +++ b/config/forms/2022_2023.json @@ -7870,7 +7870,7 @@ } ], "title_text": { - "translation": "soft_validations.net_income.title_text", + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.title_text", "arguments": [ { "key": "incfreq", @@ -7885,7 +7885,7 @@ ] }, "informative_text": { - "translation": "soft_validations.net_income.hint_text", + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.informative_text", "arguments": [ { "key": "net_income_higher_or_lower_text", diff --git a/config/locales/en.yml b/config/locales/en.yml index e68c230ea..03556e27d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -61,22 +61,6 @@ en: <<: *bulk_upload__row_parser__base bulk_upload/sales/year2023/row_parser: <<: *bulk_upload__row_parser__base - bulk_upload/lettings/validator: - attributes: - base: - blank_file: "Template is blank - The template must be filled in for us to create the logs and check if data is correct." - wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the correct template." - over_max_column_count: "Too many columns, please ensure you have used the correct template." - wrong_template: "Incorrect start dates, please ensure you have used the correct template." - no_headers: "Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})." - bulk_upload/sales/validator: - attributes: - base: - blank_file: "Template is blank - The template must be filled in for us to create the logs and check if data is correct." - wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the correct template." - over_max_column_count: "Too many columns, please ensure you have used the correct template." - wrong_template: "Incorrect sale dates, please ensure you have used the correct template." - no_headers: "Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})." forms/bulk_upload_lettings/year: attributes: year: @@ -90,11 +74,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: @@ -234,7 +220,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." @@ -281,37 +267,13 @@ 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." - 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}." - 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." @@ -333,44 +295,12 @@ 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." - needstype_general_needs: "This needs type is general needs, but the letting type is supported housing. Change either the needs type or the letting type." - needstype_supported_housing: "This needs type is supported housing, but the letting type is general needs. Change either the needs type or the letting type." - 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: 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}." @@ -463,13 +393,8 @@ en: child_over_19: "Answer cannot be child as you told us person %{person_num} is over 19." housingneeds_a: one_or_two_choices: "You can only select one option or ‘other disabled access needs’ plus ‘wheelchair-accessible housing’, ‘wheelchair access to essential rooms’ or ‘level access housing’." - housingneeds_type: - only_one_option_permitted: "Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected." housingneeds: invalid: "If somebody in the household has disabled access needs, they must have the access needs listed, or other access needs." - no_disabled_needs_conjunction: "No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs." - dont_know_disabled_needs_conjunction: "Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs." - no_and_dont_know_disabled_needs_conjunction: "No disabled access needs and don’t know disabled access needs cannot be selected together." prevten: non_temp_accommodation: "Answer cannot be non-temporary accommodation as this is a re-let to a tenant who occupied the same property as temporary accommodation." over_25_foster_care: "Answer cannot be a children’s home or foster care as the lead tenant is 26 or older." @@ -484,10 +409,8 @@ en: other_homeless: "Answer cannot be internal transfer as the tenant was considered homeless by their landlord." prevten_invalid: "Answer cannot be internal transfer as the household situation immediately before this letting was %{prevten}." reason_permanently_decanted: "Answer must be internal transfer as the tenant was permanently decanted from another property owned by this landlord." - nominated_by_local_ha_but_la: "The source of the referral cannot be Nominated by local housing authority as your organisation is a local authority." la_general_needs: internal_transfer: "Answer cannot be internal transfer as it’s the same landlord on the tenancy agreement and the household had either a fixed-term or lifetime local authority general needs tenancy immediately before this letting." - prp_referred_by_la: "The source of the referral cannot be referred by local authority housing department for a general needs log." homeless: assessed: internal_transfer: "Answer cannot be 'assessed as homeless' as this tenancy is an internal transfer." @@ -508,8 +431,6 @@ en: retired_female: "Answer cannot be ‘female’ as tenant is under 60 and retired." reason: not_internal_transfer: "Answer cannot be ‘permanently decanted from another property owned by this landlord’ as you told us the source of referral for this tenancy was not an internal transfer." - renewal_reason_needed: 'The reason for leaving must be "End of assured shorthold tenancy - no fault" or "End of fixed term tenancy - no fault" if the letting is a renewal.' - renewal_reason_needed_2024: 'The reason for leaving must be "End of social or private sector tenancy - no fault", "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)", "End of social or private sector tenancy - evicted due to rent arrears" or "End of social or private sector tenancy - evicted for any other reason".' other_not_settled: "Please give the reason for the tenant leaving their last settled home. This is where they were living before they became homeless, were living in temporary accommodation or sleeping rough." condition_effects: no_choices: "You cannot answer this question as you told us nobody in the household has a physical or mental health condition (or other illness) expected to last 12 months or more." @@ -518,14 +439,8 @@ en: nationality: "Select a valid nationality." tenancy: - length: - fixed_term_not_required: "You must only answer the length of the tenancy if it's fixed-term." - invalid_fixed: "Enter a tenancy length between %{min_tenancy_length} and 99 years for a tenancy of this type." - invalid_periodic: "Enter a tenancy length between %{min_tenancy_length} and 99 years (or don't specify the length) for a tenancy of this type." internal_transfer: "Answer must be secure tenancy as this tenancy is an internal transfer." cannot_be_internal_transfer: "Answer cannot be internal transfer as this is not a secure tenancy." - not_joint: "This cannot be a joint tenancy as you've told us there's only one person in the household." - joint_more_than_one_member: "There must be more than one person in the household as you've told us this is a joint tenancy." declaration: missing: @@ -549,7 +464,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." @@ -572,26 +486,6 @@ en: organisation_not_selected: "Select an organisation from the search list." soft_validations: - net_income: - title_text: "You told us that the household’s income is %{earnings} %{incfreq}." - hint_text: "This is %{net_income_higher_or_lower_text} than we would expect for the household’s working situation." - in_soft_min_range: - message: "Net income is lower than expected based on the household’s working situation. Are you sure this is correct?" - in_soft_max_range: - message: "Net income is higher than expected based on the household’s working situation. Are you sure this is correct?" - rent: - 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." - 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." @@ -599,70 +493,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." - females_not_in_soft_age_range: "You also told us that any female tenants living at the property are in the following age ranges:
  • under 16 years old
  • over 50 years old
" - major_repairs_date: - title_text: "You told us the property has been vacant for 2 years." - hint_text: "This is higher than we would expect." - void_date: - title_text: "You told us that the property has been vacant for more than 2 years." - hint_text: "This is higher than we would expect." - shared_ownership_deposit: - title_text: "You told us that the %{mortgage_deposit_and_discount_error_fields} add up to %{mortgage_deposit_and_discount_total}." - staircase_bought_seems_high: - 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." - referral: - title_text: "Are you sure?" - hint_text: "This is a general needs log, and this referral type is for supported housing." - scharge: - over_soft_max_title: "You told us the service charge is %{scharge}." - pscharge: - over_soft_max_title: "You told us the personal service charge is %{pscharge}." - supcharg: - over_soft_max_title: "You told us the support charge is %{supcharg}." - 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." - 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: - title: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant." - devise: two_factor_authentication: success: "Two-factor authentication successful." @@ -693,13 +523,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?" - offered: "How many times was the property offered between becoming vacant and this letting?" hints: location: @@ -712,16 +535,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: - 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." - offered: "Times previously offered since becoming available." warnings: organisation: 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/lettings/household_characteristics.en.yml b/config/locales/forms/2023/lettings/household_characteristics.en.yml new file mode 100644 index 000000000..1f175adbc --- /dev/null +++ b/config/locales/forms/2023/lettings/household_characteristics.en.yml @@ -0,0 +1,323 @@ +en: + forms: + 2023: + lettings: + household_characteristics: + declaration: + page_header: "Ministry of Housing, Communities and Local Government privacy notice" + check_answer_label: "Tenant has seen the privacy notice" + hint_text: "" + question_text: "Declaration" + + hhmemb: + page_header: "" + check_answer_label: "Number of household members" + hint_text: "You can provide details for a maximum of 8 people." + question_text: "How many people live in the household for this letting?" + + age1: + page_header: "" + age1_known: + check_answer_label: "" + hint_text: "The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "Do you know the lead tenant’s age?" + age1: + check_answer_label: "Lead tenant’s age" + hint_text: "" + question_text: "Age" + + sex1: + page_header: "" + check_answer_label: "Lead tenant’s gender identity" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "Which of these best describes the lead tenant’s gender identity?" + + ethnic_group: + page_header: "" + check_answer_label: "Lead tenant’s ethnic group" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "What is the lead tenant’s ethnic group?" + + ethnic: + ethnic_background_black: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "Which of the following best describes lead tenant’s Black, African, Caribbean or Black British background?" + ethnic_background_asian: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "Which of the following best describes lead tenant’s Asian or Asian British background?" + ethnic_background_arab: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "Which of the following best describes the lead tenant’s Arab background?" + ethnic_background_mixed: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "Which of the following best describes lead tenant’s Mixed or Multiple ethnic groups background?" + ethnic_background_white: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "Which of the following best describes lead tenant’s White background?" + + national: + page_header: "" + check_answer_label: "Lead tenant’s nationality" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "What is the nationality of the lead tenant?" + + ecstat1: + page_header: "" + check_answer_label: "Lead tenant’s working situation" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "Which of these best describes the lead tenant’s working situation?" + + details_known_2: + page_header: "You’ve given us the details for 1 person in the household" + check_answer_label: "Details known for person 2" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 2?" + + relat2: + page_header: "" + check_answer_label: "Person 2’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 2’s relationship to the lead tenant?" + + age2: + page_header: "" + age2_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 2’s age?" + age2: + check_answer_label: "Person 2’s age" + hint_text: "" + question_text: "Age" + + sex2: + page_header: "" + check_answer_label: "Person 2’s gender identity" + hint_text: "" + question_text: "Which of these best describes person 2’s gender identity?" + + ecstat2: + page_header: "" + check_answer_label: "Person 2’s working situation" + hint_text: "" + question_text: "Which of these best describes person 2’s working situation?" + + details_known_3: + page_header: "You’ve given us the details for 2 people in the household" + check_answer_label: "Details known for person 3" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 3?" + + relat3: + page_header: "" + check_answer_label: "Person 3’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 3’s relationship to the lead tenant?" + + age3: + page_header: "" + age3_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 3’s age?" + age3: + check_answer_label: "Person 3’s age" + hint_text: "" + question_text: "Age" + + sex3: + page_header: "" + check_answer_label: "Person 3’s gender identity" + hint_text: "" + question_text: "Which of these best describes person 3’s gender identity?" + + ecstat3: + page_header: "" + check_answer_label: "Person 3’s working situation" + hint_text: "" + question_text: "Which of these best describes person 3’s working situation?" + + details_known_4: + page_header: "You’ve given us the details for 3 people in the household" + check_answer_label: "Details known for person 4" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 4?" + + relat4: + page_header: "" + check_answer_label: "Person 4’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 4’s relationship to the lead tenant?" + + age4: + page_header: "" + age4_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 4’s age?" + age4: + check_answer_label: "Person 4’s age" + hint_text: "" + question_text: "Age" + + sex4: + page_header: "" + check_answer_label: "Person 4’s gender identity" + hint_text: "" + question_text: "Which of these best describes person 4’s gender identity?" + + ecstat4: + page_header: "" + check_answer_label: "Person 4’s working situation" + hint_text: "" + question_text: "Which of these best describes person 4’s working situation?" + + details_known_5: + page_header: "You’ve given us the details for 4 people in the household" + check_answer_label: "Details known for person 5" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 5?" + + relat5: + page_header: "" + check_answer_label: "Person 5’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 5’s relationship to the lead tenant?" + + age5: + page_header: "" + age5_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 5’s age?" + age5: + check_answer_label: "Person 5’s age" + hint_text: "" + question_text: "Age" + + sex5: + page_header: "" + check_answer_label: "Person 5’s gender identity" + hint_text: "" + question_text: "Which of these best describes person 5’s gender identity?" + + ecstat5: + page_header: "" + check_answer_label: "Person 5’s working situation" + hint_text: "" + question_text: "Which of these best describes person 5’s working situation?" + + details_known_6: + page_header: "You’ve given us the details for 5 people in the household" + check_answer_label: "Details known for person 6" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 6?" + + relat6: + page_header: "" + check_answer_label: "Person 6’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 6’s relationship to the lead tenant?" + + age6: + page_header: "" + age6_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 6’s age?" + age6: + check_answer_label: "Person 6’s age" + hint_text: "" + question_text: "Age" + + sex6: + page_header: "" + check_answer_label: "Person 6’s gender identity" + hint_text: "" + question_text: "Which of these best describes person 6’s gender identity?" + + ecstat6: + page_header: "" + check_answer_label: "Person 6’s working situation" + hint_text: "" + question_text: "Which of these best describes person 6’s working situation?" + + details_known_7: + page_header: "You’ve given us the details for 6 people in the household" + check_answer_label: "Details known for person 7" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 7?" + + relat7: + page_header: "" + check_answer_label: "Person 7’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 7’s relationship to the lead tenant?" + + age7: + page_header: "" + age7_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 7’s age?" + age7: + check_answer_label: "Person 7’s age" + hint_text: "" + question_text: "Age" + + sex7: + page_header: "" + check_answer_label: "Person 7’s gender identity" + hint_text: "" + question_text: "Which of these best describes person 7’s gender identity?" + + ecstat7: + page_header: "" + check_answer_label: "Person 7’s working situation" + hint_text: "" + question_text: "Which of these best describes person 7’s working situation?" + + details_known_8: + page_header: "You’ve given us the details for 7 people in the household" + check_answer_label: "Details known for person 8" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 8?" + + relat8: + page_header: "" + check_answer_label: "Person 8’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 8’s relationship to the lead tenant?" + + age8: + page_header: "" + age8_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 8’s age?" + age8: + check_answer_label: "Person 8’s age" + hint_text: "" + question_text: "Age" + + sex8: + page_header: "" + check_answer_label: "Person 8’s gender identity" + hint_text: "" + question_text: "Which of these best describes person 8’s gender identity?" + + ecstat8: + page_header: "" + check_answer_label: "Person 8’s working situation" + hint_text: "" + question_text: "Which of these best describes person 8’s working situation?" \ No newline at end of file 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/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/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/lettings/soft_validations.en.yml b/config/locales/forms/2023/lettings/soft_validations.en.yml new file mode 100644 index 000000000..d0354f127 --- /dev/null +++ b/config/locales/forms/2023/lettings/soft_validations.en.yml @@ -0,0 +1,132 @@ +en: + forms: + 2023: + lettings: + soft_validations: + pregnancy_value_check: + no_females_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that all the tenants living at the property are male." + females_in_soft_age_range_in_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that any female tenants living at the property are in the following age ranges:
  • under 16 years old
  • over 50 years old
" + + no_retirement_value_check: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + 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." + + retirement_value_check: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + question_text: "Are you sure this person isn’t retired?" + title_text: "You told us this person is over 66 and not retired." + informative_text: "" + + partner_under_16_value_check: + page_header: "" + check_answer_label: "Partner under 16 confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to the lead tenant." + informative_text: "Are you sure this is correct?" + + multiple_partners_value_check: + page_header: "" + check_answer_label: "Multiple partners confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant." + informative_text: "Are you sure this is correct?" + + reasonother_value_check: + page_header: "" + check_answer_label: "Reason other confirmation" + hint_text: "" + question_text: "Are you sure this doesn’t fit an existing category?" + title_text: "You told us that the tenant’s main reason for leaving their last settled home was %{reasonother}." + informative_text: "The reason you have entered looks very similar to one of the existing response categories. Please check the categories and select the appropriate one. If the existing categories are not suitable, please confirm here to move onto the next question." + + referral_value_check: + page_header: "" + check_answer_label: "Referral confirmation" + hint_text: "" + question_text: "Are you sure?" + title_text: "Are you sure?" + informative_text: "This is a general needs log, and this referral type is for supported housing." + + net_income_value_check: + page_header: "" + check_answer_label: "Net income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that the household’s income is %{earnings} %{incfreq}." + informative_text: "This is %{net_income_higher_or_lower_text} than we would expect for the household’s working situation." + + care_home_charges_value_check: + page_header: "" + check_answer_label: "Care home charges confirmation" + hint_text: "" + question_text: "Are you sure there are no care home charges?" + title_text: "Care home charges should be provided if this is a care home accommodation." + informative_text: "Are you sure there are no care home charges?" + + rent_value_check: + page_header: "" + check_answer_label: "Total rent confirmation" + 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
" + question_text: "Are you sure this is correct?" + title_text: "You told us the rent is %{brent}." + informative_text: "This is %{higher_or_lower} than we would expect." + + scharge_value_check: + page_header: "" + check_answer_label: "Service charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the service charge is %{scharge}." + informative_text: "This is higher than we would expect." + + pscharge_value_check: + page_header: "" + check_answer_label: "Personal service charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the personal service charge is %{pscharge}." + informative_text: "This is higher than we would expect." + + supcharg_value_check: + page_header: "" + check_answer_label: "Support charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the support charge is %{supcharg}." + informative_text: "This is higher than we would expect." + + void_date_value_check: + page_header: "" + check_answer_label: "Void date confirmation" + hint_text: "" + question_text: "Are you sure the property has been vacant for this long?" + title_text: "You told us that the property has been vacant for more than 2 years." + informative_text: "This is higher than we would expect." + + major_repairs_date_value_check: + page_header: "" + check_answer_label: "Major repairs date confirmation" + hint_text: "" + question_text: "Are you sure the property has been vacant for this long?" + title_text: "You told us the property has been vacant for 2 years." + informative_text: "This is higher than we would expect." diff --git a/config/locales/forms/2023/lettings/tenancy_information.en.yml b/config/locales/forms/2023/lettings/tenancy_information.en.yml new file mode 100644 index 000000000..e9331d4dc --- /dev/null +++ b/config/locales/forms/2023/lettings/tenancy_information.en.yml @@ -0,0 +1,66 @@ +en: + forms: + 2023: + lettings: + tenancy_information: + joint: + page_header: "" + check_answer_label: "Is this a joint tenancy?" + hint_text: "" + question_text: "Is this a joint tenancy?" + + startertenancy: + page_header: "" + check_answer_label: "Is this a starter or introductory tenancy?" + hint_text: "This is also known as an ‘introductory period’." + question_text: "Is this a starter tenancy?" + + tenancy: + tenancy_type: + page_header: "" + tenancy: + check_answer_label: "Type of main tenancy" + hint_text: "" + question_text: "What is the type of tenancy?" + tenancyother: + check_answer_label: "" + hint_text: "" + question_text: "Please state the tenancy type" + starter_tenancy_type: + page_header: "" + tenancy: + check_answer_label: "Type of main tenancy after the starter period has ended" + hint_text: "This is also known as an ‘introductory period’." + question_text: "What is the type of tenancy after the starter period has ended?" + tenancyother: + check_answer_label: "" + hint_text: "" + question_text: "Please state the tenancy type" + + tenancylength: + tenancy_length: + page_header: "" + check_answer_label: "Length of fixed-term tenancy" + hint_text: "Do not include the starter or introductory period." + question_text: "What is the length of the fixed-term tenancy to the nearest year?" + tenancy_length_affordable_rent: + page_header: "" + check_answer_label: "Length of fixed-term tenancy" + hint_text: "Do not include the starter or introductory period.
The minimum period is 2 years for social or affordable rent general needs logs and you do not need a log for shorter tenancies." + question_text: "What is the length of the fixed-term tenancy to the nearest year?" + tenancy_length_intermediate_rent: + page_header: "" + check_answer_label: "Length of fixed-term tenancy" + hint_text: "Do not include the starter or introductory period.
The minimum period is 1 year for intermediate rent general needs logs and you do not need a log for shorter tenancies." + question_text: "What is the length of the fixed-term tenancy to the nearest year?" + tenancy_length_periodic: + page_header: "" + check_answer_label: "Length of periodic tenancy" + hint_text: "As this is a periodic tenancy, this question is optional. If you do not have the information available click save and continue" + question_text: "What is the length of the periodic tenancy to the nearest year?" + + sheltered: + page_header: "" + check_answer_label: "Is this letting in sheltered accommodation?" + hint_text: "Sheltered housing and special retirement housing are for tenants with low-level care and support needs. This typically provides some limited support to enable independent living, such as alarm-based assistance or a scheme manager.

Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission." + question_text: "Is this letting in sheltered accommodation?" 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/2023/sales/household_situation.en.yml b/config/locales/forms/2023/sales/household_situation.en.yml new file mode 100644 index 000000000..e22777a28 --- /dev/null +++ b/config/locales/forms/2023/sales/household_situation.en.yml @@ -0,0 +1,50 @@ +en: + forms: + 2023: + sales: + household_situation: + prevten: + page_header: "" + check_answer_label: "Buyer 1’s previous tenure" + hint_text: "" + question_text: "What was buyer 1’s previous tenure?" + + last_accommodation: + page_header: "" + ppcodenk: + check_answer_label: "Buyer 1’s last settled accommodation" + hint_text: "This is also known as the household’s 'last settled home'" + question_text: "Do you know the postcode of buyer 1’s last settled accommodation?" + ppostcode_full: + check_answer_label: "Postcode of buyer 1’s last settled accommodation" + hint_text: "" + question_text: "Postcode" + + last_accommodation_la: + page_header: "" + previous_la_known: + check_answer_label: "Local authority of buyer 1’s last settled accommodation" + hint_text: "This is also known as the household’s 'last settled home'" + question_text: "Do you know the local authority of buyer 1’s last settled accommodation?" + prevloc: + check_answer_label: "Local authority of buyer 1’s last settled accommodation" + hint_text: "" + question_text: "Select a local authority" + + buyers_organisations: + page_header: "" + check_answer_label: "Organisations buyers were registered with" + hint_text: "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue." + question_text: "What organisations were the buyers registered with?" + + buy2living: + page_header: "" + check_answer_label: "Buyer 2 living at the same address" + hint_text: "" + header: "At the time of purchase, was buyer 2 living at the same address as buyer 1?" + + prevtenbuy2: + page_header: "" + check_answer_label: "Buyer 2’s previous tenure" + hint_text: "" + question_text: "What was buyer 2’s previous tenure?" 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/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 3467b9432..20f131e90 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: "" @@ -38,6 +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: "" @@ -49,12 +52,14 @@ 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?" + mortgage_value_check: page_header: "" check_answer_label: "Mortgage confirmation" @@ -62,34 +67,88 @@ 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." + 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:: + + 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." + 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: "" @@ -105,6 +164,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" @@ -112,6 +172,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" @@ -119,6 +180,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" @@ -126,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/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/lettings/household_characteristics.en.yml b/config/locales/forms/2024/lettings/household_characteristics.en.yml new file mode 100644 index 000000000..04a311f06 --- /dev/null +++ b/config/locales/forms/2024/lettings/household_characteristics.en.yml @@ -0,0 +1,322 @@ +en: + forms: + 2024: + lettings: + household_characteristics: + hhmemb: + page_header: "" + check_answer_label: "Number of household members" + hint_text: "You can provide details for a maximum of 8 people." + question_text: "How many people live in the household for this letting?" + + age1: + page_header: "" + age1_known: + check_answer_label: "" + hint_text: "The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same amount of paid work, the lead tenant is whoever is the oldest." + question_text: "Do you know the lead tenant’s age?" + age1: + check_answer_label: "Lead tenant’s age" + hint_text: "" + question_text: "Age" + + sex1: + page_header: "" + check_answer_label: "Lead tenant’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes the lead tenant’s gender identity?" + + ethnic_group: + page_header: "" + check_answer_label: "Lead tenant’s ethnic group" + hint_text: "" + question_text: "What is the lead tenant’s ethnic group?" + + ethnic: + ethnic_background_black: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes lead tenant’s Black, African, Caribbean or Black British background?" + ethnic_background_asian: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes lead tenant’s Asian or Asian British background?" + ethnic_background_arab: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes the lead tenant’s Arab background?" + ethnic_background_mixed: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes lead tenant’s Mixed or Multiple ethnic groups background?" + ethnic_background_white: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes lead tenant’s White background?" + + nationality_all: + page_header: "" + nationality_all: + check_answer_label: "Lead tenant’s nationality" + hint_text: "" + question_text: "Enter a nationality" + nationality_all_group: + check_answer_label: "Lead tenant’s nationality" + hint_text: "If the lead tenant is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the tenant should decide which country to enter." + question_text: "What is the nationality of the lead tenant?" + + ecstat1: + page_header: "" + check_answer_label: "Lead tenant’s working situation" + hint_text: "" + question_text: "Which of these best describes the lead tenant’s working situation?" + + details_known_2: + page_header: "You’ve given us the details for 1 person in the household" + check_answer_label: "Details known for person 2" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 2?" + + relat2: + page_header: "" + check_answer_label: "Person 2’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 2’s relationship to the lead tenant?" + + age2: + page_header: "" + age2_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 2’s age?" + age2: + check_answer_label: "Person 2’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex2: + page_header: "" + check_answer_label: "Person 2’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 2’s gender identity?" + + ecstat2: + page_header: "" + check_answer_label: "Person 2’s working situation" + hint_text: "" + question_text: "Which of these best describes person 2’s working situation?" + + details_known_3: + page_header: "You’ve given us the details for 2 people in the household" + check_answer_label: "Details known for person 3" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 3?" + + relat3: + page_header: "" + check_answer_label: "Person 3’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 3’s relationship to the lead tenant?" + + age3: + page_header: "" + age3_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 3’s age?" + age3: + check_answer_label: "Person 3’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex3: + page_header: "" + check_answer_label: "Person 3’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 3’s gender identity?" + + ecstat3: + page_header: "" + check_answer_label: "Person 3’s working situation" + hint_text: "" + question_text: "Which of these best describes person 3’s working situation?" + + details_known_4: + page_header: "You’ve given us the details for 3 people in the household" + check_answer_label: "Details known for person 4" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 4?" + + relat4: + page_header: "" + check_answer_label: "Person 4’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 4’s relationship to the lead tenant?" + + age4: + page_header: "" + age4_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 4’s age?" + age4: + check_answer_label: "Person 4’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex4: + page_header: "" + check_answer_label: "Person 4’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 4’s gender identity?" + + ecstat4: + page_header: "" + check_answer_label: "Person 4’s working situation" + hint_text: "" + question_text: "Which of these best describes person 4’s working situation?" + + details_known_5: + page_header: "You’ve given us the details for 4 people in the household" + check_answer_label: "Details known for person 5" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 5?" + + relat5: + page_header: "" + check_answer_label: "Person 5’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 5’s relationship to the lead tenant?" + + age5: + page_header: "" + age5_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 5’s age?" + age5: + check_answer_label: "Person 5’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex5: + page_header: "" + check_answer_label: "Person 5’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 5’s gender identity?" + + ecstat5: + page_header: "" + check_answer_label: "Person 5’s working situation" + hint_text: "" + question_text: "Which of these best describes person 5’s working situation?" + + details_known_6: + page_header: "You’ve given us the details for 5 people in the household" + check_answer_label: "Details known for person 6" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 6?" + + relat6: + page_header: "" + check_answer_label: "Person 6’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 6’s relationship to the lead tenant?" + + age6: + page_header: "" + age6_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 6’s age?" + age6: + check_answer_label: "Person 6’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex6: + page_header: "" + check_answer_label: "Person 6’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 6’s gender identity?" + + ecstat6: + page_header: "" + check_answer_label: "Person 6’s working situation" + hint_text: "" + question_text: "Which of these best describes person 6’s working situation?" + + details_known_7: + page_header: "You’ve given us the details for 6 people in the household" + check_answer_label: "Details known for person 7" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 7?" + + relat7: + page_header: "" + check_answer_label: "Person 7’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 7’s relationship to the lead tenant?" + + age7: + page_header: "" + age7_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 7’s age?" + age7: + check_answer_label: "Person 7’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex7: + page_header: "" + check_answer_label: "Person 7’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 7’s gender identity?" + + ecstat7: + page_header: "" + check_answer_label: "Person 7’s working situation" + hint_text: "" + question_text: "Which of these best describes person 7’s working situation?" + + details_known_8: + page_header: "You’ve given us the details for 7 people in the household" + check_answer_label: "Details known for person 8" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 8?" + + relat8: + page_header: "" + check_answer_label: "Person 8’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 8’s relationship to the lead tenant?" + + age8: + page_header: "" + age8_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 8’s age?" + age8: + check_answer_label: "Person 8’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex8: + page_header: "" + check_answer_label: "Person 8’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 8’s gender identity?" + + ecstat8: + page_header: "" + check_answer_label: "Person 8’s working situation" + hint_text: "" + question_text: "Which of these best describes person 8’s working situation?" \ 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/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" 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/config/locales/forms/2024/lettings/soft_validations.en.yml b/config/locales/forms/2024/lettings/soft_validations.en.yml new file mode 100644 index 000000000..ada093d39 --- /dev/null +++ b/config/locales/forms/2024/lettings/soft_validations.en.yml @@ -0,0 +1,132 @@ +en: + forms: + 2024: + lettings: + soft_validations: + pregnancy_value_check: + no_females_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that all the tenants living at the property are male." + females_in_soft_age_range_in_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that any female tenants living at the property are in the following age ranges:
  • under 16 years old
  • over 50 years old
" + + no_retirement_value_check: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + 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." + + retirement_value_check: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + question_text: "Are you sure this person isn’t retired?" + title_text: "You told us this person is over 66 and not retired." + informative_text: "Are you sure this person isn’t retired?" + + partner_under_16_value_check: + page_header: "" + check_answer_label: "Partner under 16 confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to the lead tenant." + informative_text: "Are you sure this is correct?" + + multiple_partners_value_check: + page_header: "" + check_answer_label: "Multiple partners confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant." + informative_text: "Are you sure this is correct?" + + reasonother_value_check: + page_header: "" + check_answer_label: "Reason other confirmation" + hint_text: "" + question_text: "Are you sure this doesn’t fit an existing category?" + title_text: "You told us that the tenant’s main reason for leaving their last settled home was %{reasonother}." + informative_text: "The reason you have entered looks very similar to one of the existing response categories. Please check the categories and select the appropriate one. If the existing categories are not suitable, please confirm here to move onto the next question." + + referral_value_check: + page_header: "" + check_answer_label: "Referral confirmation" + hint_text: "" + question_text: "Are you sure?" + title_text: "Are you sure?" + informative_text: "This is a general needs log, and this referral type is for supported housing." + + net_income_value_check: + page_header: "" + check_answer_label: "Net income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that the household’s income is %{earnings} %{incfreq}." + informative_text: "This is %{net_income_higher_or_lower_text} than we would expect for the household’s working situation." + + care_home_charges_value_check: + page_header: "" + check_answer_label: "Care home charges confirmation" + hint_text: "" + question_text: "Are you sure there are no care home charges?" + title_text: "Care home charges should be provided if this is a care home accommodation." + informative_text: "Are you sure there are no care home charges?" + + rent_value_check: + page_header: "" + check_answer_label: "Total rent confirmation" + 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
" + question_text: "Are you sure this is correct?" + title_text: "You told us the rent is %{brent}." + informative_text: "This is %{higher_or_lower} than we would expect." + + scharge_value_check: + page_header: "" + check_answer_label: "Service charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the service charge is %{scharge}." + informative_text: "This is higher than we would expect." + + pscharge_value_check: + page_header: "" + check_answer_label: "Personal service charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the personal service charge is %{pscharge}." + informative_text: "This is higher than we would expect." + + supcharg_value_check: + page_header: "" + check_answer_label: "Support charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the support charge is %{supcharg}." + informative_text: "This is higher than we would expect." + + void_date_value_check: + page_header: "" + check_answer_label: "Void date confirmation" + hint_text: "" + question_text: "Are you sure the property has been vacant for this long?" + title_text: "You told us that the property has been vacant for more than 2 years." + informative_text: "This is longer than we would expect." + + major_repairs_date_value_check: + page_header: "" + check_answer_label: "Major repairs date confirmation" + hint_text: "" + question_text: "Are you sure the property has been vacant for this long?" + title_text: "You told us the property has been vacant for 2 years." + informative_text: "This is longer than we would expect." diff --git a/config/locales/forms/2024/lettings/tenancy_information.en.yml b/config/locales/forms/2024/lettings/tenancy_information.en.yml new file mode 100644 index 000000000..bee380e7c --- /dev/null +++ b/config/locales/forms/2024/lettings/tenancy_information.en.yml @@ -0,0 +1,66 @@ +en: + forms: + 2024: + lettings: + tenancy_information: + joint: + page_header: "" + check_answer_label: "Is this a joint tenancy?" + hint_text: "This is where two or more people are named on the tenancy agreement" + question_text: "Is this a joint tenancy?" + + startertenancy: + page_header: "" + check_answer_label: "Is this a starter or introductory tenancy?" + hint_text: "If the tenancy has an ‘introductory period’ answer ‘yes’.

You should submit a CORE log at the beginning of the starter tenancy or introductory period, with the best information you have at the time. You do not need to submit a log when a tenant later rolls onto the main tenancy." + question_text: "Is this a starter tenancy?" + + tenancy: + tenancy_type: + page_header: "" + tenancy: + check_answer_label: "Type of main tenancy" + hint_text: "" + question_text: "What is the type of tenancy?" + tenancyother: + check_answer_label: "" + hint_text: "" + question_text: "Please state the tenancy type" + starter_tenancy_type: + page_header: "" + tenancy: + check_answer_label: "Type of main tenancy after the starter or introductory period has ended" + hint_text: "" + question_text: "What is the type of tenancy after the starter or introductory period has ended?" + tenancyother: + check_answer_label: "" + hint_text: "" + question_text: "Please state the tenancy type" + + tenancylength: + tenancy_length: + page_header: "" + check_answer_label: "Length of fixed-term tenancy" + hint_text: "Do not include the starter or introductory period." + question_text: "What is the length of the fixed-term tenancy to the nearest year?" + tenancy_length_affordable_rent: + page_header: "" + check_answer_label: "Length of fixed-term tenancy" + hint_text: "Do not include the starter or introductory period.
The minimum period is 2 years for social or affordable rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 2 years." + question_text: "What is the length of the fixed-term tenancy to the nearest year?" + tenancy_length_intermediate_rent: + page_header: "" + check_answer_label: "Length of fixed-term tenancy" + hint_text: "Do not include the starter or introductory period.
The minimum period is 1 year for intermediate rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 1 year." + question_text: "What is the length of the fixed-term tenancy to the nearest year?" + tenancy_length_periodic: + page_header: "" + check_answer_label: "Length of periodic tenancy" + hint_text: "As this is a periodic tenancy, this question is optional. If you do not have the information available click save and continue" + question_text: "What is the length of the periodic tenancy to the nearest year?" + + sheltered: + page_header: "" + check_answer_label: "Is this letting in sheltered accommodation?" + hint_text: "Sheltered housing and special retirement housing are for tenants with low-level care and support needs. This typically provides some limited support to enable independent living, such as alarm-based assistance or a scheme manager.

Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission." + question_text: "Is this letting in sheltered accommodation?" 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/config/locales/forms/2024/sales/household_situation.en.yml b/config/locales/forms/2024/sales/household_situation.en.yml new file mode 100644 index 000000000..1ab6d540e --- /dev/null +++ b/config/locales/forms/2024/sales/household_situation.en.yml @@ -0,0 +1,50 @@ +en: + forms: + 2024: + sales: + household_situation: + prevten: + page_header: "" + check_answer_label: "Buyer 1’s previous tenure" + hint_text: "" + question_text: "What was buyer 1’s previous tenure?" + + last_accommodation: + page_header: "" + ppcodenk: + check_answer_label: "Buyer 1’s last settled accommodation" + hint_text: "This is also known as the household’s 'last settled home'" + question_text: "Do you know the postcode of buyer 1’s last settled accommodation?" + ppostcode_full: + check_answer_label: "Postcode of buyer 1’s last settled accommodation" + hint_text: "" + question_text: "Postcode" + + last_accommodation_la: + page_header: "" + previous_la_known: + check_answer_label: "Local authority of buyer 1’s last settled accommodation" + hint_text: "This is also known as the household’s 'last settled home'" + question_text: "Do you know the local authority of buyer 1’s last settled accommodation?" + prevloc: + check_answer_label: "Local authority of buyer 1’s last settled accommodation" + hint_text: "" + question_text: "Select a local authority" + + buyers_organisations: + page_header: "" + check_answer_label: "Organisations buyers were registered with" + hint_text: "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue." + question_text: "What organisations were the buyers registered with?" + + buy2living: + page_header: "" + check_answer_label: "Buyer 2 living at the same address" + hint_text: "" + question_text: "At the time of purchase, was buyer 2 living at the same address as buyer 1?" + + prevtenbuy2: + page_header: "" + check_answer_label: "Buyer 2’s previous tenure" + hint_text: "" + question_text: "What was buyer 2’s previous tenure?" 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/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 39af6cb38..b9b1ad479 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,14 @@ 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?" + mortgage_value_check: page_header: "" check_answer_label: "Mortgage confirmation" @@ -62,34 +65,96 @@ 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." + 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: + + 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." + + 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?" 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: "" @@ -105,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" @@ -112,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" @@ -119,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" @@ -126,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/config/locales/forms/2025/lettings/guidance.en.yml b/config/locales/forms/2025/lettings/guidance.en.yml new file mode 100644 index 000000000..340eb11d5 --- /dev/null +++ b/config/locales/forms/2025/lettings/guidance.en.yml @@ -0,0 +1,63 @@ +en: + forms: + 2025: + 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
  • +
" diff --git a/config/locales/forms/2025/lettings/household_characteristics.en.yml b/config/locales/forms/2025/lettings/household_characteristics.en.yml new file mode 100644 index 000000000..1aef9297a --- /dev/null +++ b/config/locales/forms/2025/lettings/household_characteristics.en.yml @@ -0,0 +1,322 @@ +en: + forms: + 2025: + lettings: + household_characteristics: + hhmemb: + page_header: "" + check_answer_label: "Number of household members" + hint_text: "You can provide details for a maximum of 8 people." + question_text: "How many people live in the household for this letting?" + + age1: + page_header: "" + age1_known: + check_answer_label: "" + hint_text: "The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same amount of paid work, the lead tenant is whoever is the oldest." + question_text: "Do you know the lead tenant’s age?" + age1: + check_answer_label: "Lead tenant’s age" + hint_text: "" + question_text: "Age" + + sex1: + page_header: "" + check_answer_label: "Lead tenant’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes the lead tenant’s gender identity?" + + ethnic_group: + page_header: "" + check_answer_label: "Lead tenant’s ethnic group" + hint_text: "" + question_text: "What is the lead tenant’s ethnic group?" + + ethnic: + ethnic_background_black: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes lead tenant’s Black, African, Caribbean or Black British background?" + ethnic_background_asian: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes lead tenant’s Asian or Asian British background?" + ethnic_background_arab: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes the lead tenant’s Arab background?" + ethnic_background_mixed: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes lead tenant’s Mixed or Multiple ethnic groups background?" + ethnic_background_white: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes lead tenant’s White background?" + + nationality_all: + page_header: "" + nationality_all: + check_answer_label: "Lead tenant’s nationality" + hint_text: "" + question_text: "Enter a nationality" + nationality_all_group: + check_answer_label: "Lead tenant’s nationality" + hint_text: "If the lead tenant is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the tenant should decide which country to enter." + question_text: "What is the nationality of the lead tenant?" + + ecstat1: + page_header: "" + check_answer_label: "Lead tenant’s working situation" + hint_text: "" + question_text: "Which of these best describes the lead tenant’s working situation?" + + details_known_2: + page_header: "You’ve given us the details for 1 person in the household" + check_answer_label: "Details known for person 2" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 2?" + + relat2: + page_header: "" + check_answer_label: "Person 2’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 2’s relationship to the lead tenant?" + + age2: + page_header: "" + age2_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 2’s age?" + age2: + check_answer_label: "Person 2’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex2: + page_header: "" + check_answer_label: "Person 2’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 2’s gender identity?" + + ecstat2: + page_header: "" + check_answer_label: "Person 2’s working situation" + hint_text: "" + question_text: "Which of these best describes person 2’s working situation?" + + details_known_3: + page_header: "You’ve given us the details for 2 people in the household" + check_answer_label: "Details known for person 3" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 3?" + + relat3: + page_header: "" + check_answer_label: "Person 3’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 3’s relationship to the lead tenant?" + + age3: + page_header: "" + age3_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 3’s age?" + age3: + check_answer_label: "Person 3’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex3: + page_header: "" + check_answer_label: "Person 3’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 3’s gender identity?" + + ecstat3: + page_header: "" + check_answer_label: "Person 3’s working situation" + hint_text: "" + question_text: "Which of these best describes person 3’s working situation?" + + details_known_4: + page_header: "You’ve given us the details for 3 people in the household" + check_answer_label: "Details known for person 4" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 4?" + + relat4: + page_header: "" + check_answer_label: "Person 4’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 4’s relationship to the lead tenant?" + + age4: + page_header: "" + age4_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 4’s age?" + age4: + check_answer_label: "Person 4’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex4: + page_header: "" + check_answer_label: "Person 4’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 4’s gender identity?" + + ecstat4: + page_header: "" + check_answer_label: "Person 4’s working situation" + hint_text: "" + question_text: "Which of these best describes person 4’s working situation?" + + details_known_5: + page_header: "You’ve given us the details for 4 people in the household" + check_answer_label: "Details known for person 5" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 5?" + + relat5: + page_header: "" + check_answer_label: "Person 5’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 5’s relationship to the lead tenant?" + + age5: + page_header: "" + age5_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 5’s age?" + age5: + check_answer_label: "Person 5’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex5: + page_header: "" + check_answer_label: "Person 5’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 5’s gender identity?" + + ecstat5: + page_header: "" + check_answer_label: "Person 5’s working situation" + hint_text: "" + question_text: "Which of these best describes person 5’s working situation?" + + details_known_6: + page_header: "You’ve given us the details for 5 people in the household" + check_answer_label: "Details known for person 6" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 6?" + + relat6: + page_header: "" + check_answer_label: "Person 6’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 6’s relationship to the lead tenant?" + + age6: + page_header: "" + age6_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 6’s age?" + age6: + check_answer_label: "Person 6’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex6: + page_header: "" + check_answer_label: "Person 6’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 6’s gender identity?" + + ecstat6: + page_header: "" + check_answer_label: "Person 6’s working situation" + hint_text: "" + question_text: "Which of these best describes person 6’s working situation?" + + details_known_7: + page_header: "You’ve given us the details for 6 people in the household" + check_answer_label: "Details known for person 7" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 7?" + + relat7: + page_header: "" + check_answer_label: "Person 7’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 7’s relationship to the lead tenant?" + + age7: + page_header: "" + age7_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 7’s age?" + age7: + check_answer_label: "Person 7’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex7: + page_header: "" + check_answer_label: "Person 7’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 7’s gender identity?" + + ecstat7: + page_header: "" + check_answer_label: "Person 7’s working situation" + hint_text: "" + question_text: "Which of these best describes person 7’s working situation?" + + details_known_8: + page_header: "You’ve given us the details for 7 people in the household" + check_answer_label: "Details known for person 8" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 8?" + + relat8: + page_header: "" + check_answer_label: "Person 8’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 8’s relationship to the lead tenant?" + + age8: + page_header: "" + age8_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 8’s age?" + age8: + check_answer_label: "Person 8’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex8: + page_header: "" + check_answer_label: "Person 8’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 8’s gender identity?" + + ecstat8: + page_header: "" + check_answer_label: "Person 8’s working situation" + hint_text: "" + question_text: "Which of these best describes person 8’s working situation?" diff --git a/config/locales/forms/2025/lettings/household_needs.en.yml b/config/locales/forms/2025/lettings/household_needs.en.yml new file mode 100644 index 000000000..ba63f2031 --- /dev/null +++ b/config/locales/forms/2025/lettings/household_needs.en.yml @@ -0,0 +1,57 @@ +en: + forms: + 2025: + lettings: + household_needs: + armedforces: + page_header: "" + check_answer_label: "Household links to UK armed forces" + hint_text: "This excludes national service.

If there are several people in the household with links to the UK armed forces, you should answer for the regular. If there’s no regular, answer for the reserve. If there’s no reserve, answer for the spouse or civil partner." + question_text: "Does anybody in the household have any links to the UK armed forces?" + + leftreg: + page_header: "" + check_answer_label: "Person still serving in UK armed forces" + hint_text: "" + question_text: "Is the person still serving in the UK armed forces?" + + reservist: + page_header: "" + check_answer_label: "Person seriously injured or ill as result of serving in UK armed forces" + hint_text: "" + question_text: "Was the person seriously injured or ill as a result of serving in the UK armed forces?" + + preg_occ: + page_header: "" + check_answer_label: "Anybody in household pregnant" + hint_text: "" + question_text: "Is anybody in the household pregnant?" + + housingneeds: + page_header: "" + check_answer_label: "Anybody with disabled access needs" + hint_text: "" + question_text: "Does anybody in the household have any disabled access needs?" + + housingneeds_type: + page_header: "Disabled access needs" + housingneeds_type: + check_answer_label: "Disabled access needs" + hint_text: "" + question_text: "What type of access needs do they have?" + housingneeds_other: + check_answer_label: "Other disabled access needs" + hint_text: "" + question_text: "Do they have any other disabled access needs?" + + illness: + page_header: "" + check_answer_label: "Anybody in household with physical or mental health condition" + hint_text: "" + question_text: "Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?" + + condition_effects: + page_header: "" + check_answer_label: "How is person affected by condition or illness" + hint_text: "Select all that apply." + question_text: "How is the person affected by their condition or illness?" diff --git a/config/locales/forms/2025/lettings/household_situation.en.yml b/config/locales/forms/2025/lettings/household_situation.en.yml new file mode 100644 index 000000000..2b72c45d0 --- /dev/null +++ b/config/locales/forms/2025/lettings/household_situation.en.yml @@ -0,0 +1,120 @@ +en: + forms: + 2025: + 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?" diff --git a/config/locales/forms/2025/lettings/income_and_benefits.en.yml b/config/locales/forms/2025/lettings/income_and_benefits.en.yml new file mode 100644 index 000000000..55e193ff7 --- /dev/null +++ b/config/locales/forms/2025/lettings/income_and_benefits.en.yml @@ -0,0 +1,108 @@ +en: + forms: + 2025: + 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" diff --git a/config/locales/forms/2025/lettings/property_information.en.yml b/config/locales/forms/2025/lettings/property_information.en.yml new file mode 100644 index 000000000..bf3f3532c --- /dev/null +++ b/config/locales/forms/2025/lettings/property_information.en.yml @@ -0,0 +1,127 @@ +en: + forms: + 2025: + 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/config/locales/forms/2025/lettings/setup.en.yml b/config/locales/forms/2025/lettings/setup.en.yml new file mode 100644 index 000000000..029b5e91e --- /dev/null +++ b/config/locales/forms/2025/lettings/setup.en.yml @@ -0,0 +1,87 @@ +en: + forms: + 2025: + lettings: + setup: + owning_organisation_id: + page_header: "" + check_answer_label: "Stock owner" + hint_text: "" + question_text: "Which organisation owns this property?" + + managing_organisation_id: + page_header: "" + check_answer_label: "Managing agent" + hint_text: "" + question_text: "Which organisation manages this letting?" + + assigned_to_id: + page_header: "" + check_answer_label: "Log owner" + hint_text: "" + question_text: "Which user are you creating this log for?" + + needstype: + page_header: "" + check_answer_label: "Needs type" + hint_text: "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." + question_text: "What is the needs type?" + + scheme_id: + page_header: "Scheme" + check_answer_label: "Scheme name" + hint_text: "Enter postcode or scheme name.

A supported housing scheme provides shared or self-contained housing for a particular client group, for example younger or vulnerable people." + question_text: "What scheme is this log for?" + + location_id: + less_than_twenty: + page_header: "Location" + check_answer_label: "Location" + hint_text: "" + question_text: "Which location is this letting for?" + twenty_or_more: + page_header: "Location" + check_answer_label: "Location" + hint_text: '
This scheme has 20 or more locations.
Enter postcode or address.' + question_text: "Which location is this letting for?" + + renewal: + page_header: "" + check_answer_label: "Property renewal" + hint_text: "If the property was previously being used as temporary accommodation, then answer 'no'." + question_text: "Is this letting a renewal of social housing to the same tenant in the same property?" + + startdate: + page_header: "" + check_answer_label: "Tenancy start date" + hint_text: "" + question_text: "What is the tenancy start date?" + + rent_type: + page_header: "Rent Type" + rent_type: + check_answer_label: "Rent type" + hint_text: "" + question_text: "What is the rent type?" + irproduct_other: + check_answer_label: "Product name" + hint_text: "" + question_text: "Name of rent product" + + tenancycode: + page_header: "" + check_answer_label: "Tenant code" + hint_text: "This is how you usually refer to this tenancy on your own systems." + question_text: "What is the tenant code?" + + propcode: + page_header: "" + check_answer_label: "Property reference" + hint_text: "This is how you usually refer to this property on your own systems." + question_text: "What is the property reference?" + + declaration: + page_header: "Ministry of Housing, Communities and Local Government privacy notice" + check_answer_label: "Tenant has seen the privacy notice" + hint_text: "" + question_text: "Declaration" diff --git a/config/locales/forms/2025/lettings/soft_validations.en.yml b/config/locales/forms/2025/lettings/soft_validations.en.yml new file mode 100644 index 000000000..03a3cbb3d --- /dev/null +++ b/config/locales/forms/2025/lettings/soft_validations.en.yml @@ -0,0 +1,132 @@ +en: + forms: + 2025: + lettings: + soft_validations: + pregnancy_value_check: + no_females_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that all the tenants living at the property are male." + females_in_soft_age_range_in_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that any female tenants living at the property are in the following age ranges:
  • under 16 years old
  • over 50 years old
" + + no_retirement_value_check: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + 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." + + retirement_value_check: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + question_text: "Are you sure this person isn’t retired?" + title_text: "You told us this person is over 66 and not retired." + informative_text: "Are you sure this person isn’t retired?" + + partner_under_16_value_check: + page_header: "" + check_answer_label: "Partner under 16 confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to the lead tenant." + informative_text: "Are you sure this is correct?" + + multiple_partners_value_check: + page_header: "" + check_answer_label: "Multiple partners confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant." + informative_text: "Are you sure this is correct?" + + reasonother_value_check: + page_header: "" + check_answer_label: "Reason other confirmation" + hint_text: "" + question_text: "Are you sure this doesn’t fit an existing category?" + title_text: "You told us that the tenant’s main reason for leaving their last settled home was %{reasonother}." + informative_text: "The reason you have entered looks very similar to one of the existing response categories. Please check the categories and select the appropriate one. If the existing categories are not suitable, please confirm here to move onto the next question." + + referral_value_check: + page_header: "" + check_answer_label: "Referral confirmation" + hint_text: "" + question_text: "Are you sure?" + title_text: "Are you sure?" + informative_text: "This is a general needs log, and this referral type is for supported housing." + + net_income_value_check: + page_header: "" + check_answer_label: "Net income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that the household’s income is %{earnings} %{incfreq}." + informative_text: "This is %{net_income_higher_or_lower_text} than we would expect for the household’s working situation." + + care_home_charges_value_check: + page_header: "" + check_answer_label: "Care home charges confirmation" + hint_text: "" + question_text: "Are you sure there are no care home charges?" + title_text: "Care home charges should be provided if this is a care home accommodation." + informative_text: "Are you sure there are no care home charges?" + + rent_value_check: + page_header: "" + check_answer_label: "Total rent confirmation" + 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
" + question_text: "Are you sure this is correct?" + title_text: "You told us the rent is %{brent}." + informative_text: "This is %{higher_or_lower} than we would expect." + + scharge_value_check: + page_header: "" + check_answer_label: "Service charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the service charge is %{scharge}." + informative_text: "This is higher than we would expect." + + pscharge_value_check: + page_header: "" + check_answer_label: "Personal service charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the personal service charge is %{pscharge}." + informative_text: "This is higher than we would expect." + + supcharg_value_check: + page_header: "" + check_answer_label: "Support charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the support charge is %{supcharg}." + informative_text: "This is higher than we would expect." + + void_date_value_check: + page_header: "" + check_answer_label: "Void date confirmation" + hint_text: "" + question_text: "Are you sure the property has been vacant for this long?" + title_text: "You told us that the property has been vacant for more than 2 years." + informative_text: "This is longer than we would expect." + + major_repairs_date_value_check: + page_header: "" + check_answer_label: "Major repairs date confirmation" + hint_text: "" + question_text: "Are you sure the property has been vacant for this long?" + title_text: "You told us the property has been vacant for 2 years." + informative_text: "This is longer than we would expect." diff --git a/config/locales/forms/2025/lettings/tenancy_information.en.yml b/config/locales/forms/2025/lettings/tenancy_information.en.yml new file mode 100644 index 000000000..3276d1b3d --- /dev/null +++ b/config/locales/forms/2025/lettings/tenancy_information.en.yml @@ -0,0 +1,66 @@ +en: + forms: + 2025: + lettings: + tenancy_information: + joint: + page_header: "" + check_answer_label: "Is this a joint tenancy?" + hint_text: "This is where two or more people are named on the tenancy agreement" + question_text: "Is this a joint tenancy?" + + startertenancy: + page_header: "" + check_answer_label: "Is this a starter or introductory tenancy?" + hint_text: "If the tenancy has an ‘introductory period’ answer ‘yes’.

You should submit a CORE log at the beginning of the starter tenancy or introductory period, with the best information you have at the time. You do not need to submit a log when a tenant later rolls onto the main tenancy." + question_text: "Is this a starter tenancy?" + + tenancy: + tenancy_type: + page_header: "" + tenancy: + check_answer_label: "Type of main tenancy" + hint_text: "" + question_text: "What is the type of tenancy?" + tenancyother: + check_answer_label: "" + hint_text: "" + question_text: "Please state the tenancy type" + starter_tenancy_type: + page_header: "" + tenancy: + check_answer_label: "Type of main tenancy after the starter or introductory period has ended" + hint_text: "" + question_text: "What is the type of tenancy after the starter or introductory period has ended?" + tenancyother: + check_answer_label: "" + hint_text: "" + question_text: "Please state the tenancy type" + + tenancylength: + tenancy_length: + page_header: "" + check_answer_label: "Length of fixed-term tenancy" + hint_text: "Do not include the starter or introductory period." + question_text: "What is the length of the fixed-term tenancy to the nearest year?" + tenancy_length_affordable_rent: + page_header: "" + check_answer_label: "Length of fixed-term tenancy" + hint_text: "Do not include the starter or introductory period.
The minimum period is 2 years for social or affordable rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 2 years." + question_text: "What is the length of the fixed-term tenancy to the nearest year?" + tenancy_length_intermediate_rent: + page_header: "" + check_answer_label: "Length of fixed-term tenancy" + hint_text: "Do not include the starter or introductory period.
The minimum period is 1 year for intermediate rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 1 year." + question_text: "What is the length of the fixed-term tenancy to the nearest year?" + tenancy_length_periodic: + page_header: "" + check_answer_label: "Length of periodic tenancy" + hint_text: "As this is a periodic tenancy, this question is optional. If you do not have the information available click save and continue" + question_text: "What is the length of the periodic tenancy to the nearest year?" + + sheltered: + page_header: "" + check_answer_label: "Is this letting in sheltered accommodation?" + hint_text: "Sheltered housing and special retirement housing are for tenants with low-level care and support needs. This typically provides some limited support to enable independent living, such as alarm-based assistance or a scheme manager.

Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission." + question_text: "Is this letting in sheltered accommodation?" diff --git a/config/locales/forms/2025/sales/guidance.en.yml b/config/locales/forms/2025/sales/guidance.en.yml new file mode 100644 index 000000000..4ed6796b3 --- /dev/null +++ b/config/locales/forms/2025/sales/guidance.en.yml @@ -0,0 +1,46 @@ +en: + forms: + 2025: + 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/config/locales/forms/2025/sales/household_characteristics.en.yml b/config/locales/forms/2025/sales/household_characteristics.en.yml new file mode 100644 index 000000000..b92cba2de --- /dev/null +++ b/config/locales/forms/2025/sales/household_characteristics.en.yml @@ -0,0 +1,345 @@ +en: + forms: + 2025: + sales: + household_characteristics: + age1: + page_header: "" + age1_known: + check_answer_label: "Buyer 1’s age" + hint_text: "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." + question_text: "Do you know buyer 1’s age?" + age1: + check_answer_label: "Buyer 1’s age" + hint_text: "" + question_text: "Age" + + sex1: + page_header: "" + check_answer_label: "Buyer 1’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes buyer 1’s gender identity?" + + ethnic_group: + page_header: "" + check_answer_label: "Buyer 1’s ethnic group" + hint_text: "" + question_text: "What is buyer 1’s ethnic group?" + + ethnic: + ethnic_background_black: + page_header: "" + check_answer_label: "Buyer 1’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 1’s Black, African, Caribbean or Black British background?" + ethnic_background_asian: + page_header: "" + check_answer_label: "Buyer 1’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 1’s Asian or Asian British background?" + ethnic_background_arab: + page_header: "" + check_answer_label: "Buyer 1’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 1’s Arab background?" + ethnic_background_mixed: + page_header: "" + check_answer_label: "Buyer 1’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 1’s Mixed or Multiple ethnic groups background?" + ethnic_background_white: + page_header: "" + check_answer_label: "Buyer 1’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 1’s White background?" + + nationality_all_group: + page_header: "" + check_answer_label: "Buyer 1’s nationality" + hint_text: "If buyer 1 is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the buyer should decide which country to enter." + question_text: "What is buyer 1’s nationality?" + + nationality_all: + page_header: "" + check_answer_label: "Buyer 1’s nationality" + hint_text: "" + question_text: "Enter a nationality" + + ecstat1: + page_header: "" + check_answer_label: "Buyer 1's working situation" + hint_text: "" + question_text: "Which of these best describes buyer 1's working situation?" + + buy1livein: + page_header: "" + check_answer_label: "Will buyer 1 live in the property?" + hint_text: "" + question_text: "Will buyer 1 live in the property?" + + relat2: + buyer: + page_header: "" + check_answer_label: "Buyer 2's relationship to buyer 1" + hint_text: "" + question_text: "What is buyer 2's relationship to buyer 1?" + person: + page_header: "" + check_answer_label: "Person 2’s relationship to Buyer 1" + hint_text: "" + question_text: "What is Person 2’s relationship to Buyer 1?" + + age2: + buyer: + page_header: "" + age2_known: + check_answer_label: "Buyer 2’s age" + hint_text: "" + question_text: "Do you know buyer 2’s age?" + age2: + check_answer_label: "Buyer 2’s age" + hint_text: "" + question_text: "Age" + person: + page_header: "" + age2_known: + check_answer_label: "Person 2’s age known?" + hint_text: "" + question_text: "Do you know person 2’s age?" + age2: + check_answer_label: "Person 2’s age" + hint_text: "" + question_text: "Age" + + sex2: + buyer: + page_header: "" + check_answer_label: "Buyer 2’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes buyer 2’s gender identity?" + person: + page_header: "" + check_answer_label: "Person 2’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes Person 2’s gender identity?" + + ethnic_group2: + page_header: "" + check_answer_label: "Buyer 2’s ethnic group" + hint_text: "" + question_text: "What is buyer 2’s ethnic group?" + + ethnicbuy2: + ethnic_background_black: + page_header: "" + check_answer_label: "Buyer 2’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 2’s Black, African, Caribbean or Black British background?" + ethnic_background_asian: + page_header: "" + check_answer_label: "Buyer 2’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 2’s Asian or Asian British background?" + ethnic_background_arab: + page_header: "" + check_answer_label: "Buyer 2’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 2’s Arab background?" + ethnic_background_mixed: + page_header: "" + check_answer_label: "Buyer 2’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 2’s Mixed or Multiple ethnic groups background?" + ethnic_background_white: + page_header: "" + check_answer_label: "Buyer 2’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 2’s White background?" + + nationality_all_buyer2_group: + page_header: "" + check_answer_label: "Buyer 2’s nationality" + hint_text: "If buyer 1 is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the buyer should decide which country to enter." + question_text: "What is buyer 2’s nationality?" + + nationality_all_buyer2: + page_header: "" + check_answer_label: "Buyer 2’s nationality" + hint_text: "" + question_text: "Enter a nationality" + + ecstat2: + buyer: + page_header: "" + check_answer_label: "Buyer 2's working situation" + hint_text: "" + question_text: "Which of these best describes buyer 2's working situation?" + person: + page_header: "" + check_answer_label: "Person 2’s working situation" + hint_text: "" + question_text: "Which of these best describes Person 2’s working situation?" + + buy2livein: + page_header: "" + check_answer_label: "Will buyer 2 live in the property?" + hint_text: "" + question_text: "Will buyer 2 live in the property?" + + hholdcount: + joint_purchase: + page_header: "" + check_answer_label: "Number of other people living in the property" + hint_text: "You can provide details for a maximum of 4 other people for a joint purchase." + question_text: "Besides the buyers, how many other people live or will live in the property?" + not_joint_purchase: + page_header: "" + check_answer_label: "Number of other people living in the property" + hint_text: "You can provide details for a maximum of 5 other people if there is only one buyer." + question_text: "Besides the buyer, how many other people live or will live in the property?" + + details_known_2: + page_header: "" + check_answer_label: "Details known for person 2?" + hint_text: "" + question_text: "Do you know the details for person 2?" + + details_known_3: + page_header: "" + check_answer_label: "Details known for person 3?" + hint_text: "" + question_text: "Do you know the details for person 3?" + + relat3: + page_header: "" + check_answer_label: "Person 3’s relationship to Buyer 1" + hint_text: "" + question_text: "What is Person 3’s relationship to Buyer 1?" + + age3: + page_header: "" + age3_known: + check_answer_label: "Person 3’s age known?" + hint_text: "" + question_text: "Do you know person 3’s age?" + age3: + check_answer_label: "Person 3’s age" + hint_text: "" + question_text: "Age" + + sex3: + page_header: "" + check_answer_label: "Person 3’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes Person 3’s gender identity?" + + ecstat3: + page_header: "" + check_answer_label: "Person 3’s working situation" + hint_text: "" + question_text: "Which of these best describes Person 3’s working situation?" + + details_known_4: + page_header: "" + check_answer_label: "Details known for person 4?" + hint_text: "" + question_text: "Do you know the details for person 4?" + + relat4: + page_header: "" + check_answer_label: "Person 4’s relationship to Buyer 1" + hint_text: "" + question_text: "What is Person 4’s relationship to Buyer 1?" + + age4: + page_header: "" + age4_known: + check_answer_label: "Person 4’s age known?" + hint_text: "" + question_text: "Do you know person 4’s age?" + age4: + check_answer_label: "Person 4’s age" + hint_text: "" + question_text: "Age" + + sex4: + page_header: "" + check_answer_label: "Person 4’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes Person 4’s gender identity?" + + ecstat4: + page_header: "" + check_answer_label: "Person 4’s working situation" + hint_text: "" + question_text: "Which of these best describes Person 4’s working situation?" + + details_known_5: + page_header: "" + check_answer_label: "Details known for person 5?" + hint_text: "" + question_text: "Do you know the details for person 5?" + + relat5: + page_header: "" + check_answer_label: "Person 5’s relationship to Buyer 1" + hint_text: "" + question_text: "What is Person 5’s relationship to Buyer 1?" + + age5: + page_header: "" + age5_known: + check_answer_label: "Person 5’s age known?" + hint_text: "" + question_text: "Do you know person 5’s age?" + age5: + check_answer_label: "Person 5’s age" + hint_text: "" + question_text: "Age" + + sex5: + page_header: "" + check_answer_label: "Person 5’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes Person 5’s gender identity?" + + ecstat5: + page_header: "" + check_answer_label: "Person 5’s working situation" + hint_text: "" + question_text: "Which of these best describes Person 5’s working situation?" + + details_known_6: + page_header: "" + check_answer_label: "Details known for person 6?" + hint_text: "" + question_text: "Do you know the details for person 6?" + + relat6: + page_header: "" + check_answer_label: "Person 6’s relationship to Buyer 1" + hint_text: "" + question_text: "What is Person 6’s relationship to Buyer 1?" + + age6: + page_header: "" + age6_known: + check_answer_label: "Person 6’s age known?" + hint_text: "" + question_text: "Do you know person 6’s age?" + age6: + check_answer_label: "Person 6’s age" + hint_text: "" + question_text: "Age" + + sex6: + page_header: "" + check_answer_label: "Person 6’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes Person 6’s gender identity?" + + ecstat6: + page_header: "" + check_answer_label: "Person 6’s working situation" + hint_text: "" + question_text: "Which of these best describes Person 6’s working situation?" diff --git a/config/locales/forms/2025/sales/household_needs.en.yml b/config/locales/forms/2025/sales/household_needs.en.yml new file mode 100644 index 000000000..1908ba6ca --- /dev/null +++ b/config/locales/forms/2025/sales/household_needs.en.yml @@ -0,0 +1,34 @@ +en: + forms: + 2025: + sales: + household_needs: + hhregres: + page_header: "" + check_answer_label: "Have any of the buyers ever served as a regular in the UK armed forces?" + hint_text: "A regular is somebody who has served in the Royal Navy, the Royal Marines, the Royal Airforce or Army full time and does not include reserve forces" + question_text: "Have any of the buyers ever served as a regular in the UK armed forces?" + + hhregresstill: + page_header: "" + check_answer_label: "Are they still serving in the UK armed forces?" + hint_text: "" + question_text: "Is the buyer still serving in the UK armed forces?" + + armedforcesspouse: + page_header: "" + check_answer_label: "Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?" + hint_text: "" + question_text: "Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?" + + disabled: + page_header: "" + check_answer_label: "Does anyone in the household have a disability?" + hint_text: "This includes any long-term health condition that has an impact on the person's day-to-day life" + question_text: "Does anyone in the household consider themselves to have a disability?" + + wheel: + page_header: "" + check_answer_label: "Does anyone in the household use a wheelchair?" + hint_text: "This can be inside or outside the home" + question_text: "Does anyone in the household use a wheelchair?" diff --git a/config/locales/forms/2025/sales/household_situation.en.yml b/config/locales/forms/2025/sales/household_situation.en.yml new file mode 100644 index 000000000..3aa3545d8 --- /dev/null +++ b/config/locales/forms/2025/sales/household_situation.en.yml @@ -0,0 +1,50 @@ +en: + forms: + 2025: + sales: + household_situation: + prevten: + page_header: "" + check_answer_label: "Buyer 1’s previous tenure" + hint_text: "" + question_text: "What was buyer 1’s previous tenure?" + + last_accommodation: + page_header: "" + ppcodenk: + check_answer_label: "Buyer 1’s last settled accommodation" + hint_text: "This is also known as the household’s 'last settled home'" + question_text: "Do you know the postcode of buyer 1’s last settled accommodation?" + ppostcode_full: + check_answer_label: "Postcode of buyer 1’s last settled accommodation" + hint_text: "" + question_text: "Postcode" + + last_accommodation_la: + page_header: "" + previous_la_known: + check_answer_label: "Local authority of buyer 1’s last settled accommodation" + hint_text: "This is also known as the household’s 'last settled home'" + question_text: "Do you know the local authority of buyer 1’s last settled accommodation?" + prevloc: + check_answer_label: "Local authority of buyer 1’s last settled accommodation" + hint_text: "" + question_text: "Select a local authority" + + buyers_organisations: + page_header: "" + check_answer_label: "Organisations buyers were registered with" + hint_text: "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue." + question_text: "What organisations were the buyers registered with?" + + buy2living: + page_header: "" + check_answer_label: "Buyer 2 living at the same address" + hint_text: "" + question_text: "At the time of purchase, was buyer 2 living at the same address as buyer 1?" + + prevtenbuy2: + page_header: "" + check_answer_label: "Buyer 2’s previous tenure" + hint_text: "" + question_text: "What was buyer 2’s previous tenure?" diff --git a/config/locales/forms/2025/sales/income_benefits_and_savings.en.yml b/config/locales/forms/2025/sales/income_benefits_and_savings.en.yml new file mode 100644 index 000000000..20beb0b85 --- /dev/null +++ b/config/locales/forms/2025/sales/income_benefits_and_savings.en.yml @@ -0,0 +1,90 @@ +en: + forms: + 2025: + sales: + income_benefits_and_savings: + buyer_1_income: + page_header: "" + income1nk: + check_answer_label: "Buyer 1’s gross annual income known?" + hint_text: "" + question_text: "Do you know buyer 1’s annual income?" + income1: + check_answer_label: "Buyer 1’s gross annual income" + hint_text: "Provide the gross annual income (i.e. salary before tax) plus the annual amount of benefits, Universal Credit or pensions, and income from investments." + question_text: "Buyer 1’s gross annual income" + + inc1mort: + page_header: "" + check_answer_label: "Buyer 1’s income used for mortgage application" + hint_text: "" + question_text: "Was buyer 1’s income used for a mortgage application?" + + buyer_2_income: + page_header: "" + income2nk: + check_answer_label: "Buyer 2’s gross annual income known?" + hint_text: "" + question_text: "Do you know buyer 2’s annual income?" + income2: + check_answer_label: "Buyer 2’s gross annual income" + hint_text: "Provide the gross annual income (i.e. salary before tax) plus the annual amount of benefits, Universal Credit or pensions, and income from investments." + question_text: "Buyer 2’s gross annual income" + + inc2mort: + page_header: "" + check_answer_label: "Buyer 2’s income used for mortgage application" + hint_text: "" + question_text: "Was buyer 2’s income used for a mortgage application?" + + housing_benefits: + joint_purchase: + page_header: "" + check_answer_label: "Housing-related benefits buyers received before buying this property" + hint_text: "" + question_text: "Were the buyers receiving any of these housing-related benefits immediately before buying this property?" + not_joint_purchase: + page_header: "" + check_answer_label: "Housing-related benefits buyer received before buying this property" + hint_text: "" + question_text: "Was the buyer receiving any of these housing-related benefits immediately before buying this property?" + + savings: + joint_purchase: + page_header: "" + savingsnk: + check_answer_label: "Buyers’ total savings known?" + hint_text: "" + question_text: "Do you know how much the 'buyers' had in savings before they paid any deposit for the property?" + savings: + check_answer_label: "Buyers’ total savings before any deposit paid" + hint_text: "Include any savings, investments, ISAs, premium bonds, shares, or money held in a bank or building society account." + question_text: "Enter their total savings to the nearest £10" + not_joint_purchase: + page_header: "" + savingsnk: + check_answer_label: "Buyer’s total savings known?" + hint_text: "" + question_text: "Do you know how much the buyer had in savings before they paid any deposit for the property?" + savings: + check_answer_label: "Buyer’s total savings before any deposit paid" + hint_text: "Include any savings, investments, ISAs, premium bonds, shares, or money held in a bank or building society account." + question_text: "Enter their total savings to the nearest £10" + + prevown: + joint_purchase: + page_header: "" + check_answer_label: "Buyers previously owned a property." + hint_text: "" + question_text: "Have any of the buyers previously owned a property?" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer previously owned a property." + hint_text: "" + question_text: "Has the buyer previously owned a property?" + + prevshared: + page_header: "" + check_answer_label: "Previous property shared ownership?" + hint_text: "For any buyer" + question_text: "Was the previous property under shared ownership?" diff --git a/config/locales/forms/2025/sales/property_information.en.yml b/config/locales/forms/2025/sales/property_information.en.yml new file mode 100644 index 000000000..240c96f09 --- /dev/null +++ b/config/locales/forms/2025/sales/property_information.en.yml @@ -0,0 +1,91 @@ +en: + forms: + 2025: + 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/2025/sales/sale_information.en.yml b/config/locales/forms/2025/sales/sale_information.en.yml new file mode 100644 index 000000000..51270a92e --- /dev/null +++ b/config/locales/forms/2025/sales/sale_information.en.yml @@ -0,0 +1,206 @@ +en: + forms: + 2025: + 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?" diff --git a/config/locales/forms/2025/sales/setup.en.yml b/config/locales/forms/2025/sales/setup.en.yml new file mode 100644 index 000000000..4f00ab0c2 --- /dev/null +++ b/config/locales/forms/2025/sales/setup.en.yml @@ -0,0 +1,110 @@ +en: + forms: + 2025: + sales: + setup: + owning_organisation_id: + page_header: "" + check_answer_label: "Owning organisation" + hint_text: "" + question_text: "Which organisation owns this log?" + + managing_organisation_id: + page_header: "" + check_answer_label: "Reported by" + hint_text: "" + question_text: "Which organisation is reporting this sale?" + + assigned_to_id: + page_header: "" + check_answer_label: "Log owner" + hint_text: "" + question_text: "Which user are you creating this log for?" + + saledate: + page_header: "" + check_answer_label: "Sale completion date" + hint_text: "" + question_text: "What is the sale completion date?" + + purchid: + page_header: "" + check_answer_label: "Purchaser code" + hint_text: "This is how you usually refer to the purchaser on your own systems." + question_text: "What is the purchaser code?" + + ownershipsch: + page_header: "" + check_answer_label: "Purchase made under ownership scheme" + hint_text: "" + question_text: "Was this purchase made through an ownership scheme?" + + type: + shared_ownership: + page_header: "Type of shared ownership sale" + check_answer_label: "Type of shared ownership sale" + hint_text: "When the purchaser buys an initial share of up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion, or a subsequent staircasing transaction" + question_text: "What is the type of shared ownership sale?" + discounted_ownership: + page_header: "Type of discounted ownership sale" + check_answer_label: "Type of discounted ownership sale" + hint_text: "" + question_text: "What is the type of discounted ownership sale?" + outright_ownership: + page_header: "Type of outright sale" + type: + check_answer_label: "Type of outright sale" + hint_text: "" + question_text: "What is the type of outright sale?" + othtype: + check_answer_label: "Type of other sale" + hint_text: "" + question_text: "What type of sale is it?" + + companybuy: + page_header: "" + check_answer_label: "Company buyer" + hint_text: "" + question_text: "Is the buyer a company?" + + buylivein: + page_header: "" + check_answer_label: "Buyers living in property" + hint_text: "" + question_text: "Will any buyers live in the property?" + + jointpur: + page_header: "" + check_answer_label: "Joint purchase" + hint_text: "This is where two or more people are named as legal owners of the property after the purchase" + question_text: "Is this a joint purchase?" + + jointmore: + page_header: "" + check_answer_label: "More than 2 joint buyers" + hint_text: "" + question_text: "Are there more than 2 joint buyers of this property?" + + noint: + joint_purchase: + page_header: "" + check_answer_label: "Buyers interviewed in person?" + hint_text: "You should still try to answer all questions even if the buyers weren’t interviewed in person" + question_text: "Were the buyers interviewed for any of the answers you will provide on this log?" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer interviewed in person?" + hint_text: "You should still try to answer all questions even if the buyer wasn’t interviewed in person" + question_text: "Was the buyer interviewed for any of the answers you will provide on this log?" + + privacynotice: + joint_purchase: + page_header: "Ministry of Housing, Communities and Local Government privacy notice" + check_answer_label: "Buyers have seen the privacy notice?" + hint_text: "" + question_text: "Declaration" + not_joint_purchase: + page_header: "Ministry of Housing, Communities and Local Government privacy notice" + check_answer_label: "Buyer has seen the privacy notice?" + hint_text: "" + question_text: "Declaration" diff --git a/config/locales/forms/2025/sales/soft_validations.en.yml b/config/locales/forms/2025/sales/soft_validations.en.yml new file mode 100644 index 000000000..c8f0990ba --- /dev/null +++ b/config/locales/forms/2025/sales/soft_validations.en.yml @@ -0,0 +1,244 @@ +en: + forms: + 2025: + sales: + soft_validations: + retirement_value_check: + max: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + question_text: "Are you sure this person isn't retired?" + title_text: "You told us this person is over 66 and not retired." + informative_text: "The minimum expected retirement age in England is 66." + min: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + 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" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: + 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: "" + question_text: "Are you sure this is correct?" + min: + page_header: "" + title_text: "You told us income was %{income}." + informative_text: "This is less than we would expect for someone in this working situation." + 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: "" + question_text: "Are you sure this is correct?" + min: + page_header: "" + title_text: "You told us income was %{income}." + informative_text: "This is less than we would expect for someone in this working situation." + 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?" + + mortgage_value_check: + page_header: "" + check_answer_label: "Mortgage confirmation" + hint_text: "" + 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." + + 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}." + 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." + + staircase_bought_value_check: + page_header: "" + check_answer_label: "Percentage bought confirmation" + hint_text: "" + 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." + + 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?" + 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: "" + check_answer_label: "Buyer live in confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that buyer 1 will not live in the property." + informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property." + buyer2: + page_header: "" + check_answer_label: "Buyer live in confirmation" + hint_text: "" + 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" + hint_text: "" + 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" + hint_text: "" + 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" + hint_text: "" + 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/validations/lettings/2023/bulk_upload.en.yml b/config/locales/validations/lettings/2023/bulk_upload.en.yml new file mode 100644 index 000000000..e61dbe4a1 --- /dev/null +++ b/config/locales/validations/lettings/2023/bulk_upload.en.yml @@ -0,0 +1,56 @@ +en: + validations: + lettings: + 2023: + bulk_upload: + not_answered: "You must answer %{question}" + invalid_option: "Enter a valid value for %{question}" + invalid_number: "Enter a number for %{question}" + spreadsheet_dupe: "This is a duplicate of a log in your file." + duplicate: "This is a duplicate log." + blank_file: "Template is blank - The template must be filled in for us to create the logs and check if data is correct." + wrong_template: + wrong_template: "Incorrect start dates, please ensure you have used the correct template." + no_headers: "Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})." + wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the correct template." + over_max_column_count: "Too many columns, please ensure you have used the correct template." + owning_organisation: + not_found: "The owning organisation code is incorrect." + not_stock_owner: "The owning organisation code provided is for an organisation that does not own stock." + not_permitted: "You do not have permission to add logs for this owning organisation." + managing_organisation: + no_relationship: "This managing organisation does not have a relationship with the owning organisation." + not_found: "The managing organisation code is incorrect." + not_answered: "The managing organisation code is incorrect." + assigned_to: + not_found: "User with the specified email could not be found." + organisation_not_related: "User must be related to owning organisation or managing organisation." + startdate: + outside_collection_window: "Enter a date within the %{year_combo} collection year, which is between 1st April %{start_year} and 31st March %{end_year}." + year_not_two_or_four_digits: "Tenancy start year must be 2 or 4 digits." + housingneeds: + no_and_dont_know_disabled_needs_conjunction: "No disabled access needs and don’t know disabled access needs cannot be selected together." + dont_know_disabled_needs_conjunction: "Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs." + no_disabled_needs_conjunction: "No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs." + housingneeds_type: + only_one_option_permitted: "Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected." + condition_effects: + no_choices: "You cannot answer this question as you told us nobody in the household has a physical or mental health condition (or other illness) expected to last 12 months or more." + lettype: + needstype_general_needs: "This needs type is general needs, but the letting type is supported housing. Change either the needs type or the letting type." + needstype_supported_housing: "This needs type is supported housing, but the letting type is general needs. Change either the needs type or the letting type." + 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." + reason: + renewal_reason_needed: "The reason for leaving must be \"End of assured shorthold tenancy - no fault\" or \"End of fixed term tenancy - no fault\" if the letting is a renewal." + referral: + general_needs_prp_referred_by_la: "The source of the referral cannot be referred by local authority housing department for a general needs log." + nominated_by_local_ha_but_la: "The source of the referral cannot be Nominated by local housing authority as your organisation is a local authority." + scheme: + must_relate_to_org: "%{capitalised_location_or_scheme} code must relate to a %{location_or_scheme} that is owned by the owning organisation or managing organisation." + does_not_belong_to_org: "This %{scheme_or_management_group} code does not belong to the owning organisation or managing organisation." + declaration: + missing: "You must show the MHCLG privacy notice to the tenant before you can submit this log." + age: + invalid: "Age of person %{person_num} must be a number or the letter R" \ No newline at end of file diff --git a/config/locales/validations/lettings/2024/bulk_upload.en.yml b/config/locales/validations/lettings/2024/bulk_upload.en.yml new file mode 100644 index 000000000..76985ee32 --- /dev/null +++ b/config/locales/validations/lettings/2024/bulk_upload.en.yml @@ -0,0 +1,56 @@ +en: + validations: + lettings: + 2024: + bulk_upload: + not_answered: "You must answer %{question}" + invalid_option: "Enter a valid value for %{question}" + invalid_number: "Enter a number for %{question}" + spreadsheet_dupe: "This is a duplicate of a log in your file." + duplicate: "This is a duplicate log." + blank_file: "Template is blank - The template must be filled in for us to create the logs and check if data is correct." + wrong_template: + wrong_template: "Incorrect start dates, please ensure you have used the correct template." + no_headers: "Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})." + wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the correct template." + over_max_column_count: "Too many columns, please ensure you have used the correct template." + owning_organisation: + not_found: "The owning organisation code is incorrect." + not_stock_owner: "The owning organisation code provided is for an organisation that does not own stock." + not_permitted: + not_support: "You do not have permission to add logs for this owning organisation." + support: "This owning organisation is not affiliated with %{org_name}." + managing_organisation: + no_relationship: "This managing organisation does not have a relationship with the owning organisation." + not_found: "The managing organisation code is incorrect." + assigned_to: + not_found: "User with the specified email could not be found." + organisation_not_related: "User must be related to owning organisation or managing organisation." + startdate: + outside_collection_window: "Enter a date within the %{year_combo} collection year, which is between 1st April %{start_year} and 31st March %{end_year}." + year_not_two_or_four_digits: "Tenancy start year must be 2 or 4 digits." + housingneeds: + no_and_dont_know_disabled_needs_conjunction: "No disabled access needs and don’t know disabled access needs cannot be selected together." + dont_know_disabled_needs_conjunction: "Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs." + no_disabled_needs_conjunction: "No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs." + housingneeds_type: + only_one_option_permitted: "Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected." + condition_effects: + no_choices: "You cannot answer this question as you told us nobody in the household has a physical or mental health condition (or other illness) expected to last 12 months or more." + reason: + renewal_reason_needed: "The reason for leaving must be \"End of social or private sector tenancy - no fault\", \"End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)\", \"End of social or private sector tenancy - evicted due to rent arrears\" or \"End of social or private sector tenancy - evicted for any other reason\"." + referral: + general_needs_prp_referred_by_la: "The source of the referral cannot be referred by local authority housing department for a general needs log." + nominated_by_local_ha_but_la: "The source of the referral cannot be Nominated by local housing authority as your organisation is a local authority." + scheme: + must_relate_to_org: "This scheme code does not belong to the owning organisation or managing organisation." + location: + must_relate_to_org: "Location code must relate to a location that is owned by the owning organisation or managing organisation." + age: + invalid: "Age of person %{person_num} must be a number or the letter R" + address: + not_found: "We could not find this address. Check the address data in your CSV file is correct and complete, or select the correct address using the CORE site." + nationality: + invalid: "Select a valid nationality." + charges: + missing_charges: "Please enter the %{sentence_fragment}. If there is no %{sentence_fragment}, please enter '0'." \ No newline at end of file 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/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/config/locales/validations/lettings/tenancy.en.yml b/config/locales/validations/lettings/tenancy.en.yml new file mode 100644 index 000000000..4c053e9ae --- /dev/null +++ b/config/locales/validations/lettings/tenancy.en.yml @@ -0,0 +1,25 @@ +en: + validations: + lettings: + tenancy: + needstype: + invalid_fixed_tenancylength: "Enter a tenancy length between %{min_tenancy_length} and 99 years for a tenancy of this type." + invalid_periodic_tenancylength: "Enter a tenancy length between %{min_tenancy_length} and 99 years (or don't specify the length) for a tenancy of this type." + + tenancylength: + invalid_fixed_tenancylength: "Enter a tenancy length between %{min_tenancy_length} and 99 years for a tenancy of this type." + invalid_periodic_tenancylength: "Enter a tenancy length between %{min_tenancy_length} and 99 years (or don't specify the length) for a tenancy of this type." + fixed_term_not_required: "You must only answer the length of the tenancy if it's fixed-term." + + tenancy: + invalid_fixed_tenancylength: "Enter a tenancy length between %{min_tenancy_length} and 99 years for a tenancy of this type." + invalid_periodic_tenancylength: "Enter a tenancy length between %{min_tenancy_length} and 99 years (or don't specify the length) for a tenancy of this type." + fixed_term_not_required: "You must only answer the length of the tenancy if it's fixed-term." + + rent_type: + invalid_fixed_tenancylength: "Enter a tenancy length between %{min_tenancy_length} and 99 years for a tenancy of this type." + invalid_periodic_tenancylength: "Enter a tenancy length between %{min_tenancy_length} and 99 years (or don't specify the length) for a tenancy of this type." + + joint: + sole_tenancy: "This cannot be a joint tenancy as you've told us there's only one person in the household." + multiple_members_required: "There must be more than one person in the household as you've told us this is a joint tenancy." diff --git a/config/locales/validations/sales/2023/bulk_upload.en.yml b/config/locales/validations/sales/2023/bulk_upload.en.yml new file mode 100644 index 000000000..517f56858 --- /dev/null +++ b/config/locales/validations/sales/2023/bulk_upload.en.yml @@ -0,0 +1,29 @@ +en: + validations: + sales: + 2023: + bulk_upload: + not_answered: "You must answer %{question}" + invalid_option: "Enter a valid value for %{question}" + spreadsheet_dupe: "This is a duplicate of a log in your file." + duplicate: "This is a duplicate log." + blank_file: "Template is blank - The template must be filled in for us to create the logs and check if data is correct." + wrong_template: + wrong_template: "Incorrect sale dates, please ensure you have used the correct template." + no_headers: "Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})." + wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the correct template." + over_max_column_count: "Too many columns, please ensure you have used the correct template." + owning_organisation: + not_answered: "The owning organisation code is incorrect." + not_found: "The owning organisation code is incorrect." + not_stock_owner: "The owning organisation code provided is for an organisation that does not own stock." + not_permitted: "You do not have permission to add logs for this owning organisation." + assigned_to: + not_found: "User with the specified email could not be found." + organisation_not_related: "User must be related to owning organisation or managing organisation." + managing_organisation_not_related: "This user belongs to an organisation that does not have a relationship with the owning organisation." + saledate: + outside_collection_window: "Enter a date within the %{year_combo} collection year, which is between 1st April %{start_year} and 31st March %{end_year}." + year_not_two_or_four_digits: "Sale completion year must be 2 or 4 digits." + ecstat1: + child_under_16: "Buyer 1 cannot be a child under 16." diff --git a/config/locales/validations/sales/2024/bulk_upload.en.yml b/config/locales/validations/sales/2024/bulk_upload.en.yml new file mode 100644 index 000000000..fc68662d1 --- /dev/null +++ b/config/locales/validations/sales/2024/bulk_upload.en.yml @@ -0,0 +1,44 @@ +en: + validations: + sales: + 2024: + bulk_upload: + not_answered: "You must answer %{question}" + invalid_option: "Enter a valid value for %{question}" + spreadsheet_dupe: "This is a duplicate of a log in your file." + duplicate: "This is a duplicate log." + blank_file: "Template is blank - The template must be filled in for us to create the logs and check if data is correct." + wrong_template: + over_max_column_count: "Too many columns, please ensure you have used the correct template." + no_headers: "Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})." + wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the correct template." + wrong_template: "Incorrect sale dates, please ensure you have used the correct template." + numeric: + within_range: "%{field} must be between %{min} and %{max}." + owning_organisation: + not_found: "The owning organisation code is incorrect." + not_stock_owner: "The owning organisation code provided is for an organisation that does not own stock." + not_permitted: + support: "This owning organisation is not affiliated with %(name)." + not_support: "You do not have permission to add logs for this owning organisation." + assigned_to: + not_found: "User with the specified email could not be found." + organisation_not_related: "User must be related to owning organisation or managing organisation." + managing_organisation_not_related: "This organisation does not have a relationship with the owning organisation." + saledate: + outside_collection_window: "Enter a date within the %{year_combo} collection year, which is between 1st April %{start_year} and 31st March %{end_year}." + year_not_two_or_four_digits: "Sale completion year must be 2 or 4 digits." + ecstat1: + buyer_cannot_be_over_16_and_child: "Buyer 1's age cannot be 16 or over if their working situation is child under 16." + buyer_cannot_be_child: "Buyer 1 cannot have a working situation of child under 16." + age1: + buyer_cannot_be_over_16_and_child: "Buyer 1's age cannot be 16 or over if their working situation is child under 16." + ecstat2: + buyer_cannot_be_over_16_and_child: "Buyer 2's age cannot be 16 or over if their working situation is child under 16." + buyer_cannot_be_child: "Buyer 2 cannot have a working situation of child under 16." + age2: + buyer_cannot_be_over_16_and_child: "Buyer 2's age cannot be 16 or over if their working situation is child under 16." + address: + not_found: "We could not find this address. Check the address data in your CSV file is correct and complete, or select the correct address using the CORE site." + nationality: + invalid: "Select a valid nationality." 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/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 diff --git a/spec/fixtures/forms/2021_2022.json b/spec/fixtures/forms/2021_2022.json index 3159459ad..cb0aaf06e 100644 --- a/spec/fixtures/forms/2021_2022.json +++ b/spec/fixtures/forms/2021_2022.json @@ -740,7 +740,7 @@ } ], "title_text": { - "translation": "soft_validations.net_income.title_text", + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.title_text", "arguments": [ { "key": "incfreq", @@ -755,7 +755,7 @@ ] }, "informative_text": { - "translation": "soft_validations.net_income.hint_text", + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.informative_text", "arguments": [ { "key": "net_income_higher_or_lower_text", diff --git a/spec/helpers/filters_helper_spec.rb b/spec/helpers/filters_helper_spec.rb index b709a16ac..ce60d07f7 100644 --- a/spec/helpers/filters_helper_spec.rb +++ b/spec/helpers/filters_helper_spec.rb @@ -517,12 +517,46 @@ RSpec.describe FiltersHelper do allow(Time).to receive(:now).and_return(Time.zone.local(2024, 5, 1)) end - it "has the correct options" do - expect(collection_year_options).to eq( - { - "2024" => "2024 to 2025", "2023" => "2023 to 2024", "2022" => "2022 to 2023" - }, - ) + context "and in crossover period" do + before do + allow(FormHandler.instance).to receive(:in_crossover_period?).and_return(true) + end + + it "has the correct options" do + expect(collection_year_options).to eq( + { + "2024" => "2024 to 2025", "2023" => "2023 to 2024", "2022" => "2022 to 2023" + }, + ) + end + end + + context "and not in crossover period" do + before do + allow(FormHandler.instance).to receive(:in_crossover_period?).and_return(false) + end + + it "has the correct options" do + expect(collection_year_options).to eq( + { + "2024" => "2024 to 2025", "2023" => "2023 to 2024" + }, + ) + end + + context "with future form use turned on" do + before do + allow(FeatureToggle).to receive(:allow_future_form_use?).and_return(true) + end + + it "includes next year in the options" do + expect(collection_year_options).to eq( + { + "2025" => "2025 to 2026", "2024" => "2024 to 2025", "2023" => "2023 to 2024" + }, + ) + end + end end end end diff --git a/spec/helpers/interruption_screen_helper_spec.rb b/spec/helpers/interruption_screen_helper_spec.rb index 60cd71131..0d4456f2a 100644 --- a/spec/helpers/interruption_screen_helper_spec.rb +++ b/spec/helpers/interruption_screen_helper_spec.rb @@ -93,7 +93,7 @@ RSpec.describe InterruptionScreenHelper do context "when 1 out of 2 arguments are given" do it "returns an empty string" do informative_text = { - "translation" => "soft_validations.net_income.hint_text", + "translation" => "forms.2024.lettings.soft_validations.net_income_value_check.informative_text", "arguments" => [ { "key" => "ecstat1", 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/models/form/lettings/pages/care_home_charges_value_check_spec.rb b/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb index 0530cf445..e9c1d5879 100644 --- a/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb +++ b/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb @@ -30,12 +30,12 @@ RSpec.describe Form::Lettings::Pages::CareHomeChargesValueCheck, type: :model do it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.care_home_charges.title_text", + "translation" => "forms.2024.lettings.soft_validations.care_home_charges_value_check.title_text", }) end it "has the correct informative_text" do - expect(page.informative_text).to eq("") + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.care_home_charges_value_check.informative_text" }) end it "has the correct interruption_screen_question_ids" do diff --git a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb index 0b3d770b3..865fc6fd2 100644 --- a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb +++ b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb @@ -37,27 +37,15 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end @@ -82,27 +70,15 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end diff --git a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb index f380a5cb9..8ce2e5451 100644 --- a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb +++ b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb @@ -37,27 +37,15 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end @@ -82,27 +70,15 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end diff --git a/spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb b/spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb index b095af406..43dc70378 100644 --- a/spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb +++ b/spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Pages::FirstTimePropertyLetAsSocialHousing, type: let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb b/spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb index 1f2986064..b75e57674 100644 --- a/spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb +++ b/spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Pages::LeadTenantEthnicBackgroundWhite, type: :mo let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/pages/max_rent_value_check_spec.rb b/spec/models/form/lettings/pages/max_rent_value_check_spec.rb deleted file mode 100644 index 273272d8b..000000000 --- a/spec/models/form/lettings/pages/max_rent_value_check_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -require "rails_helper" - -RSpec.describe Form::Lettings::Pages::MaxRentValueCheck, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } - - let(:page_id) { "max_rent_value_check" } - let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1))) } - - 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[rent_value_check]) - end - - it "has the correct id" do - expect(page.id).to eq("max_rent_value_check") - end - - it "has correct depends_on" do - expect(page.depends_on).to eq([{ "rent_in_soft_max_range?" => true }]) - end - - it "has the correct title_text" do - expect(page.title_text).to eq({ "arguments" => [{ "i18n_template" => "brent", "key" => "brent", "label" => true }], "translation" => "soft_validations.rent.outside_range_title" }) - end - - it "has the correct interruption_screen_question_ids" do - expect(page.interruption_screen_question_ids).to eq(%w[brent period startdate uprn postcode_full la beds rent_type needstype]) - end -end diff --git a/spec/models/form/lettings/pages/min_rent_value_check_spec.rb b/spec/models/form/lettings/pages/min_rent_value_check_spec.rb deleted file mode 100644 index 950f2f43f..000000000 --- a/spec/models/form/lettings/pages/min_rent_value_check_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -require "rails_helper" - -RSpec.describe Form::Lettings::Pages::MinRentValueCheck, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } - - let(:page_id) { "min_rent_value_check" } - let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1))) } - - it "has correct subsection" do - expect(page.subsection).to eq(subsection) - end - - it "has the correct description" do - expect(page.description).to be nil - end - - it "has correct questions" do - expect(page.questions.map(&:id)).to eq(%w[rent_value_check]) - end - - it "has the correct id" do - expect(page.id).to eq("min_rent_value_check") - end - - it "has correct depends_on" do - expect(page.depends_on).to eq( - [{ "rent_in_soft_min_range?" => true }], - ) - end - - it "has the correct title_text" do - expect(page.title_text).to eq({ - "translation" => "soft_validations.rent.outside_range_title", - "arguments" => [{ "i18n_template" => "brent", "key" => "brent", "label" => true }], - }) - end - - it "has the correct interruption_screen_question_ids" do - expect(page.interruption_screen_question_ids).to eq(%w[brent period startdate uprn postcode_full la beds rent_type needstype]) - end -end diff --git a/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb b/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb index 551a3b070..f116cb601 100644 --- a/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb +++ b/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb @@ -4,7 +4,8 @@ RSpec.describe Form::Lettings::Pages::MultiplePartnersValueCheck, type: :model d subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } 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(:person_index) { 1 } let(:page_id) { "multiple_partners_value_check" } @@ -39,13 +40,13 @@ RSpec.describe Form::Lettings::Pages::MultiplePartnersValueCheck, type: :model d it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.multiple_partners_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.multiple_partners_value_check.title_text", "arguments" => [], }) end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.multiple_partners_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -71,13 +72,13 @@ RSpec.describe Form::Lettings::Pages::MultiplePartnersValueCheck, type: :model d it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.multiple_partners_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.multiple_partners_value_check.title_text", "arguments" => [], }) end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.multiple_partners_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do diff --git a/spec/models/form/lettings/pages/net_income_value_check_spec.rb b/spec/models/form/lettings/pages/net_income_value_check_spec.rb index 523e02c8b..fe98919ae 100644 --- a/spec/models/form/lettings/pages/net_income_value_check_spec.rb +++ b/spec/models/form/lettings/pages/net_income_value_check_spec.rb @@ -24,13 +24,13 @@ RSpec.describe Form::Lettings::Pages::NetIncomeValueCheck, type: :model do end it "has the correct title_text" do - expect(page.title_text).to eq({ "translation" => "soft_validations.net_income.title_text", "arguments" => [{ "i18n_template" => "incfreq", "key" => "incfreq", "label" => true }, { "arguments_for_key" => "earnings", "i18n_template" => "earnings", "key" => "field_formatted_as_currency" }] }) + expect(page.title_text).to eq({ "translation" => "forms.2024.lettings.soft_validations.net_income_value_check.title_text", "arguments" => [{ "i18n_template" => "incfreq", "key" => "incfreq", "label" => true }, { "arguments_for_key" => "earnings", "i18n_template" => "earnings", "key" => "field_formatted_as_currency" }] }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ "arguments" => [{ "i18n_template" => "net_income_higher_or_lower_text", "key" => "net_income_higher_or_lower_text", "label" => false }], - "translation" => "soft_validations.net_income.hint_text", + "translation" => "forms.2024.lettings.soft_validations.net_income_value_check.informative_text", }) end end diff --git a/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb b/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb index 286ac6183..6cf6302f8 100644 --- a/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb +++ b/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb @@ -37,27 +37,15 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCh it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end @@ -82,27 +70,15 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCh it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end diff --git a/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb b/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb index 205f19ae1..f986f17d2 100644 --- a/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb +++ b/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb @@ -37,27 +37,15 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end @@ -82,27 +70,15 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end diff --git a/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb b/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb index a769f95cc..168f4ca91 100644 --- a/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb +++ b/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb @@ -4,7 +4,8 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } 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(:person_index) { 1 } let(:page_id) { "partner_under_16_value_check" } @@ -39,7 +40,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age1", @@ -51,7 +52,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -77,7 +78,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age2", @@ -89,7 +90,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -115,7 +116,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age3", @@ -127,7 +128,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -153,7 +154,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age4", @@ -165,7 +166,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -191,7 +192,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age5", @@ -203,7 +204,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -229,7 +230,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age6", @@ -241,7 +242,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do diff --git a/spec/models/form/lettings/pages/person_age_spec.rb b/spec/models/form/lettings/pages/person_age_spec.rb index c9a57c138..2043052fd 100644 --- a/spec/models/form/lettings/pages/person_age_spec.rb +++ b/spec/models/form/lettings/pages/person_age_spec.rb @@ -1,12 +1,11 @@ require "rails_helper" RSpec.describe Form::Lettings::Pages::PersonAge, type: :model do - subject(:page) { described_class.new(nil, page_definition, subsection, person_index:, person_type:) } + subject(:page) { described_class.new(nil, page_definition, subsection, person_index:) } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: false)) } let(:person_index) { 2 } - let(:person_type) { "non_child" } it "has correct subsection" do expect(page.subsection).to eq(subsection) @@ -21,30 +20,14 @@ RSpec.describe Form::Lettings::Pages::PersonAge, type: :model do expect(page.questions.map(&:id)).to eq(%w[age2_known age2]) end - context "when child" do - let(:person_type) { "child" } - - it "has the correct id" do - expect(page.id).to eq("person_2_age_child") - end - - it "has correct depends_on" do - expect(page.depends_on).to eq( - [{ "details_known_2" => 0, "person_2_child_relation?" => true }], - ) - end + it "has the correct id" do + expect(page.id).to eq("person_2_age") end - context "when not child" do - it "has the correct id" do - expect(page.id).to eq("person_2_age_non_child") - end - - it "has correct depends_on" do - expect(page.depends_on).to eq( - [{ "details_known_2" => 0, "person_2_child_relation?" => false }], - ) - end + it "has correct depends_on" do + expect(page.depends_on).to eq( + [{ "details_known_2" => 0 }], + ) end end @@ -56,12 +39,12 @@ RSpec.describe Form::Lettings::Pages::PersonAge, type: :model do end it "has the correct id" do - expect(page.id).to eq("person_3_age_non_child") + expect(page.id).to eq("person_3_age") end it "has correct depends_on" do expect(page.depends_on).to eq( - [{ "details_known_3" => 0, "person_3_child_relation?" => false }], + [{ "details_known_3" => 0 }], ) end end diff --git a/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb b/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb index ec00f0d75..c8a482ee4 100644 --- a/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb +++ b/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb @@ -28,13 +28,14 @@ RSpec.describe Form::Lettings::Pages::PersonOverRetirementValueCheck, type: :mod it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.max.title", + "translation" => "forms.2024.lettings.soft_validations.retirement_value_check.title_text", }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.retirement.max.hint_text", + "translation" => "forms.2024.lettings.soft_validations.retirement_value_check.informative_text", + "arguments" => [], }) end end @@ -50,13 +51,14 @@ RSpec.describe Form::Lettings::Pages::PersonOverRetirementValueCheck, type: :mod it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.max.title", + "translation" => "forms.2024.lettings.soft_validations.retirement_value_check.title_text", }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.retirement.max.hint_text", + "translation" => "forms.2024.lettings.soft_validations.retirement_value_check.informative_text", + "arguments" => [], }) end end diff --git a/spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb b/spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb index a0ebb9cbc..829d55ad0 100644 --- a/spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb +++ b/spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Form::Lettings::Pages::PersonRelationshipToLead, type: :model do subject(:page) { described_class.new(nil, page_definition, subsection, person_index:) } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: false)) } let(:person_index) { 2 } it "has correct subsection" do diff --git a/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb b/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb index 37ca94f9e..6226e0309 100644 --- a/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb +++ b/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb @@ -28,7 +28,7 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.lettings.soft_validations.no_retirement_value_check.title_text", "arguments" => [ { "key" => "age2", @@ -40,7 +40,7 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo end it "has the correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.no_retirement_value_check.informative_text" }) end end @@ -55,7 +55,7 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.lettings.soft_validations.no_retirement_value_check.title_text", "arguments" => [ { "key" => "age3", @@ -67,7 +67,7 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo end it "has the correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.no_retirement_value_check.informative_text" }) end end end diff --git a/spec/models/form/lettings/pages/previous_local_authority_spec.rb b/spec/models/form/lettings/pages/previous_local_authority_spec.rb index 9e6d91be3..37ae11133 100644 --- a/spec/models/form/lettings/pages/previous_local_authority_spec.rb +++ b/spec/models/form/lettings/pages/previous_local_authority_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Pages::PreviousLocalAuthority, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/lettings/pages/previous_postcode_spec.rb b/spec/models/form/lettings/pages/previous_postcode_spec.rb index eba9af065..354f78a98 100644 --- a/spec/models/form/lettings/pages/previous_postcode_spec.rb +++ b/spec/models/form/lettings/pages/previous_postcode_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Pages::PreviousPostcode, type: :model do let(:page_id) { "previous_postcode" } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/lettings/pages/property_local_authority_spec.rb b/spec/models/form/lettings/pages/property_local_authority_spec.rb index fe5363d97..75d680ddd 100644 --- a/spec/models/form/lettings/pages/property_local_authority_spec.rb +++ b/spec/models/form/lettings/pages/property_local_authority_spec.rb @@ -37,7 +37,7 @@ RSpec.describe Form::Lettings::Pages::PropertyLocalAuthority, type: :model do context "with form before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "is routed to when la is not inferred and it is general needs log" do @@ -61,7 +61,7 @@ RSpec.describe Form::Lettings::Pages::PropertyLocalAuthority, type: :model do context "with form after 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "is routed to when la is not inferred, it is general needs log and address search has been given" do diff --git a/spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb b/spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb index 90da08fb6..8090c6ed4 100644 --- a/spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb +++ b/spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Lettings::Pages::PropertyWheelchairAccessible, type: :model let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1))) } before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct subsection" do diff --git a/spec/models/form/lettings/pages/renewal_spec.rb b/spec/models/form/lettings/pages/renewal_spec.rb index edeeaff1b..77ba3aec8 100644 --- a/spec/models/form/lettings/pages/renewal_spec.rb +++ b/spec/models/form/lettings/pages/renewal_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Pages::Renewal, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/pages/rent_type_spec.rb b/spec/models/form/lettings/pages/rent_type_spec.rb index 41dc0a1a9..3cec8e01e 100644 --- a/spec/models/form/lettings/pages/rent_type_spec.rb +++ b/spec/models/form/lettings/pages/rent_type_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Pages::RentType, type: :model do before do allow(subsection).to receive(:form).and_return(form) - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct subsection" do diff --git a/spec/models/form/lettings/pages/starter_tenancy_type_spec.rb b/spec/models/form/lettings/pages/starter_tenancy_type_spec.rb index 6842f7d3e..005b546a8 100644 --- a/spec/models/form/lettings/pages/starter_tenancy_type_spec.rb +++ b/spec/models/form/lettings/pages/starter_tenancy_type_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Form::Lettings::Pages::StarterTenancyType, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/pages/uprn_spec.rb b/spec/models/form/lettings/pages/uprn_spec.rb index 2ab83c76a..81f1aec40 100644 --- a/spec/models/form/lettings/pages/uprn_spec.rb +++ b/spec/models/form/lettings/pages/uprn_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Pages::Uprn, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(subsection).to receive(:form).and_return(form) end @@ -57,7 +57,7 @@ RSpec.describe Form::Lettings::Pages::Uprn, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "points to address search page" do diff --git a/spec/models/form/lettings/questions/age1_known_spec.rb b/spec/models/form/lettings/questions/age1_known_spec.rb index 6ec594359..94c36d3d5 100644 --- a/spec/models/form/lettings/questions/age1_known_spec.rb +++ b/spec/models/form/lettings/questions/age1_known_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Questions::Age1Known, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/age_spec.rb b/spec/models/form/lettings/questions/age_spec.rb index 4ec1ee985..639f695fd 100644 --- a/spec/models/form/lettings/questions/age_spec.rb +++ b/spec/models/form/lettings/questions/age_spec.rb @@ -1,12 +1,11 @@ require "rails_helper" RSpec.describe Form::Lettings::Questions::Age, type: :model do - subject(:question) { described_class.new(nil, question_definition, page, person_index:, person_type:) } + subject(:question) { described_class.new(nil, question_definition, page, person_index:) } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), start_year_2024_or_later?: false))) } let(:person_index) { 2 } - let(:person_type) { "non_child" } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/lettings/questions/declaration_spec.rb b/spec/models/form/lettings/questions/declaration_spec.rb index bf8743520..25705414c 100644 --- a/spec/models/form/lettings/questions/declaration_spec.rb +++ b/spec/models/form/lettings/questions/declaration_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Declaration, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?) + allow(form).to receive(:start_year_2024_or_later?) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -33,7 +33,7 @@ RSpec.describe Form::Lettings::Questions::Declaration, type: :model do context "when the form year is before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has the correct answer_options" do @@ -57,7 +57,7 @@ RSpec.describe Form::Lettings::Questions::Declaration, type: :model do context "when the form year is >= 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do @@ -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/ethnic_white_spec.rb b/spec/models/form/lettings/questions/ethnic_white_spec.rb index 7857893a1..ab20dd8ca 100644 --- a/spec/models/form/lettings/questions/ethnic_white_spec.rb +++ b/spec/models/form/lettings/questions/ethnic_white_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::EthnicWhite, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -44,7 +44,7 @@ RSpec.describe Form::Lettings::Questions::EthnicWhite, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb b/spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb index 7f38f0108..756f5e84e 100644 --- a/spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb +++ b/spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing, t let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -34,7 +34,7 @@ RSpec.describe Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing, t context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/gender_identity1_spec.rb b/spec/models/form/lettings/questions/gender_identity1_spec.rb index 2a943cbe0..19503ea33 100644 --- a/spec/models/form/lettings/questions/gender_identity1_spec.rb +++ b/spec/models/form/lettings/questions/gender_identity1_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Lettings::Questions::GenderIdentity1, type: :model do let(:question_definition) { nil } let(:page) { instance_double(Form::Page) } let(:subsection) { instance_double(Form::Subsection) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false) } before do allow(page).to receive(:subsection).and_return(subsection) diff --git a/spec/models/form/lettings/questions/hb_spec.rb b/spec/models/form/lettings/questions/hb_spec.rb index ed8f19cd5..9a1477954 100644 --- a/spec/models/form/lettings/questions/hb_spec.rb +++ b/spec/models/form/lettings/questions/hb_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Hb, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end 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/housingneeds_other_spec.rb b/spec/models/form/lettings/questions/housingneeds_other_spec.rb index f7be373e1..ead58bb35 100644 --- a/spec/models/form/lettings/questions/housingneeds_other_spec.rb +++ b/spec/models/form/lettings/questions/housingneeds_other_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::HousingneedsOther, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -42,7 +42,7 @@ RSpec.describe Form::Lettings::Questions::HousingneedsOther, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/is_carehome_spec.rb b/spec/models/form/lettings/questions/is_carehome_spec.rb index 958873599..b82ddeaeb 100644 --- a/spec/models/form/lettings/questions/is_carehome_spec.rb +++ b/spec/models/form/lettings/questions/is_carehome_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::IsCarehome, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -42,7 +42,7 @@ RSpec.describe Form::Lettings::Questions::IsCarehome, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options in the correct order" do diff --git a/spec/models/form/lettings/questions/joint_spec.rb b/spec/models/form/lettings/questions/joint_spec.rb index 1207d97d4..d856e9c18 100644 --- a/spec/models/form/lettings/questions/joint_spec.rb +++ b/spec/models/form/lettings/questions/joint_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Joint, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/layear_spec.rb b/spec/models/form/lettings/questions/layear_spec.rb index 04296beae..5ea537514 100644 --- a/spec/models/form/lettings/questions/layear_spec.rb +++ b/spec/models/form/lettings/questions/layear_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Layear, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -49,7 +49,7 @@ RSpec.describe Form::Lettings::Questions::Layear, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/letting_allocation_spec.rb b/spec/models/form/lettings/questions/letting_allocation_spec.rb index 63c750e5d..980c8fea5 100644 --- a/spec/models/form/lettings/questions/letting_allocation_spec.rb +++ b/spec/models/form/lettings/questions/letting_allocation_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::LettingAllocation, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -45,7 +45,7 @@ RSpec.describe Form::Lettings::Questions::LettingAllocation, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/max_rent_value_check_spec.rb b/spec/models/form/lettings/questions/max_rent_value_check_spec.rb deleted file mode 100644 index 6fa0784e4..000000000 --- a/spec/models/form/lettings/questions/max_rent_value_check_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -require "rails_helper" - -RSpec.describe Form::Lettings::Questions::MaxRentValueCheck, type: :model do - subject(:question) { described_class.new(nil, question_definition, page, check_answers_card_number:) } - - let(:question_definition) { nil } - let(:check_answers_card_number) { 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("rent_value_check") - end - - it "has the correct type" do - expect(question.type).to eq("interruption_screen") - end - - it "has the correct answer_options" do - expect(question.answer_options).to eq({ - "0" => { "value" => "Yes" }, - "1" => { "value" => "No" }, - }) - end - - it "has the correct hidden_in_check_answers" do - expect(question.hidden_in_check_answers).to eq({ "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] }) - end -end diff --git a/spec/models/form/lettings/questions/min_rent_value_check_spec.rb b/spec/models/form/lettings/questions/min_rent_value_check_spec.rb deleted file mode 100644 index c3d8a16bc..000000000 --- a/spec/models/form/lettings/questions/min_rent_value_check_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -require "rails_helper" - -RSpec.describe Form::Lettings::Questions::MinRentValueCheck, type: :model do - subject(:question) { described_class.new(nil, question_definition, page, check_answers_card_number:) } - - let(:question_definition) { nil } - let(:check_answers_card_number) { 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("rent_value_check") - end - - it "has the correct type" do - expect(question.type).to eq("interruption_screen") - end - - it "has the correct answer_options" do - expect(question.answer_options).to eq({ - "0" => { "value" => "Yes" }, - "1" => { "value" => "No" }, - }) - end - - it "has the correct hidden_in_check_answers" do - expect(question.hidden_in_check_answers).to eq({ "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] }) - end -end diff --git a/spec/models/form/lettings/questions/person_relationship_spec.rb b/spec/models/form/lettings/questions/person_relationship_spec.rb index 20d05e316..0023c60ef 100644 --- a/spec/models/form/lettings/questions/person_relationship_spec.rb +++ b/spec/models/form/lettings/questions/person_relationship_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Form::Lettings::Questions::PersonRelationship, type: :model do subject(:question) { described_class.new(nil, question_definition, page, person_index:) } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), start_year_2024_or_later?: false))) } let(:person_index) { 2 } it "has correct page" do diff --git a/spec/models/form/lettings/questions/ppcodenk_spec.rb b/spec/models/form/lettings/questions/ppcodenk_spec.rb index 8a29b032d..7186875d3 100644 --- a/spec/models/form/lettings/questions/ppcodenk_spec.rb +++ b/spec/models/form/lettings/questions/ppcodenk_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Questions::Ppcodenk, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/previous_la_known_spec.rb b/spec/models/form/lettings/questions/previous_la_known_spec.rb index defb56bdf..f05d376ab 100644 --- a/spec/models/form/lettings/questions/previous_la_known_spec.rb +++ b/spec/models/form/lettings/questions/previous_la_known_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Questions::PreviousLaKnown, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/previous_let_type_spec.rb b/spec/models/form/lettings/questions/previous_let_type_spec.rb index 0739fe386..95c1451cd 100644 --- a/spec/models/form/lettings/questions/previous_let_type_spec.rb +++ b/spec/models/form/lettings/questions/previous_let_type_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -44,7 +44,7 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do context "with collection year on or after 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer options" do diff --git a/spec/models/form/lettings/questions/reason_renewal_spec.rb b/spec/models/form/lettings/questions/reason_renewal_spec.rb index 02abe1527..e58a33a21 100644 --- a/spec/models/form/lettings/questions/reason_renewal_spec.rb +++ b/spec/models/form/lettings/questions/reason_renewal_spec.rb @@ -5,12 +5,12 @@ 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)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -54,7 +54,7 @@ RSpec.describe Form::Lettings::Questions::ReasonRenewal, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/reason_spec.rb b/spec/models/form/lettings/questions/reason_spec.rb index 81fd7a5c1..4b71ee176 100644 --- a/spec/models/form/lettings/questions/reason_spec.rb +++ b/spec/models/form/lettings/questions/reason_spec.rb @@ -5,12 +5,12 @@ 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)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -84,7 +84,7 @@ RSpec.describe Form::Lettings::Questions::Reason, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/reasonpref_spec.rb b/spec/models/form/lettings/questions/reasonpref_spec.rb index 5957d4979..43326b7c0 100644 --- a/spec/models/form/lettings/questions/reasonpref_spec.rb +++ b/spec/models/form/lettings/questions/reasonpref_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Questions::Reasonpref, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/referral_prp_spec.rb b/spec/models/form/lettings/questions/referral_prp_spec.rb index e11bf250c..a10b6d383 100644 --- a/spec/models/form/lettings/questions/referral_prp_spec.rb +++ b/spec/models/form/lettings/questions/referral_prp_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::ReferralPrp, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -64,7 +64,7 @@ RSpec.describe Form::Lettings::Questions::ReferralPrp, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/referral_spec.rb b/spec/models/form/lettings/questions/referral_spec.rb index b3f526697..75e6c2f42 100644 --- a/spec/models/form/lettings/questions/referral_spec.rb +++ b/spec/models/form/lettings/questions/referral_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Referral, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -62,7 +62,7 @@ RSpec.describe Form::Lettings::Questions::Referral, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/referral_supported_housing_prp_spec.rb b/spec/models/form/lettings/questions/referral_supported_housing_prp_spec.rb index ab13acd26..3059c122d 100644 --- a/spec/models/form/lettings/questions/referral_supported_housing_prp_spec.rb +++ b/spec/models/form/lettings/questions/referral_supported_housing_prp_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::ReferralSupportedHousingPrp, type: :mo let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -64,7 +64,7 @@ RSpec.describe Form::Lettings::Questions::ReferralSupportedHousingPrp, type: :mo let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/referral_supported_housing_spec.rb b/spec/models/form/lettings/questions/referral_supported_housing_spec.rb index 5e05bf65b..5a4af55e5 100644 --- a/spec/models/form/lettings/questions/referral_supported_housing_spec.rb +++ b/spec/models/form/lettings/questions/referral_supported_housing_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::ReferralSupportedHousing, type: :model let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -62,7 +62,7 @@ RSpec.describe Form::Lettings::Questions::ReferralSupportedHousing, type: :model let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/renewal_spec.rb b/spec/models/form/lettings/questions/renewal_spec.rb index 27fe1bf86..af2c22c15 100644 --- a/spec/models/form/lettings/questions/renewal_spec.rb +++ b/spec/models/form/lettings/questions/renewal_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Renewal, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/rent_type_spec.rb b/spec/models/form/lettings/questions/rent_type_spec.rb index 15183ce6b..7d45320ad 100644 --- a/spec/models/form/lettings/questions/rent_type_spec.rb +++ b/spec/models/form/lettings/questions/rent_type_spec.rb @@ -12,7 +12,7 @@ RSpec.describe Form::Lettings::Questions::RentType, type: :model do before do allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct page" do @@ -37,7 +37,7 @@ RSpec.describe Form::Lettings::Questions::RentType, type: :model do context "when 2023" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has the correct answer_options" do @@ -58,7 +58,7 @@ RSpec.describe Form::Lettings::Questions::RentType, type: :model do context "when 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do @@ -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/lettings/questions/rsnvac_spec.rb b/spec/models/form/lettings/questions/rsnvac_spec.rb index 45469cebb..5eb37ddb5 100644 --- a/spec/models/form/lettings/questions/rsnvac_spec.rb +++ b/spec/models/form/lettings/questions/rsnvac_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Rsnvac, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -78,7 +78,7 @@ RSpec.describe Form::Lettings::Questions::Rsnvac, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/scheme_id_spec.rb b/spec/models/form/lettings/questions/scheme_id_spec.rb index c490cded4..ba5734b3b 100644 --- a/spec/models/form/lettings/questions/scheme_id_spec.rb +++ b/spec/models/form/lettings/questions/scheme_id_spec.rb @@ -12,7 +12,7 @@ RSpec.describe Form::Lettings::Questions::SchemeId, type: :model do before do allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct page" do diff --git a/spec/models/form/lettings/questions/sheltered_spec.rb b/spec/models/form/lettings/questions/sheltered_spec.rb index 33b1007d2..1f21a92eb 100644 --- a/spec/models/form/lettings/questions/sheltered_spec.rb +++ b/spec/models/form/lettings/questions/sheltered_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Lettings::Questions::Sheltered, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -40,7 +40,7 @@ RSpec.describe Form::Lettings::Questions::Sheltered, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb b/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb index 66ea2b355..1100796c8 100644 --- a/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb +++ b/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Questions::StarterTenancyType, type: :model do let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page) } + let(:page) { instance_double(Form::Page, id: "starter_tenancy_type") } let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } @@ -16,7 +16,7 @@ RSpec.describe Form::Lettings::Questions::StarterTenancyType, type: :model do context "with 2023/24 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has the correct answer options" do @@ -50,7 +50,7 @@ RSpec.describe Form::Lettings::Questions::StarterTenancyType, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer options" do diff --git a/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb b/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb index fb334f909..ba9a72001 100644 --- a/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb @@ -5,12 +5,12 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthAffordableRent, type: :mo let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page) } + let(:page) { instance_double(Form::Page, id: "affordable_tenancy_length") } let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb b/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb index 0c0923bf8..55b51ccfa 100644 --- a/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb @@ -5,12 +5,12 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthIntermediateRent, type: : let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page) } + let(:page) { instance_double(Form::Page, id: "intermediate_tenancy_length") } let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb b/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb index 3a0fae171..449677736 100644 --- a/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthPeriodic, type: :model do let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))), id: "periodic_tenancy_length") } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/lettings/questions/tenancy_length_spec.rb b/spec/models/form/lettings/questions/tenancy_length_spec.rb index 2d87d0923..cc7bf9f9f 100644 --- a/spec/models/form/lettings/questions/tenancy_length_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_spec.rb @@ -3,7 +3,7 @@ require "rails_helper" RSpec.describe Form::Lettings::Questions::TenancyLength, 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, 1)))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))), id: "tenancy_length") } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/lettings/questions/tenancy_other_spec.rb b/spec/models/form/lettings/questions/tenancy_other_spec.rb index ce8aec5db..a6a2962dc 100644 --- a/spec/models/form/lettings/questions/tenancy_other_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_other_spec.rb @@ -3,7 +3,7 @@ require "rails_helper" RSpec.describe Form::Lettings::Questions::TenancyOther, 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, 1)))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))), id: "tenancy_type") } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/lettings/questions/tenancy_type_spec.rb b/spec/models/form/lettings/questions/tenancy_type_spec.rb index 13998094a..82a5ae3e7 100644 --- a/spec/models/form/lettings/questions/tenancy_type_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_type_spec.rb @@ -3,12 +3,12 @@ require "rails_helper" RSpec.describe Form::Lettings::Questions::TenancyType, type: :model do subject(:question) { described_class.new(nil, nil, page) } - let(:page) { instance_double(Form::Page) } + let(:page) { instance_double(Form::Page, id: "tenancy_type") } let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -31,7 +31,7 @@ RSpec.describe Form::Lettings::Questions::TenancyType, type: :model do context "with 2023/24 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has the correct answer options" do @@ -65,7 +65,7 @@ RSpec.describe Form::Lettings::Questions::TenancyType, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer options" do diff --git a/spec/models/form/lettings/questions/waityear_spec.rb b/spec/models/form/lettings/questions/waityear_spec.rb index 5f1f344b9..5d9a5b3a9 100644 --- a/spec/models/form/lettings/questions/waityear_spec.rb +++ b/spec/models/form/lettings/questions/waityear_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Questions::Waityear, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -59,7 +59,7 @@ RSpec.describe Form::Lettings::Questions::Waityear, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/wheelchair_spec.rb b/spec/models/form/lettings/questions/wheelchair_spec.rb index 984a2209f..0a9226ada 100644 --- a/spec/models/form/lettings/questions/wheelchair_spec.rb +++ b/spec/models/form/lettings/questions/wheelchair_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Lettings::Questions::Wheelchair, type: :model do before do allow(page).to receive(:subsection).and_return(subsection) - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct page" do diff --git a/spec/models/form/lettings/subsections/household_characteristics_spec.rb b/spec/models/form/lettings/subsections/household_characteristics_spec.rb index c71ee165c..b45f86fce 100644 --- a/spec/models/form/lettings/subsections/household_characteristics_spec.rb +++ b/spec/models/form/lettings/subsections/household_characteristics_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod let(:subsection_id) { nil } let(:subsection_definition) { nil } let(:section) { instance_double(Form::Lettings::Sections::Household) } - let(:form) { instance_double(Form) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do allow(section).to receive(:form).and_return(form) @@ -18,7 +18,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod context "with start year before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct pages" do @@ -49,8 +49,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod working_situation_lead_tenant_over_retirement_value_check person_2_known person_2_relationship_to_lead - person_2_age_child - person_2_age_non_child + person_2_age no_females_pregnant_household_person_2_age_value_check females_in_soft_age_range_in_pregnant_household_person_2_age_value_check age_2_under_retirement_value_check @@ -64,8 +63,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod working_situation_2_over_retirement_value_check person_3_known person_3_relationship_to_lead - person_3_age_child - person_3_age_non_child + person_3_age no_females_pregnant_household_person_3_age_value_check females_in_soft_age_range_in_pregnant_household_person_3_age_value_check age_3_under_retirement_value_check @@ -79,8 +77,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod working_situation_3_over_retirement_value_check person_4_known person_4_relationship_to_lead - person_4_age_child - person_4_age_non_child + person_4_age no_females_pregnant_household_person_4_age_value_check females_in_soft_age_range_in_pregnant_household_person_4_age_value_check age_4_under_retirement_value_check @@ -94,8 +91,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod working_situation_4_over_retirement_value_check person_5_known person_5_relationship_to_lead - person_5_age_child - person_5_age_non_child + person_5_age no_females_pregnant_household_person_5_age_value_check females_in_soft_age_range_in_pregnant_household_person_5_age_value_check age_5_under_retirement_value_check @@ -109,8 +105,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod working_situation_5_over_retirement_value_check person_6_known person_6_relationship_to_lead - person_6_age_child - person_6_age_non_child + person_6_age no_females_pregnant_household_person_6_age_value_check females_in_soft_age_range_in_pregnant_household_person_6_age_value_check age_6_under_retirement_value_check @@ -124,8 +119,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod working_situation_6_over_retirement_value_check person_7_known person_7_relationship_to_lead - person_7_age_child - person_7_age_non_child + person_7_age no_females_pregnant_household_person_7_age_value_check females_in_soft_age_range_in_pregnant_household_person_7_age_value_check age_7_under_retirement_value_check @@ -139,8 +133,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod working_situation_7_over_retirement_value_check person_8_known person_8_relationship_to_lead - person_8_age_child - person_8_age_non_child + person_8_age no_females_pregnant_household_person_8_age_value_check females_in_soft_age_range_in_pregnant_household_person_8_age_value_check age_8_under_retirement_value_check @@ -159,7 +152,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod context "with start year >= 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do @@ -191,8 +184,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_2_relationship_to_lead relationship_2_partner_under_16_value_check relationship_2_multiple_partners_value_check - person_2_age_child - person_2_age_non_child + person_2_age no_females_pregnant_household_person_2_age_value_check females_in_soft_age_range_in_pregnant_household_person_2_age_value_check age_2_under_retirement_value_check @@ -209,8 +201,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_3_relationship_to_lead relationship_3_partner_under_16_value_check relationship_3_multiple_partners_value_check - person_3_age_child - person_3_age_non_child + person_3_age no_females_pregnant_household_person_3_age_value_check females_in_soft_age_range_in_pregnant_household_person_3_age_value_check age_3_under_retirement_value_check @@ -227,8 +218,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_4_relationship_to_lead relationship_4_partner_under_16_value_check relationship_4_multiple_partners_value_check - person_4_age_child - person_4_age_non_child + person_4_age no_females_pregnant_household_person_4_age_value_check females_in_soft_age_range_in_pregnant_household_person_4_age_value_check age_4_under_retirement_value_check @@ -245,8 +235,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_5_relationship_to_lead relationship_5_partner_under_16_value_check relationship_5_multiple_partners_value_check - person_5_age_child - person_5_age_non_child + person_5_age no_females_pregnant_household_person_5_age_value_check females_in_soft_age_range_in_pregnant_household_person_5_age_value_check age_5_under_retirement_value_check @@ -263,8 +252,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_6_relationship_to_lead relationship_6_partner_under_16_value_check relationship_6_multiple_partners_value_check - person_6_age_child - person_6_age_non_child + person_6_age no_females_pregnant_household_person_6_age_value_check females_in_soft_age_range_in_pregnant_household_person_6_age_value_check age_6_under_retirement_value_check @@ -281,8 +269,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_7_relationship_to_lead relationship_7_partner_under_16_value_check relationship_7_multiple_partners_value_check - person_7_age_child - person_7_age_non_child + person_7_age no_females_pregnant_household_person_7_age_value_check females_in_soft_age_range_in_pregnant_household_person_7_age_value_check age_7_under_retirement_value_check @@ -299,8 +286,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_8_relationship_to_lead relationship_8_partner_under_16_value_check relationship_8_multiple_partners_value_check - person_8_age_child - person_8_age_non_child + person_8_age no_females_pregnant_household_person_8_age_value_check females_in_soft_age_range_in_pregnant_household_person_8_age_value_check age_8_under_retirement_value_check diff --git a/spec/models/form/lettings/subsections/household_needs_spec.rb b/spec/models/form/lettings/subsections/household_needs_spec.rb index 6e4dd25f1..dcd957601 100644 --- a/spec/models/form/lettings/subsections/household_needs_spec.rb +++ b/spec/models/form/lettings/subsections/household_needs_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Lettings::Subsections::HouseholdNeeds, type: :model do let(:subsection_id) { nil } let(:subsection_definition) { nil } - let(:section) { instance_double(Form::Lettings::Sections::Household) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:section) { instance_double(Form::Lettings::Sections::Household, form:) } it "has correct section" do expect(household_needs.section).to eq(section) diff --git a/spec/models/form/lettings/subsections/household_situation_spec.rb b/spec/models/form/lettings/subsections/household_situation_spec.rb index dd6f20d89..d672b3ccc 100644 --- a/spec/models/form/lettings/subsections/household_situation_spec.rb +++ b/spec/models/form/lettings/subsections/household_situation_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdSituation, type: :model do let(:subsection_id) { nil } let(:subsection_definition) { nil } let(:section) { instance_double(Form::Lettings::Sections::Household) } - let(:form) { instance_double(Form) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do allow(section).to receive(:form).and_return(form) @@ -18,7 +18,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdSituation, type: :model do context "with form year before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct pages" do @@ -48,7 +48,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdSituation, type: :model do context "with form year >= 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do diff --git a/spec/models/form/lettings/subsections/income_and_benefits_spec.rb b/spec/models/form/lettings/subsections/income_and_benefits_spec.rb index c260ff56d..7bdc26bfa 100644 --- a/spec/models/form/lettings/subsections/income_and_benefits_spec.rb +++ b/spec/models/form/lettings/subsections/income_and_benefits_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Lettings::Subsections::IncomeAndBenefits, type: :model do let(:subsection_id) { nil } let(:subsection_definition) { nil } - let(:section) { instance_double(Form::Lettings::Sections::RentAndCharges) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:section) { instance_double(Form::Lettings::Sections::RentAndCharges, form:) } it "has correct section" do expect(income_and_benefits.section).to eq(section) @@ -30,8 +31,7 @@ RSpec.describe Form::Lettings::Subsections::IncomeAndBenefits, type: :model do rent_bi_weekly rent_4_weekly rent_monthly - brent_min_rent_value_check - brent_max_rent_value_check + brent_rent_value_check scharge_value_check pscharge_value_check supcharg_value_check diff --git a/spec/models/form/lettings/subsections/property_information_spec.rb b/spec/models/form/lettings/subsections/property_information_spec.rb index 7d406d1a7..cc12f621a 100644 --- a/spec/models/form/lettings/subsections/property_information_spec.rb +++ b/spec/models/form/lettings/subsections/property_information_spec.rb @@ -14,37 +14,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do let(:form) { instance_double(Form, start_date:) } before 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_postcode - property_local_authority - local_authority_min_rent_value_check - local_authority_max_rent_value_check - first_time_property_let_as_social_housing - property_let_type - property_vacancy_reason_not_first_let - property_vacancy_reason_first_let - property_number_of_times_relet - property_unit_type - property_building_type - property_wheelchair_accessible - property_number_of_bedrooms - beds_min_rent_value_check - beds_max_rent_value_check - void_date - void_date_value_check - property_major_repairs - property_major_repairs_value_check - ], - ) - end + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end context "when 2023" do @@ -57,8 +27,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do uprn_confirmation address property_local_authority - local_authority_min_rent_value_check - local_authority_max_rent_value_check + local_authority_rent_value_check first_time_property_let_as_social_housing property_let_type property_vacancy_reason_not_first_let @@ -68,8 +37,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do property_building_type property_wheelchair_accessible property_number_of_bedrooms - beds_min_rent_value_check - beds_max_rent_value_check + beds_rent_value_check void_date void_date_value_check property_major_repairs @@ -83,7 +51,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do let(:start_date) { Time.utc(2024, 2, 8) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do @@ -96,8 +64,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do uprn_selection address property_local_authority - local_authority_min_rent_value_check - local_authority_max_rent_value_check + local_authority_rent_value_check first_time_property_let_as_social_housing property_let_type property_vacancy_reason_not_first_let @@ -106,8 +73,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do property_building_type property_wheelchair_accessible property_number_of_bedrooms - beds_min_rent_value_check - beds_max_rent_value_check + beds_rent_value_check void_date void_date_value_check property_major_repairs diff --git a/spec/models/form/lettings/subsections/setup_spec.rb b/spec/models/form/lettings/subsections/setup_spec.rb index 074f7ae5e..997f4d08e 100644 --- a/spec/models/form/lettings/subsections/setup_spec.rb +++ b/spec/models/form/lettings/subsections/setup_spec.rb @@ -18,7 +18,7 @@ RSpec.describe Form::Lettings::Subsections::Setup, type: :model do context "with start year before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct pages" do @@ -43,7 +43,7 @@ RSpec.describe Form::Lettings::Subsections::Setup, type: :model do context "with start year >= 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do diff --git a/spec/models/form/lettings/subsections/tenancy_information_spec.rb b/spec/models/form/lettings/subsections/tenancy_information_spec.rb index 96770ea78..fce8e57fb 100644 --- a/spec/models/form/lettings/subsections/tenancy_information_spec.rb +++ b/spec/models/form/lettings/subsections/tenancy_information_spec.rb @@ -12,11 +12,11 @@ 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 - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end context "when 2023" do @@ -33,7 +33,7 @@ RSpec.describe Form::Lettings::Subsections::TenancyInformation, type: :model do let(:start_date) { Time.utc(2024, 2, 8) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do 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/buyer1_ethnic_background_arab_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_arab_spec.rb index 68328a5db..a5cf4dd07 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_arab_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_arab_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundArab, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_asian_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_asian_spec.rb index b4c8a198d..c0eb8a108 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_asian_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_asian_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundAsian, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_black_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_black_spec.rb index 7650f49fa..0a04ff806 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_black_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_black_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundBlack, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_mixed_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_mixed_spec.rb index 42420774f..e7cae6445 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_mixed_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_mixed_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundMixed, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_white_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_white_spec.rb index 79dddc53a..ff45cd2c3 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_white_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_white_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundWhite, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/sales/pages/buyer1_ethnic_group_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_group_spec.rb index dcc90fe51..9a94fc0fd 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_group_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_group_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicGroup, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/buyer1_live_in_property_spec.rb b/spec/models/form/sales/pages/buyer1_live_in_property_spec.rb index 2f3c92aa7..edc53bd79 100644 --- a/spec/models/form/sales/pages/buyer1_live_in_property_spec.rb +++ b/spec/models/form/sales/pages/buyer1_live_in_property_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::Buyer1LiveInProperty, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/buyer1_nationality_spec.rb b/spec/models/form/sales/pages/buyer1_nationality_spec.rb index a9cb1e381..a84a44009 100644 --- a/spec/models/form/sales/pages/buyer1_nationality_spec.rb +++ b/spec/models/form/sales/pages/buyer1_nationality_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Pages::Buyer1Nationality, type: :model do before do allow(subsection).to receive(:form).and_return(form) - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct subsection" do @@ -33,7 +33,7 @@ RSpec.describe Form::Sales::Pages::Buyer1Nationality, type: :model do context "with year 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct questions" do diff --git a/spec/models/form/sales/pages/buyer1_working_situation_spec.rb b/spec/models/form/sales/pages/buyer1_working_situation_spec.rb index 2ae7f0f1e..fb8529967 100644 --- a/spec/models/form/sales/pages/buyer1_working_situation_spec.rb +++ b/spec/models/form/sales/pages/buyer1_working_situation_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::Buyer1WorkingSituation, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/buyer2_nationality_spec.rb b/spec/models/form/sales/pages/buyer2_nationality_spec.rb index 97b5f7caf..e01215d21 100644 --- a/spec/models/form/sales/pages/buyer2_nationality_spec.rb +++ b/spec/models/form/sales/pages/buyer2_nationality_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Pages::Buyer2Nationality, type: :model do before do allow(subsection).to receive(:form).and_return(form) - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct subsection" do @@ -42,7 +42,7 @@ RSpec.describe Form::Sales::Pages::Buyer2Nationality, type: :model do context "with year 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct questions" do diff --git a/spec/models/form/sales/pages/buyer2_relationship_to_buyer1_spec.rb b/spec/models/form/sales/pages/buyer2_relationship_to_buyer1_spec.rb index 96a67f5bf..6fbd835c5 100644 --- a/spec/models/form/sales/pages/buyer2_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/pages/buyer2_relationship_to_buyer1_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::Buyer2RelationshipToBuyer1, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/buyer_interview_spec.rb b/spec/models/form/sales/pages/buyer_interview_spec.rb index 24704526d..f7c6bbb70 100644 --- a/spec/models/form/sales/pages/buyer_interview_spec.rb +++ b/spec/models/form/sales/pages/buyer_interview_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::BuyerInterview, type: :model do let(:page_id) { "buyer_interview" } let(:page_definition) { nil } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false) } let(:subsection) { instance_double(Form::Subsection, form:, id: "setup") } it "has correct subsection" do @@ -45,7 +45,7 @@ RSpec.describe Form::Sales::Pages::BuyerInterview, type: :model do end context "when form is after 2024" do - let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: true) } context "when there are joint buyers" do subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) } diff --git a/spec/models/form/sales/pages/buyer_live_spec.rb b/spec/models/form/sales/pages/buyer_live_spec.rb index dd237214c..ac5ac2c27 100644 --- a/spec/models/form/sales/pages/buyer_live_spec.rb +++ b/spec/models/form/sales/pages/buyer_live_spec.rb @@ -11,7 +11,7 @@ RSpec.describe Form::Sales::Pages::BuyerLive, type: :model do let(:form) { instance_double(Form, start_date: current_collection_start_date) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/sales/pages/buyer_previous_spec.rb b/spec/models/form/sales/pages/buyer_previous_spec.rb index d55243dec..8e1486ee6 100644 --- a/spec/models/form/sales/pages/buyer_previous_spec.rb +++ b/spec/models/form/sales/pages/buyer_previous_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Sales::Pages::BuyerPrevious, type: :model do let(:page_definition) { nil } let(:subsection) { instance_double(Form::Subsection, depends_on: nil, enabled?: true, form:) } let(:start_date_after_2024) { false } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: start_date_after_2024, depends_on_met: true) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: start_date_after_2024, depends_on_met: true) } let(:joint_purchase) { false } it "has correct subsection" do diff --git a/spec/models/form/sales/pages/deposit_discount_spec.rb b/spec/models/form/sales/pages/deposit_discount_spec.rb index d183e379b..f94c46707 100644 --- a/spec/models/form/sales/pages/deposit_discount_spec.rb +++ b/spec/models/form/sales/pages/deposit_discount_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Pages::DepositDiscount, type: :model do let(:subsection) { instance_double(Form::Subsection) } before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct subsection" do @@ -45,7 +45,7 @@ RSpec.describe Form::Sales::Pages::DepositDiscount, type: :model do context "when it's a 2024 form" do before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: true, start_date: Time.zone.local(2024, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: true, start_date: Time.zone.local(2024, 4, 1))) end it "has correct depends_on" do diff --git a/spec/models/form/sales/pages/deposit_spec.rb b/spec/models/form/sales/pages/deposit_spec.rb index b33604176..ea309bffc 100644 --- a/spec/models/form/sales/pages/deposit_spec.rb +++ b/spec/models/form/sales/pages/deposit_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Sales::Pages::Deposit, type: :model do let(:page_id) { nil } let(:page_definition) { nil } let(:subsection) { instance_double(Form::Subsection, enabled?: true, depends_on: true) } - let(:form) { instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1), depends_on_met: true) } + let(:form) { instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1), depends_on_met: true) } let(:optional) { false } before do @@ -31,7 +31,7 @@ RSpec.describe Form::Sales::Pages::Deposit, type: :model do context "when routing with start year after 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end context "and optional is false" do @@ -131,7 +131,7 @@ RSpec.describe Form::Sales::Pages::Deposit, type: :model do context "when routing with start year before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end context "and optional is false" do diff --git a/spec/models/form/sales/pages/discount_spec.rb b/spec/models/form/sales/pages/discount_spec.rb index 4585b7f19..c9fb16095 100644 --- a/spec/models/form/sales/pages/discount_spec.rb +++ b/spec/models/form/sales/pages/discount_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Pages::Discount, type: :model do let(:subsection) { instance_double(Form::Subsection) } before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct subsection" 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/la_nominations_spec.rb b/spec/models/form/sales/pages/la_nominations_spec.rb index b69f88f1f..036e26092 100644 --- a/spec/models/form/sales/pages/la_nominations_spec.rb +++ b/spec/models/form/sales/pages/la_nominations_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Pages::LaNominations, type: :model do let(:page_id) { nil } let(:page_definition) { nil } let(:start_year_after_2024) { false } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: start_year_after_2024) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: start_year_after_2024) } let(:subsection) { instance_double(Form::Subsection, form:) } before do diff --git a/spec/models/form/sales/pages/last_accommodation_la_spec.rb b/spec/models/form/sales/pages/last_accommodation_la_spec.rb index b73cf07f0..9cdd64957 100644 --- a/spec/models/form/sales/pages/last_accommodation_la_spec.rb +++ b/spec/models/form/sales/pages/last_accommodation_la_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Sales::Pages::LastAccommodationLa, type: :model do let(:page_id) { nil } let(:page_definition) { nil } let(:start_year_after_2024) { false } - let(:form) { instance_double(Form, depends_on_met: true, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: start_year_after_2024) } + let(:form) { instance_double(Form, depends_on_met: true, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: start_year_after_2024) } let(:subsection) { instance_double(Form::Subsection, form:, depends_on: nil, enabled?: true) } let(:log) { build(:sales_log, :completed) } diff --git a/spec/models/form/sales/pages/last_accommodation_spec.rb b/spec/models/form/sales/pages/last_accommodation_spec.rb index 8c3dbdbbf..fbc581b4b 100644 --- a/spec/models/form/sales/pages/last_accommodation_spec.rb +++ b/spec/models/form/sales/pages/last_accommodation_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Pages::LastAccommodation, type: :model do let(:page_id) { nil } let(:page_definition) { nil } let(:start_year_after_2024) { false } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: start_year_after_2024) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: start_year_after_2024) } let(:subsection) { instance_double(Form::Subsection, form:, depends_on: nil) } it "has correct subsection" do diff --git a/spec/models/form/sales/pages/managing_organisation_spec.rb b/spec/models/form/sales/pages/managing_organisation_spec.rb index ea90add64..30383a1f5 100644 --- a/spec/models/form/sales/pages/managing_organisation_spec.rb +++ b/spec/models/form/sales/pages/managing_organisation_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Sales::Pages::ManagingOrganisation, type: :model do let(:page_id) { nil } let(:page_definition) { nil } let(:subsection) { instance_double(Form::Subsection, form:) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false) } it "has correct subsection" do expect(page.subsection).to eq(subsection) @@ -103,7 +103,7 @@ RSpec.describe Form::Sales::Pages::ManagingOrganisation, type: :model do describe "#routed_to? with 2024 logs" do let(:log) { create(:sales_log) } let(:organisation) { create(:organisation) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: true) } context "when user nil" do it "is not shown" do 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/person_relationship_to_buyer1_spec.rb b/spec/models/form/sales/pages/person_relationship_to_buyer1_spec.rb index 126f2f0b5..aeb196337 100644 --- a/spec/models/form/sales/pages/person_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/pages/person_relationship_to_buyer1_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Form::Sales::Pages::PersonRelationshipToBuyer1, type: :model do subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } let(:person_index) { 1 } let(:page_id) { "person_1_relationship_to_buyer_1" } 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/privacy_notice_spec.rb b/spec/models/form/sales/pages/privacy_notice_spec.rb index 7510e60d9..80be7ae66 100644 --- a/spec/models/form/sales/pages/privacy_notice_spec.rb +++ b/spec/models/form/sales/pages/privacy_notice_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do let(:page_id) { "privacy_notice" } let(:page_definition) { nil } let(:subsection) { instance_double(Form::Subsection, id: "setup") } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false) } before do allow(subsection).to receive(:form).and_return(form) @@ -40,7 +40,7 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do end context "when the form start year is after 2024" do - let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: true) } it "has the expected copy_key" do expect(page.copy_key).to eq("sales.setup.privacynotice.joint_purchase") @@ -64,7 +64,7 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do end context "when the form start year is after 2024" do - let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: true) } it "has the expected copy_key" do expect(page.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase") 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..88d049bce 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) } @@ -57,7 +44,7 @@ RSpec.describe Form::Sales::Pages::PropertyLocalAuthority, type: :model do context "with form before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "is routed to when la is not inferred" do @@ -73,7 +60,7 @@ RSpec.describe Form::Sales::Pages::PropertyLocalAuthority, type: :model do context "with form after 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "is routed to when la is not inferred and address search has been given" do diff --git a/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb b/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb index 9d60c5f3c..01dcb7ce7 100644 --- a/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb +++ b/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Pages::PropertyWheelchairAccessible, type: :model do let(:subsection) { instance_double(Form::Subsection) } before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct subsection" do diff --git a/spec/models/form/sales/pages/purchase_price_spec.rb b/spec/models/form/sales/pages/purchase_price_spec.rb index e5bfb176a..ad857ee9f 100644 --- a/spec/models/form/sales/pages/purchase_price_spec.rb +++ b/spec/models/form/sales/pages/purchase_price_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Pages::PurchasePrice, type: :model do let(:subsection) { instance_double(Form::Subsection) } before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct subsection" do 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/shared_ownership_type_spec.rb b/spec/models/form/sales/pages/shared_ownership_type_spec.rb index d12c49b57..e6ae7d55d 100644 --- a/spec/models/form/sales/pages/shared_ownership_type_spec.rb +++ b/spec/models/form/sales/pages/shared_ownership_type_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Form::Sales::Pages::SharedOwnershipType, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: current_collection_start_date, start_year_after_2024?: true)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: current_collection_start_date, start_year_2024_or_later?: true)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) 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/pages/uprn_spec.rb b/spec/models/form/sales/pages/uprn_spec.rb index 17ef3179b..03e1197bc 100644 --- a/spec/models/form/sales/pages/uprn_spec.rb +++ b/spec/models/form/sales/pages/uprn_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Sales::Pages::Uprn, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(subsection).to receive(:form).and_return(form) end @@ -57,7 +57,7 @@ RSpec.describe Form::Sales::Pages::Uprn, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "points to address search page" do diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb index 593a525d2..c5f243745 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundArab, type: :model let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb index f49d64437..6cf9306b2 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundAsian, type: :model let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb index 6afe4eaf5..cb040ffbd 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundBlack, type: :model let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb index d6e51de58..aced8cb58 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundMixed, type: :model let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb index d08ece820..6aa547e8b 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundWhite, type: :model let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -44,7 +44,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundWhite, type: :model context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/sales/questions/buyer1_ethnic_group_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_group_spec.rb index 0bdc6d9c0..8a859100d 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_group_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_group_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicGroup, type: :model do let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/sales/questions/buyer1_live_in_property_spec.rb b/spec/models/form/sales/questions/buyer1_live_in_property_spec.rb index eccb172f7..038e0ce5d 100644 --- a/spec/models/form/sales/questions/buyer1_live_in_property_spec.rb +++ b/spec/models/form/sales/questions/buyer1_live_in_property_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::Buyer1LiveInProperty, type: :model do let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/sales/questions/buyer1_working_situation_spec.rb b/spec/models/form/sales/questions/buyer1_working_situation_spec.rb index c99e64527..e25eb2aaf 100644 --- a/spec/models/form/sales/questions/buyer1_working_situation_spec.rb +++ b/spec/models/form/sales/questions/buyer1_working_situation_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::Buyer1WorkingSituation, type: :model do let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb index 8d81e8897..6cab95147 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundWhite, type: :model let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -44,7 +44,7 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundWhite, type: :model context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb b/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb index 1d478faa9..99185a592 100644 --- a/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::Buyer2RelationshipToBuyer1, type: :model let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/sales/questions/buyer_interview_spec.rb b/spec/models/form/sales/questions/buyer_interview_spec.rb index e2b39c50f..0db43407f 100644 --- a/spec/models/form/sales/questions/buyer_interview_spec.rb +++ b/spec/models/form/sales/questions/buyer_interview_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do let(:question_id) { nil } let(:question_definition) { nil } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: true) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: true) } let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form:, id: "setup")) } it "has correct page" do @@ -36,7 +36,7 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do context "when the form start year is before 2024" do let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form:, id: "household_characteristics")) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 3, 1), start_year_after_2024?: false) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 3, 1), start_year_2024_or_later?: false) } it "has the expected copy_key" do expect(question.copy_key).to eq("sales.household_characteristics.noint.joint_purchase") @@ -44,7 +44,7 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do end context "when the form start year is after 2024" do - let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: true) } it "has the expected copy_key" do expect(question.copy_key).to eq("sales.setup.noint.joint_purchase") @@ -57,7 +57,7 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do context "when the form start year is before 2024" do let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form:, id: "household_characteristics")) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false) } it "has the expected copy_key" do expect(question.copy_key).to eq("sales.household_characteristics.noint.not_joint_purchase") @@ -65,7 +65,7 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do end context "when the form start year is after 2024" do - let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: true) } it "has the expected copy_key" do expect(question.copy_key).to eq("sales.setup.noint.not_joint_purchase") diff --git a/spec/models/form/sales/questions/buyer_live_spec.rb b/spec/models/form/sales/questions/buyer_live_spec.rb index 12dfc8be6..4356db5dd 100644 --- a/spec/models/form/sales/questions/buyer_live_spec.rb +++ b/spec/models/form/sales/questions/buyer_live_spec.rb @@ -12,7 +12,7 @@ RSpec.describe Form::Sales::Questions::BuyerLive, type: :model do let(:form) { instance_double(Form, start_date: current_collection_start_date) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/sales/questions/buyer_previous_spec.rb b/spec/models/form/sales/questions/buyer_previous_spec.rb index 8c37c2ff2..88204ad1a 100644 --- a/spec/models/form/sales/questions/buyer_previous_spec.rb +++ b/spec/models/form/sales/questions/buyer_previous_spec.rb @@ -48,7 +48,7 @@ RSpec.describe Form::Sales::Questions::BuyerPrevious, type: :model do context "when form year is before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "is not marked as derived" do @@ -58,7 +58,7 @@ RSpec.describe Form::Sales::Questions::BuyerPrevious, type: :model do context "when form year is >= 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "is marked as derived" do 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/discount_spec.rb b/spec/models/form/sales/questions/discount_spec.rb index 5037e2b4e..09c2fa076 100644 --- a/spec/models/form/sales/questions/discount_spec.rb +++ b/spec/models/form/sales/questions/discount_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Sales::Questions::Discount, type: :model do before do allow(page).to receive(:subsection).and_return(subsection) - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct page" do @@ -47,7 +47,7 @@ RSpec.describe Form::Sales::Questions::Discount, type: :model do context "with form start year after 2024" do before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: true, start_date: Time.zone.local(2024, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: true, start_date: Time.zone.local(2024, 4, 1))) end it "has correct max" do 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/mortgage_lender_spec.rb b/spec/models/form/sales/questions/mortgage_lender_spec.rb index a7abd4c16..b4ce1bf86 100644 --- a/spec/models/form/sales/questions/mortgage_lender_spec.rb +++ b/spec/models/form/sales/questions/mortgage_lender_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Sales::Questions::MortgageLender, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?) + allow(form).to receive(:start_year_2024_or_later?) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -46,7 +46,7 @@ RSpec.describe Form::Sales::Questions::MortgageLender, type: :model do context "when form year is before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has the correct answer_options" do @@ -145,7 +145,7 @@ RSpec.describe Form::Sales::Questions::MortgageLender, type: :model do context "when form year is >= 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/sales/questions/mortgageused_spec.rb b/spec/models/form/sales/questions/mortgageused_spec.rb index 7c37cbd78..e85238a4d 100644 --- a/spec/models/form/sales/questions/mortgageused_spec.rb +++ b/spec/models/form/sales/questions/mortgageused_spec.rb @@ -35,7 +35,7 @@ RSpec.describe Form::Sales::Questions::Mortgageused, type: :model do context "and the saledate is before 24/25" do before do - allow(form).to receive(:start_year_after_2024?).and_return false + allow(form).to receive(:start_year_2024_or_later?).and_return false end it "does not show the don't know option" do @@ -45,7 +45,7 @@ RSpec.describe Form::Sales::Questions::Mortgageused, type: :model do context "and the saledate is 24/25 or after" do before do - allow(form).to receive(:start_year_after_2024?).and_return true + allow(form).to receive(:start_year_2024_or_later?).and_return true end it "shows the don't know option" do diff --git a/spec/models/form/sales/questions/nationality_all_group_spec.rb b/spec/models/form/sales/questions/nationality_all_group_spec.rb index a88bf1867..4c2b2a39e 100644 --- a/spec/models/form/sales/questions/nationality_all_group_spec.rb +++ b/spec/models/form/sales/questions/nationality_all_group_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::NationalityAllGroup, type: :model do let(:buyer_index) { 1 } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to be page diff --git a/spec/models/form/sales/questions/number_joint_buyers_spec.rb b/spec/models/form/sales/questions/number_joint_buyers_spec.rb index 9529b3aac..bf53d7d88 100644 --- a/spec/models/form/sales/questions/number_joint_buyers_spec.rb +++ b/spec/models/form/sales/questions/number_joint_buyers_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Sales::Questions::NumberJointBuyers, type: :model do before do allow(page).to receive(:subsection).and_return(subsection) - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct page" do diff --git a/spec/models/form/sales/questions/ownership_scheme_spec.rb b/spec/models/form/sales/questions/ownership_scheme_spec.rb index 99ec32684..222ec180d 100644 --- a/spec/models/form/sales/questions/ownership_scheme_spec.rb +++ b/spec/models/form/sales/questions/ownership_scheme_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Sales::Questions::OwnershipScheme, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -41,7 +41,7 @@ RSpec.describe Form::Sales::Questions::OwnershipScheme, type: :model do context "with collection year on or after 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/sales/questions/person_age_spec.rb b/spec/models/form/sales/questions/person_age_spec.rb index 5faa046bb..772ee20e0 100644 --- a/spec/models/form/sales/questions/person_age_spec.rb +++ b/spec/models/form/sales/questions/person_age_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do let(:question_id) { "age3" } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } let(:person_index) { 2 } it "has correct page" do diff --git a/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb b/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb index 32fb055cd..0bc00c179 100644 --- a/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model let(:question_id) { "relat2" } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } let(:person_index) { 2 } it "has correct page" do 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/privacy_notice_spec.rb b/spec/models/form/sales/questions/privacy_notice_spec.rb index 48de6056f..5f764c7af 100644 --- a/spec/models/form/sales/questions/privacy_notice_spec.rb +++ b/spec/models/form/sales/questions/privacy_notice_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?) + allow(form).to receive(:start_year_2024_or_later?) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -35,7 +35,7 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do let(:subsection) { instance_double(Form::Subsection, id: "household_characteristics") } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end context "and there is a single buyer" do @@ -83,7 +83,7 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do context "when the form year is >= 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end context "and there is a single buyer" do @@ -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/property_wheelchair_accessible_spec.rb b/spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb index 6b89deff2..a08a6d0f8 100644 --- a/spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb +++ b/spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Sales::Questions::PropertyWheelchairAccessible, type: :mode before do allow(page).to receive(:subsection).and_return(subsection) - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct page" 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..aa75b381a 100644 --- a/spec/models/form/sales/questions/shared_ownership_type_spec.rb +++ b/spec/models/form/sales/questions/shared_ownership_type_spec.rb @@ -13,7 +13,7 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do let(:page) { instance_double(Form::Page, subsection:) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct page" do @@ -36,7 +36,7 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do let(:start_date) { Time.zone.local(2023, 4, 2) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has the correct answer_options" do @@ -59,11 +59,11 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do context "when form start date is on or after 2024/25" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) 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/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 } 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/household_characteristics_spec.rb b/spec/models/form/sales/subsections/household_characteristics_spec.rb index 7c6546d79..3eb5042d8 100644 --- a/spec/models/form/sales/subsections/household_characteristics_spec.rb +++ b/spec/models/form/sales/subsections/household_characteristics_spec.rb @@ -19,7 +19,7 @@ RSpec.describe Form::Sales::Subsections::HouseholdCharacteristics, type: :model context "with 2022/23 form" do before do allow(form).to receive(:start_date).and_return(Time.zone.local(2022, 4, 1)) - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct pages" do @@ -120,7 +120,7 @@ RSpec.describe Form::Sales::Subsections::HouseholdCharacteristics, type: :model context "with 2023/24 form" do before do allow(form).to receive(:start_date).and_return(Time.zone.local(2023, 4, 1)) - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct pages" do @@ -228,7 +228,7 @@ RSpec.describe Form::Sales::Subsections::HouseholdCharacteristics, type: :model context "with 2024/25 form" do before do allow(form).to receive(:start_date).and_return(Time.zone.local(2024, 4, 1)) - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do diff --git a/spec/models/form/sales/subsections/outright_sale_spec.rb b/spec/models/form/sales/subsections/outright_sale_spec.rb index 0d28330f2..52941d0a9 100644 --- a/spec/models/form/sales/subsections/outright_sale_spec.rb +++ b/spec/models/form/sales/subsections/outright_sale_spec.rb @@ -22,7 +22,7 @@ RSpec.describe Form::Sales::Subsections::OutrightSale, type: :model do context "when 2022" do before do allow(form).to receive(:start_date).and_return(Time.zone.local(2022, 2, 8)) - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct pages" do @@ -51,7 +51,7 @@ RSpec.describe Form::Sales::Subsections::OutrightSale, type: :model do before do allow(form).to receive(:start_date).and_return(Time.zone.local(2023, 2, 8)) - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct pages" do @@ -80,7 +80,7 @@ RSpec.describe Form::Sales::Subsections::OutrightSale, type: :model do context "when 2024" do before do allow(form).to receive(:start_date).and_return(Time.zone.local(2024, 2, 8)) - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" 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..d29ee85fe 100644 --- a/spec/models/form/sales/subsections/property_information_spec.rb +++ b/spec/models/form/sales/subsections/property_information_spec.rb @@ -14,31 +14,7 @@ RSpec.describe Form::Sales::Subsections::PropertyInformation, type: :model do let(:form) { instance_double(Form, start_date:) } before 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 + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end context "when 2023" do @@ -71,7 +47,7 @@ RSpec.describe Form::Sales::Subsections::PropertyInformation, type: :model do let(:start_date) { Time.utc(2024, 2, 8) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do diff --git a/spec/models/form/sales/subsections/setup_spec.rb b/spec/models/form/sales/subsections/setup_spec.rb index 2d6612663..70d52977f 100644 --- a/spec/models/form/sales/subsections/setup_spec.rb +++ b/spec/models/form/sales/subsections/setup_spec.rb @@ -22,7 +22,7 @@ RSpec.describe Form::Sales::Subsections::Setup, type: :model do context "when start year is before 2024" do before do - allow(section.form).to receive(:start_year_after_2024?).and_return(false) + allow(section.form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct pages" do @@ -48,7 +48,7 @@ RSpec.describe Form::Sales::Subsections::Setup, type: :model do context "when start year is >= 2024" do before do - allow(section.form).to receive(:start_year_after_2024?).and_return(true) + allow(section.form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do diff --git a/spec/models/form/sales/subsections/shared_ownership_scheme_spec.rb b/spec/models/form/sales/subsections/shared_ownership_scheme_spec.rb index 922281fd0..8c5674d0b 100644 --- a/spec/models/form/sales/subsections/shared_ownership_scheme_spec.rb +++ b/spec/models/form/sales/subsections/shared_ownership_scheme_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Subsections::SharedOwnershipScheme, type: :model do let(:section) { instance_double(Form::Sales::Sections::SaleInformation) } before do - allow(section).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(section).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct section" do 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 diff --git a/spec/models/validations/property_validations_spec.rb b/spec/models/validations/property_validations_spec.rb index 3f6f9877c..8cf484f91 100644 --- a/spec/models/validations/property_validations_spec.rb +++ b/spec/models/validations/property_validations_spec.rb @@ -50,7 +50,7 @@ RSpec.describe Validations::PropertyValidations do context "and the log is from before 24/25" do it "adds an error" do - allow(log.form).to receive(:start_year_after_2024?).and_return false + allow(log.form).to receive(:start_year_2024_or_later?).and_return false property_validator.validate_shared_housing_rooms(log) @@ -76,7 +76,7 @@ RSpec.describe Validations::PropertyValidations do context "and the log is from before 24/25" do it "adds an error" do - allow(log.form).to receive(:start_year_after_2024?).and_return false + allow(log.form).to receive(:start_year_2024_or_later?).and_return false property_validator.validate_shared_housing_rooms(log) 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 diff --git a/spec/models/validations/tenancy_validations_spec.rb b/spec/models/validations/tenancy_validations_spec.rb index a41752616..751506c07 100644 --- a/spec/models/validations/tenancy_validations_spec.rb +++ b/spec/models/validations/tenancy_validations_spec.rb @@ -76,12 +76,12 @@ RSpec.describe Validations::TenancyValidations do { name: "assured shorthold", code: 4, - expected_error: ->(min_tenancy_length) { I18n.t("validations.tenancy.length.invalid_fixed", min_tenancy_length:) }, + expected_error: ->(min_tenancy_length) { I18n.t("validations.lettings.tenancy.tenancylength.invalid_fixed_tenancylength", min_tenancy_length:) }, }, { name: "secure fixed term", code: 6, - expected_error: ->(min_tenancy_length) { I18n.t("validations.tenancy.length.invalid_fixed", min_tenancy_length:) }, + expected_error: ->(min_tenancy_length) { I18n.t("validations.lettings.tenancy.tenancylength.invalid_fixed_tenancylength", min_tenancy_length:) }, }, ] @@ -211,7 +211,7 @@ RSpec.describe Validations::TenancyValidations do periodic_tenancy_case = { name: "periodic", code: 8, - expected_error: ->(min_tenancy_length) { I18n.t("validations.tenancy.length.invalid_periodic", min_tenancy_length:) }, + expected_error: ->(min_tenancy_length) { I18n.t("validations.lettings.tenancy.tenancylength.invalid_periodic_tenancylength", min_tenancy_length:) }, } error_fields = %w[tenancylength tenancy] include_examples "adds expected errors based on the tenancy length", periodic_tenancy_case, error_fields, 1 @@ -237,9 +237,8 @@ RSpec.describe Validations::TenancyValidations do it "adds errors to tenancylength and tenancy" do tenancy_validator.validate_tenancy_length_blank_when_not_required(record) - expected_error = I18n.t("validations.tenancy.length.fixed_term_not_required") - expect(record.errors["tenancylength"]).to include(expected_error) - expect(record.errors["tenancy"]).to include(expected_error) + expect(record.errors["tenancylength"]).to include(I18n.t("validations.lettings.tenancy.tenancylength.fixed_term_not_required")) + expect(record.errors["tenancy"]).to include(I18n.t("validations.lettings.tenancy.tenancy.fixed_term_not_required")) end end @@ -321,8 +320,8 @@ RSpec.describe Validations::TenancyValidations do describe "joint tenancy validation" do context "when the data inputter has said that there is only one member in the household" do let(:record) { FactoryBot.build(:lettings_log, :setup_completed, hhmemb: 1) } - let(:expected_error) { I18n.t("validations.tenancy.not_joint") } - let(:hhmemb_expected_error) { I18n.t("validations.tenancy.joint_more_than_one_member") } + let(:expected_error) { I18n.t("validations.lettings.tenancy.joint.sole_tenancy") } + let(:hhmemb_expected_error) { I18n.t("validations.lettings.tenancy.joint.multiple_members_required") } it "displays an error if the data inputter says the letting is a joint tenancy" do record.joint = 1 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) 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/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/services/bulk_upload/lettings/year2023/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb index 314db674d..591ffdd53 100644 --- a/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb @@ -263,7 +263,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "adds an error to all (and only) the fields used to determine duplicates" do parser.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.lettings.2023.bulk_upload.duplicate") [ :field_1, # owning_organisation @@ -300,7 +300,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "adds an error to all the fields used to determine duplicates" do parser.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.lettings.2023.bulk_upload.duplicate") [ :field_1, # owning_organisation @@ -338,7 +338,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "adds an error to all the fields used to determine duplicates" do parser.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.lettings.2023.bulk_upload.duplicate") [ :field_1, # owning_organisation @@ -385,7 +385,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "adds an error to all the fields used to determine duplicates" do parser.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.lettings.2023.bulk_upload.duplicate") [ :field_1, # owning_organisation @@ -444,7 +444,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "does not add an error to all the fields used to determine duplicates" do parser_too.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.lettings.2023.bulk_upload.duplicate") [ :field_1, # owning_organisation @@ -479,7 +479,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "adds an error to all the fields used to determine duplicates" do parser.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.lettings.2023.bulk_upload.duplicate") [ :field_1, # owning_organisation @@ -526,7 +526,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "adds an error to all the fields used to determine duplicates" do parser.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.lettings.2023.bulk_upload.duplicate") [ :field_1, # owning_organisation @@ -585,7 +585,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "does not add an error to all the fields used to determine duplicates" do parser_too.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.lettings.2023.bulk_upload.duplicate") [ :field_1, # owning_organisation @@ -686,7 +686,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "cannot be nulled" do parser.valid? - expect(parser.errors[:field_45]).to eq(["You must show the MHCLG privacy notice to the tenant before you can submit this log."]) + expect(parser.errors[:field_45]).to eq([I18n.t("validations.lettings.2023.bulk_upload.declaration.missing")]) end end end @@ -697,8 +697,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "fetches the question's check_answer_label if it exists" do parser.valid? - expect(parser.errors[:field_19]).to eql(["You must answer address line 1."]) - expect(parser.errors[:field_21]).to eql(["You must answer town or city."]) + expect(parser.errors[:field_19]).to eql([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "address line 1.")]) + expect(parser.errors[:field_21]).to eql([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "town or city.")]) end end end @@ -846,7 +846,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? expect(parser.errors[:field_5]).to be_present - expect(parser.errors[:field_11]).to eq(["You must answer intermediate rent type."]) + expect(parser.errors[:field_11]).to eq([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "intermediate rent type.")]) end end @@ -857,7 +857,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? expect(parser.errors[:field_5]).to be_present - expect(parser.errors[:field_11]).to eq(["You must answer intermediate rent type."]) + expect(parser.errors[:field_11]).to eq([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "intermediate rent type.")]) end end @@ -868,7 +868,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? expect(parser.errors[:field_5]).to be_present - expect(parser.errors[:field_10]).to eq(["You must answer is this a London Affordable Rent letting."]) + expect(parser.errors[:field_10]).to eq([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "is this a London Affordable Rent letting.")]) end end @@ -879,7 +879,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? expect(parser.errors[:field_5]).to be_present - expect(parser.errors[:field_10]).to eq(["You must answer is this a London Affordable Rent letting."]) + expect(parser.errors[:field_10]).to eq([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "is this a London Affordable Rent letting.")]) end end @@ -888,7 +888,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "adds error on field_12" do parser.valid? - expect(parser.errors[:field_12]).to eq(["You must answer product name."]) + expect(parser.errors[:field_12]).to eq([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "product name.")]) end end @@ -910,8 +910,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "is not permitted" do parser.valid? - expect(parser.errors[:field_4]).to include("This letting type is supported housing, but the needs type is general needs. Change either the needs type or the letting type.") - expect(parser.errors[:field_5]).to include("This needs type is general needs, but the letting type is supported housing. Change either the needs type or the letting type.") + expect(parser.errors[:field_4]).to include(I18n.t("validations.lettings.2023.bulk_upload.needstype.lettype_not_general_needs")) + expect(parser.errors[:field_5]).to include(I18n.t("validations.lettings.2023.bulk_upload.lettype.needstype_general_needs")) end end end @@ -925,8 +925,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "is not permitted" do parser.valid? - expect(parser.errors[:field_4]).to include("This letting type is general needs, but the needs type is supported housing. Change either the needs type or the letting type.") - expect(parser.errors[:field_5]).to include("This needs type is supported housing, but the letting type is general needs. Change either the needs type or the letting type.") + expect(parser.errors[:field_4]).to include(I18n.t("validations.lettings.2023.bulk_upload.needstype.lettype_not_supported_housing")) + expect(parser.errors[:field_5]).to include(I18n.t("validations.lettings.2023.bulk_upload.lettype.needstype_supported_housing")) end end @@ -951,7 +951,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? expect(parser.errors[:field_15]).to be_blank - expect(parser.errors[:field_16]).to eq(["You must answer scheme code."]) + expect(parser.errors[:field_16]).to eq([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "scheme code.")]) expect(parser.errors[:field_17]).to be_blank end end @@ -979,7 +979,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? expect(parser.errors[:field_15]).to be_blank - expect(parser.errors.where(:field_16, category: :setup).map(&:message)).to eq(["This scheme code does not belong to the owning organisation or managing organisation."]) + expect(parser.errors.where(:field_16, category: :setup).map(&:message)).to eq([I18n.t("validations.lettings.2023.bulk_upload.scheme.does_not_belong_to_org", scheme_or_management_group: "scheme")]) expect(parser.errors[:field_17]).to be_blank end end @@ -992,7 +992,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do expect(parser.errors[:field_15]).to be_blank expect(parser.errors[:field_16]).to be_blank - expect(parser.errors.where(:field_17, category: :setup).map(&:message)).to eq(["You must answer location code."]) + expect(parser.errors.where(:field_17, category: :setup).map(&:message)).to eq([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "location code.")]) expect(parser.errors[:field_17].count).to eq(1) end end @@ -1005,7 +1005,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do expect(parser.errors[:field_16]).to be_blank expect(parser.errors[:field_17]).to be_blank - expect(parser.errors.where(:field_15, category: :setup).map(&:message)).to eq(["You must answer management group code."]) + expect(parser.errors.where(:field_15, category: :setup).map(&:message)).to eq([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "management group code.")]) expect(parser.errors[:field_15].count).to eq(1) end end @@ -1018,7 +1018,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do expect(parser.errors[:field_15]).to be_blank expect(parser.errors[:field_16]).to be_blank - expect(parser.errors.where(:field_17, category: :setup).map(&:message)).to eq(["Location code must relate to a location that is owned by the owning organisation or managing organisation."]) + expect(parser.errors.where(:field_17, category: :setup).map(&:message)).to eq([I18n.t("validations.lettings.2023.bulk_upload.scheme.must_relate_to_org", capitalised_location_or_scheme: "Location", location_or_scheme: "location")]) end end @@ -1054,7 +1054,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do expect(parser.errors[:field_15]).to be_blank expect(parser.errors[:field_16]).to be_blank - expect(parser.errors.where(:field_17, category: :setup).map(&:message)).to eq(["Location code must relate to a location that is owned by the owning organisation or managing organisation."]) + expect(parser.errors.where(:field_17, category: :setup).map(&:message)).to eq([I18n.t("validations.lettings.2023.bulk_upload.scheme.must_relate_to_org", capitalised_location_or_scheme: "Location", location_or_scheme: "location")]) end end @@ -1067,7 +1067,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? expect(parser.errors[:field_15]).to be_blank - expect(parser.errors.where(:field_16, category: :setup).map(&:message)).to eq(["This scheme code does not belong to the owning organisation or managing organisation."]) + expect(parser.errors.where(:field_16, category: :setup).map(&:message)).to eq([I18n.t("validations.lettings.2023.bulk_upload.scheme.does_not_belong_to_org", scheme_or_management_group: "scheme")]) expect(parser.errors[:field_17]).to be_blank end end @@ -1093,7 +1093,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? expect(parser.errors[:field_15]).to be_blank - expect(parser.errors[:field_16]).to include("You must answer scheme name.") + expect(parser.errors[:field_16]).to include(I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "scheme name.")) expect(parser.errors[:field_17]).to be_blank end end @@ -1122,7 +1122,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "returns a setup error" do parser.valid? - expect(parser.errors.where(:field_15, category: :setup).map(&:message)).to eq(["This management group code does not belong to the owning organisation or managing organisation."]) + expect(parser.errors.where(:field_15, category: :setup).map(&:message)).to eq([I18n.t("validations.lettings.2023.bulk_upload.scheme.does_not_belong_to_org", scheme_or_management_group: "management group")]) expect(parser.errors[:field_16]).to be_blank expect(parser.errors[:field_17]).to be_blank end @@ -1135,7 +1135,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? expect(parser.errors[:field_15]).to be_blank - expect(parser.errors.where(:field_16, category: :setup).map(&:message)).to eq(["You must answer scheme code."]) + expect(parser.errors.where(:field_16, category: :setup).map(&:message)).to eq([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "scheme code.")]) expect(parser.errors[:field_17]).to be_blank end end @@ -1147,7 +1147,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? expect(parser.errors[:field_15]).to be_blank - expect(parser.errors.where(:field_16, category: :setup).map(&:message)).to eq(["Scheme code must relate to a scheme that is owned by the owning organisation or managing organisation."]) + expect(parser.errors.where(:field_16, category: :setup).map(&:message)).to eq([I18n.t("validations.lettings.2023.bulk_upload.scheme.must_relate_to_org", capitalised_location_or_scheme: "Scheme", location_or_scheme: "scheme")]) expect(parser.errors[:field_17]).to be_blank end end @@ -1173,7 +1173,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? expect(parser.errors[:field_15]).to be_blank - expect(parser.errors.where(:field_16, category: :setup).map(&:message)).to eq(["Scheme code must relate to a scheme that is owned by the owning organisation or managing organisation."]) + expect(parser.errors.where(:field_16, category: :setup).map(&:message)).to eq([I18n.t("validations.lettings.2023.bulk_upload.scheme.must_relate_to_org", capitalised_location_or_scheme: "Scheme", location_or_scheme: "scheme")]) expect(parser.errors[:field_17]).to be_blank end end @@ -1186,7 +1186,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "returns a setup error" do parser.valid? - expect(parser.errors.where(:field_15, category: :setup).map(&:message)).to eq(["This management group code does not belong to the owning organisation or managing organisation."]) + expect(parser.errors.where(:field_15, category: :setup).map(&:message)).to eq([I18n.t("validations.lettings.2023.bulk_upload.scheme.does_not_belong_to_org", scheme_or_management_group: "management group")]) expect(parser.errors[:field_16]).to be_blank expect(parser.errors[:field_17]).to be_blank end @@ -1212,7 +1212,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "clears the scheme answer" do parser.valid? - expect(parser.errors[:field_15]).to include("You must answer scheme name.") + expect(parser.errors[:field_15]).to include(I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "scheme name.")) expect(parser.errors[:field_16]).to be_blank expect(parser.errors[:field_17]).to be_blank end @@ -1255,7 +1255,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "returns an error" do parser.valid? - expect(parser.errors[:field_102]).to include("Enter a valid value for what is the tenant’s main reason for the household leaving their last settled home?") + expect(parser.errors[:field_102]).to include(I18n.t("validations.lettings.2023.bulk_upload.invalid_option", question: "what is the tenant’s main reason for the household leaving their last settled home?")) end end end @@ -1490,7 +1490,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "returns an error" do parser.valid? - expect(parser.errors[:field_9]).to include("Tenancy start year must be 2 or 4 digits.") + expect(parser.errors[:field_9]).to include(I18n.t("validations.lettings.2023.bulk_upload.startdate.year_not_two_or_four_digits")) end end @@ -1537,7 +1537,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "is not permitted as setup error" do parser.valid? - expect(parser.errors.where(:field_1, category: :setup).map(&:message)).to eql(["You must answer owning organisation."]) + expect(parser.errors.where(:field_1, category: :setup).map(&:message)).to eql([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "owning organisation.")]) end it "blocks log creation" do @@ -1553,7 +1553,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_1 }.message).to eql("The owning organisation code is incorrect.") + expect(setup_errors.find { |e| e.attribute == :field_1 }.message).to eql(I18n.t("validations.lettings.2023.bulk_upload.owning_organisation.not_found")) end it "blocks log creation" do @@ -1571,7 +1571,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_1 }.message).to eql("The owning organisation code provided is for an organisation that does not own stock.") + expect(setup_errors.find { |e| e.attribute == :field_1 }.message).to eql(I18n.t("validations.lettings.2023.bulk_upload.owning_organisation.not_stock_owner")) end it "blocks log creation" do @@ -1589,7 +1589,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_1 }.message).to eql("You do not have permission to add logs for this owning organisation.") + expect(setup_errors.find { |e| e.attribute == :field_1 }.message).to eql(I18n.t("validations.lettings.2023.bulk_upload.owning_organisation.not_permitted")) end it "blocks log creation" do @@ -1652,7 +1652,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql("The managing organisation code is incorrect.") + expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql(I18n.t("validations.lettings.2023.bulk_upload.managing_organisation.not_answered")) end it "blocks log creation" do @@ -1668,7 +1668,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql("The managing organisation code is incorrect.") + expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql(I18n.t("validations.lettings.2023.bulk_upload.managing_organisation.not_found")) end it "blocks log creation" do @@ -1686,7 +1686,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do parser.valid? setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql("This managing organisation does not have a relationship with the owning organisation.") + expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql(I18n.t("validations.lettings.2023.bulk_upload.managing_organisation.no_relationship")) end it "blocks log creation" do @@ -1702,7 +1702,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "is reported as a setup error" do parser.valid? - expect(parser.errors.where(:field_4, category: :setup).map(&:message)).to eql(["You must answer needs type."]) + expect(parser.errors.where(:field_4, category: :setup).map(&:message)).to eql([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "needs type.")]) end end end @@ -1713,7 +1713,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "has setup errors on the field" do parser.valid? - expect(parser.errors.where(:field_6, category: :setup).map(&:message)).to eql(["You must answer property renewal."]) + expect(parser.errors.where(:field_6, category: :setup).map(&:message)).to eql([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "property renewal.")]) end end @@ -1722,7 +1722,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "adds a setup error" do parser.valid? - expect(parser.errors.where(:field_6, category: :setup).map(&:message)).to include("Enter a valid value for is this letting a renewal?") + expect(parser.errors.where(:field_6, category: :setup).map(&:message)).to include(I18n.t("validations.lettings.2023.bulk_upload.invalid_option", question: "is this letting a renewal?")) end end end @@ -1743,9 +1743,9 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "adds appropriate errors" do parser.valid? - expect(parser.errors[:field_18]).to eql(["You must answer UPRN."]) - expect(parser.errors[:field_19]).to eql(["You must answer address line 1."]) - expect(parser.errors[:field_21]).to eql(["You must answer town or city."]) + expect(parser.errors[:field_18]).to eql([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "UPRN.")]) + expect(parser.errors[:field_19]).to eql([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "address line 1.")]) + expect(parser.errors[:field_21]).to eql([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "town or city.")]) end end @@ -1821,7 +1821,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "populates with correct error message" do parser.valid? - expect(parser.errors[:field_30]).to eql(["You must answer type of building."]) + expect(parser.errors[:field_30]).to eql([I18n.t("validations.lettings.2023.bulk_upload.not_answered", question: "type of building.")]) end end end @@ -1851,8 +1851,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "populates with correct error message" do parser.valid? - expect(parser.errors.where(:field_46, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") - expect(parser.errors.where(:field_50, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") + expect(parser.errors.where(:field_46, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.") + expect(parser.errors.where(:field_50, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.") end end @@ -2170,7 +2170,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "adds an error" do parser.valid? - expect(parser.errors[:field_116]).to include("Enter a valid value for was the letting made under the Choice-Based Lettings (CBL)?") + expect(parser.errors[:field_116]).to include(I18n.t("validations.lettings.2023.bulk_upload.invalid_option", question: "was the letting made under the Choice-Based Lettings (CBL)?")) end end end @@ -2197,7 +2197,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "adds an error" do parser.valid? - expect(parser.errors[:field_118]).to include("Enter a valid value for was the letting made under the Common Housing Register (CHR)?") + expect(parser.errors[:field_118]).to include(I18n.t("validations.lettings.2023.bulk_upload.invalid_option", question: "was the letting made under the Common Housing Register (CHR)?")) end end end @@ -2224,7 +2224,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "adds an error" do parser.valid? - expect(parser.errors[:field_117]).to include("Enter a valid value for was the letting made under the Common Allocation Policy (CAP)?") + expect(parser.errors[:field_117]).to include(I18n.t("validations.lettings.2023.bulk_upload.invalid_option", question: "was the letting made under the Common Allocation Policy (CAP)?")) end end end @@ -2736,8 +2736,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "sets error on housingneeds a and b" do parser.valid? - expect(parser.errors[:field_83]).to include("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.") - expect(parser.errors[:field_84]).to include("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.") + expect(parser.errors[:field_83]).to include(I18n.t("validations.lettings.2023.bulk_upload.housingneeds_type.only_one_option_permitted")) + expect(parser.errors[:field_84]).to include(I18n.t("validations.lettings.2023.bulk_upload.housingneeds_type.only_one_option_permitted")) expect(parser.errors[:field_85]).to be_blank end end @@ -2747,8 +2747,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "sets error on housingneeds a and c" do parser.valid? - expect(parser.errors[:field_83]).to include("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.") - expect(parser.errors[:field_85]).to include("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.") + expect(parser.errors[:field_83]).to include(I18n.t("validations.lettings.2023.bulk_upload.housingneeds_type.only_one_option_permitted")) + expect(parser.errors[:field_85]).to include(I18n.t("validations.lettings.2023.bulk_upload.housingneeds_type.only_one_option_permitted")) expect(parser.errors[:field_84]).to be_blank end end @@ -2758,8 +2758,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "sets error on housingneeds b and c" do parser.valid? - expect(parser.errors[:field_84]).to include("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.") - expect(parser.errors[:field_85]).to include("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.") + expect(parser.errors[:field_84]).to include(I18n.t("validations.lettings.2023.bulk_upload.housingneeds_type.only_one_option_permitted")) + expect(parser.errors[:field_85]).to include(I18n.t("validations.lettings.2023.bulk_upload.housingneeds_type.only_one_option_permitted")) expect(parser.errors[:field_83]).to be_blank end end @@ -2769,8 +2769,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "sets error on housingneeds a and g" do parser.valid? - expect(parser.errors[:field_87]).to include("No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.") - expect(parser.errors[:field_83]).to include("No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.") + expect(parser.errors[:field_87]).to include(I18n.t("validations.lettings.2023.bulk_upload.housingneeds.no_disabled_needs_conjunction")) + expect(parser.errors[:field_83]).to include(I18n.t("validations.lettings.2023.bulk_upload.housingneeds.no_disabled_needs_conjunction")) expect(parser.errors[:field_84]).to be_blank expect(parser.errors[:field_85]).to be_blank end @@ -2793,8 +2793,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "sets error on housingneeds a and h" do parser.valid? - expect(parser.errors[:field_88]).to include("Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.") - expect(parser.errors[:field_83]).to include("Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.") + expect(parser.errors[:field_88]).to include(I18n.t("validations.lettings.2023.bulk_upload.housingneeds.dont_know_disabled_needs_conjunction")) + expect(parser.errors[:field_83]).to include(I18n.t("validations.lettings.2023.bulk_upload.housingneeds.dont_know_disabled_needs_conjunction")) expect(parser.errors[:field_84]).to be_blank expect(parser.errors[:field_85]).to be_blank end diff --git a/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb index d82effa0b..e9047b2ae 100644 --- a/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb @@ -283,7 +283,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds an error to all (and only) the fields used to determine duplicates" do parser.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.lettings.2024.bulk_upload.duplicate") [ :field_1, # owning_organisation @@ -339,7 +339,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds an error to all the fields used to determine duplicates" do parser.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.lettings.2024.bulk_upload.duplicate") [ :field_1, # owning_organisation @@ -381,7 +381,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds an error to all the fields used to determine duplicates" do parser.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.lettings.2024.bulk_upload.duplicate") [ :field_1, # owning_organisation @@ -432,7 +432,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds an error to all the fields used to determine duplicates" do parser.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.lettings.2024.bulk_upload.duplicate") [ :field_1, # owning_organisation @@ -492,7 +492,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "does not add an error to all the fields used to determine duplicates" do parser_too.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.lettings.2024.bulk_upload.duplicate") [ :field_1, # owning_organisation @@ -527,7 +527,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds an error to all the fields used to determine duplicates" do parser.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.lettings.2024.bulk_upload.duplicate") [ :field_1, # owning_organisation @@ -574,7 +574,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds an error to all the fields used to determine duplicates" do parser.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.lettings.2024.bulk_upload.duplicate") [ :field_1, # owning_organisation @@ -634,7 +634,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "does not add an error to all the fields used to determine duplicates" do parser_too.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.lettings.2024.bulk_upload.duplicate") [ :field_1, # owning_organisation @@ -770,7 +770,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "fetches the question's check_answer_label if it exists" do parser.valid? - expect(parser.errors[:field_43]).to eql(["You must answer lead tenant’s gender identity."]) + expect(parser.errors[:field_43]).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "lead tenant’s gender identity.")]) end end @@ -779,7 +779,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "only has one error added to the field" do parser.valid? - expect(parser.errors[:field_112]).to eql(["You must answer was the letting made under the Choice-Based Lettings (CBL)?"]) + expect(parser.errors[:field_112]).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "was the letting made under the Choice-Based Lettings (CBL)?")]) end end @@ -789,7 +789,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "does not add an additional error" do parser.valid? expect(parser.errors[:field_116].length).to eq(1) - expect(parser.errors[:field_116]).to include(match "Enter a valid value for") + expect(parser.errors[:field_116]).to include(match I18n.t("validations.lettings.2024.bulk_upload.invalid_option", question: "")) end end end @@ -833,7 +833,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "is not permitted" do parser.valid? expect(parser.errors[:field_3]).to be_present - expect(parser.errors[:field_3]).to include("You must answer what is the CORE username of the account this letting log should be assigned to?") + expect(parser.errors[:field_3]).to include(I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "what is the CORE username of the account this letting log should be assigned to?")) end it "blocks log creation" do @@ -915,8 +915,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "cannot be nulled" do parser.valid? - expect(parser.errors[:field_5]).to eq(["You must answer scheme code."]) - expect(parser.errors[:field_6]).to eq(["You must answer location code."]) + expect(parser.errors[:field_5]).to eq([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "scheme code.")]) + expect(parser.errors[:field_6]).to eq([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "location code.")]) end end @@ -942,7 +942,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do let(:attributes) { { bulk_upload:, field_1: owning_org.old_visible_id, field_2: owning_org.old_visible_id, field_4: "2", field_11: "2", field_5: "S123", field_6: location.id } } it "returns a setup error" do - expect(parser.errors.where(:field_5, category: :setup).map(&:message)).to eq(["This scheme code does not belong to the owning organisation or managing organisation."]) + expect(parser.errors.where(:field_5, category: :setup).map(&:message)).to eq([I18n.t("validations.lettings.2024.bulk_upload.scheme.must_relate_to_org")]) expect(parser.errors[:field_6]).to be_blank end end @@ -952,7 +952,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "returns a setup error" do expect(parser.errors[:field_5]).to be_blank - expect(parser.errors.where(:field_6, category: :setup).map(&:message)).to eq(["You must answer location code."]) + expect(parser.errors.where(:field_6, category: :setup).map(&:message)).to eq([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "location code.")]) expect(parser.errors[:field_6].count).to eq(1) end end @@ -962,7 +962,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "returns a setup error" do expect(parser.errors[:field_5]).to be_blank - expect(parser.errors.where(:field_6, category: :setup).map(&:message)).to eq(["Location code must relate to a location that is owned by the owning organisation or managing organisation."]) + expect(parser.errors.where(:field_6, category: :setup).map(&:message)).to eq([I18n.t("validations.lettings.2024.bulk_upload.location.must_relate_to_org")]) end end @@ -991,7 +991,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "returns a setup error" do expect(parser.errors[:field_5]).to be_blank - expect(parser.errors.where(:field_6, category: :setup).map(&:message)).to eq(["Location code must relate to a location that is owned by the owning organisation or managing organisation."]) + expect(parser.errors.where(:field_6, category: :setup).map(&:message)).to eq([I18n.t("validations.lettings.2024.bulk_upload.location.must_relate_to_org")]) end end @@ -1001,7 +1001,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do let(:attributes) { { bulk_upload:, field_4: "2", field_11: "2", field_5: "S#{other_scheme.id}", field_6: other_location.id, field_1: owning_org.old_visible_id, field_2: owning_org.old_visible_id } } it "returns a setup error" do - expect(parser.errors.where(:field_5, category: :setup).map(&:message)).to eq(["This scheme code does not belong to the owning organisation or managing organisation."]) + expect(parser.errors.where(:field_5, category: :setup).map(&:message)).to eq([I18n.t("validations.lettings.2024.bulk_upload.scheme.must_relate_to_org")]) expect(parser.errors[:field_6]).to be_blank end end @@ -1081,7 +1081,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "is not permitted" do parser.valid? - expect(parser.errors[:field_98]).to include('The reason for leaving must be "End of social or private sector tenancy - no fault", "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)", "End of social or private sector tenancy - evicted due to rent arrears" or "End of social or private sector tenancy - evicted for any other reason".') + expect(parser.errors[:field_98]).to include(I18n.t("validations.lettings.2024.bulk_upload.reason.renewal_reason_needed")) end end end @@ -1091,7 +1091,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "returns an error" do parser.valid? - expect(parser.errors[:field_98]).to include("Enter a valid value for what is the tenant’s main reason for the household leaving their last settled home?") + expect(parser.errors[:field_98]).to include(I18n.t("validations.lettings.2024.bulk_upload.invalid_option", question: "what is the tenant’s main reason for the household leaving their last settled home?")) end end end @@ -1317,7 +1317,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "returns an error" do parser.valid? - expect(parser.errors[:field_10]).to include("Tenancy start year must be 2 or 4 digits.") + expect(parser.errors[:field_10]).to include(I18n.t("validations.lettings.2024.bulk_upload.startdate.year_not_two_or_four_digits")) end end @@ -1368,7 +1368,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "is not permitted as setup error" do parser.valid? - expect(parser.errors.where(:field_1, category: :setup).map(&:message)).to eql(["You must answer owning organisation."]) + expect(parser.errors.where(:field_1, category: :setup).map(&:message)).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "owning organisation.")]) end it "blocks log creation" do @@ -1385,7 +1385,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_1 }.message).to eql("The owning organisation code is incorrect.") + expect(setup_errors.find { |e| e.attribute == :field_1 }.message).to eql(I18n.t("validations.lettings.2024.bulk_upload.owning_organisation.not_found")) end it "blocks log creation" do @@ -1404,7 +1404,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_1 }.message).to eql("The owning organisation code provided is for an organisation that does not own stock.") + expect(setup_errors.find { |e| e.attribute == :field_1 }.message).to eql(I18n.t("validations.lettings.2024.bulk_upload.owning_organisation.not_stock_owner")) end it "blocks log creation" do @@ -1423,7 +1423,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_1 }.message).to eql("You do not have permission to add logs for this owning organisation.") + expect(setup_errors.find { |e| e.attribute == :field_1 }.message).to eql(I18n.t("validations.lettings.2024.bulk_upload.owning_organisation.not_permitted.not_support")) end it "blocks log creation" do @@ -1492,7 +1492,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do parser = described_class.new(attributes) parser.valid? expect(parser).to be_block_log_creation - expect(parser.errors[:field_1]).to include("You do not have permission to add logs for this owning organisation.") + expect(parser.errors[:field_1]).to include(I18n.t("validations.lettings.2024.bulk_upload.owning_organisation.not_permitted.not_support")) end end @@ -1510,7 +1510,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "does not block log creation and does not add an error to field_1" do parser = described_class.new(attributes) parser.valid? - expect(parser.errors[:field_1]).not_to include("You do not have permission to add logs for this owning organisation.") + expect(parser.errors[:field_1]).not_to include(I18n.t("validations.lettings.2024.bulk_upload.owning_organisation.not_permitted")) end end end @@ -1524,7 +1524,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql("You must answer managing organisation.") + expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql(I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "managing organisation.")) end it "blocks log creation" do @@ -1541,7 +1541,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql("The managing organisation code is incorrect.") + expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql(I18n.t("validations.lettings.2024.bulk_upload.managing_organisation.not_found")) end it "blocks log creation" do @@ -1560,7 +1560,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql("This managing organisation does not have a relationship with the owning organisation.") + expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql(I18n.t("validations.lettings.2024.bulk_upload.managing_organisation.no_relationship")) end it "blocks log creation" do @@ -1576,7 +1576,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "is reported as a setup error" do parser.valid? - expect(parser.errors.where(:field_4, category: :setup).map(&:message)).to eql(["You must answer needs type."]) + expect(parser.errors.where(:field_4, category: :setup).map(&:message)).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "needs type.")]) end end end @@ -1587,7 +1587,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "has setup errors on the field" do parser.valid? - expect(parser.errors.where(:field_7, category: :setup).map(&:message)).to eql(["You must answer property renewal."]) + expect(parser.errors.where(:field_7, category: :setup).map(&:message)).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "property renewal.")]) end end @@ -1596,7 +1596,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds a setup error" do parser.valid? - expect(parser.errors.where(:field_7, category: :setup).map(&:message)).to include("Enter a valid value for is this letting a renewal?") + expect(parser.errors.where(:field_7, category: :setup).map(&:message)).to include(I18n.t("validations.lettings.2024.bulk_upload.invalid_option", question: "is this letting a renewal?")) end end end @@ -1627,10 +1627,10 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds errors to missing key address fields" do parser.valid? - expect(parser.errors[:field_17]).to eql(["You must answer address line 1."]) - expect(parser.errors[:field_19]).to eql(["You must answer town or city."]) - expect(parser.errors[:field_21]).to eql(["You must answer part 1 of postcode."]) - expect(parser.errors[:field_22]).to eql(["You must answer part 2 of postcode."]) + expect(parser.errors[:field_17]).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "address line 1.")]) + expect(parser.errors[:field_19]).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "town or city.")]) + expect(parser.errors[:field_21]).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "part 1 of postcode.")]) + expect(parser.errors[:field_22]).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "part 2 of postcode.")]) end end @@ -1658,11 +1658,11 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds appropriate errors to UPRN and key address fields" do parser.valid? - expect(parser.errors[:field_16]).to eql(["You must answer UPRN."]) - expect(parser.errors[:field_17]).to eql(["You must answer address line 1."]) - expect(parser.errors[:field_19]).to eql(["You must answer town or city."]) - expect(parser.errors[:field_21]).to eql(["You must answer part 1 of postcode."]) - expect(parser.errors[:field_22]).to eql(["You must answer part 2 of postcode."]) + expect(parser.errors[:field_16]).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "UPRN.")]) + expect(parser.errors[:field_17]).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "address line 1.")]) + expect(parser.errors[:field_19]).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "town or city.")]) + expect(parser.errors[:field_21]).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "part 1 of postcode.")]) + expect(parser.errors[:field_22]).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "part 2 of postcode.")]) end end @@ -1671,8 +1671,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds errors to UPRN and the missing key address field" do parser.valid? - expect(parser.errors[:field_16]).to eql(["You must answer UPRN."]) - expect(parser.errors[:field_17]).to eql(["You must answer address line 1."]) + expect(parser.errors[:field_16]).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "UPRN.")]) + expect(parser.errors[:field_17]).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "address line 1.")]) expect(parser.errors[:field_19]).to be_empty expect(parser.errors[:field_21]).to be_empty expect(parser.errors[:field_22]).to be_empty @@ -1706,7 +1706,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do parser.valid? expect(parser.errors[:field_16]).to be_empty %i[field_17 field_18 field_19 field_20 field_21 field_22].each do |field| - expect(parser.errors[field]).to eql(["We could not find this address. Check the address data in your CSV file is correct and complete, or select the correct address using the CORE site."]) + expect(parser.errors[field]).to eql([I18n.t("validations.lettings.2024.bulk_upload.address.not_found")]) end end end @@ -1721,7 +1721,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do parser.valid? expect(parser.errors[:field_16]).to be_empty %i[field_17 field_18 field_19 field_20 field_21 field_22].each do |field| - expect(parser.errors[field]).to eql(["We could not find this address. Check the address data in your CSV file is correct and complete, or select the correct address using the CORE site."]) + expect(parser.errors[field]).to eql([I18n.t("validations.lettings.2024.bulk_upload.address.not_found")]) end end end @@ -1765,7 +1765,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "populates with correct error message" do parser.valid? - expect(parser.errors[:field_27]).to eql(["You must answer type of building."]) + expect(parser.errors[:field_27]).to eql([I18n.t("validations.lettings.2024.bulk_upload.not_answered", question: "type of building.")]) end end end @@ -1864,7 +1864,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds an error to field_45" do parser.valid? - expect(parser.errors["field_45"]).to include("Select a valid nationality.") + expect(parser.errors["field_45"]).to include(I18n.t("validations.lettings.2024.bulk_upload.nationality.invalid")) end end end @@ -1881,8 +1881,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "populates with correct error message" do parser.valid? - expect(parser.errors.where(:field_42, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") - expect(parser.errors.where(:field_46, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") + expect(parser.errors.where(:field_42, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.") + expect(parser.errors.where(:field_46, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.") end end @@ -2185,7 +2185,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds an error" do parser.valid? - expect(parser.errors[:field_112]).to include("Enter a valid value for was the letting made under the Choice-Based Lettings (CBL)?") + expect(parser.errors[:field_112]).to include(I18n.t("validations.lettings.2024.bulk_upload.invalid_option", question: "was the letting made under the Choice-Based Lettings (CBL)?")) end end end @@ -2212,7 +2212,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds an error" do parser.valid? - expect(parser.errors[:field_114]).to include("Enter a valid value for was the letting made under the Common Housing Register (CHR)?") + expect(parser.errors[:field_114]).to include(I18n.t("validations.lettings.2024.bulk_upload.invalid_option", question: "was the letting made under the Common Housing Register (CHR)?")) end end end @@ -2239,7 +2239,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds an error" do parser.valid? - expect(parser.errors[:field_113]).to include("Enter a valid value for was the letting made under the Common Allocation Policy (CAP)?") + expect(parser.errors[:field_113]).to include(I18n.t("validations.lettings.2024.bulk_upload.invalid_option", question: "was the letting made under the Common Allocation Policy (CAP)?")) end end end @@ -2266,7 +2266,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds an error" do parser.valid? - expect(parser.errors[:field_115]).to include("Enter a valid value for was the letting made under the Accessible Register?") + expect(parser.errors[:field_115]).to include(I18n.t("validations.lettings.2024.bulk_upload.invalid_option", question: "was the letting made under the Accessible Register?")) end end end @@ -2603,10 +2603,10 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds an error to all missing charges" do parser.valid? - expect(parser.errors[:field_125]).to eql(["Please enter the basic rent. If there is no basic rent, please enter '0'."]) - expect(parser.errors[:field_126]).to eql(["Please enter the service charge. If there is no service charge, please enter '0'."]) - expect(parser.errors[:field_127]).to eql(["Please enter the personal service charge. If there is no personal service charge, please enter '0'."]) - expect(parser.errors[:field_128]).to eql(["Please enter the basic rent. If there is no basic rent, please enter '0'.", "Please enter the service charge. If there is no service charge, please enter '0'.", "Please enter the personal service charge. If there is no personal service charge, please enter '0'."]) + expect(parser.errors[:field_125]).to eql([I18n.t("validations.lettings.2024.bulk_upload.charges.missing_charges", sentence_fragment: "basic rent")]) + expect(parser.errors[:field_126]).to eql([I18n.t("validations.lettings.2024.bulk_upload.charges.missing_charges", sentence_fragment: "service charge")]) + expect(parser.errors[:field_127]).to eql([I18n.t("validations.lettings.2024.bulk_upload.charges.missing_charges", sentence_fragment: "personal service charge")]) + expect(parser.errors[:field_128]).to eql([I18n.t("validations.lettings.2024.bulk_upload.charges.missing_charges", sentence_fragment: "basic rent"), I18n.t("validations.lettings.2024.bulk_upload.charges.missing_charges", sentence_fragment: "service charge"), I18n.t("validations.lettings.2024.bulk_upload.charges.missing_charges", sentence_fragment: "personal service charge")]) end end end @@ -2627,10 +2627,10 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "adds an error to all charges" do parser.valid? - expect(parser.errors[:field_125]).to eql(["Please enter the support charge. If there is no support charge, please enter '0'."]) - expect(parser.errors[:field_126]).to eql(["Please enter the support charge. If there is no support charge, please enter '0'."]) - expect(parser.errors[:field_127]).to eql(["Please enter the support charge. If there is no support charge, please enter '0'."]) - expect(parser.errors[:field_128]).to eql(["Please enter the support charge. If there is no support charge, please enter '0'."]) + expect(parser.errors[:field_125]).to eql([I18n.t("validations.lettings.2024.bulk_upload.charges.missing_charges", sentence_fragment: "support charge")]) + expect(parser.errors[:field_126]).to eql([I18n.t("validations.lettings.2024.bulk_upload.charges.missing_charges", sentence_fragment: "support charge")]) + expect(parser.errors[:field_127]).to eql([I18n.t("validations.lettings.2024.bulk_upload.charges.missing_charges", sentence_fragment: "support charge")]) + expect(parser.errors[:field_128]).to eql([I18n.t("validations.lettings.2024.bulk_upload.charges.missing_charges", sentence_fragment: "support charge")]) end end end @@ -2857,8 +2857,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "sets error on housingneeds a and b" do parser.valid? - expect(parser.errors[:field_79]).to include("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.") - expect(parser.errors[:field_80]).to include("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.") + expect(parser.errors[:field_79]).to include(I18n.t("validations.lettings.2024.bulk_upload.housingneeds_type.only_one_option_permitted")) + expect(parser.errors[:field_80]).to include(I18n.t("validations.lettings.2024.bulk_upload.housingneeds_type.only_one_option_permitted")) expect(parser.errors[:field_81]).to be_blank end end @@ -2868,8 +2868,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "sets error on housingneeds a and c" do parser.valid? - expect(parser.errors[:field_79]).to include("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.") - expect(parser.errors[:field_81]).to include("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.") + expect(parser.errors[:field_79]).to include(I18n.t("validations.lettings.2024.bulk_upload.housingneeds_type.only_one_option_permitted")) + expect(parser.errors[:field_81]).to include(I18n.t("validations.lettings.2024.bulk_upload.housingneeds_type.only_one_option_permitted")) expect(parser.errors[:field_80]).to be_blank end end @@ -2879,8 +2879,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "sets error on housingneeds b and c" do parser.valid? - expect(parser.errors[:field_80]).to include("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.") - expect(parser.errors[:field_81]).to include("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.") + expect(parser.errors[:field_80]).to include(I18n.t("validations.lettings.2024.bulk_upload.housingneeds_type.only_one_option_permitted")) + expect(parser.errors[:field_81]).to include(I18n.t("validations.lettings.2024.bulk_upload.housingneeds_type.only_one_option_permitted")) expect(parser.errors[:field_79]).to be_blank end end @@ -2890,8 +2890,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "sets error on housingneeds a and g" do parser.valid? - expect(parser.errors[:field_83]).to include("No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.") - expect(parser.errors[:field_79]).to include("No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.") + expect(parser.errors[:field_83]).to include(I18n.t("validations.lettings.2024.bulk_upload.housingneeds.no_disabled_needs_conjunction")) + expect(parser.errors[:field_79]).to include(I18n.t("validations.lettings.2024.bulk_upload.housingneeds.no_disabled_needs_conjunction")) expect(parser.errors[:field_80]).to be_blank expect(parser.errors[:field_81]).to be_blank end @@ -2914,8 +2914,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "sets error on housingneeds a and h" do parser.valid? - expect(parser.errors[:field_84]).to include("Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.") - expect(parser.errors[:field_79]).to include("Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.") + expect(parser.errors[:field_84]).to include(I18n.t("validations.lettings.2024.bulk_upload.housingneeds.dont_know_disabled_needs_conjunction")) + expect(parser.errors[:field_79]).to include(I18n.t("validations.lettings.2024.bulk_upload.housingneeds.dont_know_disabled_needs_conjunction")) expect(parser.errors[:field_80]).to be_blank expect(parser.errors[:field_81]).to be_blank end diff --git a/spec/services/bulk_upload/sales/validator_spec.rb b/spec/services/bulk_upload/sales/validator_spec.rb index d196126c9..c275ce681 100644 --- a/spec/services/bulk_upload/sales/validator_spec.rb +++ b/spec/services/bulk_upload/sales/validator_spec.rb @@ -15,7 +15,7 @@ RSpec.describe BulkUpload::Sales::Validator do context "when file is empty" do it "is not valid" do expect(validator).not_to be_valid - expect(validator.errors["base"]).to eql(["Template is blank - The template must be filled in for us to create the logs and check if data is correct."]) + expect(validator.errors["base"]).to eql([I18n.t("validations.sales.2024.bulk_upload.blank_file")]) end end @@ -27,7 +27,7 @@ RSpec.describe BulkUpload::Sales::Validator do it "is not valid" do expect(validator).not_to be_valid - expect(validator.errors["base"]).to eql(["Template is blank - The template must be filled in for us to create the logs and check if data is correct."]) + expect(validator.errors["base"]).to eql([I18n.t("validations.sales.2024.bulk_upload.blank_file")]) end end @@ -54,7 +54,7 @@ RSpec.describe BulkUpload::Sales::Validator do it "is not valid" do expect(validator).not_to be_valid - expect(validator.errors["base"]).to eql(["Incorrect sale dates, please ensure you have used the correct template."]) + expect(validator.errors["base"]).to eql([I18n.t("validations.sales.2024.bulk_upload.wrong_template.wrong_template")]) end end diff --git a/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb b/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb index 70bd923e6..2994a418e 100644 --- a/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb +++ b/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb @@ -406,7 +406,7 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do let(:attributes) { setup_section_params.merge(field_1: nil) } it "is not permitted as setup error" do - expect(parser.errors.where(:field_1, category: :setup).map(&:message)).to eql(["You must answer owning organisation."]) + expect(parser.errors.where(:field_1, category: :setup).map(&:message)).to eql([I18n.t("validations.sales.2023.bulk_upload.not_answered", question: "owning organisation.")]) end it "blocks log creation" do @@ -418,7 +418,7 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do let(:attributes) { { bulk_upload:, field_1: "donotexist" } } it "is not permitted as a setup error" do - expect(parser.errors.where(:field_1, category: :setup).map(&:message)).to eql(["You must answer owning organisation."]) + expect(parser.errors.where(:field_1, category: :setup).map(&:message)).to eql([I18n.t("validations.sales.2023.bulk_upload.not_answered", question: "owning organisation.")]) end it "blocks log creation" do @@ -432,7 +432,7 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do let(:attributes) { { bulk_upload:, field_1: unaffiliated_org.old_visible_id } } it "is not permitted as setup error" do - expect(parser.errors.where(:field_1, category: :setup).map(&:message)).to eql(["You do not have permission to add logs for this owning organisation."]) + expect(parser.errors.where(:field_1, category: :setup).map(&:message)).to eql([I18n.t("validations.sales.2023.bulk_upload.owning_organisation.not_permitted")]) end it "blocks log creation" do @@ -608,7 +608,7 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do it "returns a setup error" do parser.valid? - expect(parser.errors.where(:field_5, category: :setup).map(&:message)).to include("Sale completion year must be 2 or 4 digits.") + expect(parser.errors.where(:field_5, category: :setup).map(&:message)).to include(I18n.t("validations.sales.2023.bulk_upload.saledate.year_not_two_or_four_digits")) end end @@ -672,7 +672,7 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do it "adds an error to all (and only) the fields used to determine duplicates" do parser.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.sales.2023.bulk_upload.duplicate") [ :field_1, # Owning org @@ -932,7 +932,7 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do it "does not set ##{age}" do parser.valid? - expect(parser.errors[field.to_sym]).to include(/You must answer/) + expect(parser.errors[field.to_sym]).to include(/#{I18n.t("validations.sales.2023.bulk_upload.not_answered", question: "")}/) end end end @@ -980,7 +980,7 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do let(:attributes) { valid_attributes.merge({ field_35: "9" }) } it "a custom validation is applied" do - validation_message = "Buyer 1 cannot be a child under 16." + validation_message = I18n.t("validations.sales.2023.bulk_upload.ecstat1.child_under_16") expect(parser.errors[:field_35]).to include validation_message end end @@ -1052,7 +1052,7 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do let(:attributes) { setup_section_params.merge(field_105: "4") } it "returns correct errors" do - expect(parser.errors[:field_105]).to include("Enter a valid value for was a mortgage used for the purchase of this property? - Shared ownership.") + expect(parser.errors[:field_105]).to include(I18n.t("validations.sales.2023.bulk_upload.invalid_option", question: "was a mortgage used for the purchase of this property? - Shared ownership.")) parser.log.blank_invalid_non_setup_fields! parser.log.save! expect(parser.log.mortgageused).to be_nil @@ -1420,7 +1420,7 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do parser.valid? setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql("This user belongs to an organisation that does not have a relationship with the owning organisation.") + expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql(I18n.t("validations.sales.2023.bulk_upload.assigned_to.managing_organisation_not_related")) end it "blocks log creation" do @@ -1442,7 +1442,7 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do parser.valid? setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_1 }.message).to eql("The owning organisation code provided is for an organisation that does not own stock.") + expect(setup_errors.find { |e| e.attribute == :field_1 }.message).to eql(I18n.t("validations.sales.2023.bulk_upload.owning_organisation.not_stock_owner")) end it "blocks log creation" do diff --git a/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb b/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb index d1d4aeb53..4844ce490 100644 --- a/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb +++ b/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb @@ -301,7 +301,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "fetches the question's check_answer_label if it exists" do parser.valid? - expect(parser.errors[:field_32]).to eql(["You must answer buyer 1’s gender identity."]) + expect(parser.errors[:field_32]).to eql([I18n.t("validations.not_answered", question: "buyer 1’s gender identity.")]) end end @@ -310,7 +310,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "only has one error added to the field" do parser.valid? - expect(parser.errors[:field_23]).to eql(["You must answer address line 1."]) + expect(parser.errors[:field_23]).to eql([I18n.t("validations.sales.2024.bulk_upload.not_answered", question: "address line 1.")]) end end @@ -320,7 +320,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "does not add an additional error" do parser.valid? expect(parser.errors[:field_35].length).to eq(1) - expect(parser.errors[:field_35]).to include(match "Enter a valid value for") + expect(parser.errors[:field_35]).to include(match I18n.t("validations.sales.2024.bulk_upload.invalid_option", question: "")) end end end @@ -463,7 +463,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "is not permitted as setup error" do parser.valid? - expect(parser.errors.where(:field_1, category: :setup).map(&:message)).to eql(["You must answer owning organisation."]) + expect(parser.errors.where(:field_1, category: :setup).map(&:message)).to eql([I18n.t("validations.sales.2024.bulk_upload.not_answered", question: "owning organisation.")]) end it "blocks log creation" do @@ -477,7 +477,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "is not permitted as a setup error" do parser.valid? - expect(parser.errors.where(:field_1, category: :setup).map(&:message)).to eql(["The owning organisation code is incorrect."]) + expect(parser.errors.where(:field_1, category: :setup).map(&:message)).to eql([I18n.t("validations.sales.2024.bulk_upload.owning_organisation.not_found")]) end it "blocks log creation" do @@ -493,7 +493,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "is not permitted as setup error" do parser.valid? - expect(parser.errors.where(:field_1, category: :setup).map(&:message)).to eql(["You do not have permission to add logs for this owning organisation."]) + expect(parser.errors.where(:field_1, category: :setup).map(&:message)).to eql([I18n.t("validations.sales.2024.bulk_upload.owning_organisation.not_permitted.not_support")]) end it "blocks log creation" do @@ -580,7 +580,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do parser = described_class.new(attributes) parser.valid? expect(parser).to be_block_log_creation - expect(parser.errors[:field_1]).to include("You do not have permission to add logs for this owning organisation.") + expect(parser.errors[:field_1]).to include(I18n.t("validations.sales.2024.bulk_upload.owning_organisation.not_permitted.not_support")) end end @@ -598,7 +598,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "does not block log creation and does not add an error to field_1" do parser = described_class.new(attributes) parser.valid? - expect(parser.errors[:field_1]).not_to include("You do not have permission to add logs for this owning organisation.") + expect(parser.errors[:field_1]).not_to include(I18n.t("validations.sales.2024.bulk_upload.owning_organisation.not_permitted.not_support")) end end end @@ -631,7 +631,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "is not permitted" do parser.valid? expect(parser.errors[:field_3]).to be_present - expect(parser.errors[:field_3]).to include("You must answer what is the CORE username of the account this sales log should be assigned to?") + expect(parser.errors[:field_3]).to include(I18n.t("validations.sales.2024.bulk_upload.not_answered", question: "what is the CORE username of the account this sales log should be assigned to?")) end it "blocks log creation" do @@ -736,7 +736,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "returns a setup error" do parser.valid? - expect(parser.errors.where(:field_6, category: :setup).map(&:message)).to include("Sale completion year must be 2 or 4 digits.") + expect(parser.errors.where(:field_6, category: :setup).map(&:message)).to include(I18n.t("validations.sales.2024.bulk_upload.saledate.year_not_two_or_four_digits")) end end @@ -802,7 +802,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "adds an error to all (and only) the fields used to determine duplicates" do parser.valid? - error_message = "This is a duplicate log." + error_message = I18n.t("validations.sales.2024.bulk_upload.duplicate") [ :field_1, # Owning org @@ -891,7 +891,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "returns correct error" do parser.valid? - expect(parser.errors.where(:field_116).map(&:message)).to include("Percentage discount must be between 0% and 70%.") + expect(parser.errors.where(:field_116).map(&:message)).to include(I18n.t("validations.sales.2024.bulk_upload.numeric.within_range", field: "Percentage discount", min: "0%", max: "70%")) end end @@ -909,7 +909,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "returns correct error" do parser.valid? - expect(parser.errors.where(:field_116).map(&:message)).to include("Percentage discount must be between 0% and 70%.") + expect(parser.errors.where(:field_116).map(&:message)).to include(I18n.t("validations.sales.2024.bulk_upload.numeric.within_range", field: "Percentage discount", min: "0%", max: "70%")) end end end @@ -942,7 +942,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "returns setup error" do parser.valid? - expect(parser.errors.where(:field_13).map(&:message)).to include("Enter a valid value for is the buyer a company?") + expect(parser.errors.where(:field_13).map(&:message)).to include(I18n.t("validations.invalid_option", question: "is the buyer a company?")) expect(parser.errors.where(:field_13, category: :setup)).to be_present end end @@ -954,7 +954,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "returns setup error" do parser.valid? - expect(parser.errors.where(:field_14).map(&:message)).to eql(["Enter a valid value for will the buyers live in the property?"]) + expect(parser.errors.where(:field_14).map(&:message)).to eql([I18n.t("validations.invalid_option", question: "will the buyers live in the property?")]) expect(parser.errors.where(:field_14, category: :setup)).to be_present end end @@ -1011,10 +1011,10 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "adds errors to missing key address fields" do parser.valid? - expect(parser.errors[:field_23]).to eql(["You must answer address line 1."]) - expect(parser.errors[:field_25]).to eql(["You must answer town or city."]) - expect(parser.errors[:field_27]).to eql(["You must answer part 1 of postcode."]) - expect(parser.errors[:field_28]).to eql(["You must answer part 2 of postcode."]) + expect(parser.errors[:field_23]).to eql([I18n.t("validations.sales.2024.bulk_upload.not_answered", question: "address line 1.")]) + expect(parser.errors[:field_25]).to eql([I18n.t("validations.sales.2024.bulk_upload.not_answered", question: "town or city.")]) + expect(parser.errors[:field_27]).to eql([I18n.t("validations.sales.2024.bulk_upload.not_answered", question: "part 1 of postcode.")]) + expect(parser.errors[:field_28]).to eql([I18n.t("validations.sales.2024.bulk_upload.not_answered", question: "part 2 of postcode.")]) end end @@ -1042,11 +1042,11 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "adds appropriate errors to UPRN and key address fields" do parser.valid? - expect(parser.errors[:field_22]).to eql(["You must answer UPRN."]) - expect(parser.errors[:field_23]).to eql(["You must answer address line 1."]) - expect(parser.errors[:field_25]).to eql(["You must answer town or city."]) - expect(parser.errors[:field_27]).to eql(["You must answer part 1 of postcode."]) - expect(parser.errors[:field_28]).to eql(["You must answer part 2 of postcode."]) + expect(parser.errors[:field_22]).to eql([I18n.t("validations.sales.2024.bulk_upload.not_answered", question: "UPRN.")]) + expect(parser.errors[:field_23]).to eql([I18n.t("validations.sales.2024.bulk_upload.not_answered", question: "address line 1.")]) + expect(parser.errors[:field_25]).to eql([I18n.t("validations.sales.2024.bulk_upload.not_answered", question: "town or city.")]) + expect(parser.errors[:field_27]).to eql([I18n.t("validations.sales.2024.bulk_upload.not_answered", question: "part 1 of postcode.")]) + expect(parser.errors[:field_28]).to eql([I18n.t("validations.sales.2024.bulk_upload.not_answered", question: "part 2 of postcode.")]) end end @@ -1055,8 +1055,8 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "adds errors to UPRN and the missing key address field" do parser.valid? - expect(parser.errors[:field_22]).to eql(["You must answer UPRN."]) - expect(parser.errors[:field_23]).to eql(["You must answer address line 1."]) + expect(parser.errors[:field_22]).to eql([I18n.t("validations.sales.2024.bulk_upload.not_answered", question: "UPRN.")]) + expect(parser.errors[:field_23]).to eql([I18n.t("validations.sales.2024.bulk_upload.not_answered", question: "address line 1.")]) expect(parser.errors[:field_25]).to be_empty expect(parser.errors[:field_27]).to be_empty expect(parser.errors[:field_28]).to be_empty @@ -1090,7 +1090,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do parser.valid? expect(parser.errors[:field_22]).to be_empty %i[field_23 field_24 field_25 field_26 field_27 field_28].each do |field| - expect(parser.errors[field]).to eql(["We could not find this address. Check the address data in your CSV file is correct and complete, or select the correct address using the CORE site."]) + expect(parser.errors[field]).to eql([I18n.t("validations.sales.2024.bulk_upload.address.not_found")]) end end end @@ -1105,7 +1105,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do parser.valid? expect(parser.errors[:field_22]).to be_empty %i[field_23 field_24 field_25 field_26 field_27 field_28].each do |field| - expect(parser.errors[field]).to eql(["We could not find this address. Check the address data in your CSV file is correct and complete, or select the correct address using the CORE site."]) + expect(parser.errors[field]).to eql([I18n.t("validations.sales.2024.bulk_upload.address.not_found")]) end end end @@ -1218,8 +1218,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "a custom validation is applied" do parser.valid? - validation_message = "Buyer 2 cannot have a working situation of child under 16." - expect(parser.errors[:field_42]).to include validation_message + expect(parser.errors[:field_42]).to include I18n.t("validations.sales.2024.bulk_upload.ecstat2.buyer_cannot_be_child") end end @@ -1240,9 +1239,8 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "a custom validation is applied" do parser.valid? - validation_message = "Buyer 2's age cannot be 16 or over if their working situation is child under 16." - expect(parser.errors[:field_42]).to include validation_message - expect(parser.errors[:field_38]).to include validation_message + expect(parser.errors[:field_42]).to include I18n.t("validations.sales.2024.bulk_upload.ecstat2.buyer_cannot_be_over_16_and_child") + expect(parser.errors[:field_38]).to include I18n.t("validations.sales.2024.bulk_upload.age2.buyer_cannot_be_over_16_and_child") end end @@ -1264,8 +1262,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "a custom validation is applied" do parser.valid? - validation_message = "Buyer 1 cannot have a working situation of child under 16." - expect(parser.errors[:field_35]).to include validation_message + expect(parser.errors[:field_35]).to include I18n.t("validations.sales.2024.bulk_upload.ecstat1.buyer_cannot_be_child") end end @@ -1286,9 +1283,8 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "a custom validation is applied" do parser.valid? - validation_message = "Buyer 1's age cannot be 16 or over if their working situation is child under 16." - expect(parser.errors[:field_35]).to include validation_message - expect(parser.errors[:field_31]).to include validation_message + expect(parser.errors[:field_35]).to include I18n.t("validations.sales.2024.bulk_upload.ecstat1.buyer_cannot_be_over_16_and_child") + expect(parser.errors[:field_31]).to include I18n.t("validations.sales.2024.bulk_upload.age1.buyer_cannot_be_over_16_and_child") end end end @@ -1333,7 +1329,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "returns correct errors" do parser.valid? - expect(parser.errors[:field_103]).to include("Enter a valid value for was a mortgage used for the purchase of this property? - Shared ownership.") + expect(parser.errors[:field_103]).to include(I18n.t("validations.sales.2024.bulk_upload.invalid_option", question: "was a mortgage used for the purchase of this property? - Shared ownership.")) parser.log.blank_invalid_non_setup_fields! parser.log.save! @@ -1370,7 +1366,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "returns correct errors" do parser.valid? - expect(parser.errors[:field_103]).to include("Enter a valid value for was a mortgage used for the purchase of this property?") + expect(parser.errors[:field_103]).to include(I18n.t("validations.invalid_option", question: "was a mortgage used for the purchase of this property?")) parser.log.blank_invalid_non_setup_fields! parser.log.save! @@ -1383,7 +1379,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "returns correct errors" do parser.valid? - expect(parser.errors[:field_103]).to include("Enter a valid value for was a mortgage used for the purchase of this property?") + expect(parser.errors[:field_103]).to include(I18n.t("validations.invalid_option", question: "was a mortgage used for the purchase of this property?")) parser.log.blank_invalid_non_setup_fields! parser.log.save! @@ -1440,7 +1436,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "does not allow 3 (don't know) as an option for discounted ownership" do parser.valid? - expect(parser.errors[:field_117]).to include("Enter a valid value for was a mortgage used for the purchase of this property?") + expect(parser.errors[:field_117]).to include(I18n.t("validations.invalid_option", question: "was a mortgage used for the purchase of this property?")) parser.log.blank_invalid_non_setup_fields! parser.log.save! @@ -1696,7 +1692,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do parser.valid? expect(parser.log.nationality_all).to be(nil) expect(parser.log.nationality_all_group).to be(nil) - expect(parser.errors["field_34"]).to include("Select a valid nationality.") + expect(parser.errors["field_34"]).to include(I18n.t("validations.sales.2024.bulk_upload.nationality.invalid")) end end end @@ -1781,7 +1777,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do parser.valid? expect(parser.log.nationality_all_buyer2).to be(nil) expect(parser.log.nationality_all_buyer2_group).to be(nil) - expect(parser.errors["field_41"]).to include("Select a valid nationality.") + expect(parser.errors["field_41"]).to include(I18n.t("validations.sales.2024.bulk_upload.nationality.invalid")) end end end @@ -1983,7 +1979,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do parser.valid? setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql("You must answer reported by.") + expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql(I18n.t("validations.not_answered", question: "reported by.")) end it "blocks log creation" do @@ -1999,7 +1995,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do parser.valid? setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql("You must answer reported by.") + expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql(I18n.t("validations.not_answered", question: "reported by.")) end it "blocks log creation" do @@ -2017,7 +2013,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do parser.valid? setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql("This organisation does not have a relationship with the owning organisation.") + expect(setup_errors.find { |e| e.attribute == :field_2 }.message).to eql(I18n.t("validations.sales.2024.bulk_upload.assigned_to.managing_organisation_not_related")) end it "blocks log creation" do @@ -2039,7 +2035,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do parser.valid? setup_errors = parser.errors.select { |e| e.options[:category] == :setup } - expect(setup_errors.find { |e| e.attribute == :field_1 }.message).to eql("The owning organisation code provided is for an organisation that does not own stock.") + expect(setup_errors.find { |e| e.attribute == :field_1 }.message).to eql(I18n.t("validations.sales.2024.bulk_upload.owning_organisation.not_stock_owner")) end it "blocks log creation" do diff --git a/spec/services/documentation_generator_spec.rb b/spec/services/documentation_generator_spec.rb index 47bc813f7..6f4714d01 100644 --- a/spec/services/documentation_generator_spec.rb +++ b/spec/services/documentation_generator_spec.rb @@ -89,7 +89,7 @@ describe DocumentationGenerator do end describe ":describe_soft_validations" do - let(:all_validation_methods) { ["rent_in_soft_min_range?"] } + let(:all_validation_methods) { ["rent_soft_validation_triggered?"] } let(:response) do { "choices" => [{ "message" => { "tool_calls" => [{ "function" => { "arguments" => "{\n \"description\": \"Validates the format.\",\n \"validation_type\": \"format\",\n \"other_validated_models\": \"User\"}" } }] } }] } @@ -100,7 +100,7 @@ describe DocumentationGenerator do it "creates new validation documentation records" do expect { described_class.new.describe_soft_validations(client, all_validation_methods, all_helper_methods, log_type) }.to change(LogValidation, :count) - expect(LogValidation.where(validation_name: "rent_in_soft_min_range?").count).to be_positive + expect(LogValidation.where(validation_name: "rent_soft_validation_triggered?").count).to be_positive any_validation = LogValidation.first expect(any_validation.description).to eq("Validates the format.") expect(any_validation.field).not_to be_empty diff --git a/spec/services/merge/merge_organisations_service_spec.rb b/spec/services/merge/merge_organisations_service_spec.rb index 6eea8635f..7163a142f 100644 --- a/spec/services/merge/merge_organisations_service_spec.rb +++ b/spec/services/merge/merge_organisations_service_spec.rb @@ -1317,9 +1317,9 @@ RSpec.describe Merge::MergeOrganisationsService do merging_organisation.reload expect(new_absorbing_organisation.owned_lettings_logs.count).to eq(2) expect(new_absorbing_organisation.managed_lettings_logs.count).to eq(1) - expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log.id).scheme).to eq(new_absorbing_organisation.owned_schemes.first) - expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log.id).location).to eq(new_absorbing_organisation.owned_schemes.first.locations.first) - expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log_no_location.id).scheme).to eq(new_absorbing_organisation.owned_schemes.first) + expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log.id).scheme).to eq(new_absorbing_organisation.owned_schemes.find_by(service_name: scheme.service_name)) + expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log.id).location).to eq(new_absorbing_organisation.owned_schemes.find_by(service_name: scheme.service_name).locations.first) + expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log_no_location.id).scheme).to eq(new_absorbing_organisation.owned_schemes.find_by(service_name: scheme.service_name)) expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log_no_location.id).location).to eq(nil) 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" } } } 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