Browse Source

Merge branch 'main' into CLDC-3689-Extract-lettings-household-validations

pull/2741/head
Manny Dinssa 8 months ago committed by GitHub
parent
commit
31c8abd209
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      app/constants/global_constants.rb
  2. 3
      app/helpers/formatting_helper.rb
  3. 1
      app/helpers/interruption_screen_helper.rb
  4. 2
      app/helpers/merge_requests_helper.rb
  5. 2
      app/models/bulk_upload.rb
  6. 2
      app/models/form/lettings/pages/address.rb
  7. 2
      app/models/form/lettings/pages/address_fallback.rb
  8. 2
      app/models/form/lettings/pages/address_matcher.rb
  9. 1
      app/models/form/lettings/pages/care_home_weekly.rb
  10. 2
      app/models/form/lettings/pages/income_amount.rb
  11. 1
      app/models/form/lettings/pages/income_known.rb
  12. 1
      app/models/form/lettings/pages/previous_housing_situation.rb
  13. 1
      app/models/form/lettings/pages/previous_housing_situation_renewal.rb
  14. 1
      app/models/form/lettings/pages/previous_local_authority.rb
  15. 1
      app/models/form/lettings/pages/previous_postcode.rb
  16. 1
      app/models/form/lettings/pages/property_major_repairs.rb
  17. 14
      app/models/form/lettings/pages/property_postcode.rb
  18. 1
      app/models/form/lettings/pages/reason_for_leaving_last_settled_home.rb
  19. 1
      app/models/form/lettings/pages/reason_for_leaving_last_settled_home_renewal.rb
  20. 1
      app/models/form/lettings/pages/referral.rb
  21. 1
      app/models/form/lettings/pages/referral_prp.rb
  22. 1
      app/models/form/lettings/pages/referral_supported_housing.rb
  23. 1
      app/models/form/lettings/pages/referral_supported_housing_prp.rb
  24. 2
      app/models/form/lettings/pages/rent_4_weekly.rb
  25. 2
      app/models/form/lettings/pages/rent_bi_weekly.rb
  26. 2
      app/models/form/lettings/pages/rent_monthly.rb
  27. 2
      app/models/form/lettings/pages/rent_weekly.rb
  28. 1
      app/models/form/lettings/pages/uprn.rb
  29. 1
      app/models/form/lettings/pages/uprn_selection.rb
  30. 1
      app/models/form/lettings/pages/void_date.rb
  31. 3
      app/models/form/lettings/questions/address_line1.rb
  32. 3
      app/models/form/lettings/questions/address_line1_for_address_matcher.rb
  33. 2
      app/models/form/lettings/questions/address_line2.rb
  34. 6
      app/models/form/lettings/questions/beds.rb
  35. 3
      app/models/form/lettings/questions/benefits.rb
  36. 4
      app/models/form/lettings/questions/brent_4_weekly.rb
  37. 4
      app/models/form/lettings/questions/brent_bi_weekly.rb
  38. 4
      app/models/form/lettings/questions/brent_monthly.rb
  39. 4
      app/models/form/lettings/questions/brent_weekly.rb
  40. 3
      app/models/form/lettings/questions/builtype.rb
  41. 4
      app/models/form/lettings/questions/chcharge_4_weekly.rb
  42. 4
      app/models/form/lettings/questions/chcharge_bi_weekly.rb
  43. 4
      app/models/form/lettings/questions/chcharge_monthly.rb
  44. 4
      app/models/form/lettings/questions/chcharge_weekly.rb
  45. 3
      app/models/form/lettings/questions/county.rb
  46. 2
      app/models/form/lettings/questions/declaration.rb
  47. 4
      app/models/form/lettings/questions/earnings.rb
  48. 3
      app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb
  49. 3
      app/models/form/lettings/questions/hb.rb
  50. 3
      app/models/form/lettings/questions/hbrentshortfall.rb
  51. 3
      app/models/form/lettings/questions/homeless.rb
  52. 3
      app/models/form/lettings/questions/household_charge.rb
  53. 4
      app/models/form/lettings/questions/incfreq.rb
  54. 4
      app/models/form/lettings/questions/is_carehome.rb
  55. 2
      app/models/form/lettings/questions/la.rb
  56. 3
      app/models/form/lettings/questions/layear.rb
  57. 3
      app/models/form/lettings/questions/letting_allocation.rb
  58. 4
      app/models/form/lettings/questions/majorrepairs.rb
  59. 3
      app/models/form/lettings/questions/mrcdate.rb
  60. 3
      app/models/form/lettings/questions/net_income_known.rb
  61. 2
      app/models/form/lettings/questions/offered.rb
  62. 3
      app/models/form/lettings/questions/period.rb
  63. 2
      app/models/form/lettings/questions/postcode_for_address_matcher.rb
  64. 3
      app/models/form/lettings/questions/postcode_for_full_address.rb
  65. 15
      app/models/form/lettings/questions/postcode_full.rb
  66. 17
      app/models/form/lettings/questions/postcode_known.rb
  67. 4
      app/models/form/lettings/questions/ppcodenk.rb
  68. 4
      app/models/form/lettings/questions/ppostcode_full.rb
  69. 4
      app/models/form/lettings/questions/previous_la_known.rb
  70. 3
      app/models/form/lettings/questions/previous_let_type.rb
  71. 4
      app/models/form/lettings/questions/previous_tenure.rb
  72. 5
      app/models/form/lettings/questions/previous_tenure_renewal.rb
  73. 4
      app/models/form/lettings/questions/prevloc.rb
  74. 4
      app/models/form/lettings/questions/pscharge_4_weekly.rb
  75. 4
      app/models/form/lettings/questions/pscharge_bi_weekly.rb
  76. 4
      app/models/form/lettings/questions/pscharge_monthly.rb
  77. 4
      app/models/form/lettings/questions/pscharge_weekly.rb
  78. 4
      app/models/form/lettings/questions/reason.rb
  79. 4
      app/models/form/lettings/questions/reason_renewal.rb
  80. 3
      app/models/form/lettings/questions/reasonable_preference_reason.rb
  81. 4
      app/models/form/lettings/questions/reasonother.rb
  82. 3
      app/models/form/lettings/questions/reasonpref.rb
  83. 4
      app/models/form/lettings/questions/referral.rb
  84. 4
      app/models/form/lettings/questions/referral_prp.rb
  85. 4
      app/models/form/lettings/questions/referral_supported_housing.rb
  86. 4
      app/models/form/lettings/questions/referral_supported_housing_prp.rb
  87. 2
      app/models/form/lettings/questions/rent_type.rb
  88. 3
      app/models/form/lettings/questions/rsnvac.rb
  89. 3
      app/models/form/lettings/questions/rsnvac_first_let.rb
  90. 4
      app/models/form/lettings/questions/scharge_4_weekly.rb
  91. 4
      app/models/form/lettings/questions/scharge_bi_weekly.rb
  92. 4
      app/models/form/lettings/questions/scharge_monthly.rb
  93. 4
      app/models/form/lettings/questions/scharge_weekly.rb
  94. 4
      app/models/form/lettings/questions/supcharg_4_weekly.rb
  95. 4
      app/models/form/lettings/questions/supcharg_bi_weekly.rb
  96. 4
      app/models/form/lettings/questions/supcharg_monthly.rb
  97. 4
      app/models/form/lettings/questions/supcharg_weekly.rb
  98. 4
      app/models/form/lettings/questions/tcharge_4_weekly.rb
  99. 4
      app/models/form/lettings/questions/tcharge_bi_weekly.rb
  100. 4
      app/models/form/lettings/questions/tcharge_monthly.rb
  101. Some files were not shown because too many files have changed in this diff Show More

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",

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

1
app/helpers/interruption_screen_helper.rb

@ -1,6 +1,7 @@
module InterruptionScreenHelper module InterruptionScreenHelper
def display_informative_text(informative_text, log) def display_informative_text(informative_text, log)
return informative_text if informative_text.is_a? String return informative_text if informative_text.is_a? String
return "" if informative_text.nil?
return "" unless informative_text["arguments"] return "" unless informative_text["arguments"]
translation_params = {} translation_params = {}

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/models/bulk_upload.rb

@ -32,6 +32,8 @@ class BulkUpload < ApplicationRecord
scope :filter_by_user, ->(user_id, _user = nil) { user_id.present? ? where(user_id:) : all } scope :filter_by_user, ->(user_id, _user = nil) { user_id.present? ? where(user_id:) : all }
scope :filter_by_uploading_organisation, ->(organisation_id, _user = nil) { where(organisation_id:) } scope :filter_by_uploading_organisation, ->(organisation_id, _user = nil) { where(organisation_id:) }
has_paper_trail
def completed? def completed?
incomplete_logs = logs.where.not(status: "completed") incomplete_logs = logs.where.not(status: "completed")
!incomplete_logs.exists? !incomplete_logs.exists?

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

@ -2,7 +2,7 @@ class Form::Lettings::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 = "lettings.property_information.address"
@depends_on = [ @depends_on = [
{ "is_supported_housing?" => false, "uprn_known" => nil }, { "is_supported_housing?" => false, "uprn_known" => nil },
{ "is_supported_housing?" => false, "uprn_known" => 0 }, { "is_supported_housing?" => false, "uprn_known" => 0 },

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

@ -2,7 +2,7 @@ class Form::Lettings::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 = "lettings.property_information.address"
@depends_on = [ @depends_on = [
{ "is_supported_housing?" => false, "uprn_known" => nil, "uprn_selection" => "uprn_not_listed" }, { "is_supported_housing?" => false, "uprn_known" => nil, "uprn_selection" => "uprn_not_listed" },
{ "is_supported_housing?" => false, "uprn_known" => 0, "uprn_selection" => "uprn_not_listed" }, { "is_supported_housing?" => false, "uprn_known" => 0, "uprn_selection" => "uprn_not_listed" },

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

@ -2,7 +2,7 @@ class Form::Lettings::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 = "lettings.property_information.address_matcher"
@depends_on = [ @depends_on = [
{ "is_supported_housing?" => false, "uprn_known" => nil }, { "is_supported_housing?" => false, "uprn_known" => nil },
{ "is_supported_housing?" => false, "uprn_known" => 0 }, { "is_supported_housing?" => false, "uprn_known" => 0 },

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::CareHomeWeekly < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "care_home_weekly" @id = "care_home_weekly"
@copy_key = "lettings.income_and_benefits.care_home"
@depends_on = [ @depends_on = [
{ "rent_and_charges_paid_weekly?" => true, "is_supported_housing?" => true, "household_charge" => 0 }, { "rent_and_charges_paid_weekly?" => true, "is_supported_housing?" => true, "household_charge" => 0 },
{ "rent_and_charges_paid_weekly?" => true, "is_supported_housing?" => true, "household_charge" => nil }, { "rent_and_charges_paid_weekly?" => true, "is_supported_housing?" => true, "household_charge" => nil },

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

@ -2,7 +2,7 @@ class Form::Lettings::Pages::IncomeAmount < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "income_amount" @id = "income_amount"
@header = "Total household income" @copy_key = "lettings.income_and_benefits.income_amount"
@depends_on = [{ "net_income_known" => 0 }] @depends_on = [{ "net_income_known" => 0 }]
end end

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

@ -2,7 +2,6 @@ class Form::Lettings::Pages::IncomeKnown < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "income_known" @id = "income_known"
@header = "Household’s combined income after tax"
end end
def questions def questions

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::PreviousHousingSituation < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "previous_housing_situation" @id = "previous_housing_situation"
@copy_key = "lettings.household_situation.prevten.not_renewal"
@depends_on = [{ "is_renewal?" => false }] @depends_on = [{ "is_renewal?" => false }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::PreviousHousingSituationRenewal < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "previous_housing_situation_renewal" @id = "previous_housing_situation_renewal"
@copy_key = "lettings.household_situation.prevten.renewal"
@depends_on = [{ "is_renewal?" => true, "is_supported_housing?" => true }] @depends_on = [{ "is_renewal?" => true, "is_supported_housing?" => true }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::PreviousLocalAuthority < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "previous_local_authority" @id = "previous_local_authority"
@copy_key = "lettings.household_situation.previous_local_authority"
@depends_on = [{ "is_previous_la_inferred" => false, "renewal" => 0 }] @depends_on = [{ "is_previous_la_inferred" => false, "renewal" => 0 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::PreviousPostcode < ::Form::Page
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@depends_on = [{ "renewal" => 0 }] @depends_on = [{ "renewal" => 0 }]
@copy_key = "lettings.household_situation.previous_postcode"
end end
def questions def questions

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::PropertyMajorRepairs < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "property_major_repairs" @id = "property_major_repairs"
@copy_key = "lettings.property_information.property_major_repairs"
@depends_on = [{ "is_renewal?" => false, "vacancy_reason_not_renewal_or_first_let?" => true }] @depends_on = [{ "is_renewal?" => false, "vacancy_reason_not_renewal_or_first_let?" => true }]
end end

14
app/models/form/lettings/pages/property_postcode.rb

@ -1,14 +0,0 @@
class Form::Lettings::Pages::PropertyPostcode < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_postcode"
@depends_on = [{ "is_general_needs?" => true }]
end
def questions
@questions ||= [
Form::Lettings::Questions::PostcodeKnown.new(nil, nil, self),
Form::Lettings::Questions::PostcodeFull.new(nil, nil, self),
]
end
end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReasonForLeavingLastSettledHome < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "reason_for_leaving_last_settled_home" @id = "reason_for_leaving_last_settled_home"
@copy_key = "lettings.household_situation.reason.reason_for_leaving_last_settled_home"
@depends_on = [{ "renewal" => 0 }] @depends_on = [{ "renewal" => 0 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReasonForLeavingLastSettledHomeRenewal < ::Form::Pa
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "reason_for_leaving_last_settled_home_renewal" @id = "reason_for_leaving_last_settled_home_renewal"
@copy_key = "lettings.household_situation.reason.reason_for_leaving_last_settled_home_renewal"
@depends_on = [{ "renewal" => 1 }] @depends_on = [{ "renewal" => 1 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::Referral < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "referral" @id = "referral"
@copy_key = "lettings.household_situation.referral.general_needs.la"
@depends_on = [{ "owning_organisation_provider_type" => "LA", "needstype" => 1, "renewal" => 0 }] @depends_on = [{ "owning_organisation_provider_type" => "LA", "needstype" => 1, "renewal" => 0 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReferralPrp < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "referral_prp" @id = "referral_prp"
@copy_key = "lettings.household_situation.referral.general_needs.prp"
@depends_on = [{ "owning_organisation_provider_type" => "PRP", "needstype" => 1, "renewal" => 0 }] @depends_on = [{ "owning_organisation_provider_type" => "PRP", "needstype" => 1, "renewal" => 0 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReferralSupportedHousing < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "referral_supported_housing" @id = "referral_supported_housing"
@copy_key = "lettings.household_situation.referral.supported_housing.la"
@depends_on = [{ "owning_organisation_provider_type" => "LA", "needstype" => 2, "renewal" => 0 }] @depends_on = [{ "owning_organisation_provider_type" => "LA", "needstype" => 2, "renewal" => 0 }]
end end

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

@ -2,6 +2,7 @@ class Form::Lettings::Pages::ReferralSupportedHousingPrp < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "referral_supported_housing_prp" @id = "referral_supported_housing_prp"
@copy_key = "lettings.household_situation.referral.supported_housing.prp"
@depends_on = [{ "owning_organisation_provider_type" => "PRP", "needstype" => 2, "renewal" => 0 }] @depends_on = [{ "owning_organisation_provider_type" => "PRP", "needstype" => 2, "renewal" => 0 }]
end end

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

@ -2,7 +2,7 @@ class Form::Lettings::Pages::Rent4Weekly < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "rent_4_weekly" @id = "rent_4_weekly"
@header = "Household rent and charges" @copy_key = "lettings.income_and_benefits.rent_and_charges"
@depends_on = [ @depends_on = [
{ "household_charge" => 0, "rent_and_charges_paid_every_4_weeks?" => true, "is_carehome?" => false }, { "household_charge" => 0, "rent_and_charges_paid_every_4_weeks?" => true, "is_carehome?" => false },
{ "household_charge" => nil, "rent_and_charges_paid_every_4_weeks?" => true, "is_carehome?" => false }, { "household_charge" => nil, "rent_and_charges_paid_every_4_weeks?" => true, "is_carehome?" => false },

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

@ -2,7 +2,7 @@ class Form::Lettings::Pages::RentBiWeekly < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "rent_bi_weekly" @id = "rent_bi_weekly"
@header = "Household rent and charges" @copy_key = "lettings.income_and_benefits.rent_and_charges"
@depends_on = [ @depends_on = [
{ "household_charge" => nil, "rent_and_charges_paid_every_2_weeks?" => true, "is_carehome?" => false }, { "household_charge" => nil, "rent_and_charges_paid_every_2_weeks?" => true, "is_carehome?" => false },
{ "household_charge" => 0, "rent_and_charges_paid_every_2_weeks?" => true, "is_carehome?" => false }, { "household_charge" => 0, "rent_and_charges_paid_every_2_weeks?" => true, "is_carehome?" => false },

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

@ -2,7 +2,7 @@ class Form::Lettings::Pages::RentMonthly < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "rent_monthly" @id = "rent_monthly"
@header = "Household rent and charges" @copy_key = "lettings.income_and_benefits.rent_and_charges"
@depends_on = [ @depends_on = [
{ "household_charge" => nil, "rent_and_charges_paid_monthly?" => true, "is_carehome?" => false }, { "household_charge" => nil, "rent_and_charges_paid_monthly?" => true, "is_carehome?" => false },
{ "household_charge" => 0, "rent_and_charges_paid_monthly?" => true, "is_carehome?" => false }, { "household_charge" => 0, "rent_and_charges_paid_monthly?" => true, "is_carehome?" => false },

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

@ -2,7 +2,7 @@ class Form::Lettings::Pages::RentWeekly < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "rent_weekly" @id = "rent_weekly"
@header = "Household rent and charges" @copy_key = "lettings.income_and_benefits.rent_and_charges"
@depends_on = [ @depends_on = [
{ "rent_and_charges_paid_weekly?" => true, "household_charge" => 0, "is_carehome?" => false }, { "rent_and_charges_paid_weekly?" => true, "household_charge" => 0, "is_carehome?" => false },
{ "rent_and_charges_paid_weekly?" => true, "household_charge" => nil, "is_carehome?" => false }, { "rent_and_charges_paid_weekly?" => true, "household_charge" => nil, "is_carehome?" => false },

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

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

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

@ -2,7 +2,6 @@ class Form::Lettings::Pages::UprnSelection < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "uprn_selection" @id = "uprn_selection"
@header = "We found some addresses that might be this property"
@depends_on = [ @depends_on = [
{ "is_supported_housing?" => false, "uprn_known" => nil, "address_options_present?" => true }, { "is_supported_housing?" => false, "uprn_known" => nil, "address_options_present?" => true },
{ "is_supported_housing?" => false, "uprn_known" => 0, "address_options_present?" => true }, { "is_supported_housing?" => false, "uprn_known" => 0, "address_options_present?" => true },

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

@ -2,7 +2,6 @@ class Form::Lettings::Pages::VoidDate < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "void_date" @id = "void_date"
@header = "Void date"
@depends_on = [{ "is_renewal?" => false }] @depends_on = [{ "is_renewal?" => false }]
end end

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

@ -2,11 +2,10 @@ class Form::Lettings::Questions::AddressLine1 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "address_line1" @id = "address_line1"
@header = "Address line 1" @copy_key = "lettings.property_information.address.address_line1"
@error_label = "Address line 1" @error_label = "Address line 1"
@type = "text" @type = "text"
@plain_label = true @plain_label = true
@check_answer_label = "Address lines 1 and 2"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hide_question_number_on_page = true @hide_question_number_on_page = true

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

@ -2,11 +2,10 @@ class Form::Lettings::Questions::AddressLine1ForAddressMatcher < ::Form::Questio
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "address_line1_input" @id = "address_line1_input"
@header = "Address line 1" @copy_key = "lettings.property_information.address_matcher.address_line1_input"
@error_label = "Address line 1" @error_label = "Address line 1"
@type = "text" @type = "text"
@plain_label = true @plain_label = true
@check_answer_label = "Find address"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true
@hide_question_number_on_page = true @hide_question_number_on_page = true
end end

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

@ -2,7 +2,7 @@ class Form::Lettings::Questions::AddressLine2 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "address_line2" @id = "address_line2"
@header = "Address line 2 (optional)" @copy_key = "lettings.property_information.address.address_line2"
@type = "text" @type = "text"
@plain_label = true @plain_label = true
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true

6
app/models/form/lettings/questions/beds.rb

@ -2,8 +2,6 @@ class Form::Lettings::Questions::Beds < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "beds" @id = "beds"
@check_answer_label = "Number of bedrooms"
@header = "How many bedrooms does the property have?"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@check_answers_card_number = 0 @check_answers_card_number = 0
@ -17,9 +15,5 @@ class Form::Lettings::Questions::Beds < ::Form::Question
log.is_bedsit? log.is_bedsit?
end end
def hint_text
form.start_year_after_2024? ? "If shared accommodation, enter the number of bedrooms occupied by this household." : "If shared accommodation, enter the number of bedrooms occupied by this household. A bedsit has 1 bedroom."
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 22 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 22 }.freeze
end end

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Benefits < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "benefits" @id = "benefits"
@check_answer_label = "Household income from Universal Credit, state pension or benefits"
@header = "How much of the household’s income is from Universal Credit, state pensions or benefits?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "This excludes child and housing benefit, council tax support and tax credits."
@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/brent_4_weekly.rb

@ -2,13 +2,11 @@ class Form::Lettings::Questions::Brent4Weekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "brent" @id = "brent"
@check_answer_label = "Basic rent" @copy_key = "lettings.income_and_benefits.rent_and_charges.brent"
@header = "What is the basic rent?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::BrentBiWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "brent" @id = "brent"
@check_answer_label = "Basic rent" @copy_key = "lettings.income_and_benefits.rent_and_charges.brent"
@header = "What is the basic rent?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::BrentMonthly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "brent" @id = "brent"
@check_answer_label = "Basic rent" @copy_key = "lettings.income_and_benefits.rent_and_charges.brent"
@header = "What is the basic rent?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::BrentWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "brent" @id = "brent"
@check_answer_label = "Basic rent" @copy_key = "lettings.income_and_benefits.rent_and_charges.brent"
@header = "What is the basic rent?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Builtype < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "builtype" @id = "builtype"
@check_answer_label = "Type of building"
@header = "What type of building is the property?"
@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/chcharge_4_weekly.rb

@ -2,12 +2,10 @@ class Form::Lettings::Questions::Chcharge4Weekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "chcharge" @id = "chcharge"
@check_answer_label = "Care home charges" @copy_key = "lettings.income_and_benefits.care_home.chcharge_4_weekly"
@header = "How much does the household pay every 4 weeks?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@step = 0.01 @step = 0.01
@prefix = "£" @prefix = "£"
@suffix = " every 4 weeks" @suffix = " every 4 weeks"

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

@ -2,12 +2,10 @@ class Form::Lettings::Questions::ChchargeBiWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "chcharge" @id = "chcharge"
@check_answer_label = "Care home charges" @copy_key = "lettings.income_and_benefits.care_home.chcharge_bi_weekly"
@header = "How much does the household pay every 2 weeks?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@step = 0.01 @step = 0.01
@prefix = "£" @prefix = "£"
@suffix = " every 2 weeks" @suffix = " every 2 weeks"

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

@ -2,12 +2,10 @@ class Form::Lettings::Questions::ChchargeMonthly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "chcharge" @id = "chcharge"
@check_answer_label = "Care home charges" @copy_key = "lettings.income_and_benefits.care_home.chcharge_monthly"
@header = "How much does the household pay every month?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@step = 0.01 @step = 0.01
@prefix = "£" @prefix = "£"
@suffix = " every month" @suffix = " every month"

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

@ -2,12 +2,10 @@ class Form::Lettings::Questions::ChchargeWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "chcharge" @id = "chcharge"
@check_answer_label = "Care home charges" @copy_key = "lettings.income_and_benefits.care_home.chcharge_weekly"
@header = "How much does the household pay every week?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@step = 0.01 @step = 0.01
@prefix = "£" @prefix = "£"
@suffix = " every week" @suffix = " every week"

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

@ -2,10 +2,9 @@ class Form::Lettings::Questions::County < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "county" @id = "county"
@header = "County (optional)" @copy_key = "lettings.property_information.address.county"
@type = "text" @type = "text"
@plain_label = true @plain_label = true
@check_answer_label = "County"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hide_question_number_on_page = true @hide_question_number_on_page = true

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

@ -4,7 +4,7 @@ class Form::Lettings::Questions::Declaration < ::Form::Question
@id = "declaration" @id = "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 = "privacy_notice_tenant"
@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/earnings.rb

@ -2,14 +2,12 @@ class Form::Lettings::Questions::Earnings < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "earnings" @id = "earnings"
@check_answer_label = "Total household income" @copy_key = "lettings.income_and_benefits.income_amount.earnings"
@header = "How much income does the household have in total?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@top_guidance_partial = "what_counts_as_income" @top_guidance_partial = "what_counts_as_income"
@hint_text = ""
@step = 0.01 @step = 0.01
@prefix = "£" @prefix = "£"
@suffix = [ @suffix = [

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing < ::Form::Q
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "first_time_property_let_as_social_housing" @id = "first_time_property_let_as_social_housing"
@check_answer_label = "First time being let as social-housing?"
@header = "Is this the first time the property has been let as social housing?"
@type = "radio" @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

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Hb < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "hb" @id = "hb"
@check_answer_label = "Housing-related benefits received"
@header = "Is the household likely to be receiving any of these housing-related benefits?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "This is about when the tenant is in their new let. If they are unsure about the situation for their new let and their financial and working situation hasn’t changed significantly, answer based on what housing-related benefits they currently receive." : ""
@answer_options = ANSWER_OPTIONS @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/hbrentshortfall.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Hbrentshortfall < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "hbrentshortfall" @id = "hbrentshortfall"
@check_answer_label = "Any outstanding amount for basic rent and charges"
@header = "After the household has received any housing-related benefits, will they still need to pay for rent and charges?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "Also known as the ‘outstanding amount’."
@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/homeless.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Homeless < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "homeless" @id = "homeless"
@check_answer_label = "Household homeless immediately before letting"
@header = "Did the household experience homelessness immediately before this letting?"
@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/household_charge.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::HouseholdCharge < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "household_charge" @id = "household_charge"
@check_answer_label = "Does the household pay rent or charges?"
@header = "Does the household pay rent or other charges for the accommodation?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "If rent is charged on the property then answer Yes to this question, even if the tenants do not pay it themselves."
@answer_options = ANSWER_OPTIONS @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/incfreq.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Incfreq < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "incfreq" @id = "incfreq"
@check_answer_label = "How often does the household receive this amount?" @copy_key = "lettings.income_and_benefits.income_amount.incfreq"
@header = "How often does the household receive this amount?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hidden_in_check_answers = true @hidden_in_check_answers = true
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::IsCarehome < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "is_carehome" @id = "is_carehome"
@check_answer_label = "Care home accommodation" @copy_key = "lettings.income_and_benefits.care_home.is_carehome"
@header = "Is this accommodation a care home?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@conditional_for = { "chcharge" => [1] } @conditional_for = { "chcharge" => [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

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

@ -2,8 +2,6 @@ class Form::Lettings::Questions::La < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "la" @id = "la"
@check_answer_label = "Local Authority"
@header = "What is the property’s local authority?"
@type = "select" @type = "select"
@check_answers_card_number = nil @check_answers_card_number = nil
@hint_text = "" @hint_text = ""

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Layear < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "layear" @id = "layear"
@check_answer_label = "Length of time in local authority area"
@header = "How long has the household continuously lived in the local authority area of the new letting?"
@type = "radio" @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

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::LettingAllocation < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "letting_allocation" @id = "letting_allocation"
@check_answer_label = "Allocation system"
@header = "How was this letting allocated?"
@type = "checkbox" @type = "checkbox"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "Select all that apply."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @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/majorrepairs.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Majorrepairs < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "majorrepairs" @id = "majorrepairs"
@check_answer_label = "Major repairs carried out during void period" @copy_key = "lettings.property_information.property_major_repairs.majorrepairs"
@header = "Were any major repairs carried out during the void period?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "Major repairs are works that could not be reasonably carried out with a tenant living at the property. For example, structural repairs."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@conditional_for = { "mrcdate" => [1] } @conditional_for = { "mrcdate" => [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]

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

@ -2,8 +2,7 @@ class Form::Lettings::Questions::Mrcdate < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "mrcdate" @id = "mrcdate"
@check_answer_label = "Completion date of repairs" @copy_key = "lettings.property_information.property_major_repairs.mrcdate"
@header = "When were the repairs completed?"
@type = "date" @type = "date"
@check_answers_card_number = 0 @check_answers_card_number = 0
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

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

@ -2,12 +2,9 @@ class Form::Lettings::Questions::NetIncomeKnown < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "net_income_known" @id = "net_income_known"
@check_answer_label = "Do you know the household’s combined total income after tax?"
@header = "Do you know the household’s combined income after tax?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@top_guidance_partial = "what_counts_as_income" @top_guidance_partial = "what_counts_as_income"
@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

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

@ -2,8 +2,6 @@ class Form::Lettings::Questions::Offered < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "offered" @id = "offered"
@check_answer_label = I18n.t("check_answer_labels.offered")
@header = I18n.t("questions.offered")
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@check_answers_card_number = 0 @check_answers_card_number = 0

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Period < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "period" @id = "period"
@check_answer_label = "Frequency of household rent and charges"
@header = "How often does the household pay rent and other charges?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "Select how often the household is charged. This may be different to how often they pay."
@answer_options = ANSWER_OPTIONS @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/postcode_for_address_matcher.rb

@ -2,7 +2,7 @@ class Form::Lettings::Questions::PostcodeForAddressMatcher < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "postcode_full_input" @id = "postcode_full_input"
@header = "Postcode" @copy_key = "lettings.property_information.address_matcher.postcode_full_input"
@type = "text" @type = "text"
@width = 5 @width = 5
@plain_label = true @plain_label = true

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

@ -2,7 +2,7 @@ class Form::Lettings::Questions::PostcodeForFullAddress < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "postcode_full" @id = "postcode_full"
@header = "Postcode" @copy_key = "lettings.property_information.address.postcode_full"
@type = "text" @type = "text"
@width = 5 @width = 5
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
@ -17,7 +17,6 @@ class Form::Lettings::Questions::PostcodeForFullAddress < ::Form::Question
}, },
} }
@plain_label = true @plain_label = true
@check_answer_label = "Postcode"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hide_question_number_on_page = true @hide_question_number_on_page = true

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

@ -1,15 +0,0 @@
class Form::Lettings::Questions::PostcodeFull < ::Form::Question
def initialize(id, hsh, page)
super
@id = "postcode_full"
@check_answer_label = "Postcode"
@header = "What is the property’s postcode?"
@type = "text"
@width = 5
@inferred_check_answers_value = [{ "condition" => { "postcode_known" => 0 }, "value" => "Not known" }]
@check_answers_card_number = 0
@hint_text = ""
@inferred_answers = { "la" => { "is_la_inferred" => true } }
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
end
end

17
app/models/form/lettings/questions/postcode_known.rb

@ -1,17 +0,0 @@
class Form::Lettings::Questions::PostcodeKnown < ::Form::Question
def initialize(id, hsh, page)
super
@id = "postcode_known"
@check_answer_label = "Do you know the property postcode?"
@header = "Do you know the property’s postcode?"
@type = "radio"
@check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
@conditional_for = { "postcode_full" => [1] }
@hidden_in_check_answers = { "depends_on" => [{ "postcode_known" => 0 }, { "postcode_known" => 1 }] }
end
ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "0" => { "value" => "No" } }.freeze
end

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Ppcodenk < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ppcodenk" @id = "ppcodenk"
@check_answer_label = "" @copy_key = "lettings.household_situation.previous_postcode.ppcodenk"
@header = "Do you know the postcode of the household’s last settled accommodation?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless." : "This is also known as the household’s ‘last settled home’."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@conditional_for = { "ppostcode_full" => [0] } @conditional_for = { "ppostcode_full" => [0] }
@hidden_in_check_answers = { "depends_on" => [{ "ppcodenk" => 0 }, { "ppcodenk" => 1 }] } @hidden_in_check_answers = { "depends_on" => [{ "ppcodenk" => 0 }, { "ppcodenk" => 1 }] }

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

@ -2,8 +2,7 @@ class Form::Lettings::Questions::PpostcodeFull < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ppostcode_full" @id = "ppostcode_full"
@check_answer_label = "Postcode of household’s last settled accommodation" @copy_key = "lettings.household_situation.previous_postcode.ppostcode_full"
@header = "Postcode for the previous accommodation"
@type = "text" @type = "text"
@width = 5 @width = 5
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
@ -13,7 +12,6 @@ class Form::Lettings::Questions::PpostcodeFull < ::Form::Question
"value" => "Not known", "value" => "Not known",
}] }]
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = ""
@inferred_answers = { "prevloc" => { "is_previous_la_inferred" => true } } @inferred_answers = { "prevloc" => { "is_previous_la_inferred" => true } }
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::PreviousLaKnown < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "previous_la_known" @id = "previous_la_known"
@check_answer_label = "Do you know the local authority of the household’s last settled accommodation?" @copy_key = "lettings.household_situation.previous_local_authority.previous_la_known"
@header = "Do you know the local authority of the household’s last settled accommodation?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless." : "This is also known as the household’s ‘last settled home’."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@conditional_for = { "prevloc" => [1] } @conditional_for = { "prevloc" => [1] }
@hidden_in_check_answers = { "depends_on" => [{ "previous_la_known" => 0 }, { "previous_la_known" => 1 }] } @hidden_in_check_answers = { "depends_on" => [{ "previous_la_known" => 0 }, { "previous_la_known" => 1 }] }

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::PreviousLetType < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "unitletas" @id = "unitletas"
@check_answer_label = "Most recent let type"
@header = "What type was the property most recently let as?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "This is the rent type of the previous tenancy in this property." : ""
@answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_AFTER_2024 : ANSWER_OPTIONS @answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_AFTER_2024 : ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @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/previous_tenure.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::PreviousTenure < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "prevten" @id = "prevten"
@check_answer_label = "Where was the household immediately before this letting?" @copy_key = "lettings.household_situation.prevten.not_renewal"
@header = "Where was the household immediately before this letting?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "This is where the household was the night before they moved into this new let."
@answer_options = ANSWER_OPTIONS @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

5
app/models/form/lettings/questions/previous_tenure_renewal.rb

@ -2,12 +2,9 @@ class Form::Lettings::Questions::PreviousTenureRenewal < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "prevten" @id = "prevten"
@check_answer_label = "Where was the household immediately before this letting?" @copy_key = "lettings.household_situation.prevten.renewal"
@header = "Where was the household immediately before this letting?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "You told us this letting is a renewal. We have removed some options because of this.<br><br>
This is where the household was the night before they moved into this new let."
@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/prevloc.rb

@ -2,12 +2,10 @@ class Form::Lettings::Questions::Prevloc < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "prevloc" @id = "prevloc"
@check_answer_label = "Location of household’s last settled accommodation" @copy_key = "lettings.household_situation.previous_local_authority.prevloc"
@header = "Select a local authority"
@type = "select" @type = "select"
@inferred_check_answers_value = [{ "condition" => { "previous_la_known" => 0 }, "value" => "Not known" }] @inferred_check_answers_value = [{ "condition" => { "previous_la_known" => 0 }, "value" => "Not known" }]
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "Select ‘Northern Ireland’, ‘Scotland’, ‘Wales’ or ‘Outside the UK’ if the household’s last settled home was outside England."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true
end end

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::Pscharge4Weekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "pscharge" @id = "pscharge"
@check_answer_label = "Personal service charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.pscharge"
@header = "What is the personal service charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::PschargeBiWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "pscharge" @id = "pscharge"
@check_answer_label = "Personal service charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.pscharge"
@header = "What is the personal service charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::PschargeMonthly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "pscharge" @id = "pscharge"
@check_answer_label = "Personal service charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.pscharge"
@header = "What is the personal service charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::PschargeWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "pscharge" @id = "pscharge"
@check_answer_label = "Personal service charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.pscharge"
@header = "What is the personal service charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Reason < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "reason" @id = "reason"
@check_answer_label = "Reason for leaving last settled home" @copy_key = "lettings.household_situation.reason.#{page.id}.reason"
@header = "What is the tenant’s main reason for the household leaving their last settled home?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living previously." : "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation or sleeping rough, their last settled home is where they were living previously."
@conditional_for = { @conditional_for = {
"reasonother" => [ "reasonother" => [
20, 20,

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::ReasonRenewal < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "reason" @id = "reason"
@check_answer_label = "Reason for leaving last settled home"
@header = "What is the tenant’s main reason for the household leaving their last settled home?"
@type = "radio" @type = "radio"
@copy_key = "lettings.household_situation.reason.#{page.id}.reason"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "You told us this letting is a renewal. We have removed some options because of this."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@conditional_for = { @conditional_for = {
"reasonother" => [ "reasonother" => [

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::ReasonablePreferenceReason < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "reasonable_preference_reason" @id = "reasonable_preference_reason"
@check_answer_label = "Reason for reasonable preference"
@header = "Why was the household given ‘reasonable preference’?"
@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

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

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Reasonother < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "reasonother" @id = "reasonother"
@check_answer_label = "" @copy_key = "lettings.household_situation.reason.#{@page.id}.reasonother"
@header = "What is the reason?"
@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

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Reasonpref < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "reasonpref" @id = "reasonpref"
@check_answer_label = "Household given reasonable preference"
@header = "Was the household given ‘reasonable preference’ by the local authority?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "Households may be given ‘reasonable preference’ for social housing under one or more specific categories by the local authority. This is also known as ‘priority need’." : "Households may be given ‘reasonable preference’ for social housing, also known as ‘priority need’, by the local authority."
@answer_options = ANSWER_OPTIONS @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/referral.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::Referral < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "referral" @id = "referral"
@check_answer_label = "Source of referral for letting" @copy_key = "lettings.household_situation.referral.general_needs.la"
@header = "What was the source of referral for this letting?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "You told us that you are a local authority and that the needs type is general needs. We have removed some options because of this."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @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/referral_prp.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::ReferralPrp < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "referral" @id = "referral"
@check_answer_label = "Source of referral for letting" @copy_key = "lettings.household_situation.referral.general_needs.prp"
@header = "What was the source of referral for this letting?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "You told us that the needs type is general needs. We have removed some options because of this."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @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/referral_supported_housing.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::ReferralSupportedHousing < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "referral" @id = "referral"
@check_answer_label = "Source of referral for letting" @copy_key = "lettings.household_situation.referral.supported_housing.la"
@header = "What was the source of referral for this letting?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = "You told us that you are a local authority. We have removed some options because of this."
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @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/referral_supported_housing_prp.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::ReferralSupportedHousingPrp < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "referral" @id = "referral"
@check_answer_label = "Source of referral for letting" @copy_key = "lettings.household_situation.referral.supported_housing.prp"
@header = "What was the source of referral for this letting?"
@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

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

@ -4,7 +4,7 @@ class Form::Lettings::Questions::RentType < ::Form::Question
@id = "rent_type" @id = "rent_type"
@copy_key = "lettings.setup.rent_type.rent_type" @copy_key = "lettings.setup.rent_type.rent_type"
@type = "radio" @type = "radio"
@top_guidance_partial = form.start_year_after_2024? ? "rent_type_definitions_2024" : "rent_type_definitions" @top_guidance_partial = "rent_type_definitions"
@answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_2024 : ANSWER_OPTIONS @answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_2024 : ANSWER_OPTIONS
@conditional_for = { "irproduct_other" => [5] } @conditional_for = { "irproduct_other" => [5] }
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? @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/rsnvac.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Rsnvac < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "rsnvac" @id = "rsnvac"
@check_answer_label = "Vacancy reason"
@header = "What is the reason for the property being vacant?"
@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

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

@ -2,11 +2,8 @@ class Form::Lettings::Questions::RsnvacFirstLet < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "rsnvac" @id = "rsnvac"
@check_answer_label = "Vacancy reason"
@header = "What is the reason for the property being vacant?"
@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/scharge_4_weekly.rb

@ -2,13 +2,11 @@ class Form::Lettings::Questions::Scharge4Weekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "scharge" @id = "scharge"
@check_answer_label = "Service charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.scharge"
@header = "What is the service charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::SchargeBiWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "scharge" @id = "scharge"
@check_answer_label = "Service charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.scharge"
@header = "What is the service charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::SchargeMonthly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "scharge" @id = "scharge"
@check_answer_label = "Service charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.scharge"
@header = "What is the service charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::SchargeWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "scharge" @id = "scharge"
@check_answer_label = "Service charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.scharge"
@header = "What is the service charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::Supcharg4Weekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "supcharg" @id = "supcharg"
@check_answer_label = "Support charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.supcharg"
@header = "What is the support charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "Any charges made to fund support services included in tenancy agreement."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::SupchargBiWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "supcharg" @id = "supcharg"
@check_answer_label = "Support charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.supcharg"
@header = "What is the support charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "Any charges made to fund support services included in tenancy agreement."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::SupchargMonthly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "supcharg" @id = "supcharg"
@check_answer_label = "Support charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.supcharg"
@header = "What is the support charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "Any charges made to fund support services included in tenancy agreement."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::SupchargWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "supcharg" @id = "supcharg"
@check_answer_label = "Support charge" @copy_key = "lettings.income_and_benefits.rent_and_charges.supcharg"
@header = "What is the support charge?"
@type = "numeric" @type = "numeric"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "Any charges made to fund support services included in tenancy agreement."
@step = 0.01 @step = 0.01
@fields_to_add = %w[brent scharge pscharge supcharg] @fields_to_add = %w[brent scharge pscharge supcharg]
@result_field = "tcharge" @result_field = "tcharge"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::Tcharge4Weekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tcharge" @id = "tcharge"
@check_answer_label = "Household rent and charges" @copy_key = "lettings.income_and_benefits.rent_and_charges.tcharge"
@header = "Total charge"
@type = "numeric_output" @type = "numeric_output"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "This is the total for rent and all charges."
@step = 0.01 @step = 0.01
@readonly = true @readonly = true
@prefix = "£" @prefix = "£"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::TchargeBiWeekly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tcharge" @id = "tcharge"
@check_answer_label = "Household rent and charges" @copy_key = "lettings.income_and_benefits.rent_and_charges.tcharge"
@header = "Total charge"
@type = "numeric_output" @type = "numeric_output"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "This is the total for rent and all charges."
@step = 0.01 @step = 0.01
@readonly = true @readonly = true
@prefix = "£" @prefix = "£"

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

@ -2,13 +2,11 @@ class Form::Lettings::Questions::TchargeMonthly < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "tcharge" @id = "tcharge"
@check_answer_label = "Household rent and charges" @copy_key = "lettings.income_and_benefits.rent_and_charges.tcharge"
@header = "Total charge"
@type = "numeric_output" @type = "numeric_output"
@width = 5 @width = 5
@check_answers_card_number = 0 @check_answers_card_number = 0
@min = 0 @min = 0
@hint_text = "This is the total for rent and all charges."
@step = 0.01 @step = 0.01
@readonly = true @readonly = true
@prefix = "£" @prefix = "£"

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

Loading…
Cancel
Save