Browse Source

Merge branch 'main' into CLDC-3691-Copy-changes-lettings-setup-validations

pull/2739/head
Manny Dinssa 8 months ago committed by GitHub
parent
commit
1a0d0f0149
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. 2
      app/helpers/merge_requests_helper.rb
  4. 2
      app/models/form/lettings/pages/address.rb
  5. 2
      app/models/form/lettings/pages/address_fallback.rb
  6. 2
      app/models/form/lettings/pages/address_matcher.rb
  7. 24
      app/models/form/lettings/pages/max_rent_value_check.rb
  8. 24
      app/models/form/lettings/pages/min_rent_value_check.rb
  9. 1
      app/models/form/lettings/pages/property_major_repairs.rb
  10. 14
      app/models/form/lettings/pages/property_postcode.rb
  11. 35
      app/models/form/lettings/pages/rent_value_check.rb
  12. 1
      app/models/form/lettings/pages/starter_tenancy_type.rb
  13. 1
      app/models/form/lettings/pages/tenancy_length.rb
  14. 1
      app/models/form/lettings/pages/tenancy_length_affordable_rent.rb
  15. 1
      app/models/form/lettings/pages/tenancy_length_intermediate_rent.rb
  16. 1
      app/models/form/lettings/pages/tenancy_length_periodic.rb
  17. 1
      app/models/form/lettings/pages/tenancy_type.rb
  18. 1
      app/models/form/lettings/pages/uprn.rb
  19. 1
      app/models/form/lettings/pages/uprn_selection.rb
  20. 1
      app/models/form/lettings/pages/void_date.rb
  21. 3
      app/models/form/lettings/questions/address_line1.rb
  22. 3
      app/models/form/lettings/questions/address_line1_for_address_matcher.rb
  23. 2
      app/models/form/lettings/questions/address_line2.rb
  24. 6
      app/models/form/lettings/questions/beds.rb
  25. 3
      app/models/form/lettings/questions/builtype.rb
  26. 3
      app/models/form/lettings/questions/county.rb
  27. 3
      app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb
  28. 3
      app/models/form/lettings/questions/joint.rb
  29. 2
      app/models/form/lettings/questions/la.rb
  30. 4
      app/models/form/lettings/questions/majorrepairs.rb
  31. 15
      app/models/form/lettings/questions/max_rent_value_check.rb
  32. 3
      app/models/form/lettings/questions/mrcdate.rb
  33. 2
      app/models/form/lettings/questions/offered.rb
  34. 2
      app/models/form/lettings/questions/postcode_for_address_matcher.rb
  35. 3
      app/models/form/lettings/questions/postcode_for_full_address.rb
  36. 15
      app/models/form/lettings/questions/postcode_full.rb
  37. 17
      app/models/form/lettings/questions/postcode_known.rb
  38. 3
      app/models/form/lettings/questions/previous_let_type.rb
  39. 4
      app/models/form/lettings/questions/rent_value_check.rb
  40. 3
      app/models/form/lettings/questions/rsnvac.rb
  41. 3
      app/models/form/lettings/questions/rsnvac_first_let.rb
  42. 3
      app/models/form/lettings/questions/sheltered.rb
  43. 4
      app/models/form/lettings/questions/starter_tenancy_type.rb
  44. 11
      app/models/form/lettings/questions/startertenancy.rb
  45. 4
      app/models/form/lettings/questions/tenancy_length.rb
  46. 11
      app/models/form/lettings/questions/tenancy_length_affordable_rent.rb
  47. 11
      app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb
  48. 4
      app/models/form/lettings/questions/tenancy_length_periodic.rb
  49. 4
      app/models/form/lettings/questions/tenancy_other.rb
  50. 4
      app/models/form/lettings/questions/tenancy_type.rb
  51. 3
      app/models/form/lettings/questions/town_or_city.rb
  52. 3
      app/models/form/lettings/questions/unittype_gn.rb
  53. 3
      app/models/form/lettings/questions/uprn.rb
  54. 6
      app/models/form/lettings/questions/uprn_known.rb
  55. 2
      app/models/form/lettings/questions/uprn_selection.rb
  56. 2
      app/models/form/lettings/questions/voiddate.rb
  57. 3
      app/models/form/lettings/questions/wheelchair.rb
  58. 3
      app/models/form/lettings/subsections/income_and_benefits.rb
  59. 14
      app/models/form/lettings/subsections/property_information.rb
  60. 5
      app/models/form/sales/pages/about_price_value_check.rb
  61. 2
      app/models/form/sales/pages/address.rb
  62. 2
      app/models/form/sales/pages/address_fallback.rb
  63. 2
      app/models/form/sales/pages/address_matcher.rb
  64. 1
      app/models/form/sales/pages/last_accommodation.rb
  65. 1
      app/models/form/sales/pages/last_accommodation_la.rb
  66. 5
      app/models/form/sales/pages/monthly_charges_value_check.rb
  67. 5
      app/models/form/sales/pages/no_address_found.rb
  68. 7
      app/models/form/sales/pages/percentage_discount_value_check.rb
  69. 13
      app/models/form/sales/pages/postcode.rb
  70. 9
      app/models/form/sales/pages/property_local_authority.rb
  71. 1
      app/models/form/sales/pages/uprn.rb
  72. 1
      app/models/form/sales/pages/uprn_confirmation.rb
  73. 1
      app/models/form/sales/pages/uprn_selection.rb
  74. 3
      app/models/form/sales/questions/about_price_value_check.rb
  75. 3
      app/models/form/sales/questions/address_line1.rb
  76. 3
      app/models/form/sales/questions/address_line1_for_address_matcher.rb
  77. 2
      app/models/form/sales/questions/address_line2.rb
  78. 2
      app/models/form/sales/questions/buyer1_previous_tenure.rb
  79. 3
      app/models/form/sales/questions/buyer2_living_in.rb
  80. 7
      app/models/form/sales/questions/buyers_organisations.rb
  81. 3
      app/models/form/sales/questions/county.rb
  82. 3
      app/models/form/sales/questions/monthly_charges_value_check.rb
  83. 2
      app/models/form/sales/questions/no_address_found.rb
  84. 3
      app/models/form/sales/questions/percentage_discount_value_check.rb
  85. 22
      app/models/form/sales/questions/postcode.rb
  86. 2
      app/models/form/sales/questions/postcode_for_address_matcher.rb
  87. 3
      app/models/form/sales/questions/postcode_for_full_address.rb
  88. 29
      app/models/form/sales/questions/postcode_known.rb
  89. 4
      app/models/form/sales/questions/previous_la_known.rb
  90. 3
      app/models/form/sales/questions/previous_postcode.rb
  91. 4
      app/models/form/sales/questions/previous_postcode_known.rb
  92. 3
      app/models/form/sales/questions/previous_tenure_buyer2.rb
  93. 3
      app/models/form/sales/questions/prevloc.rb
  94. 3
      app/models/form/sales/questions/property_building_type.rb
  95. 2
      app/models/form/sales/questions/property_local_authority.rb
  96. 26
      app/models/form/sales/questions/property_local_authority_known.rb
  97. 4
      app/models/form/sales/questions/property_number_of_bedrooms.rb
  98. 3
      app/models/form/sales/questions/property_unit_type.rb
  99. 4
      app/models/form/sales/questions/property_wheelchair_accessible.rb
  100. 3
      app/models/form/sales/questions/town_or_city.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

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/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 },

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

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

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

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

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

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

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

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]

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/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]

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

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

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

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

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

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/town_or_city.rb

@ -2,10 +2,9 @@ class Form::Lettings::Questions::TownOrCity < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "town_or_city" @id = "town_or_city"
@header = "Town or city" @copy_key = "lettings.property_information.address.town_or_city"
@type = "text" @type = "text"
@plain_label = true @plain_label = true
@check_answer_label = "Town or city"
@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/unittype_gn.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::UnittypeGn < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "unittype_gn" @id = "unittype_gn"
@check_answer_label = "Type of unit"
@header = "What type of unit 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

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

@ -2,8 +2,7 @@ class Form::Lettings::Questions::Uprn < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "uprn" @id = "uprn"
@check_answer_label = "UPRN" @copy_key = "lettings.property_information.uprn.uprn"
@header = "What is the property's UPRN?"
@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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

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

@ -2,13 +2,9 @@ class Form::Lettings::Questions::UprnKnown < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "uprn_known" @id = "uprn_known"
@check_answer_label = "UPRN known?" @copy_key = "lettings.property_information.uprn.uprn_known"
@header = "Do you know the property's UPRN?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.<br><br>
The UPRN may not be the same as the property reference assigned by your organisation.<br><br>
If you dont know the UPRN you can enter the address of the property instead on the next screen."
@conditional_for = { "uprn" => [1] } @conditional_for = { "uprn" => [1] }
@inferred_check_answers_value = [ @inferred_check_answers_value = [
{ {

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

@ -2,9 +2,7 @@ class Form::Lettings::Questions::UprnSelection < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "uprn_selection" @id = "uprn_selection"
@header = "Select the correct address"
@type = "radio" @type = "radio"
@check_answer_label = "Select the correct address"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true
end end

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

@ -2,8 +2,6 @@ class Form::Lettings::Questions::Voiddate < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "voiddate" @id = "voiddate"
@check_answer_label = "Void date"
@header = "What is the void date?"
@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/wheelchair.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Wheelchair < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "wchair" @id = "wchair"
@check_answer_label = "Property built or adapted to wheelchair-user standards"
@header = "Is the property built or adapted to wheelchair-user standards?"
@type = "radio" @type = "radio"
@check_answers_card_number = 0 @check_answers_card_number = 0
@hint_text = form.start_year_after_2024? ? "This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property." : ""
@answer_options = ANSWER_OPTIONS @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/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),

14
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),
@ -36,20 +34,16 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection
Form::Lettings::Pages::Uprn.new(nil, nil, self), Form::Lettings::Pages::Uprn.new(nil, nil, self),
Form::Lettings::Pages::UprnConfirmation.new(nil, nil, self), Form::Lettings::Pages::UprnConfirmation.new(nil, nil, self),
Form::Lettings::Pages::AddressMatcher.new(nil, nil, self), Form::Lettings::Pages::AddressMatcher.new(nil, nil, self),
Form::Lettings::Pages::NoAddressFound.new(nil, nil, self), Form::Lettings::Pages::NoAddressFound.new(nil, nil, self), # soft validation
Form::Lettings::Pages::UprnSelection.new(nil, nil, self), Form::Lettings::Pages::UprnSelection.new(nil, nil, self),
Form::Lettings::Pages::AddressFallback.new(nil, nil, self), Form::Lettings::Pages::AddressFallback.new(nil, nil, self),
] ]
elsif form.start_date.year == 2023 else
[ [
Form::Lettings::Pages::Uprn.new(nil, nil, self), Form::Lettings::Pages::Uprn.new(nil, nil, self),
Form::Lettings::Pages::UprnConfirmation.new(nil, nil, self), Form::Lettings::Pages::UprnConfirmation.new(nil, nil, self),
Form::Lettings::Pages::Address.new(nil, nil, self), Form::Lettings::Pages::Address.new(nil, nil, self),
] ]
else
[
Form::Lettings::Pages::PropertyPostcode.new(nil, nil, self),
]
end end
end end

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

1
app/models/form/sales/pages/last_accommodation.rb

@ -2,6 +2,7 @@ class Form::Sales::Pages::LastAccommodation < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "last_accommodation" @id = "last_accommodation"
@copy_key = "sales.household_situation.last_accommodation"
end end
def questions def questions

1
app/models/form/sales/pages/last_accommodation_la.rb

@ -2,6 +2,7 @@ class Form::Sales::Pages::LastAccommodationLa < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "last_accommodation_la" @id = "last_accommodation_la"
@copy_key = "sales.household_situation.last_accommodation_la"
@depends_on = [{ @depends_on = [{
"is_previous_la_inferred" => false, "is_previous_la_inferred" => false,
}] }]

5
app/models/form/sales/pages/monthly_charges_value_check.rb

@ -6,8 +6,9 @@ class Form::Sales::Pages::MonthlyChargesValueCheck < ::Form::Page
"monthly_charges_over_soft_max?" => true, "monthly_charges_over_soft_max?" => true,
}, },
] ]
@copy_key = "sales.soft_validations.monthly_charges_value_check"
@title_text = { @title_text = {
"translation" => "soft_validations.monthly_charges_over_soft_max.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [ "arguments" => [
{ {
"key" => "field_formatted_as_currency", "key" => "field_formatted_as_currency",
@ -17,7 +18,7 @@ class Form::Sales::Pages::MonthlyChargesValueCheck < ::Form::Page
], ],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.monthly_charges_over_soft_max.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
end end

5
app/models/form/sales/pages/no_address_found.rb

@ -3,12 +3,13 @@ class Form::Sales::Pages::NoAddressFound < ::Form::Page
super super
@id = "no_address_found" @id = "no_address_found"
@type = "interruption_screen" @type = "interruption_screen"
@copy_key = "sales.soft_validations.address_search_value_check"
@title_text = { @title_text = {
"translation" => "soft_validations.no_address_found.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [], "arguments" => [],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.no_address_found.informative_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
@depends_on = [ @depends_on = [

7
app/models/form/sales/pages/percentage_discount_value_check.rb

@ -1,15 +1,16 @@
class Form::Sales::Pages::PercentageDiscountValueCheck < ::Form::Page class Form::Sales::Pages::PercentageDiscountValueCheck < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@depends_on = [{ "percentage_discount_invalid?" => true }]
@copy_key = "sales.soft_validations.percentage_discount_value_check"
@title_text = { @title_text = {
"translation" => "soft_validations.percentage_discount_value.title_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [{ "key" => "discount", "label" => true, "i18n_template" => "discount" }], "arguments" => [{ "key" => "discount", "label" => true, "i18n_template" => "discount" }],
} }
@informative_text = { @informative_text = {
"translation" => "soft_validations.percentage_discount_value.hint_text", "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [], "arguments" => [],
} }
@depends_on = [{ "percentage_discount_invalid?" => true }]
end end
def questions def questions

13
app/models/form/sales/pages/postcode.rb

@ -1,13 +0,0 @@
class Form::Sales::Pages::Postcode < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_postcode"
end
def questions
@questions ||= [
Form::Sales::Questions::PostcodeKnown.new(nil, nil, self),
Form::Sales::Questions::Postcode.new(nil, nil, self),
]
end
end

9
app/models/form/sales/pages/property_local_authority.rb

@ -10,14 +10,7 @@ class Form::Sales::Pages::PropertyLocalAuthority < ::Form::Page
def questions def questions
@questions ||= [ @questions ||= [
la_known_question,
Form::Sales::Questions::PropertyLocalAuthority.new(nil, nil, self), Form::Sales::Questions::PropertyLocalAuthority.new(nil, nil, self),
].compact ]
end
def la_known_question
if form.start_date.year < 2023
Form::Sales::Questions::PropertyLocalAuthorityKnown.new(nil, nil, self)
end
end end
end end

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

@ -2,6 +2,7 @@ class Form::Sales::Pages::Uprn < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "uprn" @id = "uprn"
@copy_key = "sales.property_information.uprn"
end end
def questions def questions

1
app/models/form/sales/pages/uprn_confirmation.rb

@ -2,7 +2,6 @@ class Form::Sales::Pages::UprnConfirmation < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "uprn_confirmation" @id = "uprn_confirmation"
@header = "We found an address that might be this property"
end end
def questions def questions

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

@ -2,7 +2,6 @@ class Form::Sales::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 = [
{ "uprn_known" => nil, "address_options_present?" => true }, { "uprn_known" => nil, "address_options_present?" => true },
{ "uprn_known" => 0, "address_options_present?" => true }, { "uprn_known" => 0, "address_options_present?" => true },

3
app/models/form/sales/questions/about_price_value_check.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::AboutPriceValueCheck < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "value_value_check" @id = "value_value_check"
@check_answer_label = "Purchase price confirmation" @copy_key = "sales.soft_validations.value_value_check"
@header = "Are you sure?"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },

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

@ -2,11 +2,10 @@ class Form::Sales::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 = "sales.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/sales/questions/address_line1_for_address_matcher.rb

@ -2,11 +2,10 @@ class Form::Sales::Questions::AddressLine1ForAddressMatcher < ::Form::Question
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 = "sales.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/sales/questions/address_line2.rb

@ -2,7 +2,7 @@ class Form::Sales::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 = "sales.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

2
app/models/form/sales/questions/buyer1_previous_tenure.rb

@ -2,8 +2,6 @@ class Form::Sales::Questions::Buyer1PreviousTenure < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "prevten" @id = "prevten"
@check_answer_label = "Buyer 1’s previous tenure"
@header = "What was buyer 1’s previous tenure?"
@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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

3
app/models/form/sales/questions/buyer2_living_in.rb

@ -2,10 +2,7 @@ class Form::Sales::Questions::Buyer2LivingIn < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "buy2living" @id = "buy2living"
@check_answer_label = "Buyer 2 living at the same address"
@header = "At the time of purchase, was buyer 2 living at the same address as buyer 1?"
@type = "radio" @type = "radio"
@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

7
app/models/form/sales/questions/buyers_organisations.rb

@ -2,10 +2,7 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "buyers_organisations" @id = "buyers_organisations"
@check_answer_label = "Organisations buyers were registered with"
@header = "What organisations were the buyers registered with?"
@type = "checkbox" @type = "checkbox"
@hint_text = "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue."
@answer_options = ANSWER_OPTIONS @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
@ -27,9 +24,5 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question
} }
end end
def unanswered_error_message
"At least one option must be selected of these four"
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 59, 2024 => 61 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 59, 2024 => 61 }.freeze
end end

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

@ -2,10 +2,9 @@ class Form::Sales::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 = "sales.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

3
app/models/form/sales/questions/monthly_charges_value_check.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::MonthlyChargesValueCheck < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "monthly_charges_value_check" @id = "monthly_charges_value_check"
@check_answer_label = "Monthly charges confirmation" @copy_key = "sales.soft_validations.monthly_charges_value_check"
@header = "Are you sure this is correct?"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },

2
app/models/form/sales/questions/no_address_found.rb

@ -2,7 +2,7 @@ class Form::Sales::Questions::NoAddressFound < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "address_search_value_check" @id = "address_search_value_check"
@header = "No address found" @copy_key = "sales.soft_validations.address_search_value_check"
@type = "interruption_screen" @type = "interruption_screen"
@hidden_in_check_answers = true @hidden_in_check_answers = true
end end

3
app/models/form/sales/questions/percentage_discount_value_check.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::PercentageDiscountValueCheck < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "percentage_discount_value_check" @id = "percentage_discount_value_check"
@check_answer_label = "Percentage discount confirmation" @copy_key = "sales.soft_validations.percentage_discount_value_check"
@header = "Are you sure this is correct?"
@type = "interruption_screen" @type = "interruption_screen"
@answer_options = { @answer_options = {
"0" => { "value" => "Yes" }, "0" => { "value" => "Yes" },

22
app/models/form/sales/questions/postcode.rb

@ -1,22 +0,0 @@
class Form::Sales::Questions::Postcode < ::Form::Question
def initialize(id, hsh, page)
super
@id = "postcode_full"
@check_answer_label = "Property’s postcode"
@header = "Postcode"
@type = "text"
@width = 5
@inferred_check_answers_value = [{
"condition" => {
"pcodenk" => 1,
},
"value" => "Not known",
}]
@inferred_answers = {
"la" => {
"is_la_inferred" => true,
},
}
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
end
end

2
app/models/form/sales/questions/postcode_for_address_matcher.rb

@ -2,7 +2,7 @@ class Form::Sales::Questions::PostcodeForAddressMatcher < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "postcode_full_input" @id = "postcode_full_input"
@header = "Postcode" @copy_key = "sales.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/sales/questions/postcode_for_full_address.rb

@ -2,7 +2,7 @@ class Form::Sales::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 = "sales.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::Sales::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

29
app/models/form/sales/questions/postcode_known.rb

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

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

@ -2,11 +2,9 @@ class Form::Sales::Questions::PreviousLaKnown < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "previous_la_known" @id = "previous_la_known"
@check_answer_label = "Local authority of buyer 1’s last settled accommodation" @copy_key = "sales.household_situation.last_accommodation_la.previous_la_known"
@header = "Do you know the local authority of buyer 1’s last settled accommodation?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = "This is also known as the household’s 'last settled home'"
@hidden_in_check_answers = { @hidden_in_check_answers = {
"depends_on" => [ "depends_on" => [
{ {

3
app/models/form/sales/questions/previous_postcode.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::PreviousPostcode < ::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 buyer 1’s last settled accommodation" @copy_key = "sales.household_situation.last_accommodation.ppostcode_full"
@header = "Postcode"
@type = "text" @type = "text"
@width = 5 @width = 5
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{

4
app/models/form/sales/questions/previous_postcode_known.rb

@ -2,14 +2,12 @@ class Form::Sales::Questions::PreviousPostcodeKnown < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ppcodenk" @id = "ppcodenk"
@check_answer_label = "Buyer 1’s last settled accommodation" @copy_key = "sales.household_situation.last_accommodation.ppcodenk"
@header = "Do you know the postcode of buyer 1’s last settled accommodation?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@conditional_for = { @conditional_for = {
"ppostcode_full" => [0], "ppostcode_full" => [0],
} }
@hint_text = "This is also known as the household’s 'last settled home'"
@hidden_in_check_answers = { @hidden_in_check_answers = {
"depends_on" => [ "depends_on" => [
{ {

3
app/models/form/sales/questions/previous_tenure_buyer2.rb

@ -2,10 +2,7 @@ class Form::Sales::Questions::PreviousTenureBuyer2 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "prevtenbuy2" @id = "prevtenbuy2"
@check_answer_label = "Buyer 2’s previous tenure"
@header = "What was buyer 2’s previous tenure?"
@type = "radio" @type = "radio"
@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/sales/questions/prevloc.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::Prevloc < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "prevloc" @id = "prevloc"
@check_answer_label = "Local authority of buyer 1’s last settled accommodation" @copy_key = "sales.household_situation.last_accommodation_la.prevloc"
@header = "Select a local authority"
@type = "select" @type = "select"
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
"condition" => { "condition" => {

3
app/models/form/sales/questions/property_building_type.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::PropertyBuildingType < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "builtype" @id = "builtype"
@check_answer_label = "Type of building" @copy_key = "sales.property_information.builtype"
@header = "What type of building is the property?"
@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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

2
app/models/form/sales/questions/property_local_authority.rb

@ -2,8 +2,6 @@ class Form::Sales::Questions::PropertyLocalAuthority < ::Form::Question
def initialize(id, hsh, page) 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"
@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

26
app/models/form/sales/questions/property_local_authority_known.rb

@ -1,26 +0,0 @@
class Form::Sales::Questions::PropertyLocalAuthorityKnown < ::Form::Question
def initialize(id, hsh, page)
super
@id = "la_known"
@check_answer_label = "Local authority known"
@header = "Do you know the property’s local authority?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@conditional_for = { "la" => [1] }
@hidden_in_check_answers = {
"depends_on" => [
{
"la_known" => 1,
},
],
}
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end
ANSWER_OPTIONS = {
"1" => { "value" => "Yes" },
"0" => { "value" => "No" },
}.freeze
QUESTION_NUMBER_FROM_YEAR = { 2023 => 16, 2024 => 17 }.freeze
end

4
app/models/form/sales/questions/property_number_of_bedrooms.rb

@ -2,9 +2,7 @@ class Form::Sales::Questions::PropertyNumberOfBedrooms < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "beds" @id = "beds"
@check_answer_label = "Number of bedrooms" @copy_key = "sales.property_information.beds"
@header = "How many bedrooms does the property have?"
@hint_text = "A bedsit has 1 bedroom"
@type = "numeric" @type = "numeric"
@width = 2 @width = 2
@min = 1 @min = 1

3
app/models/form/sales/questions/property_unit_type.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::PropertyUnitType < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "proptype" @id = "proptype"
@check_answer_label = "Type of unit" @copy_key = "sales.property_information.proptype"
@header = "What type of unit is the property?"
@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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

4
app/models/form/sales/questions/property_wheelchair_accessible.rb

@ -2,12 +2,10 @@ class Form::Sales::Questions::PropertyWheelchairAccessible < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "wchair" @id = "wchair"
@check_answer_label = "Property built or adapted to wheelchair-user standards" @copy_key = "sales.property_information.wchair"
@header = "Is the property built or adapted to wheelchair-user standards?"
@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] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hint_text = form.start_year_after_2024? ? "This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property." : nil
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

3
app/models/form/sales/questions/town_or_city.rb

@ -2,10 +2,9 @@ class Form::Sales::Questions::TownOrCity < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "town_or_city" @id = "town_or_city"
@header = "Town or city" @copy_key = "sales.property_information.address.town_or_city"
@type = "text" @type = "text"
@plain_label = true @plain_label = true
@check_answer_label = "Town or city"
@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

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

Loading…
Cancel
Save