diff --git a/Gemfile.lock b/Gemfile.lock index cc9e57d24..1a98463b5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -377,8 +377,7 @@ GEM responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.6) - strscan + rexml (3.3.9) roo (2.10.1) nokogiri (~> 1) rubyzip (>= 1.3.0, < 3.0.0) @@ -463,7 +462,6 @@ GEM smart_properties (1.17.0) stimulus-rails (1.3.3) railties (>= 6.0.0) - strscan (3.1.0) thor (1.3.2) thread_safe (0.3.6) timecop (0.9.8) diff --git a/app/models/form/lettings/pages/declaration.rb b/app/models/form/lettings/pages/declaration.rb index 89561817d..647e2ccee 100644 --- a/app/models/form/lettings/pages/declaration.rb +++ b/app/models/form/lettings/pages/declaration.rb @@ -2,7 +2,6 @@ class Form::Lettings::Pages::Declaration < ::Form::Page def initialize(id, hsh, subsection) super @id = "declaration" - @header = "Ministry of Housing, Communities and Local Government privacy notice" end def questions diff --git a/app/models/form/lettings/pages/location.rb b/app/models/form/lettings/pages/location.rb index ba357dc1b..b35a38f7c 100644 --- a/app/models/form/lettings/pages/location.rb +++ b/app/models/form/lettings/pages/location.rb @@ -8,7 +8,7 @@ class Form::Lettings::Pages::Location < ::Form::Page "scheme_has_large_number_of_locations?" => false, }, ] - @header = "Location" + @copy_key = "lettings.setup.location_id.less_than_twenty" @next_unresolved_page_id = :check_answers end diff --git a/app/models/form/lettings/pages/location_search.rb b/app/models/form/lettings/pages/location_search.rb index f27fae281..e77346fce 100644 --- a/app/models/form/lettings/pages/location_search.rb +++ b/app/models/form/lettings/pages/location_search.rb @@ -8,7 +8,7 @@ class Form::Lettings::Pages::LocationSearch < ::Form::Page "scheme_has_large_number_of_locations?" => true, }, ] - @header = "Location" + @copy_key = "lettings.setup.location_id.twenty_or_more" @next_unresolved_page_id = :check_answers end diff --git a/app/models/form/lettings/pages/rent_type.rb b/app/models/form/lettings/pages/rent_type.rb index b3e52d0e2..8353b0338 100644 --- a/app/models/form/lettings/pages/rent_type.rb +++ b/app/models/form/lettings/pages/rent_type.rb @@ -2,7 +2,7 @@ class Form::Lettings::Pages::RentType < ::Form::Page def initialize(_id, hsh, subsection) super("rent_type", hsh, subsection) @derived = true - @header = "Rent Type" + @copy_key = "lettings.setup.rent_type" end def questions diff --git a/app/models/form/lettings/pages/scheme.rb b/app/models/form/lettings/pages/scheme.rb index 06bb6eb9c..9ac87a756 100644 --- a/app/models/form/lettings/pages/scheme.rb +++ b/app/models/form/lettings/pages/scheme.rb @@ -6,7 +6,6 @@ class Form::Lettings::Pages::Scheme < ::Form::Page "needstype" => 2, }, ] - @header = "Scheme" @next_unresolved_page_id = "location" end diff --git a/app/models/form/lettings/pages/type_of_access_needs.rb b/app/models/form/lettings/pages/type_of_access_needs.rb index 670e2ef89..25b4fe187 100644 --- a/app/models/form/lettings/pages/type_of_access_needs.rb +++ b/app/models/form/lettings/pages/type_of_access_needs.rb @@ -2,7 +2,7 @@ class Form::Lettings::Pages::TypeOfAccessNeeds < ::Form::Page def initialize(id, hsh, subsection) super @id = "type_of_access_needs" - @header = "Disabled access needs" + @copy_key = "lettings.household_needs.housingneeds_type" @depends_on = [{ "housingneeds" => 1 }] end diff --git a/app/models/form/lettings/questions/armedforces.rb b/app/models/form/lettings/questions/armedforces.rb index d7f8e44f2..25dbeff86 100644 --- a/app/models/form/lettings/questions/armedforces.rb +++ b/app/models/form/lettings/questions/armedforces.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Armedforces < ::Form::Question def initialize(id, hsh, page) super @id = "armedforces" - @check_answer_label = "Household links to UK armed forces" - @header = "Does anybody in the household have any links to the UK armed forces?" @type = "radio" @check_answers_card_number = 0 - @hint_text = "This excludes national service.

If there are several people in the household with links to the UK armed forces, you should answer for the regular. If there’s no regular, answer for the reserve. If there’s no reserve, answer for the spouse or civil partner." @answer_options = ANSWER_OPTIONS @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/condition_effects.rb b/app/models/form/lettings/questions/condition_effects.rb index de5c188f0..1821f6e98 100644 --- a/app/models/form/lettings/questions/condition_effects.rb +++ b/app/models/form/lettings/questions/condition_effects.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::ConditionEffects < ::Form::Question def initialize(id, hsh, page) super @id = "condition_effects" - @check_answer_label = "How is person affected by condition or illness" - @header = "How is the person affected by their condition or illness?" @type = "checkbox" @check_answers_card_number = 0 - @hint_text = "Select all that apply." @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/created_by_id.rb b/app/models/form/lettings/questions/created_by_id.rb index 1f260960f..ea6375152 100644 --- a/app/models/form/lettings/questions/created_by_id.rb +++ b/app/models/form/lettings/questions/created_by_id.rb @@ -4,8 +4,6 @@ class Form::Lettings::Questions::CreatedById < ::Form::Question def initialize(id, hsh, page) super @id = "assigned_to_id" - @check_answer_label = "Log owner" - @header = "Which user are you creating this log for?" @derived = true @type = "select" end diff --git a/app/models/form/lettings/questions/housingneeds.rb b/app/models/form/lettings/questions/housingneeds.rb index 3d3369d68..03c80d5cb 100644 --- a/app/models/form/lettings/questions/housingneeds.rb +++ b/app/models/form/lettings/questions/housingneeds.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Housingneeds < ::Form::Question def initialize(id, hsh, page) super @id = "housingneeds" - @check_answer_label = "Anybody with disabled access needs" - @header = "Does anybody in the household have any disabled access needs?" @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/housingneeds_other.rb b/app/models/form/lettings/questions/housingneeds_other.rb index e8fa2c0f9..75834d3bb 100644 --- a/app/models/form/lettings/questions/housingneeds_other.rb +++ b/app/models/form/lettings/questions/housingneeds_other.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::HousingneedsOther < ::Form::Question def initialize(id, hsh, page) super @id = "housingneeds_other" - @check_answer_label = "Other disabled access needs" - @header = "Do they have any other disabled access needs?" + @copy_key = "lettings.household_needs.housingneeds_type.housingneeds_other" @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/housingneeds_type.rb b/app/models/form/lettings/questions/housingneeds_type.rb index a3de7223d..50b9c3742 100644 --- a/app/models/form/lettings/questions/housingneeds_type.rb +++ b/app/models/form/lettings/questions/housingneeds_type.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::HousingneedsType < ::Form::Question def initialize(id, hsh, page) super @id = "housingneeds_type" - @check_answer_label = "Disabled access needs" - @header = "What type of access needs do they have?" + @copy_key = "lettings.household_needs.housingneeds_type.housingneeds_type" @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/illness.rb b/app/models/form/lettings/questions/illness.rb index 20b76bec4..f92a7a04a 100644 --- a/app/models/form/lettings/questions/illness.rb +++ b/app/models/form/lettings/questions/illness.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Illness < ::Form::Question def initialize(id, hsh, page) super @id = "illness" - @check_answer_label = "Anybody in household with physical or mental health condition" - @header = "Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?" @type = "radio" @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/irproduct_other.rb b/app/models/form/lettings/questions/irproduct_other.rb index d0df0bec8..b004d5dc2 100644 --- a/app/models/form/lettings/questions/irproduct_other.rb +++ b/app/models/form/lettings/questions/irproduct_other.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::IrproductOther < ::Form::Question def initialize(id, hsh, page) super @id = "irproduct_other" - @check_answer_label = "Product name" - @header = "Name of rent product" + @copy_key = "lettings.setup.rent_type.irproduct_other" @type = "text" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? end diff --git a/app/models/form/lettings/questions/leftreg.rb b/app/models/form/lettings/questions/leftreg.rb index 3868d5ce7..9b90566cf 100644 --- a/app/models/form/lettings/questions/leftreg.rb +++ b/app/models/form/lettings/questions/leftreg.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Leftreg < ::Form::Question def initialize(id, hsh, page) super @id = "leftreg" - @check_answer_label = "Person still serving in UK armed forces" - @header = "Is the person still serving in the UK armed forces?" @type = "radio" @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/location_id.rb b/app/models/form/lettings/questions/location_id.rb index 59101592f..5bc316476 100644 --- a/app/models/form/lettings/questions/location_id.rb +++ b/app/models/form/lettings/questions/location_id.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::LocationId < ::Form::Question def initialize(id, hsh, page) super @id = "location_id" - @check_answer_label = "Location" - @header = header_text + @copy_key = "lettings.setup.location_id.less_than_twenty" @type = "radio" @answer_options = answer_options @inferred_answers = { @@ -56,13 +55,5 @@ private false end - def header_text - if form.start_date && form.start_date.year >= 2023 - "Which location is this letting for?" - else - "Which location is this log for?" - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 5 }.freeze end diff --git a/app/models/form/lettings/questions/location_id_search.rb b/app/models/form/lettings/questions/location_id_search.rb index d085572e4..ecba28c38 100644 --- a/app/models/form/lettings/questions/location_id_search.rb +++ b/app/models/form/lettings/questions/location_id_search.rb @@ -2,10 +2,8 @@ class Form::Lettings::Questions::LocationIdSearch < ::Form::Question def initialize(id, hsh, page) super @id = "location_id" - @check_answer_label = "Location" - @header = header_text - @hint_text = '
This scheme has 20 or more locations.
Enter postcode or address.' @type = "select" + @copy_key = "lettings.setup.location_id.twenty_or_more" @answer_options = answer_options @inferred_answers = { "location.name": { @@ -52,13 +50,5 @@ private false end - def header_text - if form.start_date && form.start_date.year >= 2023 - "Which location is this letting for?" - else - "Which location is this log for?" - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 5 }.freeze end diff --git a/app/models/form/lettings/questions/managing_organisation.rb b/app/models/form/lettings/questions/managing_organisation.rb index 81847876e..e415837fe 100644 --- a/app/models/form/lettings/questions/managing_organisation.rb +++ b/app/models/form/lettings/questions/managing_organisation.rb @@ -2,8 +2,6 @@ class Form::Lettings::Questions::ManagingOrganisation < ::Form::Question def initialize(id, hsh, page) super @id = "managing_organisation_id" - @check_answer_label = "Managing agent" - @header = "Which organisation manages this letting?" @derived = true @type = "select" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? diff --git a/app/models/form/lettings/questions/needs_type.rb b/app/models/form/lettings/questions/needs_type.rb index 158626843..4a0aff67b 100644 --- a/app/models/form/lettings/questions/needs_type.rb +++ b/app/models/form/lettings/questions/needs_type.rb @@ -2,9 +2,6 @@ class Form::Lettings::Questions::NeedsType < ::Form::Question def initialize(id, hsh, page) super @id = "needstype" - @check_answer_label = "Needs type" - @header = "What is the needs type?" - @hint_text = "General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing can include direct access hostels, group homes, residential care and nursing homes." @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? diff --git a/app/models/form/lettings/questions/preg_occ.rb b/app/models/form/lettings/questions/preg_occ.rb index a733fc806..1ad1bd1f5 100644 --- a/app/models/form/lettings/questions/preg_occ.rb +++ b/app/models/form/lettings/questions/preg_occ.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::PregOcc < ::Form::Question def initialize(id, hsh, page) super @id = "preg_occ" - @check_answer_label = "Anybody in household pregnant" - @header = "Is anybody in the household pregnant?" @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/property_reference.rb b/app/models/form/lettings/questions/property_reference.rb index f7d80829c..d4587ffe8 100644 --- a/app/models/form/lettings/questions/property_reference.rb +++ b/app/models/form/lettings/questions/property_reference.rb @@ -2,9 +2,6 @@ class Form::Lettings::Questions::PropertyReference < ::Form::Question def initialize(id, hsh, page) super @id = "propcode" - @check_answer_label = "Property reference" - @header = "What is the property reference?" - @hint_text = "This is how you usually refer to this property on your own systems." @type = "text" @width = 10 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? diff --git a/app/models/form/lettings/questions/renewal.rb b/app/models/form/lettings/questions/renewal.rb index 2a32d1f16..e78d98247 100644 --- a/app/models/form/lettings/questions/renewal.rb +++ b/app/models/form/lettings/questions/renewal.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Renewal < ::Form::Question def initialize(id, hsh, page) super @id = "renewal" - @check_answer_label = "Property renewal" - @header = header_text @type = "radio" @answer_options = ANSWER_OPTIONS - @hint_text = hint_text @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? end @@ -16,21 +13,5 @@ class Form::Lettings::Questions::Renewal < ::Form::Question } .freeze - def header_text - if form.start_year_after_2024? - "Is this letting a renewal of social housing to the same tenant in the same property?" - else - "Is this letting a renewal?" - end - end - - def hint_text - if form.start_year_after_2024? - "If the property was previously being used as temporary accommodation, then answer 'no'" - else - "A renewal is a letting to the same tenant in the same property. If the property was previously being used as temporary accommodation, then answer 'no'" - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 4, 2024 => 6 }.freeze end diff --git a/app/models/form/lettings/questions/rent_type.rb b/app/models/form/lettings/questions/rent_type.rb index 7454cd752..818ead98a 100644 --- a/app/models/form/lettings/questions/rent_type.rb +++ b/app/models/form/lettings/questions/rent_type.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::RentType < ::Form::Question def initialize(id, hsh, page) super @id = "rent_type" - @check_answer_label = "Rent type" - @header = "What is the rent type?" + @copy_key = "lettings.setup.rent_type.rent_type" @type = "radio" @top_guidance_partial = form.start_year_after_2024? ? "rent_type_definitions_2024" : "rent_type_definitions" @answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_2024 : ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/reservist.rb b/app/models/form/lettings/questions/reservist.rb index d411f96e7..023f1655d 100644 --- a/app/models/form/lettings/questions/reservist.rb +++ b/app/models/form/lettings/questions/reservist.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Reservist < ::Form::Question def initialize(id, hsh, page) super @id = "reservist" - @check_answer_label = "Person seriously injured or ill as result of serving in UK armed forces" - @header = "Was the person seriously injured or ill as a result of serving in the UK armed forces?" @type = "radio" @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/scheme_id.rb b/app/models/form/lettings/questions/scheme_id.rb index d5c58df61..862ef3130 100644 --- a/app/models/form/lettings/questions/scheme_id.rb +++ b/app/models/form/lettings/questions/scheme_id.rb @@ -1,8 +1,6 @@ class Form::Lettings::Questions::SchemeId < ::Form::Question def initialize(_id, hsh, page) super("scheme_id", hsh, page) - @check_answer_label = "Scheme name" - @header = "What scheme is this log for?" @type = "select" @answer_options = answer_options @top_guidance_partial = "finding_scheme" @@ -48,15 +46,6 @@ class Form::Lettings::Questions::SchemeId < ::Form::Question lettings_log.form.get_question("postcode_full", nil).label_from_value(lettings_log.postcode_full) unless lettings_log.scheme_has_multiple_locations? end - def hint_text - if form.start_year_after_2024? - "Enter postcode or scheme name.

- A supported housing scheme provides shared or self-contained housing for a particular client group, for example younger or vulnerable people." - else - "Enter postcode or scheme name" - end - end - private def supported_housing_selected?(lettings_log) diff --git a/app/models/form/lettings/questions/stock_owner.rb b/app/models/form/lettings/questions/stock_owner.rb index daa042004..6fc418b62 100644 --- a/app/models/form/lettings/questions/stock_owner.rb +++ b/app/models/form/lettings/questions/stock_owner.rb @@ -2,8 +2,6 @@ class Form::Lettings::Questions::StockOwner < ::Form::Question def initialize(id, hsh, page) super @id = "owning_organisation_id" - @check_answer_label = "Stock owner" - @header = "Which organisation owns this property?" @derived = true @type = "select" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? diff --git a/app/models/form/lettings/questions/tenancy_start_date.rb b/app/models/form/lettings/questions/tenancy_start_date.rb index c7dc73627..cf1b556e7 100644 --- a/app/models/form/lettings/questions/tenancy_start_date.rb +++ b/app/models/form/lettings/questions/tenancy_start_date.rb @@ -2,8 +2,6 @@ class Form::Lettings::Questions::TenancyStartDate < ::Form::Question def initialize(id, hsh, page) super @id = "startdate" - @check_answer_label = "Tenancy start date" - @header = "What is the tenancy start date?" @type = "date" @unresolved_hint_text = "Some scheme details have changed, and now this log needs updating. Check that the tenancy start date is correct." @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? diff --git a/app/models/form/lettings/questions/tenant_code.rb b/app/models/form/lettings/questions/tenant_code.rb index 30b51525a..7b7be3cac 100644 --- a/app/models/form/lettings/questions/tenant_code.rb +++ b/app/models/form/lettings/questions/tenant_code.rb @@ -2,9 +2,6 @@ class Form::Lettings::Questions::TenantCode < ::Form::Question def initialize(id, hsh, page) super @id = "tenancycode" - @check_answer_label = "Tenant code" - @header = "What is the tenant code?" - @hint_text = "This is how you usually refer to this tenancy on your own systems." @type = "text" @width = 10 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? diff --git a/app/models/form/lettings/subsections/household_needs.rb b/app/models/form/lettings/subsections/household_needs.rb index 2f6900f4f..3bfbbb336 100644 --- a/app/models/form/lettings/subsections/household_needs.rb +++ b/app/models/form/lettings/subsections/household_needs.rb @@ -2,6 +2,7 @@ class Form::Lettings::Subsections::HouseholdNeeds < ::Form::Subsection def initialize(id, hsh, section) super @id = "household_needs" + @copy_key = "lettings.household_needs.housingneeds_type" @label = "Household needs" @depends_on = [{ "non_location_setup_questions_completed?" => true }] end diff --git a/app/models/form/sales/pages/age1.rb b/app/models/form/sales/pages/age1.rb index caa0948ee..12fc8c4d2 100644 --- a/app/models/form/sales/pages/age1.rb +++ b/app/models/form/sales/pages/age1.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::Age1 < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_1_age" + @copy_key = "sales.household_characteristics.age1" @depends_on = [ { "buyer_has_seen_privacy_notice?" => true, diff --git a/app/models/form/sales/pages/age2.rb b/app/models/form/sales/pages/age2.rb index ee3bbc487..fb8d3953a 100644 --- a/app/models/form/sales/pages/age2.rb +++ b/app/models/form/sales/pages/age2.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::Age2 < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_2_age" + @copy_key = "sales.household_characteristics.age2.buyer" @depends_on = [ { "joint_purchase?" => true, diff --git a/app/models/form/sales/pages/buyer1_ethnic_background_arab.rb b/app/models/form/sales/pages/buyer1_ethnic_background_arab.rb index e0e74e129..ff603e1d6 100644 --- a/app/models/form/sales/pages/buyer1_ethnic_background_arab.rb +++ b/app/models/form/sales/pages/buyer1_ethnic_background_arab.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer1EthnicBackgroundArab < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_1_ethnic_background_arab" + @copy_key = "sales.household_characteristics.ethnic.ethnic_background_arab" @depends_on = [{ "ethnic_group" => 4, }] diff --git a/app/models/form/sales/pages/buyer1_ethnic_background_asian.rb b/app/models/form/sales/pages/buyer1_ethnic_background_asian.rb index 599a48f91..5b865cd9b 100644 --- a/app/models/form/sales/pages/buyer1_ethnic_background_asian.rb +++ b/app/models/form/sales/pages/buyer1_ethnic_background_asian.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer1EthnicBackgroundAsian < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_1_ethnic_background_asian" + @copy_key = "sales.household_characteristics.ethnic.ethnic_background_asian" @depends_on = [{ "ethnic_group" => 2, }] diff --git a/app/models/form/sales/pages/buyer1_ethnic_background_black.rb b/app/models/form/sales/pages/buyer1_ethnic_background_black.rb index 73e17d912..a54c4c54d 100644 --- a/app/models/form/sales/pages/buyer1_ethnic_background_black.rb +++ b/app/models/form/sales/pages/buyer1_ethnic_background_black.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer1EthnicBackgroundBlack < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_1_ethnic_background_black" + @copy_key = "sales.household_characteristics.ethnic.ethnic_background_black" @depends_on = [{ "ethnic_group" => 3, }] diff --git a/app/models/form/sales/pages/buyer1_ethnic_background_mixed.rb b/app/models/form/sales/pages/buyer1_ethnic_background_mixed.rb index 13fea19a7..2b498e68f 100644 --- a/app/models/form/sales/pages/buyer1_ethnic_background_mixed.rb +++ b/app/models/form/sales/pages/buyer1_ethnic_background_mixed.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer1EthnicBackgroundMixed < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_1_ethnic_background_mixed" + @copy_key = "sales.household_characteristics.ethnic.ethnic_background_mixed" @depends_on = [{ "ethnic_group" => 1, }] diff --git a/app/models/form/sales/pages/buyer1_ethnic_background_white.rb b/app/models/form/sales/pages/buyer1_ethnic_background_white.rb index 2e4bd3097..4553d5d36 100644 --- a/app/models/form/sales/pages/buyer1_ethnic_background_white.rb +++ b/app/models/form/sales/pages/buyer1_ethnic_background_white.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer1EthnicBackgroundWhite < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_1_ethnic_background_white" + @copy_key = "sales.household_characteristics.ethnic.ethnic_background_white" @depends_on = [{ "ethnic_group" => 0, }] diff --git a/app/models/form/sales/pages/buyer2_ethnic_background_arab.rb b/app/models/form/sales/pages/buyer2_ethnic_background_arab.rb index 593e43ebc..370e07dcd 100644 --- a/app/models/form/sales/pages/buyer2_ethnic_background_arab.rb +++ b/app/models/form/sales/pages/buyer2_ethnic_background_arab.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2EthnicBackgroundArab < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_2_ethnic_background_arab" + @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_arab" @depends_on = [{ "ethnic_group2" => 4, }] diff --git a/app/models/form/sales/pages/buyer2_ethnic_background_asian.rb b/app/models/form/sales/pages/buyer2_ethnic_background_asian.rb index 98a36476e..0c9f47627 100644 --- a/app/models/form/sales/pages/buyer2_ethnic_background_asian.rb +++ b/app/models/form/sales/pages/buyer2_ethnic_background_asian.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2EthnicBackgroundAsian < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_2_ethnic_background_asian" + @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_asian" @depends_on = [{ "ethnic_group2" => 2, }] diff --git a/app/models/form/sales/pages/buyer2_ethnic_background_black.rb b/app/models/form/sales/pages/buyer2_ethnic_background_black.rb index a772f46ac..2178d42ce 100644 --- a/app/models/form/sales/pages/buyer2_ethnic_background_black.rb +++ b/app/models/form/sales/pages/buyer2_ethnic_background_black.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2EthnicBackgroundBlack < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_2_ethnic_background_black" + @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_black" @depends_on = [{ "ethnic_group2" => 3, }] diff --git a/app/models/form/sales/pages/buyer2_ethnic_background_mixed.rb b/app/models/form/sales/pages/buyer2_ethnic_background_mixed.rb index f02165dfc..9a8710396 100644 --- a/app/models/form/sales/pages/buyer2_ethnic_background_mixed.rb +++ b/app/models/form/sales/pages/buyer2_ethnic_background_mixed.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2EthnicBackgroundMixed < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_2_ethnic_background_mixed" + @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_black" @depends_on = [{ "ethnic_group2" => 1, }] diff --git a/app/models/form/sales/pages/buyer2_ethnic_background_white.rb b/app/models/form/sales/pages/buyer2_ethnic_background_white.rb index 2013c8682..d81f20d4f 100644 --- a/app/models/form/sales/pages/buyer2_ethnic_background_white.rb +++ b/app/models/form/sales/pages/buyer2_ethnic_background_white.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2EthnicBackgroundWhite < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_2_ethnic_background_white" + @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_white" @depends_on = [{ "ethnic_group2" => 0, }] diff --git a/app/models/form/sales/pages/buyer2_relationship_to_buyer1.rb b/app/models/form/sales/pages/buyer2_relationship_to_buyer1.rb index 0791769d8..a9d3550f0 100644 --- a/app/models/form/sales/pages/buyer2_relationship_to_buyer1.rb +++ b/app/models/form/sales/pages/buyer2_relationship_to_buyer1.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2RelationshipToBuyer1 < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_2_relationship_to_buyer_1" + @copy_key = "sales.household_characteristics.relat2.buyer" @depends_on = [ { "joint_purchase?" => true, diff --git a/app/models/form/sales/pages/buyer2_working_situation.rb b/app/models/form/sales/pages/buyer2_working_situation.rb index 1ff7bbecc..4e73c09cf 100644 --- a/app/models/form/sales/pages/buyer2_working_situation.rb +++ b/app/models/form/sales/pages/buyer2_working_situation.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::Buyer2WorkingSituation < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_2_working_situation" + @copy_key = "sales.household_characteristics.ecstat2.buyer" @depends_on = [ { "joint_purchase?" => true, diff --git a/app/models/form/sales/pages/buyer_interview.rb b/app/models/form/sales/pages/buyer_interview.rb index d042db288..c6a43690b 100644 --- a/app/models/form/sales/pages/buyer_interview.rb +++ b/app/models/form/sales/pages/buyer_interview.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::BuyerInterview < ::Form::Page def initialize(id, hsh, subsection, joint_purchase:) super(id, hsh, subsection) @joint_purchase = joint_purchase - @copy_key = "sales.setup.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" + @copy_key = "sales.#{subsection.id}.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" end def questions diff --git a/app/models/form/sales/pages/buyer_live_in_value_check.rb b/app/models/form/sales/pages/buyer_live_in_value_check.rb index 99080ae77..bb08ba7f4 100644 --- a/app/models/form/sales/pages/buyer_live_in_value_check.rb +++ b/app/models/form/sales/pages/buyer_live_in_value_check.rb @@ -6,12 +6,13 @@ class Form::Sales::Pages::BuyerLiveInValueCheck < Form::Sales::Pages::Person "buyer#{person_index}_livein_wrong_for_ownership_type?" => true, }, ] + @copy_key = "sales.soft_validations.buyer_livein_value_check.buyer#{person_index}" @title_text = { - "translation" => "soft_validations.buyer#{person_index}_livein_wrong_for_ownership_type.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }], } @informative_text = { - "translation" => "soft_validations.buyer#{person_index}_livein_wrong_for_ownership_type.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }], } end diff --git a/app/models/form/sales/pages/gender_identity2.rb b/app/models/form/sales/pages/gender_identity2.rb index 94e585795..dc38847e4 100644 --- a/app/models/form/sales/pages/gender_identity2.rb +++ b/app/models/form/sales/pages/gender_identity2.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::GenderIdentity2 < ::Form::Page def initialize(id, hsh, subsection) super @id = "buyer_2_gender_identity" + @copy_key = "sales.household_characteristics.sex2.buyer" @depends_on = [ { "joint_purchase?" => true, diff --git a/app/models/form/sales/pages/multiple_partners_value_check.rb b/app/models/form/sales/pages/multiple_partners_value_check.rb index db409f148..37ab02ca4 100644 --- a/app/models/form/sales/pages/multiple_partners_value_check.rb +++ b/app/models/form/sales/pages/multiple_partners_value_check.rb @@ -6,12 +6,16 @@ class Form::Sales::Pages::MultiplePartnersValueCheck < Form::Sales::Pages::Perso "multiple_partners?" => true, }, ] + @copy_key = "sales.soft_validations.multiple_partners_value_check" @person_index = person_index @title_text = { - "translation" => "soft_validations.multiple_partners_sales.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], + } + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } - @informative_text = {} end def questions diff --git a/app/models/form/sales/pages/not_retired_value_check.rb b/app/models/form/sales/pages/not_retired_value_check.rb index 193aa6e7d..cf480cb59 100644 --- a/app/models/form/sales/pages/not_retired_value_check.rb +++ b/app/models/form/sales/pages/not_retired_value_check.rb @@ -7,11 +7,13 @@ class Form::Sales::Pages::NotRetiredValueCheck < Form::Sales::Pages::Person }, ] @person_index = person_index + @copy_key = "sales.soft_validations.retirement_value_check.max" @title_text = { - "translation" => "soft_validations.retirement.max.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", } @informative_text = { - "translation" => "soft_validations.retirement.max.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/sales/pages/old_persons_shared_ownership_value_check.rb b/app/models/form/sales/pages/old_persons_shared_ownership_value_check.rb index 0254804f0..7ac7b7cad 100644 --- a/app/models/form/sales/pages/old_persons_shared_ownership_value_check.rb +++ b/app/models/form/sales/pages/old_persons_shared_ownership_value_check.rb @@ -1,12 +1,13 @@ class Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck < ::Form::Page def initialize(id, hsh, subsection, joint_purchase:) super(id, hsh, subsection) + @copy_key = "sales.soft_validations.old_persons_shared_ownership_value_check" @title_text = { - "translation" => "soft_validations.old_persons_shared_ownership.title_text.#{joint_purchase ? 'two' : 'one'}", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}", "arguments" => [], } @informative_text = { - "translation" => "soft_validations.old_persons_shared_ownership.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } @joint_purchase = joint_purchase diff --git a/app/models/form/sales/pages/partner_under_16_value_check.rb b/app/models/form/sales/pages/partner_under_16_value_check.rb index 5113e1677..f6b3622f1 100644 --- a/app/models/form/sales/pages/partner_under_16_value_check.rb +++ b/app/models/form/sales/pages/partner_under_16_value_check.rb @@ -6,9 +6,10 @@ class Form::Sales::Pages::PartnerUnder16ValueCheck < Form::Sales::Pages::Person "person_#{person_index}_partner_under_16?" => true, }, ] + @copy_key = "sales.soft_validations.partner_under_16_value_check" @person_index = person_index @title_text = { - "translation" => "soft_validations.partner_under_16_sales.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "age#{person_index}", @@ -17,7 +18,10 @@ class Form::Sales::Pages::PartnerUnder16ValueCheck < Form::Sales::Pages::Person }, ], } - @informative_text = {} + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } end def questions diff --git a/app/models/form/sales/pages/person_age.rb b/app/models/form/sales/pages/person_age.rb index 82e958aca..af7daa606 100644 --- a/app/models/form/sales/pages/person_age.rb +++ b/app/models/form/sales/pages/person_age.rb @@ -1,6 +1,7 @@ class Form::Sales::Pages::PersonAge < Form::Sales::Pages::Person def initialize(id, hsh, subsection, person_index:) super + @copy_key = person_index == 2 ? "sales.household_characteristics.age2.person" : "sales.household_characteristics.age#{person_index}" @depends_on = [{ "details_known_#{person_index}" => 1 }] end diff --git a/app/models/form/sales/pages/person_gender_identity.rb b/app/models/form/sales/pages/person_gender_identity.rb index 7cc080fa4..f4673d1db 100644 --- a/app/models/form/sales/pages/person_gender_identity.rb +++ b/app/models/form/sales/pages/person_gender_identity.rb @@ -1,6 +1,7 @@ class Form::Sales::Pages::PersonGenderIdentity < Form::Sales::Pages::Person def initialize(id, hsh, subsection, person_index:) super + @copy_key = "sales.household_characteristics.sex2.person" if person_index == 2 @depends_on = [ { "details_known_#{person_index}" => 1 }, ] diff --git a/app/models/form/sales/pages/person_relationship_to_buyer_1.rb b/app/models/form/sales/pages/person_relationship_to_buyer_1.rb index 3967d57ea..8f09e50b6 100644 --- a/app/models/form/sales/pages/person_relationship_to_buyer_1.rb +++ b/app/models/form/sales/pages/person_relationship_to_buyer_1.rb @@ -1,6 +1,7 @@ class Form::Sales::Pages::PersonRelationshipToBuyer1 < ::Form::Sales::Pages::Person def initialize(id, hsh, subsection, person_index:) super + @copy_key = "sales.household_characteristics.relat2.person" if person_index == 2 @depends_on = [ { "details_known_#{person_index}" => 1 }, ] diff --git a/app/models/form/sales/pages/person_student_not_child_value_check.rb b/app/models/form/sales/pages/person_student_not_child_value_check.rb index a798c8e16..33448298c 100644 --- a/app/models/form/sales/pages/person_student_not_child_value_check.rb +++ b/app/models/form/sales/pages/person_student_not_child_value_check.rb @@ -6,11 +6,12 @@ class Form::Sales::Pages::PersonStudentNotChildValueCheck < Form::Sales::Pages:: "person_#{person_index}_student_not_child?" => true, }, ] + @copy_key = "sales.soft_validations.student_not_child_value_check" @person_index = person_index @title_text = { - "translation" => "soft_validations.student_not_child.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", } - @informative_text = {} + @informative_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [] } end def questions diff --git a/app/models/form/sales/pages/person_working_situation.rb b/app/models/form/sales/pages/person_working_situation.rb index 488141ccf..5237d2827 100644 --- a/app/models/form/sales/pages/person_working_situation.rb +++ b/app/models/form/sales/pages/person_working_situation.rb @@ -1,6 +1,7 @@ class Form::Sales::Pages::PersonWorkingSituation < Form::Sales::Pages::Person def initialize(id, hsh, subsection, person_index:) super + @copy_key = "sales.household_characteristics.ecstat2.person" if person_index == 2 @depends_on = [ { "details_known_#{person_index}" => 1, diff --git a/app/models/form/sales/pages/privacy_notice.rb b/app/models/form/sales/pages/privacy_notice.rb index cf6a7bbbc..40c441d3e 100644 --- a/app/models/form/sales/pages/privacy_notice.rb +++ b/app/models/form/sales/pages/privacy_notice.rb @@ -1,7 +1,7 @@ class Form::Sales::Pages::PrivacyNotice < ::Form::Page def initialize(id, hsh, subsection, joint_purchase:) super(id, hsh, subsection) - @copy_key = "sales.setup.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" + @copy_key = "sales.#{subsection.id}.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @joint_purchase = joint_purchase end diff --git a/app/models/form/sales/pages/retirement_value_check.rb b/app/models/form/sales/pages/retirement_value_check.rb index 9e5dbb87f..0f3e45559 100644 --- a/app/models/form/sales/pages/retirement_value_check.rb +++ b/app/models/form/sales/pages/retirement_value_check.rb @@ -7,8 +7,9 @@ class Form::Sales::Pages::RetirementValueCheck < Form::Sales::Pages::Person }, ] @person_index = person_index + @copy_key = "sales.soft_validations.retirement_value_check.min" @title_text = { - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "age#{person_index}", @@ -17,7 +18,10 @@ class Form::Sales::Pages::RetirementValueCheck < Form::Sales::Pages::Person }, ], } - @informative_text = {} + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } end def questions diff --git a/app/models/form/sales/questions/age1.rb b/app/models/form/sales/questions/age1.rb index 65a969c08..4722d0208 100644 --- a/app/models/form/sales/questions/age1.rb +++ b/app/models/form/sales/questions/age1.rb @@ -2,10 +2,9 @@ class Form::Sales::Questions::Age1 < ::Form::Question def initialize(id, hsh, page) super @id = "age1" - @check_answer_label = "Buyer 1’s age" - @header = "Age" @type = "numeric" @width = 2 + @copy_key = "sales.household_characteristics.age1.age1" @inferred_check_answers_value = [ { "condition" => { "age1_known" => 1 }, diff --git a/app/models/form/sales/questions/age2.rb b/app/models/form/sales/questions/age2.rb index 82deecbed..29d955291 100644 --- a/app/models/form/sales/questions/age2.rb +++ b/app/models/form/sales/questions/age2.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::Age2 < ::Form::Question def initialize(id, hsh, page) super @id = "age2" - @check_answer_label = "Buyer 2’s age" - @header = "Age" + @copy_key = "sales.household_characteristics.age2.buyer.age2" @type = "numeric" @width = 2 @inferred_check_answers_value = [{ diff --git a/app/models/form/sales/questions/buyer1_age_known.rb b/app/models/form/sales/questions/buyer1_age_known.rb index 2e38871eb..9f6da83ad 100644 --- a/app/models/form/sales/questions/buyer1_age_known.rb +++ b/app/models/form/sales/questions/buyer1_age_known.rb @@ -2,11 +2,9 @@ class Form::Sales::Questions::Buyer1AgeKnown < ::Form::Question def initialize(id, hsh, page) super @id = "age1_known" - @check_answer_label = "Buyer 1’s age" - @header = "Do you know buyer 1’s age?" @type = "radio" + @copy_key = "sales.household_characteristics.age1.age1_known" @answer_options = ANSWER_OPTIONS - @hint_text = "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @conditional_for = { "age1" => [0], } diff --git a/app/models/form/sales/questions/buyer1_ethnic_background_arab.rb b/app/models/form/sales/questions/buyer1_ethnic_background_arab.rb index fbaca62ca..12a4bd842 100644 --- a/app/models/form/sales/questions/buyer1_ethnic_background_arab.rb +++ b/app/models/form/sales/questions/buyer1_ethnic_background_arab.rb @@ -2,11 +2,9 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundArab < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic" - @check_answer_label = "Buyer 1’s ethnic background" - @header = "Which of the following best describes buyer 1’s Arab background?" + @copy_key = "sales.household_characteristics.ethnic.ethnic_background_arab" @type = "radio" @answer_options = ANSWER_OPTIONS - @hint_text = form.start_year_after_2024? ? "" : "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @check_answers_card_number = 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/sales/questions/buyer1_ethnic_background_asian.rb b/app/models/form/sales/questions/buyer1_ethnic_background_asian.rb index 64cffb507..1b982e39c 100644 --- a/app/models/form/sales/questions/buyer1_ethnic_background_asian.rb +++ b/app/models/form/sales/questions/buyer1_ethnic_background_asian.rb @@ -2,11 +2,9 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundAsian < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic" - @check_answer_label = "Buyer 1’s ethnic background" - @header = "Which of the following best describes buyer 1’s Asian or Asian British background?" + @copy_key = "sales.household_characteristics.ethnic.ethnic_background_asian" @type = "radio" @answer_options = ANSWER_OPTIONS - @hint_text = form.start_year_after_2024? ? "" : "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @check_answers_card_number = 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/sales/questions/buyer1_ethnic_background_black.rb b/app/models/form/sales/questions/buyer1_ethnic_background_black.rb index 41d951d71..fac93e0eb 100644 --- a/app/models/form/sales/questions/buyer1_ethnic_background_black.rb +++ b/app/models/form/sales/questions/buyer1_ethnic_background_black.rb @@ -2,11 +2,9 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundBlack < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic" - @check_answer_label = "Buyer 1’s ethnic background" - @header = "Which of the following best describes buyer 1’s Black, African, Caribbean or Black British background?" + @copy_key = "sales.household_characteristics.ethnic.ethnic_background_black" @type = "radio" @answer_options = ANSWER_OPTIONS - @hint_text = form.start_year_after_2024? ? "" : "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @check_answers_card_number = 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/sales/questions/buyer1_ethnic_background_mixed.rb b/app/models/form/sales/questions/buyer1_ethnic_background_mixed.rb index 42506b70e..342490da3 100644 --- a/app/models/form/sales/questions/buyer1_ethnic_background_mixed.rb +++ b/app/models/form/sales/questions/buyer1_ethnic_background_mixed.rb @@ -2,11 +2,9 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundMixed < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic" - @check_answer_label = "Buyer 1’s ethnic background" - @header = "Which of the following best describes buyer 1’s Mixed or Multiple ethnic groups background?" + @copy_key = "sales.household_characteristics.ethnic.ethnic_background_mixed" @type = "radio" @answer_options = ANSWER_OPTIONS - @hint_text = form.start_year_after_2024? ? "" : "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @check_answers_card_number = 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/sales/questions/buyer1_ethnic_background_white.rb b/app/models/form/sales/questions/buyer1_ethnic_background_white.rb index 6c8017fbf..2bbe4939f 100644 --- a/app/models/form/sales/questions/buyer1_ethnic_background_white.rb +++ b/app/models/form/sales/questions/buyer1_ethnic_background_white.rb @@ -2,10 +2,8 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundWhite < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic" - @check_answer_label = "Buyer 1’s ethnic background" - @header = "Which of the following best describes buyer 1’s White background?" + @copy_key = "sales.household_characteristics.ethnic.ethnic_background_white" @type = "radio" - @hint_text = form.start_year_after_2024? ? "" : "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @check_answers_card_number = 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/sales/questions/buyer1_ethnic_group.rb b/app/models/form/sales/questions/buyer1_ethnic_group.rb index a3eec2474..9e67164cc 100644 --- a/app/models/form/sales/questions/buyer1_ethnic_group.rb +++ b/app/models/form/sales/questions/buyer1_ethnic_group.rb @@ -2,11 +2,8 @@ class Form::Sales::Questions::Buyer1EthnicGroup < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic_group" - @check_answer_label = "Buyer 1’s ethnic group" - @header = "What is buyer 1’s ethnic group?" @type = "radio" @answer_options = ANSWER_OPTIONS - @hint_text = form.start_year_after_2024? ? "" : "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @check_answers_card_number = 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/sales/questions/buyer1_live_in_property.rb b/app/models/form/sales/questions/buyer1_live_in_property.rb index 83dff6437..835cbe4a3 100644 --- a/app/models/form/sales/questions/buyer1_live_in_property.rb +++ b/app/models/form/sales/questions/buyer1_live_in_property.rb @@ -2,11 +2,8 @@ class Form::Sales::Questions::Buyer1LiveInProperty < ::Form::Question def initialize(id, hsh, page) super @id = "buy1livein" - @check_answer_label = "Will buyer 1 live in the property?" - @header = "Will buyer 1 live in the property?" @type = "radio" @answer_options = ANSWER_OPTIONS - @hint_text = form.start_year_after_2024? ? "" : "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @check_answers_card_number = 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/sales/questions/buyer1_nationality.rb b/app/models/form/sales/questions/buyer1_nationality.rb index b0bedfbb4..9cd5f3eed 100644 --- a/app/models/form/sales/questions/buyer1_nationality.rb +++ b/app/models/form/sales/questions/buyer1_nationality.rb @@ -2,10 +2,7 @@ class Form::Sales::Questions::Buyer1Nationality < ::Form::Question def initialize(id, hsh, page) super @id = "national" - @check_answer_label = "Buyer 1’s nationality" - @header = "What is buyer 1’s nationality?" @type = "radio" - @hint_text = "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @answer_options = ANSWER_OPTIONS @check_answers_card_number = 1 @inferred_check_answers_value = [{ diff --git a/app/models/form/sales/questions/buyer1_working_situation.rb b/app/models/form/sales/questions/buyer1_working_situation.rb index 376367624..b00db033f 100644 --- a/app/models/form/sales/questions/buyer1_working_situation.rb +++ b/app/models/form/sales/questions/buyer1_working_situation.rb @@ -2,11 +2,8 @@ class Form::Sales::Questions::Buyer1WorkingSituation < ::Form::Question def initialize(id, hsh, page) super @id = "ecstat1" - @check_answer_label = "Buyer 1's working situation" - @header = "Which of these best describes buyer 1's working situation?" @type = "radio" @answer_options = ANSWER_OPTIONS - @hint_text = form.start_year_after_2024? ? "" : "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." @check_answers_card_number = 1 @inferred_check_answers_value = [{ "condition" => { diff --git a/app/models/form/sales/questions/buyer2_age_known.rb b/app/models/form/sales/questions/buyer2_age_known.rb index 7123d3e5e..ecd6c91f0 100644 --- a/app/models/form/sales/questions/buyer2_age_known.rb +++ b/app/models/form/sales/questions/buyer2_age_known.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2AgeKnown < ::Form::Question def initialize(id, hsh, page) super @id = "age2_known" - @check_answer_label = "Buyer 2’s age" - @header = "Do you know buyer 2’s age?" + @copy_key = "sales.household_characteristics.age2.buyer.age2_known" @type = "radio" @answer_options = ANSWER_OPTIONS @conditional_for = { diff --git a/app/models/form/sales/questions/buyer2_ethnic_background_arab.rb b/app/models/form/sales/questions/buyer2_ethnic_background_arab.rb index 5debc0257..e69ad5a9e 100644 --- a/app/models/form/sales/questions/buyer2_ethnic_background_arab.rb +++ b/app/models/form/sales/questions/buyer2_ethnic_background_arab.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundArab < ::Form::Question def initialize(id, hsh, page) super @id = "ethnicbuy2" - @check_answer_label = "Buyer 2’s ethnic background" - @header = "Which of the following best describes buyer 2’s Arab background?" + @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_arab" @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 diff --git a/app/models/form/sales/questions/buyer2_ethnic_background_asian.rb b/app/models/form/sales/questions/buyer2_ethnic_background_asian.rb index eee32a4b2..8c31fc723 100644 --- a/app/models/form/sales/questions/buyer2_ethnic_background_asian.rb +++ b/app/models/form/sales/questions/buyer2_ethnic_background_asian.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundAsian < ::Form::Question def initialize(id, hsh, page) super @id = "ethnicbuy2" - @check_answer_label = "Buyer 2’s ethnic background" - @header = "Which of the following best describes buyer 2’s Asian or Asian British background?" + @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_asian" @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 diff --git a/app/models/form/sales/questions/buyer2_ethnic_background_black.rb b/app/models/form/sales/questions/buyer2_ethnic_background_black.rb index 4fffd67ca..f44119251 100644 --- a/app/models/form/sales/questions/buyer2_ethnic_background_black.rb +++ b/app/models/form/sales/questions/buyer2_ethnic_background_black.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundBlack < ::Form::Question def initialize(id, hsh, page) super @id = "ethnicbuy2" - @check_answer_label = "Buyer 2’s ethnic background" - @header = "Which of the following best describes buyer 2’s Black, African, Caribbean or Black British background?" + @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_black" @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 diff --git a/app/models/form/sales/questions/buyer2_ethnic_background_mixed.rb b/app/models/form/sales/questions/buyer2_ethnic_background_mixed.rb index d66e2e2aa..013ad100b 100644 --- a/app/models/form/sales/questions/buyer2_ethnic_background_mixed.rb +++ b/app/models/form/sales/questions/buyer2_ethnic_background_mixed.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundMixed < ::Form::Question def initialize(id, hsh, page) super @id = "ethnicbuy2" - @check_answer_label = "Buyer 2’s ethnic background" - @header = "Which of the following best describes buyer 2’s Mixed or Multiple ethnic groups background?" + @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_mixed" @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 diff --git a/app/models/form/sales/questions/buyer2_ethnic_background_white.rb b/app/models/form/sales/questions/buyer2_ethnic_background_white.rb index 8af5b8641..232e0f99e 100644 --- a/app/models/form/sales/questions/buyer2_ethnic_background_white.rb +++ b/app/models/form/sales/questions/buyer2_ethnic_background_white.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundWhite < ::Form::Question def initialize(id, hsh, page) super @id = "ethnicbuy2" - @check_answer_label = "Buyer 2’s ethnic background" - @header = "Which of the following best describes buyer 2’s White background?" + @copy_key = "sales.household_characteristics.ethnicbuy2.ethnic_background_white" @type = "radio" @check_answers_card_number = 2 @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_ethnic_group.rb b/app/models/form/sales/questions/buyer2_ethnic_group.rb index 16b5d7cd0..4613b9963 100644 --- a/app/models/form/sales/questions/buyer2_ethnic_group.rb +++ b/app/models/form/sales/questions/buyer2_ethnic_group.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::Buyer2EthnicGroup < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic_group2" - @check_answer_label = "Buyer 2’s ethnic group" - @header = "What is buyer 2’s ethnic group?" @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 diff --git a/app/models/form/sales/questions/buyer2_live_in_property.rb b/app/models/form/sales/questions/buyer2_live_in_property.rb index 93f5c3870..4d6aad8ba 100644 --- a/app/models/form/sales/questions/buyer2_live_in_property.rb +++ b/app/models/form/sales/questions/buyer2_live_in_property.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::Buyer2LiveInProperty < ::Form::Question def initialize(id, hsh, page) super @id = "buy2livein" - @check_answer_label = "Will buyer 2 live in the property?" - @header = "Will buyer 2 live in the property?" @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 diff --git a/app/models/form/sales/questions/buyer2_nationality.rb b/app/models/form/sales/questions/buyer2_nationality.rb index 62f269e4a..c7e92d294 100644 --- a/app/models/form/sales/questions/buyer2_nationality.rb +++ b/app/models/form/sales/questions/buyer2_nationality.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::Buyer2Nationality < ::Form::Question def initialize(id, hsh, page) super @id = "nationalbuy2" - @check_answer_label = "Buyer 2’s nationality" - @header = "What is buyer 2’s nationality?" @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 diff --git a/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb b/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb index f8acf75aa..3f0fc299c 100644 --- a/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb +++ b/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2RelationshipToBuyer1 < ::Form::Question def initialize(id, hsh, page) super @id = "relat2" - @check_answer_label = "Buyer 2's relationship to buyer 1" - @header = "What is buyer 2's relationship to buyer 1?" + @copy_key = "sales.household_characteristics.relat2.buyer" @type = "radio" @answer_options = answer_options @check_answers_card_number = 2 diff --git a/app/models/form/sales/questions/buyer2_working_situation.rb b/app/models/form/sales/questions/buyer2_working_situation.rb index 54fcb5931..5356cb8e8 100644 --- a/app/models/form/sales/questions/buyer2_working_situation.rb +++ b/app/models/form/sales/questions/buyer2_working_situation.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2WorkingSituation < ::Form::Question def initialize(id, hsh, page) super @id = "ecstat2" - @check_answer_label = "Buyer 2's working situation" - @header = "Which of these best describes buyer 2's working situation?" + @copy_key = "sales.household_characteristics.ecstat2.buyer" @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 diff --git a/app/models/form/sales/questions/buyer_interview.rb b/app/models/form/sales/questions/buyer_interview.rb index 8b434d11c..b49b57807 100644 --- a/app/models/form/sales/questions/buyer_interview.rb +++ b/app/models/form/sales/questions/buyer_interview.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::BuyerInterview < ::Form::Question def initialize(id, hsh, page, joint_purchase:) super(id, hsh, page) @id = "noint" - @copy_key = "sales.setup.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" + @copy_key = "sales.#{subsection.id}.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @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/buyer_live_in_value_check.rb b/app/models/form/sales/questions/buyer_live_in_value_check.rb index a4209c38c..1526e1e6e 100644 --- a/app/models/form/sales/questions/buyer_live_in_value_check.rb +++ b/app/models/form/sales/questions/buyer_live_in_value_check.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::BuyerLiveInValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "buyer_livein_value_check" - @check_answer_label = "Buyer live in confirmation" + @copy_key = "sales.soft_validations.buyer_livein_value_check.buyer#{person_index}" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Sales::Questions::BuyerLiveInValueCheck < ::Form::Question ], } @check_answers_card_number = person_index - @header = "Are you sure this is correct?" end end diff --git a/app/models/form/sales/questions/gender_identity1.rb b/app/models/form/sales/questions/gender_identity1.rb index e59ba355b..c82af4b91 100644 --- a/app/models/form/sales/questions/gender_identity1.rb +++ b/app/models/form/sales/questions/gender_identity1.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::GenderIdentity1 < ::Form::Question def initialize(id, hsh, page) super @id = "sex1" - @check_answer_label = "Buyer 1’s gender identity" - @header = "Which of these best describes buyer 1’s gender identity?" @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 1 @@ -17,13 +15,5 @@ class Form::Sales::Questions::GenderIdentity1 < ::Form::Question "R" => { "value" => "Prefers not to say" }, }.freeze - def hint_text - if form.start_year_after_2024? - "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." - else - "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 21, 2024 => 23 }.freeze end diff --git a/app/models/form/sales/questions/gender_identity2.rb b/app/models/form/sales/questions/gender_identity2.rb index 110de6c3a..50545a796 100644 --- a/app/models/form/sales/questions/gender_identity2.rb +++ b/app/models/form/sales/questions/gender_identity2.rb @@ -2,9 +2,8 @@ class Form::Sales::Questions::GenderIdentity2 < ::Form::Question def initialize(id, hsh, page) super @id = "sex2" - @check_answer_label = "Buyer 2’s gender identity" - @header = "Which of these best describes buyer 2’s gender identity?" @type = "radio" + @copy_key = "sales.household_characteristics.sex2.buyer" @answer_options = ANSWER_OPTIONS @check_answers_card_number = 2 @inferred_check_answers_value = [{ @@ -23,11 +22,5 @@ class Form::Sales::Questions::GenderIdentity2 < ::Form::Question "R" => { "value" => "Buyer prefers not to say" }, }.freeze - def hint_text - return unless form.start_year_after_2024? - - "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 29, 2024 => 31 }.freeze end diff --git a/app/models/form/sales/questions/multiple_partners_value_check.rb b/app/models/form/sales/questions/multiple_partners_value_check.rb index ce99438d0..06e3af3b3 100644 --- a/app/models/form/sales/questions/multiple_partners_value_check.rb +++ b/app/models/form/sales/questions/multiple_partners_value_check.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::MultiplePartnersValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "multiple_partners_value_check" - @check_answer_label = "Multiple partners confirmation" + @copy_key = "sales.soft_validations.multiple_partners_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Sales::Questions::MultiplePartnersValueCheck < ::Form::Question ], } @check_answers_card_number = person_index - @header = "Are you sure this is correct?" end end diff --git a/app/models/form/sales/questions/nationality_all.rb b/app/models/form/sales/questions/nationality_all.rb index 68ef122bf..6dd3c19df 100644 --- a/app/models/form/sales/questions/nationality_all.rb +++ b/app/models/form/sales/questions/nationality_all.rb @@ -1,8 +1,6 @@ class Form::Sales::Questions::NationalityAll < ::Form::Question def initialize(id, hsh, page, buyer_index) super(id, hsh, page) - @check_answer_label = "Buyer #{buyer_index}’s nationality" - @header = "Enter a nationality" @type = "select" @answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS @check_answers_card_number = buyer_index diff --git a/app/models/form/sales/questions/nationality_all_group.rb b/app/models/form/sales/questions/nationality_all_group.rb index 86dcabc88..afbc5bf19 100644 --- a/app/models/form/sales/questions/nationality_all_group.rb +++ b/app/models/form/sales/questions/nationality_all_group.rb @@ -1,10 +1,7 @@ class Form::Sales::Questions::NationalityAllGroup < ::Form::Question def initialize(id, hsh, page, buyer_index) super(id, hsh, page) - @check_answer_label = "Buyer #{buyer_index}’s nationality" - @header = "What is buyer #{buyer_index}’s nationality?" @type = "radio" - @hint_text = "If buyer #{buyer_index} is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the buyer should decide which country to enter." @answer_options = ANSWER_OPTIONS @check_answers_card_number = buyer_index @conditional_for = buyer_index == 1 ? { "nationality_all" => [12] } : { "nationality_all_buyer2" => [12] } diff --git a/app/models/form/sales/questions/not_retired_value_check.rb b/app/models/form/sales/questions/not_retired_value_check.rb index 58c95c1bb..86b85f294 100644 --- a/app/models/form/sales/questions/not_retired_value_check.rb +++ b/app/models/form/sales/questions/not_retired_value_check.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::NotRetiredValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "retirement_value_check" - @check_answer_label = "Retirement confirmation" + @copy_key = "sales.soft_validations.retirement_value_check.max" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Sales::Questions::NotRetiredValueCheck < ::Form::Question ], } @check_answers_card_number = person_index - @header = "Are you sure this person isn't retired?" end end diff --git a/app/models/form/sales/questions/number_of_others_in_property.rb b/app/models/form/sales/questions/number_of_others_in_property.rb index fd498cebe..c10047da5 100644 --- a/app/models/form/sales/questions/number_of_others_in_property.rb +++ b/app/models/form/sales/questions/number_of_others_in_property.rb @@ -2,10 +2,8 @@ class Form::Sales::Questions::NumberOfOthersInProperty < ::Form::Question def initialize(id, hsh, page, joint_purchase:) super(id, hsh, page) @id = "hholdcount" - @check_answer_label = "Number of other people living in the property" - @header = "Besides the #{'buyer'.pluralize(joint_purchase ? 2 : 1)}, how many other people live or will live in the property?" + @copy_key = joint_purchase ? "sales.household_characteristics.hholdcount.joint_purchase" : "sales.household_characteristics.hholdcount.not_joint_purchase" @type = "numeric" - @hint_text = hint(joint_purchase) @width = 2 @min = 0 @max = 15 @@ -13,15 +11,5 @@ class Form::Sales::Questions::NumberOfOthersInProperty < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end -private - - def hint(joint_purchase) - if joint_purchase - "You can provide details for a maximum of 4 other people for a joint purchase." - else - "You can provide details for a maximum of 5 other people if there is only one buyer." - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 37 }.freeze end diff --git a/app/models/form/sales/questions/old_persons_shared_ownership_value_check.rb b/app/models/form/sales/questions/old_persons_shared_ownership_value_check.rb index c869dd3be..601e02ac2 100644 --- a/app/models/form/sales/questions/old_persons_shared_ownership_value_check.rb +++ b/app/models/form/sales/questions/old_persons_shared_ownership_value_check.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::OldPersonsSharedOwnershipValueCheck < ::Form::Ques def initialize(id, hsh, page) super @id = "old_persons_shared_ownership_value_check" - @check_answer_label = "Shared ownership confirmation" - @header = "Are you sure this is correct?" + @copy_key = "sales.soft_validations.old_persons_shared_ownership_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/app/models/form/sales/questions/partner_under_16_value_check.rb b/app/models/form/sales/questions/partner_under_16_value_check.rb index 4c147b7e5..cca2386fd 100644 --- a/app/models/form/sales/questions/partner_under_16_value_check.rb +++ b/app/models/form/sales/questions/partner_under_16_value_check.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::PartnerUnder16ValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "partner_under_16_value_check" - @check_answer_label = "Partner under 16 confirmation" + @copy_key = "sales.soft_validations.partner_under_16_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Sales::Questions::PartnerUnder16ValueCheck < ::Form::Question ], } @check_answers_card_number = person_index - @header = "Are you sure this is correct?" end end diff --git a/app/models/form/sales/questions/person_age.rb b/app/models/form/sales/questions/person_age.rb index 9f3d9378f..1638f6103 100644 --- a/app/models/form/sales/questions/person_age.rb +++ b/app/models/form/sales/questions/person_age.rb @@ -1,9 +1,8 @@ class Form::Sales::Questions::PersonAge < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) - @check_answer_label = "Person #{person_index}’s age" - @header = "Age" @type = "numeric" + @copy_key = person_index == 2 ? "sales.household_characteristics.age2.person.age2" : "sales.household_characteristics.age#{person_index}.age#{person_index}" @width = 3 @inferred_check_answers_value = [{ "condition" => { "age#{person_index}_known" => 1 }, @@ -27,10 +26,4 @@ class Form::Sales::Questions::PersonAge < ::Form::Question base_question_number + (4 * @person_index) end - - def hint_text - if form.start_year_after_2024? - "Answer 1 for children aged under 1 year old" - end - end end diff --git a/app/models/form/sales/questions/person_age_known.rb b/app/models/form/sales/questions/person_age_known.rb index b53724e67..ede210c80 100644 --- a/app/models/form/sales/questions/person_age_known.rb +++ b/app/models/form/sales/questions/person_age_known.rb @@ -1,10 +1,9 @@ class Form::Sales::Questions::PersonAgeKnown < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) - @check_answer_label = "Person #{person_index}’s age known?" - @header = "Do you know person #{person_index}’s age?" @type = "radio" @answer_options = ANSWER_OPTIONS + @copy_key = person_index == 2 ? "sales.household_characteristics.age2.person.age2_known" : "sales.household_characteristics.age#{person_index}.age#{person_index}_known" @conditional_for = { "age#{person_index}" => [0], } diff --git a/app/models/form/sales/questions/person_gender_identity.rb b/app/models/form/sales/questions/person_gender_identity.rb index 8b1a0ff2b..44cf15a85 100644 --- a/app/models/form/sales/questions/person_gender_identity.rb +++ b/app/models/form/sales/questions/person_gender_identity.rb @@ -1,9 +1,8 @@ class Form::Sales::Questions::PersonGenderIdentity < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) - @check_answer_label = "Person #{person_index}’s gender identity" - @header = "Which of these best describes Person #{person_index}’s gender identity?" @type = "radio" + @copy_key = "sales.household_characteristics.sex2.person" if person_index == 2 @answer_options = ANSWER_OPTIONS @check_answers_card_number = person_index @inferred_check_answers_value = [{ @@ -23,12 +22,6 @@ class Form::Sales::Questions::PersonGenderIdentity < ::Form::Question "R" => { "value" => "Person prefers not to say" }, }.freeze - def hint_text - return unless form.start_year_after_2024? - - "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." - end - def question_number base_question_number = case form.start_date.year when 2023 diff --git a/app/models/form/sales/questions/person_known.rb b/app/models/form/sales/questions/person_known.rb index d0de89044..e8a7122f8 100644 --- a/app/models/form/sales/questions/person_known.rb +++ b/app/models/form/sales/questions/person_known.rb @@ -1,8 +1,6 @@ class Form::Sales::Questions::PersonKnown < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) - @check_answer_label = "Details known for person #{person_index}?" - @header = "Do you know the details for person #{person_index}?" @type = "radio" @answer_options = ANSWER_OPTIONS @check_answers_card_number = person_index diff --git a/app/models/form/sales/questions/person_relationship_to_buyer_1.rb b/app/models/form/sales/questions/person_relationship_to_buyer_1.rb index 3fe33cef0..af3f2a78b 100644 --- a/app/models/form/sales/questions/person_relationship_to_buyer_1.rb +++ b/app/models/form/sales/questions/person_relationship_to_buyer_1.rb @@ -1,9 +1,8 @@ class Form::Sales::Questions::PersonRelationshipToBuyer1 < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) - @check_answer_label = "Person #{person_index}’s relationship to Buyer 1" - @header = "What is Person #{person_index}’s relationship to Buyer 1?" @type = "radio" + @copy_key = "sales.household_characteristics.relat2.person" if person_index == 2 @answer_options = answer_options @check_answers_card_number = person_index @inferred_check_answers_value = [{ diff --git a/app/models/form/sales/questions/person_student_not_child_value_check.rb b/app/models/form/sales/questions/person_student_not_child_value_check.rb index fba35d05b..c2ff55688 100644 --- a/app/models/form/sales/questions/person_student_not_child_value_check.rb +++ b/app/models/form/sales/questions/person_student_not_child_value_check.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::PersonStudentNotChildValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "student_not_child_value_check" - @check_answer_label = "Student not a child confirmation" + @copy_key = "sales.soft_validations.student_not_child_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Sales::Questions::PersonStudentNotChildValueCheck < ::Form::Question ], } @check_answers_card_number = person_index - @header = "Are you sure this person is not a child?" end end diff --git a/app/models/form/sales/questions/person_working_situation.rb b/app/models/form/sales/questions/person_working_situation.rb index fd5506170..488a77092 100644 --- a/app/models/form/sales/questions/person_working_situation.rb +++ b/app/models/form/sales/questions/person_working_situation.rb @@ -1,9 +1,8 @@ class Form::Sales::Questions::PersonWorkingSituation < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) - @check_answer_label = "Person #{person_index}’s working situation" - @header = "Which of these best describes Person #{person_index}’s working situation?" @type = "radio" + @copy_key = "sales.household_characteristics.ecstat2.person" if person_index == 2 @check_answers_card_number = person_index @inferred_check_answers_value = [{ "condition" => { diff --git a/app/models/form/sales/questions/privacy_notice.rb b/app/models/form/sales/questions/privacy_notice.rb index a9e737f0e..95921737f 100644 --- a/app/models/form/sales/questions/privacy_notice.rb +++ b/app/models/form/sales/questions/privacy_notice.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question def initialize(id, hsh, page, joint_purchase:) super(id, hsh, page) @id = "privacynotice" - @copy_key = "sales.setup.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" + @copy_key = "sales.#{subsection.id}.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @type = "checkbox" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @joint_purchase = joint_purchase diff --git a/app/models/form/sales/questions/retirement_value_check.rb b/app/models/form/sales/questions/retirement_value_check.rb index 56573490e..6b8b10898 100644 --- a/app/models/form/sales/questions/retirement_value_check.rb +++ b/app/models/form/sales/questions/retirement_value_check.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::RetirementValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "retirement_value_check" - @check_answer_label = "Retirement confirmation" + @copy_key = "sales.soft_validations.retirement_value_check.min" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Sales::Questions::RetirementValueCheck < ::Form::Question ], } @check_answers_card_number = person_index - @header = "Are you sure this person is retired?" end end diff --git a/app/models/validations/sales/sale_information_validations.rb b/app/models/validations/sales/sale_information_validations.rb index c5febb693..700867e66 100644 --- a/app/models/validations/sales/sale_information_validations.rb +++ b/app/models/validations/sales/sale_information_validations.rb @@ -8,13 +8,13 @@ module Validations::Sales::SaleInformationValidations return if record.saledate.blank? if record.hodate > record.saledate - record.errors.add :hodate, I18n.t("validations.sale_information.hodate.must_be_before_saledate") - record.errors.add :saledate, I18n.t("validations.sale_information.saledate.must_be_after_hodate") + record.errors.add :hodate, I18n.t("validations.sales.sale_information.hodate.must_be_before_saledate") + record.errors.add :saledate, I18n.t("validations.sales.sale_information.saledate.must_be_after_hodate") end if record.saledate - record.hodate >= 3.years && record.form.start_year_after_2024? - record.errors.add :hodate, I18n.t("validations.sale_information.hodate.must_be_less_than_3_years_from_saledate") - record.errors.add :saledate, I18n.t("validations.sale_information.saledate.must_be_less_than_3_years_from_hodate") + record.errors.add :hodate, I18n.t("validations.sales.sale_information.hodate.must_be_less_than_3_years_from_saledate") + record.errors.add :saledate, I18n.t("validations.sales.sale_information.saledate.must_be_less_than_3_years_from_hodate") end end @@ -22,13 +22,13 @@ module Validations::Sales::SaleInformationValidations return unless record.exdate && record.saledate if record.exdate > record.saledate - record.errors.add :exdate, I18n.t("validations.sale_information.exdate.must_be_before_saledate") - record.errors.add :saledate, I18n.t("validations.sale_information.saledate.must_be_after_exdate") + record.errors.add :exdate, I18n.t("validations.sales.sale_information.exdate.must_be_before_saledate") + record.errors.add :saledate, I18n.t("validations.sales.sale_information.saledate.must_be_after_exdate") end if record.saledate - record.exdate >= 1.year - record.errors.add :exdate, I18n.t("validations.sale_information.exdate.must_be_less_than_1_year_from_saledate") - record.errors.add :saledate, I18n.t("validations.sale_information.saledate.must_be_less_than_1_year_from_exdate") + record.errors.add :exdate, I18n.t("validations.sales.sale_information.exdate.must_be_less_than_1_year_from_saledate") + record.errors.add :saledate, I18n.t("validations.sales.sale_information.saledate.must_be_less_than_1_year_from_exdate") end end @@ -36,8 +36,8 @@ module Validations::Sales::SaleInformationValidations return unless record.fromprop && record.frombeds if record.frombeds != 1 && record.fromprop == 2 - record.errors.add :frombeds, I18n.t("validations.sale_information.previous_property_type.property_type_bedsit") - record.errors.add :fromprop, I18n.t("validations.sale_information.previous_property_type.property_type_bedsit") + record.errors.add :frombeds, I18n.t("validations.sales.sale_information.frombeds.previous_property_type_bedsit") + record.errors.add :fromprop, I18n.t("validations.sales.sale_information.fromprop.previous_property_type_bedsit") end end @@ -54,7 +54,7 @@ module Validations::Sales::SaleInformationValidations deposit_and_grant_sentence = record.grant.present? ? ", cash deposit (#{record.field_formatted_as_currency('deposit')}), and grant (#{record.field_formatted_as_currency('grant')})" : " and cash deposit (#{record.field_formatted_as_currency('deposit')})" discount_sentence = record.discount.present? ? " (#{record.field_formatted_as_currency('value')}) subtracted by the sum of the full purchase price (#{record.field_formatted_as_currency('value')}) multiplied by the percentage discount (#{record.discount}%)" : "" %i[mortgageused mortgage value deposit ownershipsch discount grant].each do |field| - record.errors.add field, I18n.t("validations.sale_information.discounted_ownership_value", + record.errors.add field, I18n.t("validations.sales.sale_information.#{field}.discounted_ownership_value", mortgage: record.mortgage&.positive? ? " (#{record.field_formatted_as_currency('mortgage')})" : "", deposit_and_grant_sentence:, mortgage_deposit_and_grant_total: record.field_formatted_as_currency("mortgage_deposit_and_grant_total"), @@ -72,13 +72,13 @@ module Validations::Sales::SaleInformationValidations if over_tolerance?(record.mortgage_and_deposit_total, record.value, 1) %i[mortgageused mortgage value deposit].each do |field| - record.errors.add field, I18n.t("validations.sale_information.outright_sale_value", + record.errors.add field, I18n.t("validations.sales.sale_information.#{field}.outright_sale_value", mortgage_and_deposit_total: record.field_formatted_as_currency("mortgage_and_deposit_total"), mortgage: record.mortgage&.positive? ? " (#{record.field_formatted_as_currency('mortgage')})" : "", deposit: record.field_formatted_as_currency("deposit"), value: record.field_formatted_as_currency("value")).html_safe end - record.errors.add :ownershipsch, :skip_bu_error, message: I18n.t("validations.sale_information.outright_sale_value", + record.errors.add :ownershipsch, :skip_bu_error, message: I18n.t("validations.sales.sale_information.ownershipsch.outright_sale_value", mortgage_and_deposit_total: record.field_formatted_as_currency("mortgage_and_deposit_total"), mortgage: record.mortgage&.positive? ? " (#{record.field_formatted_as_currency('mortgage')})" : "", deposit: record.field_formatted_as_currency("deposit"), @@ -90,8 +90,8 @@ module Validations::Sales::SaleInformationValidations return unless record.mrent && record.ownershipsch && record.type if record.shared_ownership_scheme? && !record.old_persons_shared_ownership? && record.mrent > 9999 - record.errors.add :mrent, I18n.t("validations.sale_information.monthly_rent.higher_than_expected") - record.errors.add :type, I18n.t("validations.sale_information.monthly_rent.higher_than_expected") + record.errors.add :mrent, I18n.t("validations.sales.sale_information.mrent.monthly_rent_higher_than_expected") + record.errors.add :type, I18n.t("validations.sales.sale_information.type.monthly_rent_higher_than_expected") end end @@ -100,7 +100,7 @@ module Validations::Sales::SaleInformationValidations return unless record.grant && (record.type == 8 || record.type == 21) unless record.grant.between?(9_000, 16_000) - record.errors.add :grant, I18n.t("validations.sale_information.grant.out_of_range") + record.errors.add :grant, I18n.t("validations.sales.sale_information.grant.out_of_range") end end @@ -118,8 +118,8 @@ module Validations::Sales::SaleInformationValidations end if max_stairbought && record.stairbought > max_stairbought - record.errors.add :stairbought, I18n.t("validations.sale_information.stairbought.over_max", max_stairbought:, type: record.form.get_question("type", record).answer_label(record)) - record.errors.add :type, I18n.t("validations.sale_information.stairbought.over_max", max_stairbought:, type: record.form.get_question("type", record).answer_label(record)) + record.errors.add :stairbought, I18n.t("validations.sales.sale_information.stairbought.stairbought_over_max", max_stairbought:, type: record.form.get_question("type", record).answer_label(record)) + record.errors.add :type, I18n.t("validations.sales.sale_information.type.stairbought_over_max", max_stairbought:, type: record.form.get_question("type", record).answer_label(record)) end end @@ -129,11 +129,11 @@ module Validations::Sales::SaleInformationValidations if record.london_property? && record.discount_value > 136_400 %i[discount value la postcode_full uprn].each do |field| - record.errors.add field, I18n.t("validations.sale_information.value.over_discounted_london_max", discount_value: record.field_formatted_as_currency("discount_value")) + record.errors.add field, I18n.t("validations.sales.sale_information.#{field}.value_over_discounted_london_max", discount_value: record.field_formatted_as_currency("discount_value")) end elsif record.property_not_in_london? && record.discount_value > 102_400 %i[discount value la postcode_full uprn].each do |field| - record.errors.add field, I18n.t("validations.sale_information.value.over_discounted_max", discount_value: record.field_formatted_as_currency("discount_value")) + record.errors.add field, I18n.t("validations.sales.sale_information.#{field}.value_over_discounted_max", discount_value: record.field_formatted_as_currency("discount_value")) end end end @@ -170,7 +170,7 @@ module Validations::Sales::SaleInformationValidations if over_tolerance?(record.mortgage_deposit_and_discount_total, record.expected_shared_ownership_deposit_value, 1) %i[mortgage value deposit cashdis equity].each do |field| - record.errors.add field, I18n.t("validations.sale_information.non_staircasing_mortgage.mortgage_used_socialhomebuy", + record.errors.add field, I18n.t("validations.sales.sale_information.#{field}.non_staircasing_mortgage.mortgage_used_socialhomebuy", mortgage: record.field_formatted_as_currency("mortgage"), value: record.field_formatted_as_currency("value"), deposit: record.field_formatted_as_currency("deposit"), @@ -179,7 +179,7 @@ module Validations::Sales::SaleInformationValidations mortgage_deposit_and_discount_total: record.field_formatted_as_currency("mortgage_deposit_and_discount_total"), expected_shared_ownership_deposit_value: record.field_formatted_as_currency("expected_shared_ownership_deposit_value")).html_safe end - record.errors.add :type, :skip_bu_error, message: I18n.t("validations.sale_information.non_staircasing_mortgage.mortgage_used_socialhomebuy", + record.errors.add :type, :skip_bu_error, message: I18n.t("validations.sales.sale_information.type.non_staircasing_mortgage.mortgage_used_socialhomebuy", mortgage: record.field_formatted_as_currency("mortgage"), value: record.field_formatted_as_currency("value"), deposit: record.field_formatted_as_currency("deposit"), @@ -191,7 +191,7 @@ module Validations::Sales::SaleInformationValidations elsif record.mortgage_not_used? if over_tolerance?(record.deposit_and_discount_total, record.expected_shared_ownership_deposit_value, 1) %i[mortgageused value deposit cashdis equity].each do |field| - record.errors.add field, I18n.t("validations.sale_information.non_staircasing_mortgage.mortgage_not_used_socialhomebuy", + record.errors.add field, I18n.t("validations.sales.sale_information.#{field}.non_staircasing_mortgage.mortgage_not_used_socialhomebuy", deposit_and_discount_total: record.field_formatted_as_currency("deposit_and_discount_total"), expected_shared_ownership_deposit_value: record.field_formatted_as_currency("expected_shared_ownership_deposit_value"), value: record.field_formatted_as_currency("value"), @@ -199,7 +199,7 @@ module Validations::Sales::SaleInformationValidations cashdis: record.field_formatted_as_currency("cashdis"), equity: "#{record.equity}%").html_safe end - record.errors.add :type, :skip_bu_error, message: I18n.t("validations.sale_information.non_staircasing_mortgage.mortgage_not_used_socialhomebuy", + record.errors.add :type, :skip_bu_error, message: I18n.t("validations.sales.sale_information.type.non_staircasing_mortgage.mortgage_not_used_socialhomebuy", deposit_and_discount_total: record.field_formatted_as_currency("deposit_and_discount_total"), expected_shared_ownership_deposit_value: record.field_formatted_as_currency("expected_shared_ownership_deposit_value"), value: record.field_formatted_as_currency("value"), @@ -216,7 +216,7 @@ module Validations::Sales::SaleInformationValidations if over_tolerance?(record.mortgage_and_deposit_total, record.expected_shared_ownership_deposit_value, 1) %i[mortgage value deposit equity].each do |field| - record.errors.add field, I18n.t("validations.sale_information.non_staircasing_mortgage.mortgage_used", + record.errors.add field, I18n.t("validations.sales.sale_information.#{field}.non_staircasing_mortgage.mortgage_used", mortgage: record.field_formatted_as_currency("mortgage"), deposit: record.field_formatted_as_currency("deposit"), value: record.field_formatted_as_currency("value"), @@ -224,7 +224,7 @@ module Validations::Sales::SaleInformationValidations mortgage_and_deposit_total: record.field_formatted_as_currency("mortgage_and_deposit_total"), expected_shared_ownership_deposit_value: record.field_formatted_as_currency("expected_shared_ownership_deposit_value")).html_safe end - record.errors.add :type, :skip_bu_error, message: I18n.t("validations.sale_information.non_staircasing_mortgage.mortgage_used", + record.errors.add :type, :skip_bu_error, message: I18n.t("validations.sales.sale_information.type.non_staircasing_mortgage.mortgage_used", mortgage: record.field_formatted_as_currency("mortgage"), deposit: record.field_formatted_as_currency("deposit"), value: record.field_formatted_as_currency("value"), @@ -235,12 +235,12 @@ module Validations::Sales::SaleInformationValidations elsif record.mortgage_not_used? if over_tolerance?(record.deposit, record.expected_shared_ownership_deposit_value, 1) %i[mortgageused value deposit equity].each do |field| - record.errors.add field, I18n.t("validations.sale_information.non_staircasing_mortgage.mortgage_not_used", + record.errors.add field, I18n.t("validations.sales.sale_information.#{field}.non_staircasing_mortgage.mortgage_not_used", deposit: record.field_formatted_as_currency("deposit"), value: record.field_formatted_as_currency("value"), expected_shared_ownership_deposit_value: record.field_formatted_as_currency("expected_shared_ownership_deposit_value")).html_safe end - record.errors.add :type, :skip_bu_error, message: I18n.t("validations.sale_information.non_staircasing_mortgage.mortgage_not_used", + record.errors.add :type, :skip_bu_error, message: I18n.t("validations.sales.sale_information.type.non_staircasing_mortgage.mortgage_not_used", deposit: record.field_formatted_as_currency("deposit"), value: record.field_formatted_as_currency("value"), expected_shared_ownership_deposit_value: record.field_formatted_as_currency("expected_shared_ownership_deposit_value")).html_safe @@ -256,7 +256,7 @@ module Validations::Sales::SaleInformationValidations if over_tolerance?(record.mortgage_deposit_and_discount_total, record.stairbought_part_of_value, 1) %i[mortgage value deposit cashdis stairbought].each do |field| - record.errors.add field, I18n.t("validations.sale_information.staircasing_mortgage.mortgage_used_socialhomebuy", + record.errors.add field, I18n.t("validations.sales.sale_information.#{field}.staircasing_mortgage.mortgage_used_socialhomebuy", mortgage_deposit_and_discount_total: record.field_formatted_as_currency("mortgage_deposit_and_discount_total"), stairbought_part_of_value: record.field_formatted_as_currency("stairbought_part_of_value"), mortgage: record.field_formatted_as_currency("mortgage"), @@ -265,7 +265,7 @@ module Validations::Sales::SaleInformationValidations cashdis: record.field_formatted_as_currency("cashdis"), stairbought: "#{record.stairbought}%").html_safe end - record.errors.add :type, :skip_bu_error, message: I18n.t("validations.sale_information.staircasing_mortgage.mortgage_used_socialhomebuy", + record.errors.add :type, :skip_bu_error, message: I18n.t("validations.sales.sale_information.type.staircasing_mortgage.mortgage_used_socialhomebuy", mortgage_deposit_and_discount_total: record.field_formatted_as_currency("mortgage_deposit_and_discount_total"), stairbought_part_of_value: record.field_formatted_as_currency("stairbought_part_of_value"), mortgage: record.field_formatted_as_currency("mortgage"), @@ -276,7 +276,7 @@ module Validations::Sales::SaleInformationValidations end elsif over_tolerance?(record.deposit_and_discount_total, record.stairbought_part_of_value, 1) %i[mortgageused value deposit cashdis stairbought].each do |field| - record.errors.add field, I18n.t("validations.sale_information.staircasing_mortgage.mortgage_not_used_socialhomebuy", + record.errors.add field, I18n.t("validations.sales.sale_information.#{field}.staircasing_mortgage.mortgage_not_used_socialhomebuy", deposit_and_discount_total: record.field_formatted_as_currency("deposit_and_discount_total"), stairbought_part_of_value: record.field_formatted_as_currency("stairbought_part_of_value"), value: record.field_formatted_as_currency("value"), @@ -284,7 +284,7 @@ module Validations::Sales::SaleInformationValidations cashdis: record.field_formatted_as_currency("cashdis"), stairbought: "#{record.stairbought}%").html_safe end - record.errors.add :type, :skip_bu_error, message: I18n.t("validations.sale_information.staircasing_mortgage.mortgage_not_used_socialhomebuy", + record.errors.add :type, :skip_bu_error, message: I18n.t("validations.sales.sale_information.type.staircasing_mortgage.mortgage_not_used_socialhomebuy", deposit_and_discount_total: record.field_formatted_as_currency("deposit_and_discount_total"), stairbought_part_of_value: record.field_formatted_as_currency("stairbought_part_of_value"), value: record.field_formatted_as_currency("value"), @@ -300,14 +300,14 @@ module Validations::Sales::SaleInformationValidations if over_tolerance?(record.mortgage_and_deposit_total, record.stairbought_part_of_value, 1) %i[mortgage value deposit stairbought].each do |field| - record.errors.add field, I18n.t("validations.sale_information.staircasing_mortgage.mortgage_used", + record.errors.add field, I18n.t("validations.sales.sale_information.#{field}.staircasing_mortgage.mortgage_used", mortgage: record.field_formatted_as_currency("mortgage"), deposit: record.field_formatted_as_currency("deposit"), mortgage_and_deposit_total: record.field_formatted_as_currency("mortgage_and_deposit_total"), value: record.field_formatted_as_currency("value"), stairbought_part_of_value: record.field_formatted_as_currency("stairbought_part_of_value")).html_safe end - record.errors.add :type, :skip_bu_error, message: I18n.t("validations.sale_information.staircasing_mortgage.mortgage_used", + record.errors.add :type, :skip_bu_error, message: I18n.t("validations.sales.sale_information.type.staircasing_mortgage.mortgage_used", mortgage: record.field_formatted_as_currency("mortgage"), deposit: record.field_formatted_as_currency("deposit"), mortgage_and_deposit_total: record.field_formatted_as_currency("mortgage_and_deposit_total"), @@ -316,12 +316,12 @@ module Validations::Sales::SaleInformationValidations end elsif over_tolerance?(record.deposit, record.stairbought_part_of_value, 1) %i[mortgageused value deposit stairbought].each do |field| - record.errors.add field, I18n.t("validations.sale_information.staircasing_mortgage.mortgage_not_used", + record.errors.add field, I18n.t("validations.sales.sale_information.#{field}.staircasing_mortgage.mortgage_not_used", deposit: record.field_formatted_as_currency("deposit"), value: record.field_formatted_as_currency("value"), stairbought_part_of_value: record.field_formatted_as_currency("stairbought_part_of_value")).html_safe end - record.errors.add :type, :skip_bu_error, message: I18n.t("validations.sale_information.staircasing_mortgage.mortgage_not_used", + record.errors.add :type, :skip_bu_error, message: I18n.t("validations.sales.sale_information.type.staircasing_mortgage.mortgage_not_used", deposit: record.field_formatted_as_currency("deposit"), value: record.field_formatted_as_currency("value"), stairbought_part_of_value: record.field_formatted_as_currency("stairbought_part_of_value")).html_safe @@ -336,15 +336,15 @@ module Validations::Sales::SaleInformationValidations end if record.outright_sale? && record.saledate && !record.form.start_year_after_2024? record.errors.add :mortgageused, I18n.t("validations.invalid_option", question: "was a mortgage used for the purchase of this property?") - record.errors.add :saledate, I18n.t("validations.financial.mortgage_used.year") + record.errors.add :saledate, I18n.t("validations.sales.sale_information.saledate.mortgage_used_year") end if record.shared_ownership_scheme? && record.is_not_staircasing? record.errors.add :mortgageused, I18n.t("validations.invalid_option", question: "was a mortgage used for the purchase of this property?") - record.errors.add :staircase, I18n.t("validations.financial.mortgage_used.staircasing") + record.errors.add :staircase, I18n.t("validations.sales.sale_information.staircase.mortgage_used_value") end if record.stairowned && !record.stairowned_100? - record.errors.add :stairowned, I18n.t("validations.sale_information.stairowned.mortgageused_dont_know") - record.errors.add :mortgageused, I18n.t("validations.sale_information.stairowned.mortgageused_dont_know") + record.errors.add :stairowned, I18n.t("validations.sales.sale_information.stairowned.mortgageused_dont_know") + record.errors.add :mortgageused, I18n.t("validations.sales.sale_information.mortgageused.mortgageused_dont_know") end end diff --git a/config/locales/en.yml b/config/locales/en.yml index afa157034..7ed8f42e8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -476,9 +476,6 @@ en: over_max: "The maximum initial equity stake is %{max_equity}%." over_stairowned_minus_stairbought: "The initial equity stake is %{equity}% and the percentage owned in total minus the percentage bought is %{staircase_difference}%. In a staircasing transaction, the equity stake purchased cannot be larger than the percentage the %{buyer_owns} minus the percentage bought." mortgage: "Mortgage value cannot be £0 if a mortgage was used for the purchase of this property." - mortgage_used: - year: "You must answer either ‘yes’ or ‘no’ to the question ‘was a mortgage used’ for the selected year." - staircasing: "You must answer either ‘yes’ or ‘no’ to the question ‘was a mortgage used’ for staircasing transactions." shared_ownership_deposit: "The %{mortgage_deposit_and_discount_error_fields} added together is %{mortgage_deposit_and_discount_total}. The value times the equity percentage is %{value_times_equity}. These figures should be the same." household: @@ -637,46 +634,6 @@ en: before_deactivation: "This location was deactivated on %{date}. The reactivation date must be on or after deactivation date." deactivation: during_deactivated_period: "The location is already deactivated during this date, please enter a different date." - sale_information: - proplen: - social_homebuy: "Social HomeBuy buyers should not have lived here before." - rent_to_buy: "Rent to Buy buyers should not have lived here before." - hodate: - must_be_before_saledate: "Practical completion or handover date must be before sale completion date." - must_be_less_than_3_years_from_saledate: "Practical completion or handover date must be less than 3 years before sale completion date." - exdate: - must_be_before_saledate: "Contract exchange date must be before sale completion date." - must_be_less_than_1_year_from_saledate: "Contract exchange date must be less than 1 year before sale completion date." - saledate: - must_be_after_exdate: "Sale completion date must be after contract exchange date." - must_be_less_than_1_year_from_exdate: "Sale completion date must be less than 1 year after contract exchange date." - must_be_less_than_3_years_from_hodate: "Sale completion date must be less than 3 years after practical completion or handover date." - must_be_after_hodate: "Sale completion date must be after practical completion or handover date." - previous_property_type: - property_type_bedsit: "A bedsit cannot have more than 1 bedroom." - discounted_ownership_value: "The mortgage%{mortgage}%{deposit_and_grant_sentence} added together is %{mortgage_deposit_and_grant_total}.

The full purchase price%{discount_sentence} is %{value_with_discount}.

These two amounts should be the same." - outright_sale_value: "The mortgage%{mortgage} and cash deposit (%{deposit}) when added together is %{mortgage_and_deposit_total}.

The full purchase price is %{value}.

These two amounts should be the same." - monthly_rent: - higher_than_expected: "Basic monthly rent must be between £0.00 and £9,999.00." - grant: - out_of_range: "Loan, grants or subsidies must be between £9,000 and £16,000." - stairbought: - over_max: "The percentage bought in this staircasing transaction cannot be higher than %{max_stairbought}% for %{type} sales." - value: - over_discounted_london_max: "The percentage discount multiplied by the purchase price is %{discount_value}. This figure should not be more than £136,400 for properties in London." - over_discounted_max: "The percentage discount multiplied by the purchase price is %{discount_value}. This figure should not be more than £102,400 for properties outside of London." - non_staircasing_mortgage: - mortgage_used: "The mortgage (%{mortgage}) and cash deposit (%{deposit}) added together is %{mortgage_and_deposit_total}.

The full purchase price (%{value}) multiplied by the percentage equity stake purchased (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." - mortgage_not_used: "The cash deposit is %{deposit}.

The full purchase price (%{value}) multiplied by the percentage bought is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." - mortgage_used_socialhomebuy: "The mortgage amount (%{mortgage}), cash deposit (%{deposit}), and cash discount (%{cashdis}) added together is %{mortgage_deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage equity stake purchased (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." - mortgage_not_used_socialhomebuy: "The cash deposit (%{deposit}) and cash discount (%{cashdis}) added together is %{deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." - staircasing_mortgage: - mortgage_used: "The mortgage (%{mortgage}) and cash deposit (%{deposit}) added together is %{mortgage_and_deposit_total}.

The full purchase price (%{value}) multiplied by the percentage bought is %{stairbought_part_of_value}.

These two amounts should be the same." - mortgage_not_used: "The cash deposit is %{deposit}.

The full purchase price (%{value}) multiplied by the percentage bought is %{stairbought_part_of_value}.

These two amounts should be the same." - mortgage_used_socialhomebuy: "The mortgage amount (%{mortgage}), cash deposit (%{deposit}), and cash discount (%{cashdis}) added together is %{mortgage_deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{stairbought}) is %{stairbought_part_of_value}.

These two amounts should be the same." - mortgage_not_used_socialhomebuy: "The cash deposit (%{deposit}) and cash discount (%{cashdis}) added together is %{deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{stairbought}) is %{stairbought_part_of_value}.

These two amounts should be the same." - stairowned: - mortgageused_dont_know: "The percentage owned has to be 100% if the mortgage used is 'Don’t know'" merge_request: organisation_part_of_another_merge: "This organisation is part of another merge - select a different one." organisation_not_selected: "Select an organisation from the search list." @@ -724,30 +681,17 @@ Make sure these answers are correct." hint_text: "This is higher than we would expect." shared_ownership_deposit: title_text: "You told us that the %{mortgage_deposit_and_discount_error_fields} add up to %{mortgage_deposit_and_discount_total}." - old_persons_shared_ownership: - title_text: - one: "You told us the buyer is using the Older Persons Shared Ownership scheme." - two: "You told us the buyers are using the Older Persons Shared Ownership scheme." - hint_text: "At least one buyer must be aged 65 years and over to use this scheme." 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." - student_not_child: - title_text: "You told us this person is a student aged between 16 and 19." 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." - buyer1_livein_wrong_for_ownership_type: - title_text: "You told us that buyer 1 will not live in the property." - hint_text: " For %{ownership_scheme} types, the buyer usually lives in the property." - buyer2_livein_wrong_for_ownership_type: - title_text: "You told us that buyer 2 will not live in the property." - hint_text: " For %{ownership_scheme} types, the buyer usually lives in the property." percentage_discount_value: title_text: "You told us that the percentage discount is %{discount}." hint_text: "This is higher than we would expect." @@ -783,12 +727,8 @@ Make sure these answers are correct." 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." - partner_under_16_sales: - title: "You told us this person is aged %{age} years and has 'Partner' relationship to buyer 1." multiple_partners_lettings: title: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant." - multiple_partners_sales: - title: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1." devise: two_factor_authentication: diff --git a/config/locales/forms/2023/lettings/household_needs.en.yml b/config/locales/forms/2023/lettings/household_needs.en.yml new file mode 100644 index 000000000..1e1a2823e --- /dev/null +++ b/config/locales/forms/2023/lettings/household_needs.en.yml @@ -0,0 +1,58 @@ +en: + forms: + 2023: + lettings: + household_needs: + armedforces: + page_header: "" + check_answer_label: "Household links to UK armed forces" + hint_text: "This excludes national service.

If there are several people in the household with links to the UK armed forces, you should answer for the regular. If there’s no regular, answer for the reserve. If there’s no reserve, answer for the spouse or civil partner." + question_text: "Does anybody in the household have any links to the UK armed forces?" + + leftreg: + page_header: "" + check_answer_label: "Person still serving in UK armed forces" + hint_text: "" + question_text: "Is the person still serving in the UK armed forces?" + + reservist: + page_header: "" + check_answer_label: "Person seriously injured or ill as result of serving in UK armed forces" + hint_text: "" + question_text: "Was the person seriously injured or ill as a result of serving in the UK armed forces?" + + preg_occ: + page_header: "" + check_answer_label: "Anybody in household pregnant" + hint_text: "" + question_text: "Is anybody in the household pregnant?" + + housingneeds: + page_header: "" + check_answer_label: "Anybody with disabled access needs" + hint_text: "" + question_text: "Does anybody in the household have any disabled access needs?" + + housingneeds_type: + page_header: "Disabled access needs" + housingneeds_type: + check_answer_label: "Disabled access needs" + hint_text: "" + question_text: "What type of access needs do they have?" + housingneeds_other: + check_answer_label: "Other disabled access needs" + hint_text: "" + question_text: "Do they have any other disabled access needs?" + + illness: + page_header: "" + check_answer_label: "Anybody in household with physical or mental health condition" + hint_text: "" + question_text: "Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?" + + condition_effects: + page_header: "" + check_answer_label: "How is person affected by condition or illness" + hint_text: "Select all that apply." + question_text: "How is the person affected by their condition or illness?" + \ No newline at end of file diff --git a/config/locales/forms/2023/lettings/setup.en.yml b/config/locales/forms/2023/lettings/setup.en.yml new file mode 100644 index 000000000..5df98796a --- /dev/null +++ b/config/locales/forms/2023/lettings/setup.en.yml @@ -0,0 +1,81 @@ +en: + forms: + 2023: + lettings: + setup: + owning_organisation_id: + page_header: "" + check_answer_label: "Stock owner" + hint_text: "" + question_text: "Which organisation owns this property?" + + managing_organisation_id: + page_header: "" + check_answer_label: "Managing agent" + hint_text: "" + question_text: "Which organisation manages this letting?" + + assigned_to_id: + page_header: "" + check_answer_label: "Log owner" + hint_text: "" + question_text: "Which user are you creating this log for?" + + needstype: + page_header: "" + check_answer_label: "Needs type" + hint_text: "General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing can include direct access hostels, group homes, residential care and nursing homes." + question_text: "What is the needs type?" + + scheme_id: + page_header: "Scheme" + check_answer_label: "Scheme name" + hint_text: "Enter postcode or scheme name" + question_text: "What scheme is this log for?" + + location_id: + less_than_twenty: + page_header: "Location" + check_answer_label: "Location" + hint_text: "" + question_text: "Which location is this letting for?" + twenty_or_more: + page_header: "Location" + check_answer_label: "Location" + hint_text: '
This scheme has 20 or more locations.
Enter postcode or address.' + question_text: "Which location is this letting for?" + + renewal: + page_header: "" + check_answer_label: "Property renewal" + hint_text: "A renewal is a letting to the same tenant in the same property. If the property was previously being used as temporary accommodation, then answer 'no'." + question_text: "Is this letting a renewal?" + + startdate: + page_header: "" + check_answer_label: "Tenancy start date" + hint_text: "" + question_text: "What is the tenancy start date?" + + rent_type: + page_header: "Rent Type" + rent_type: + check_answer_label: "Rent type" + hint_text: "" + question_text: "What is the rent type?" + irproduct_other: + check_answer_label: "Product name" + hint_text: "" + question_text: "Name of rent product" + + tenancycode: + page_header: "" + check_answer_label: "Tenant code" + hint_text: "This is how you usually refer to this tenancy on your own systems." + question_text: "What is the tenant code?" + + propcode: + page_header: "" + check_answer_label: "Property reference" + hint_text: "This is how you usually refer to this property on your own systems." + question_text: "What is the property reference?" diff --git a/config/locales/forms/2023/sales/household_characteristics.en.yml b/config/locales/forms/2023/sales/household_characteristics.en.yml new file mode 100644 index 000000000..a49a817dc --- /dev/null +++ b/config/locales/forms/2023/sales/household_characteristics.en.yml @@ -0,0 +1,357 @@ +en: + forms: + 2023: + sales: + household_characteristics: + noint: + joint_purchase: + page_header: "" + check_answer_label: "Buyers interviewed in person?" + hint_text: "You should still try to answer all questions even if the buyers weren’t interviewed in person" + question_text: "Were the buyers interviewed for any of the answers you will provide on this log?" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer interviewed in person?" + hint_text: "You should still try to answer all questions even if the buyer wasn’t interviewed in person" + question_text: "Was the buyer interviewed for any of the answers you will provide on this log?" + + privacynotice: + joint_purchase: + page_header: "" + check_answer_label: "Buyers have seen the privacy notice?" + hint_text: "" + question_text: "Declaration" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer has seen the privacy notice?" + hint_text: "" + question_text: "Declaration" + + age1: + page_header: "" + age1_known: + check_answer_label: "Buyer 1’s age" + hint_text: "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." + question_text: "Do you know buyer 1’s age?" + age1: + check_answer_label: "Buyer 1’s age" + hint_text: "" + question_text: "Age" + + sex1: + page_header: "" + check_answer_label: "Buyer 1’s gender identity" + hint_text: "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." + question_text: "Which of these best describes buyer 1’s gender identity?" + + ethnic_group: + page_header: "" + check_answer_label: "Buyer 1’s ethnic group" + hint_text: "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." + question_text: "What is buyer 1’s ethnic group?" + + ethnic: + ethnic_background_black: + page_header: "" + check_answer_label: "Buyer 1’s ethnic background" + hint_text: "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." + question_text: "Which of the following best describes buyer 1’s Black, African, Caribbean or Black British background?" + ethnic_background_asian: + page_header: "" + check_answer_label: "Buyer 1’s ethnic background" + hint_text: "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." + question_text: "Which of the following best describes buyer 1’s Asian or Asian British background?" + ethnic_background_arab: + page_header: "" + check_answer_label: "Buyer 1’s ethnic background" + hint_text: "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." + question_text: "Which of the following best describes buyer 1’s Arab background?" + ethnic_background_mixed: + page_header: "" + check_answer_label: "Buyer 1’s ethnic background" + hint_text: "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." + question_text: "Which of the following best describes buyer 1’s Mixed or Multiple ethnic groups background?" + ethnic_background_white: + page_header: "" + check_answer_label: "Buyer 1’s ethnic background" + hint_text: "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." + question_text: "Which of the following best describes buyer 1’s White background?" + + national: + page_header: "" + check_answer_label: "Buyer 1’s nationality" + hint_text: "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." + question_text: "What is buyer 1’s nationality?" + + ecstat1: + page_header: "" + check_answer_label: "Buyer 1's working situation" + hint_text: "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." + question_text: "Which of these best describes buyer 1's working situation?" + + buy1livein: + page_header: "" + check_answer_label: "Will buyer 1 live in the property?" + hint_text: "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." + question_text: "Will buyer 1 live in the property?" + + relat2: + buyer: + page_header: "" + check_answer_label: "Buyer 2's relationship to buyer 1" + hint_text: "" + question_text: "What is buyer 2's relationship to buyer 1?" + person: + page_header: "" + check_answer_label: "Person 2’s relationship to Buyer 1" + hint_text: "" + question_text: "What is Person 2’s relationship to Buyer 1?" + + age2: + buyer: + page_header: "" + age2_known: + check_answer_label: "Buyer 2’s age" + hint_text: "" + question_text: "Do you know buyer 2’s age?" + age2: + check_answer_label: "Buyer 2’s age" + hint_text: "" + question_text: "Age" + person: + page_header: "" + age2_known: + check_answer_label: "Person 2’s age known?" + hint_text: "" + question_text: "Do you know person 2’s age?" + age: + check_answer_label: "Person 2’s age" + hint_text: "" + question_text: "Age" + + sex2: + buyer: + page_header: "" + check_answer_label: "Buyer 2’s gender identity" + hint_text: "" + question_text: "Which of these best describes buyer 2’s gender identity?" + person: + page_header: "" + check_answer_label: "Person 2’s gender identity" + hint_text: "" + question_text: "Which of these best describes Person 2’s gender identity?" + + ethnic_group2: + page_header: "" + check_answer_label: "Buyer 2’s ethnic group" + hint_text: "" + question_text: "What is buyer 2’s ethnic group?" + + ethnicbuy2: + ethnic_background_black: + page_header: "" + check_answer_label: "Buyer 2’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 2’s Black, African, Caribbean or Black British background?" + ethnic_background_asian: + page_header: "" + check_answer_label: "Buyer 2’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 2’s Asian or Asian British background?" + ethnic_background_arab: + page_header: "" + check_answer_label: "Buyer 2’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 2’s Arab background?" + ethnic_background_mixed: + page_header: "" + check_answer_label: "Buyer 2’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 2’s Mixed or Multiple ethnic groups background?" + ethnic_background_white: + page_header: "" + check_answer_label: "Buyer 2’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 2’s White background?" + + nationalbuy2: + page_header: "" + check_answer_label: "Buyer 2’s nationality" + hint_text: "" + question_text: "What is buyer 2’s nationality?" + + ecstat2: + buyer: + page_header: "" + check_answer_label: "Buyer 2's working situation" + hint_text: "" + question_text: "Which of these best describes buyer 2's working situation?" + person: + page_header: "" + check_answer_label: "Person 2’s working situation" + hint_text: "" + question_text: "Which of these best describes Person 2’s working situation?" + + buy2livein: + page_header: "" + check_answer_label: "Will buyer 2 live in the property?" + hint_text: "" + question_text: "Will buyer 2 live in the property?" + + hholdcount: + joint_purchase: + page_header: "" + check_answer_label: "Number of other people living in the property" + hint_text: "You can provide details for a maximum of 4 other people for a joint purchase." + question_text: "Besides the buyers, how many other people live or will live in the property?" + not_joint_purchase: + page_header: "" + check_answer_label: "Number of other people living in the property" + hint_text: "You can provide details for a maximum of 5 other people if there is only one buyer." + question_text: "Besides the buyer, how many other people live or will live in the property?" + + details_known_2: + page_header: "" + check_answer_label: "Details known for person 2?" + hint_text: "" + question_text: "Do you know the details for person 2?" + + details_known_3: + page_header: "" + check_answer_label: "Details known for person 3?" + hint_text: "" + question_text: "Do you know the details for person 3?" + + relat3: + page_header: "" + check_answer_label: "Person 3’s relationship to Buyer 1" + hint_text: "" + question_text: "What is Person 3’s relationship to Buyer 1?" + + age3: + page_header: "" + age3_known: + check_answer_label: "Person 3’s age known?" + hint_text: "" + question_text: "Do you know person 3’s age?" + age3: + check_answer_label: "Person 3’s age" + hint_text: "" + question_text: "Age" + + sex3: + page_header: "" + check_answer_label: "Person 3’s gender identity" + hint_text: "" + question_text: "Which of these best describes Person 3’s gender identity?" + + ecstat3: + page_header: "" + check_answer_label: "Person 3’s working situation" + hint_text: "" + question_text: "Which of these best describes Person 3’s working situation?" + + details_known_4: + page_header: "" + check_answer_label: "Details known for person 4?" + hint_text: "" + question_text: "Do you know the details for person 4?" + + relat4: + page_header: "" + check_answer_label: "Person 4’s relationship to Buyer 1" + hint_text: "" + question_text: "What is Person 4’s relationship to Buyer 1?" + + age4: + page_header: "" + age4_known: + check_answer_label: "Person 4’s age known?" + hint_text: "" + question_text: "Do you know person 4’s age?" + age4: + check_answer_label: "Person 4’s age" + hint_text: "" + question_text: "Age" + + sex4: + page_header: "" + check_answer_label: "Person 4’s gender identity" + hint_text: "" + question_text: "Which of these best describes Person 4’s gender identity?" + + ecstat4: + page_header: "" + check_answer_label: "Person 4’s working situation" + hint_text: "" + question_text: "Which of these best describes Person 4’s working situation?" + + details_known_5: + page_header: "" + check_answer_label: "Details known for person 5?" + hint_text: "" + question_text: "Do you know the details for person 5?" + + relat5: + page_header: "" + check_answer_label: "Person 5’s relationship to Buyer 1" + hint_text: "" + question_text: "What is Person 5’s relationship to Buyer 1?" + + age5: + page_header: "" + age5_known: + check_answer_label: "Person 5’s age known?" + hint_text: "" + question_text: "Do you know person 5’s age?" + age5: + check_answer_label: "Person 5’s age" + hint_text: "" + question_text: "Age" + + sex5: + page_header: "" + check_answer_label: "Person 5’s gender identity" + hint_text: "" + question_text: "Which of these best describes Person 5’s gender identity?" + + ecstat5: + page_header: "" + check_answer_label: "Person 5’s working situation" + hint_text: "" + question_text: "Which of these best describes Person 5’s working situation?" + + details_known_6: + page_header: "" + check_answer_label: "Details known for person 6?" + hint_text: "" + question_text: "Do you know the details for person 6?" + + relat6: + page_header: "" + check_answer_label: "Person 6’s relationship to Buyer 1" + hint_text: "" + question_text: "What is Person 6’s relationship to Buyer 1?" + + age6: + page_header: "" + age6_known: + check_answer_label: "Person 6’s age known?" + hint_text: "" + question_text: "Do you know person 6’s age?" + age6: + check_answer_label: "Person 6’s age" + hint_text: "" + question_text: "Age" + + sex6: + page_header: "" + check_answer_label: "Person 6’s gender identity" + hint_text: "" + question_text: "Which of these best describes Person 6’s gender identity?" + + ecstat6: + page_header: "" + check_answer_label: "Person 6’s working situation" + hint_text: "" + question_text: "Which of these best describes Person 6’s working situation?" diff --git a/config/locales/forms/2023/sales/soft_validations.en.yml b/config/locales/forms/2023/sales/soft_validations.en.yml index a0912555a..3467b9432 100644 --- a/config/locales/forms/2023/sales/soft_validations.en.yml +++ b/config/locales/forms/2023/sales/soft_validations.en.yml @@ -3,25 +3,51 @@ en: 2023: sales: soft_validations: - income1_value_check: + retirement_value_check: + max: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + question_text: "Are you sure this person isn't retired?" + title_text: "You told us this person is over 66 and not retired." + informative_text: "The minimum expected retirement age in England is 66." + min: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + 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" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: + 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: "" question_text: "Are you sure this is correct?" min: + page_header: "" title_text: "You told us income was %{income}." informative_text: "This is less than we would expect for someone in this working situation." 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: - page_header: "" check_answer_label: "Buyer 2 income confirmation" hint_text: "" question_text: "Are you sure this is correct?" min: + page_header: "" title_text: "You told us income was %{income}." informative_text: "This is less than we would expect for someone in this working situation." 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: "" @@ -64,3 +90,39 @@ en: 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: "" + check_answer_label: "Buyer live in confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that buyer 1 will not live in the property." + informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property." + buyer2: + page_header: "" + check_answer_label: "Buyer live in confirmation" + hint_text: "" + 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" + hint_text: "" + 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" + hint_text: "" + 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" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1." + informative_text: "Are you sure this is correct?" diff --git a/config/locales/forms/2024/lettings/household_needs.en.yml b/config/locales/forms/2024/lettings/household_needs.en.yml new file mode 100644 index 000000000..d934be355 --- /dev/null +++ b/config/locales/forms/2024/lettings/household_needs.en.yml @@ -0,0 +1,58 @@ +en: + forms: + 2024: + lettings: + household_needs: + armedforces: + page_header: "" + check_answer_label: "Household links to UK armed forces" + hint_text: "This excludes national service.

If there are several people in the household with links to the UK armed forces, you should answer for the regular. If there’s no regular, answer for the reserve. If there’s no reserve, answer for the spouse or civil partner." + question_text: "Does anybody in the household have any links to the UK armed forces?" + + leftreg: + page_header: "" + check_answer_label: "Person still serving in UK armed forces" + hint_text: "" + question_text: "Is the person still serving in the UK armed forces?" + + reservist: + page_header: "" + check_answer_label: "Person seriously injured or ill as result of serving in UK armed forces" + hint_text: "" + question_text: "Was the person seriously injured or ill as a result of serving in the UK armed forces?" + + preg_occ: + page_header: "" + check_answer_label: "Anybody in household pregnant" + hint_text: "" + question_text: "Is anybody in the household pregnant?" + + housingneeds: + page_header: "" + check_answer_label: "Anybody with disabled access needs" + hint_text: "" + question_text: "Does anybody in the household have any disabled access needs?" + + housingneeds_type: + page_header: "Disabled access needs" + housingneeds_type: + check_answer_label: "Disabled access needs" + hint_text: "" + question_text: "What type of access needs do they have?" + housingneeds_other: + check_answer_label: "Other disabled access needs" + hint_text: "" + question_text: "Do they have any other disabled access needs?" + + illness: + page_header: "" + check_answer_label: "Anybody in household with physical or mental health condition" + hint_text: "" + question_text: "Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?" + + condition_effects: + page_header: "" + check_answer_label: "How is person affected by condition or illness" + hint_text: "Select all that apply." + question_text: "How is the person affected by their condition or illness?" + \ No newline at end of file diff --git a/config/locales/forms/2024/lettings/setup.en.yml b/config/locales/forms/2024/lettings/setup.en.yml new file mode 100644 index 000000000..5a18fe719 --- /dev/null +++ b/config/locales/forms/2024/lettings/setup.en.yml @@ -0,0 +1,87 @@ +en: + forms: + 2024: + lettings: + setup: + owning_organisation_id: + page_header: "" + check_answer_label: "Stock owner" + hint_text: "" + question_text: "Which organisation owns this property?" + + managing_organisation_id: + page_header: "" + check_answer_label: "Managing agent" + hint_text: "" + question_text: "Which organisation manages this letting?" + + assigned_to_id: + page_header: "" + check_answer_label: "Log owner" + hint_text: "" + question_text: "Which user are you creating this log for?" + + needstype: + page_header: "" + check_answer_label: "Needs type" + hint_text: "General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing can include direct access hostels, group homes, residential care and nursing homes." + question_text: "What is the needs type?" + + scheme_id: + page_header: "Scheme" + check_answer_label: "Scheme name" + hint_text: "Enter postcode or scheme name.

A supported housing scheme provides shared or self-contained housing for a particular client group, for example younger or vulnerable people." + question_text: "What scheme is this log for?" + + location_id: + less_than_twenty: + page_header: "Location" + check_answer_label: "Location" + hint_text: "" + question_text: "Which location is this letting for?" + twenty_or_more: + page_header: "Location" + check_answer_label: "Location" + hint_text: '
This scheme has 20 or more locations.
Enter postcode or address.' + question_text: "Which location is this letting for?" + + renewal: + page_header: "" + check_answer_label: "Property renewal" + hint_text: "If the property was previously being used as temporary accommodation, then answer 'no'." + question_text: "Is this letting a renewal of social housing to the same tenant in the same property?" + + startdate: + page_header: "" + check_answer_label: "Tenancy start date" + hint_text: "" + question_text: "What is the tenancy start date?" + + rent_type: + page_header: "Rent Type" + rent_type: + check_answer_label: "Rent type" + hint_text: "" + question_text: "What is the rent type?" + irproduct_other: + check_answer_label: "Product name" + hint_text: "" + question_text: "Name of rent product" + + tenancycode: + page_header: "" + check_answer_label: "Tenant code" + hint_text: "This is how you usually refer to this tenancy on your own systems." + question_text: "What is the tenant code?" + + propcode: + page_header: "" + check_answer_label: "Property reference" + hint_text: "This is how you usually refer to this property on your own systems." + question_text: "What is the property reference?" + + declaration: + page_header: "Ministry of Housing, Communities and Local Government privacy notice" + check_answer_label: "Tenant has seen the privacy notice" + hint_text: "" + question_text: "Declaration" diff --git a/config/locales/forms/2024/sales/household_characteristics.en.yml b/config/locales/forms/2024/sales/household_characteristics.en.yml new file mode 100644 index 000000000..22f9427e8 --- /dev/null +++ b/config/locales/forms/2024/sales/household_characteristics.en.yml @@ -0,0 +1,345 @@ +en: + forms: + 2024: + sales: + household_characteristics: + age1: + page_header: "" + age1_known: + check_answer_label: "Buyer 1’s age" + hint_text: "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." + question_text: "Do you know buyer 1’s age?" + age1: + check_answer_label: "Buyer 1’s age" + hint_text: "" + question_text: "Age" + + sex1: + page_header: "" + check_answer_label: "Buyer 1’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes buyer 1’s gender identity?" + + ethnic_group: + page_header: "" + check_answer_label: "Buyer 1’s ethnic group" + hint_text: "" + question_text: "What is buyer 1’s ethnic group?" + + ethnic: + ethnic_background_black: + page_header: "" + check_answer_label: "Buyer 1’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 1’s Black, African, Caribbean or Black British background?" + ethnic_background_asian: + page_header: "" + check_answer_label: "Buyer 1’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 1’s Asian or Asian British background?" + ethnic_background_arab: + page_header: "" + check_answer_label: "Buyer 1’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 1’s Arab background?" + ethnic_background_mixed: + page_header: "" + check_answer_label: "Buyer 1’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 1’s Mixed or Multiple ethnic groups background?" + ethnic_background_white: + page_header: "" + check_answer_label: "Buyer 1’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 1’s White background?" + + nationality_all_group: + page_header: "" + check_answer_label: "Buyer 1’s nationality" + hint_text: "If buyer 1 is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the buyer should decide which country to enter." + question_text: "What is buyer 1’s nationality?" + + nationality_all: + page_header: "" + check_answer_label: "Buyer 1’s nationality" + hint_text: "" + question_text: "Enter a nationality" + + ecstat1: + page_header: "" + check_answer_label: "Buyer 1's working situation" + hint_text: "" + question_text: "Which of these best describes buyer 1's working situation?" + + buy1livein: + page_header: "" + check_answer_label: "Will buyer 1 live in the property?" + hint_text: "" + question_text: "Will buyer 1 live in the property?" + + relat2: + buyer: + page_header: "" + check_answer_label: "Buyer 2's relationship to buyer 1" + hint_text: "" + question_text: "What is buyer 2's relationship to buyer 1?" + person: + page_header: "" + check_answer_label: "Person 2’s relationship to Buyer 1" + hint_text: "" + question_text: "What is Person 2’s relationship to Buyer 1?" + + age2: + buyer: + page_header: "" + age2_known: + check_answer_label: "Buyer 2’s age" + hint_text: "" + question_text: "Do you know buyer 2’s age?" + age2: + check_answer_label: "Buyer 2’s age" + hint_text: "" + question_text: "Age" + person: + page_header: "" + age2_known: + check_answer_label: "Person 2’s age known?" + hint_text: "" + question_text: "Do you know person 2’s age?" + age2: + check_answer_label: "Person 2’s age" + hint_text: "" + question_text: "Age" + + sex2: + buyer: + page_header: "" + check_answer_label: "Buyer 2’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes buyer 2’s gender identity?" + person: + page_header: "" + check_answer_label: "Person 2’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes Person 2’s gender identity?" + + ethnic_group2: + page_header: "" + check_answer_label: "Buyer 2’s ethnic group" + hint_text: "" + question_text: "What is buyer 2’s ethnic group?" + + ethnicbuy2: + ethnic_background_black: + page_header: "" + check_answer_label: "Buyer 2’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 2’s Black, African, Caribbean or Black British background?" + ethnic_background_asian: + page_header: "" + check_answer_label: "Buyer 2’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 2’s Asian or Asian British background?" + ethnic_background_arab: + page_header: "" + check_answer_label: "Buyer 2’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 2’s Arab background?" + ethnic_background_mixed: + page_header: "" + check_answer_label: "Buyer 2’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 2’s Mixed or Multiple ethnic groups background?" + ethnic_background_white: + page_header: "" + check_answer_label: "Buyer 2’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes buyer 2’s White background?" + + nationality_all_buyer2_group: + page_header: "" + check_answer_label: "Buyer 2’s nationality" + hint_text: "If buyer 1 is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the buyer should decide which country to enter." + question_text: "What is buyer 2’s nationality?" + + nationality_all_buyer2: + page_header: "" + check_answer_label: "Buyer 2’s nationality" + hint_text: "" + question_text: "Enter a nationality" + + ecstat2: + buyer: + page_header: "" + check_answer_label: "Buyer 2's working situation" + hint_text: "" + question_text: "Which of these best describes buyer 2's working situation?" + person: + page_header: "" + check_answer_label: "Person 2’s working situation" + hint_text: "" + question_text: "Which of these best describes Person 2’s working situation?" + + buy2livein: + page_header: "" + check_answer_label: "Will buyer 2 live in the property?" + hint_text: "" + question_text: "Will buyer 2 live in the property?" + + hholdcount: + joint_purchase: + page_header: "" + check_answer_label: "Number of other people living in the property" + hint_text: "You can provide details for a maximum of 4 other people for a joint purchase." + question_text: "Besides the buyers, how many other people live or will live in the property?" + not_joint_purchase: + page_header: "" + check_answer_label: "Number of other people living in the property" + hint_text: "You can provide details for a maximum of 5 other people if there is only one buyer." + question_text: "Besides the buyer, how many other people live or will live in the property?" + + details_known_2: + page_header: "" + check_answer_label: "Details known for person 2?" + hint_text: "" + question_text: "Do you know the details for person 2?" + + details_known_3: + page_header: "" + check_answer_label: "Details known for person 3?" + hint_text: "" + question_text: "Do you know the details for person 3?" + + relat3: + page_header: "" + check_answer_label: "Person 3’s relationship to Buyer 1" + hint_text: "" + question_text: "What is Person 3’s relationship to Buyer 1?" + + age3: + page_header: "" + age3_known: + check_answer_label: "Person 3’s age known?" + hint_text: "" + question_text: "Do you know person 3’s age?" + age3: + check_answer_label: "Person 3’s age" + hint_text: "" + question_text: "Age" + + sex3: + page_header: "" + check_answer_label: "Person 3’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes Person 3’s gender identity?" + + ecstat3: + page_header: "" + check_answer_label: "Person 3’s working situation" + hint_text: "" + question_text: "Which of these best describes Person 3’s working situation?" + + details_known_4: + page_header: "" + check_answer_label: "Details known for person 4?" + hint_text: "" + question_text: "Do you know the details for person 4?" + + relat4: + page_header: "" + check_answer_label: "Person 4’s relationship to Buyer 1" + hint_text: "" + question_text: "What is Person 4’s relationship to Buyer 1?" + + age4: + page_header: "" + age4_known: + check_answer_label: "Person 4’s age known?" + hint_text: "" + question_text: "Do you know person 4’s age?" + age4: + check_answer_label: "Person 4’s age" + hint_text: "" + question_text: "Age" + + sex4: + page_header: "" + check_answer_label: "Person 4’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes Person 4’s gender identity?" + + ecstat4: + page_header: "" + check_answer_label: "Person 4’s working situation" + hint_text: "" + question_text: "Which of these best describes Person 4’s working situation?" + + details_known_5: + page_header: "" + check_answer_label: "Details known for person 5?" + hint_text: "" + question_text: "Do you know the details for person 5?" + + relat5: + page_header: "" + check_answer_label: "Person 5’s relationship to Buyer 1" + hint_text: "" + question_text: "What is Person 5’s relationship to Buyer 1?" + + age5: + page_header: "" + age5_known: + check_answer_label: "Person 5’s age known?" + hint_text: "" + question_text: "Do you know person 5’s age?" + age5: + check_answer_label: "Person 5’s age" + hint_text: "" + question_text: "Age" + + sex5: + page_header: "" + check_answer_label: "Person 5’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes Person 5’s gender identity?" + + ecstat5: + page_header: "" + check_answer_label: "Person 5’s working situation" + hint_text: "" + question_text: "Which of these best describes Person 5’s working situation?" + + details_known_6: + page_header: "" + check_answer_label: "Details known for person 6?" + hint_text: "" + question_text: "Do you know the details for person 6?" + + relat6: + page_header: "" + check_answer_label: "Person 6’s relationship to Buyer 1" + hint_text: "" + question_text: "What is Person 6’s relationship to Buyer 1?" + + age6: + page_header: "" + age6_known: + check_answer_label: "Person 6’s age known?" + hint_text: "" + question_text: "Do you know person 6’s age?" + age6: + check_answer_label: "Person 6’s age" + hint_text: "" + question_text: "Age" + + sex6: + page_header: "" + check_answer_label: "Person 6’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes Person 6’s gender identity?" + + ecstat6: + page_header: "" + check_answer_label: "Person 6’s working situation" + hint_text: "" + question_text: "Which of these best describes Person 6’s working situation?" diff --git a/config/locales/forms/2024/sales/soft_validations.en.yml b/config/locales/forms/2024/sales/soft_validations.en.yml index 2c7ac6e3e..39af6cb38 100644 --- a/config/locales/forms/2024/sales/soft_validations.en.yml +++ b/config/locales/forms/2024/sales/soft_validations.en.yml @@ -3,25 +3,51 @@ en: 2024: sales: soft_validations: - income1_value_check: + retirement_value_check: + max: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + question_text: "Are you sure this person isn't retired?" + title_text: "You told us this person is over 66 and not retired." + informative_text: "The minimum expected retirement age in England is 66." + min: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + 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" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: + 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: "" question_text: "Are you sure this is correct?" min: + page_header: "" title_text: "You told us income was %{income}." informative_text: "This is less than we would expect for someone in this working situation." 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: - page_header: "" check_answer_label: "Buyer 2 income confirmation" hint_text: "" question_text: "Are you sure this is correct?" min: + page_header: "" title_text: "You told us income was %{income}." informative_text: "This is less than we would expect for someone in this working situation." 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: "" @@ -64,3 +90,39 @@ en: 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: "" + check_answer_label: "Buyer live in confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that buyer 1 will not live in the property." + informative_text: "For %{ownership_scheme} types, the buyer usually lives in the property." + buyer2: + page_header: "" + check_answer_label: "Buyer live in confirmation" + hint_text: "" + 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" + hint_text: "" + 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" + hint_text: "" + 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" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1." + informative_text: "Are you sure this is correct?" diff --git a/config/locales/validations/sales/sale_information.en.yml b/config/locales/validations/sales/sale_information.en.yml new file mode 100644 index 000000000..20aca17d2 --- /dev/null +++ b/config/locales/validations/sales/sale_information.en.yml @@ -0,0 +1,125 @@ +en: + validations: + sales: + sale_information: + ownershipsch: + discounted_ownership_value: "The mortgage%{mortgage}%{deposit_and_grant_sentence} added together is %{mortgage_deposit_and_grant_total}.

The full purchase price%{discount_sentence} is %{value_with_discount}.

These two amounts should be the same." + outright_sale_value: "The mortgage%{mortgage} and cash deposit (%{deposit}) when added together is %{mortgage_and_deposit_total}.

The full purchase price is %{value}.

These two amounts should be the same." + hodate: + must_be_before_saledate: "Practical completion or handover date must be before sale completion date." + must_be_less_than_3_years_from_saledate: "Practical completion or handover date must be less than 3 years before sale completion date." + saledate: + must_be_after_hodate: "Sale completion date must be after practical completion or handover date." + must_be_less_than_3_years_from_hodate: "Sale completion date must be less than 3 years after practical completion or handover date." + must_be_after_exdate: "Sale completion date must be after contract exchange date." + must_be_less_than_1_year_from_exdate: "Sale completion date must be less than 1 year after contract exchange date." + mortgage_used_year: "You must answer either ‘yes’ or ‘no’ to the question ‘was a mortgage used’ for the selected year." + exdate: + must_be_before_saledate: "Contract exchange date must be before sale completion date." + must_be_less_than_1_year_from_saledate: "Contract exchange date must be less than 1 year before sale completion date." + fromprop: + previous_property_type_bedsit: "A bedsit cannot have more than 1 bedroom." + frombeds: + previous_property_type_bedsit: "A bedsit cannot have more than 1 bedroom." + mortgageused: + discounted_ownership_value: "The mortgage%{mortgage}%{deposit_and_grant_sentence} added together is %{mortgage_deposit_and_grant_total}.

The full purchase price%{discount_sentence} is %{value_with_discount}.

These two amounts should be the same." + outright_sale_value: "The mortgage%{mortgage} and cash deposit (%{deposit}) when added together is %{mortgage_and_deposit_total}.

The full purchase price is %{value}.

These two amounts should be the same." + mortgageused_dont_know: "The percentage owned has to be 100% if the mortgage used is 'Don’t know'" + non_staircasing_mortgage: + mortgage_not_used: "The cash deposit is %{deposit}.

The full purchase price (%{value}) multiplied by the percentage bought is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + mortgage_not_used_socialhomebuy: "The cash deposit (%{deposit}) and cash discount (%{cashdis}) added together is %{deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + staircasing_mortgage: + mortgage_not_used: "The cash deposit is %{deposit}.

The full purchase price (%{value}) multiplied by the percentage bought is %{stairbought_part_of_value}.

These two amounts should be the same." + mortgage_not_used_socialhomebuy: "The cash deposit (%{deposit}) and cash discount (%{cashdis}) added together is %{deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{stairbought}) is %{stairbought_part_of_value}.

These two amounts should be the same." + mortgage: + discounted_ownership_value: "The mortgage%{mortgage}%{deposit_and_grant_sentence} added together is %{mortgage_deposit_and_grant_total}.

The full purchase price%{discount_sentence} is %{value_with_discount}.

These two amounts should be the same." + outright_sale_value: "The mortgage%{mortgage} and cash deposit (%{deposit}) when added together is %{mortgage_and_deposit_total}.

The full purchase price is %{value}.

These two amounts should be the same." + non_staircasing_mortgage: + mortgage_used: "The mortgage (%{mortgage}) and cash deposit (%{deposit}) added together is %{mortgage_and_deposit_total}.

The full purchase price (%{value}) multiplied by the percentage equity stake purchased (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + mortgage_used_socialhomebuy: "The mortgage amount (%{mortgage}), cash deposit (%{deposit}), and cash discount (%{cashdis}) added together is %{mortgage_deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage equity stake purchased (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + staircasing_mortgage: + mortgage_used: "The mortgage (%{mortgage}) and cash deposit (%{deposit}) added together is %{mortgage_and_deposit_total}.

The full purchase price (%{value}) multiplied by the percentage bought is %{stairbought_part_of_value}.

These two amounts should be the same." + mortgage_used_socialhomebuy: "The mortgage amount (%{mortgage}), cash deposit (%{deposit}), and cash discount (%{cashdis}) added together is %{mortgage_deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{stairbought}) is %{stairbought_part_of_value}.

These two amounts should be the same." + value: + discounted_ownership_value: "The mortgage%{mortgage}%{deposit_and_grant_sentence} added together is %{mortgage_deposit_and_grant_total}.

The full purchase price%{discount_sentence} is %{value_with_discount}.

These two amounts should be the same." + outright_sale_value: "The mortgage%{mortgage} and cash deposit (%{deposit}) when added together is %{mortgage_and_deposit_total}.

The full purchase price is %{value}.

These two amounts should be the same." + value_over_discounted_london_max: "The percentage discount multiplied by the purchase price is %{discount_value}. This figure should not be more than £136,400 for properties in London." + value_over_discounted_max: "The percentage discount multiplied by the purchase price is %{discount_value}. This figure should not be more than £102,400 for properties outside of London." + non_staircasing_mortgage: + mortgage_used: "The mortgage (%{mortgage}) and cash deposit (%{deposit}) added together is %{mortgage_and_deposit_total}.

The full purchase price (%{value}) multiplied by the percentage equity stake purchased (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + mortgage_not_used: "The cash deposit is %{deposit}.

The full purchase price (%{value}) multiplied by the percentage bought is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + mortgage_used_socialhomebuy: "The mortgage amount (%{mortgage}), cash deposit (%{deposit}), and cash discount (%{cashdis}) added together is %{mortgage_deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage equity stake purchased (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + mortgage_not_used_socialhomebuy: "The cash deposit (%{deposit}) and cash discount (%{cashdis}) added together is %{deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + staircasing_mortgage: + mortgage_used: "The mortgage (%{mortgage}) and cash deposit (%{deposit}) added together is %{mortgage_and_deposit_total}.

The full purchase price (%{value}) multiplied by the percentage bought is %{stairbought_part_of_value}.

These two amounts should be the same." + mortgage_not_used: "The cash deposit is %{deposit}.

The full purchase price (%{value}) multiplied by the percentage bought is %{stairbought_part_of_value}.

These two amounts should be the same." + mortgage_used_socialhomebuy: "The mortgage amount (%{mortgage}), cash deposit (%{deposit}), and cash discount (%{cashdis}) added together is %{mortgage_deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{stairbought}) is %{stairbought_part_of_value}.

These two amounts should be the same." + mortgage_not_used_socialhomebuy: "The cash deposit (%{deposit}) and cash discount (%{cashdis}) added together is %{deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{stairbought}) is %{stairbought_part_of_value}.

These two amounts should be the same." + deposit: + discounted_ownership_value: "The mortgage%{mortgage}%{deposit_and_grant_sentence} added together is %{mortgage_deposit_and_grant_total}.

The full purchase price%{discount_sentence} is %{value_with_discount}.

These two amounts should be the same." + outright_sale_value: "The mortgage%{mortgage} and cash deposit (%{deposit}) when added together is %{mortgage_and_deposit_total}.

The full purchase price is %{value}.

These two amounts should be the same." + non_staircasing_mortgage: + mortgage_used: "The mortgage (%{mortgage}) and cash deposit (%{deposit}) added together is %{mortgage_and_deposit_total}.

The full purchase price (%{value}) multiplied by the percentage equity stake purchased (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + mortgage_not_used: "The cash deposit is %{deposit}.

The full purchase price (%{value}) multiplied by the percentage bought is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + mortgage_used_socialhomebuy: "The mortgage amount (%{mortgage}), cash deposit (%{deposit}), and cash discount (%{cashdis}) added together is %{mortgage_deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage equity stake purchased (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + mortgage_not_used_socialhomebuy: "The cash deposit (%{deposit}) and cash discount (%{cashdis}) added together is %{deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + staircasing_mortgage: + mortgage_used: "The mortgage (%{mortgage}) and cash deposit (%{deposit}) added together is %{mortgage_and_deposit_total}.

The full purchase price (%{value}) multiplied by the percentage bought is %{stairbought_part_of_value}.

These two amounts should be the same." + mortgage_not_used: "The cash deposit is %{deposit}.

The full purchase price (%{value}) multiplied by the percentage bought is %{stairbought_part_of_value}.

These two amounts should be the same." + mortgage_used_socialhomebuy: "The mortgage amount (%{mortgage}), cash deposit (%{deposit}), and cash discount (%{cashdis}) added together is %{mortgage_deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{stairbought}) is %{stairbought_part_of_value}.

These two amounts should be the same." + mortgage_not_used_socialhomebuy: "The cash deposit (%{deposit}) and cash discount (%{cashdis}) added together is %{deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{stairbought}) is %{stairbought_part_of_value}.

These two amounts should be the same." + cashdis: + non_staircasing_mortgage: + mortgage_used_socialhomebuy: "The mortgage amount (%{mortgage}), cash deposit (%{deposit}), and cash discount (%{cashdis}) added together is %{mortgage_deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage equity stake purchased (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + mortgage_not_used_socialhomebuy: "The cash deposit (%{deposit}) and cash discount (%{cashdis}) added together is %{deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + staircasing_mortgage: + mortgage_used_socialhomebuy: "The mortgage amount (%{mortgage}), cash deposit (%{deposit}), and cash discount (%{cashdis}) added together is %{mortgage_deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{stairbought}) is %{stairbought_part_of_value}.

These two amounts should be the same." + mortgage_not_used_socialhomebuy: "The cash deposit (%{deposit}) and cash discount (%{cashdis}) added together is %{deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{stairbought}) is %{stairbought_part_of_value}.

These two amounts should be the same." + equity: + non_staircasing_mortgage: + mortgage_used: "The mortgage (%{mortgage}) and cash deposit (%{deposit}) added together is %{mortgage_and_deposit_total}.

The full purchase price (%{value}) multiplied by the percentage equity stake purchased (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + mortgage_not_used: "The cash deposit is %{deposit}.

The full purchase price (%{value}) multiplied by the percentage bought is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + mortgage_used_socialhomebuy: "The mortgage amount (%{mortgage}), cash deposit (%{deposit}), and cash discount (%{cashdis}) added together is %{mortgage_deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage equity stake purchased (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + mortgage_not_used_socialhomebuy: "The cash deposit (%{deposit}) and cash discount (%{cashdis}) added together is %{deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + discount: + discounted_ownership_value: "The mortgage%{mortgage}%{deposit_and_grant_sentence} added together is %{mortgage_deposit_and_grant_total}.

The full purchase price%{discount_sentence} is %{value_with_discount}.

These two amounts should be the same." + value_over_discounted_london_max: "The percentage discount multiplied by the purchase price is %{discount_value}. This figure should not be more than £136,400 for properties in London." + value_over_discounted_max: "The percentage discount multiplied by the purchase price is %{discount_value}. This figure should not be more than £102,400 for properties outside of London." + grant: + discounted_ownership_value: "The mortgage%{mortgage}%{deposit_and_grant_sentence} added together is %{mortgage_deposit_and_grant_total}.

The full purchase price%{discount_sentence} is %{value_with_discount}.

These two amounts should be the same." + out_of_range: "Loan, grants or subsidies must be between £9,000 and £16,000." + mrent: + monthly_rent_higher_than_expected: "Basic monthly rent must be between £0.00 and £9,999.00." + type: + monthly_rent_higher_than_expected: "Basic monthly rent must be between £0.00 and £9,999.00." + stairbought_over_max: "The percentage bought in this staircasing transaction cannot be higher than %{max_stairbought}% for %{type} sales." + non_staircasing_mortgage: + mortgage_used: "The mortgage (%{mortgage}) and cash deposit (%{deposit}) added together is %{mortgage_and_deposit_total}.

The full purchase price (%{value}) multiplied by the percentage equity stake purchased (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + mortgage_not_used: "The cash deposit is %{deposit}.

The full purchase price (%{value}) multiplied by the percentage bought is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + mortgage_used_socialhomebuy: "The mortgage amount (%{mortgage}), cash deposit (%{deposit}), and cash discount (%{cashdis}) added together is %{mortgage_deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage equity stake purchased (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + mortgage_not_used_socialhomebuy: "The cash deposit (%{deposit}) and cash discount (%{cashdis}) added together is %{deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{equity}) is %{expected_shared_ownership_deposit_value}.

These two amounts should be the same." + staircasing_mortgage: + mortgage_used: "The mortgage (%{mortgage}) and cash deposit (%{deposit}) added together is %{mortgage_and_deposit_total}.

The full purchase price (%{value}) multiplied by the percentage bought is %{stairbought_part_of_value}.

These two amounts should be the same." + mortgage_not_used: "The cash deposit is %{deposit}.

The full purchase price (%{value}) multiplied by the percentage bought is %{stairbought_part_of_value}.

These two amounts should be the same." + mortgage_used_socialhomebuy: "The mortgage amount (%{mortgage}), cash deposit (%{deposit}), and cash discount (%{cashdis}) added together is %{mortgage_deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{stairbought}) is %{stairbought_part_of_value}.

These two amounts should be the same." + mortgage_not_used_socialhomebuy: "The cash deposit (%{deposit}) and cash discount (%{cashdis}) added together is %{deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{stairbought}) is %{stairbought_part_of_value}.

These two amounts should be the same." + stairbought: + stairbought_over_max: "The percentage bought in this staircasing transaction cannot be higher than %{max_stairbought}% for %{type} sales." + staircasing_mortgage: + mortgage_used: "The mortgage (%{mortgage}) and cash deposit (%{deposit}) added together is %{mortgage_and_deposit_total}.

The full purchase price (%{value}) multiplied by the percentage bought is %{stairbought_part_of_value}.

These two amounts should be the same." + mortgage_not_used: "The cash deposit is %{deposit}.

The full purchase price (%{value}) multiplied by the percentage bought is %{stairbought_part_of_value}.

These two amounts should be the same." + mortgage_used_socialhomebuy: "The mortgage amount (%{mortgage}), cash deposit (%{deposit}), and cash discount (%{cashdis}) added together is %{mortgage_deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{stairbought}) is %{stairbought_part_of_value}.

These two amounts should be the same." + mortgage_not_used_socialhomebuy: "The cash deposit (%{deposit}) and cash discount (%{cashdis}) added together is %{deposit_and_discount_total}.

The full purchase price (%{value}) multiplied by the percentage bought (%{stairbought}) is %{stairbought_part_of_value}.

These two amounts should be the same." + stairowned: + mortgageused_dont_know: "The percentage owned has to be 100% if the mortgage used is 'Don’t know'" + staircase: + mortgage_used_value: "You must answer either ‘yes’ or ‘no’ to the question ‘was a mortgage used’ for staircasing transactions." + la: + value_over_discounted_london_max: "The percentage discount multiplied by the purchase price is %{discount_value}. This figure should not be more than £136,400 for properties in London." + value_over_discounted_max: "The percentage discount multiplied by the purchase price is %{discount_value}. This figure should not be more than £102,400 for properties outside of London." + uprn: + value_over_discounted_london_max: "The percentage discount multiplied by the purchase price is %{discount_value}. This figure should not be more than £136,400 for properties in London." + value_over_discounted_max: "The percentage discount multiplied by the purchase price is %{discount_value}. This figure should not be more than £102,400 for properties outside of London." + postcode_full: + value_over_discounted_london_max: "The percentage discount multiplied by the purchase price is %{discount_value}. This figure should not be more than £136,400 for properties in London." + value_over_discounted_max: "The percentage discount multiplied by the purchase price is %{discount_value}. This figure should not be more than £102,400 for properties outside of London." diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 8270007c8..f8962318e 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -226,8 +226,7 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - rexml (3.3.6) - strscan + rexml (3.3.9) rouge (3.26.0) ruby2_keywords (0.0.5) rubyzip (2.3.2) @@ -242,7 +241,6 @@ GEM faraday (>= 0.17.3, < 3) simpleidn (0.2.1) unf (~> 0.1.4) - strscan (3.1.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) typhoeus (1.4.0) diff --git a/spec/features/form/check_answers_page_lettings_logs_spec.rb b/spec/features/form/check_answers_page_lettings_logs_spec.rb index d435f8b7a..bbbeccbe6 100644 --- a/spec/features/form/check_answers_page_lettings_logs_spec.rb +++ b/spec/features/form/check_answers_page_lettings_logs_spec.rb @@ -167,14 +167,12 @@ RSpec.describe "Lettings Log Check Answers Page" do it "displays inferred postcode with the location id" do lettings_log.update!(location:) visit("/lettings-logs/#{id}/setup/check-answers") - expect(page).to have_content("Location") expect(page).to have_content(location.name) end it "displays inferred postcode with the location_admin_district" do lettings_log.update!(location:) visit("/lettings-logs/#{id}/setup/check-answers") - expect(page).to have_content("Location") expect(page).to have_content(location.location_admin_district) end end diff --git a/spec/features/lettings_log_spec.rb b/spec/features/lettings_log_spec.rb index 218850992..092ab2b40 100644 --- a/spec/features/lettings_log_spec.rb +++ b/spec/features/lettings_log_spec.rb @@ -243,7 +243,7 @@ RSpec.describe "Lettings Log Features" do context "when completing the setup lettings log section", :aggregate_failure do before do - Timecop.freeze(Time.zone.local(2023, 3, 3)) + Timecop.freeze(Time.zone.local(2023, 4, 3)) Singleton.__init__(FormHandler) end diff --git a/spec/models/form/sales/pages/buyer_interview_spec.rb b/spec/models/form/sales/pages/buyer_interview_spec.rb index ce72974e9..24704526d 100644 --- a/spec/models/form/sales/pages/buyer_interview_spec.rb +++ b/spec/models/form/sales/pages/buyer_interview_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::BuyerInterview, type: :model do let(:page_id) { "buyer_interview" } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) } + let(:subsection) { instance_double(Form::Subsection, form:, id: "setup") } it "has correct subsection" do expect(page.subsection).to eq(subsection) @@ -23,19 +24,43 @@ RSpec.describe Form::Sales::Pages::BuyerInterview, type: :model do expect(page.description).to be_nil end - context "when there are joint buyers" do - subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) } + context "when form is before 2024" do + let(:subsection) { instance_double(Form::Subsection, form:, id: "household_characteristics") } - it "has the expected copy_key" do - expect(page.copy_key).to eq("sales.setup.noint.joint_purchase") + context "when there are joint buyers" do + subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) } + + it "has the expected copy_key" do + expect(page.copy_key).to eq("sales.household_characteristics.noint.joint_purchase") + end + end + + context "when there is a single buyer" do + subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: false) } + + it "has the expected copy_key" do + expect(page.copy_key).to eq("sales.household_characteristics.noint.not_joint_purchase") + end end end - context "when there is a single buyer" do - subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: false) } + context "when form is after 2024" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) } + + context "when there are joint buyers" do + subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) } + + it "has the expected copy_key" do + expect(page.copy_key).to eq("sales.setup.noint.joint_purchase") + end + end + + context "when there is a single buyer" do + subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: false) } - it "has the expected copy_key" do - expect(page.copy_key).to eq("sales.setup.noint.not_joint_purchase") + it "has the expected copy_key" do + expect(page.copy_key).to eq("sales.setup.noint.not_joint_purchase") + end end end end diff --git a/spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb b/spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb index 4bce29312..72234b6d5 100644 --- a/spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb +++ b/spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb @@ -6,7 +6,8 @@ RSpec.describe Form::Sales::Pages::BuyerLiveInValueCheck, type: :model do let(:page_id) { "buyer_1_live_in_value_check" } let(:page_definition) { nil } let(:person_index) { 1 } - 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) @@ -34,7 +35,7 @@ RSpec.describe Form::Sales::Pages::BuyerLiveInValueCheck, type: :model do it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.buyer1_livein_wrong_for_ownership_type.title_text", + "translation" => "forms.2024.sales.soft_validations.buyer_livein_value_check.buyer1.title_text", "arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }], }) end @@ -56,7 +57,7 @@ RSpec.describe Form::Sales::Pages::BuyerLiveInValueCheck, type: :model do it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.buyer2_livein_wrong_for_ownership_type.title_text", + "translation" => "forms.2024.sales.soft_validations.buyer_livein_value_check.buyer2.title_text", "arguments" => [{ "key" => "ownership_scheme", "label" => false, "i18n_template" => "ownership_scheme" }], }) end diff --git a/spec/models/form/sales/pages/multiple_partners_value_check_spec.rb b/spec/models/form/sales/pages/multiple_partners_value_check_spec.rb index 890a24e6a..e3ee322a5 100644 --- a/spec/models/form/sales/pages/multiple_partners_value_check_spec.rb +++ b/spec/models/form/sales/pages/multiple_partners_value_check_spec.rb @@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } 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:) } let(:person_index) { 1 } let(:page_id) { "multiple_partners_value_check" } @@ -39,13 +40,13 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.multiple_partners_sales.title", + "translation" => "forms.2024.sales.soft_validations.multiple_partners_value_check.title_text", "arguments" => [], }) end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.multiple_partners_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -71,13 +72,13 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.multiple_partners_sales.title", + "translation" => "forms.2024.sales.soft_validations.multiple_partners_value_check.title_text", "arguments" => [], }) end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.multiple_partners_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do diff --git a/spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb b/spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb index 8bc20cef7..19292db35 100644 --- a/spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb +++ b/spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck, type: :m let(:page_id) { "old_persons_shared_ownership_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) @@ -34,13 +35,13 @@ RSpec.describe Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck, type: :m it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.old_persons_shared_ownership.title_text.one", + "translation" => "forms.2024.sales.soft_validations.old_persons_shared_ownership_value_check.title_text.not_joint_purchase", "arguments" => [], }) end it "has the correct informative_text" do - expect(page.informative_text).to eq({ "arguments" => [], "translation" => "soft_validations.old_persons_shared_ownership.hint_text" }) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.old_persons_shared_ownership_value_check.informative_text" }) end it "has the correct interruption_screen_question_ids" do @@ -52,7 +53,7 @@ RSpec.describe Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck, type: :m it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.old_persons_shared_ownership.title_text.two", + "translation" => "forms.2024.sales.soft_validations.old_persons_shared_ownership_value_check.title_text.joint_purchase", "arguments" => [], }) end diff --git a/spec/models/form/sales/pages/partner_under16_value_check_spec.rb b/spec/models/form/sales/pages/partner_under16_value_check_spec.rb index fe11bdc86..5785ab900 100644 --- a/spec/models/form/sales/pages/partner_under16_value_check_spec.rb +++ b/spec/models/form/sales/pages/partner_under16_value_check_spec.rb @@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } 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:) } let(:person_index) { 1 } let(:page_id) { "partner_under_16_value_check" } @@ -39,7 +40,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_sales.title", + "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age1", @@ -51,7 +52,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -77,7 +78,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_sales.title", + "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age2", @@ -89,7 +90,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -115,7 +116,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_sales.title", + "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age3", @@ -127,7 +128,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -153,7 +154,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_sales.title", + "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age4", @@ -165,7 +166,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -191,7 +192,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_sales.title", + "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age5", @@ -203,7 +204,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -229,7 +230,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_sales.title", + "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age6", @@ -241,7 +242,7 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do diff --git a/spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb b/spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb index 9185f9f1c..43ba0af49 100644 --- a/spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb +++ b/spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb @@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::PersonStudentNotChildValueCheck, type: :model subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } 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:) } let(:person_index) { 2 } let(:page_id) { "person_2_student_not_child_value_check" } @@ -23,12 +24,12 @@ RSpec.describe Form::Sales::Pages::PersonStudentNotChildValueCheck, type: :model it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.student_not_child.title_text", + "translation" => "forms.2024.sales.soft_validations.student_not_child_value_check.title_text", }) end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.student_not_child_value_check.informative_text" }) end it "has correct questions" do diff --git a/spec/models/form/sales/pages/privacy_notice_spec.rb b/spec/models/form/sales/pages/privacy_notice_spec.rb index 1d146f0af..7510e60d9 100644 --- a/spec/models/form/sales/pages/privacy_notice_spec.rb +++ b/spec/models/form/sales/pages/privacy_notice_spec.rb @@ -5,12 +5,11 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do let(:page_id) { "privacy_notice" } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } + let(:subsection) { instance_double(Form::Subsection, id: "setup") } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) } before do allow(subsection).to receive(:form).and_return(form) - allow(form).to receive(:start_year_after_2024?) end it "has correct subsection" do @@ -32,8 +31,20 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do context "when there are joint buyers" do subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) } - it "has the expected copy_key" do - expect(page.copy_key).to eq("sales.setup.privacynotice.joint_purchase") + context "when the form start year is before 2024" do + let(:subsection) { instance_double(Form::Subsection, id: "household_characteristics") } + + it "has the expected copy_key" do + expect(page.copy_key).to eq("sales.household_characteristics.privacynotice.joint_purchase") + end + end + + context "when the form start year is after 2024" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) } + + it "has the expected copy_key" do + expect(page.copy_key).to eq("sales.setup.privacynotice.joint_purchase") + end end it "has correct depends_on" do @@ -44,8 +55,20 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do context "when there is a single buyer" do subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: false) } - it "has the expected copy_key" do - expect(page.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase") + context "when the form start year is before 2024" do + let(:subsection) { instance_double(Form::Subsection, id: "household_characteristics") } + + it "has the expected copy_key" do + expect(page.copy_key).to eq("sales.household_characteristics.privacynotice.not_joint_purchase") + end + end + + context "when the form start year is after 2024" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) } + + it "has the expected copy_key" do + expect(page.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase") + end end it "has correct depends_on" do diff --git a/spec/models/form/sales/pages/retirement_value_check_spec.rb b/spec/models/form/sales/pages/retirement_value_check_spec.rb index 6df7a379b..e316250b5 100644 --- a/spec/models/form/sales/pages/retirement_value_check_spec.rb +++ b/spec/models/form/sales/pages/retirement_value_check_spec.rb @@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } 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:) } let(:person_index) { 1 } let(:page_id) { "person_1_retirement_value_check" } @@ -39,7 +40,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text", "arguments" => [ { "key" => "age1", @@ -51,7 +52,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -77,7 +78,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text", "arguments" => [ { "key" => "age2", @@ -89,7 +90,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -115,7 +116,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text", "arguments" => [ { "key" => "age3", @@ -127,7 +128,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -153,7 +154,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text", "arguments" => [ { "key" => "age4", @@ -165,7 +166,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -191,7 +192,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text", "arguments" => [ { "key" => "age5", @@ -203,7 +204,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -229,7 +230,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.title_text", "arguments" => [ { "key" => "age6", @@ -241,7 +242,7 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.sales.soft_validations.retirement_value_check.min.informative_text" }) end it "has correct interruption_screen_question_ids" do diff --git a/spec/models/form/sales/questions/buyer_interview_spec.rb b/spec/models/form/sales/questions/buyer_interview_spec.rb index 3370a84f5..e2b39c50f 100644 --- a/spec/models/form/sales/questions/buyer_interview_spec.rb +++ b/spec/models/form/sales/questions/buyer_interview_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, 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(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: true) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form:, id: "setup")) } it "has correct page" do expect(question.page).to eq(page) @@ -33,16 +34,42 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do context "when there are joint buyers" do subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: true) } - it "has the expected copy_key" do - expect(question.copy_key).to eq("sales.setup.noint.joint_purchase") + context "when the form start year is before 2024" do + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form:, id: "household_characteristics")) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 3, 1), start_year_after_2024?: false) } + + it "has the expected copy_key" do + expect(question.copy_key).to eq("sales.household_characteristics.noint.joint_purchase") + end + end + + context "when the form start year is after 2024" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) } + + it "has the expected copy_key" do + expect(question.copy_key).to eq("sales.setup.noint.joint_purchase") + end end end context "when there is a single buyer" do subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: false) } - it "has the expected copy_key" do - expect(question.copy_key).to eq("sales.setup.noint.not_joint_purchase") + context "when the form start year is before 2024" do + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form:, id: "household_characteristics")) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) } + + it "has the expected copy_key" do + expect(question.copy_key).to eq("sales.household_characteristics.noint.not_joint_purchase") + end + end + + context "when the form start year is after 2024" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) } + + it "has the expected copy_key" do + expect(question.copy_key).to eq("sales.setup.noint.not_joint_purchase") + end end end end diff --git a/spec/models/form/sales/questions/privacy_notice_spec.rb b/spec/models/form/sales/questions/privacy_notice_spec.rb index 11589049d..48de6056f 100644 --- a/spec/models/form/sales/questions/privacy_notice_spec.rb +++ b/spec/models/form/sales/questions/privacy_notice_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do let(:question_id) { nil } let(:question_definition) { nil } let(:page) { instance_double(Form::Page) } - let(:subsection) { instance_double(Form::Subsection) } + let(:subsection) { instance_double(Form::Subsection, id: "setup") } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do @@ -31,23 +31,9 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do expect(question.derived?(nil)).to be false end - context "when there are joint buyers" do - subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: true) } - - it "has the expected copy_key" do - expect(question.copy_key).to eq("sales.setup.privacynotice.joint_purchase") - end - end - - context "when there is a single buyer" do - subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: false) } - - it "has the expected copy_key" do - expect(question.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase") - end - end - context "when the form year is before 2024" do + let(:subsection) { instance_double(Form::Subsection, id: "household_characteristics") } + before do allow(form).to receive(:start_year_after_2024?).and_return(false) end @@ -66,6 +52,10 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do it "returns correct unanswered_error_message" do expect(question.unanswered_error_message).to eq("You must show the MHCLG privacy notice to the buyer before you can submit this log.") end + + it "has the expected copy_key" do + expect(question.copy_key).to eq("sales.household_characteristics.privacynotice.not_joint_purchase") + end end context "and there are joint buyers" do @@ -84,6 +74,10 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do it "returns correct unanswered_error_message" do expect(question.unanswered_error_message).to eq("You must show the MHCLG privacy notice to the buyers before you can submit this log.") end + + it "has the expected copy_key" do + expect(question.copy_key).to eq("sales.household_characteristics.privacynotice.joint_purchase") + end end end @@ -106,6 +100,10 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do it "returns correct unanswered_error_message" do expect(question.unanswered_error_message).to eq("You must show or give the buyer access to the MHCLG privacy notice before you can submit this log.") end + + it "has the expected copy_key" do + expect(question.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase") + end end context "and there are joint buyers" do @@ -124,6 +122,10 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do it "returns correct unanswered_error_message" do expect(question.unanswered_error_message).to eq("You must show or give the buyers access to the MHCLG privacy notice before you can submit this log.") end + + it "has the expected copy_key" do + expect(question.copy_key).to eq("sales.setup.privacynotice.joint_purchase") + end end end end diff --git a/spec/models/validations/sales/sale_information_validations_spec.rb b/spec/models/validations/sales/sale_information_validations_spec.rb index 945d1b25b..1f20163d3 100644 --- a/spec/models/validations/sales/sale_information_validations_spec.rb +++ b/spec/models/validations/sales/sale_information_validations_spec.rb @@ -197,8 +197,8 @@ RSpec.describe Validations::Sales::SaleInformationValidations do it "does add an error if it's a bedsit" do sale_information_validator.validate_previous_property_unit_type(record) - expect(record.errors["fromprop"]).to include(I18n.t("validations.sale_information.previous_property_type.property_type_bedsit")) - expect(record.errors["frombeds"]).to include(I18n.t("validations.sale_information.previous_property_type.property_type_bedsit")) + expect(record.errors["fromprop"]).to include(I18n.t("validations.sales.sale_information.fromprop.previous_property_type_bedsit")) + expect(record.errors["frombeds"]).to include(I18n.t("validations.sales.sale_information.frombeds.previous_property_type_bedsit")) end end end @@ -648,8 +648,8 @@ RSpec.describe Validations::Sales::SaleInformationValidations do it "adds an error" do sale_information_validator.validate_basic_monthly_rent(record) - expect(record.errors[:mrent]).to include(I18n.t("validations.sale_information.monthly_rent.higher_than_expected")) - expect(record.errors[:type]).to include(I18n.t("validations.sale_information.monthly_rent.higher_than_expected")) + expect(record.errors[:mrent]).to include(I18n.t("validations.sales.sale_information.mrent.monthly_rent_higher_than_expected")) + expect(record.errors[:type]).to include(I18n.t("validations.sales.sale_information.type.monthly_rent_higher_than_expected")) end end end diff --git a/spec/requests/form_controller_spec.rb b/spec/requests/form_controller_spec.rb index 80157e992..94f6595c7 100644 --- a/spec/requests/form_controller_spec.rb +++ b/spec/requests/form_controller_spec.rb @@ -735,14 +735,19 @@ RSpec.describe FormController, type: :request do end before do + Timecop.freeze(Time.zone.local(2023, 12, 1)) organisation.stock_owners << stock_owner organisation.managing_agents << managing_organisation organisation.managing_agents << managing_organisation_too organisation.reload - lettings_log.update!(owning_organisation: stock_owner, assigned_to: user, managing_organisation: organisation) + lettings_log.update!(owning_organisation: stock_owner, assigned_to: user, managing_organisation: organisation, startdate: Time.zone.local(2023, 5, 1)) lettings_log.reload end + after do + Timecop.unfreeze + end + it "re-renders the same page with errors if validation fails" do post "/lettings-logs/#{lettings_log.id}/managing-organisation", params: params expect(page).to have_content("There is a problem") diff --git a/spec/requests/lettings_logs_controller_spec.rb b/spec/requests/lettings_logs_controller_spec.rb index 6af9f3f12..308b90c1e 100644 --- a/spec/requests/lettings_logs_controller_spec.rb +++ b/spec/requests/lettings_logs_controller_spec.rb @@ -1538,7 +1538,7 @@ RSpec.describe LettingsLogsController, type: :request do end context "when viewing a specific log affected by deactivated location" do - let!(:affected_lettings_log) { FactoryBot.create(:lettings_log, unresolved: true, assigned_to: user, needstype: 2) } + let!(:affected_lettings_log) { FactoryBot.create(:lettings_log, unresolved: true, assigned_to: user, needstype: 2, startdate: Time.zone.local(2024, 4, 1)) } let(:headers) { { "Accept" => "text/html" } } before do diff --git a/spec/requests/locations_controller_spec.rb b/spec/requests/locations_controller_spec.rb index b42176967..a7d7684f0 100644 --- a/spec/requests/locations_controller_spec.rb +++ b/spec/requests/locations_controller_spec.rb @@ -180,7 +180,7 @@ RSpec.describe LocationsController, type: :request do context "when signed in as a data coordinator user" do let(:user) { create(:user, :data_coordinator) } - let(:scheme) { create(:scheme, owning_organisation: user.organisation) } + let(:scheme) { create(:scheme, owning_organisation: user.organisation, service_name: "Some name") } let!(:locations) { create_list(:location, 3, scheme:, startdate: Time.zone.local(2022, 4, 1)) } before do @@ -288,7 +288,7 @@ RSpec.describe LocationsController, type: :request do it "has search in the title" do expected_title = CGI.escapeHTML("#{scheme.service_name} (1 location matching ‘#{search_param}’) - Submit social housing lettings and sales data (CORE) - GOV.UK") - expect(page).to have_title(expected_title) + expect(page.title).to eq(expected_title) end end diff --git a/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb b/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb index 824754b25..70bd923e6 100644 --- a/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb +++ b/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb @@ -1029,8 +1029,8 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do end it "populates with correct error message" do - expect(parser.errors.where(:field_30, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") - expect(parser.errors.where(:field_30, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") + expect(parser.errors.where(:field_30, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.") + expect(parser.errors.where(:field_30, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.") end end diff --git a/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb b/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb index 96914fc44..d1d4aeb53 100644 --- a/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb +++ b/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb @@ -1486,8 +1486,8 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "populates with correct error message" do parser.valid? - expect(parser.errors.where(:field_31, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") - expect(parser.errors.where(:field_35, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") + expect(parser.errors.where(:field_31, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.") + expect(parser.errors.where(:field_35, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.") end end end