diff --git a/app/constants/global_constants.rb b/app/constants/global_constants.rb index f42af5253..4066fb1d4 100644 --- a/app/constants/global_constants.rb +++ b/app/constants/global_constants.rb @@ -1,5 +1,5 @@ module GlobalConstants - HELPDESK_URL = "https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11".freeze + HELPDESK_URL = "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11".freeze COUNTRIES_ANSWER_OPTIONS = { "" => "Select an option", diff --git a/app/helpers/formatting_helper.rb b/app/helpers/formatting_helper.rb index 0675d42ba..ffa8b05e9 100644 --- a/app/helpers/formatting_helper.rb +++ b/app/helpers/formatting_helper.rb @@ -2,7 +2,8 @@ module FormattingHelper def format_ending(text) return text if text.blank? - modified_text = lowercase_first_letter(text) + first_word = text.split.first + modified_text = first_word == first_word.upcase ? text : lowercase_first_letter(text) ensure_sentence_ending(modified_text) end diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb index a342ca808..6283ef42e 100644 --- a/app/helpers/merge_requests_helper.rb +++ b/app/helpers/merge_requests_helper.rb @@ -9,7 +9,7 @@ module MergeRequestsHelper def request_details(merge_request) [ { label: "Requester", value: display_value_or_placeholder(merge_request.requester&.name) }, - { label: "Helpdesk ticket", value: merge_request.helpdesk_ticket.present? ? link_to("#{merge_request.helpdesk_ticket} (opens in a new tab)", "https://dluhcdigital.atlassian.net/browse/#{merge_request.helpdesk_ticket}", target: "_blank", rel: "noopener noreferrer") : display_value_or_placeholder(nil), action: merge_request_action(merge_request, "helpdesk_ticket") }, + { label: "Helpdesk ticket", value: merge_request.helpdesk_ticket.present? ? link_to("#{merge_request.helpdesk_ticket} (opens in a new tab)", "https://mhclgdigital.atlassian.net/browse/#{merge_request.helpdesk_ticket}", target: "_blank", rel: "noopener noreferrer") : display_value_or_placeholder(nil), action: merge_request_action(merge_request, "helpdesk_ticket") }, { label: "Status", value: status_tag(merge_request.status) }, ] end diff --git a/app/models/form/lettings/pages/address.rb b/app/models/form/lettings/pages/address.rb index 9fe18d3ef..eadda7f46 100644 --- a/app/models/form/lettings/pages/address.rb +++ b/app/models/form/lettings/pages/address.rb @@ -2,7 +2,7 @@ class Form::Lettings::Pages::Address < ::Form::Page def initialize(id, hsh, subsection) super @id = "address" - @header = "Q#{QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]} - What is the property's address?" + @copy_key = "lettings.property_information.address" @depends_on = [ { "is_supported_housing?" => false, "uprn_known" => nil }, { "is_supported_housing?" => false, "uprn_known" => 0 }, diff --git a/app/models/form/lettings/pages/address_fallback.rb b/app/models/form/lettings/pages/address_fallback.rb index 67f8ef5b1..2d5249671 100644 --- a/app/models/form/lettings/pages/address_fallback.rb +++ b/app/models/form/lettings/pages/address_fallback.rb @@ -2,7 +2,7 @@ class Form::Lettings::Pages::AddressFallback < ::Form::Page def initialize(id, hsh, subsection) super @id = "address" - @header = "Q12 - What is the property's address?" + @copy_key = "lettings.property_information.address" @depends_on = [ { "is_supported_housing?" => false, "uprn_known" => nil, "uprn_selection" => "uprn_not_listed" }, { "is_supported_housing?" => false, "uprn_known" => 0, "uprn_selection" => "uprn_not_listed" }, diff --git a/app/models/form/lettings/pages/address_matcher.rb b/app/models/form/lettings/pages/address_matcher.rb index 859e31077..b1fc885be 100644 --- a/app/models/form/lettings/pages/address_matcher.rb +++ b/app/models/form/lettings/pages/address_matcher.rb @@ -2,7 +2,7 @@ class Form::Lettings::Pages::AddressMatcher < ::Form::Page def initialize(id, hsh, subsection) super @id = "address_matcher" - @header = "Find an address" + @copy_key = "lettings.property_information.address_matcher" @depends_on = [ { "is_supported_housing?" => false, "uprn_known" => nil }, { "is_supported_housing?" => false, "uprn_known" => 0 }, diff --git a/app/models/form/lettings/pages/max_rent_value_check.rb b/app/models/form/lettings/pages/max_rent_value_check.rb deleted file mode 100644 index f3280420b..000000000 --- a/app/models/form/lettings/pages/max_rent_value_check.rb +++ /dev/null @@ -1,24 +0,0 @@ -class Form::Lettings::Pages::MaxRentValueCheck < ::Form::Page - def initialize(id, hsh, subsection, check_answers_card_number: nil) - super(id, hsh, subsection) - @depends_on = [{ "rent_in_soft_max_range?" => true }] - @title_text = { - "translation" => "soft_validations.rent.outside_range_title", - "arguments" => [{ - "key" => "brent", - "label" => true, - "i18n_template" => "brent", - }], - } - @informative_text = I18n.t("soft_validations.rent.informative_text", higher_or_lower: "higher") - @check_answers_card_number = check_answers_card_number - end - - def questions - @questions ||= [Form::Lettings::Questions::MaxRentValueCheck.new(nil, nil, self, check_answers_card_number: @check_answers_card_number)] - end - - def interruption_screen_question_ids - %w[brent period startdate uprn postcode_full la beds rent_type needstype] - end -end diff --git a/app/models/form/lettings/pages/min_rent_value_check.rb b/app/models/form/lettings/pages/min_rent_value_check.rb deleted file mode 100644 index ee26b4d7e..000000000 --- a/app/models/form/lettings/pages/min_rent_value_check.rb +++ /dev/null @@ -1,24 +0,0 @@ -class Form::Lettings::Pages::MinRentValueCheck < ::Form::Page - def initialize(id, hsh, subsection, check_answers_card_number: nil) - super(id, hsh, subsection) - @depends_on = [{ "rent_in_soft_min_range?" => true }] - @title_text = { - "translation" => "soft_validations.rent.outside_range_title", - "arguments" => [{ - "key" => "brent", - "label" => true, - "i18n_template" => "brent", - }], - } - @informative_text = I18n.t("soft_validations.rent.informative_text", higher_or_lower: "lower") - @check_answers_card_number = check_answers_card_number - end - - def questions - @questions ||= [Form::Lettings::Questions::MinRentValueCheck.new(nil, nil, self, check_answers_card_number: @check_answers_card_number)] - end - - def interruption_screen_question_ids - %w[brent period startdate uprn postcode_full la beds rent_type needstype] - end -end diff --git a/app/models/form/lettings/pages/property_major_repairs.rb b/app/models/form/lettings/pages/property_major_repairs.rb index 985b5dce1..92bbadc0b 100644 --- a/app/models/form/lettings/pages/property_major_repairs.rb +++ b/app/models/form/lettings/pages/property_major_repairs.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::PropertyMajorRepairs < ::Form::Page def initialize(id, hsh, subsection) super @id = "property_major_repairs" + @copy_key = "lettings.property_information.property_major_repairs" @depends_on = [{ "is_renewal?" => false, "vacancy_reason_not_renewal_or_first_let?" => true }] end diff --git a/app/models/form/lettings/pages/property_postcode.rb b/app/models/form/lettings/pages/property_postcode.rb deleted file mode 100644 index a40d4140f..000000000 --- a/app/models/form/lettings/pages/property_postcode.rb +++ /dev/null @@ -1,14 +0,0 @@ -class Form::Lettings::Pages::PropertyPostcode < ::Form::Page - def initialize(id, hsh, subsection) - super - @id = "property_postcode" - @depends_on = [{ "is_general_needs?" => true }] - end - - def questions - @questions ||= [ - Form::Lettings::Questions::PostcodeKnown.new(nil, nil, self), - Form::Lettings::Questions::PostcodeFull.new(nil, nil, self), - ] - end -end diff --git a/app/models/form/lettings/pages/rent_value_check.rb b/app/models/form/lettings/pages/rent_value_check.rb new file mode 100644 index 000000000..a80dc7339 --- /dev/null +++ b/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 diff --git a/app/models/form/lettings/pages/starter_tenancy_type.rb b/app/models/form/lettings/pages/starter_tenancy_type.rb index fe147bc77..462d4fb37 100644 --- a/app/models/form/lettings/pages/starter_tenancy_type.rb +++ b/app/models/form/lettings/pages/starter_tenancy_type.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::StarterTenancyType < ::Form::Page def initialize(id, hsh, subsection) super @id = "starter_tenancy_type" + @copy_key = "lettings.tenancy_information.tenancy.starter_tenancy_type" @depends_on = [{ "starter_tenancy?" => true }] end diff --git a/app/models/form/lettings/pages/tenancy_length.rb b/app/models/form/lettings/pages/tenancy_length.rb index 006cd8e42..b855133bf 100644 --- a/app/models/form/lettings/pages/tenancy_length.rb +++ b/app/models/form/lettings/pages/tenancy_length.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::TenancyLength < ::Form::Page def initialize(id, hsh, subsection) super @id = "tenancy_length" + @copy_key = "lettings.tenancy_information.tenancylength.tenancy_length" @depends_on = [{ "tenancy_type_fixed_term?" => true, "needstype" => 2 }] end diff --git a/app/models/form/lettings/pages/tenancy_length_affordable_rent.rb b/app/models/form/lettings/pages/tenancy_length_affordable_rent.rb index aa88d81f9..cb292823a 100644 --- a/app/models/form/lettings/pages/tenancy_length_affordable_rent.rb +++ b/app/models/form/lettings/pages/tenancy_length_affordable_rent.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::TenancyLengthAffordableRent < ::Form::Page def initialize(id, hsh, subsection) super @id = "tenancy_length_affordable_rent" + @copy_key = "lettings.tenancy_information.tenancylength.tenancy_length_affordable_rent" @depends_on = [{ "tenancy_type_fixed_term?" => true, "affordable_or_social_rent?" => true, "needstype" => 1 }] end diff --git a/app/models/form/lettings/pages/tenancy_length_intermediate_rent.rb b/app/models/form/lettings/pages/tenancy_length_intermediate_rent.rb index 070d0abe1..a693a6f3d 100644 --- a/app/models/form/lettings/pages/tenancy_length_intermediate_rent.rb +++ b/app/models/form/lettings/pages/tenancy_length_intermediate_rent.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::TenancyLengthIntermediateRent < ::Form::Page def initialize(id, hsh, subsection) super @id = "tenancy_length_intermediate_rent" + @copy_key = "lettings.tenancy_information.tenancylength.tenancy_length_intermediate_rent" @depends_on = [{ "tenancy_type_fixed_term?" => true, "affordable_or_social_rent?" => false, "needstype" => 1 }] end diff --git a/app/models/form/lettings/pages/tenancy_length_periodic.rb b/app/models/form/lettings/pages/tenancy_length_periodic.rb index 9ea6553af..82972e796 100644 --- a/app/models/form/lettings/pages/tenancy_length_periodic.rb +++ b/app/models/form/lettings/pages/tenancy_length_periodic.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::TenancyLengthPeriodic < ::Form::Page def initialize(id, hsh, subsection) super @id = "tenancy_length_periodic" + @copy_key = "lettings.tenancy_information.tenancylength.tenancy_length_periodic" @depends_on = [{ "tenancy_type_periodic?" => true }] end diff --git a/app/models/form/lettings/pages/tenancy_type.rb b/app/models/form/lettings/pages/tenancy_type.rb index c15f6f27a..2d7eceb5f 100644 --- a/app/models/form/lettings/pages/tenancy_type.rb +++ b/app/models/form/lettings/pages/tenancy_type.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::TenancyType < ::Form::Page def initialize(id, hsh, subsection) super @id = "tenancy_type" + @copy_key = "lettings.tenancy_information.tenancy.tenancy_type" @depends_on = [{ "starter_tenancy?" => false }] end diff --git a/app/models/form/lettings/pages/uprn.rb b/app/models/form/lettings/pages/uprn.rb index d3c744b8f..474928eb3 100644 --- a/app/models/form/lettings/pages/uprn.rb +++ b/app/models/form/lettings/pages/uprn.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::Uprn < ::Form::Page def initialize(id, hsh, subsection) super @id = "uprn" + @copy_key = "lettings.property_information.uprn" @depends_on = [{ "is_supported_housing?" => false }] end diff --git a/app/models/form/lettings/pages/uprn_selection.rb b/app/models/form/lettings/pages/uprn_selection.rb index 4c7ca4ae1..96bfe68e8 100644 --- a/app/models/form/lettings/pages/uprn_selection.rb +++ b/app/models/form/lettings/pages/uprn_selection.rb @@ -2,7 +2,6 @@ class Form::Lettings::Pages::UprnSelection < ::Form::Page def initialize(id, hsh, subsection) super @id = "uprn_selection" - @header = "We found some addresses that might be this property" @depends_on = [ { "is_supported_housing?" => false, "uprn_known" => nil, "address_options_present?" => true }, { "is_supported_housing?" => false, "uprn_known" => 0, "address_options_present?" => true }, diff --git a/app/models/form/lettings/pages/void_date.rb b/app/models/form/lettings/pages/void_date.rb index 2187ebe57..5ba80d41e 100644 --- a/app/models/form/lettings/pages/void_date.rb +++ b/app/models/form/lettings/pages/void_date.rb @@ -2,7 +2,6 @@ class Form::Lettings::Pages::VoidDate < ::Form::Page def initialize(id, hsh, subsection) super @id = "void_date" - @header = "Void date" @depends_on = [{ "is_renewal?" => false }] end diff --git a/app/models/form/lettings/questions/address_line1.rb b/app/models/form/lettings/questions/address_line1.rb index f90da8b26..7da9720eb 100644 --- a/app/models/form/lettings/questions/address_line1.rb +++ b/app/models/form/lettings/questions/address_line1.rb @@ -2,11 +2,10 @@ class Form::Lettings::Questions::AddressLine1 < ::Form::Question def initialize(id, hsh, page) super @id = "address_line1" - @header = "Address line 1" + @copy_key = "lettings.property_information.address.address_line1" @error_label = "Address line 1" @type = "text" @plain_label = true - @check_answer_label = "Address lines 1 and 2" @disable_clearing_if_not_routed_or_dynamic_answer_options = true @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @hide_question_number_on_page = true diff --git a/app/models/form/lettings/questions/address_line1_for_address_matcher.rb b/app/models/form/lettings/questions/address_line1_for_address_matcher.rb index b2247a8f0..0e8f59da3 100644 --- a/app/models/form/lettings/questions/address_line1_for_address_matcher.rb +++ b/app/models/form/lettings/questions/address_line1_for_address_matcher.rb @@ -2,11 +2,10 @@ class Form::Lettings::Questions::AddressLine1ForAddressMatcher < ::Form::Questio def initialize(id, hsh, page) super @id = "address_line1_input" - @header = "Address line 1" + @copy_key = "lettings.property_information.address_matcher.address_line1_input" @error_label = "Address line 1" @type = "text" @plain_label = true - @check_answer_label = "Find address" @disable_clearing_if_not_routed_or_dynamic_answer_options = true @hide_question_number_on_page = true end diff --git a/app/models/form/lettings/questions/address_line2.rb b/app/models/form/lettings/questions/address_line2.rb index 3b2c36dbc..0d4d2a705 100644 --- a/app/models/form/lettings/questions/address_line2.rb +++ b/app/models/form/lettings/questions/address_line2.rb @@ -2,7 +2,7 @@ class Form::Lettings::Questions::AddressLine2 < ::Form::Question def initialize(id, hsh, page) super @id = "address_line2" - @header = "Address line 2 (optional)" + @copy_key = "lettings.property_information.address.address_line2" @type = "text" @plain_label = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true diff --git a/app/models/form/lettings/questions/beds.rb b/app/models/form/lettings/questions/beds.rb index 8c0399a61..4661f5367 100644 --- a/app/models/form/lettings/questions/beds.rb +++ b/app/models/form/lettings/questions/beds.rb @@ -2,8 +2,6 @@ class Form::Lettings::Questions::Beds < ::Form::Question def initialize(id, hsh, page) super @id = "beds" - @check_answer_label = "Number of bedrooms" - @header = "How many bedrooms does the property have?" @type = "numeric" @width = 2 @check_answers_card_number = 0 @@ -17,9 +15,5 @@ class Form::Lettings::Questions::Beds < ::Form::Question log.is_bedsit? end - def hint_text - form.start_year_after_2024? ? "If shared accommodation, enter the number of bedrooms occupied by this household." : "If shared accommodation, enter the number of bedrooms occupied by this household. A bedsit has 1 bedroom." - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 22 }.freeze end diff --git a/app/models/form/lettings/questions/builtype.rb b/app/models/form/lettings/questions/builtype.rb index a95d88b13..7df3c46dd 100644 --- a/app/models/form/lettings/questions/builtype.rb +++ b/app/models/form/lettings/questions/builtype.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Builtype < ::Form::Question def initialize(id, hsh, page) super @id = "builtype" - @check_answer_label = "Type of building" - @header = "What type of building is the property?" @type = "radio" @check_answers_card_number = 0 - @hint_text = "" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/county.rb b/app/models/form/lettings/questions/county.rb index f3c780257..27e17645e 100644 --- a/app/models/form/lettings/questions/county.rb +++ b/app/models/form/lettings/questions/county.rb @@ -2,10 +2,9 @@ class Form::Lettings::Questions::County < ::Form::Question def initialize(id, hsh, page) super @id = "county" - @header = "County (optional)" + @copy_key = "lettings.property_information.address.county" @type = "text" @plain_label = true - @check_answer_label = "County" @disable_clearing_if_not_routed_or_dynamic_answer_options = true @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @hide_question_number_on_page = true diff --git a/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb b/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb index 6e36c9911..9d54cfcb3 100644 --- a/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb +++ b/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing < ::Form::Q def initialize(id, hsh, page) super @id = "first_time_property_let_as_social_housing" - @check_answer_label = "First time being let as social-housing?" - @header = "Is this the first time the property has been let as social housing?" @type = "radio" @check_answers_card_number = 0 - @hint_text = "" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/joint.rb b/app/models/form/lettings/questions/joint.rb index 5f3379c5d..e28a0085c 100644 --- a/app/models/form/lettings/questions/joint.rb +++ b/app/models/form/lettings/questions/joint.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Joint < ::Form::Question def initialize(id, hsh, page) super @id = "joint" - @check_answer_label = "Is this a joint tenancy?" - @header = "Is this a joint tenancy?" @type = "radio" @check_answers_card_number = 0 - @hint_text = form.start_year_after_2024? ? "This is where two or more people are named on the tenancy agreement" : "" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/la.rb b/app/models/form/lettings/questions/la.rb index 6038bc2ad..5e1c8ae2b 100644 --- a/app/models/form/lettings/questions/la.rb +++ b/app/models/form/lettings/questions/la.rb @@ -2,8 +2,6 @@ class Form::Lettings::Questions::La < ::Form::Question def initialize(id, hsh, page) super @id = "la" - @check_answer_label = "Local Authority" - @header = "What is the property’s local authority?" @type = "select" @check_answers_card_number = nil @hint_text = "" diff --git a/app/models/form/lettings/questions/majorrepairs.rb b/app/models/form/lettings/questions/majorrepairs.rb index d2d94224e..ef33c1e01 100644 --- a/app/models/form/lettings/questions/majorrepairs.rb +++ b/app/models/form/lettings/questions/majorrepairs.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::Majorrepairs < ::Form::Question def initialize(id, hsh, page) super @id = "majorrepairs" - @check_answer_label = "Major repairs carried out during void period" - @header = "Were any major repairs carried out during the void period?" + @copy_key = "lettings.property_information.property_major_repairs.majorrepairs" @type = "radio" @check_answers_card_number = 0 - @hint_text = "Major repairs are works that could not be reasonably carried out with a tenant living at the property. For example, structural repairs." @answer_options = ANSWER_OPTIONS @conditional_for = { "mrcdate" => [1] } @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/lettings/questions/max_rent_value_check.rb b/app/models/form/lettings/questions/max_rent_value_check.rb deleted file mode 100644 index 6936e9e36..000000000 --- a/app/models/form/lettings/questions/max_rent_value_check.rb +++ /dev/null @@ -1,15 +0,0 @@ -class Form::Lettings::Questions::MaxRentValueCheck < ::Form::Question - def initialize(id, hsh, page, check_answers_card_number:) - super(id, hsh, page) - @id = "rent_value_check" - @check_answer_label = "Total rent confirmation" - @header = "Are you sure this is correct?" - @type = "interruption_screen" - @hint_text = I18n.t("soft_validations.rent.hint_text", higher_or_lower: "higher") - @check_answers_card_number = check_answers_card_number - @answer_options = ANSWER_OPTIONS - @hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] } - end - - ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze -end diff --git a/app/models/form/lettings/questions/mrcdate.rb b/app/models/form/lettings/questions/mrcdate.rb index 8bbd8223b..33c8f2c5f 100644 --- a/app/models/form/lettings/questions/mrcdate.rb +++ b/app/models/form/lettings/questions/mrcdate.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::Mrcdate < ::Form::Question def initialize(id, hsh, page) super @id = "mrcdate" - @check_answer_label = "Completion date of repairs" - @header = "When were the repairs completed?" + @copy_key = "lettings.property_information.property_major_repairs.mrcdate" @type = "date" @check_answers_card_number = 0 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/lettings/questions/offered.rb b/app/models/form/lettings/questions/offered.rb index 6d98f405c..701a6f737 100644 --- a/app/models/form/lettings/questions/offered.rb +++ b/app/models/form/lettings/questions/offered.rb @@ -2,8 +2,6 @@ class Form::Lettings::Questions::Offered < ::Form::Question def initialize(id, hsh, page) super @id = "offered" - @check_answer_label = I18n.t("check_answer_labels.offered") - @header = I18n.t("questions.offered") @type = "numeric" @width = 2 @check_answers_card_number = 0 diff --git a/app/models/form/lettings/questions/postcode_for_address_matcher.rb b/app/models/form/lettings/questions/postcode_for_address_matcher.rb index 2cac3ce92..9a7751904 100644 --- a/app/models/form/lettings/questions/postcode_for_address_matcher.rb +++ b/app/models/form/lettings/questions/postcode_for_address_matcher.rb @@ -2,7 +2,7 @@ class Form::Lettings::Questions::PostcodeForAddressMatcher < ::Form::Question def initialize(id, hsh, page) super @id = "postcode_full_input" - @header = "Postcode" + @copy_key = "lettings.property_information.address_matcher.postcode_full_input" @type = "text" @width = 5 @plain_label = true diff --git a/app/models/form/lettings/questions/postcode_for_full_address.rb b/app/models/form/lettings/questions/postcode_for_full_address.rb index ef93b003d..d6ee9859f 100644 --- a/app/models/form/lettings/questions/postcode_for_full_address.rb +++ b/app/models/form/lettings/questions/postcode_for_full_address.rb @@ -2,7 +2,7 @@ class Form::Lettings::Questions::PostcodeForFullAddress < ::Form::Question def initialize(id, hsh, page) super @id = "postcode_full" - @header = "Postcode" + @copy_key = "lettings.property_information.address.postcode_full" @type = "text" @width = 5 @inferred_check_answers_value = [{ @@ -17,7 +17,6 @@ class Form::Lettings::Questions::PostcodeForFullAddress < ::Form::Question }, } @plain_label = true - @check_answer_label = "Postcode" @disable_clearing_if_not_routed_or_dynamic_answer_options = true @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @hide_question_number_on_page = true diff --git a/app/models/form/lettings/questions/postcode_full.rb b/app/models/form/lettings/questions/postcode_full.rb deleted file mode 100644 index fc7d7691b..000000000 --- a/app/models/form/lettings/questions/postcode_full.rb +++ /dev/null @@ -1,15 +0,0 @@ -class Form::Lettings::Questions::PostcodeFull < ::Form::Question - def initialize(id, hsh, page) - super - @id = "postcode_full" - @check_answer_label = "Postcode" - @header = "What is the property’s postcode?" - @type = "text" - @width = 5 - @inferred_check_answers_value = [{ "condition" => { "postcode_known" => 0 }, "value" => "Not known" }] - @check_answers_card_number = 0 - @hint_text = "" - @inferred_answers = { "la" => { "is_la_inferred" => true } } - @disable_clearing_if_not_routed_or_dynamic_answer_options = true - end -end diff --git a/app/models/form/lettings/questions/postcode_known.rb b/app/models/form/lettings/questions/postcode_known.rb deleted file mode 100644 index ea9adb06b..000000000 --- a/app/models/form/lettings/questions/postcode_known.rb +++ /dev/null @@ -1,17 +0,0 @@ -class Form::Lettings::Questions::PostcodeKnown < ::Form::Question - def initialize(id, hsh, page) - super - @id = "postcode_known" - @check_answer_label = "Do you know the property postcode?" - @header = "Do you know the property’s postcode?" - @type = "radio" - @check_answers_card_number = 0 - @hint_text = "" - @answer_options = ANSWER_OPTIONS - @disable_clearing_if_not_routed_or_dynamic_answer_options = true - @conditional_for = { "postcode_full" => [1] } - @hidden_in_check_answers = { "depends_on" => [{ "postcode_known" => 0 }, { "postcode_known" => 1 }] } - end - - ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "0" => { "value" => "No" } }.freeze -end diff --git a/app/models/form/lettings/questions/previous_let_type.rb b/app/models/form/lettings/questions/previous_let_type.rb index d9c018820..577571571 100644 --- a/app/models/form/lettings/questions/previous_let_type.rb +++ b/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) super @id = "unitletas" - @check_answer_label = "Most recent let type" - @header = "What type was the property most recently let as?" @type = "radio" @check_answers_card_number = 0 - @hint_text = form.start_year_after_2024? ? "This is the rent type of the previous tenancy in this property." : "" @answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_AFTER_2024 : ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/min_rent_value_check.rb b/app/models/form/lettings/questions/rent_value_check.rb similarity index 77% rename from app/models/form/lettings/questions/min_rent_value_check.rb rename to app/models/form/lettings/questions/rent_value_check.rb index ad4111c61..688499259 100644 --- a/app/models/form/lettings/questions/min_rent_value_check.rb +++ b/app/models/form/lettings/questions/rent_value_check.rb @@ -1,11 +1,11 @@ -class Form::Lettings::Questions::MinRentValueCheck < ::Form::Question +class Form::Lettings::Questions::RentValueCheck < ::Form::Question def initialize(id, hsh, page, check_answers_card_number:) super(id, hsh, page) @id = "rent_value_check" @check_answer_label = "Total rent confirmation" @header = "Are you sure this is correct?" @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 @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] } diff --git a/app/models/form/lettings/questions/rsnvac.rb b/app/models/form/lettings/questions/rsnvac.rb index 303f2ea48..935980712 100644 --- a/app/models/form/lettings/questions/rsnvac.rb +++ b/app/models/form/lettings/questions/rsnvac.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Rsnvac < ::Form::Question def initialize(id, hsh, page) super @id = "rsnvac" - @check_answer_label = "Vacancy reason" - @header = "What is the reason for the property being vacant?" @type = "radio" @check_answers_card_number = 0 - @hint_text = "" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/rsnvac_first_let.rb b/app/models/form/lettings/questions/rsnvac_first_let.rb index f03c64995..4b87d059f 100644 --- a/app/models/form/lettings/questions/rsnvac_first_let.rb +++ b/app/models/form/lettings/questions/rsnvac_first_let.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::RsnvacFirstLet < ::Form::Question def initialize(id, hsh, page) super @id = "rsnvac" - @check_answer_label = "Vacancy reason" - @header = "What is the reason for the property being vacant?" @type = "radio" @check_answers_card_number = 0 - @hint_text = "" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/sheltered.rb b/app/models/form/lettings/questions/sheltered.rb index 7b78a9b30..7b80bb5bf 100644 --- a/app/models/form/lettings/questions/sheltered.rb +++ b/app/models/form/lettings/questions/sheltered.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Sheltered < ::Form::Question def initialize(id, hsh, page) super @id = "sheltered" - @check_answer_label = "Is this letting in sheltered accommodation?" - @header = "Is this letting in sheltered accommodation?" @type = "radio" @check_answers_card_number = 0 - @hint_text = "Sheltered housing and special retirement housing are for tenants with low-level care and support needs. This typically provides some limited support to enable independent living, such as alarm-based assistance or a scheme manager.

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

- You should submit a CORE log at the beginning of the starter tenancy or introductory period, with the best information you have at the time. You do not need to submit a log when a tenant later rolls onto the main tenancy." - else - "This is also known as an ‘introductory period’." - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 26 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length.rb b/app/models/form/lettings/questions/tenancy_length.rb index b94d41af5..1bf868377 100644 --- a/app/models/form/lettings/questions/tenancy_length.rb +++ b/app/models/form/lettings/questions/tenancy_length.rb @@ -2,14 +2,12 @@ class Form::Lettings::Questions::TenancyLength < ::Form::Question def initialize(id, hsh, page) super @id = "tenancylength" - @check_answer_label = "Length of fixed-term tenancy" - @header = "What is the length of the fixed-term tenancy to the nearest year?" + @copy_key = "lettings.tenancy_information.tenancylength.#{page.id}" @type = "numeric" @width = 2 @check_answers_card_number = 0 @max = 150 @min = 0 - @hint_text = "Do not include the starter or introductory period." @step = 1 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb b/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb index bea745ae1..8e79924aa 100644 --- a/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb +++ b/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::TenancyLengthAffordableRent < ::Form::Question def initialize(id, hsh, page) super @id = "tenancylength" - @check_answer_label = "Length of fixed-term tenancy" - @header = "What is the length of the fixed-term tenancy to the nearest year?" + @copy_key = "lettings.tenancy_information.tenancylength.#{page.id}" @type = "numeric" @width = 2 @check_answers_card_number = 0 @@ -13,13 +12,5 @@ class Form::Lettings::Questions::TenancyLengthAffordableRent < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - def hint_text - if form.start_year_after_2024? - "Do not include the starter or introductory period.
The minimum period is 2 years for social or affordable rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 2 years." - else - "Do not include the starter or introductory period.
The minimum period is 2 years for social or affordable rent general needs logs and you do not need a log for shorter tenancies." - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb b/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb index 835efd429..1bf3bd7cc 100644 --- a/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb +++ b/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::TenancyLengthIntermediateRent < ::Form::Questio def initialize(id, hsh, page) super @id = "tenancylength" - @check_answer_label = "Length of fixed-term tenancy" - @header = "What is the length of the fixed-term tenancy to the nearest year?" + @copy_key = "lettings.tenancy_information.tenancylength.#{page.id}" @type = "numeric" @width = 2 @check_answers_card_number = 0 @@ -13,13 +12,5 @@ class Form::Lettings::Questions::TenancyLengthIntermediateRent < ::Form::Questio @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - def hint_text - if form.start_year_after_2024? - "Do not include the starter or introductory period.
The minimum period is 1 year for intermediate rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 1 year." - else - "Do not include the starter or introductory period.
The minimum period is 1 year for intermediate rent general needs logs and you do not need a log for shorter tenancies." - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length_periodic.rb b/app/models/form/lettings/questions/tenancy_length_periodic.rb index 113435dd6..c65f41399 100644 --- a/app/models/form/lettings/questions/tenancy_length_periodic.rb +++ b/app/models/form/lettings/questions/tenancy_length_periodic.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::TenancyLengthPeriodic < ::Form::Question def initialize(id, hsh, page) super @id = "tenancylength" - @check_answer_label = "Length of periodic tenancy" - @header = "What is the length of the periodic tenancy to the nearest year?" + @copy_key = "lettings.tenancy_information.tenancylength.#{page.id}" @type = "numeric" @width = 2 @check_answers_card_number = 0 @@ -11,7 +10,6 @@ class Form::Lettings::Questions::TenancyLengthPeriodic < ::Form::Question @min = 0 @step = 1 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] - @hint_text = "As this is a periodic tenancy, this question is optional. If you do not have the information available click save and continue" end QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze diff --git a/app/models/form/lettings/questions/tenancy_other.rb b/app/models/form/lettings/questions/tenancy_other.rb index 21e932250..3fb3469ee 100644 --- a/app/models/form/lettings/questions/tenancy_other.rb +++ b/app/models/form/lettings/questions/tenancy_other.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::TenancyOther < ::Form::Question def initialize(id, hsh, page) super @id = "tenancyother" - @check_answer_label = "" - @header = "Please state the tenancy type" + @copy_key = "lettings.tenancy_information.tenancy.#{page.id}.tenancyother" @type = "text" @check_answers_card_number = 0 - @hint_text = "" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/tenancy_type.rb b/app/models/form/lettings/questions/tenancy_type.rb index b4ed6aca4..9a83b44cb 100644 --- a/app/models/form/lettings/questions/tenancy_type.rb +++ b/app/models/form/lettings/questions/tenancy_type.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question def initialize(id, hsh, page) super @id = "tenancy" - @check_answer_label = "Type of main tenancy" - @header = "What is the type of tenancy?" + @copy_key = "lettings.tenancy_information.tenancy.#{page.id}.tenancy" @type = "radio" @check_answers_card_number = 0 - @hint_text = "" @conditional_for = { "tenancyother" => [3] } @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/town_or_city.rb b/app/models/form/lettings/questions/town_or_city.rb index 745810893..14ed19dfc 100644 --- a/app/models/form/lettings/questions/town_or_city.rb +++ b/app/models/form/lettings/questions/town_or_city.rb @@ -2,10 +2,9 @@ class Form::Lettings::Questions::TownOrCity < ::Form::Question def initialize(id, hsh, page) super @id = "town_or_city" - @header = "Town or city" + @copy_key = "lettings.property_information.address.town_or_city" @type = "text" @plain_label = true - @check_answer_label = "Town or city" @disable_clearing_if_not_routed_or_dynamic_answer_options = true @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @hide_question_number_on_page = true diff --git a/app/models/form/lettings/questions/unittype_gn.rb b/app/models/form/lettings/questions/unittype_gn.rb index 501f25ee7..95a199b98 100644 --- a/app/models/form/lettings/questions/unittype_gn.rb +++ b/app/models/form/lettings/questions/unittype_gn.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::UnittypeGn < ::Form::Question def initialize(id, hsh, page) super @id = "unittype_gn" - @check_answer_label = "Type of unit" - @header = "What type of unit is the property?" @type = "radio" @check_answers_card_number = 0 - @hint_text = "" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/uprn.rb b/app/models/form/lettings/questions/uprn.rb index 7c860e01b..53df6bcf2 100644 --- a/app/models/form/lettings/questions/uprn.rb +++ b/app/models/form/lettings/questions/uprn.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::Uprn < ::Form::Question def initialize(id, hsh, page) super @id = "uprn" - @check_answer_label = "UPRN" - @header = "What is the property's UPRN?" + @copy_key = "lettings.property_information.uprn.uprn" @type = "text" @width = 10 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/lettings/questions/uprn_known.rb b/app/models/form/lettings/questions/uprn_known.rb index a9840667c..29d415134 100644 --- a/app/models/form/lettings/questions/uprn_known.rb +++ b/app/models/form/lettings/questions/uprn_known.rb @@ -2,13 +2,9 @@ class Form::Lettings::Questions::UprnKnown < ::Form::Question def initialize(id, hsh, page) super @id = "uprn_known" - @check_answer_label = "UPRN known?" - @header = "Do you know the property's UPRN?" + @copy_key = "lettings.property_information.uprn.uprn_known" @type = "radio" @answer_options = ANSWER_OPTIONS - @hint_text = "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

- The UPRN may not be the same as the property reference assigned by your organisation.

- If you don’t know the UPRN you can enter the address of the property instead on the next screen." @conditional_for = { "uprn" => [1] } @inferred_check_answers_value = [ { diff --git a/app/models/form/lettings/questions/uprn_selection.rb b/app/models/form/lettings/questions/uprn_selection.rb index f6c71f498..90fa319b7 100644 --- a/app/models/form/lettings/questions/uprn_selection.rb +++ b/app/models/form/lettings/questions/uprn_selection.rb @@ -2,9 +2,7 @@ class Form::Lettings::Questions::UprnSelection < ::Form::Question def initialize(id, hsh, page) super @id = "uprn_selection" - @header = "Select the correct address" @type = "radio" - @check_answer_label = "Select the correct address" @disable_clearing_if_not_routed_or_dynamic_answer_options = true end diff --git a/app/models/form/lettings/questions/voiddate.rb b/app/models/form/lettings/questions/voiddate.rb index 9d47fe1ea..1f5d2317a 100644 --- a/app/models/form/lettings/questions/voiddate.rb +++ b/app/models/form/lettings/questions/voiddate.rb @@ -2,8 +2,6 @@ class Form::Lettings::Questions::Voiddate < ::Form::Question def initialize(id, hsh, page) super @id = "voiddate" - @check_answer_label = "Void date" - @header = "What is the void date?" @type = "date" @check_answers_card_number = 0 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/lettings/questions/wheelchair.rb b/app/models/form/lettings/questions/wheelchair.rb index 7d8dcfa25..f766a0e44 100644 --- a/app/models/form/lettings/questions/wheelchair.rb +++ b/app/models/form/lettings/questions/wheelchair.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Wheelchair < ::Form::Question def initialize(id, hsh, page) super @id = "wchair" - @check_answer_label = "Property built or adapted to wheelchair-user standards" - @header = "Is the property built or adapted to wheelchair-user standards?" @type = "radio" @check_answers_card_number = 0 - @hint_text = form.start_year_after_2024? ? "This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property." : "" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/subsections/income_and_benefits.rb b/app/models/form/lettings/subsections/income_and_benefits.rb index 1404ebf04..2be2fb9a5 100644 --- a/app/models/form/lettings/subsections/income_and_benefits.rb +++ b/app/models/form/lettings/subsections/income_and_benefits.rb @@ -24,8 +24,7 @@ class Form::Lettings::Subsections::IncomeAndBenefits < ::Form::Subsection Form::Lettings::Pages::RentBiWeekly.new(nil, nil, self), Form::Lettings::Pages::Rent4Weekly.new(nil, nil, self), Form::Lettings::Pages::RentMonthly.new(nil, nil, self), - Form::Lettings::Pages::MinRentValueCheck.new("brent_min_rent_value_check", nil, self, check_answers_card_number: 0), - Form::Lettings::Pages::MaxRentValueCheck.new("brent_max_rent_value_check", nil, self, check_answers_card_number: 0), + Form::Lettings::Pages::RentValueCheck.new("brent_rent_value_check", nil, self, check_answers_card_number: 0), Form::Lettings::Pages::SchargeValueCheck.new(nil, nil, self), Form::Lettings::Pages::PschargeValueCheck.new(nil, nil, self), Form::Lettings::Pages::SupchargValueCheck.new(nil, nil, self), diff --git a/app/models/form/lettings/subsections/property_information.rb b/app/models/form/lettings/subsections/property_information.rb index 67a22c7f5..fa2ff0efa 100644 --- a/app/models/form/lettings/subsections/property_information.rb +++ b/app/models/form/lettings/subsections/property_information.rb @@ -10,8 +10,7 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection @pages ||= [ uprn_questions, Form::Lettings::Pages::PropertyLocalAuthority.new(nil, nil, self), - Form::Lettings::Pages::MinRentValueCheck.new("local_authority_min_rent_value_check", nil, self, check_answers_card_number: nil), - Form::Lettings::Pages::MaxRentValueCheck.new("local_authority_max_rent_value_check", nil, self, check_answers_card_number: nil), + Form::Lettings::Pages::RentValueCheck.new("local_authority_rent_value_check", nil, self, check_answers_card_number: nil), Form::Lettings::Pages::FirstTimePropertyLetAsSocialHousing.new(nil, nil, self), Form::Lettings::Pages::PropertyLetType.new(nil, nil, self), Form::Lettings::Pages::PropertyVacancyReasonNotFirstLet.new(nil, nil, self), @@ -21,8 +20,7 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection Form::Lettings::Pages::PropertyBuildingType.new(nil, nil, self), Form::Lettings::Pages::PropertyWheelchairAccessible.new(nil, nil, self), Form::Lettings::Pages::PropertyNumberOfBedrooms.new(nil, nil, self), - Form::Lettings::Pages::MinRentValueCheck.new("beds_min_rent_value_check", nil, self, check_answers_card_number: 0), - Form::Lettings::Pages::MaxRentValueCheck.new("beds_max_rent_value_check", nil, self, check_answers_card_number: 0), + Form::Lettings::Pages::RentValueCheck.new("beds_rent_value_check", nil, self, check_answers_card_number: 0), Form::Lettings::Pages::VoidDate.new(nil, nil, self), Form::Lettings::Pages::VoidDateValueCheck.new(nil, nil, self), Form::Lettings::Pages::PropertyMajorRepairs.new(nil, nil, self), @@ -36,20 +34,16 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection Form::Lettings::Pages::Uprn.new(nil, nil, self), Form::Lettings::Pages::UprnConfirmation.new(nil, nil, self), Form::Lettings::Pages::AddressMatcher.new(nil, nil, self), - Form::Lettings::Pages::NoAddressFound.new(nil, nil, self), + Form::Lettings::Pages::NoAddressFound.new(nil, nil, self), # soft validation Form::Lettings::Pages::UprnSelection.new(nil, nil, self), Form::Lettings::Pages::AddressFallback.new(nil, nil, self), ] - elsif form.start_date.year == 2023 + else [ Form::Lettings::Pages::Uprn.new(nil, nil, self), Form::Lettings::Pages::UprnConfirmation.new(nil, nil, self), Form::Lettings::Pages::Address.new(nil, nil, self), ] - else - [ - Form::Lettings::Pages::PropertyPostcode.new(nil, nil, self), - ] end end diff --git a/app/models/form/sales/pages/about_price_value_check.rb b/app/models/form/sales/pages/about_price_value_check.rb index 8b5cb45ab..41ae283dc 100644 --- a/app/models/form/sales/pages/about_price_value_check.rb +++ b/app/models/form/sales/pages/about_price_value_check.rb @@ -6,8 +6,9 @@ class Form::Sales::Pages::AboutPriceValueCheck < ::Form::Page "purchase_price_out_of_soft_range?" => true, }, ] + @copy_key = "sales.soft_validations.value_value_check" @title_text = { - "translation" => "soft_validations.purchase_price.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "value", @@ -17,7 +18,7 @@ class Form::Sales::Pages::AboutPriceValueCheck < ::Form::Page ], } @informative_text = { - "translation" => "soft_validations.purchase_price.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [ { "key" => "field_formatted_as_currency", diff --git a/app/models/form/sales/pages/address.rb b/app/models/form/sales/pages/address.rb index 6bd74f8b7..be0ed9eae 100644 --- a/app/models/form/sales/pages/address.rb +++ b/app/models/form/sales/pages/address.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::Address < ::Form::Page def initialize(id, hsh, subsection) super @id = "address" - @header = "Q#{QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]} - What is the property's address?" + @copy_key = "sales.property_information.address" @depends_on = [ { "uprn_known" => nil }, { "uprn_known" => 0 }, diff --git a/app/models/form/sales/pages/address_fallback.rb b/app/models/form/sales/pages/address_fallback.rb index 3a69dabba..1f0a3f1e8 100644 --- a/app/models/form/sales/pages/address_fallback.rb +++ b/app/models/form/sales/pages/address_fallback.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::AddressFallback < ::Form::Page def initialize(id, hsh, subsection) super @id = "address" - @header = "Q12 - What is the property's address?" + @copy_key = "sales.property_information.address" @depends_on = [ { "uprn_known" => nil, "uprn_selection" => "uprn_not_listed" }, { "uprn_known" => 0, "uprn_selection" => "uprn_not_listed" }, diff --git a/app/models/form/sales/pages/address_matcher.rb b/app/models/form/sales/pages/address_matcher.rb index 5d2a38767..23b8c5c86 100644 --- a/app/models/form/sales/pages/address_matcher.rb +++ b/app/models/form/sales/pages/address_matcher.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::AddressMatcher < ::Form::Page def initialize(id, hsh, subsection) super @id = "address_matcher" - @header = "Find an address" + @copy_key = "sales.property_information.address_matcher" @depends_on = [ { "uprn_known" => nil }, { "uprn_known" => 0 }, diff --git a/app/models/form/sales/pages/last_accommodation.rb b/app/models/form/sales/pages/last_accommodation.rb index 457da99b1..f9d167028 100644 --- a/app/models/form/sales/pages/last_accommodation.rb +++ b/app/models/form/sales/pages/last_accommodation.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::LastAccommodation < ::Form::Page def initialize(id, hsh, subsection) super @id = "last_accommodation" + @copy_key = "sales.household_situation.last_accommodation" end def questions diff --git a/app/models/form/sales/pages/last_accommodation_la.rb b/app/models/form/sales/pages/last_accommodation_la.rb index 1c126a28d..9cae326bf 100644 --- a/app/models/form/sales/pages/last_accommodation_la.rb +++ b/app/models/form/sales/pages/last_accommodation_la.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::LastAccommodationLa < ::Form::Page def initialize(id, hsh, subsection) super @id = "last_accommodation_la" + @copy_key = "sales.household_situation.last_accommodation_la" @depends_on = [{ "is_previous_la_inferred" => false, }] diff --git a/app/models/form/sales/pages/monthly_charges_value_check.rb b/app/models/form/sales/pages/monthly_charges_value_check.rb index 662a048bb..f6aef088c 100644 --- a/app/models/form/sales/pages/monthly_charges_value_check.rb +++ b/app/models/form/sales/pages/monthly_charges_value_check.rb @@ -6,8 +6,9 @@ class Form::Sales::Pages::MonthlyChargesValueCheck < ::Form::Page "monthly_charges_over_soft_max?" => true, }, ] + @copy_key = "sales.soft_validations.monthly_charges_value_check" @title_text = { - "translation" => "soft_validations.monthly_charges_over_soft_max.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "field_formatted_as_currency", @@ -17,7 +18,7 @@ class Form::Sales::Pages::MonthlyChargesValueCheck < ::Form::Page ], } @informative_text = { - "translation" => "soft_validations.monthly_charges_over_soft_max.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } end diff --git a/app/models/form/sales/pages/no_address_found.rb b/app/models/form/sales/pages/no_address_found.rb index 6e3b04f40..ae2663896 100644 --- a/app/models/form/sales/pages/no_address_found.rb +++ b/app/models/form/sales/pages/no_address_found.rb @@ -3,12 +3,13 @@ class Form::Sales::Pages::NoAddressFound < ::Form::Page super @id = "no_address_found" @type = "interruption_screen" + @copy_key = "sales.soft_validations.address_search_value_check" @title_text = { - "translation" => "soft_validations.no_address_found.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [], } @informative_text = { - "translation" => "soft_validations.no_address_found.informative_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } @depends_on = [ diff --git a/app/models/form/sales/pages/percentage_discount_value_check.rb b/app/models/form/sales/pages/percentage_discount_value_check.rb index 37ff4eea4..aa8c20d75 100644 --- a/app/models/form/sales/pages/percentage_discount_value_check.rb +++ b/app/models/form/sales/pages/percentage_discount_value_check.rb @@ -1,15 +1,16 @@ class Form::Sales::Pages::PercentageDiscountValueCheck < ::Form::Page def initialize(id, hsh, subsection) super + @depends_on = [{ "percentage_discount_invalid?" => true }] + @copy_key = "sales.soft_validations.percentage_discount_value_check" @title_text = { - "translation" => "soft_validations.percentage_discount_value.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [{ "key" => "discount", "label" => true, "i18n_template" => "discount" }], } @informative_text = { - "translation" => "soft_validations.percentage_discount_value.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } - @depends_on = [{ "percentage_discount_invalid?" => true }] end def questions diff --git a/app/models/form/sales/pages/postcode.rb b/app/models/form/sales/pages/postcode.rb deleted file mode 100644 index c40a18845..000000000 --- a/app/models/form/sales/pages/postcode.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Form::Sales::Pages::Postcode < ::Form::Page - def initialize(id, hsh, subsection) - super - @id = "property_postcode" - end - - def questions - @questions ||= [ - Form::Sales::Questions::PostcodeKnown.new(nil, nil, self), - Form::Sales::Questions::Postcode.new(nil, nil, self), - ] - end -end diff --git a/app/models/form/sales/pages/property_local_authority.rb b/app/models/form/sales/pages/property_local_authority.rb index e0289839d..649a445f9 100644 --- a/app/models/form/sales/pages/property_local_authority.rb +++ b/app/models/form/sales/pages/property_local_authority.rb @@ -10,14 +10,7 @@ class Form::Sales::Pages::PropertyLocalAuthority < ::Form::Page def questions @questions ||= [ - la_known_question, Form::Sales::Questions::PropertyLocalAuthority.new(nil, nil, self), - ].compact - end - - def la_known_question - if form.start_date.year < 2023 - Form::Sales::Questions::PropertyLocalAuthorityKnown.new(nil, nil, self) - end + ] end end diff --git a/app/models/form/sales/pages/uprn.rb b/app/models/form/sales/pages/uprn.rb index d4c7e4d77..fce51e543 100644 --- a/app/models/form/sales/pages/uprn.rb +++ b/app/models/form/sales/pages/uprn.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::Uprn < ::Form::Page def initialize(id, hsh, subsection) super @id = "uprn" + @copy_key = "sales.property_information.uprn" end def questions diff --git a/app/models/form/sales/pages/uprn_confirmation.rb b/app/models/form/sales/pages/uprn_confirmation.rb index d553972a3..9cc2ccf94 100644 --- a/app/models/form/sales/pages/uprn_confirmation.rb +++ b/app/models/form/sales/pages/uprn_confirmation.rb @@ -2,7 +2,6 @@ class Form::Sales::Pages::UprnConfirmation < ::Form::Page def initialize(id, hsh, subsection) super @id = "uprn_confirmation" - @header = "We found an address that might be this property" end def questions diff --git a/app/models/form/sales/pages/uprn_selection.rb b/app/models/form/sales/pages/uprn_selection.rb index 94f35540f..6dc5bb2bc 100644 --- a/app/models/form/sales/pages/uprn_selection.rb +++ b/app/models/form/sales/pages/uprn_selection.rb @@ -2,7 +2,6 @@ class Form::Sales::Pages::UprnSelection < ::Form::Page def initialize(id, hsh, subsection) super @id = "uprn_selection" - @header = "We found some addresses that might be this property" @depends_on = [ { "uprn_known" => nil, "address_options_present?" => true }, { "uprn_known" => 0, "address_options_present?" => true }, diff --git a/app/models/form/sales/questions/about_price_value_check.rb b/app/models/form/sales/questions/about_price_value_check.rb index 2b51cd7fb..52f7b156f 100644 --- a/app/models/form/sales/questions/about_price_value_check.rb +++ b/app/models/form/sales/questions/about_price_value_check.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::AboutPriceValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "value_value_check" - @check_answer_label = "Purchase price confirmation" - @header = "Are you sure?" + @copy_key = "sales.soft_validations.value_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/address_line1.rb b/app/models/form/sales/questions/address_line1.rb index f72aaea96..f7a4c7c2d 100644 --- a/app/models/form/sales/questions/address_line1.rb +++ b/app/models/form/sales/questions/address_line1.rb @@ -2,11 +2,10 @@ class Form::Sales::Questions::AddressLine1 < ::Form::Question def initialize(id, hsh, page) super @id = "address_line1" - @header = "Address line 1" + @copy_key = "sales.property_information.address.address_line1" @error_label = "Address line 1" @type = "text" @plain_label = true - @check_answer_label = "Address lines 1 and 2" @disable_clearing_if_not_routed_or_dynamic_answer_options = true @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @hide_question_number_on_page = true diff --git a/app/models/form/sales/questions/address_line1_for_address_matcher.rb b/app/models/form/sales/questions/address_line1_for_address_matcher.rb index fd1211b69..cfc086f7b 100644 --- a/app/models/form/sales/questions/address_line1_for_address_matcher.rb +++ b/app/models/form/sales/questions/address_line1_for_address_matcher.rb @@ -2,11 +2,10 @@ class Form::Sales::Questions::AddressLine1ForAddressMatcher < ::Form::Question def initialize(id, hsh, page) super @id = "address_line1_input" - @header = "Address line 1" + @copy_key = "sales.property_information.address_matcher.address_line1_input" @error_label = "Address line 1" @type = "text" @plain_label = true - @check_answer_label = "Find address" @disable_clearing_if_not_routed_or_dynamic_answer_options = true @hide_question_number_on_page = true end diff --git a/app/models/form/sales/questions/address_line2.rb b/app/models/form/sales/questions/address_line2.rb index 94396a2af..521d1dc58 100644 --- a/app/models/form/sales/questions/address_line2.rb +++ b/app/models/form/sales/questions/address_line2.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::AddressLine2 < ::Form::Question def initialize(id, hsh, page) super @id = "address_line2" - @header = "Address line 2 (optional)" + @copy_key = "sales.property_information.address.address_line2" @type = "text" @plain_label = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true diff --git a/app/models/form/sales/questions/buyer1_previous_tenure.rb b/app/models/form/sales/questions/buyer1_previous_tenure.rb index 4f560f10d..aea90af30 100644 --- a/app/models/form/sales/questions/buyer1_previous_tenure.rb +++ b/app/models/form/sales/questions/buyer1_previous_tenure.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::Buyer1PreviousTenure < ::Form::Question def initialize(id, hsh, page) super @id = "prevten" - @check_answer_label = "Buyer 1’s previous tenure" - @header = "What was buyer 1’s previous tenure?" @type = "radio" @answer_options = answer_options @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/buyer2_living_in.rb b/app/models/form/sales/questions/buyer2_living_in.rb index 83b1712fe..0939d119f 100644 --- a/app/models/form/sales/questions/buyer2_living_in.rb +++ b/app/models/form/sales/questions/buyer2_living_in.rb @@ -2,10 +2,7 @@ class Form::Sales::Questions::Buyer2LivingIn < ::Form::Question def initialize(id, hsh, page) super @id = "buy2living" - @check_answer_label = "Buyer 2 living at the same address" - @header = "At the time of purchase, was buyer 2 living at the same address as buyer 1?" @type = "radio" - @hint_text = "" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/buyers_organisations.rb b/app/models/form/sales/questions/buyers_organisations.rb index 714f7a2e3..727a65ad0 100644 --- a/app/models/form/sales/questions/buyers_organisations.rb +++ b/app/models/form/sales/questions/buyers_organisations.rb @@ -2,10 +2,7 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question def initialize(id, hsh, page) super @id = "buyers_organisations" - @check_answer_label = "Organisations buyers were registered with" - @header = "What organisations were the buyers registered with?" @type = "checkbox" - @hint_text = "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue." @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end @@ -27,9 +24,5 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question } end - def unanswered_error_message - "At least one option must be selected of these four" - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 59, 2024 => 61 }.freeze end diff --git a/app/models/form/sales/questions/county.rb b/app/models/form/sales/questions/county.rb index d95d90e73..8f92a5480 100644 --- a/app/models/form/sales/questions/county.rb +++ b/app/models/form/sales/questions/county.rb @@ -2,10 +2,9 @@ class Form::Sales::Questions::County < ::Form::Question def initialize(id, hsh, page) super @id = "county" - @header = "County (optional)" + @copy_key = "sales.property_information.address.county" @type = "text" @plain_label = true - @check_answer_label = "County" @disable_clearing_if_not_routed_or_dynamic_answer_options = true @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @hide_question_number_on_page = true diff --git a/app/models/form/sales/questions/monthly_charges_value_check.rb b/app/models/form/sales/questions/monthly_charges_value_check.rb index 90fcf4545..615238cda 100644 --- a/app/models/form/sales/questions/monthly_charges_value_check.rb +++ b/app/models/form/sales/questions/monthly_charges_value_check.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::MonthlyChargesValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "monthly_charges_value_check" - @check_answer_label = "Monthly charges confirmation" - @header = "Are you sure this is correct?" + @copy_key = "sales.soft_validations.monthly_charges_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/no_address_found.rb b/app/models/form/sales/questions/no_address_found.rb index 0db041111..06d92b594 100644 --- a/app/models/form/sales/questions/no_address_found.rb +++ b/app/models/form/sales/questions/no_address_found.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::NoAddressFound < ::Form::Question def initialize(id, hsh, page) super @id = "address_search_value_check" - @header = "No address found" + @copy_key = "sales.soft_validations.address_search_value_check" @type = "interruption_screen" @hidden_in_check_answers = true end diff --git a/app/models/form/sales/questions/percentage_discount_value_check.rb b/app/models/form/sales/questions/percentage_discount_value_check.rb index 9ac5547b4..5a1e7a045 100644 --- a/app/models/form/sales/questions/percentage_discount_value_check.rb +++ b/app/models/form/sales/questions/percentage_discount_value_check.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::PercentageDiscountValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "percentage_discount_value_check" - @check_answer_label = "Percentage discount confirmation" - @header = "Are you sure this is correct?" + @copy_key = "sales.soft_validations.percentage_discount_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/postcode.rb b/app/models/form/sales/questions/postcode.rb deleted file mode 100644 index 55e33199a..000000000 --- a/app/models/form/sales/questions/postcode.rb +++ /dev/null @@ -1,22 +0,0 @@ -class Form::Sales::Questions::Postcode < ::Form::Question - def initialize(id, hsh, page) - super - @id = "postcode_full" - @check_answer_label = "Property’s postcode" - @header = "Postcode" - @type = "text" - @width = 5 - @inferred_check_answers_value = [{ - "condition" => { - "pcodenk" => 1, - }, - "value" => "Not known", - }] - @inferred_answers = { - "la" => { - "is_la_inferred" => true, - }, - } - @disable_clearing_if_not_routed_or_dynamic_answer_options = true - end -end diff --git a/app/models/form/sales/questions/postcode_for_address_matcher.rb b/app/models/form/sales/questions/postcode_for_address_matcher.rb index 421cdc4fc..945bdc2ad 100644 --- a/app/models/form/sales/questions/postcode_for_address_matcher.rb +++ b/app/models/form/sales/questions/postcode_for_address_matcher.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::PostcodeForAddressMatcher < ::Form::Question def initialize(id, hsh, page) super @id = "postcode_full_input" - @header = "Postcode" + @copy_key = "sales.property_information.address_matcher.postcode_full_input" @type = "text" @width = 5 @plain_label = true diff --git a/app/models/form/sales/questions/postcode_for_full_address.rb b/app/models/form/sales/questions/postcode_for_full_address.rb index 74c235ab7..34fbea00b 100644 --- a/app/models/form/sales/questions/postcode_for_full_address.rb +++ b/app/models/form/sales/questions/postcode_for_full_address.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::PostcodeForFullAddress < ::Form::Question def initialize(id, hsh, page) super @id = "postcode_full" - @header = "Postcode" + @copy_key = "sales.property_information.address.postcode_full" @type = "text" @width = 5 @inferred_check_answers_value = [{ @@ -17,7 +17,6 @@ class Form::Sales::Questions::PostcodeForFullAddress < ::Form::Question }, } @plain_label = true - @check_answer_label = "Postcode" @disable_clearing_if_not_routed_or_dynamic_answer_options = true @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @hide_question_number_on_page = true diff --git a/app/models/form/sales/questions/postcode_known.rb b/app/models/form/sales/questions/postcode_known.rb deleted file mode 100644 index 10a3e2765..000000000 --- a/app/models/form/sales/questions/postcode_known.rb +++ /dev/null @@ -1,29 +0,0 @@ -class Form::Sales::Questions::PostcodeKnown < ::Form::Question - def initialize(id, hsh, page) - super - @id = "pcodenk" - @check_answer_label = "Property’s postcode" - @header = "Do you know the property’s postcode?" - @type = "radio" - @answer_options = ANSWER_OPTIONS - @conditional_for = { - "postcode_full" => [0], - } - @hidden_in_check_answers = { - "depends_on" => [ - { - "pcodenk" => 0, - }, - { - "pcodenk" => 1, - }, - ], - } - @disable_clearing_if_not_routed_or_dynamic_answer_options = true - end - - ANSWER_OPTIONS = { - "0" => { "value" => "Yes" }, - "1" => { "value" => "No" }, - }.freeze -end diff --git a/app/models/form/sales/questions/previous_la_known.rb b/app/models/form/sales/questions/previous_la_known.rb index 7a31fbd74..a54a98d11 100644 --- a/app/models/form/sales/questions/previous_la_known.rb +++ b/app/models/form/sales/questions/previous_la_known.rb @@ -2,11 +2,9 @@ class Form::Sales::Questions::PreviousLaKnown < ::Form::Question def initialize(id, hsh, page) super @id = "previous_la_known" - @check_answer_label = "Local authority of buyer 1’s last settled accommodation" - @header = "Do you know the local authority of buyer 1’s last settled accommodation?" + @copy_key = "sales.household_situation.last_accommodation_la.previous_la_known" @type = "radio" @answer_options = ANSWER_OPTIONS - @hint_text = "This is also known as the household’s 'last settled home'" @hidden_in_check_answers = { "depends_on" => [ { diff --git a/app/models/form/sales/questions/previous_postcode.rb b/app/models/form/sales/questions/previous_postcode.rb index a0a4fe725..32b4e153e 100644 --- a/app/models/form/sales/questions/previous_postcode.rb +++ b/app/models/form/sales/questions/previous_postcode.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::PreviousPostcode < ::Form::Question def initialize(id, hsh, page) super @id = "ppostcode_full" - @check_answer_label = "Postcode of buyer 1’s last settled accommodation" - @header = "Postcode" + @copy_key = "sales.household_situation.last_accommodation.ppostcode_full" @type = "text" @width = 5 @inferred_check_answers_value = [{ diff --git a/app/models/form/sales/questions/previous_postcode_known.rb b/app/models/form/sales/questions/previous_postcode_known.rb index d9df53f6c..c2156b887 100644 --- a/app/models/form/sales/questions/previous_postcode_known.rb +++ b/app/models/form/sales/questions/previous_postcode_known.rb @@ -2,14 +2,12 @@ class Form::Sales::Questions::PreviousPostcodeKnown < ::Form::Question def initialize(id, hsh, page) super @id = "ppcodenk" - @check_answer_label = "Buyer 1’s last settled accommodation" - @header = "Do you know the postcode of buyer 1’s last settled accommodation?" + @copy_key = "sales.household_situation.last_accommodation.ppcodenk" @type = "radio" @answer_options = ANSWER_OPTIONS @conditional_for = { "ppostcode_full" => [0], } - @hint_text = "This is also known as the household’s 'last settled home'" @hidden_in_check_answers = { "depends_on" => [ { diff --git a/app/models/form/sales/questions/previous_tenure_buyer2.rb b/app/models/form/sales/questions/previous_tenure_buyer2.rb index 2873b8dc5..db606e254 100644 --- a/app/models/form/sales/questions/previous_tenure_buyer2.rb +++ b/app/models/form/sales/questions/previous_tenure_buyer2.rb @@ -2,10 +2,7 @@ class Form::Sales::Questions::PreviousTenureBuyer2 < ::Form::Question def initialize(id, hsh, page) super @id = "prevtenbuy2" - @check_answer_label = "Buyer 2’s previous tenure" - @header = "What was buyer 2’s previous tenure?" @type = "radio" - @hint_text = "" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/prevloc.rb b/app/models/form/sales/questions/prevloc.rb index b8c46f427..5deb48877 100644 --- a/app/models/form/sales/questions/prevloc.rb +++ b/app/models/form/sales/questions/prevloc.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::Prevloc < ::Form::Question def initialize(id, hsh, page) super @id = "prevloc" - @check_answer_label = "Local authority of buyer 1’s last settled accommodation" - @header = "Select a local authority" + @copy_key = "sales.household_situation.last_accommodation_la.prevloc" @type = "select" @inferred_check_answers_value = [{ "condition" => { diff --git a/app/models/form/sales/questions/property_building_type.rb b/app/models/form/sales/questions/property_building_type.rb index f8f7e3905..42b65a57a 100644 --- a/app/models/form/sales/questions/property_building_type.rb +++ b/app/models/form/sales/questions/property_building_type.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::PropertyBuildingType < ::Form::Question def initialize(id, hsh, page) super @id = "builtype" - @check_answer_label = "Type of building" - @header = "What type of building is the property?" + @copy_key = "sales.property_information.builtype" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/property_local_authority.rb b/app/models/form/sales/questions/property_local_authority.rb index 2a8d3cc69..053ee8fde 100644 --- a/app/models/form/sales/questions/property_local_authority.rb +++ b/app/models/form/sales/questions/property_local_authority.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::PropertyLocalAuthority < ::Form::Question def initialize(id, hsh, page) super @id = "la" - @check_answer_label = "Local authority" - @header = "What is the property’s local authority?" @type = "select" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @disable_clearing_if_not_routed_or_dynamic_answer_options = true diff --git a/app/models/form/sales/questions/property_local_authority_known.rb b/app/models/form/sales/questions/property_local_authority_known.rb deleted file mode 100644 index b18486c6a..000000000 --- a/app/models/form/sales/questions/property_local_authority_known.rb +++ /dev/null @@ -1,26 +0,0 @@ -class Form::Sales::Questions::PropertyLocalAuthorityKnown < ::Form::Question - def initialize(id, hsh, page) - super - @id = "la_known" - @check_answer_label = "Local authority known" - @header = "Do you know the property’s local authority?" - @type = "radio" - @answer_options = ANSWER_OPTIONS - @conditional_for = { "la" => [1] } - @hidden_in_check_answers = { - "depends_on" => [ - { - "la_known" => 1, - }, - ], - } - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] - end - - ANSWER_OPTIONS = { - "1" => { "value" => "Yes" }, - "0" => { "value" => "No" }, - }.freeze - - QUESTION_NUMBER_FROM_YEAR = { 2023 => 16, 2024 => 17 }.freeze -end diff --git a/app/models/form/sales/questions/property_number_of_bedrooms.rb b/app/models/form/sales/questions/property_number_of_bedrooms.rb index b8462b6fa..c394fe334 100644 --- a/app/models/form/sales/questions/property_number_of_bedrooms.rb +++ b/app/models/form/sales/questions/property_number_of_bedrooms.rb @@ -2,9 +2,7 @@ class Form::Sales::Questions::PropertyNumberOfBedrooms < ::Form::Question def initialize(id, hsh, page) super @id = "beds" - @check_answer_label = "Number of bedrooms" - @header = "How many bedrooms does the property have?" - @hint_text = "A bedsit has 1 bedroom" + @copy_key = "sales.property_information.beds" @type = "numeric" @width = 2 @min = 1 diff --git a/app/models/form/sales/questions/property_unit_type.rb b/app/models/form/sales/questions/property_unit_type.rb index 1622473ec..45e935941 100644 --- a/app/models/form/sales/questions/property_unit_type.rb +++ b/app/models/form/sales/questions/property_unit_type.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::PropertyUnitType < ::Form::Question def initialize(id, hsh, page) super @id = "proptype" - @check_answer_label = "Type of unit" - @header = "What type of unit is the property?" + @copy_key = "sales.property_information.proptype" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/property_wheelchair_accessible.rb b/app/models/form/sales/questions/property_wheelchair_accessible.rb index 1569725c5..fd79bda9e 100644 --- a/app/models/form/sales/questions/property_wheelchair_accessible.rb +++ b/app/models/form/sales/questions/property_wheelchair_accessible.rb @@ -2,12 +2,10 @@ class Form::Sales::Questions::PropertyWheelchairAccessible < ::Form::Question def initialize(id, hsh, page) super @id = "wchair" - @check_answer_label = "Property built or adapted to wheelchair-user standards" - @header = "Is the property built or adapted to wheelchair-user standards?" + @copy_key = "sales.property_information.wchair" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] - @hint_text = form.start_year_after_2024? ? "This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property." : nil end ANSWER_OPTIONS = { diff --git a/app/models/form/sales/questions/town_or_city.rb b/app/models/form/sales/questions/town_or_city.rb index 18f6298f3..9536c024f 100644 --- a/app/models/form/sales/questions/town_or_city.rb +++ b/app/models/form/sales/questions/town_or_city.rb @@ -2,10 +2,9 @@ class Form::Sales::Questions::TownOrCity < ::Form::Question def initialize(id, hsh, page) super @id = "town_or_city" - @header = "Town or city" + @copy_key = "sales.property_information.address.town_or_city" @type = "text" @plain_label = true - @check_answer_label = "Town or city" @disable_clearing_if_not_routed_or_dynamic_answer_options = true @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @hide_question_number_on_page = true diff --git a/app/models/form/sales/questions/uprn.rb b/app/models/form/sales/questions/uprn.rb index 94aaccb43..ea0df85ab 100644 --- a/app/models/form/sales/questions/uprn.rb +++ b/app/models/form/sales/questions/uprn.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::Uprn < ::Form::Question def initialize(id, hsh, page) super @id = "uprn" - @check_answer_label = "UPRN" - @header = "What is the property's UPRN?" + @copy_key = "sales.property_information.uprn.uprn" @type = "text" @width = 10 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/uprn_confirmation.rb b/app/models/form/sales/questions/uprn_confirmation.rb index 6954a6ea5..94c1afa36 100644 --- a/app/models/form/sales/questions/uprn_confirmation.rb +++ b/app/models/form/sales/questions/uprn_confirmation.rb @@ -2,9 +2,7 @@ class Form::Sales::Questions::UprnConfirmation < ::Form::Question def initialize(id, hsh, page) super @id = "uprn_confirmed" - @header = "Is this the property address?" @type = "radio" - @check_answer_label = "Is this the right address?" end def answer_options diff --git a/app/models/form/sales/questions/uprn_known.rb b/app/models/form/sales/questions/uprn_known.rb index fdd0c9e9a..e35642bee 100644 --- a/app/models/form/sales/questions/uprn_known.rb +++ b/app/models/form/sales/questions/uprn_known.rb @@ -2,13 +2,9 @@ class Form::Sales::Questions::UprnKnown < ::Form::Question def initialize(id, hsh, page) super @id = "uprn_known" - @check_answer_label = "UPRN known?" - @header = "Do you know the property's UPRN?" + @copy_key = "sales.property_information.uprn.uprn_known" @type = "radio" @answer_options = ANSWER_OPTIONS - @hint_text = "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

- The UPRN may not be the same as the property reference assigned by your organisation.

- If you don’t know the UPRN you can enter the address of the property instead on the next screen." @conditional_for = { "uprn" => [1] } @inferred_check_answers_value = [ { diff --git a/app/models/form/sales/questions/uprn_selection.rb b/app/models/form/sales/questions/uprn_selection.rb index f916dcd47..282aed353 100644 --- a/app/models/form/sales/questions/uprn_selection.rb +++ b/app/models/form/sales/questions/uprn_selection.rb @@ -2,9 +2,7 @@ class Form::Sales::Questions::UprnSelection < ::Form::Question def initialize(id, hsh, page) super @id = "uprn_selection" - @header = "Select the correct address" @type = "radio" - @check_answer_label = "Select the correct address" @disable_clearing_if_not_routed_or_dynamic_answer_options = true end diff --git a/app/models/form/sales/subsections/property_information.rb b/app/models/form/sales/subsections/property_information.rb index 2c530ab60..c59c159ae 100644 --- a/app/models/form/sales/subsections/property_information.rb +++ b/app/models/form/sales/subsections/property_information.rb @@ -16,7 +16,6 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection Form::Sales::Pages::PercentageDiscountValueCheck.new("percentage_discount_proptype_value_check", nil, self), Form::Sales::Pages::PropertyBuildingType.new(nil, nil, self), (uprn_questions if form.start_date.year == 2023), - (postcode_and_la_questions if form.start_date.year < 2023), Form::Sales::Pages::PropertyWheelchairAccessible.new(nil, nil, self), ].flatten.compact end @@ -49,15 +48,4 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection ] end end - - def postcode_and_la_questions - [ - Form::Sales::Pages::Postcode.new(nil, nil, self), - Form::Sales::Pages::PropertyLocalAuthority.new(nil, nil, self), - Form::Sales::Pages::Buyer1IncomeMaxValueCheck.new("local_authority_buyer_1_income_max_value_check", nil, self, check_answers_card_number: nil), - Form::Sales::Pages::Buyer2IncomeMaxValueCheck.new("local_authority_buyer_2_income_max_value_check", nil, self, check_answers_card_number: nil), - Form::Sales::Pages::CombinedIncomeMaxValueCheck.new("local_authority_combined_income_max_value_check", nil, self, check_answers_card_number: nil), - Form::Sales::Pages::AboutPriceValueCheck.new("about_price_la_value_check", nil, self), - ] - end end diff --git a/app/models/validations/date_validations.rb b/app/models/validations/date_validations.rb index dce5c1ef0..7462290b6 100644 --- a/app/models/validations/date_validations.rb +++ b/app/models/validations/date_validations.rb @@ -4,30 +4,30 @@ module Validations::DateValidations def validate_property_major_repairs(record) date_valid?("mrcdate", record) if record["startdate"].present? && record["mrcdate"].present? && record["startdate"] < record["mrcdate"] - record.errors.add :mrcdate, I18n.t("validations.property.mrcdate.before_tenancy_start") + record.errors.add :mrcdate, I18n.t("validations.lettings.date.mrcdate.before_tenancy_start") end if is_rsnvac_first_let?(record) && record["mrcdate"].present? - record.errors.add :mrcdate, I18n.t("validations.property.mrcdate.not_first_let") + record.errors.add :mrcdate, I18n.t("validations.lettings.date.mrcdate.not_first_let") end if record["mrcdate"].present? && record["startdate"].present? && record["startdate"].to_date - record["mrcdate"].to_date > 3650 - record.errors.add :mrcdate, I18n.t("validations.property.mrcdate.ten_years_before_tenancy_start") + record.errors.add :mrcdate, I18n.t("validations.lettings.date.mrcdate.ten_years_before_tenancy_start") end end def validate_property_void_date(record) if record["voiddate"].present? && record["startdate"].present? && record["startdate"].to_date - record["voiddate"].to_date > 3650 - record.errors.add :voiddate, I18n.t("validations.property.void_date.ten_years_before_tenancy_start") + record.errors.add :voiddate, I18n.t("validations.lettings.date.void_date.ten_years_before_tenancy_start") end if record["voiddate"].present? && record["startdate"].present? && record["startdate"].to_date < record["voiddate"].to_date - record.errors.add :voiddate, I18n.t("validations.property.void_date.before_tenancy_start") + record.errors.add :voiddate, I18n.t("validations.lettings.date.void_date.before_tenancy_start") end if record["voiddate"].present? && record["mrcdate"].present? && record["mrcdate"].to_date < record["voiddate"].to_date - record.errors.add :voiddate, :after_mrcdate, message: I18n.t("validations.property.void_date.after_mrcdate") - record.errors.add :mrcdate, I18n.t("validations.property.mrcdate.before_void_date") + record.errors.add :voiddate, :after_mrcdate, message: I18n.t("validations.lettings.date.void_date.after_mrcdate") + record.errors.add :mrcdate, I18n.t("validations.lettings.date.mrcdate.before_void_date") end end @@ -35,19 +35,19 @@ module Validations::DateValidations return unless record.startdate && date_valid?("startdate", record) if record["voiddate"].present? && record.startdate < record["voiddate"] - record.errors.add :startdate, I18n.t("validations.setup.startdate.after_void_date") + record.errors.add :startdate, I18n.t("validations.lettings.date.startdate.after_void_date") end if record["mrcdate"].present? && record.startdate < record["mrcdate"] - record.errors.add :startdate, I18n.t("validations.setup.startdate.after_major_repair_date") + record.errors.add :startdate, I18n.t("validations.lettings.date.startdate.after_major_repair_date") end if record["voiddate"].present? && record["startdate"].to_date - record["voiddate"].to_date > 3650 - record.errors.add :startdate, I18n.t("validations.setup.startdate.ten_years_after_void_date") + record.errors.add :startdate, I18n.t("validations.lettings.date.startdate.ten_years_after_void_date") end if record["mrcdate"].present? && record["startdate"].to_date - record["mrcdate"].to_date > 3650 - record.errors.add :startdate, I18n.t("validations.setup.startdate.ten_years_after_mrc_date") + record.errors.add :startdate, I18n.t("validations.lettings.date.startdate.ten_years_after_mrc_date") end end diff --git a/app/models/validations/soft_validations.rb b/app/models/validations/soft_validations.rb index 41309cef0..0b76f792b 100644 --- a/app/models/validations/soft_validations.rb +++ b/app/models/validations/soft_validations.rb @@ -27,6 +27,14 @@ module Validations::SoftValidations weekly_net_income.between?(applicable_income_range.hard_min, applicable_income_range.soft_min) end + def rent_soft_validation_triggered? + rent_in_soft_min_range? || rent_in_soft_max_range? + end + + def rent_soft_validation_higher_or_lower_text + rent_in_soft_min_range? ? "lower" : "higher" + end + def rent_in_soft_min_range? return unless brent && weekly_value(brent) && startdate diff --git a/app/views/content/accessibility_statement.md b/app/views/content/accessibility_statement.md index a49bd999c..1d861fdcf 100644 --- a/app/views/content/accessibility_statement.md +++ b/app/views/content/accessibility_statement.md @@ -32,11 +32,11 @@ If you need information on this website in a different format like accessible PD We’ll consider your request and get back to you in 2 working days. -You can also [contact us through the helpdesk](https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11). +You can also [contact us through the helpdesk](https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11). ### Reporting accessibility problems with this website -We’re always looking to improve the accessibility of this website. If you find any problems not listed on this page or think we’re not meeting accessibility requirements, [contact the helpdesk](https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11). +We’re always looking to improve the accessibility of this website. If you find any problems not listed on this page or think we’re not meeting accessibility requirements, [contact the helpdesk](https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11). ### Enforcement procedure diff --git a/app/views/organisations/duplicate_schemes.html.erb b/app/views/organisations/duplicate_schemes.html.erb index 427cf427c..79f7d435f 100644 --- a/app/views/organisations/duplicate_schemes.html.erb +++ b/app/views/organisations/duplicate_schemes.html.erb @@ -56,6 +56,8 @@ <% end %> +

The links below open in a new tab.

+ <%= govuk_table do |table| %> <%= table.with_head do |head| %> <% head.with_row do |row| %> @@ -69,7 +71,7 @@
    <% duplicate_set.each do |scheme| %>
  1. - <%= govuk_link_to scheme.service_name, scheme %> + <%= govuk_link_to scheme.service_name, scheme, target: "#" %>
  2. <% end %>
@@ -93,6 +95,8 @@ <% end %> +

The links below open in a new tab.

+ <%= govuk_table do |table| %> <%= table.with_head do |head| %> <% head.with_row do |row| %> @@ -107,13 +111,13 @@
    <% duplicate_set[:locations].each do |location| %>
  1. - <%= govuk_link_to location.name, scheme_location_path(location) %> + <%= govuk_link_to location.name, scheme_location_path(location), target: "#" %>
  2. <% end %>
<% end %> <% row.with_cell do %> - <%= govuk_link_to duplicate_set[:scheme].service_name, duplicate_set[:scheme] %> + <%= govuk_link_to duplicate_set[:scheme].service_name, duplicate_set[:scheme], target: "#" %> <% end %> <% end %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 5ae2579d8..106ccb9fa 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -288,12 +288,7 @@ en: startdate: before_scheme_end_date: "The tenancy start date must be before the end date for this supported housing scheme." - after_void_date: "Enter a tenancy start date that is after the void date." - after_major_repair_date: "Enter a tenancy start date that is after the major repair date." year_not_two_or_four_digits: "Tenancy start year must be 2 or 4 digits." - ten_years_after_void_date: "Enter a tenancy start date that is no more than 10 years after the void date." - ten_years_after_mrc_date: "Enter a tenancy start date that is no more than 10 years after the major repairs completion date." - location: deactivated: startdate: "The location %{postcode} is inactive on this date. Enter another date or choose another location." @@ -330,15 +325,6 @@ en: invalid: "UPRN must be 12 digits or less." uprn_known: invalid: "You must answer UPRN known?" - mrcdate: - before_tenancy_start: "Enter a major repairs date that is before the tenancy start date." - not_first_let: "Major repairs date must not be completed if the tenancy is a first let." - ten_years_before_tenancy_start: "Enter a major repairs completion date that is no more than 10 years before the tenancy start date." - before_void_date: "Major repairs date must be after the void date if provided." - void_date: - ten_years_before_tenancy_start: "Enter a void date no more than 10 years before the tenancy start date." - before_tenancy_start: "Enter a void date that is before the tenancy start date." - after_mrcdate: "Void date must be before the major repairs date if provided." la: la_invalid_for_org: "%{org_name} does not operate in %{la_name}." postcode_invalid_for_org: "Enter a postcode in an area covered by %{org_name}." @@ -617,9 +603,6 @@ en: outside_range_title: "You told us the rent is %{brent}." informative_text: "This is %{higher_or_lower} than we would expect." hint_text: "Check the following:" - purchase_price: - title_text: "You told us the purchase price is %{value}." - hint_text: "This is %{higher_or_lower} than we would expect." staircase_owned: title_text: one: "You told us that the buyer now owns %{stairowned} of the property." @@ -651,17 +634,11 @@ Make sure these answers are correct." staircase_bought_seems_high: title_text: "You told us that %{percentage}% was bought in this staircasing transaction." hint_text: "Most staircasing transactions are less than 50%" - monthly_charges_over_soft_max: - title_text: "You told us that the monthly charges were %{mscharge}." - hint_text: "This is higher than we would expect." discounted_sale_value: title_text: "Mortgage, deposit, and grant total must equal %{value_with_discount}." informative_text: "Your given mortgage, deposit and grant total is %{mortgage_deposit_and_grant_total}." care_home_charges: title_text: "Care home charges should be provided if this is a care home accommodation." - percentage_discount_value: - title_text: "You told us that the percentage discount is %{discount}." - hint_text: "This is higher than we would expect." grant: title_text: "You told us that the grant amount is %{grant}." hint_text: "Loans, grants and subsidies are usually between £9,000 and £16,000." @@ -689,9 +666,6 @@ Make sure these answers are correct." must_be_less_than_3_years_from_saledate: "You told us practical completion or handover date is more than 3 years before sale completion date." saledate: must_be_less_than_3_years_from_hodate: "You told us sale completion date is more than 3 years after practical completion or handover date." - no_address_found: - title_text: "No address found." - informative_text: "We could not find an address that matches your search. You can search again or continue to enter the address manually." partner_under_16_lettings: title: "You told us this person is aged %{age} years and has 'Partner' relationship to the lead tenant." multiple_partners_lettings: @@ -733,7 +707,6 @@ Make sure these answers are correct." stairowned: one: "What percentage of the property does the buyer now own in total?" other: "What percentage of the property do the buyers now own in total?" - offered: "How many times was the property offered between becoming vacant and this letting?" hints: location: @@ -746,7 +719,6 @@ Make sure these answers are correct." toggle_active: "If the date is before %{date}, select ‘From the start of the open collection period’ because the previous period has now closed." bulk_upload: needstype: "General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing can include direct access hostels, group homes, residential care and nursing homes." - offered: "Do not include the offer that led to this letting. This is after the last tenancy ended. If the property is being offered for let for the first time, enter 0." check_answer_labels: soctenant: @@ -755,7 +727,6 @@ Make sure these answers are correct." stairowned: one: "Percentage the buyer now owns in total." other: "Percentage the buyers now own in total." - offered: "Times previously offered since becoming available." warnings: organisation: diff --git a/config/locales/forms/2023/lettings/property_information.en.yml b/config/locales/forms/2023/lettings/property_information.en.yml new file mode 100644 index 000000000..f1b652935 --- /dev/null +++ b/config/locales/forms/2023/lettings/property_information.en.yml @@ -0,0 +1,104 @@ +en: + forms: + 2023: + lettings: + property_information: + uprn: + page_header: "" + uprn_known: + check_answer_label: "UPRN known?" + hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

The UPRN may not be the same as the property reference assigned by your organisation.

If you don’t know the UPRN you can enter the address of the property instead on the next screen." + question_text: "Do you know the property's UPRN?" + uprn: + check_answer_label: "UPRN" + hint_text: "" + question_text: "What is the property's UPRN?" + + uprn_confirmed: + page_header: "We found an address that might be this property" + check_answer_label: "Is this the right address?" + hint_text: "" + question_text: "Is this the property address?" + + address: + page_header: "Q12 - What is the property's address?" + address_line1: + check_answer_label: "Address lines 1 and 2" + hint_text: "" + question_text: "Address line 1" + address_line2: + check_answer_label: "" + hint_text: "" + question_text: "Address line 2 (optional)" + town_or_city: + check_answer_label: "Town or city" + hint_text: "" + question_text: "Town or city" + county: + check_answer_label: "County" + hint_text: "" + question_text: "County (optional)" + postcode_full: + check_answer_label: "Postcode" + hint_text: "" + question_text: "Postcode" + + la: + page_header: "" + check_answer_label: "Local authority" + hint_text: "" + question_text: "What is the property’s local authority?" + + first_time_property_let_as_social_housing: + page_header: "" + check_answer_label: "First time being let as social-housing?" + hint_text: "" + question_text: "Is this the first time the property has been let as social housing?" + + unitletas: + page_header: "" + check_answer_label: "Most recent let type" + hint_text: "" + question_text: "What type was the property most recently let as?" + + rsnvac: + page_header: "" + check_answer_label: "Vacancy reason" + hint_text: "" + question_text: "What is the reason for the property being vacant?" + + offered: + page_header: "" + check_answer_label: "Times previously offered since becoming available." + hint_text: "Do not include the offer that led to this letting. This is after the last tenancy ended. If the property is being offered for let for the first time, enter 0." + question_text: "How many times was the property offered between becoming vacant and this letting?" + + unittype_gn: + page_header: "" + check_answer_label: "Type of unit" + hint_text: "" + question_text: "What type of unit is the property?" + + builtype: + page_header: "" + check_answer_label: "Type of building" + hint_text: "" + question_text: "What type of building is the property?" + + wchair: + page_header: "" + check_answer_label: "Property built or adapted to wheelchair-user standards" + hint_text: "" + question_text: "Is the property built or adapted to wheelchair-user standards?" + + beds: + page_header: "" + check_answer_label: "Number of bedrooms" + hint_text: "If shared accommodation, enter the number of bedrooms occupied by this household. A bedsit has 1 bedroom." + question_text: "How many bedrooms does the property have?" + + voiddate: + page_header: "Void date" + check_answer_label: "Void date" + hint_text: "" + question_text: "What is the void date?" diff --git a/config/locales/forms/2023/lettings/tenancy_information.en.yml b/config/locales/forms/2023/lettings/tenancy_information.en.yml new file mode 100644 index 000000000..e9331d4dc --- /dev/null +++ b/config/locales/forms/2023/lettings/tenancy_information.en.yml @@ -0,0 +1,66 @@ +en: + forms: + 2023: + lettings: + tenancy_information: + joint: + page_header: "" + check_answer_label: "Is this a joint tenancy?" + hint_text: "" + question_text: "Is this a joint tenancy?" + + startertenancy: + page_header: "" + check_answer_label: "Is this a starter or introductory tenancy?" + hint_text: "This is also known as an ‘introductory period’." + question_text: "Is this a starter tenancy?" + + tenancy: + tenancy_type: + page_header: "" + tenancy: + check_answer_label: "Type of main tenancy" + hint_text: "" + question_text: "What is the type of tenancy?" + tenancyother: + check_answer_label: "" + hint_text: "" + question_text: "Please state the tenancy type" + starter_tenancy_type: + page_header: "" + tenancy: + check_answer_label: "Type of main tenancy after the starter period has ended" + hint_text: "This is also known as an ‘introductory period’." + question_text: "What is the type of tenancy after the starter period has ended?" + tenancyother: + check_answer_label: "" + hint_text: "" + question_text: "Please state the tenancy type" + + tenancylength: + tenancy_length: + page_header: "" + check_answer_label: "Length of fixed-term tenancy" + hint_text: "Do not include the starter or introductory period." + question_text: "What is the length of the fixed-term tenancy to the nearest year?" + tenancy_length_affordable_rent: + page_header: "" + check_answer_label: "Length of fixed-term tenancy" + hint_text: "Do not include the starter or introductory period.
The minimum period is 2 years for social or affordable rent general needs logs and you do not need a log for shorter tenancies." + question_text: "What is the length of the fixed-term tenancy to the nearest year?" + tenancy_length_intermediate_rent: + page_header: "" + check_answer_label: "Length of fixed-term tenancy" + hint_text: "Do not include the starter or introductory period.
The minimum period is 1 year for intermediate rent general needs logs and you do not need a log for shorter tenancies." + question_text: "What is the length of the fixed-term tenancy to the nearest year?" + tenancy_length_periodic: + page_header: "" + check_answer_label: "Length of periodic tenancy" + hint_text: "As this is a periodic tenancy, this question is optional. If you do not have the information available click save and continue" + question_text: "What is the length of the periodic tenancy to the nearest year?" + + sheltered: + page_header: "" + check_answer_label: "Is this letting in sheltered accommodation?" + hint_text: "Sheltered housing and special retirement housing are for tenants with low-level care and support needs. This typically provides some limited support to enable independent living, such as alarm-based assistance or a scheme manager.

Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission." + question_text: "Is this letting in sheltered accommodation?" diff --git a/config/locales/forms/2023/sales/household_situation.en.yml b/config/locales/forms/2023/sales/household_situation.en.yml new file mode 100644 index 000000000..e22777a28 --- /dev/null +++ b/config/locales/forms/2023/sales/household_situation.en.yml @@ -0,0 +1,50 @@ +en: + forms: + 2023: + sales: + household_situation: + prevten: + page_header: "" + check_answer_label: "Buyer 1’s previous tenure" + hint_text: "" + question_text: "What was buyer 1’s previous tenure?" + + last_accommodation: + page_header: "" + ppcodenk: + check_answer_label: "Buyer 1’s last settled accommodation" + hint_text: "This is also known as the household’s 'last settled home'" + question_text: "Do you know the postcode of buyer 1’s last settled accommodation?" + ppostcode_full: + check_answer_label: "Postcode of buyer 1’s last settled accommodation" + hint_text: "" + question_text: "Postcode" + + last_accommodation_la: + page_header: "" + previous_la_known: + check_answer_label: "Local authority of buyer 1’s last settled accommodation" + hint_text: "This is also known as the household’s 'last settled home'" + question_text: "Do you know the local authority of buyer 1’s last settled accommodation?" + prevloc: + check_answer_label: "Local authority of buyer 1’s last settled accommodation" + hint_text: "" + question_text: "Select a local authority" + + buyers_organisations: + page_header: "" + check_answer_label: "Organisations buyers were registered with" + hint_text: "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue." + question_text: "What organisations were the buyers registered with?" + + buy2living: + page_header: "" + check_answer_label: "Buyer 2 living at the same address" + hint_text: "" + header: "At the time of purchase, was buyer 2 living at the same address as buyer 1?" + + prevtenbuy2: + page_header: "" + check_answer_label: "Buyer 2’s previous tenure" + hint_text: "" + question_text: "What was buyer 2’s previous tenure?" diff --git a/config/locales/forms/2023/sales/property_information.en.yml b/config/locales/forms/2023/sales/property_information.en.yml new file mode 100644 index 000000000..c4dd84130 --- /dev/null +++ b/config/locales/forms/2023/sales/property_information.en.yml @@ -0,0 +1,74 @@ +en: + forms: + 2023: + sales: + property_information: + uprn: + page_header: "" + uprn_known: + check_answer_label: "UPRN known?" + hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

The UPRN may not be the same as the property reference assigned by your organisation.

If you don’t know the UPRN you can enter the address of the property instead on the next screen." + question_text: "Do you know the property's UPRN?" + uprn: + check_answer_label: "UPRN" + hint_text: "" + question_text: "What is the property's UPRN?" + + uprn_confirmed: + page_header: "We found an address that might be this property" + check_answer_label: "Is this the right address?" + hint_text: "" + question_text: "Is this the property address?" + + address: + page_header: "Q15 - What is the property's address?" + address_line1: + check_answer_label: "Address lines 1 and 2" + hint_text: "" + question_text: "Address line 1" + address_line2: + check_answer_label: "" + hint_text: "" + question_text: "Address line 2 (optional)" + town_or_city: + check_answer_label: "Town or city" + hint_text: "" + question_text: "Town or city" + county: + check_answer_label: "County" + hint_text: "" + question_text: "County (optional)" + postcode_full: + check_answer_label: "Postcode" + hint_text: "" + question_text: "Postcode" + + la: + page_header: "" + check_answer_label: "Local authority" + hint_text: "" + question_text: "What is the property’s local authority?" + + beds: + page_header: "" + check_answer_label: "Number of bedrooms" + hint_text: "A bedsit has 1 bedroom." + question_text: "How many bedrooms does the property have?" + + proptype: + page_header: "" + check_answer_label: "Type of unit" + hint_text: "" + question_text: "What type of unit is the property?" + + builtype: + page_header: "" + check_answer_label: "Type of building" + hint_text: "" + question_text: "What type of building is the property?" + + wchair: + page_header: "" + check_answer_label: "Property built or adapted to wheelchair-user standards" + hint_text: "" + question_text: "Is the property built or adapted to wheelchair-user standards?" diff --git a/config/locales/forms/2023/sales/soft_validations.en.yml b/config/locales/forms/2023/sales/soft_validations.en.yml index 3467b9432..1c3cd4955 100644 --- a/config/locales/forms/2023/sales/soft_validations.en.yml +++ b/config/locales/forms/2023/sales/soft_validations.en.yml @@ -18,6 +18,7 @@ en: question_text: "Are you sure this person is retired?" title_text: "You told us this person is aged %{age} years and retired." informative_text: "The minimum expected retirement age in England is 66." + old_persons_shared_ownership_value_check: page_header: "" check_answer_label: "Shared ownership confirmation" @@ -27,6 +28,7 @@ en: joint_purchase: "You told us the buyers are using the Older Persons Shared Ownership scheme." not_joint_purchase: "You told us the buyer is using the Older Persons Shared Ownership scheme." informative_text: "At least one buyer must be aged 65 years and over to use this scheme." + income1_value_check: check_answer_label: "Buyer 1 income confirmation" hint_text: "" @@ -38,6 +40,7 @@ en: max: page_header: "" title_text: "You told us the income of buyer 1 is %{income}. This seems high. Are you sure this is correct?" + income2_value_check: check_answer_label: "Buyer 2 income confirmation" hint_text: "" @@ -49,12 +52,22 @@ en: max: page_header: "" title_text: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?" + combined_income_value_check: page_header: "" check_answer_label: "Combined income confirmation" hint_text: "" question_text: "Are you sure this is correct?" title_text: "You told us the combined income of this household is %{combined_income}. This seems high. Are you sure this is correct?" + + value_value_check: + page_header: "" + check_answer_label: "Purchase price confirmation" + hint_text: "" + question_text: "Are you sure?" + title_text: "You told us the purchase price is %{value}." + informative_text: "This is %{higher_or_lower} than we would expect." + mortgage_value_check: page_header: "" check_answer_label: "Mortgage confirmation" @@ -62,18 +75,36 @@ en: question_text: "Are you sure that the mortgage is more than 5 times the income used for the mortgage application?" title_text: "You told us that the mortgage amount is %{mortgage}." informative_text: "This is more than 5 times the income, which is higher than we would expect." + + monthly_charges_value_check: + page_header: "" + check_answer_label: "Monthly charges confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that the monthly charges were %{mscharge}." + informative_text: "This is higher than we would expect." + + percentage_discount_value_check: + page_header: "" + check_answer_label: "Percentage discount confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that the percentage discount is %{discount}." + informative_text: "This is higher than we would expect." + savings_value_check: page_header: "" check_answer_label: "Savings confirmation" hint_text: "" question_text: "Are you sure the savings are higher than £100,000?" joint_purchase: - title_text: You told us the buyers’ savings were %{savings}." + title_text: "You told us the buyers’ savings were %{savings}." informative_text: "This is higher than we would expect." not_joint_purchase: title_text: "You told us the buyer’s savings were %{savings}." informative_text: "This is higher than we would expect." - deposit_value_check:: + + deposit_value_check: page_header: "" check_answer_label: "Deposit confirmation" hint_text: "" @@ -84,12 +115,14 @@ en: not_joint_purchase: title_text: "You told us the buyer’s deposit was %{deposit} and their savings were %{savings}." informative_text: "The deposit amount is higher than we would expect for the amount of savings they have." + wheel_value_check: page_header: "" check_answer_label: "Does anyone in the household use a wheelchair?" hint_text: "" question_text: "You told us that someone in the household uses a wheelchair." title_text: "You told us that someone in the household uses a wheelchair." + buyer_livein_value_check: buyer1: page_header: "" @@ -105,6 +138,7 @@ en: question_text: "Are you sure this is correct?" title_text: "You told us that buyer 2 will not live in the property." informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property." + student_not_child_value_check: page_header: "" check_answer_label: "Student not a child confirmation" @@ -112,6 +146,7 @@ en: question_text: "Are you sure this person is not a child?" title_text: "You told us this person is a student aged between 16 and 19." informative_text: "Are you sure this person is not a child?" + partner_under_16_value_check: page_header: "" check_answer_label: "Partner under 16 confirmation" @@ -119,6 +154,7 @@ en: question_text: "Are you sure this is correct?" title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to buyer 1." informative_text: "Are you sure this is correct?" + multiple_partners_value_check: page_header: "" check_answer_label: "Multiple partners confirmation" diff --git a/config/locales/forms/2024/lettings/property_information.en.yml b/config/locales/forms/2024/lettings/property_information.en.yml new file mode 100644 index 000000000..012ff0e0d --- /dev/null +++ b/config/locales/forms/2024/lettings/property_information.en.yml @@ -0,0 +1,127 @@ +en: + forms: + 2024: + lettings: + property_information: + first_time_property_let_as_social_housing: + page_header: "" + check_answer_label: "First time being let as social-housing?" + hint_text: "" + question_text: "Is this the first time the property has been let as social housing?" + + uprn: + page_header: "" + uprn_known: + check_answer_label: "UPRN known?" + hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

The UPRN may not be the same as the property reference assigned by your organisation.

If you don’t know the UPRN you can enter the address of the property instead on the next screen." + question_text: "Do you know the property's UPRN?" + uprn: + check_answer_label: "UPRN" + hint_text: "" + question_text: "What is the property's UPRN?" + + uprn_confirmed: + page_header: "We found an address that might be this property" + check_answer_label: "Is this the right address?" + hint_text: "" + question_text: "Is this the property address?" + + address_matcher: + page_header: "Find an address" + address_line1_input: + check_answer_label: "Find address" + hint_text: "" + question_text: "Address line 1" + postcode_full_input: + check_answer_label: "" + hint_text: "" + question_text: "Postcode" + + uprn_selection: + page_header: "We found an address that might be this property" + check_answer_label: "Select the correct address" + hint_text: "" + question_text: "Select the correct address" + + address: + page_header: "Q12 - What is the property's address?" + address_line1: + check_answer_label: "Address lines 1 and 2" + hint_text: "" + question_text: "Address line 1" + address_line2: + check_answer_label: "" + hint_text: "" + question_text: "Address line 2 (optional)" + town_or_city: + check_answer_label: "Town or city" + hint_text: "" + question_text: "Town or city" + county: + check_answer_label: "County" + hint_text: "" + question_text: "County (optional)" + postcode_full: + check_answer_label: "Postcode" + hint_text: "" + question_text: "Postcode" + + la: + page_header: "" + check_answer_label: "Local authority" + hint_text: "" + question_text: "What is the property’s local authority?" + + + unitletas: + page_header: "" + check_answer_label: "Most recent let type" + hint_text: "This is the rent type of the previous tenancy in this property." + question_text: "What type was the property most recently let as?" + + rsnvac: + page_header: "" + check_answer_label: "Vacancy reason" + hint_text: "" + question_text: "What is the reason for the property being vacant?" + + unittype_gn: + page_header: "" + check_answer_label: "Type of unit" + hint_text: "" + question_text: "What type of unit is the property?" + + builtype: + page_header: "" + check_answer_label: "Type of building" + hint_text: "" + question_text: "What type of building is the property?" + + wchair: + page_header: "" + check_answer_label: "Property built or adapted to wheelchair-user standards" + hint_text: "This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property." + question_text: "Is the property built or adapted to wheelchair-user standards?" + + beds: + page_header: "" + check_answer_label: "Number of bedrooms" + hint_text: "If shared accommodation, enter the number of bedrooms occupied by this household." + question_text: "How many bedrooms does the property have?" + + voiddate: + page_header: "Void date" + check_answer_label: "Void date" + hint_text: "" + question_text: "What is the void date?" + + property_major_repairs: + page_header: "" + majorrepairs: + check_answer_label: "Major repairs carried out during void period" + hint_text: "Major repairs are works that could not be reasonably carried out with a tenant living at the property. For example, structural repairs." + question_text: "Were any major repairs carried out during the void period?" + mrcdate: + check_answer_label: "Completion date of repairs" + hint_text: "" + question_text: "When were the repairs completed?" diff --git a/config/locales/forms/2024/lettings/tenancy_information.en.yml b/config/locales/forms/2024/lettings/tenancy_information.en.yml new file mode 100644 index 000000000..bee380e7c --- /dev/null +++ b/config/locales/forms/2024/lettings/tenancy_information.en.yml @@ -0,0 +1,66 @@ +en: + forms: + 2024: + lettings: + tenancy_information: + joint: + page_header: "" + check_answer_label: "Is this a joint tenancy?" + hint_text: "This is where two or more people are named on the tenancy agreement" + question_text: "Is this a joint tenancy?" + + startertenancy: + page_header: "" + check_answer_label: "Is this a starter or introductory tenancy?" + hint_text: "If the tenancy has an ‘introductory period’ answer ‘yes’.

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

Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission." + question_text: "Is this letting in sheltered accommodation?" diff --git a/config/locales/forms/2024/sales/household_situation.en.yml b/config/locales/forms/2024/sales/household_situation.en.yml new file mode 100644 index 000000000..1ab6d540e --- /dev/null +++ b/config/locales/forms/2024/sales/household_situation.en.yml @@ -0,0 +1,50 @@ +en: + forms: + 2024: + sales: + household_situation: + prevten: + page_header: "" + check_answer_label: "Buyer 1’s previous tenure" + hint_text: "" + question_text: "What was buyer 1’s previous tenure?" + + last_accommodation: + page_header: "" + ppcodenk: + check_answer_label: "Buyer 1’s last settled accommodation" + hint_text: "This is also known as the household’s 'last settled home'" + question_text: "Do you know the postcode of buyer 1’s last settled accommodation?" + ppostcode_full: + check_answer_label: "Postcode of buyer 1’s last settled accommodation" + hint_text: "" + question_text: "Postcode" + + last_accommodation_la: + page_header: "" + previous_la_known: + check_answer_label: "Local authority of buyer 1’s last settled accommodation" + hint_text: "This is also known as the household’s 'last settled home'" + question_text: "Do you know the local authority of buyer 1’s last settled accommodation?" + prevloc: + check_answer_label: "Local authority of buyer 1’s last settled accommodation" + hint_text: "" + question_text: "Select a local authority" + + buyers_organisations: + page_header: "" + check_answer_label: "Organisations buyers were registered with" + hint_text: "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue." + question_text: "What organisations were the buyers registered with?" + + buy2living: + page_header: "" + check_answer_label: "Buyer 2 living at the same address" + hint_text: "" + question_text: "At the time of purchase, was buyer 2 living at the same address as buyer 1?" + + prevtenbuy2: + page_header: "" + check_answer_label: "Buyer 2’s previous tenure" + hint_text: "" + question_text: "What was buyer 2’s previous tenure?" diff --git a/config/locales/forms/2024/sales/property_information.en.yml b/config/locales/forms/2024/sales/property_information.en.yml new file mode 100644 index 000000000..269f4fdca --- /dev/null +++ b/config/locales/forms/2024/sales/property_information.en.yml @@ -0,0 +1,91 @@ +en: + forms: + 2024: + sales: + property_information: + uprn: + page_header: "" + uprn_known: + check_answer_label: "UPRN known?" + hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

The UPRN may not be the same as the property reference assigned by your organisation.

If you don’t know the UPRN you can enter the address of the property instead on the next screen." + question_text: "Do you know the property's UPRN?" + uprn: + check_answer_label: "UPRN" + hint_text: "" + question_text: "What is the property's UPRN?" + + uprn_confirmed: + page_header: "We found an address that might be this property" + check_answer_label: "Is this the right address?" + hint_text: "" + question_text: "Is this the property address?" + + address_matcher: + page_header: "Find an address" + address_line1_input: + check_answer_label: "Find address" + hint_text: "" + question_text: "Address line 1" + postcode_full_input: + check_answer_label: "" + hint_text: "" + question_text: "Postcode" + + uprn_selection: + page_header: "We found an address that might be this property" + check_answer_label: "Select the correct address" + hint_text: "" + question_text: "Select the correct address" + + address: + page_header: "Q12 - What is the property's address?" + address_line1: + check_answer_label: "Address lines 1 and 2" + hint_text: "" + question_text: "Address line 1" + address_line2: + check_answer_label: "" + hint_text: "" + question_text: "Address line 2 (optional)" + town_or_city: + check_answer_label: "Town or city" + hint_text: "" + question_text: "Town or city" + county: + check_answer_label: "County" + hint_text: "" + question_text: "County (optional)" + postcode_full: + check_answer_label: "Postcode" + hint_text: "" + question_text: "Postcode" + + la: + page_header: "" + check_answer_label: "Local authority" + hint_text: "" + question_text: "What is the property’s local authority?" + + beds: + page_header: "" + check_answer_label: "Number of bedrooms" + hint_text: "A bedsit has 1 bedroom." + question_text: "How many bedrooms does the property have?" + + proptype: + page_header: "" + check_answer_label: "Type of unit" + hint_text: "" + question_text: "What type of unit is the property?" + + builtype: + page_header: "" + check_answer_label: "Type of building" + hint_text: "" + question_text: "What type of building is the property?" + + wchair: + page_header: "" + check_answer_label: "Property built or adapted to wheelchair-user standards" + hint_text: "This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property." + question_text: "Is the property built or adapted to wheelchair-user standards?" diff --git a/config/locales/forms/2024/sales/soft_validations.en.yml b/config/locales/forms/2024/sales/soft_validations.en.yml index 39af6cb38..872db4679 100644 --- a/config/locales/forms/2024/sales/soft_validations.en.yml +++ b/config/locales/forms/2024/sales/soft_validations.en.yml @@ -38,6 +38,7 @@ en: max: page_header: "" title_text: "You told us the income of buyer 1 is %{income}. This seems high. Are you sure this is correct?" + income2_value_check: check_answer_label: "Buyer 2 income confirmation" hint_text: "" @@ -49,12 +50,23 @@ en: max: page_header: "" title_text: "You told us the income of buyer 2 is %{income}. This seems high. Are you sure this is correct?" + combined_income_value_check: page_header: "" check_answer_label: "Combined income confirmation" hint_text: "" question_text: "Are you sure this is correct?" title_text: "You told us the combined income of this household is %{combined_income}. This seems high. Are you sure this is correct?" + informative_text: "" + + value_value_check: + page_header: "" + check_answer_label: "Purchase price confirmation" + hint_text: "" + question_text: "Are you sure?" + title_text: "You told us the purchase price is %{value}." + informative_text: "This is %{higher_or_lower} than we would expect." + mortgage_value_check: page_header: "" check_answer_label: "Mortgage confirmation" @@ -62,17 +74,35 @@ en: question_text: "Are you sure that the mortgage is more than 5 times the income used for the mortgage application?" title_text: "You told us that the mortgage amount is %{mortgage}." informative_text: "This is more than 5 times the income, which is higher than we would expect." + + monthly_charges_value_check: + page_header: "" + check_answer_label: "Monthly charges confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that the monthly charges were %{mscharge}." + informative_text: "This is higher than we would expect." + + percentage_discount_value_check: + page_header: "" + check_answer_label: "Percentage discount confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that the percentage discount is %{discount}." + informative_text: "This is higher than we would expect." + savings_value_check: page_header: "" check_answer_label: "Savings confirmation" hint_text: "" question_text: "Are you sure the savings are higher than £100,000?" joint_purchase: - title_text: You told us the buyers’ savings were %{savings}." + title_text: "You told us the buyers’ savings were %{savings}." informative_text: "This is higher than we would expect." not_joint_purchase: title_text: "You told us the buyer’s savings were %{savings}." informative_text: "This is higher than we would expect." + deposit_value_check: page_header: "" check_answer_label: "Deposit confirmation" @@ -84,6 +114,15 @@ en: not_joint_purchase: title_text: "You told us the buyer’s deposit was %{deposit} and their savings were %{savings}." informative_text: "The deposit amount is higher than we would expect for the amount of savings they have." + + address_search_value_check: + page_header: "" + check_answer_label: "" + hint_text: "" + question_text: "" + title_text: "No address found." + informative_text: "We could not find an address that matches your search. You can search again or continue to enter the address manually." + wheel_value_check: page_header: "" check_answer_label: "Does anyone in the household use a wheelchair?" diff --git a/config/locales/validations/lettings/date.en.yml b/config/locales/validations/lettings/date.en.yml new file mode 100644 index 000000000..54c53996f --- /dev/null +++ b/config/locales/validations/lettings/date.en.yml @@ -0,0 +1,20 @@ +en: + validations: + lettings: + date: + startdate: + after_void_date: "Enter a tenancy start date that is after the void date." + after_major_repair_date: "Enter a tenancy start date that is after the major repair date." + ten_years_after_void_date: "Enter a tenancy start date that is no more than 10 years after the void date." + ten_years_after_mrc_date: "Enter a tenancy start date that is no more than 10 years after the major repairs completion date." + + mrcdate: + before_tenancy_start: "Enter a major repairs date that is before the tenancy start date." + not_first_let: "Major repairs date must not be completed if the tenancy is a first let." + ten_years_before_tenancy_start: "Enter a major repairs completion date that is no more than 10 years before the tenancy start date." + before_void_date: "Major repairs date must be after the void date if provided." + + void_date: + ten_years_before_tenancy_start: "Enter a void date no more than 10 years before the tenancy start date." + before_tenancy_start: "Enter a void date that is before the tenancy start date." + after_mrcdate: "Void date must be before the major repairs date if provided." diff --git a/spec/components/data_protection_confirmation_banner_component_spec.rb b/spec/components/data_protection_confirmation_banner_component_spec.rb index 608628093..fb687f25c 100644 --- a/spec/components/data_protection_confirmation_banner_component_spec.rb +++ b/spec/components/data_protection_confirmation_banner_component_spec.rb @@ -27,7 +27,7 @@ RSpec.describe DataProtectionConfirmationBannerComponent, type: :component do expect(component.display_banner?).to eq(true) expect(render).to have_link( "Contact helpdesk to assign a data protection officer", - href: "https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11", + href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11", ) expect(render).to have_selector("p", text: "To create logs your organisation must state a data protection officer. They must sign the Data Sharing Agreement.") end @@ -131,7 +131,7 @@ RSpec.describe DataProtectionConfirmationBannerComponent, type: :component do expect(component.display_banner?).to eq(true) expect(render).to have_link( "Contact helpdesk to assign a data protection officer", - href: "https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11", + href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11", ) expect(render).to have_selector("p", text: "To create logs your organisation must state a data protection officer. They must sign the Data Sharing Agreement.") end diff --git a/spec/mailers/csv_download_mailer_spec.rb b/spec/mailers/csv_download_mailer_spec.rb index 704d71e1e..138a0e4ce 100644 --- a/spec/mailers/csv_download_mailer_spec.rb +++ b/spec/mailers/csv_download_mailer_spec.rb @@ -42,7 +42,7 @@ RSpec.describe CsvDownloadMailer do ## Missing town or city The town or city in some logs is missing. This data is required in the new version of CORE.\n", how_to_fix: "You need to:\n -- download [this spreadsheet for lettings logs](#{link}). This link will expire in one week. To request another link, [contact the CORE helpdesk](https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11). +- download [this spreadsheet for lettings logs](#{link}). This link will expire in one week. To request another link, [contact the CORE helpdesk](https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11). - fill in the missing address data - check that the existing address data is correct\n", duration: "20 minutes", @@ -70,7 +70,7 @@ In some of your logs, the UPRN is the same as the purchaser code, but these are If a log has the correct UPRN, leave the UPRN unchanged. If the UPRN is incorrect, clear the value and provide the full address instead. Alternatively, you can change the UPRN on the CORE system.\n", how_to_fix: "You need to:\n -- download [this spreadsheet for sales logs](#{link}). This link will expire in one week. To request another link, [contact the CORE helpdesk](https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11). +- download [this spreadsheet for sales logs](#{link}). This link will expire in one week. To request another link, [contact the CORE helpdesk](https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11). - check that the address data is correct - correct any address errors\n", duration: "20 minutes", diff --git a/spec/models/form/lettings/pages/max_rent_value_check_spec.rb b/spec/models/form/lettings/pages/max_rent_value_check_spec.rb deleted file mode 100644 index 273272d8b..000000000 --- a/spec/models/form/lettings/pages/max_rent_value_check_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -require "rails_helper" - -RSpec.describe Form::Lettings::Pages::MaxRentValueCheck, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } - - let(:page_id) { "max_rent_value_check" } - let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1))) } - - it "has correct subsection" do - expect(page.subsection).to eq(subsection) - end - - it "has correct questions" do - expect(page.questions.map(&:id)).to eq(%w[rent_value_check]) - end - - it "has the correct id" do - expect(page.id).to eq("max_rent_value_check") - end - - it "has correct depends_on" do - expect(page.depends_on).to eq([{ "rent_in_soft_max_range?" => true }]) - end - - it "has the correct title_text" do - expect(page.title_text).to eq({ "arguments" => [{ "i18n_template" => "brent", "key" => "brent", "label" => true }], "translation" => "soft_validations.rent.outside_range_title" }) - end - - it "has the correct interruption_screen_question_ids" do - expect(page.interruption_screen_question_ids).to eq(%w[brent period startdate uprn postcode_full la beds rent_type needstype]) - end -end diff --git a/spec/models/form/lettings/pages/min_rent_value_check_spec.rb b/spec/models/form/lettings/pages/min_rent_value_check_spec.rb deleted file mode 100644 index 950f2f43f..000000000 --- a/spec/models/form/lettings/pages/min_rent_value_check_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -require "rails_helper" - -RSpec.describe Form::Lettings::Pages::MinRentValueCheck, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } - - let(:page_id) { "min_rent_value_check" } - let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1))) } - - it "has correct subsection" do - expect(page.subsection).to eq(subsection) - end - - it "has the correct description" do - expect(page.description).to be nil - end - - it "has correct questions" do - expect(page.questions.map(&:id)).to eq(%w[rent_value_check]) - end - - it "has the correct id" do - expect(page.id).to eq("min_rent_value_check") - end - - it "has correct depends_on" do - expect(page.depends_on).to eq( - [{ "rent_in_soft_min_range?" => true }], - ) - end - - it "has the correct title_text" do - expect(page.title_text).to eq({ - "translation" => "soft_validations.rent.outside_range_title", - "arguments" => [{ "i18n_template" => "brent", "key" => "brent", "label" => true }], - }) - end - - it "has the correct interruption_screen_question_ids" do - expect(page.interruption_screen_question_ids).to eq(%w[brent period startdate uprn postcode_full la beds rent_type needstype]) - end -end diff --git a/spec/models/form/lettings/questions/max_rent_value_check_spec.rb b/spec/models/form/lettings/questions/max_rent_value_check_spec.rb deleted file mode 100644 index 6fa0784e4..000000000 --- a/spec/models/form/lettings/questions/max_rent_value_check_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -require "rails_helper" - -RSpec.describe Form::Lettings::Questions::MaxRentValueCheck, type: :model do - subject(:question) { described_class.new(nil, question_definition, page, check_answers_card_number:) } - - let(:question_definition) { nil } - let(:check_answers_card_number) { nil } - let(:page) { instance_double(Form::Page) } - - it "has correct page" do - expect(question.page).to eq(page) - end - - it "has the correct id" do - expect(question.id).to eq("rent_value_check") - end - - it "has the correct type" do - expect(question.type).to eq("interruption_screen") - end - - it "has the correct answer_options" do - expect(question.answer_options).to eq({ - "0" => { "value" => "Yes" }, - "1" => { "value" => "No" }, - }) - end - - it "has the correct hidden_in_check_answers" do - expect(question.hidden_in_check_answers).to eq({ "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] }) - end -end diff --git a/spec/models/form/lettings/questions/min_rent_value_check_spec.rb b/spec/models/form/lettings/questions/min_rent_value_check_spec.rb deleted file mode 100644 index c3d8a16bc..000000000 --- a/spec/models/form/lettings/questions/min_rent_value_check_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -require "rails_helper" - -RSpec.describe Form::Lettings::Questions::MinRentValueCheck, type: :model do - subject(:question) { described_class.new(nil, question_definition, page, check_answers_card_number:) } - - let(:question_definition) { nil } - let(:check_answers_card_number) { nil } - let(:page) { instance_double(Form::Page) } - - it "has correct page" do - expect(question.page).to eq(page) - end - - it "has the correct id" do - expect(question.id).to eq("rent_value_check") - end - - it "has the correct type" do - expect(question.type).to eq("interruption_screen") - end - - it "has the correct answer_options" do - expect(question.answer_options).to eq({ - "0" => { "value" => "Yes" }, - "1" => { "value" => "No" }, - }) - end - - it "has the correct hidden_in_check_answers" do - expect(question.hidden_in_check_answers).to eq({ "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] }) - end -end diff --git a/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb b/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb index 66ea2b355..d3022dfcf 100644 --- a/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb +++ b/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Questions::StarterTenancyType, type: :model do let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page) } + let(:page) { instance_double(Form::Page, id: "starter_tenancy_type") } let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } diff --git a/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb b/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb index fb334f909..4bab9187a 100644 --- a/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthAffordableRent, type: :mo let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page) } + let(:page) { instance_double(Form::Page, id: "affordable_tenancy_length") } let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } diff --git a/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb b/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb index 0c0923bf8..a3f9c80e2 100644 --- a/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthIntermediateRent, type: : let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page) } + let(:page) { instance_double(Form::Page, id: "intermediate_tenancy_length") } let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } diff --git a/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb b/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb index 3a0fae171..449677736 100644 --- a/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthPeriodic, type: :model do let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))), id: "periodic_tenancy_length") } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/lettings/questions/tenancy_length_spec.rb b/spec/models/form/lettings/questions/tenancy_length_spec.rb index 2d87d0923..cc7bf9f9f 100644 --- a/spec/models/form/lettings/questions/tenancy_length_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_spec.rb @@ -3,7 +3,7 @@ require "rails_helper" RSpec.describe Form::Lettings::Questions::TenancyLength, type: :model do subject(:question) { described_class.new(nil, nil, page) } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))), id: "tenancy_length") } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/lettings/questions/tenancy_other_spec.rb b/spec/models/form/lettings/questions/tenancy_other_spec.rb index ce8aec5db..a6a2962dc 100644 --- a/spec/models/form/lettings/questions/tenancy_other_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_other_spec.rb @@ -3,7 +3,7 @@ require "rails_helper" RSpec.describe Form::Lettings::Questions::TenancyOther, type: :model do subject(:question) { described_class.new(nil, nil, page) } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))), id: "tenancy_type") } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/lettings/questions/tenancy_type_spec.rb b/spec/models/form/lettings/questions/tenancy_type_spec.rb index 13998094a..08818d3ea 100644 --- a/spec/models/form/lettings/questions/tenancy_type_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_type_spec.rb @@ -3,7 +3,7 @@ require "rails_helper" RSpec.describe Form::Lettings::Questions::TenancyType, type: :model do subject(:question) { described_class.new(nil, nil, page) } - let(:page) { instance_double(Form::Page) } + let(:page) { instance_double(Form::Page, id: "tenancy_type") } let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } diff --git a/spec/models/form/lettings/subsections/income_and_benefits_spec.rb b/spec/models/form/lettings/subsections/income_and_benefits_spec.rb index c260ff56d..4c92faaf6 100644 --- a/spec/models/form/lettings/subsections/income_and_benefits_spec.rb +++ b/spec/models/form/lettings/subsections/income_and_benefits_spec.rb @@ -30,8 +30,7 @@ RSpec.describe Form::Lettings::Subsections::IncomeAndBenefits, type: :model do rent_bi_weekly rent_4_weekly rent_monthly - brent_min_rent_value_check - brent_max_rent_value_check + brent_rent_value_check scharge_value_check pscharge_value_check supcharg_value_check diff --git a/spec/models/form/lettings/subsections/property_information_spec.rb b/spec/models/form/lettings/subsections/property_information_spec.rb index 7d406d1a7..d333ff669 100644 --- a/spec/models/form/lettings/subsections/property_information_spec.rb +++ b/spec/models/form/lettings/subsections/property_information_spec.rb @@ -17,36 +17,6 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do allow(form).to receive(:start_year_after_2024?).and_return(false) end - context "when 2022" do - let(:start_date) { Time.utc(2022, 2, 8) } - - it "has correct pages" do - expect(property_information.pages.compact.map(&:id)).to eq( - %w[ - property_postcode - property_local_authority - local_authority_min_rent_value_check - local_authority_max_rent_value_check - first_time_property_let_as_social_housing - property_let_type - property_vacancy_reason_not_first_let - property_vacancy_reason_first_let - property_number_of_times_relet - property_unit_type - property_building_type - property_wheelchair_accessible - property_number_of_bedrooms - beds_min_rent_value_check - beds_max_rent_value_check - void_date - void_date_value_check - property_major_repairs - property_major_repairs_value_check - ], - ) - end - end - context "when 2023" do let(:start_date) { Time.utc(2023, 2, 8) } @@ -57,8 +27,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do uprn_confirmation address property_local_authority - local_authority_min_rent_value_check - local_authority_max_rent_value_check + local_authority_rent_value_check first_time_property_let_as_social_housing property_let_type property_vacancy_reason_not_first_let @@ -68,8 +37,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do property_building_type property_wheelchair_accessible property_number_of_bedrooms - beds_min_rent_value_check - beds_max_rent_value_check + beds_rent_value_check void_date void_date_value_check property_major_repairs @@ -96,8 +64,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do uprn_selection address property_local_authority - local_authority_min_rent_value_check - local_authority_max_rent_value_check + local_authority_rent_value_check first_time_property_let_as_social_housing property_let_type property_vacancy_reason_not_first_let @@ -106,8 +73,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do property_building_type property_wheelchair_accessible property_number_of_bedrooms - beds_min_rent_value_check - beds_max_rent_value_check + beds_rent_value_check void_date void_date_value_check property_major_repairs diff --git a/spec/models/form/sales/pages/about_price_value_check_spec.rb b/spec/models/form/sales/pages/about_price_value_check_spec.rb index 7d3c31537..1193768db 100644 --- a/spec/models/form/sales/pages/about_price_value_check_spec.rb +++ b/spec/models/form/sales/pages/about_price_value_check_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::AboutPriceValueCheck, type: :model do let(:page_id) { "savings_value_check" } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:subsection) { instance_double(Form::Subsection, form:) } it "has correct subsection" do expect(page.subsection).to eq(subsection) @@ -28,12 +29,12 @@ RSpec.describe Form::Sales::Pages::AboutPriceValueCheck, type: :model do end it "has the correct title_text" do - expect(page.title_text).to eq({ "arguments" => [{ "i18n_template" => "value", "key" => "value", "label" => true }], "translation" => "soft_validations.purchase_price.title_text" }) + expect(page.title_text).to eq({ "arguments" => [{ "i18n_template" => "value", "key" => "value", "label" => true }], "translation" => "forms.2024.sales.soft_validations.value_value_check.title_text" }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.purchase_price.hint_text", + "translation" => "forms.2024.sales.soft_validations.value_value_check.informative_text", "arguments" => [ { "key" => "field_formatted_as_currency", diff --git a/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb b/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb index cb187ecfd..ce72bbda8 100644 --- a/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb +++ b/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::MonthlyChargesValueCheck, type: :model do let(:page_id) { "monthly_charges_value_check" } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:subsection) { instance_double(Form::Subsection, form:) } it "has correct subsection" do expect(page.subsection).to eq(subsection) @@ -33,13 +34,13 @@ RSpec.describe Form::Sales::Pages::MonthlyChargesValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.monthly_charges_over_soft_max.title_text", + "translation" => "forms.2024.sales.soft_validations.monthly_charges_value_check.title_text", "arguments" => [{ "arguments_for_key" => "mscharge", "i18n_template" => "mscharge", "key" => "field_formatted_as_currency" }], }) end it "has correct informative_text" do - expect(page.informative_text).to eq({ "arguments" => [], "translation" => "soft_validations.monthly_charges_over_soft_max.hint_text" }) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.monthly_charges_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do diff --git a/spec/models/form/sales/pages/no_address_found_spec.rb b/spec/models/form/sales/pages/no_address_found_spec.rb index 1a40abba4..b6dbd677e 100644 --- a/spec/models/form/sales/pages/no_address_found_spec.rb +++ b/spec/models/form/sales/pages/no_address_found_spec.rb @@ -5,8 +5,9 @@ RSpec.describe Form::Sales::Pages::NoAddressFound, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection) } let(:log) { create(:sales_log) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:subsection) { instance_double(Form::Subsection, form:) } it "has correct subsection" do expect(page.subsection).to eq(subsection) @@ -31,11 +32,11 @@ RSpec.describe Form::Sales::Pages::NoAddressFound, type: :model do end it "has the correct title_text" do - expect(page.title_text).to eq({ "arguments" => [], "translation" => "soft_validations.no_address_found.title_text" }) + expect(page.title_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.address_search_value_check.title_text" }) end it "has the correct informative_text" do - expect(page.informative_text).to eq({ "arguments" => [], "translation" => "soft_validations.no_address_found.informative_text" }) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.address_search_value_check.informative_text" }) end it "has the correct interruption_screen_question_ids" do diff --git a/spec/models/form/sales/pages/percentage_discount_value_check_spec.rb b/spec/models/form/sales/pages/percentage_discount_value_check_spec.rb index 5fc3e05ad..0b8cf0152 100644 --- a/spec/models/form/sales/pages/percentage_discount_value_check_spec.rb +++ b/spec/models/form/sales/pages/percentage_discount_value_check_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::PercentageDiscountValueCheck, type: :model do let(:page_id) { "percentage_discount_value_check" } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:subsection) { instance_double(Form::Subsection, form:) } it "has correct subsection" do expect(page.subsection).to eq(subsection) @@ -21,14 +22,14 @@ RSpec.describe Form::Sales::Pages::PercentageDiscountValueCheck, type: :model do it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.percentage_discount_value.title_text", + "translation" => "forms.2024.sales.soft_validations.percentage_discount_value_check.title_text", "arguments" => [{ "key" => "discount", "label" => true, "i18n_template" => "discount" }], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.percentage_discount_value.hint_text", + "translation" => "forms.2024.sales.soft_validations.percentage_discount_value_check.informative_text", "arguments" => [], }) end diff --git a/spec/models/form/sales/pages/postcode_spec.rb b/spec/models/form/sales/pages/postcode_spec.rb deleted file mode 100644 index 8f9c7273c..000000000 --- a/spec/models/form/sales/pages/postcode_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -require "rails_helper" - -RSpec.describe Form::Sales::Pages::Postcode, type: :model do - subject(:page) { described_class.new(page_id, page_definition, subsection) } - - let(:page_id) { nil } - let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection) } - - it "has correct subsection" do - expect(page.subsection).to eq(subsection) - end - - it "has correct questions" do - expect(page.questions.map(&:id)).to eq(%w[pcodenk postcode_full]) - end - - it "has the correct id" do - expect(page.id).to eq("property_postcode") - end - - it "has the correct description" do - expect(page.description).to be_nil - end - - it "has correct depends_on" do - expect(page.depends_on).to be_nil - end -end diff --git a/spec/models/form/sales/pages/property_local_authority_spec.rb b/spec/models/form/sales/pages/property_local_authority_spec.rb index 016d0534d..faba75665 100644 --- a/spec/models/form/sales/pages/property_local_authority_spec.rb +++ b/spec/models/form/sales/pages/property_local_authority_spec.rb @@ -18,19 +18,6 @@ RSpec.describe Form::Sales::Pages::PropertyLocalAuthority, type: :model do end describe "has correct questions" do - context "when 2022" do - let(:start_date) { Time.utc(2022, 2, 8) } - - it "has correct questions" do - expect(page.questions.map(&:id)).to eq( - %w[ - la_known - la - ], - ) - end - end - context "when 2023" do let(:start_date) { Time.utc(2023, 2, 8) } diff --git a/spec/models/form/sales/questions/postcode_known_spec.rb b/spec/models/form/sales/questions/postcode_known_spec.rb deleted file mode 100644 index 794c981d4..000000000 --- a/spec/models/form/sales/questions/postcode_known_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -require "rails_helper" - -RSpec.describe Form::Sales::Questions::PostcodeKnown, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } - - let(:question_id) { nil } - let(:question_definition) { nil } - let(:page) { instance_double(Form::Page) } - - it "has correct page" do - expect(question.page).to eq(page) - end - - it "has the correct id" do - expect(question.id).to eq("pcodenk") - end - - it "has the correct type" do - expect(question.type).to eq("radio") - end - - it "is not marked as derived" do - expect(question.derived?(nil)).to be false - end - - it "has the correct answer_options" do - expect(question.answer_options).to eq({ - "0" => { "value" => "Yes" }, - "1" => { "value" => "No" }, - }) - end - - it "has correct conditional for" do - expect(question.conditional_for).to eq({ - "postcode_full" => [0], - }) - end - - it "has the correct hidden_in_check_answers" do - expect(question.hidden_in_check_answers).to eq({ - "depends_on" => [ - { "pcodenk" => 0 }, - { "pcodenk" => 1 }, - ], - }) - end -end diff --git a/spec/models/form/sales/questions/postcode_spec.rb b/spec/models/form/sales/questions/postcode_spec.rb deleted file mode 100644 index 480d6af60..000000000 --- a/spec/models/form/sales/questions/postcode_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -require "rails_helper" - -RSpec.describe Form::Sales::Questions::Postcode, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } - - let(:question_id) { nil } - let(:question_definition) { nil } - let(:page) { instance_double(Form::Page) } - - it "has correct page" do - expect(question.page).to eq(page) - end - - it "has the correct id" do - expect(question.id).to eq("postcode_full") - end - - it "has the correct type" do - expect(question.type).to eq("text") - end - - it "is not marked as derived" do - expect(question.derived?(nil)).to be false - end - - it "has the correct width" do - expect(question.width).to eq(5) - end - - it "has the correct inferred_answers" do - expect(question.inferred_answers).to eq({ - "la" => { - "is_la_inferred" => true, - }, - }) - end - - it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to eq([{ - "condition" => { - "pcodenk" => 1, - }, - "value" => "Not known", - }]) - end -end diff --git a/spec/models/form/sales/questions/uprn_confirmation_spec.rb b/spec/models/form/sales/questions/uprn_confirmation_spec.rb index ddb047937..0e54155b6 100644 --- a/spec/models/form/sales/questions/uprn_confirmation_spec.rb +++ b/spec/models/form/sales/questions/uprn_confirmation_spec.rb @@ -1,11 +1,13 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::UprnConfirmation, type: :model do + include FormattingHelper + subject(:question) { described_class.new(question_id, question_definition, page) } let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), type: "sales"), id: "property_information")) } it "has correct page" do expect(question.page).to eq(page) @@ -24,7 +26,7 @@ RSpec.describe Form::Sales::Questions::UprnConfirmation, type: :model do end it "has the correct unanswered_error_message" do - expect(question.unanswered_error_message).to eq("You must answer is this the right address?") + expect(question.unanswered_error_message).to eq("You must answer #{format_ending(I18n.t('forms.2023.sales.property_information.uprn_confirmed.check_answer_label'))}") end describe "notification_banner" do diff --git a/spec/models/form/sales/questions/uprn_known_spec.rb b/spec/models/form/sales/questions/uprn_known_spec.rb index d3a91a3ef..e551ca430 100644 --- a/spec/models/form/sales/questions/uprn_known_spec.rb +++ b/spec/models/form/sales/questions/uprn_known_spec.rb @@ -1,6 +1,8 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::UprnKnown, type: :model do + include FormattingHelper + subject(:question) { described_class.new(question_id, question_definition, page) } let(:question_id) { nil } @@ -35,7 +37,7 @@ RSpec.describe Form::Sales::Questions::UprnKnown, type: :model do end it "has the correct unanswered_error_message" do - expect(question.unanswered_error_message).to eq("You must answer UPRN known?") + expect(question.unanswered_error_message).to eq("You must answer #{format_ending(I18n.t('forms.2023.sales.property_information.uprn.uprn_known.check_answer_label'))}") end it "has the correct hidden_in_check_answers" do diff --git a/spec/models/form/sales/subsections/property_information_spec.rb b/spec/models/form/sales/subsections/property_information_spec.rb index e0bf51e11..6e181f738 100644 --- a/spec/models/form/sales/subsections/property_information_spec.rb +++ b/spec/models/form/sales/subsections/property_information_spec.rb @@ -17,30 +17,6 @@ RSpec.describe Form::Sales::Subsections::PropertyInformation, type: :model do allow(form).to receive(:start_year_after_2024?).and_return(false) end - context "when 2022" do - let(:start_date) { Time.utc(2022, 2, 8) } - - it "has correct pages" do - expect(property_information.pages.compact.map(&:id)).to eq( - %w[ - property_number_of_bedrooms - about_price_bedrooms_value_check - property_unit_type - monthly_charges_property_type_value_check - percentage_discount_proptype_value_check - property_building_type - property_postcode - property_local_authority - local_authority_buyer_1_income_max_value_check - local_authority_buyer_2_income_max_value_check - local_authority_combined_income_max_value_check - about_price_la_value_check - property_wheelchair_accessible - ], - ) - end - end - context "when 2023" do let(:start_date) { Time.utc(2023, 2, 8) } diff --git a/spec/models/validations/date_validations_spec.rb b/spec/models/validations/date_validations_spec.rb index 59be2537e..f6c81a088 100644 --- a/spec/models/validations/date_validations_spec.rb +++ b/spec/models/validations/date_validations_spec.rb @@ -26,7 +26,7 @@ RSpec.describe Validations::DateValidations do record.voiddate = Time.zone.local(2022, 2, 1) date_validator.validate_startdate(record) expect(record.errors["startdate"]) - .to include(match I18n.t("validations.setup.startdate.after_void_date")) + .to include(match I18n.t("validations.lettings.date.startdate.after_void_date")) end it "validates that the tenancy start date is after the major repair date if it has a major repair date" do @@ -34,7 +34,7 @@ RSpec.describe Validations::DateValidations do record.mrcdate = Time.zone.local(2022, 2, 1) date_validator.validate_startdate(record) expect(record.errors["startdate"]) - .to include(match I18n.t("validations.setup.startdate.after_major_repair_date")) + .to include(match I18n.t("validations.lettings.date.startdate.after_major_repair_date")) end it "produces no error when the tenancy start date is before the end date of the chosen scheme if it has an end date" do @@ -58,7 +58,7 @@ RSpec.describe Validations::DateValidations do record.mrcdate = Time.zone.local(2022, 2, 1) date_validator.validate_property_major_repairs(record) expect(record.errors["mrcdate"]) - .to include(match I18n.t("validations.property.mrcdate.before_tenancy_start")) + .to include(match I18n.t("validations.lettings.date.mrcdate.before_tenancy_start")) end it "must be before the tenancy start date" do @@ -74,9 +74,9 @@ RSpec.describe Validations::DateValidations do date_validator.validate_property_major_repairs(record) date_validator.validate_startdate(record) expect(record.errors["mrcdate"]) - .to include(match I18n.t("validations.property.mrcdate.ten_years_before_tenancy_start")) + .to include(match I18n.t("validations.lettings.date.mrcdate.ten_years_before_tenancy_start")) expect(record.errors["startdate"]) - .to include(match I18n.t("validations.setup.startdate.ten_years_after_mrc_date")) + .to include(match I18n.t("validations.lettings.date.startdate.ten_years_after_mrc_date")) end it "must be within 10 years of the tenancy start date" do @@ -93,7 +93,7 @@ RSpec.describe Validations::DateValidations do record.mrcdate = Time.zone.local(2022, 1, 1) date_validator.validate_property_major_repairs(record) expect(record.errors["mrcdate"]) - .to include(match I18n.t("validations.property.mrcdate.not_first_let")) + .to include(match I18n.t("validations.lettings.date.mrcdate.not_first_let")) end it "validates that no major repair date is provided for a conversion" do @@ -101,7 +101,7 @@ RSpec.describe Validations::DateValidations do record.mrcdate = Time.zone.local(2022, 1, 1) date_validator.validate_property_major_repairs(record) expect(record.errors["mrcdate"]) - .to include(match I18n.t("validations.property.mrcdate.not_first_let")) + .to include(match I18n.t("validations.lettings.date.mrcdate.not_first_let")) end it "validates that no major repair date is provided for a leased property" do @@ -109,7 +109,7 @@ RSpec.describe Validations::DateValidations do record.mrcdate = Time.zone.local(2022, 1, 1) date_validator.validate_property_major_repairs(record) expect(record.errors["mrcdate"]) - .to include(match I18n.t("validations.property.mrcdate.not_first_let")) + .to include(match I18n.t("validations.lettings.date.mrcdate.not_first_let")) end end @@ -129,7 +129,7 @@ RSpec.describe Validations::DateValidations do record.voiddate = Time.zone.local(2022, 2, 1) date_validator.validate_property_void_date(record) expect(record.errors["voiddate"]) - .to include(match I18n.t("validations.property.void_date.before_tenancy_start")) + .to include(match I18n.t("validations.lettings.date.void_date.before_tenancy_start")) end it "must be before the tenancy start date" do @@ -145,9 +145,9 @@ RSpec.describe Validations::DateValidations do date_validator.validate_property_void_date(record) date_validator.validate_startdate(record) expect(record.errors["voiddate"]) - .to include(match I18n.t("validations.property.void_date.ten_years_before_tenancy_start")) + .to include(match I18n.t("validations.lettings.date.void_date.ten_years_before_tenancy_start")) expect(record.errors["startdate"]) - .to include(match I18n.t("validations.setup.startdate.ten_years_after_void_date")) + .to include(match I18n.t("validations.lettings.date.startdate.ten_years_after_void_date")) end it "must be within 10 years of the tenancy start date" do @@ -164,9 +164,9 @@ RSpec.describe Validations::DateValidations do record.voiddate = Time.zone.local(2022, 2, 1) date_validator.validate_property_void_date(record) expect(record.errors["voiddate"]) - .to include(match I18n.t("validations.property.void_date.after_mrcdate")) + .to include(match I18n.t("validations.lettings.date.void_date.after_mrcdate")) expect(record.errors["mrcdate"]) - .to include(match I18n.t("validations.property.mrcdate.before_void_date")) + .to include(match I18n.t("validations.lettings.date.mrcdate.before_void_date")) end it "must be before major repairs date" do diff --git a/spec/requests/duplicate_logs_controller_spec.rb b/spec/requests/duplicate_logs_controller_spec.rb index c06d30baf..700964fcf 100644 --- a/spec/requests/duplicate_logs_controller_spec.rb +++ b/spec/requests/duplicate_logs_controller_spec.rb @@ -66,7 +66,6 @@ RSpec.describe DuplicateLogsController, type: :request do it "displays check your answers for each log with correct questions" do expect(page).to have_content("Q5 - Tenancy start date", count: 3) expect(page).to have_content("Q7 - Tenant code", count: 3) - expect(page).to have_content("Q12 - Postcode", count: 3) expect(page).to have_content("Q32 - Lead tenant’s age", count: 3) expect(page).to have_content("Q33 - Lead tenant’s gender identity", count: 3) expect(page).to have_content("Q37 - Lead tenant’s working situation", count: 3) @@ -84,7 +83,6 @@ RSpec.describe DuplicateLogsController, type: :request do expect(page).to have_content("Q5 - Tenancy start date", count: 3) expect(page).to have_content("Q7 - Tenant code", count: 3) - expect(page).to have_content("Q12 - Postcode", count: 1) expect(page).to have_content("Postcode (from UPRN)", count: 2) expect(page).to have_content("Q32 - Lead tenant’s age", count: 3) expect(page).to have_content("Q33 - Lead tenant’s gender identity", count: 3) @@ -114,7 +112,6 @@ RSpec.describe DuplicateLogsController, type: :request do it "displays check your answers for each log with correct questions" do expect(page).to have_content("Q5 - Tenancy start date", count: 1) expect(page).to have_content("Q7 - Tenant code", count: 1) - expect(page).to have_content("Q12 - Postcode", count: 1) expect(page).to have_content("Q32 - Lead tenant’s age", count: 1) expect(page).to have_content("Q33 - Lead tenant’s gender identity", count: 1) expect(page).to have_content("Q37 - Lead tenant’s working situation", count: 1) @@ -141,7 +138,6 @@ RSpec.describe DuplicateLogsController, type: :request do it "displays check your answers for each log with correct questions" do expect(page).to have_content("Q5 - Tenancy start date", count: 1) expect(page).to have_content("Q7 - Tenant code", count: 1) - expect(page).to have_content("Q12 - Postcode", count: 1) expect(page).to have_content("Q32 - Lead tenant’s age", count: 1) expect(page).to have_content("Q33 - Lead tenant’s gender identity", count: 1) expect(page).to have_content("Q37 - Lead tenant’s working situation", count: 1) @@ -295,7 +291,6 @@ RSpec.describe DuplicateLogsController, type: :request do it "displays check your answers for each log with correct questions" do expect(page).to have_content("Q5 - Tenancy start date", count: 3) expect(page).to have_content("Q7 - Tenant code", count: 3) - expect(page).to have_content("Q12 - Postcode", count: 3) expect(page).to have_content("Q32 - Lead tenant’s age", count: 3) expect(page).to have_content("Q33 - Lead tenant’s gender identity", count: 3) expect(page).to have_content("Q37 - Lead tenant’s working situation", count: 3) @@ -324,7 +319,6 @@ RSpec.describe DuplicateLogsController, type: :request do it "displays check your answers for each log with correct questions" do expect(page).to have_content("Q5 - Tenancy start date", count: 1) expect(page).to have_content("Q7 - Tenant code", count: 1) - expect(page).to have_content("Q12 - Postcode", count: 1) expect(page).to have_content("Q32 - Lead tenant’s age", count: 1) expect(page).to have_content("Q33 - Lead tenant’s gender identity", count: 1) expect(page).to have_content("Q37 - Lead tenant’s working situation", count: 1) @@ -351,7 +345,6 @@ RSpec.describe DuplicateLogsController, type: :request do it "displays check your answers for each log with correct questions" do expect(page).to have_content("Q5 - Tenancy start date", count: 1) expect(page).to have_content("Q7 - Tenant code", count: 1) - expect(page).to have_content("Q12 - Postcode", count: 1) expect(page).to have_content("Q32 - Lead tenant’s age", count: 1) expect(page).to have_content("Q33 - Lead tenant’s gender identity", count: 1) expect(page).to have_content("Q37 - Lead tenant’s working situation", count: 1) diff --git a/spec/requests/organisations_controller_spec.rb b/spec/requests/organisations_controller_spec.rb index 223cc9e00..5a300c56c 100644 --- a/spec/requests/organisations_controller_spec.rb +++ b/spec/requests/organisations_controller_spec.rb @@ -497,7 +497,7 @@ RSpec.describe OrganisationsController, type: :request do it "displays a link to merge organisations" do expect(page).to have_content("To report a merge or update your organisation details, ") - expect(page).to have_link("contact the helpdesk", href: "https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11") + expect(page).to have_link("contact the helpdesk", href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11") end it "does not display merge history if there is none" do diff --git a/spec/services/documentation_generator_spec.rb b/spec/services/documentation_generator_spec.rb index 47bc813f7..6f4714d01 100644 --- a/spec/services/documentation_generator_spec.rb +++ b/spec/services/documentation_generator_spec.rb @@ -89,7 +89,7 @@ describe DocumentationGenerator do end describe ":describe_soft_validations" do - let(:all_validation_methods) { ["rent_in_soft_min_range?"] } + let(:all_validation_methods) { ["rent_soft_validation_triggered?"] } let(:response) do { "choices" => [{ "message" => { "tool_calls" => [{ "function" => { "arguments" => "{\n \"description\": \"Validates the format.\",\n \"validation_type\": \"format\",\n \"other_validated_models\": \"User\"}" } }] } }] } @@ -100,7 +100,7 @@ describe DocumentationGenerator do it "creates new validation documentation records" do expect { described_class.new.describe_soft_validations(client, all_validation_methods, all_helper_methods, log_type) }.to change(LogValidation, :count) - expect(LogValidation.where(validation_name: "rent_in_soft_min_range?").count).to be_positive + expect(LogValidation.where(validation_name: "rent_soft_validation_triggered?").count).to be_positive any_validation = LogValidation.first expect(any_validation.description).to eq("Validates the format.") expect(any_validation.field).not_to be_empty diff --git a/spec/services/merge/merge_organisations_service_spec.rb b/spec/services/merge/merge_organisations_service_spec.rb index 6eea8635f..7163a142f 100644 --- a/spec/services/merge/merge_organisations_service_spec.rb +++ b/spec/services/merge/merge_organisations_service_spec.rb @@ -1317,9 +1317,9 @@ RSpec.describe Merge::MergeOrganisationsService do merging_organisation.reload expect(new_absorbing_organisation.owned_lettings_logs.count).to eq(2) expect(new_absorbing_organisation.managed_lettings_logs.count).to eq(1) - expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log.id).scheme).to eq(new_absorbing_organisation.owned_schemes.first) - expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log.id).location).to eq(new_absorbing_organisation.owned_schemes.first.locations.first) - expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log_no_location.id).scheme).to eq(new_absorbing_organisation.owned_schemes.first) + expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log.id).scheme).to eq(new_absorbing_organisation.owned_schemes.find_by(service_name: scheme.service_name)) + expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log.id).location).to eq(new_absorbing_organisation.owned_schemes.find_by(service_name: scheme.service_name).locations.first) + expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log_no_location.id).scheme).to eq(new_absorbing_organisation.owned_schemes.find_by(service_name: scheme.service_name)) expect(new_absorbing_organisation.owned_lettings_logs.find(owned_lettings_log_no_location.id).location).to eq(nil) end diff --git a/spec/views/merge_requests/show.html.erb_spec.rb b/spec/views/merge_requests/show.html.erb_spec.rb index d03239d2a..c1dd47bfd 100644 --- a/spec/views/merge_requests/show.html.erb_spec.rb +++ b/spec/views/merge_requests/show.html.erb_spec.rb @@ -30,7 +30,7 @@ RSpec.describe "merge_requests/show.html.erb", type: :view do it "displays the helpdesk ticket details" do expect(rendered).to have_selector("dt", text: "Helpdesk ticket") if merge_request.helpdesk_ticket.present? - expect(rendered).to have_link(merge_request.helpdesk_ticket, href: "https://dluhcdigital.atlassian.net/browse/#{merge_request.helpdesk_ticket}") + expect(rendered).to have_link(merge_request.helpdesk_ticket, href: "https://mhclgdigital.atlassian.net/browse/#{merge_request.helpdesk_ticket}") else expect(rendered).to have_selector("dd", text: "You didn't answer this question") end