diff --git a/app/models/form/lettings/questions/address_search.rb b/app/models/form/lettings/questions/address_search.rb index 8d9370c22..5955abc0a 100644 --- a/app/models/form/lettings/questions/address_search.rb +++ b/app/models/form/lettings/questions/address_search.rb @@ -10,12 +10,6 @@ class Form::Lettings::Questions::AddressSearch < ::Form::Question @hide_question_number_on_page = true end - def unanswered_error_message(log = nil) - return super unless log&.is_supported_housing? - - I18n.t("validations.lettings.property.address.not_answered_supported_housing") - end - def answer_options(log = nil, _user = nil) return {} unless ActiveRecord::Base.connected? return {} unless log&.address_search_options&.any? @@ -44,5 +38,11 @@ class Form::Lettings::Questions::AddressSearch < ::Form::Question answer_options(log, user).transform_values { |value| value["value"] } || {} end + def unanswered_error_message(log = nil) + return super unless log&.is_supported_housing? + + I18n.t("validations.lettings.property.address.not_answered_supported_housing") + end + QUESTION_NUMBER_FROM_YEAR = { 2024 => 12, 2025 => 16, 2026 => 16 }.freeze end diff --git a/app/services/bulk_upload/lettings/year2026/row_parser.rb b/app/services/bulk_upload/lettings/year2026/row_parser.rb index 03534d1d8..834c620bb 100644 --- a/app/services/bulk_upload/lettings/year2026/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2026/row_parser.rb @@ -1579,16 +1579,16 @@ private @scheme ||= Scheme.where(id: (owning_organisation.owned_schemes + managing_organisation.owned_schemes).map(&:id)).find_by_id_on_multiple_fields(field_5.strip, field_6) end + def scheme_has_confidential_information? + scheme&.has_confidential_information? || false + end + def location return if scheme.nil? @location ||= scheme.locations.find_by_id_on_multiple_fields(field_6) end - def scheme_has_confidential_information? - scheme&.has_confidential_information? || false - end - def startdate year = field_10.to_s.strip.length.between?(1, 2) ? field_10 + 2000 : field_10 Date.new(year, field_9, field_8) if field_10.present? && field_9.present? && field_8.present? diff --git a/app/views/form/guidance/_address_search.html.erb b/app/views/form/guidance/_address_search.html.erb index e93fb78b6..0d890c1ee 100644 --- a/app/views/form/guidance/_address_search.html.erb +++ b/app/views/form/guidance/_address_search.html.erb @@ -6,6 +6,12 @@ <%= I18n.t("forms.#{@log.form.start_date.year}.#{@log.form.type}.guidance.address_uprn.content").html_safe %> <% end %> +<% if @log.form.type == "lettings" && @log.form.start_year_2026_or_later? %> + <%= govuk_details(summary_text: I18n.t("forms.#{@log.form.start_date.year}.#{@log.form.type}.guidance.confidential_supported_lettings.title")) do %> + <%= I18n.t("forms.#{@log.form.start_date.year}.#{@log.form.type}.guidance.confidential_supported_lettings.content").html_safe %> + <% end %> +<% end %> +
diff --git a/config/locales/forms/2026/lettings/guidance.en.yml b/config/locales/forms/2026/lettings/guidance.en.yml index 3f2e315cf..7ea71158c 100644 --- a/config/locales/forms/2026/lettings/guidance.en.yml +++ b/config/locales/forms/2026/lettings/guidance.en.yml @@ -73,6 +73,10 @@ en: content: "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 is 0010457355.
The UPRN may not be the same as the property reference assigned by your organisation.
" + confidential_supported_lettings: + title: "What should I do for confidential supported lettings?" + content: "Full address or UPRN is not required for confidential supported lettings. You are seeing this question because the scheme you chose in the ‘Set up this lettings log’ section does not have the ‘Confidential information’ box ticked. Please check the scheme you chose. If a scheme needs updating to mark it as confidential, a CORE coordinator in your organisation can do this. If you or they need further assistance contact the helpdesk." + needs_type: title: "What does each need type mean?" content: "General needs housing includes both self-contained and shared housing without support or specific adaptations.