Browse Source

Merge branch 'main' into CLDC-3680-Copy-changes-lettings-property-information-questions

pull/2726/head
Manny Dinssa 8 months ago committed by GitHub
parent
commit
855df39e96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      Gemfile.lock
  2. 2
      app/components/bulk_upload_summary_component.html.erb
  3. 2
      app/constants/global_constants.rb
  4. 2
      app/controllers/lettings_logs_controller.rb
  5. 2
      app/controllers/sales_logs_controller.rb
  6. 17
      app/controllers/users_controller.rb
  7. 2
      app/helpers/filters_helper.rb
  8. 3
      app/helpers/formatting_helper.rb
  9. 8
      app/helpers/log_actions_helper.rb
  10. 2
      app/helpers/merge_requests_helper.rb
  11. 2
      app/helpers/review_helper.rb
  12. 2
      app/helpers/tasklist_helper.rb
  13. 2
      app/models/bulk_upload.rb
  14. 1
      app/models/form/lettings/pages/declaration.rb
  15. 1
      app/models/form/lettings/pages/lead_tenant_age.rb
  16. 1
      app/models/form/lettings/pages/lead_tenant_ethnic_background_arab.rb
  17. 1
      app/models/form/lettings/pages/lead_tenant_ethnic_background_asian.rb
  18. 1
      app/models/form/lettings/pages/lead_tenant_ethnic_background_black.rb
  19. 1
      app/models/form/lettings/pages/lead_tenant_ethnic_background_mixed.rb
  20. 1
      app/models/form/lettings/pages/lead_tenant_ethnic_background_white.rb
  21. 1
      app/models/form/lettings/pages/lead_tenant_nationality.rb
  22. 2
      app/models/form/lettings/pages/location.rb
  23. 2
      app/models/form/lettings/pages/location_search.rb
  24. 24
      app/models/form/lettings/pages/max_rent_value_check.rb
  25. 24
      app/models/form/lettings/pages/min_rent_value_check.rb
  26. 9
      app/models/form/lettings/pages/person_age.rb
  27. 1
      app/models/form/lettings/pages/person_known.rb
  28. 2
      app/models/form/lettings/pages/rent_type.rb
  29. 35
      app/models/form/lettings/pages/rent_value_check.rb
  30. 1
      app/models/form/lettings/pages/scheme.rb
  31. 1
      app/models/form/lettings/pages/starter_tenancy_type.rb
  32. 1
      app/models/form/lettings/pages/tenancy_length.rb
  33. 1
      app/models/form/lettings/pages/tenancy_length_affordable_rent.rb
  34. 1
      app/models/form/lettings/pages/tenancy_length_intermediate_rent.rb
  35. 1
      app/models/form/lettings/pages/tenancy_length_periodic.rb
  36. 1
      app/models/form/lettings/pages/tenancy_type.rb
  37. 2
      app/models/form/lettings/pages/type_of_access_needs.rb
  38. 8
      app/models/form/lettings/questions/age.rb
  39. 3
      app/models/form/lettings/questions/age1.rb
  40. 11
      app/models/form/lettings/questions/age1_known.rb
  41. 4
      app/models/form/lettings/questions/age_known.rb
  42. 3
      app/models/form/lettings/questions/armedforces.rb
  43. 3
      app/models/form/lettings/questions/condition_effects.rb
  44. 2
      app/models/form/lettings/questions/created_by_id.rb
  45. 2
      app/models/form/lettings/questions/declaration.rb
  46. 3
      app/models/form/lettings/questions/details_known.rb
  47. 4
      app/models/form/lettings/questions/ethnic_arab.rb
  48. 4
      app/models/form/lettings/questions/ethnic_asian.rb
  49. 4
      app/models/form/lettings/questions/ethnic_black.rb
  50. 3
      app/models/form/lettings/questions/ethnic_group.rb
  51. 4
      app/models/form/lettings/questions/ethnic_mixed.rb
  52. 4
      app/models/form/lettings/questions/ethnic_white.rb
  53. 10
      app/models/form/lettings/questions/gender_identity1.rb
  54. 3
      app/models/form/lettings/questions/hhmemb.rb
  55. 3
      app/models/form/lettings/questions/housingneeds.rb
  56. 4
      app/models/form/lettings/questions/housingneeds_other.rb
  57. 4
      app/models/form/lettings/questions/housingneeds_type.rb
  58. 3
      app/models/form/lettings/questions/illness.rb
  59. 3
      app/models/form/lettings/questions/irproduct_other.rb
  60. 3
      app/models/form/lettings/questions/joint.rb
  61. 3
      app/models/form/lettings/questions/leftreg.rb
  62. 11
      app/models/form/lettings/questions/location_id.rb
  63. 12
      app/models/form/lettings/questions/location_id_search.rb
  64. 2
      app/models/form/lettings/questions/managing_organisation.rb
  65. 15
      app/models/form/lettings/questions/max_rent_value_check.rb
  66. 3
      app/models/form/lettings/questions/nationality.rb
  67. 3
      app/models/form/lettings/questions/nationality_all.rb
  68. 4
      app/models/form/lettings/questions/nationality_all_group.rb
  69. 3
      app/models/form/lettings/questions/needs_type.rb
  70. 10
      app/models/form/lettings/questions/person_gender_identity.rb
  71. 3
      app/models/form/lettings/questions/person_relationship.rb
  72. 3
      app/models/form/lettings/questions/person_working_situation.rb
  73. 3
      app/models/form/lettings/questions/preg_occ.rb
  74. 3
      app/models/form/lettings/questions/property_reference.rb
  75. 19
      app/models/form/lettings/questions/renewal.rb
  76. 3
      app/models/form/lettings/questions/rent_type.rb
  77. 4
      app/models/form/lettings/questions/rent_value_check.rb
  78. 3
      app/models/form/lettings/questions/reservist.rb
  79. 11
      app/models/form/lettings/questions/scheme_id.rb
  80. 3
      app/models/form/lettings/questions/sheltered.rb
  81. 4
      app/models/form/lettings/questions/starter_tenancy_type.rb
  82. 11
      app/models/form/lettings/questions/startertenancy.rb
  83. 2
      app/models/form/lettings/questions/stock_owner.rb
  84. 4
      app/models/form/lettings/questions/tenancy_length.rb
  85. 11
      app/models/form/lettings/questions/tenancy_length_affordable_rent.rb
  86. 11
      app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb
  87. 4
      app/models/form/lettings/questions/tenancy_length_periodic.rb
  88. 4
      app/models/form/lettings/questions/tenancy_other.rb
  89. 2
      app/models/form/lettings/questions/tenancy_start_date.rb
  90. 4
      app/models/form/lettings/questions/tenancy_type.rb
  91. 3
      app/models/form/lettings/questions/tenant_code.rb
  92. 3
      app/models/form/lettings/questions/working_situation1.rb
  93. 7
      app/models/form/lettings/subsections/household_characteristics.rb
  94. 1
      app/models/form/lettings/subsections/household_needs.rb
  95. 3
      app/models/form/lettings/subsections/income_and_benefits.rb
  96. 6
      app/models/form/lettings/subsections/property_information.rb
  97. 5
      app/models/form/sales/pages/about_price_value_check.rb
  98. 2
      app/models/form/sales/pages/address.rb
  99. 2
      app/models/form/sales/pages/address_fallback.rb
  100. 2
      app/models/form/sales/pages/address_matcher.rb
  101. Some files were not shown because too many files have changed in this diff Show More

4
Gemfile.lock

@ -377,8 +377,7 @@ GEM
responders (3.1.1) responders (3.1.1)
actionpack (>= 5.2) actionpack (>= 5.2)
railties (>= 5.2) railties (>= 5.2)
rexml (3.3.6) rexml (3.3.9)
strscan
roo (2.10.1) roo (2.10.1)
nokogiri (~> 1) nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0) rubyzip (>= 1.3.0, < 3.0.0)
@ -463,7 +462,6 @@ GEM
smart_properties (1.17.0) smart_properties (1.17.0)
stimulus-rails (1.3.3) stimulus-rails (1.3.3)
railties (>= 6.0.0) railties (>= 6.0.0)
strscan (3.1.0)
thor (1.3.2) thor (1.3.2)
thread_safe (0.3.6) thread_safe (0.3.6)
timecop (0.9.8) timecop (0.9.8)

2
app/components/bulk_upload_summary_component.html.erb

@ -4,7 +4,7 @@
<header class="app-log-summary__header"> <header class="app-log-summary__header">
<h2 class="govuk-heading-m govuk-!-font-weight-regular govuk-!-margin-bottom-0 text-normal-break "> <h2 class="govuk-heading-m govuk-!-font-weight-regular govuk-!-margin-bottom-0 text-normal-break ">
<span class="govuk-!-margin-right-1"><%= bulk_upload.filename %></span> <span class="govuk-!-margin-right-1"><%= bulk_upload.filename %></span>
<span class="app-metadata app-log-summary__details" style="white-space: nowrap;"><%= bulk_upload.year %>/<%= bulk_upload.year + 1 %></span> <span class="app-metadata app-log-summary__details" style="white-space: nowrap;"><%= bulk_upload.year %> to <%= bulk_upload.year + 1 %></span>
</h2> </h2>
</header> </header>
<div class="govuk-!-margin-bottom-2"> <div class="govuk-!-margin-bottom-2">

2
app/constants/global_constants.rb

@ -1,5 +1,5 @@
module GlobalConstants 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 = { COUNTRIES_ANSWER_OPTIONS = {
"" => "Select an option", "" => "Select an option",

2
app/controllers/lettings_logs_controller.rb

@ -65,7 +65,7 @@ class LettingsLogsController < LogsController
elsif @log.collection_closed_for_editing? elsif @log.collection_closed_for_editing?
redirect_to review_lettings_log_path(@log) redirect_to review_lettings_log_path(@log)
else else
render("logs/edit", locals: { current_user: }) render("logs/edit", locals: { current_user:, bulk_upload_filter_applied: session_filters["bulk_upload_id"].present? })
end end
end end

2
app/controllers/sales_logs_controller.rb

@ -39,7 +39,7 @@ class SalesLogsController < LogsController
if @log.collection_closed_for_editing? if @log.collection_closed_for_editing?
redirect_to review_sales_log_path(@log, sales_log: true) redirect_to review_sales_log_path(@log, sales_log: true)
else else
render "logs/edit", locals: { current_user: } render "logs/edit", locals: { current_user:, bulk_upload_filter_applied: session_filters["bulk_upload_id"].present? }
end end
end end

17
app/controllers/users_controller.rb

@ -257,13 +257,7 @@ private
def user_params def user_params
if @user == current_user if @user == current_user
if current_user.data_coordinator? current_user_params
params.require(:user).permit(:email, :phone, :phone_extension, :name, :password, :password_confirmation, :role, :is_dpo, :is_key_contact, :initial_confirmation_sent)
elsif current_user.support?
params.require(:user).permit(:email, :phone, :phone_extension, :name, :password, :password_confirmation, :role, :is_dpo, :is_key_contact, :initial_confirmation_sent, :organisation_id)
else
params.require(:user).permit(:email, :phone, :phone_extension, :name, :password, :password_confirmation, :initial_confirmation_sent)
end
elsif current_user.data_coordinator? elsif current_user.data_coordinator?
params.require(:user).permit(:email, :phone, :phone_extension, :name, :role, :is_dpo, :is_key_contact, :active, :initial_confirmation_sent) params.require(:user).permit(:email, :phone, :phone_extension, :name, :role, :is_dpo, :is_key_contact, :active, :initial_confirmation_sent)
elsif current_user.support? elsif current_user.support?
@ -271,6 +265,15 @@ private
end end
end end
def current_user_params
base_params = %i[email phone phone_extension name password password_confirmation initial_confirmation_sent]
return params.require(:user).permit(*(base_params + %i[role is_dpo is_key_contact])) if current_user.data_coordinator?
return params.require(:user).permit(*(base_params + %i[role is_dpo is_key_contact organisation_id])) if current_user.support?
return params.require(:user).permit(*(base_params + [:role])) if Rails.env.staging? && current_user.in_staging_role_update_email_allowlist?
params.require(:user).permit(*base_params)
end
def user_params_without_org def user_params_without_org
user_params.except(:organisation_id) user_params.except(:organisation_id)
end end

2
app/helpers/filters_helper.rb

@ -287,7 +287,7 @@ private
end end
def year_combo(year) def year_combo(year)
"#{year}/#{year - 2000 + 1}" "#{year} to #{year + 1}"
end end
def formatted_years_filter(session_filters) def formatted_years_filter(session_filters)

3
app/helpers/formatting_helper.rb

@ -2,7 +2,8 @@ module FormattingHelper
def format_ending(text) def format_ending(text)
return text if text.blank? 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) ensure_sentence_ending(modified_text)
end end

8
app/helpers/log_actions_helper.rb

@ -2,8 +2,8 @@ module LogActionsHelper
include GovukLinkHelper include GovukLinkHelper
include GovukVisuallyHiddenHelper include GovukVisuallyHiddenHelper
def edit_actions_for_log(log) def edit_actions_for_log(log, bulk_upload_filter_applied)
back = back_button_for(log) back = back_button_for(log, bulk_upload_filter_applied)
delete = delete_button_for_log(log) delete = delete_button_for_log(log)
return if back.nil? && delete.nil? return if back.nil? && delete.nil?
@ -15,9 +15,9 @@ module LogActionsHelper
private private
def back_button_for(log) def back_button_for(log, bulk_upload_filter_applied)
if log.completed? if log.completed?
if log.creation_method_bulk_upload? && log.bulk_upload.present? if log.creation_method_bulk_upload? && log.bulk_upload.present? && bulk_upload_filter_applied
if log.lettings? if log.lettings?
govuk_button_link_to "Back to uploaded logs", resume_bulk_upload_lettings_result_path(log.bulk_upload) govuk_button_link_to "Back to uploaded logs", resume_bulk_upload_lettings_result_path(log.bulk_upload)
else else

2
app/helpers/merge_requests_helper.rb

@ -9,7 +9,7 @@ module MergeRequestsHelper
def request_details(merge_request) def request_details(merge_request)
[ [
{ label: "Requester", value: display_value_or_placeholder(merge_request.requester&.name) }, { 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) }, { label: "Status", value: status_tag(merge_request.status) },
] ]
end end

2
app/helpers/review_helper.rb

@ -6,7 +6,7 @@ module ReviewHelper
"You can review and make changes to this log until #{log.form.submission_deadline.to_formatted_s(:govuk_date)}.".html_safe "You can review and make changes to this log until #{log.form.submission_deadline.to_formatted_s(:govuk_date)}.".html_safe
else else
start_year = log.startdate ? collection_start_year_for_date(log.startdate) : log.form.start_date.year start_year = log.startdate ? collection_start_year_for_date(log.startdate) : log.form.start_date.year
"This log is from the #{start_year}/#{start_year + 1} collection window, which is now closed." "This log is from the #{start_year} to #{start_year + 1} collection window, which is now closed."
end end
end end

2
app/helpers/tasklist_helper.rb

@ -55,7 +55,7 @@ module TasklistHelper
else else
start_year = log.startdate ? collection_start_year_for_date(log.startdate) : log.form.start_date.year start_year = log.startdate ? collection_start_year_for_date(log.startdate) : log.form.start_date.year
"This log is from the #{start_year}/#{start_year + 1} collection window, which is now closed." "This log is from the #{start_year} to #{start_year + 1} collection window, which is now closed."
end end
end end

2
app/models/bulk_upload.rb

@ -59,7 +59,7 @@ class BulkUpload < ApplicationRecord
end end
def year_combo def year_combo
"#{year}/#{year - 2000 + 1}" "#{year} to #{year + 1}"
end end
def end_year def end_year

1
app/models/form/lettings/pages/declaration.rb

@ -2,7 +2,6 @@ class Form::Lettings::Pages::Declaration < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "declaration" @id = "declaration"
@header = "Ministry of Housing, Communities and Local Government privacy notice"
end end
def questions def questions

1
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) def initialize(id, hsh, subsection)
super super
@id = "lead_tenant_age" @id = "lead_tenant_age"
@copy_key = "lettings.household_characteristics.age1"
@depends_on = [{ "declaration" => 1 }] @depends_on = [{ "declaration" => 1 }]
end end

1
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) def initialize(id, hsh, subsection)
super super
@id = "lead_tenant_ethnic_background_arab" @id = "lead_tenant_ethnic_background_arab"
@copy_key = "lettings.household_characteristics.ethnic.ethnic_background_arab"
@depends_on = [{ "ethnic_group" => 4 }] @depends_on = [{ "ethnic_group" => 4 }]
end end

1
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) def initialize(id, hsh, subsection)
super super
@id = "lead_tenant_ethnic_background_asian" @id = "lead_tenant_ethnic_background_asian"
@copy_key = "lettings.household_characteristics.ethnic.ethnic_background_asian"
@depends_on = [{ "ethnic_group" => 2 }] @depends_on = [{ "ethnic_group" => 2 }]
end end

1
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) def initialize(id, hsh, subsection)
super super
@id = "lead_tenant_ethnic_background_black" @id = "lead_tenant_ethnic_background_black"
@copy_key = "lettings.household_characteristics.ethnic.ethnic_background_black"
@depends_on = [{ "ethnic_group" => 3 }] @depends_on = [{ "ethnic_group" => 3 }]
end end

1
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) def initialize(id, hsh, subsection)
super super
@id = "lead_tenant_ethnic_background_mixed" @id = "lead_tenant_ethnic_background_mixed"
@copy_key = "lettings.household_characteristics.ethnic.ethnic_background_mixed"
@depends_on = [{ "ethnic_group" => 1 }] @depends_on = [{ "ethnic_group" => 1 }]
end end

1
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) def initialize(id, hsh, subsection)
super super
@id = "lead_tenant_ethnic_background_white" @id = "lead_tenant_ethnic_background_white"
@copy_key = "lettings.household_characteristics.ethnic.ethnic_background_white"
@depends_on = [{ "ethnic_group" => 0 }] @depends_on = [{ "ethnic_group" => 0 }]
end end

1
app/models/form/lettings/pages/lead_tenant_nationality.rb

@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantNationality < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "lead_tenant_nationality" @id = "lead_tenant_nationality"
@copy_key = "lettings.household_characteristics.#{form.start_year_after_2024? ? 'nationality_all' : 'national'}"
@depends_on = [{ "declaration" => 1 }] @depends_on = [{ "declaration" => 1 }]
end end

2
app/models/form/lettings/pages/location.rb

@ -8,7 +8,7 @@ class Form::Lettings::Pages::Location < ::Form::Page
"scheme_has_large_number_of_locations?" => false, "scheme_has_large_number_of_locations?" => false,
}, },
] ]
@header = "Location" @copy_key = "lettings.setup.location_id.less_than_twenty"
@next_unresolved_page_id = :check_answers @next_unresolved_page_id = :check_answers
end end

2
app/models/form/lettings/pages/location_search.rb

@ -8,7 +8,7 @@ class Form::Lettings::Pages::LocationSearch < ::Form::Page
"scheme_has_large_number_of_locations?" => true, "scheme_has_large_number_of_locations?" => true,
}, },
] ]
@header = "Location" @copy_key = "lettings.setup.location_id.twenty_or_more"
@next_unresolved_page_id = :check_answers @next_unresolved_page_id = :check_answers
end end

24
app/models/form/lettings/pages/max_rent_value_check.rb

@ -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

24
app/models/form/lettings/pages/min_rent_value_check.rb

@ -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

9
app/models/form/lettings/pages/person_age.rb

@ -1,13 +1,12 @@
class Form::Lettings::Pages::PersonAge < ::Form::Page 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) 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_index = person_index
@person_type = person_type
@depends_on = [ @depends_on = [
{ {
"details_known_#{person_index}" => 0, "details_known_#{person_index}" => 0,
"person_#{person_index}_child_relation?" => (person_type == "child"),
}, },
] ]
end end
@ -15,7 +14,7 @@ class Form::Lettings::Pages::PersonAge < ::Form::Page
def questions def questions
@questions ||= [ @questions ||= [
Form::Lettings::Questions::AgeKnown.new(nil, nil, self, person_index: @person_index), 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
end end

1
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:) def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection) super(id, hsh, subsection)
@id = "person_#{person_index}_known" @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 } } @depends_on = (person_index..8).map { |index| { "hhmemb" => index } }
@person_index = person_index @person_index = person_index
end end

2
app/models/form/lettings/pages/rent_type.rb

@ -2,7 +2,7 @@ class Form::Lettings::Pages::RentType < ::Form::Page
def initialize(_id, hsh, subsection) def initialize(_id, hsh, subsection)
super("rent_type", hsh, subsection) super("rent_type", hsh, subsection)
@derived = true @derived = true
@header = "Rent Type" @copy_key = "lettings.setup.rent_type"
end end
def questions def questions

35
app/models/form/lettings/pages/rent_value_check.rb

@ -0,0 +1,35 @@
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 }]
@title_text = {
"translation" => "soft_validations.rent.outside_range_title",
"arguments" => [
{
"key" => "brent",
"label" => true,
"i18n_template" => "brent",
},
],
}
@informative_text = {
"translation" => "soft_validations.rent.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

1
app/models/form/lettings/pages/scheme.rb

@ -6,7 +6,6 @@ class Form::Lettings::Pages::Scheme < ::Form::Page
"needstype" => 2, "needstype" => 2,
}, },
] ]
@header = "Scheme"
@next_unresolved_page_id = "location" @next_unresolved_page_id = "location"
end end

1
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) def initialize(id, hsh, subsection)
super super
@id = "starter_tenancy_type" @id = "starter_tenancy_type"
@copy_key = "lettings.tenancy_information.tenancy.starter_tenancy_type"
@depends_on = [{ "starter_tenancy?" => true }] @depends_on = [{ "starter_tenancy?" => true }]
end end

1
app/models/form/lettings/pages/tenancy_length.rb

@ -2,6 +2,7 @@ class Form::Lettings::Pages::TenancyLength < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "tenancy_length" @id = "tenancy_length"
@copy_key = "lettings.tenancy_information.tenancylength.tenancy_length"
@depends_on = [{ "tenancy_type_fixed_term?" => true, "needstype" => 2 }] @depends_on = [{ "tenancy_type_fixed_term?" => true, "needstype" => 2 }]
end end

1
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) def initialize(id, hsh, subsection)
super super
@id = "tenancy_length_affordable_rent" @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 }] @depends_on = [{ "tenancy_type_fixed_term?" => true, "affordable_or_social_rent?" => true, "needstype" => 1 }]
end end

1
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) def initialize(id, hsh, subsection)
super super
@id = "tenancy_length_intermediate_rent" @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 }] @depends_on = [{ "tenancy_type_fixed_term?" => true, "affordable_or_social_rent?" => false, "needstype" => 1 }]
end end

1
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) def initialize(id, hsh, subsection)
super super
@id = "tenancy_length_periodic" @id = "tenancy_length_periodic"
@copy_key = "lettings.tenancy_information.tenancylength.tenancy_length_periodic"
@depends_on = [{ "tenancy_type_periodic?" => true }] @depends_on = [{ "tenancy_type_periodic?" => true }]
end end

1
app/models/form/lettings/pages/tenancy_type.rb

@ -2,6 +2,7 @@ class Form::Lettings::Pages::TenancyType < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "tenancy_type" @id = "tenancy_type"
@copy_key = "lettings.tenancy_information.tenancy.tenancy_type"
@depends_on = [{ "starter_tenancy?" => false }] @depends_on = [{ "starter_tenancy?" => false }]
end end

2
app/models/form/lettings/pages/type_of_access_needs.rb

@ -2,7 +2,7 @@ class Form::Lettings::Pages::TypeOfAccessNeeds < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "type_of_access_needs" @id = "type_of_access_needs"
@header = "Disabled access needs" @copy_key = "lettings.household_needs.housingneeds_type"
@depends_on = [{ "housingneeds" => 1 }] @depends_on = [{ "housingneeds" => 1 }]
end end

8
app/models/form/lettings/questions/age.rb

@ -1,9 +1,8 @@
class Form::Lettings::Questions::Age < ::Form::Question 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) super(id, hsh, page)
@id = "age#{person_index}" @id = "age#{person_index}"
@check_answer_label = "Person #{person_index}’s age" @copy_key = "lettings.household_characteristics.age#{person_index}.age#{person_index}"
@header = "Age"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@inferred_check_answers_value = [{ "condition" => { "age#{person_index}_known" => 1 }, "value" => "Not known" }] @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 @step = 1
@person_index = person_index @person_index = person_index
@question_number = question_number @question_number = question_number
@person_type = person_type
@hint_text = hint_text @hint_text = hint_text
end end
@ -31,8 +29,6 @@ class Form::Lettings::Questions::Age < ::Form::Question
def hint_text def hint_text
if form.start_year_after_2024? if form.start_year_after_2024?
"Answer 1 for children aged under 1 year old" "Answer 1 for children aged under 1 year old"
elsif @person_type == "child"
"For a child under 1, enter 1"
end end
end end
end end

3
app/models/form/lettings/questions/age1.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::Age1 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "age1" @id = "age1"
@check_answer_label = "Lead tenant’s age" @copy_key = "lettings.household_characteristics.age1.age1"
@header = "Age"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@inferred_check_answers_value = [{ "condition" => { "age1_known" => 1 }, "value" => "Not known" }] @inferred_check_answers_value = [{ "condition" => { "age1_known" => 1 }, "value" => "Not known" }]

11
app/models/form/lettings/questions/age1_known.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::Age1Known < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "age1_known" @id = "age1_known"
@check_answer_label = "" @copy_key = "lettings.household_characteristics.age1.age1_known"
@header = "Do you know the lead tenant’s age?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @check_answers_card_number = 1
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@ -14,13 +13,5 @@ class Form::Lettings::Questions::Age1Known < ::Form::Question
ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze 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 QUESTION_NUMBER_FROM_YEAR = { 2023 => 32, 2024 => 31 }.freeze
end end

4
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:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "age#{person_index}_known" @id = "age#{person_index}_known"
@check_answer_label = "" @copy_key = "lettings.household_characteristics.age#{person_index}.age#{person_index}_known"
@header = "Do you know person #{person_index}’s age?"
@type = "radio" @type = "radio"
@check_answers_card_number = person_index @check_answers_card_number = person_index
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@conditional_for = { "age#{person_index}" => [0] } @conditional_for = { "age#{person_index}" => [0] }
@hidden_in_check_answers = { @hidden_in_check_answers = {

3
app/models/form/lettings/questions/armedforces.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Armedforces < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "armedforces" @id = "armedforces"
@check_answer_label = "Household links to UK armed forces"
@header = "Does anybody in the household have any links to the UK armed forces?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "This excludes national service.<br><br>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."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/lettings/questions/condition_effects.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::ConditionEffects < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "condition_effects" @id = "condition_effects"
@check_answer_label = "How is person affected by condition or illness"
@header = "How is the person affected by their condition or illness?"
@type = "checkbox" @type = "checkbox"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "Select all that apply."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

2
app/models/form/lettings/questions/created_by_id.rb

@ -4,8 +4,6 @@ class Form::Lettings::Questions::CreatedById < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "assigned_to_id" @id = "assigned_to_id"
@check_answer_label = "Log owner"
@header = "Which user are you creating this log for?"
@derived = true @derived = true
@type = "select" @type = "select"
end end

2
app/models/form/lettings/questions/declaration.rb

@ -2,8 +2,6 @@ class Form::Lettings::Questions::Declaration < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "declaration" @id = "declaration"
@check_answer_label = "Tenant has seen the privacy notice"
@header = "Declaration"
@type = "checkbox" @type = "checkbox"
@check_answers_card_number = 0 unless form.start_year_after_2024? @check_answers_card_number = 0 unless form.start_year_after_2024?
@top_guidance_partial = form.start_year_after_2024? ? "privacy_notice_tenant_2024" : "privacy_notice_tenant" @top_guidance_partial = form.start_year_after_2024? ? "privacy_notice_tenant_2024" : "privacy_notice_tenant"

3
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:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "details_known_#{person_index}" @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" @type = "radio"
@check_answers_card_number = person_index @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 @answer_options = ANSWER_OPTIONS
end end

4
app/models/form/lettings/questions/ethnic_arab.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicArab < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Lead tenant’s ethnic background" @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_arab"
@header = "Which of the following best describes the lead tenant’s Arab background?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @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 @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

4
app/models/form/lettings/questions/ethnic_asian.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicAsian < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Lead tenant’s ethnic background" @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_asian"
@header = "Which of the following best describes the lead tenant’s Asian or Asian British background?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @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 @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

4
app/models/form/lettings/questions/ethnic_black.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicBlack < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Lead tenant’s ethnic background" @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_black"
@header = "Which of the following best describes the lead tenant’s Black, African, Caribbean or Black British background?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @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 @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/lettings/questions/ethnic_group.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::EthnicGroup < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic_group" @id = "ethnic_group"
@check_answer_label = "Lead tenant’s ethnic group"
@header = "What is the lead tenant’s ethnic group?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @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 @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

4
app/models/form/lettings/questions/ethnic_mixed.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicMixed < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Lead tenant’s ethnic background" @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_mixed"
@header = "Which of the following best describes the lead tenant’s Mixed or Multiple ethnic groups background?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @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 @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

4
app/models/form/lettings/questions/ethnic_white.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicWhite < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ethnic" @id = "ethnic"
@check_answer_label = "Lead tenant’s ethnic background" @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_white"
@header = "Which of the following best describes the lead tenant’s White background?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

10
app/models/form/lettings/questions/gender_identity1.rb

@ -2,8 +2,6 @@ class Form::Lettings::Questions::GenderIdentity1 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "sex1" @id = "sex1"
@check_answer_label = "Lead tenant’s gender identity"
@header = "Which of these best describes the lead tenant’s gender identity?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @check_answers_card_number = 1
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@ -18,13 +16,5 @@ class Form::Lettings::Questions::GenderIdentity1 < ::Form::Question
"R" => { "value" => "Tenant prefers not to say" }, "R" => { "value" => "Tenant prefers not to say" },
}.freeze }.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 QUESTION_NUMBER_FROM_YEAR = { 2023 => 33, 2024 => 32 }.freeze
end end

3
app/models/form/lettings/questions/hhmemb.rb

@ -2,14 +2,11 @@ class Form::Lettings::Questions::Hhmemb < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "hhmemb" @id = "hhmemb"
@check_answer_label = "Number of household members"
@header = "How many people live in the household for this letting?"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@check_answers_card_number = 0 @check_answers_card_number = 0
@max = 8 @max = 8
@min = 1 @min = 1
@hint_text = "You can provide details for a maximum of 8 people."
@step = 1 @step = 1
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/lettings/questions/housingneeds.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Housingneeds < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "housingneeds" @id = "housingneeds"
@check_answer_label = "Anybody with disabled access needs"
@header = "Does anybody in the household have any disabled access needs?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

4
app/models/form/lettings/questions/housingneeds_other.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::HousingneedsOther < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "housingneeds_other" @id = "housingneeds_other"
@check_answer_label = "Other disabled access needs" @copy_key = "lettings.household_needs.housingneeds_type.housingneeds_other"
@header = "Do they have any other disabled access needs?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

4
app/models/form/lettings/questions/housingneeds_type.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::HousingneedsType < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "housingneeds_type" @id = "housingneeds_type"
@check_answer_label = "Disabled access needs" @copy_key = "lettings.household_needs.housingneeds_type.housingneeds_type"
@header = "What type of access needs do they have?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/lettings/questions/illness.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Illness < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "illness" @id = "illness"
@check_answer_label = "Anybody in household with physical or mental health condition"
@header = "Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/lettings/questions/irproduct_other.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::IrproductOther < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "irproduct_other" @id = "irproduct_other"
@check_answer_label = "Product name" @copy_key = "lettings.setup.rent_type.irproduct_other"
@header = "Name of rent product"
@type = "text" @type = "text"
@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? @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 end

3
app/models/form/lettings/questions/joint.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Joint < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "joint" @id = "joint"
@check_answer_label = "Is this a joint tenancy?"
@header = "Is this a joint tenancy?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @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 @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/lettings/questions/leftreg.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Leftreg < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "leftreg" @id = "leftreg"
@check_answer_label = "Person still serving in UK armed forces"
@header = "Is the person still serving in the UK armed forces?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

11
app/models/form/lettings/questions/location_id.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::LocationId < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "location_id" @id = "location_id"
@check_answer_label = "Location" @copy_key = "lettings.setup.location_id.less_than_twenty"
@header = header_text
@type = "radio" @type = "radio"
@answer_options = answer_options @answer_options = answer_options
@inferred_answers = { @inferred_answers = {
@ -56,13 +55,5 @@ private
false false
end end
def header_text
if form.start_date && form.start_date.year >= 2023
"Which location is this letting for?"
else
"Which location is this log for?"
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 5 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 5 }.freeze
end end

12
app/models/form/lettings/questions/location_id_search.rb

@ -2,10 +2,8 @@ class Form::Lettings::Questions::LocationIdSearch < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "location_id" @id = "location_id"
@check_answer_label = "Location"
@header = header_text
@hint_text = '<div class="govuk-inset-text">This scheme has 20 or more locations.</div>Enter postcode or address.'
@type = "select" @type = "select"
@copy_key = "lettings.setup.location_id.twenty_or_more"
@answer_options = answer_options @answer_options = answer_options
@inferred_answers = { @inferred_answers = {
"location.name": { "location.name": {
@ -52,13 +50,5 @@ private
false false
end end
def header_text
if form.start_date && form.start_date.year >= 2023
"Which location is this letting for?"
else
"Which location is this log for?"
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 5 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 5 }.freeze
end end

2
app/models/form/lettings/questions/managing_organisation.rb

@ -2,8 +2,6 @@ class Form::Lettings::Questions::ManagingOrganisation < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "managing_organisation_id" @id = "managing_organisation_id"
@check_answer_label = "Managing agent"
@header = "Which organisation manages this letting?"
@derived = true @derived = true
@type = "select" @type = "select"
@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? @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?

15
app/models/form/lettings/questions/max_rent_value_check.rb

@ -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

3
app/models/form/lettings/questions/nationality.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Nationality < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "national" @id = "national"
@check_answer_label = "Lead tenant’s nationality"
@header = "What is the nationality of the lead tenant?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @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 @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/lettings/questions/nationality_all.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::NationalityAll < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "nationality_all" @id = "nationality_all"
@check_answer_label = "Lead tenant’s nationality" @copy_key = "lettings.household_characteristics.nationality_all.nationality_all"
@header = "Enter a nationality"
@type = "select" @type = "select"
@check_answers_card_number = 1 @check_answers_card_number = 1
@answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS @answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS

4
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) def initialize(id, hsh, page)
super super
@id = "nationality_all_group" @id = "nationality_all_group"
@check_answer_label = "Lead tenant’s nationality" @copy_key = "lettings.household_characteristics.nationality_all.nationality_all_group"
@header = "What is the nationality of the lead tenant?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @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 @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @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] } @conditional_for = { "nationality_all" => [12] }

3
app/models/form/lettings/questions/needs_type.rb

@ -2,9 +2,6 @@ class Form::Lettings::Questions::NeedsType < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "needstype" @id = "needstype"
@check_answer_label = "Needs type"
@header = "What is the 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."
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@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? @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?

10
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:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "sex#{person_index}" @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" @type = "radio"
@check_answers_card_number = person_index @check_answers_card_number = person_index
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@ -19,14 +17,6 @@ class Form::Lettings::Questions::PersonGenderIdentity < ::Form::Question
"R" => { "value" => "Person prefers not to say" }, "R" => { "value" => "Person prefers not to say" },
}.freeze }.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 def question_number
base_question_number = case form.start_date.year base_question_number = case form.start_date.year
when 2023 when 2023

3
app/models/form/lettings/questions/person_relationship.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::PersonRelationship < ::Form::Question
def initialize(id, hsh, page, person_index:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "relat#{person_index}" @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" @type = "radio"
@check_answers_card_number = person_index @check_answers_card_number = person_index
@hint_text = ""
@answer_options = answer_options @answer_options = answer_options
@person_index = person_index @person_index = person_index
@question_number = question_number @question_number = question_number

3
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:) def initialize(id, hsh, page, person_index:)
super(id, hsh, page) super(id, hsh, page)
@id = "ecstat#{person_index}" @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" @type = "radio"
@check_answers_card_number = person_index @check_answers_card_number = person_index
@hint_text = ""
@person_index = person_index @person_index = person_index
@question_number = question_number @question_number = question_number
@answer_options = answer_options @answer_options = answer_options

3
app/models/form/lettings/questions/preg_occ.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::PregOcc < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "preg_occ" @id = "preg_occ"
@check_answer_label = "Anybody in household pregnant"
@header = "Is anybody in the household pregnant?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/lettings/questions/property_reference.rb

@ -2,9 +2,6 @@ class Form::Lettings::Questions::PropertyReference < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "propcode" @id = "propcode"
@check_answer_label = "Property reference"
@header = "What is the property reference?"
@hint_text = "This is how you usually refer to this property on your own systems."
@type = "text" @type = "text"
@width = 10 @width = 10
@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? @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?

19
app/models/form/lettings/questions/renewal.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Renewal < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "renewal" @id = "renewal"
@check_answer_label = "Property renewal"
@header = header_text
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = hint_text
@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? @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 end
@ -16,21 +13,5 @@ class Form::Lettings::Questions::Renewal < ::Form::Question
} }
.freeze .freeze
def header_text
if form.start_year_after_2024?
"Is this letting a renewal of social housing to the same tenant in the same property?"
else
"Is this letting a renewal?"
end
end
def hint_text
if form.start_year_after_2024?
"If the property was previously being used as temporary accommodation, then answer 'no'"
else
"A renewal is a letting to the same tenant in the same property. If the property was previously being used as temporary accommodation, then answer 'no'"
end
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 4, 2024 => 6 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 4, 2024 => 6 }.freeze
end end

3
app/models/form/lettings/questions/rent_type.rb

@ -2,8 +2,7 @@ class Form::Lettings::Questions::RentType < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "rent_type" @id = "rent_type"
@check_answer_label = "Rent type" @copy_key = "lettings.setup.rent_type.rent_type"
@header = "What is the rent type?"
@type = "radio" @type = "radio"
@top_guidance_partial = form.start_year_after_2024? ? "rent_type_definitions_2024" : "rent_type_definitions" @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 @answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_2024 : ANSWER_OPTIONS

4
app/models/form/lettings/questions/min_rent_value_check.rb → app/models/form/lettings/questions/rent_value_check.rb

@ -1,11 +1,11 @@
class Form::Lettings::Questions::MinRentValueCheck < ::Form::Question class Form::Lettings::Questions::RentValueCheck < ::Form::Question
def initialize(id, hsh, page, check_answers_card_number:) def initialize(id, hsh, page, check_answers_card_number:)
super(id, hsh, page) super(id, hsh, page)
@id = "rent_value_check" @id = "rent_value_check"
@check_answer_label = "Total rent confirmation" @check_answer_label = "Total rent confirmation"
@header = "Are you sure this is correct?" @header = "Are you sure this is correct?"
@type = "interruption_screen" @type = "interruption_screen"
@hint_text = I18n.t("soft_validations.rent.hint_text", higher_or_lower: "lower") @hint_text = I18n.t("soft_validations.rent.hint_text")
@check_answers_card_number = check_answers_card_number @check_answers_card_number = check_answers_card_number
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] } @hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] }

3
app/models/form/lettings/questions/reservist.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Reservist < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "reservist" @id = "reservist"
@check_answer_label = "Person seriously injured or ill as result of serving in UK armed forces"
@header = "Was the person seriously injured or ill as a result of serving in the UK armed forces?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

11
app/models/form/lettings/questions/scheme_id.rb

@ -1,8 +1,6 @@
class Form::Lettings::Questions::SchemeId < ::Form::Question class Form::Lettings::Questions::SchemeId < ::Form::Question
def initialize(_id, hsh, page) def initialize(_id, hsh, page)
super("scheme_id", hsh, page) super("scheme_id", hsh, page)
@check_answer_label = "Scheme name"
@header = "What scheme is this log for?"
@type = "select" @type = "select"
@answer_options = answer_options @answer_options = answer_options
@top_guidance_partial = "finding_scheme" @top_guidance_partial = "finding_scheme"
@ -48,15 +46,6 @@ class Form::Lettings::Questions::SchemeId < ::Form::Question
lettings_log.form.get_question("postcode_full", nil).label_from_value(lettings_log.postcode_full) unless lettings_log.scheme_has_multiple_locations? lettings_log.form.get_question("postcode_full", nil).label_from_value(lettings_log.postcode_full) unless lettings_log.scheme_has_multiple_locations?
end end
def hint_text
if form.start_year_after_2024?
"Enter postcode or scheme name.<br><br>
A supported housing scheme provides shared or self-contained housing for a particular client group, for example younger or vulnerable people."
else
"Enter postcode or scheme name"
end
end
private private
def supported_housing_selected?(lettings_log) def supported_housing_selected?(lettings_log)

3
app/models/form/lettings/questions/sheltered.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Sheltered < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "sheltered" @id = "sheltered"
@check_answer_label = "Is this letting in sheltered accommodation?"
@header = "Is this letting in sheltered accommodation?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @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.</br></br>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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

4
app/models/form/lettings/questions/starter_tenancy_type.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::StarterTenancyType < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tenancy" @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" @copy_key = "lettings.tenancy_information.tenancy.#{page.id}.tenancy"
@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?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "" : "This is also known as an ‘introductory period’."
@conditional_for = { "tenancyother" => [3] } @conditional_for = { "tenancyother" => [3] }
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

11
app/models/form/lettings/questions/startertenancy.rb

@ -2,8 +2,6 @@ class Form::Lettings::Questions::Startertenancy < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "startertenancy" @id = "startertenancy"
@check_answer_label = "Is this a starter or introductory tenancy?"
@header = "Is this a starter tenancy?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@ -12,14 +10,5 @@ class Form::Lettings::Questions::Startertenancy < ::Form::Question
ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "2" => { "value" => "No" } }.freeze 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’.<br><br>
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 QUESTION_NUMBER_FROM_YEAR = { 2023 => 26 }.freeze
end end

2
app/models/form/lettings/questions/stock_owner.rb

@ -2,8 +2,6 @@ class Form::Lettings::Questions::StockOwner < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "owning_organisation_id" @id = "owning_organisation_id"
@check_answer_label = "Stock owner"
@header = "Which organisation owns this property?"
@derived = true @derived = true
@type = "select" @type = "select"
@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? @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?

4
app/models/form/lettings/questions/tenancy_length.rb

@ -2,14 +2,12 @@ class Form::Lettings::Questions::TenancyLength < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tenancylength" @id = "tenancylength"
@check_answer_label = "Length of fixed-term tenancy" @copy_key = "lettings.tenancy_information.tenancylength.#{page.id}"
@header = "What is the length of the fixed-term tenancy to the nearest year?"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@check_answers_card_number = 0 @check_answers_card_number = 0
@max = 150 @max = 150
@min = 0 @min = 0
@hint_text = "Do not include the starter or introductory period."
@step = 1 @step = 1
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

11
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) def initialize(id, hsh, page)
super super
@id = "tenancylength" @id = "tenancylength"
@check_answer_label = "Length of fixed-term tenancy" @copy_key = "lettings.tenancy_information.tenancylength.#{page.id}"
@header = "What is the length of the fixed-term tenancy to the nearest year?"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@check_answers_card_number = 0 @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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end
def hint_text
if form.start_year_after_2024?
"Do not include the starter or introductory period.</br>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.</br>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 QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze
end end

11
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) def initialize(id, hsh, page)
super super
@id = "tenancylength" @id = "tenancylength"
@check_answer_label = "Length of fixed-term tenancy" @copy_key = "lettings.tenancy_information.tenancylength.#{page.id}"
@header = "What is the length of the fixed-term tenancy to the nearest year?"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@check_answers_card_number = 0 @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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end
def hint_text
if form.start_year_after_2024?
"Do not include the starter or introductory period.</br>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.</br>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 QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze
end end

4
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) def initialize(id, hsh, page)
super super
@id = "tenancylength" @id = "tenancylength"
@check_answer_label = "Length of periodic tenancy" @copy_key = "lettings.tenancy_information.tenancylength.#{page.id}"
@header = "What is the length of the periodic tenancy to the nearest year?"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@check_answers_card_number = 0 @check_answers_card_number = 0
@ -11,7 +10,6 @@ class Form::Lettings::Questions::TenancyLengthPeriodic < ::Form::Question
@min = 0 @min = 0
@step = 1 @step = 1
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @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 end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze

4
app/models/form/lettings/questions/tenancy_other.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::TenancyOther < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tenancyother" @id = "tenancyother"
@check_answer_label = "" @copy_key = "lettings.tenancy_information.tenancy.#{page.id}.tenancyother"
@header = "Please state the tenancy type"
@type = "text" @type = "text"
@check_answers_card_number = 0 @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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

2
app/models/form/lettings/questions/tenancy_start_date.rb

@ -2,8 +2,6 @@ class Form::Lettings::Questions::TenancyStartDate < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "startdate" @id = "startdate"
@check_answer_label = "Tenancy start date"
@header = "What is the tenancy start date?"
@type = "date" @type = "date"
@unresolved_hint_text = "Some scheme details have changed, and now this log needs updating. Check that the tenancy start date is correct." @unresolved_hint_text = "Some scheme details have changed, and now this log needs updating. Check that the tenancy start date is correct."
@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? @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?

4
app/models/form/lettings/questions/tenancy_type.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tenancy" @id = "tenancy"
@check_answer_label = "Type of main tenancy" @copy_key = "lettings.tenancy_information.tenancy.#{page.id}.tenancy"
@header = "What is the type of tenancy?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@conditional_for = { "tenancyother" => [3] } @conditional_for = { "tenancyother" => [3] }
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/lettings/questions/tenant_code.rb

@ -2,9 +2,6 @@ class Form::Lettings::Questions::TenantCode < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tenancycode" @id = "tenancycode"
@check_answer_label = "Tenant code"
@header = "What is the tenant code?"
@hint_text = "This is how you usually refer to this tenancy on your own systems."
@type = "text" @type = "text"
@width = 10 @width = 10
@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? @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?

3
app/models/form/lettings/questions/working_situation1.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::WorkingSituation1 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ecstat1" @id = "ecstat1"
@check_answer_label = "Lead tenant’s working situation"
@header = "Which of these best describes the lead tenant’s working situation?"
@type = "radio" @type = "radio"
@check_answers_card_number = 1 @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 @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

7
app/models/form/lettings/subsections/household_characteristics.rb

@ -35,7 +35,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonRelationshipToLead.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::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::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::PersonAge.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 2),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 2), person_index: 2),
@ -56,7 +55,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonRelationshipToLead.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::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::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::PersonAge.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 3),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 3), person_index: 3),
@ -77,7 +75,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonRelationshipToLead.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::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::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::PersonAge.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 4),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 4), person_index: 4),
@ -98,7 +95,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonRelationshipToLead.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::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::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::PersonAge.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 5),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 5), person_index: 5),
@ -119,7 +115,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonRelationshipToLead.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::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::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::PersonAge.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 6),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 6), person_index: 6),
@ -140,7 +135,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonRelationshipToLead.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::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::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::PersonAge.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 7),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 7), person_index: 7),
@ -161,7 +155,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::PersonRelationshipToLead.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::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::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::PersonAge.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 8),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 8), person_index: 8),

1
app/models/form/lettings/subsections/household_needs.rb

@ -2,6 +2,7 @@ class Form::Lettings::Subsections::HouseholdNeeds < ::Form::Subsection
def initialize(id, hsh, section) def initialize(id, hsh, section)
super super
@id = "household_needs" @id = "household_needs"
@copy_key = "lettings.household_needs.housingneeds_type"
@label = "Household needs" @label = "Household needs"
@depends_on = [{ "non_location_setup_questions_completed?" => true }] @depends_on = [{ "non_location_setup_questions_completed?" => true }]
end end

3
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::RentBiWeekly.new(nil, nil, self),
Form::Lettings::Pages::Rent4Weekly.new(nil, nil, self), Form::Lettings::Pages::Rent4Weekly.new(nil, nil, self),
Form::Lettings::Pages::RentMonthly.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::RentValueCheck.new("brent_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::SchargeValueCheck.new(nil, nil, self), Form::Lettings::Pages::SchargeValueCheck.new(nil, nil, self),
Form::Lettings::Pages::PschargeValueCheck.new(nil, nil, self), Form::Lettings::Pages::PschargeValueCheck.new(nil, nil, self),
Form::Lettings::Pages::SupchargValueCheck.new(nil, nil, self), Form::Lettings::Pages::SupchargValueCheck.new(nil, nil, self),

6
app/models/form/lettings/subsections/property_information.rb

@ -10,8 +10,7 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection
@pages ||= [ @pages ||= [
uprn_questions, uprn_questions,
Form::Lettings::Pages::PropertyLocalAuthority.new(nil, nil, self), 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::RentValueCheck.new("local_authority_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::FirstTimePropertyLetAsSocialHousing.new(nil, nil, self), Form::Lettings::Pages::FirstTimePropertyLetAsSocialHousing.new(nil, nil, self),
Form::Lettings::Pages::PropertyLetType.new(nil, nil, self), Form::Lettings::Pages::PropertyLetType.new(nil, nil, self),
Form::Lettings::Pages::PropertyVacancyReasonNotFirstLet.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::PropertyBuildingType.new(nil, nil, self),
Form::Lettings::Pages::PropertyWheelchairAccessible.new(nil, nil, self), Form::Lettings::Pages::PropertyWheelchairAccessible.new(nil, nil, self),
Form::Lettings::Pages::PropertyNumberOfBedrooms.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::RentValueCheck.new("beds_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::VoidDate.new(nil, nil, self), Form::Lettings::Pages::VoidDate.new(nil, nil, self),
Form::Lettings::Pages::VoidDateValueCheck.new(nil, nil, self), Form::Lettings::Pages::VoidDateValueCheck.new(nil, nil, self),
Form::Lettings::Pages::PropertyMajorRepairs.new(nil, nil, self), Form::Lettings::Pages::PropertyMajorRepairs.new(nil, nil, self),

5
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, "purchase_price_out_of_soft_range?" => true,
}, },
] ]
@copy_key = "sales.soft_validations.value_value_check"
@title_text = { @title_text = {
"translation" => "soft_validations.purchase_price.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "value", "key" => "value",
@ -17,7 +18,7 @@ class Form::Sales::Pages::AboutPriceValueCheck < ::Form::Page
], ],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.purchase_price.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [ "arguments" => [
{ {
"key" => "field_formatted_as_currency", "key" => "field_formatted_as_currency",

2
app/models/form/sales/pages/address.rb

@ -2,7 +2,7 @@ class Form::Sales::Pages::Address < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "address" @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 = [ @depends_on = [
{ "uprn_known" => nil }, { "uprn_known" => nil },
{ "uprn_known" => 0 }, { "uprn_known" => 0 },

2
app/models/form/sales/pages/address_fallback.rb

@ -2,7 +2,7 @@ class Form::Sales::Pages::AddressFallback < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "address" @id = "address"
@header = "Q12 - What is the property's address?" @copy_key = "sales.property_information.address"
@depends_on = [ @depends_on = [
{ "uprn_known" => nil, "uprn_selection" => "uprn_not_listed" }, { "uprn_known" => nil, "uprn_selection" => "uprn_not_listed" },
{ "uprn_known" => 0, "uprn_selection" => "uprn_not_listed" }, { "uprn_known" => 0, "uprn_selection" => "uprn_not_listed" },

2
app/models/form/sales/pages/address_matcher.rb

@ -2,7 +2,7 @@ class Form::Sales::Pages::AddressMatcher < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "address_matcher" @id = "address_matcher"
@header = "Find an address" @copy_key = "sales.property_information.address_matcher"
@depends_on = [ @depends_on = [
{ "uprn_known" => nil }, { "uprn_known" => nil },
{ "uprn_known" => 0 }, { "uprn_known" => 0 },

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save