From ee3018b94435e6d037353c48021cccced6b534d4 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:14:59 +0000 Subject: [PATCH 1/9] CLDC-3066: Show filters button bug (#2748) * Add show filters toggle to user and scheme pages * Adjust spacing between buttons to match show filters button --- app/components/create_log_actions_component.html.erb | 2 +- app/views/logs/_create_for_org_actions.html.erb | 10 +++++----- app/views/organisations/schemes.html.erb | 4 +++- app/views/organisations/users.html.erb | 8 +++++--- app/views/schemes/index.html.erb | 10 +++++----- app/views/users/index.html.erb | 4 ++-- 6 files changed, 21 insertions(+), 17 deletions(-) diff --git a/app/components/create_log_actions_component.html.erb b/app/components/create_log_actions_component.html.erb index 8af78b169..2e88034d7 100644 --- a/app/components/create_log_actions_component.html.erb +++ b/app/components/create_log_actions_component.html.erb @@ -1,6 +1,6 @@ <% if display_actions? %>
- <%= govuk_button_to create_button_copy, create_button_href, class: "govuk-!-margin-right-6" %> + <%= govuk_button_to create_button_copy, create_button_href, class: "govuk-!-margin-right-3" %> <% unless user.support? %> <%= govuk_button_link_to upload_button_copy, upload_button_href, secondary: true %> <% end %> diff --git a/app/views/logs/_create_for_org_actions.html.erb b/app/views/logs/_create_for_org_actions.html.erb index 9b5935cb0..76b8f7d0d 100644 --- a/app/views/logs/_create_for_org_actions.html.erb +++ b/app/views/logs/_create_for_org_actions.html.erb @@ -1,13 +1,13 @@ -
+
<% if @organisation.data_protection_confirmed? %> <% if current_page?(controller: 'organisations', action: 'lettings_logs') %> - <%= govuk_button_to "Create a new lettings log", lettings_logs_path(lettings_log: { owning_organisation_id: @organisation.id }, method: :post), class: "govuk-!-margin-right-6" %> - <%= govuk_button_link_to "Upload lettings logs in bulk", bulk_upload_lettings_log_path(id: "start", organisation_id: @organisation.id), secondary: true, class: "govuk-!-margin-right-6" %> + <%= govuk_button_to "Create a new lettings log", lettings_logs_path(lettings_log: { owning_organisation_id: @organisation.id }, method: :post), class: "govuk-!-margin-right-3" %> + <%= govuk_button_link_to "Upload lettings logs in bulk", bulk_upload_lettings_log_path(id: "start", organisation_id: @organisation.id), secondary: true, class: "govuk-!-margin-right-3" %> <%= govuk_button_link_to "View lettings bulk uploads", bulk_uploads_lettings_logs_path(organisation_id: @organisation.id, clear_old_filters: true), secondary: true %> <% end %> <% if current_page?(controller: 'organisations', action: 'sales_logs') %> - <%= govuk_button_to "Create a new sales log", sales_logs_path(sales_log: { owning_organisation_id: @organisation.id }, method: :post), class: "govuk-!-margin-right-6" %> - <%= govuk_button_link_to "Upload sales logs in bulk", bulk_upload_sales_log_path(id: "start", organisation_id: @organisation.id), secondary: true, class: "govuk-!-margin-right-6" %> + <%= govuk_button_to "Create a new sales log", sales_logs_path(sales_log: { owning_organisation_id: @organisation.id }, method: :post), class: "govuk-!-margin-right-3" %> + <%= govuk_button_link_to "Upload sales logs in bulk", bulk_upload_sales_log_path(id: "start", organisation_id: @organisation.id), secondary: true, class: "govuk-!-margin-right-3" %> <%= govuk_button_link_to "View sales bulk uploads", bulk_uploads_sales_logs_path(organisation_id: @organisation.id, clear_old_filters: true), secondary: true %> <% end %> <% end %> diff --git a/app/views/organisations/schemes.html.erb b/app/views/organisations/schemes.html.erb index b9706d4db..0fda1d359 100644 --- a/app/views/organisations/schemes.html.erb +++ b/app/views/organisations/schemes.html.erb @@ -23,7 +23,9 @@
<% if SchemePolicy.new(current_user, nil).create? %> - <%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %> +
+ <%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %> +
<% end %> <%= govuk_details( diff --git a/app/views/organisations/users.html.erb b/app/views/organisations/users.html.erb index f1a6336ce..73a460276 100644 --- a/app/views/organisations/users.html.erb +++ b/app/views/organisations/users.html.erb @@ -12,10 +12,12 @@

Users

<% end %> -<% if current_user.data_coordinator? || current_user.support? %> - <%= govuk_button_link_to "Invite user", new_user_path(organisation_id: @organisation.id), html: { method: :get } %> -<% end %>
+
+ <% if current_user.data_coordinator? || current_user.support? %> + <%= govuk_button_link_to "Invite user", new_user_path(organisation_id: @organisation.id), html: { method: :get } %> + <% end %> +
<%= render partial: "users/user_filters" %>
diff --git a/app/views/schemes/index.html.erb b/app/views/schemes/index.html.erb index edaed6212..9cbc95fdb 100644 --- a/app/views/schemes/index.html.erb +++ b/app/views/schemes/index.html.erb @@ -5,12 +5,12 @@ <%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Supported housing schemes", sub: nil } : { main: "Supported housing schemes", sub: current_user.organisation.name } %> -<% if SchemePolicy.new(current_user, nil).create? %> -
- <%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %> -
-<% end %>
+ <% if SchemePolicy.new(current_user, nil).create? %> +
+ <%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %> +
+ <% end %> <%= render partial: "schemes/scheme_filters" %>
<%= render SearchComponent.new(current_user:, search_label: "Search by postcode, scheme name, scheme code or location name", value: @searched) %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 4e5053563..dd454464d 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -5,12 +5,12 @@ <%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Users", sub: nil } : { main: "Users", sub: current_user.organisation.name } %> +
<% if current_user.data_coordinator? || current_user.support? %> -
+
<%= govuk_button_link_to "Invite user", new_user_path, html: { method: :get } %>
<% end %> -
<%= render partial: "users/user_filters" %>
<%= render SearchComponent.new(current_user:, search_label: "Search by name or email address", value: @searched) %> From 1d23f9e50a9980553d65197c0e203c97b274fb34 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Thu, 7 Nov 2024 13:18:30 +0000 Subject: [PATCH 2/9] CLDC-3716: Allow 25/26 form use on dev, review, and staging environments (#2749) * CLDC-3716: Allow 25/26 form use on dev, review, and staging environments * Remove empty line --- app/helpers/filters_helper.rb | 6 +- app/services/feature_toggle.rb | 2 +- .../lettings/household_characteristics.en.yml | 0 .../forms/2025/lettings/guidance.en.yml | 63 ++++ .../lettings/household_characteristics.en.yml | 322 ++++++++++++++++ .../2025/lettings/household_needs.en.yml | 57 +++ .../2025/lettings/household_situation.en.yml | 120 ++++++ .../2025/lettings/income_and_benefits.en.yml | 108 ++++++ .../2025/lettings/property_information.en.yml | 127 +++++++ .../locales/forms/2025/lettings/setup.en.yml | 87 +++++ .../2025/lettings/tenancy_information.en.yml | 66 ++++ .../locales/forms/2025/sales/guidance.en.yml | 46 +++ .../sales/household_characteristics.en.yml | 345 ++++++++++++++++++ .../forms/2025/sales/household_needs.en.yml | 34 ++ .../2025/sales/household_situation.en.yml | 50 +++ .../sales/income_benefits_and_savings.en.yml | 90 +++++ .../2025/sales/property_information.en.yml | 91 +++++ .../forms/2025/sales/sale_information.en.yml | 206 +++++++++++ config/locales/forms/2025/sales/setup.en.yml | 110 ++++++ .../forms/2025/sales/soft_validations.en.yml | 244 +++++++++++++ spec/helpers/filters_helper_spec.rb | 46 ++- 21 files changed, 2212 insertions(+), 8 deletions(-) rename config/locales/forms/2024/{sales => }/lettings/household_characteristics.en.yml (100%) create mode 100644 config/locales/forms/2025/lettings/guidance.en.yml create mode 100644 config/locales/forms/2025/lettings/household_characteristics.en.yml create mode 100644 config/locales/forms/2025/lettings/household_needs.en.yml create mode 100644 config/locales/forms/2025/lettings/household_situation.en.yml create mode 100644 config/locales/forms/2025/lettings/income_and_benefits.en.yml create mode 100644 config/locales/forms/2025/lettings/property_information.en.yml create mode 100644 config/locales/forms/2025/lettings/setup.en.yml create mode 100644 config/locales/forms/2025/lettings/tenancy_information.en.yml create mode 100644 config/locales/forms/2025/sales/guidance.en.yml create mode 100644 config/locales/forms/2025/sales/household_characteristics.en.yml create mode 100644 config/locales/forms/2025/sales/household_needs.en.yml create mode 100644 config/locales/forms/2025/sales/household_situation.en.yml create mode 100644 config/locales/forms/2025/sales/income_benefits_and_savings.en.yml create mode 100644 config/locales/forms/2025/sales/property_information.en.yml create mode 100644 config/locales/forms/2025/sales/sale_information.en.yml create mode 100644 config/locales/forms/2025/sales/setup.en.yml create mode 100644 config/locales/forms/2025/sales/soft_validations.en.yml diff --git a/app/helpers/filters_helper.rb b/app/helpers/filters_helper.rb index 35fea17e9..3a4c337ea 100644 --- a/app/helpers/filters_helper.rb +++ b/app/helpers/filters_helper.rb @@ -143,7 +143,11 @@ module FiltersHelper } if FormHandler.instance.in_crossover_period? - return years.merge({ archived_collection_start_year.to_s => year_combo(archived_collection_start_year) }) + years = years.merge({ archived_collection_start_year.to_s => year_combo(archived_collection_start_year) }) + end + + if FeatureToggle.allow_future_form_use? + years = { next_collection_start_year.to_s => year_combo(next_collection_start_year) }.merge(years) end years diff --git a/app/services/feature_toggle.rb b/app/services/feature_toggle.rb index 5312d1964..1b67b8b37 100644 --- a/app/services/feature_toggle.rb +++ b/app/services/feature_toggle.rb @@ -1,6 +1,6 @@ class FeatureToggle def self.allow_future_form_use? - false + Rails.env.development? || Rails.env.review? || Rails.env.staging? end def self.bulk_upload_duplicate_log_check_enabled? diff --git a/config/locales/forms/2024/sales/lettings/household_characteristics.en.yml b/config/locales/forms/2024/lettings/household_characteristics.en.yml similarity index 100% rename from config/locales/forms/2024/sales/lettings/household_characteristics.en.yml rename to config/locales/forms/2024/lettings/household_characteristics.en.yml diff --git a/config/locales/forms/2025/lettings/guidance.en.yml b/config/locales/forms/2025/lettings/guidance.en.yml new file mode 100644 index 000000000..340eb11d5 --- /dev/null +++ b/config/locales/forms/2025/lettings/guidance.en.yml @@ -0,0 +1,63 @@ +en: + forms: + 2025: + lettings: + guidance: + finding_location: + title: "What is a location?" + content: "A location is a postcode area where supported housing is provided under a scheme. A scheme can have multiple locations, and a location can have multiple units at the same postcode." + scheme_changes_link_text: "Read more about schemes and locations" + + finding_scheme: + title: "Can’t find your scheme?" + content: "

Schemes are attached to the organisation that owns the property. Check you have correctly answered question 1 \"Which organisation owns this property?\"

+

If your organisation’s schemes were migrated from old CORE, they may have new names and codes. Search by postcode to find your scheme.

" + scheme_changes_link_text: "Read more about how schemes have changed" + view_schemes_link_text: "View your organisation’s schemes" + + privacy_notice_tenant: + content: "Make sure the lead tenant has seen or been given access to %{privacy_notice_link} before completing this log. This is a legal requirement under data protection legislation." + privacy_notice_link_text: "the Ministry of Housing, Communities and Local Government (MHCLG) privacy notice" + + rent_type_definitions: + title: "Rent type definitions" + content: "

Social Rent: where target rents are determined through the national rent regime. This is sometimes also known as 'formula rent'.

+

Affordable Rent: where up to 80% of market rent can be charged. A new supply agreement is signed with Homes England or the Greater London Authority (GLA).

+

London Affordable Rent: a tenure of affordable housing available in London by the GLA. It is an affordable rent which must be set in accordance with the Regulator of Social Housing’s Affordable Rent guidance. The landlord of these homes must be registered with the Regulator of Social Housing. These are a type of Affordable Rent lettings.

+

Rent to Buy: a discount of up to 20% market rent is charged for a single rental period for a minimum of 5 years. After that period, the tenant is offered first chance to purchase the property (either shared ownership or outright) at full market value. These are a type of Intermediate Rent lettings.

+

London Living Rent: a tenure of affordable housing available in London by the GLA. It was introduced in Affordable Homes Programme 2016 to 2021. These are a type of Intermediate Rent lettings.

+

Other intermediate rent: any other specific scheme where up to 80% of market rent can be charged. This includes schemes with reduced rent so tenants can save towards a house purchasing deposit and schemes with an in-built future opportunity to buy the property being rented.

" + + scheme_selection: + data_provider: + content: "If you’re not sure which scheme to choose, ask a data coordinator. Find your data coordinators on the %{users_page_link}." + users_page_link_text: "users page" + data_coordinator: + create_scheme_link_text: "Create a new supported housing scheme" + + void_date: + title: "What is a void date?" + content: "

Date the property was (legally or contractually) available to let, or for:

+
    +
  • re-lets: the day after the previous tenant's contract ended
  • +
  • new builds: the day the landlord legally first owned the property (‘completion date’)
  • +
  • new conversions or acquisitions: completion date, or the day after rehabilitation work ended
  • +
  • new leases: the day the landlord got contractual property rights and could let it out to tenants
  • +
" + + what_counts_as_income: + title: "What counts as income?" + content: "

You should include any income after tax from:

+
    +
  • employment
  • +
  • pensions
  • +
  • Universal Credit
  • +
+ +

Don’t include:

+
    +
  • National Insurance (NI) contributions and tax
  • +
  • housing benefit
  • +
  • child benefit
  • +
  • council tax support
  • +
" diff --git a/config/locales/forms/2025/lettings/household_characteristics.en.yml b/config/locales/forms/2025/lettings/household_characteristics.en.yml new file mode 100644 index 000000000..1aef9297a --- /dev/null +++ b/config/locales/forms/2025/lettings/household_characteristics.en.yml @@ -0,0 +1,322 @@ +en: + forms: + 2025: + lettings: + household_characteristics: + hhmemb: + page_header: "" + check_answer_label: "Number of household members" + hint_text: "You can provide details for a maximum of 8 people." + question_text: "How many people live in the household for this letting?" + + age1: + page_header: "" + age1_known: + check_answer_label: "" + hint_text: "The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same amount of paid work, the lead tenant is whoever is the oldest." + question_text: "Do you know the lead tenant’s age?" + age1: + check_answer_label: "Lead tenant’s age" + hint_text: "" + question_text: "Age" + + sex1: + page_header: "" + check_answer_label: "Lead tenant’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 the lead tenant’s gender identity?" + + ethnic_group: + page_header: "" + check_answer_label: "Lead tenant’s ethnic group" + hint_text: "" + question_text: "What is the lead tenant’s ethnic group?" + + ethnic: + ethnic_background_black: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes lead tenant’s Black, African, Caribbean or Black British background?" + ethnic_background_asian: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes lead tenant’s Asian or Asian British background?" + ethnic_background_arab: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes the lead tenant’s Arab background?" + ethnic_background_mixed: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes lead tenant’s Mixed or Multiple ethnic groups background?" + ethnic_background_white: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes lead tenant’s White background?" + + nationality_all: + page_header: "" + nationality_all: + check_answer_label: "Lead tenant’s nationality" + hint_text: "" + question_text: "Enter a nationality" + nationality_all_group: + check_answer_label: "Lead tenant’s nationality" + hint_text: "If the lead tenant is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the tenant should decide which country to enter." + question_text: "What is the nationality of the lead tenant?" + + ecstat1: + page_header: "" + check_answer_label: "Lead tenant’s working situation" + hint_text: "" + question_text: "Which of these best describes the lead tenant’s working situation?" + + details_known_2: + page_header: "You’ve given us the details for 1 person in the household" + check_answer_label: "Details known for person 2" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 2?" + + relat2: + page_header: "" + check_answer_label: "Person 2’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 2’s relationship to the lead tenant?" + + age2: + page_header: "" + age2_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 2’s age?" + age2: + check_answer_label: "Person 2’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex2: + 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?" + + ecstat2: + page_header: "" + check_answer_label: "Person 2’s working situation" + hint_text: "" + question_text: "Which of these best describes person 2’s working situation?" + + details_known_3: + page_header: "You’ve given us the details for 2 people in the household" + check_answer_label: "Details known for person 3" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 3?" + + relat3: + page_header: "" + check_answer_label: "Person 3’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 3’s relationship to the lead tenant?" + + age3: + page_header: "" + age3_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 3’s age?" + age3: + check_answer_label: "Person 3’s age" + hint_text: "Answer 1 for children aged under 1 year old" + 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: "You’ve given us the details for 3 people in the household" + check_answer_label: "Details known for person 4" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 4?" + + relat4: + page_header: "" + check_answer_label: "Person 4’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 4’s relationship to the lead tenant?" + + age4: + page_header: "" + age4_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 4’s age?" + age4: + check_answer_label: "Person 4’s age" + hint_text: "Answer 1 for children aged under 1 year old" + 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: "You’ve given us the details for 4 people in the household" + check_answer_label: "Details known for person 5" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 5?" + + relat5: + page_header: "" + check_answer_label: "Person 5’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 5’s relationship to the lead tenant?" + + age5: + page_header: "" + age5_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 5’s age?" + age5: + check_answer_label: "Person 5’s age" + hint_text: "Answer 1 for children aged under 1 year old" + 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: "You’ve given us the details for 5 people in the household" + check_answer_label: "Details known for person 6" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 6?" + + relat6: + page_header: "" + check_answer_label: "Person 6’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 6’s relationship to the lead tenant?" + + age6: + page_header: "" + age6_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 6’s age?" + age6: + check_answer_label: "Person 6’s age" + hint_text: "Answer 1 for children aged under 1 year old" + 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?" + + details_known_7: + page_header: "You’ve given us the details for 6 people in the household" + check_answer_label: "Details known for person 7" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 7?" + + relat7: + page_header: "" + check_answer_label: "Person 7’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 7’s relationship to the lead tenant?" + + age7: + page_header: "" + age7_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 7’s age?" + age7: + check_answer_label: "Person 7’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex7: + page_header: "" + check_answer_label: "Person 7’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 7’s gender identity?" + + ecstat7: + page_header: "" + check_answer_label: "Person 7’s working situation" + hint_text: "" + question_text: "Which of these best describes person 7’s working situation?" + + details_known_8: + page_header: "You’ve given us the details for 7 people in the household" + check_answer_label: "Details known for person 8" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 8?" + + relat8: + page_header: "" + check_answer_label: "Person 8’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 8’s relationship to the lead tenant?" + + age8: + page_header: "" + age8_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 8’s age?" + age8: + check_answer_label: "Person 8’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex8: + page_header: "" + check_answer_label: "Person 8’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 8’s gender identity?" + + ecstat8: + page_header: "" + check_answer_label: "Person 8’s working situation" + hint_text: "" + question_text: "Which of these best describes person 8’s working situation?" diff --git a/config/locales/forms/2025/lettings/household_needs.en.yml b/config/locales/forms/2025/lettings/household_needs.en.yml new file mode 100644 index 000000000..ba63f2031 --- /dev/null +++ b/config/locales/forms/2025/lettings/household_needs.en.yml @@ -0,0 +1,57 @@ +en: + forms: + 2025: + 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?" diff --git a/config/locales/forms/2025/lettings/household_situation.en.yml b/config/locales/forms/2025/lettings/household_situation.en.yml new file mode 100644 index 000000000..2b72c45d0 --- /dev/null +++ b/config/locales/forms/2025/lettings/household_situation.en.yml @@ -0,0 +1,120 @@ +en: + forms: + 2025: + lettings: + household_situation: + layear: + page_header: "" + check_answer_label: "Length of time in local authority area" + hint_text: "" + question_text: "How long has the household continuously lived in the local authority area of the new letting?" + + waityear: + page_header: "" + check_answer_label: "Length of time on local authority waiting list" + hint_text: "" + question_text: "How long has the household been on the local authority waiting list for the area of the new letting?" + + reason: + reason_for_leaving_last_settled_home_renewal: + page_header: "" + reason: + check_answer_label: "Reason for leaving last settled home" + hint_text: "You told us this letting is a renewal. We have removed some options because of this." + question_text: "What is the tenant’s main reason for the household leaving their last settled home?" + reasonother: + check_answer_label: "Length of time on local authority waiting list" + hint_text: "" + question_text: "How long has the household been on the local authority waiting list for the area of the new letting?" + reason_for_leaving_last_settled_home: + page_header: "" + reason: + check_answer_label: "Reason for leaving last settled home" + hint_text: "The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living previously." + question_text: "What is the tenant’s main reason for the household leaving their last settled home?" + reasonother: + check_answer_label: "" + hint_text: "" + question_text: "What is the reason?" + + prevten: + renewal: + page_header: "" + check_answer_label: "Where was the household immediately before this letting?" + hint_text: "You told us this letting is a renewal. We have removed some options because of this.

This is where the household was the night before they moved into this new let." + question_text: "Where was the household immediately before this letting?" + not_renewal: + page_header: "" + check_answer_label: "Where was the household immediately before this letting?" + hint_text: "This is where the household was the night before they moved into this new let." + question_text: "Where was the household immediately before this letting?" + + homeless: + page_header: "" + check_answer_label: "Household homeless immediately before letting" + hint_text: "" + question_text: "Did the household experience homelessness immediately before this letting?" + + previous_postcode: + page_header: "" + ppcodenk: + check_answer_label: "" + hint_text: "This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless." + question_text: "Do you know the postcode of the household’s last settled accommodation?" + ppostcode_full: + check_answer_label: "Postcode of household’s last settled accommodation" + hint_text: "" + question_text: "Postcode for the previous accommodation" + + previous_local_authority: + page_header: "" + previous_la_known: + check_answer_label: "" + hint_text: "This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless." + question_text: "Do you know the local authority of the household’s last settled accommodation?" + prevloc: + check_answer_label: "Location of household’s last settled accommodation" + hint_text: "Select ‘Northern Ireland’, ‘Scotland’, ‘Wales’ or ‘Outside the UK’ if the household’s last settled home was outside England." + question_text: "Select a local authority" + + reasonpref: + page_header: "" + check_answer_label: "Household given reasonable preference" + hint_text: "Households may be given ‘reasonable preference’ for social housing under one or more specific categories by the local authority. This is also known as ‘priority need’." + question_text: "Was the household given ‘reasonable preference’ by the local authority?" + + reasonable_preference_reason: + page_header: "" + check_answer_label: "Reason for reasonable preference" + hint_text: "Select all that apply." + question_text: "Why was the household given ‘reasonable preference’?" + + letting_allocation: + page_header: "" + check_answer_label: "Allocation system" + hint_text: "Select all that apply." + question_text: "How was this letting allocated?" + + referral: + supported_housing: + prp: + page_header: "" + check_answer_label: "Source of referral for letting" + hint_text: "" + question_text: "What was the source of referral for this letting?" + la: + page_header: "" + check_answer_label: "Source of referral for letting" + hint_text: "You told us that you are a local authority. We have removed some options because of this." + question_text: "What was the source of referral for this letting?" + general_needs: + prp: + page_header: "" + check_answer_label: "Source of referral for letting" + hint_text: "You told us that the needs type is general needs. We have removed some options because of this." + question_text: "What was the source of referral for this letting?" + la: + page_header: "" + check_answer_label: "Source of referral for letting" + hint_text: "You told us that you are a local authority and that the needs type is general needs. We have removed some options because of this." + question_text: "What was the source of referral for this letting?" diff --git a/config/locales/forms/2025/lettings/income_and_benefits.en.yml b/config/locales/forms/2025/lettings/income_and_benefits.en.yml new file mode 100644 index 000000000..55e193ff7 --- /dev/null +++ b/config/locales/forms/2025/lettings/income_and_benefits.en.yml @@ -0,0 +1,108 @@ +en: + forms: + 2025: + lettings: + income_and_benefits: + net_income_known: + page_header: "Household’s combined income after tax" + check_answer_label: "Do you know the household’s combined total income after tax?" + hint_text: "" + question_text: "Do you know the household’s combined income after tax?" + + income_amount: + page_header: "Total household income" + incfreq: + check_answer_label: "How often does the household receive this amount?" + hint_text: "" + question_text: "How often does the household receive this amount?" + earnings: + check_answer_label: "Total household income" + hint_text: "" + question_text: "How much income does the household have in total?" + + hb: + page_header: "" + check_answer_label: "Housing-related benefits received" + hint_text: "This is about when the tenant is in their new let. If they are unsure about the situation for their new let and their financial and working situation hasn’t changed significantly, answer based on what housing-related benefits they currently receive." + question_text: "Is the household likely to be receiving any of these housing-related benefits?" + + benefits: + page_header: "" + check_answer_label: "Household income from Universal Credit, state pension or benefit" + hint_text: "This excludes child and housing benefit, council tax support and tax credits." + question_text: "How much of the household’s income is from Universal Credit, state pensions or benefits?" + + household_charge: + page_header: "" + check_answer_label: "Does the household pay rent or charges" + hint_text: "If rent is charged on the property then answer Yes to this question, even if the tenants do not pay it themselves." + question_text: "Does the household pay rent or other charges for the accommodation?" + + period: + page_header: "" + check_answer_label: "Frequency of household rent and charges" + hint_text: "Select how often the household is charged. This may be different to how often they pay." + question_text: "How often does the household pay rent and other charges?" + + care_home: + page_header: "" + is_carehome: + check_answer_label: "Care home accommodation" + hint_text: "" + question_text: "Is this accommodation a care home?" + chcharge_weekly: + check_answer_label: "Care home charges" + hint_text: "" + question_text: "How much does the household pay every week?" + chcharge_bi_weekly: + check_answer_label: "Care home charges" + hint_text: "" + question_text: "How much does the household pay every 2 weeks?" + chcharge_4_weekly: + check_answer_label: "Care home charges" + hint_text: "" + question_text: "How much does the household pay every 4 weeks?" + chcharge_monthly: + check_answer_label: "Care home charges" + hint_text: "" + question_text: "How much does the household pay every month?" + + rent_and_charges: + page_header: "Household rent and charges" + brent: + check_answer_label: "Basic rent" + hint_text: "This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent." + question_text: "What is the basic rent?" + scharge: + check_answer_label: "Service charge" + hint_text: "For example, for cleaning. Households may receive housing benefit or Universal Credit towards the service charge." + question_text: "What is the service charge?" + pscharge: + check_answer_label: "Personal service charge" + hint_text: "For example, for heating or hot water. This doesn’t include housing benefit or Universal Credit." + question_text: "What is the personal service charge?" + supcharg: + check_answer_label: "Support charge" + hint_text: "Any charges made to fund support services included in tenancy agreement." + question_text: "What is the support charge?" + tcharge: + check_answer_label: "Household rent and charges" + hint_text: "This is the total for rent and all charges." + question_text: "Total charge" + + hbrentshortfall: + page_header: "" + check_answer_label: "Any outstanding amount for basic rent and charges" + hint_text: "Also known as the ‘outstanding amount’." + question_text: "After the household has received any housing-related benefits, will they still need to pay for rent and charges?" + + outstanding_amount: + page_header: "" + tshortfall_known: + check_answer_label: "Do you know the outstanding amount?" + hint_text: "You only need to give an approximate figure." + question_text: "Can you estimate the outstanding amount?" + tshortfall: + check_answer_label: "Estimated outstanding amountt" + hint_text: "Also known as the ‘outstanding amount’." + question_text: "Estimated outstanding amount" diff --git a/config/locales/forms/2025/lettings/property_information.en.yml b/config/locales/forms/2025/lettings/property_information.en.yml new file mode 100644 index 000000000..bf3f3532c --- /dev/null +++ b/config/locales/forms/2025/lettings/property_information.en.yml @@ -0,0 +1,127 @@ +en: + forms: + 2025: + lettings: + property_information: + first_time_property_let_as_social_housing: + page_header: "" + check_answer_label: "First time being let as social-housing?" + hint_text: "" + question_text: "Is this the first time the property has been let as social housing?" + + uprn: + page_header: "" + uprn_known: + check_answer_label: "UPRN known?" + hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

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

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

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

Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission." + question_text: "Is this letting in sheltered accommodation?" diff --git a/config/locales/forms/2025/sales/guidance.en.yml b/config/locales/forms/2025/sales/guidance.en.yml new file mode 100644 index 000000000..4ed6796b3 --- /dev/null +++ b/config/locales/forms/2025/sales/guidance.en.yml @@ -0,0 +1,46 @@ +en: + forms: + 2025: + sales: + guidance: + shared_ownership_type_definitions: + title: "Shared Ownership Type Definitions" + content: "

Shared Ownership (old model lease): Cannot be used for homes funded through the Affordable Homes Programme 2021 to 2026. Use the new model lease for these properties.

+

Shared Ownership (new model lease): Homes bought using the Affordable Homes Programme 2021 to 2026.

+

Social HomeBuy — shared ownership purchase: Tenants of private registered providers purchase their home at discount on Shared Ownership terms.

+

Home Ownership for people with Long-Term Disabilities (HOLD): A shared ownership sale for those with long term disabilities.

+

Older Persons Shared Ownership: A type of shared ownership for those 55 years and over.

+

Rent to Buy — Shared Ownership: A sale following a period of discounted rent.

+

Right to Shared Ownership (RtSO): A sale of a share of a rented home to a tenant using this scheme.

+

London Living Rent — Shared Ownership: A shared ownership sale following a period of discounted rent as part of the London Living Rent scheme.

" + + discounted_ownership_type_definitions: + title: "Discounted Ownership Type Definitions" + content: "

Right to Acquire (RTA): a discounted sale of a property built or purchased after 31 March 1997 to tenants of a private registered provider.

+

Preserved Right to Buy (PRTB): a discounted sale of a property that used to be owned by a council to tenants of a private registered provider.

+

Voluntary Right to Buy (VRTB): a discounted sale to tenants in this PRP owned property, as part of a pilot scheme.

+

Right to Buy (RTB): a discounted sale to tenants in this council owned property.

+

Rent to Buy full ownership: a sale on full ownership terms following a period of discounted rent.

+

Social HomeBuy for outright purchase: a discounted sale to tenants of a private registered provider on full ownership terms.

+

Any other equity loan scheme: any scheme, not covered elsewhere, in which a loan is used to purchase equity.

" + + mortgage_lender: + title: "Can’t find the mortgage lender you’re looking for?" + content: "
    +
  • Double check the spelling and try again
  • +
  • Type the first few letters to see the suggestions
  • +
  • Type Other and continue - we’ll ask you to type in your answer in the next question
  • +
" + + outright_sale_type_definitions: + title: "Outright sale type definitions" + content: "

Outright sale: the full purchase of a property, usually with a mortgage or cash.

+

Other sale: any sale which does not fit the criteria of any of the remaining options.

" + + privacy_notice_buyer_joint_purchase: + content: "Make sure the buyers have seen or been given access to %{privacy_notice_link} before completing this log. This is a legal requirement under data protection legislation." + privacy_notice_link_text: "the Ministry of Housing, Communities and Local Government (MHCLG) privacy notice" + + privacy_notice_buyer: + content: "Make sure the buyer has seen or been given access to %{privacy_notice_link} before completing this log. This is a legal requirement under data protection legislation." + privacy_notice_link_text: "the Ministry of Housing, Communities and Local Government (MHCLG) privacy notice" diff --git a/config/locales/forms/2025/sales/household_characteristics.en.yml b/config/locales/forms/2025/sales/household_characteristics.en.yml new file mode 100644 index 000000000..b92cba2de --- /dev/null +++ b/config/locales/forms/2025/sales/household_characteristics.en.yml @@ -0,0 +1,345 @@ +en: + forms: + 2025: + 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/2025/sales/household_needs.en.yml b/config/locales/forms/2025/sales/household_needs.en.yml new file mode 100644 index 000000000..1908ba6ca --- /dev/null +++ b/config/locales/forms/2025/sales/household_needs.en.yml @@ -0,0 +1,34 @@ +en: + forms: + 2025: + sales: + household_needs: + hhregres: + page_header: "" + check_answer_label: "Have any of the buyers ever served as a regular in the UK armed forces?" + hint_text: "A regular is somebody who has served in the Royal Navy, the Royal Marines, the Royal Airforce or Army full time and does not include reserve forces" + question_text: "Have any of the buyers ever served as a regular in the UK armed forces?" + + hhregresstill: + page_header: "" + check_answer_label: "Are they still serving in the UK armed forces?" + hint_text: "" + question_text: "Is the buyer still serving in the UK armed forces?" + + armedforcesspouse: + page_header: "" + check_answer_label: "Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?" + hint_text: "" + question_text: "Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?" + + disabled: + page_header: "" + check_answer_label: "Does anyone in the household have a disability?" + hint_text: "This includes any long-term health condition that has an impact on the person's day-to-day life" + question_text: "Does anyone in the household consider themselves to have a disability?" + + wheel: + page_header: "" + check_answer_label: "Does anyone in the household use a wheelchair?" + hint_text: "This can be inside or outside the home" + question_text: "Does anyone in the household use a wheelchair?" diff --git a/config/locales/forms/2025/sales/household_situation.en.yml b/config/locales/forms/2025/sales/household_situation.en.yml new file mode 100644 index 000000000..3aa3545d8 --- /dev/null +++ b/config/locales/forms/2025/sales/household_situation.en.yml @@ -0,0 +1,50 @@ +en: + forms: + 2025: + sales: + household_situation: + prevten: + page_header: "" + check_answer_label: "Buyer 1’s previous tenure" + hint_text: "" + question_text: "What was buyer 1’s previous tenure?" + + last_accommodation: + page_header: "" + ppcodenk: + check_answer_label: "Buyer 1’s last settled accommodation" + hint_text: "This is also known as the household’s 'last settled home'" + question_text: "Do you know the postcode of buyer 1’s last settled accommodation?" + ppostcode_full: + check_answer_label: "Postcode of buyer 1’s last settled accommodation" + hint_text: "" + question_text: "Postcode" + + last_accommodation_la: + page_header: "" + previous_la_known: + check_answer_label: "Local authority of buyer 1’s last settled accommodation" + hint_text: "This is also known as the household’s 'last settled home'" + question_text: "Do you know the local authority of buyer 1’s last settled accommodation?" + prevloc: + check_answer_label: "Local authority of buyer 1’s last settled accommodation" + hint_text: "" + question_text: "Select a local authority" + + buyers_organisations: + page_header: "" + check_answer_label: "Organisations buyers were registered with" + hint_text: "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue." + question_text: "What organisations were the buyers registered with?" + + buy2living: + page_header: "" + check_answer_label: "Buyer 2 living at the same address" + hint_text: "" + question_text: "At the time of purchase, was buyer 2 living at the same address as buyer 1?" + + prevtenbuy2: + page_header: "" + check_answer_label: "Buyer 2’s previous tenure" + hint_text: "" + question_text: "What was buyer 2’s previous tenure?" diff --git a/config/locales/forms/2025/sales/income_benefits_and_savings.en.yml b/config/locales/forms/2025/sales/income_benefits_and_savings.en.yml new file mode 100644 index 000000000..20beb0b85 --- /dev/null +++ b/config/locales/forms/2025/sales/income_benefits_and_savings.en.yml @@ -0,0 +1,90 @@ +en: + forms: + 2025: + sales: + income_benefits_and_savings: + buyer_1_income: + page_header: "" + income1nk: + check_answer_label: "Buyer 1’s gross annual income known?" + hint_text: "" + question_text: "Do you know buyer 1’s annual income?" + income1: + check_answer_label: "Buyer 1’s gross annual income" + hint_text: "Provide the gross annual income (i.e. salary before tax) plus the annual amount of benefits, Universal Credit or pensions, and income from investments." + question_text: "Buyer 1’s gross annual income" + + inc1mort: + page_header: "" + check_answer_label: "Buyer 1’s income used for mortgage application" + hint_text: "" + question_text: "Was buyer 1’s income used for a mortgage application?" + + buyer_2_income: + page_header: "" + income2nk: + check_answer_label: "Buyer 2’s gross annual income known?" + hint_text: "" + question_text: "Do you know buyer 2’s annual income?" + income2: + check_answer_label: "Buyer 2’s gross annual income" + hint_text: "Provide the gross annual income (i.e. salary before tax) plus the annual amount of benefits, Universal Credit or pensions, and income from investments." + question_text: "Buyer 2’s gross annual income" + + inc2mort: + page_header: "" + check_answer_label: "Buyer 2’s income used for mortgage application" + hint_text: "" + question_text: "Was buyer 2’s income used for a mortgage application?" + + housing_benefits: + joint_purchase: + page_header: "" + check_answer_label: "Housing-related benefits buyers received before buying this property" + hint_text: "" + question_text: "Were the buyers receiving any of these housing-related benefits immediately before buying this property?" + not_joint_purchase: + page_header: "" + check_answer_label: "Housing-related benefits buyer received before buying this property" + hint_text: "" + question_text: "Was the buyer receiving any of these housing-related benefits immediately before buying this property?" + + savings: + joint_purchase: + page_header: "" + savingsnk: + check_answer_label: "Buyers’ total savings known?" + hint_text: "" + question_text: "Do you know how much the 'buyers' had in savings before they paid any deposit for the property?" + savings: + check_answer_label: "Buyers’ total savings before any deposit paid" + hint_text: "Include any savings, investments, ISAs, premium bonds, shares, or money held in a bank or building society account." + question_text: "Enter their total savings to the nearest £10" + not_joint_purchase: + page_header: "" + savingsnk: + check_answer_label: "Buyer’s total savings known?" + hint_text: "" + question_text: "Do you know how much the buyer had in savings before they paid any deposit for the property?" + savings: + check_answer_label: "Buyer’s total savings before any deposit paid" + hint_text: "Include any savings, investments, ISAs, premium bonds, shares, or money held in a bank or building society account." + question_text: "Enter their total savings to the nearest £10" + + prevown: + joint_purchase: + page_header: "" + check_answer_label: "Buyers previously owned a property." + hint_text: "" + question_text: "Have any of the buyers previously owned a property?" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer previously owned a property." + hint_text: "" + question_text: "Has the buyer previously owned a property?" + + prevshared: + page_header: "" + check_answer_label: "Previous property shared ownership?" + hint_text: "For any buyer" + question_text: "Was the previous property under shared ownership?" diff --git a/config/locales/forms/2025/sales/property_information.en.yml b/config/locales/forms/2025/sales/property_information.en.yml new file mode 100644 index 000000000..240c96f09 --- /dev/null +++ b/config/locales/forms/2025/sales/property_information.en.yml @@ -0,0 +1,91 @@ +en: + forms: + 2025: + sales: + property_information: + uprn: + page_header: "" + uprn_known: + check_answer_label: "UPRN known?" + hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

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

If you don’t know the UPRN you can enter the address of the property instead on the next screen." + question_text: "Do you know the property's UPRN?" + uprn: + check_answer_label: "UPRN" + hint_text: "" + question_text: "What is the property's UPRN?" + + uprn_confirmed: + page_header: "We found an address that might be this property" + check_answer_label: "Is this the right address?" + hint_text: "" + question_text: "Is this the property address?" + + address_matcher: + page_header: "Find an address" + address_line1_input: + check_answer_label: "Find address" + hint_text: "" + question_text: "Address line 1" + postcode_full_input: + check_answer_label: "" + hint_text: "" + question_text: "Postcode" + + uprn_selection: + page_header: "We found an address that might be this property" + check_answer_label: "Select the correct address" + hint_text: "" + question_text: "Select the correct address" + + address: + page_header: "Q12 - What is the property's address?" + address_line1: + check_answer_label: "Address lines 1 and 2" + hint_text: "" + question_text: "Address line 1" + address_line2: + check_answer_label: "" + hint_text: "" + question_text: "Address line 2 (optional)" + town_or_city: + check_answer_label: "Town or city" + hint_text: "" + question_text: "Town or city" + county: + check_answer_label: "County" + hint_text: "" + question_text: "County (optional)" + postcode_full: + check_answer_label: "Postcode" + hint_text: "" + question_text: "Postcode" + + la: + page_header: "" + check_answer_label: "Local authority" + hint_text: "" + question_text: "What is the property’s local authority?" + + beds: + page_header: "" + check_answer_label: "Number of bedrooms" + hint_text: "A bedsit has 1 bedroom." + question_text: "How many bedrooms does the property have?" + + proptype: + page_header: "" + check_answer_label: "Type of unit" + hint_text: "" + question_text: "What type of unit is the property?" + + builtype: + page_header: "" + check_answer_label: "Type of building" + hint_text: "" + question_text: "What type of building is the property?" + + wchair: + page_header: "" + check_answer_label: "Property built or adapted to wheelchair-user standards" + hint_text: "This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property." + question_text: "Is the property built or adapted to wheelchair-user standards?" diff --git a/config/locales/forms/2025/sales/sale_information.en.yml b/config/locales/forms/2025/sales/sale_information.en.yml new file mode 100644 index 000000000..51270a92e --- /dev/null +++ b/config/locales/forms/2025/sales/sale_information.en.yml @@ -0,0 +1,206 @@ +en: + forms: + 2025: + sales: + sale_information: + living_before_purchase: + joint_purchase: + page_header: "" + proplen: + check_answer_label: "Number of years living in the property before purchase" + hint_text: "You should round up to the nearest year" + question_text: "How long did they live there?" + proplen_asked: + check_answer_label: "Buyers lived in the property before purchasing" + hint_text: "" + question_text: "Did the buyers live in the property before purchasing it?" + not_joint_purchase: + page_header: "" + proplen: + check_answer_label: "Number of years living in the property before purchase" + hint_text: "You should round up to the nearest year" + question_text: "How long did they live there?" + proplen_asked: + check_answer_label: "Buyer lived in the property before purchasing" + hint_text: "" + question_text: "Did the buyer live in the property before purchasing it?" + + staircasing: + page_header: "" + check_answer_label: "Staircasing transaction" + hint_text: "A staircasing transaction is when the household purchases more shares in their property, increasing the proportion they own and decreasing the proportion the housing association owns. Once the household purchases 100% of the shares, they own the property" + question_text: "Is this a staircasing transaction?" + about_staircasing: + page_header: "About the staircasing transaction" + stairbought: + check_answer_label: "Percentage bought in this staircasing transaction" + hint_text: "" + question_text: "What percentage of the property has been bought in this staircasing transaction?" + stairowned: + joint_purchase: + check_answer_label: "Percentage the buyers now own in total" + hint_text: "" + question_text: "What percentage of the property do the buyers now own in total?" + not_joint_purchase: + check_answer_label: "Percentage the buyer now owns in total" + hint_text: "" + question_text: "What percentage of the property does the buyer now own in total?" + staircasesale: + check_answer_label: "Part of a back-to-back staircasing transaction" + hint_text: "" + question_text: "Is this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?" + + resale: + page_header: "" + check_answer_label: "Is this a resale?" + hint_text: "If the social landlord has previously sold the property to another buyer and is now reselling the property, select 'yes'. If this is the first time the property has been sold, select 'no'." + question_text: "Is this a resale?" + + exchange_date: + page_header: "" + check_answer_label: "Exchange of contracts date" + hint_text: "" + question_text: "What is the exchange of contracts date?" + + handover_date: + page_header: "" + check_answer_label: "Practical completion or handover date" + hint_text: "This is the date on which the building contractor hands over responsibility for the completed property to the private registered provider (PRP)" + question_text: "What is the practical completion or handover date?" + + la_nominations: + page_header: "" + check_answer_label: "Household rehoused under a local authority nominations agreement?" + hint_text: "A local authority nominations agreement is a written agreement between a local authority and private registered provider (PRP) that some or all of its sales vacancies are offered to local authorities for rehousing" + question_text: "Was the household rehoused under a 'local authority nominations agreement'?" + + soctenant: + joint_purchase: + page_header: "" + check_answer_label: "Any buyers were registered providers, housing association or local authority tenants immediately before this sale?" + hint_text: "" + question_text: "Were any of the buyers private registered providers, housing association or local authority tenants immediately before this sale?" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer was a registered provider, housing association or local authority tenant immediately before this sale?" + hint_text: "" + question_text: "Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?" + + frombeds: + page_header: "About the buyers’ previous property" + check_answer_label: "Number of bedrooms in previous property" + hint_text: "For bedsits enter 1" + question_text: "How many bedrooms did the property have?" + + fromprop: + page_header: "" + check_answer_label: "Previous property type" + hint_text: "" + question_text: "What was the previous property type?" + + socprevten: + page_header: "" + check_answer_label: "Previous property tenure" + hint_text: "" + question_text: "What was the previous tenure of the buyer?" + + value: + page_header: "About the price of the property" + check_answer_label: "Full purchase price" + hint_text: "Enter the full purchase price of the property before any discounts are applied. For shared ownership, enter the full purchase price paid for 100% equity (this is equal to the value of the share owned by the PRP plus the value bought by the purchaser)" + question_text: "What was the full purchase price?" + + equity: + page_header: "About the price of the property" + check_answer_label: "Initial percentage equity stake" + hint_text: "Enter the amount of initial equity held by the purchaser (for example, 25% or 50%)" + question_text: "What was the initial percentage equity stake purchased?" + + mortgageused: + page_header: "Mortgage Amount" + check_answer_label: "Mortgage used" + hint_text: "" + question_text: "Was a mortgage used for the purchase of this property?" + + mortgage: + page_header: "Mortgage Amount" + check_answer_label: "Mortgage amount" + hint_text: "Enter the amount of mortgage agreed with the mortgage lender. Exclude any deposits or cash payments. Numeric in pounds. Rounded to the nearest pound." + question_text: "What is the mortgage amount?" + + mortgagelender: + page_header: "" + check_answer_label: "Mortgage lender" + hint_text: "" + question_text: "What is the name of the mortgage lender?" + + mortgagelenderother: + page_header: "" + check_answer_label: "Other Mortgage Lender" + hint_text: "" + question_text: "What is the other mortgage lender?" + + mortlen: + page_header: "" + check_answer_label: "Length of mortgage" + hint_text: "You should round up to the nearest year. Value should not exceed 60 years." + question_text: "What is the length of the mortgage?" + + extrabor: + page_header: "" + check_answer_label: "Any other borrowing?" + hint_text: "" + question_text: "Does this include any extra borrowing?" + + deposit: + page_header: "About the deposit" + check_answer_label: "Deposit amount" + hint_text: "Enter the total cash sum paid by the buyer towards the property that was not funded by the mortgage. This excludes any grant or loan. As this is a fully staircased sale this question is optional. If you do not have the information available click save and continue" + question_text: "How much cash deposit was paid on the property?" + + cashdis: + page_header: "About the deposit" + check_answer_label: "Cash discount through SocialHomeBuy" + hint_text: "Enter the total cash discount given on the property being purchased through the Social HomeBuy scheme" + question_text: "How much cash discount was given through Social HomeBuy?" + + mrent: + page_header: "" + check_answer_label: "Monthly rent" + hint_text: "Amount paid before any charges" + question_text: "What is the basic monthly rent?" + + leaseholdcharges: + page_header: "" + has_mscharge: + check_answer_label: "Does the property have any monthly leasehold charges?" + hint_text: "For example, service and management charges" + question_text: "Does the property have any monthly leasehold charges?" + mscharge: + check_answer_label: "Monthly leasehold charges" + hint_text: "" + question_text: "Enter the total monthly charge" + + purchase_price: + discounted_ownership: + page_header: "About the price of the property" + check_answer_label: "Purchase price" + hint_text: "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount" + question_text: "What is the full purchase price?" + outright_sale: + page_header: "About the price of the property" + check_answer_label: "Purchase price" + hint_text: "" + question_text: "What is the full purchase price?" + + discount: + page_header: "About the price of the property" + check_answer_label: "Percentage discount" + hint_text: "For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)

If discount capped, enter capped %

If the property is being sold to an existing tenant under the RTB, PRTB, or VRTB schemes, enter the % discount from the full market value that is being given." + question_text: "What was the percentage discount?" + + grant: + page_header: "About the price of the property" + check_answer_label: "Amount of any loan, grant or subsidy" + hint_text: "For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy" + question_text: "What was the amount of any loan, grant, discount or subsidy given?" diff --git a/config/locales/forms/2025/sales/setup.en.yml b/config/locales/forms/2025/sales/setup.en.yml new file mode 100644 index 000000000..4f00ab0c2 --- /dev/null +++ b/config/locales/forms/2025/sales/setup.en.yml @@ -0,0 +1,110 @@ +en: + forms: + 2025: + sales: + setup: + owning_organisation_id: + page_header: "" + check_answer_label: "Owning organisation" + hint_text: "" + question_text: "Which organisation owns this log?" + + managing_organisation_id: + page_header: "" + check_answer_label: "Reported by" + hint_text: "" + question_text: "Which organisation is reporting this sale?" + + assigned_to_id: + page_header: "" + check_answer_label: "Log owner" + hint_text: "" + question_text: "Which user are you creating this log for?" + + saledate: + page_header: "" + check_answer_label: "Sale completion date" + hint_text: "" + question_text: "What is the sale completion date?" + + purchid: + page_header: "" + check_answer_label: "Purchaser code" + hint_text: "This is how you usually refer to the purchaser on your own systems." + question_text: "What is the purchaser code?" + + ownershipsch: + page_header: "" + check_answer_label: "Purchase made under ownership scheme" + hint_text: "" + question_text: "Was this purchase made through an ownership scheme?" + + type: + shared_ownership: + page_header: "Type of shared ownership sale" + check_answer_label: "Type of shared ownership sale" + hint_text: "When the purchaser buys an initial share of up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion, or a subsequent staircasing transaction" + question_text: "What is the type of shared ownership sale?" + discounted_ownership: + page_header: "Type of discounted ownership sale" + check_answer_label: "Type of discounted ownership sale" + hint_text: "" + question_text: "What is the type of discounted ownership sale?" + outright_ownership: + page_header: "Type of outright sale" + type: + check_answer_label: "Type of outright sale" + hint_text: "" + question_text: "What is the type of outright sale?" + othtype: + check_answer_label: "Type of other sale" + hint_text: "" + question_text: "What type of sale is it?" + + companybuy: + page_header: "" + check_answer_label: "Company buyer" + hint_text: "" + question_text: "Is the buyer a company?" + + buylivein: + page_header: "" + check_answer_label: "Buyers living in property" + hint_text: "" + question_text: "Will any buyers live in the property?" + + jointpur: + page_header: "" + check_answer_label: "Joint purchase" + hint_text: "This is where two or more people are named as legal owners of the property after the purchase" + question_text: "Is this a joint purchase?" + + jointmore: + page_header: "" + check_answer_label: "More than 2 joint buyers" + hint_text: "" + question_text: "Are there more than 2 joint buyers of this property?" + + 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: "Ministry of Housing, Communities and Local Government privacy notice" + check_answer_label: "Buyers have seen the privacy notice?" + hint_text: "" + question_text: "Declaration" + not_joint_purchase: + page_header: "Ministry of Housing, Communities and Local Government privacy notice" + check_answer_label: "Buyer has seen the privacy notice?" + hint_text: "" + question_text: "Declaration" diff --git a/config/locales/forms/2025/sales/soft_validations.en.yml b/config/locales/forms/2025/sales/soft_validations.en.yml new file mode 100644 index 000000000..c8f0990ba --- /dev/null +++ b/config/locales/forms/2025/sales/soft_validations.en.yml @@ -0,0 +1,244 @@ +en: + forms: + 2025: + sales: + soft_validations: + 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: + 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: "" + check_answer_label: "Combined income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us the combined income of this household is %{combined_income}. This seems high. Are you sure this is correct?" + + mortgage_value_check: + page_header: "" + check_answer_label: "Mortgage confirmation" + hint_text: "" + question_text: "Are you sure that the mortgage is more than 5 times the income used for the mortgage application?" + title_text: "You told us that the mortgage amount is %{mortgage}." + informative_text: "This is more than 5 times the income, which is higher than we would expect." + + savings_value_check: + page_header: "" + check_answer_label: "Savings confirmation" + hint_text: "" + question_text: "Are you sure the savings are higher than £100,000?" + joint_purchase: + title_text: "You told us the buyers’ savings were %{savings}." + informative_text: "This is higher than we would expect." + not_joint_purchase: + title_text: "You told us the buyer’s savings were %{savings}." + informative_text: "This is higher than we would expect." + + staircase_bought_value_check: + page_header: "" + check_answer_label: "Percentage bought confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that %{percentage}% was bought in this staircasing transaction." + informative_text: "Most staircasing transactions are less than 50%" + + stairowned_value_check: + joint_purchase: + page_header: "" + check_answer_label: "Percentage owned confirmation" + hint_text: "" + question_text: "Are you sure?" + title_text: "You told us that the buyers now own %{stairowned} of the property." + informative_text: "The maximum percentage that can be owned under the Older Persons Shared Ownership scheme is 75%, unless the property was funded outside the Affordable Homes Programme. Make sure these answers are correct." + not_joint_purchase: + page_header: "" + check_answer_label: "Percentage owned confirmation" + hint_text: "" + question_text: "Are you sure?" + title_text: "You told us that the buyer now owns %{stairowned} of the property." + informative_text: "The maximum percentage that can be owned under the Older Persons Shared Ownership scheme is 75%, unless the property was funded outside the Affordable Homes Programme. Make sure these answers are correct." + + hodate_check: + page_header: "" + check_answer_label: "Practical completion or handover date check" + hint_text: "" + question_text: "Are you sure?" + title_text: "You told us practical completion or handover date is more than 3 years before sale completion date." + + value_value_check: + page_header: "" + check_answer_label: "Purchase price confirmation" + hint_text: "" + question_text: "Are you sure?" + title_text: "You told us the purchase price is %{value}." + informative_text: "This is %{higher_or_lower} than we would expect." + + shared_ownership_deposit_value_check: + page_header: "" + check_answer_label: "Shared ownership deposit confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that the %{mortgage_deposit_and_discount_error_fields} add up to %{mortgage_deposit_and_discount_total}." + + deposit_value_check: + joint_purchase: + page_header: "" + check_answer_label: "Deposit confirmation" + hint_text: "" + question_text: "Are you sure that the deposit is this much higher than the buyer's savings?" + title_text: "You told us the buyers’ deposit was %{deposit} and their savings were %{savings}." + informative_text: "The deposit amount is higher than we would expect for the amount of savings they have." + not_joint_purchase: + page_header: "" + check_answer_label: "Deposit confirmation" + hint_text: "" + question_text: "Are you sure that the deposit is this much higher than the buyer's savings?" + title_text: "You told us the buyer’s deposit was %{deposit} and their savings were %{savings}." + informative_text: "The deposit amount is higher than we would expect for the amount of savings they have." + + address_search_value_check: + page_header: "" + check_answer_label: "" + hint_text: "" + question_text: "" + title_text: "No address found." + informative_text: "We could not find an address that matches your search. You can search again or continue to enter the address manually." + + wheel_value_check: + page_header: "" + check_answer_label: "Does anyone in the household use a wheelchair?" + 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?" + + monthly_charges_value_check: + page_header: "" + check_answer_label: "Monthly charges confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that the monthly charges were %{mscharge}." + informative_text: "This is higher than we would expect." + + extra_borrowing_value_check: + page_header: "" + check_answer_label: "Extra borrowing confirmation" + hint_text: "" + question_text: "Are you sure there is no extra borrowing?" + title_text: "You told us that the mortgage and deposit total is %{mortgage_and_deposit_total}." + informative_text: "This is higher than the purchase price minus the discount." + + percentage_discount_value_check: + page_header: "" + check_answer_label: "Percentage discount confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that the percentage discount is %{discount}." + informative_text: "This is higher than we would expect." + + grant_value_check: + page_header: "" + check_answer_label: "Grant value confirmation" + hint_text: "" + question_text: "Are you sure? Grants are usually £9,000 - £16,000" + title_text: "You told us that the grant amount is %{grant}." + informative_text: "Loans, grants and subsidies are usually between £9,000 and £16,000." + + discounted_sale_value_check: + page_header: "" + check_answer_label: "Discounted sale value confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + 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}." + + deposit_and_mortgage_value_check: + page_header: "" + check_answer_label: "Deposit and mortgage against discount confirmation" + hint_text: "" + question_text: "Are you sure? Mortgage and deposit usually equal or are more than (value - discount)" + title_text: "You told us the mortgage amount was %{mortgage}, the cash deposit was %{deposit} and the discount was %{discount}." + informative_text: "We would expect the mortgage amount and the deposit added together to be the same as the purchase price minus the discount." diff --git a/spec/helpers/filters_helper_spec.rb b/spec/helpers/filters_helper_spec.rb index b709a16ac..ce60d07f7 100644 --- a/spec/helpers/filters_helper_spec.rb +++ b/spec/helpers/filters_helper_spec.rb @@ -517,12 +517,46 @@ RSpec.describe FiltersHelper do allow(Time).to receive(:now).and_return(Time.zone.local(2024, 5, 1)) end - it "has the correct options" do - expect(collection_year_options).to eq( - { - "2024" => "2024 to 2025", "2023" => "2023 to 2024", "2022" => "2022 to 2023" - }, - ) + context "and in crossover period" do + before do + allow(FormHandler.instance).to receive(:in_crossover_period?).and_return(true) + end + + it "has the correct options" do + expect(collection_year_options).to eq( + { + "2024" => "2024 to 2025", "2023" => "2023 to 2024", "2022" => "2022 to 2023" + }, + ) + end + end + + context "and not in crossover period" do + before do + allow(FormHandler.instance).to receive(:in_crossover_period?).and_return(false) + end + + it "has the correct options" do + expect(collection_year_options).to eq( + { + "2024" => "2024 to 2025", "2023" => "2023 to 2024" + }, + ) + end + + context "with future form use turned on" do + before do + allow(FeatureToggle).to receive(:allow_future_form_use?).and_return(true) + end + + it "includes next year in the options" do + expect(collection_year_options).to eq( + { + "2025" => "2025 to 2026", "2024" => "2024 to 2025", "2023" => "2023 to 2024" + }, + ) + end + end end end end From 6fb29ade6bd434cc130c5ec558ee8fa37676da30 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Thu, 7 Nov 2024 15:54:42 +0000 Subject: [PATCH 3/9] CLDC-3712: Sales Form Updates (#2756) --- .../lettings_log_variables.rb | 4 +- .../derived_variables/sales_log_variables.rb | 4 +- app/models/form.rb | 6 +- .../lettings/pages/lead_tenant_nationality.rb | 4 +- .../pages/property_local_authority.rb | 4 +- app/models/form/lettings/pages/uprn.rb | 4 +- app/models/form/lettings/questions/age.rb | 2 +- .../form/lettings/questions/declaration.rb | 6 +- .../form/lettings/questions/ethnic_white.rb | 2 +- ...rst_time_property_let_as_social_housing.rb | 4 +- .../lettings/questions/housingneeds_other.rb | 2 +- .../form/lettings/questions/is_carehome.rb | 2 +- app/models/form/lettings/questions/layear.rb | 2 +- .../lettings/questions/letting_allocation.rb | 2 +- .../lettings/questions/person_relationship.rb | 2 +- .../lettings/questions/previous_let_type.rb | 2 +- app/models/form/lettings/questions/reason.rb | 2 +- .../form/lettings/questions/reason_renewal.rb | 2 +- .../form/lettings/questions/referral.rb | 2 +- .../form/lettings/questions/referral_prp.rb | 2 +- .../questions/referral_supported_housing.rb | 2 +- .../referral_supported_housing_prp.rb | 2 +- .../form/lettings/questions/rent_type.rb | 2 +- app/models/form/lettings/questions/rsnvac.rb | 2 +- .../form/lettings/questions/sheltered.rb | 2 +- .../questions/starter_tenancy_type.rb | 2 +- .../form/lettings/questions/tenancy_type.rb | 2 +- .../lettings/questions/uprn_confirmation.rb | 2 +- .../form/lettings/questions/waityear.rb | 2 +- .../subsections/household_characteristics.rb | 44 ++++++------- .../subsections/household_situation.rb | 2 +- .../subsections/property_information.rb | 4 +- app/models/form/lettings/subsections/setup.rb | 2 +- .../subsections/tenancy_information.rb | 2 +- .../form/sales/pages/buyer1_nationality.rb | 2 +- .../form/sales/pages/buyer2_nationality.rb | 2 +- app/models/form/sales/pages/buyer_previous.rb | 2 +- app/models/form/sales/pages/deposit.rb | 2 +- .../form/sales/pages/deposit_discount.rb | 2 +- app/models/form/sales/pages/la_nominations.rb | 2 +- .../form/sales/pages/last_accommodation.rb | 2 +- .../form/sales/pages/last_accommodation_la.rb | 2 +- .../form/sales/pages/managing_organisation.rb | 2 +- .../sales/pages/property_local_authority.rb | 4 +- app/models/form/sales/pages/uprn.rb | 4 +- .../buyer1_ethnic_background_white.rb | 2 +- .../buyer2_ethnic_background_white.rb | 2 +- .../buyer2_relationship_to_buyer1.rb | 2 +- .../form/sales/questions/buyer_previous.rb | 2 +- app/models/form/sales/questions/discount.rb | 2 +- .../form/sales/questions/mortgage_lender.rb | 2 +- .../form/sales/questions/mortgageused.rb | 2 +- .../form/sales/questions/ownership_scheme.rb | 2 +- .../person_relationship_to_buyer_1.rb | 2 +- .../form/sales/questions/privacy_notice.rb | 4 +- .../form/sales/questions/uprn_confirmation.rb | 2 +- .../subsections/household_characteristics.rb | 66 +++++++++---------- .../form/sales/subsections/outright_sale.rb | 4 +- .../sales/subsections/property_information.rb | 2 +- app/models/form/sales/subsections/setup.rb | 8 +-- .../subsections/shared_ownership_scheme.rb | 4 +- app/models/lettings_log.rb | 4 +- app/models/sales_log.rb | 6 +- .../validations/household_validations.rb | 10 +-- .../validations/property_validations.rb | 2 +- .../sales/financial_validations.rb | 4 +- .../sales/household_validations.rb | 12 ++-- .../validations/sales/property_validations.rb | 2 +- .../sales/sale_information_validations.rb | 18 ++--- .../validations/sales/soft_validations.rb | 4 +- app/models/validations/shared_validations.rb | 2 +- .../exports/lettings_log_export_service.rb | 4 +- ...ime_property_let_as_social_housing_spec.rb | 2 +- ...ead_tenant_ethnic_background_white_spec.rb | 2 +- .../form/lettings/pages/person_age_spec.rb | 2 +- .../pages/person_relationship_to_lead_spec.rb | 2 +- .../pages/previous_local_authority_spec.rb | 2 +- .../lettings/pages/previous_postcode_spec.rb | 2 +- .../pages/property_local_authority_spec.rb | 4 +- .../property_wheelchair_accessible_spec.rb | 2 +- .../form/lettings/pages/renewal_spec.rb | 2 +- .../form/lettings/pages/rent_type_spec.rb | 2 +- .../pages/starter_tenancy_type_spec.rb | 2 +- spec/models/form/lettings/pages/uprn_spec.rb | 4 +- .../lettings/questions/age1_known_spec.rb | 2 +- .../form/lettings/questions/age_spec.rb | 2 +- .../lettings/questions/declaration_spec.rb | 6 +- .../lettings/questions/ethnic_white_spec.rb | 4 +- ...ime_property_let_as_social_housing_spec.rb | 4 +- .../questions/gender_identity1_spec.rb | 2 +- .../models/form/lettings/questions/hb_spec.rb | 2 +- .../questions/housingneeds_other_spec.rb | 4 +- .../lettings/questions/is_carehome_spec.rb | 4 +- .../form/lettings/questions/joint_spec.rb | 2 +- .../form/lettings/questions/layear_spec.rb | 4 +- .../questions/letting_allocation_spec.rb | 4 +- .../questions/person_relationship_spec.rb | 2 +- .../form/lettings/questions/ppcodenk_spec.rb | 2 +- .../questions/previous_la_known_spec.rb | 2 +- .../questions/previous_let_type_spec.rb | 4 +- .../lettings/questions/reason_renewal_spec.rb | 4 +- .../form/lettings/questions/reason_spec.rb | 4 +- .../lettings/questions/reasonpref_spec.rb | 2 +- .../lettings/questions/referral_prp_spec.rb | 4 +- .../form/lettings/questions/referral_spec.rb | 4 +- .../referral_supported_housing_prp_spec.rb | 4 +- .../referral_supported_housing_spec.rb | 4 +- .../form/lettings/questions/renewal_spec.rb | 2 +- .../form/lettings/questions/rent_type_spec.rb | 6 +- .../form/lettings/questions/rsnvac_spec.rb | 4 +- .../form/lettings/questions/scheme_id_spec.rb | 2 +- .../form/lettings/questions/sheltered_spec.rb | 4 +- .../questions/starter_tenancy_type_spec.rb | 4 +- .../tenancy_length_affordable_rent_spec.rb | 2 +- .../tenancy_length_intermediate_rent_spec.rb | 2 +- .../lettings/questions/tenancy_type_spec.rb | 6 +- .../form/lettings/questions/waityear_spec.rb | 4 +- .../lettings/questions/wheelchair_spec.rb | 2 +- .../household_characteristics_spec.rb | 4 +- .../subsections/household_situation_spec.rb | 4 +- .../subsections/property_information_spec.rb | 4 +- .../form/lettings/subsections/setup_spec.rb | 4 +- .../subsections/tenancy_information_spec.rb | 4 +- .../buyer1_ethnic_background_arab_spec.rb | 2 +- .../buyer1_ethnic_background_asian_spec.rb | 2 +- .../buyer1_ethnic_background_black_spec.rb | 2 +- .../buyer1_ethnic_background_mixed_spec.rb | 2 +- .../buyer1_ethnic_background_white_spec.rb | 2 +- .../sales/pages/buyer1_ethnic_group_spec.rb | 2 +- .../pages/buyer1_live_in_property_spec.rb | 2 +- .../sales/pages/buyer1_nationality_spec.rb | 4 +- .../pages/buyer1_working_situation_spec.rb | 2 +- .../sales/pages/buyer2_nationality_spec.rb | 4 +- .../buyer2_relationship_to_buyer1_spec.rb | 2 +- .../form/sales/pages/buyer_interview_spec.rb | 4 +- .../form/sales/pages/buyer_live_spec.rb | 2 +- .../form/sales/pages/buyer_previous_spec.rb | 2 +- .../form/sales/pages/deposit_discount_spec.rb | 4 +- spec/models/form/sales/pages/deposit_spec.rb | 6 +- spec/models/form/sales/pages/discount_spec.rb | 2 +- .../form/sales/pages/la_nominations_spec.rb | 2 +- .../sales/pages/last_accommodation_la_spec.rb | 2 +- .../sales/pages/last_accommodation_spec.rb | 2 +- .../sales/pages/managing_organisation_spec.rb | 4 +- .../person_relationship_to_buyer1_spec.rb | 2 +- .../form/sales/pages/privacy_notice_spec.rb | 6 +- .../pages/property_local_authority_spec.rb | 4 +- .../property_wheelchair_accessible_spec.rb | 2 +- .../form/sales/pages/purchase_price_spec.rb | 2 +- .../sales/pages/shared_ownership_type_spec.rb | 2 +- spec/models/form/sales/pages/uprn_spec.rb | 4 +- .../buyer1_ethnic_background_arab_spec.rb | 2 +- .../buyer1_ethnic_background_asian_spec.rb | 2 +- .../buyer1_ethnic_background_black_spec.rb | 2 +- .../buyer1_ethnic_background_mixed_spec.rb | 2 +- .../buyer1_ethnic_background_white_spec.rb | 4 +- .../questions/buyer1_ethnic_group_spec.rb | 2 +- .../questions/buyer1_live_in_property_spec.rb | 2 +- .../buyer1_working_situation_spec.rb | 2 +- .../buyer2_ethnic_background_white_spec.rb | 4 +- .../buyer2_relationship_to_buyer1_spec.rb | 2 +- .../sales/questions/buyer_interview_spec.rb | 10 +-- .../form/sales/questions/buyer_live_spec.rb | 2 +- .../sales/questions/buyer_previous_spec.rb | 4 +- .../form/sales/questions/discount_spec.rb | 4 +- .../sales/questions/mortgage_lender_spec.rb | 6 +- .../form/sales/questions/mortgageused_spec.rb | 4 +- .../questions/nationality_all_group_spec.rb | 2 +- .../questions/number_joint_buyers_spec.rb | 2 +- .../sales/questions/ownership_scheme_spec.rb | 4 +- .../form/sales/questions/person_age_spec.rb | 2 +- .../person_relationship_to_buyer1_spec.rb | 2 +- .../sales/questions/privacy_notice_spec.rb | 6 +- .../property_wheelchair_accessible_spec.rb | 2 +- .../questions/shared_ownership_type_spec.rb | 6 +- .../household_characteristics_spec.rb | 6 +- .../sales/subsections/outright_sale_spec.rb | 6 +- .../subsections/property_information_spec.rb | 4 +- .../form/sales/subsections/setup_spec.rb | 4 +- .../shared_ownership_scheme_spec.rb | 2 +- .../validations/property_validations_spec.rb | 4 +- 181 files changed, 342 insertions(+), 338 deletions(-) diff --git a/app/models/derived_variables/lettings_log_variables.rb b/app/models/derived_variables/lettings_log_variables.rb index e50161188..9219392f7 100644 --- a/app/models/derived_variables/lettings_log_variables.rb +++ b/app/models/derived_variables/lettings_log_variables.rb @@ -65,7 +65,7 @@ module DerivedVariables::LettingsLogVariables self.has_benefits = get_has_benefits self.tshortfall_known = 0 if tshortfall self.nocharge = household_charge&.zero? ? 1 : 0 - if form.start_year_after_2024? && is_bedsit? + if form.start_year_2024_or_later? && is_bedsit? self.beds = 1 end @@ -186,7 +186,7 @@ private self.wchair = nil self.location_id = nil end - if form.start_year_after_2024? && (unittype_gn_changed? && unittype_gn_was == 2) + if form.start_year_2024_or_later? && (unittype_gn_changed? && unittype_gn_was == 2) self.beds = nil end end diff --git a/app/models/derived_variables/sales_log_variables.rb b/app/models/derived_variables/sales_log_variables.rb index f23f9eb28..e182c2158 100644 --- a/app/models/derived_variables/sales_log_variables.rb +++ b/app/models/derived_variables/sales_log_variables.rb @@ -29,7 +29,7 @@ module DerivedVariables::SalesLogVariables end end - if saledate && form.start_year_after_2024? && discounted_ownership_sale? + if saledate && form.start_year_2024_or_later? && discounted_ownership_sale? self.ppostcode_full = postcode_full self.ppcodenk = pcodenk self.prevloc = la @@ -44,7 +44,7 @@ module DerivedVariables::SalesLogVariables self.hhmemb = number_of_household_members self.hhtype = household_type - if saledate && form.start_year_after_2024? + if saledate && form.start_year_2024_or_later? self.soctenant = soctenant_from_prevten_values child_under_16_constraints! end diff --git a/app/models/form.rb b/app/models/form.rb index 4336376e6..ce77378ca 100644 --- a/app/models/form.rb +++ b/app/models/form.rb @@ -334,7 +334,11 @@ class Form type == "sales" || (start_year && start_year.to_i > 2022) end - def start_year_after_2024? + def start_year_2024_or_later? start_date && start_date.year >= 2024 end + + def start_year_2025_or_later? + start_date && start_date.year >= 2025 + end end diff --git a/app/models/form/lettings/pages/lead_tenant_nationality.rb b/app/models/form/lettings/pages/lead_tenant_nationality.rb index d4845f8f9..410a6320f 100644 --- a/app/models/form/lettings/pages/lead_tenant_nationality.rb +++ b/app/models/form/lettings/pages/lead_tenant_nationality.rb @@ -2,12 +2,12 @@ class Form::Lettings::Pages::LeadTenantNationality < ::Form::Page def initialize(id, hsh, subsection) super @id = "lead_tenant_nationality" - @copy_key = "lettings.household_characteristics.#{form.start_year_after_2024? ? 'nationality_all' : 'national'}" + @copy_key = "lettings.household_characteristics.#{form.start_year_2024_or_later? ? 'nationality_all' : 'national'}" @depends_on = [{ "declaration" => 1 }] end def questions - @questions ||= if form.start_year_after_2024? + @questions ||= if form.start_year_2024_or_later? [ Form::Lettings::Questions::NationalityAllGroup.new(nil, nil, self), Form::Lettings::Questions::NationalityAll.new(nil, nil, self), diff --git a/app/models/form/lettings/pages/property_local_authority.rb b/app/models/form/lettings/pages/property_local_authority.rb index 1e3d34bd2..339ccb4d8 100644 --- a/app/models/form/lettings/pages/property_local_authority.rb +++ b/app/models/form/lettings/pages/property_local_authority.rb @@ -3,8 +3,8 @@ class Form::Lettings::Pages::PropertyLocalAuthority < ::Form::Page super @id = "property_local_authority" @depends_on = [ - { "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_after_2024?" => false }, - { "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_after_2024?" => true, "address_search_given?" => true }, + { "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_2024_or_later?" => false }, + { "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_2024_or_later?" => true, "address_search_given?" => true }, ] end diff --git a/app/models/form/lettings/pages/uprn.rb b/app/models/form/lettings/pages/uprn.rb index 474928eb3..b9a3a4e94 100644 --- a/app/models/form/lettings/pages/uprn.rb +++ b/app/models/form/lettings/pages/uprn.rb @@ -14,7 +14,7 @@ class Form::Lettings::Pages::Uprn < ::Form::Page end def skip_text - if form.start_year_after_2024? + if form.start_year_2024_or_later? "Search for address instead" else "Enter address instead" @@ -24,7 +24,7 @@ class Form::Lettings::Pages::Uprn < ::Form::Page def skip_href(log = nil) return unless log - if form.start_year_after_2024? + if form.start_year_2024_or_later? "address-matcher" else "address" diff --git a/app/models/form/lettings/questions/age.rb b/app/models/form/lettings/questions/age.rb index b861cb39f..f35abe61e 100644 --- a/app/models/form/lettings/questions/age.rb +++ b/app/models/form/lettings/questions/age.rb @@ -27,7 +27,7 @@ class Form::Lettings::Questions::Age < ::Form::Question end def hint_text - if form.start_year_after_2024? + if form.start_year_2024_or_later? "Answer 1 for children aged under 1 year old" end end diff --git a/app/models/form/lettings/questions/declaration.rb b/app/models/form/lettings/questions/declaration.rb index 0e2fd5b2c..3261452cd 100644 --- a/app/models/form/lettings/questions/declaration.rb +++ b/app/models/form/lettings/questions/declaration.rb @@ -3,13 +3,13 @@ class Form::Lettings::Questions::Declaration < ::Form::Question super @id = "declaration" @type = "checkbox" - @check_answers_card_number = 0 unless form.start_year_after_2024? + @check_answers_card_number = 0 unless form.start_year_2024_or_later? @top_guidance_partial = "privacy_notice_tenant" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end def answer_options - declaration_text = if form.start_year_after_2024? + declaration_text = if form.start_year_2024_or_later? "The tenant has seen or been given access to the MHCLG privacy notice" else "The tenant has seen the MHCLG privacy notice" @@ -19,7 +19,7 @@ class Form::Lettings::Questions::Declaration < ::Form::Question end def unanswered_error_message - if form.start_year_after_2024? + if form.start_year_2024_or_later? I18n.t("validations.declaration.missing.post_2024") else I18n.t("validations.declaration.missing.pre_2024") diff --git a/app/models/form/lettings/questions/ethnic_white.rb b/app/models/form/lettings/questions/ethnic_white.rb index 40b99bc9f..74430d840 100644 --- a/app/models/form/lettings/questions/ethnic_white.rb +++ b/app/models/form/lettings/questions/ethnic_white.rb @@ -9,7 +9,7 @@ class Form::Lettings::Questions::EthnicWhite < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "English, Welsh, Northern Irish, Scottish or British" }, "2" => { "value" => "Irish" }, diff --git a/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb b/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb index 9d54cfcb3..bc1c66cb4 100644 --- a/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb +++ b/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb @@ -15,11 +15,11 @@ class Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing < ::Form::Q end def yes_hint - form.start_year_after_2024? ? "This property was previously used for other purposes or is a new-build." : "This is a new let." + form.start_year_2024_or_later? ? "This property was previously used for other purposes or is a new-build." : "This is a new let." end def no_hint - form.start_year_after_2024? ? "This is a re-let of existing social housing stock." : "This is a re-let of existing social housing." + form.start_year_2024_or_later? ? "This is a re-let of existing social housing stock." : "This is a re-let of existing social housing." end QUESTION_NUMBER_FROM_YEAR = { 2023 => 14, 2024 => 15 }.freeze diff --git a/app/models/form/lettings/questions/housingneeds_other.rb b/app/models/form/lettings/questions/housingneeds_other.rb index 75834d3bb..fc403d00c 100644 --- a/app/models/form/lettings/questions/housingneeds_other.rb +++ b/app/models/form/lettings/questions/housingneeds_other.rb @@ -9,7 +9,7 @@ class Form::Lettings::Questions::HousingneedsOther < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Yes" }, "0" => { "value" => "No" }, diff --git a/app/models/form/lettings/questions/is_carehome.rb b/app/models/form/lettings/questions/is_carehome.rb index efb29a817..25dae3fc6 100644 --- a/app/models/form/lettings/questions/is_carehome.rb +++ b/app/models/form/lettings/questions/is_carehome.rb @@ -10,7 +10,7 @@ class Form::Lettings::Questions::IsCarehome < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Yes" }, "0" => { "value" => "No" }, diff --git a/app/models/form/lettings/questions/layear.rb b/app/models/form/lettings/questions/layear.rb index 63f99c36f..fdaad6c22 100644 --- a/app/models/form/lettings/questions/layear.rb +++ b/app/models/form/lettings/questions/layear.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Layear < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Just moved to local authority area with this new let" }, "2" => { "value" => "Less than 1 year" }, diff --git a/app/models/form/lettings/questions/letting_allocation.rb b/app/models/form/lettings/questions/letting_allocation.rb index 0ae7b740d..08310da13 100644 --- a/app/models/form/lettings/questions/letting_allocation.rb +++ b/app/models/form/lettings/questions/letting_allocation.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::LettingAllocation < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "cbl" => { "value" => "Choice-based lettings (CBL)", "hint" => "Where available vacant properties are advertised and applicants are able to bid for specific properties." }, "cap" => { "value" => "Common Allocation Policy (CAP)", "hint" => "Where a common system agreed between a group of housing providers is used to determine applicant’s priority for housing." }, diff --git a/app/models/form/lettings/questions/person_relationship.rb b/app/models/form/lettings/questions/person_relationship.rb index ec7a78969..d39cb49ff 100644 --- a/app/models/form/lettings/questions/person_relationship.rb +++ b/app/models/form/lettings/questions/person_relationship.rb @@ -10,7 +10,7 @@ class Form::Lettings::Questions::PersonRelationship < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "P" => { "value" => "Partner" }, "C" => { "value" => "Child" }, diff --git a/app/models/form/lettings/questions/previous_let_type.rb b/app/models/form/lettings/questions/previous_let_type.rb index 577571571..8c50cb41a 100644 --- a/app/models/form/lettings/questions/previous_let_type.rb +++ b/app/models/form/lettings/questions/previous_let_type.rb @@ -4,7 +4,7 @@ class Form::Lettings::Questions::PreviousLetType < ::Form::Question @id = "unitletas" @type = "radio" @check_answers_card_number = 0 - @answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_AFTER_2024 : ANSWER_OPTIONS + @answer_options = form.start_year_2024_or_later? ? ANSWER_OPTIONS_AFTER_2024 : ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/reason.rb b/app/models/form/lettings/questions/reason.rb index 4bc00ce43..3a659fc5c 100644 --- a/app/models/form/lettings/questions/reason.rb +++ b/app/models/form/lettings/questions/reason.rb @@ -14,7 +14,7 @@ class Form::Lettings::Questions::Reason < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "50" => { "value" => "End of social or private sector tenancy - no fault" }, "51" => { "value" => "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)" }, diff --git a/app/models/form/lettings/questions/reason_renewal.rb b/app/models/form/lettings/questions/reason_renewal.rb index 9a9ee72de..c00bd2581 100644 --- a/app/models/form/lettings/questions/reason_renewal.rb +++ b/app/models/form/lettings/questions/reason_renewal.rb @@ -14,7 +14,7 @@ class Form::Lettings::Questions::ReasonRenewal < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "50" => { "value" => "End of social or private sector tenancy - no fault" }, "51" => { "value" => "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)" }, diff --git a/app/models/form/lettings/questions/referral.rb b/app/models/form/lettings/questions/referral.rb index 904668a4b..98e5a9186 100644 --- a/app/models/form/lettings/questions/referral.rb +++ b/app/models/form/lettings/questions/referral.rb @@ -9,7 +9,7 @@ class Form::Lettings::Questions::Referral < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Internal transfer", diff --git a/app/models/form/lettings/questions/referral_prp.rb b/app/models/form/lettings/questions/referral_prp.rb index 76ad3fbf8..96da2cba3 100644 --- a/app/models/form/lettings/questions/referral_prp.rb +++ b/app/models/form/lettings/questions/referral_prp.rb @@ -9,7 +9,7 @@ class Form::Lettings::Questions::ReferralPrp < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Internal transfer", diff --git a/app/models/form/lettings/questions/referral_supported_housing.rb b/app/models/form/lettings/questions/referral_supported_housing.rb index 50822705e..d8d05fade 100644 --- a/app/models/form/lettings/questions/referral_supported_housing.rb +++ b/app/models/form/lettings/questions/referral_supported_housing.rb @@ -9,7 +9,7 @@ class Form::Lettings::Questions::ReferralSupportedHousing < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Internal transfer", diff --git a/app/models/form/lettings/questions/referral_supported_housing_prp.rb b/app/models/form/lettings/questions/referral_supported_housing_prp.rb index cab8fbbc9..75cc218fe 100644 --- a/app/models/form/lettings/questions/referral_supported_housing_prp.rb +++ b/app/models/form/lettings/questions/referral_supported_housing_prp.rb @@ -9,7 +9,7 @@ class Form::Lettings::Questions::ReferralSupportedHousingPrp < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Internal transfer", diff --git a/app/models/form/lettings/questions/rent_type.rb b/app/models/form/lettings/questions/rent_type.rb index bc6934200..b941dfcc3 100644 --- a/app/models/form/lettings/questions/rent_type.rb +++ b/app/models/form/lettings/questions/rent_type.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::RentType < ::Form::Question @copy_key = "lettings.setup.rent_type.rent_type" @type = "radio" @top_guidance_partial = "rent_type_definitions" - @answer_options = form.start_year_after_2024? ? ANSWER_OPTIONS_2024 : ANSWER_OPTIONS + @answer_options = form.start_year_2024_or_later? ? ANSWER_OPTIONS_2024 : ANSWER_OPTIONS @conditional_for = { "irproduct_other" => [5] } @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? end diff --git a/app/models/form/lettings/questions/rsnvac.rb b/app/models/form/lettings/questions/rsnvac.rb index 935980712..3f767d311 100644 --- a/app/models/form/lettings/questions/rsnvac.rb +++ b/app/models/form/lettings/questions/rsnvac.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Rsnvac < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "14" => { "value" => "Renewal of fixed-term tenancy", diff --git a/app/models/form/lettings/questions/sheltered.rb b/app/models/form/lettings/questions/sheltered.rb index 7b80bb5bf..458772675 100644 --- a/app/models/form/lettings/questions/sheltered.rb +++ b/app/models/form/lettings/questions/sheltered.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Sheltered < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Yes – specialist retirement housing" }, "2" => { "value" => "Yes – extra care housing" }, "5" => { "value" => "Yes – sheltered housing for adults aged under 55 years" }, diff --git a/app/models/form/lettings/questions/starter_tenancy_type.rb b/app/models/form/lettings/questions/starter_tenancy_type.rb index 85d4a14ff..03d3fee88 100644 --- a/app/models/form/lettings/questions/starter_tenancy_type.rb +++ b/app/models/form/lettings/questions/starter_tenancy_type.rb @@ -10,7 +10,7 @@ class Form::Lettings::Questions::StarterTenancyType < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "4" => { "value" => "Assured Shorthold Tenancy (AST) – Fixed term", diff --git a/app/models/form/lettings/questions/tenancy_type.rb b/app/models/form/lettings/questions/tenancy_type.rb index 9a83b44cb..c67895bef 100644 --- a/app/models/form/lettings/questions/tenancy_type.rb +++ b/app/models/form/lettings/questions/tenancy_type.rb @@ -10,7 +10,7 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "4" => { "value" => "Assured Shorthold Tenancy (AST) – Fixed term", diff --git a/app/models/form/lettings/questions/uprn_confirmation.rb b/app/models/form/lettings/questions/uprn_confirmation.rb index 1c31485b6..2f03cb357 100644 --- a/app/models/form/lettings/questions/uprn_confirmation.rb +++ b/app/models/form/lettings/questions/uprn_confirmation.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::UprnConfirmation < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Yes" }, "0" => { "value" => "No, I want to search for the address instead" }, diff --git a/app/models/form/lettings/questions/waityear.rb b/app/models/form/lettings/questions/waityear.rb index 045765951..67a560167 100644 --- a/app/models/form/lettings/questions/waityear.rb +++ b/app/models/form/lettings/questions/waityear.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Waityear < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "2" => { "value" => "Less than 1 year" }, "7" => { "value" => "1 year but under 2 years" }, diff --git a/app/models/form/lettings/subsections/household_characteristics.rb b/app/models/form/lettings/subsections/household_characteristics.rb index e95cdf19c..61334d84c 100644 --- a/app/models/form/lettings/subsections/household_characteristics.rb +++ b/app/models/form/lettings/subsections/household_characteristics.rb @@ -8,7 +8,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection def pages @pages ||= [ - (Form::Lettings::Pages::Declaration.new(nil, nil, self) unless form.start_year_after_2024?), + (Form::Lettings::Pages::Declaration.new(nil, nil, self) unless form.start_year_2024_or_later?), Form::Lettings::Pages::HouseholdMembers.new(nil, nil, self), Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadHhmembValueCheck.new(nil, nil, self), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadHhmembValueCheck.new(nil, nil, self), @@ -33,8 +33,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::LeadTenantOverRetirementValueCheck.new("working_situation_lead_tenant_over_retirement_value_check", nil, self), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 2), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), - (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), + (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 2), @@ -42,7 +42,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection person_index: 2), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_2_under_retirement_value_check", nil, self, person_index: 2), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_2_over_retirement_value_check", nil, self, person_index: 2), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -53,8 +53,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_2_over_retirement_value_check", nil, self, person_index: 2), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 3), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), - (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?), + (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 3), @@ -62,7 +62,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection person_index: 3), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_3_under_retirement_value_check", nil, self, person_index: 3), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_3_over_retirement_value_check", nil, self, person_index: 3), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -73,8 +73,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_3_over_retirement_value_check", nil, self, person_index: 3), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 4), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), - (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?), + (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 4), @@ -82,7 +82,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection person_index: 4), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_4_under_retirement_value_check", nil, self, person_index: 4), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_4_over_retirement_value_check", nil, self, person_index: 4), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -93,8 +93,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_4_over_retirement_value_check", nil, self, person_index: 4), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 5), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), - (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?), + (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 5), @@ -102,7 +102,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection person_index: 5), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_5_under_retirement_value_check", nil, self, person_index: 5), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_5_over_retirement_value_check", nil, self, person_index: 5), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -113,8 +113,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_5_over_retirement_value_check", nil, self, person_index: 5), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 6), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), - (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?), + (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 6), @@ -122,7 +122,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection person_index: 6), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_6_under_retirement_value_check", nil, self, person_index: 6), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_6_over_retirement_value_check", nil, self, person_index: 6), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -133,8 +133,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_6_over_retirement_value_check", nil, self, person_index: 6), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 7), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_after_2024?), - (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_7_multiple_partners_value_check", nil, self, person_index: 7) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_2024_or_later?), + (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_7_multiple_partners_value_check", nil, self, person_index: 7) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 7), @@ -142,7 +142,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection person_index: 7), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_7_under_retirement_value_check", nil, self, person_index: 7), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_7_over_retirement_value_check", nil, self, person_index: 7), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -153,8 +153,8 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_7_over_retirement_value_check", nil, self, person_index: 7), Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 8), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_after_2024?), - (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_8_multiple_partners_value_check", nil, self, person_index: 8) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_2024_or_later?), + (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_8_multiple_partners_value_check", nil, self, person_index: 8) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 8), @@ -162,7 +162,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection person_index: 8), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_8_under_retirement_value_check", nil, self, person_index: 8), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_8_over_retirement_value_check", nil, self, person_index: 8), - (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_after_2024?), + (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_2024_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, diff --git a/app/models/form/lettings/subsections/household_situation.rb b/app/models/form/lettings/subsections/household_situation.rb index 6646d7230..dc3fd608b 100644 --- a/app/models/form/lettings/subsections/household_situation.rb +++ b/app/models/form/lettings/subsections/household_situation.rb @@ -12,7 +12,7 @@ class Form::Lettings::Subsections::HouseholdSituation < ::Form::Subsection Form::Lettings::Pages::TimeOnWaitingList.new(nil, nil, self), Form::Lettings::Pages::ReasonForLeavingLastSettledHome.new(nil, nil, self), Form::Lettings::Pages::ReasonForLeavingLastSettledHomeRenewal.new(nil, nil, self), - (Form::Lettings::Pages::ReasonotherValueCheck.new(nil, nil, self) if form.start_year_after_2024?), + (Form::Lettings::Pages::ReasonotherValueCheck.new(nil, nil, self) if form.start_year_2024_or_later?), Form::Lettings::Pages::PreviousHousingSituation.new(nil, nil, self), Form::Lettings::Pages::PreviousHousingSituationRenewal.new(nil, nil, self), Form::Lettings::Pages::Homelessness.new("homelessness", nil, self), diff --git a/app/models/form/lettings/subsections/property_information.rb b/app/models/form/lettings/subsections/property_information.rb index fa2ff0efa..c80e49e84 100644 --- a/app/models/form/lettings/subsections/property_information.rb +++ b/app/models/form/lettings/subsections/property_information.rb @@ -29,7 +29,7 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection end def uprn_questions - if form.start_year_after_2024? + if form.start_year_2024_or_later? [ Form::Lettings::Pages::Uprn.new(nil, nil, self), Form::Lettings::Pages::UprnConfirmation.new(nil, nil, self), @@ -48,7 +48,7 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection end def number_of_times_relet - Form::Lettings::Pages::PropertyNumberOfTimesRelet.new(nil, nil, self) unless form.start_year_after_2024? + Form::Lettings::Pages::PropertyNumberOfTimesRelet.new(nil, nil, self) unless form.start_year_2024_or_later? end def displayed_in_tasklist?(log) diff --git a/app/models/form/lettings/subsections/setup.rb b/app/models/form/lettings/subsections/setup.rb index 1970149ed..0e65c2f13 100644 --- a/app/models/form/lettings/subsections/setup.rb +++ b/app/models/form/lettings/subsections/setup.rb @@ -20,7 +20,7 @@ class Form::Lettings::Subsections::Setup < ::Form::Subsection Form::Lettings::Pages::RentType.new(nil, nil, self), Form::Lettings::Pages::TenantCode.new(nil, nil, self), Form::Lettings::Pages::PropertyReference.new(nil, nil, self), - (Form::Lettings::Pages::Declaration.new(nil, nil, self) if form.start_year_after_2024?), + (Form::Lettings::Pages::Declaration.new(nil, nil, self) if form.start_year_2024_or_later?), ].compact end diff --git a/app/models/form/lettings/subsections/tenancy_information.rb b/app/models/form/lettings/subsections/tenancy_information.rb index 5525c182f..f0b7f4bef 100644 --- a/app/models/form/lettings/subsections/tenancy_information.rb +++ b/app/models/form/lettings/subsections/tenancy_information.rb @@ -15,7 +15,7 @@ class Form::Lettings::Subsections::TenancyInformation < ::Form::Subsection Form::Lettings::Pages::TenancyLength.new(nil, nil, self), Form::Lettings::Pages::TenancyLengthAffordableRent.new(nil, nil, self), Form::Lettings::Pages::TenancyLengthIntermediateRent.new(nil, nil, self), - (Form::Lettings::Pages::TenancyLengthPeriodic.new(nil, nil, self) if form.start_year_after_2024?), + (Form::Lettings::Pages::TenancyLengthPeriodic.new(nil, nil, self) if form.start_year_2024_or_later?), Form::Lettings::Pages::ShelteredAccommodation.new(nil, nil, self), ].flatten.compact end diff --git a/app/models/form/sales/pages/buyer1_nationality.rb b/app/models/form/sales/pages/buyer1_nationality.rb index 6bcf12952..791ecafac 100644 --- a/app/models/form/sales/pages/buyer1_nationality.rb +++ b/app/models/form/sales/pages/buyer1_nationality.rb @@ -13,7 +13,7 @@ class Form::Sales::Pages::Buyer1Nationality < ::Form::Page end def questions - @questions ||= if form.start_year_after_2024? + @questions ||= if form.start_year_2024_or_later? [ Form::Sales::Questions::NationalityAllGroup.new("nationality_all_group", nil, self, 1), Form::Sales::Questions::NationalityAll.new("nationality_all", nil, self, 1), diff --git a/app/models/form/sales/pages/buyer2_nationality.rb b/app/models/form/sales/pages/buyer2_nationality.rb index bbec2a105..30790fd63 100644 --- a/app/models/form/sales/pages/buyer2_nationality.rb +++ b/app/models/form/sales/pages/buyer2_nationality.rb @@ -15,7 +15,7 @@ class Form::Sales::Pages::Buyer2Nationality < ::Form::Page end def questions - @questions ||= if form.start_year_after_2024? + @questions ||= if form.start_year_2024_or_later? [ Form::Sales::Questions::NationalityAllGroup.new("nationality_all_buyer2_group", nil, self, 2), Form::Sales::Questions::NationalityAll.new("nationality_all_buyer2", nil, self, 2), diff --git a/app/models/form/sales/pages/buyer_previous.rb b/app/models/form/sales/pages/buyer_previous.rb index 0d20207a3..197a68971 100644 --- a/app/models/form/sales/pages/buyer_previous.rb +++ b/app/models/form/sales/pages/buyer_previous.rb @@ -13,7 +13,7 @@ class Form::Sales::Pages::BuyerPrevious < ::Form::Page end def routed_to?(log, _current_user) - return false if log.is_staircase? && form.start_year_after_2024? + return false if log.is_staircase? && form.start_year_2024_or_later? super end diff --git a/app/models/form/sales/pages/deposit.rb b/app/models/form/sales/pages/deposit.rb index f0bbda05c..4870a3c35 100644 --- a/app/models/form/sales/pages/deposit.rb +++ b/app/models/form/sales/pages/deposit.rb @@ -15,7 +15,7 @@ class Form::Sales::Pages::Deposit < ::Form::Page def routed_to?(log, _user) return false unless super return true if log.ownershipsch == 2 || (log.ownershipsch == 3 && log.mortgageused == 1) - return false if log.stairowned_100? != @optional && form.start_year_after_2024? + return false if log.stairowned_100? != @optional && form.start_year_2024_or_later? log.ownershipsch == 1 end diff --git a/app/models/form/sales/pages/deposit_discount.rb b/app/models/form/sales/pages/deposit_discount.rb index caf726460..84fcbb45f 100644 --- a/app/models/form/sales/pages/deposit_discount.rb +++ b/app/models/form/sales/pages/deposit_discount.rb @@ -12,7 +12,7 @@ class Form::Sales::Pages::DepositDiscount < ::Form::Page end def depends_on - if form.start_year_after_2024? + if form.start_year_2024_or_later? [{ "social_homebuy?" => true, "stairowned_100?" => @optional }] else [{ "social_homebuy?" => true }] diff --git a/app/models/form/sales/pages/la_nominations.rb b/app/models/form/sales/pages/la_nominations.rb index 6adda533d..e86e0374a 100644 --- a/app/models/form/sales/pages/la_nominations.rb +++ b/app/models/form/sales/pages/la_nominations.rb @@ -12,7 +12,7 @@ class Form::Sales::Pages::LaNominations < ::Form::Page end def routed_to?(log, _current_user) - return false if log.staircase == 1 && form.start_year_after_2024? + return false if log.staircase == 1 && form.start_year_2024_or_later? super end diff --git a/app/models/form/sales/pages/last_accommodation.rb b/app/models/form/sales/pages/last_accommodation.rb index f9d167028..42620038b 100644 --- a/app/models/form/sales/pages/last_accommodation.rb +++ b/app/models/form/sales/pages/last_accommodation.rb @@ -13,7 +13,7 @@ class Form::Sales::Pages::LastAccommodation < ::Form::Page end def routed_to?(log, _user) - return false if form.start_year_after_2024? && log.discounted_ownership_sale? + return false if form.start_year_2024_or_later? && log.discounted_ownership_sale? super end diff --git a/app/models/form/sales/pages/last_accommodation_la.rb b/app/models/form/sales/pages/last_accommodation_la.rb index 9cae326bf..ceb5b272c 100644 --- a/app/models/form/sales/pages/last_accommodation_la.rb +++ b/app/models/form/sales/pages/last_accommodation_la.rb @@ -16,7 +16,7 @@ class Form::Sales::Pages::LastAccommodationLa < ::Form::Page end def routed_to?(log, _user) - return false if form.start_year_after_2024? && log.discounted_ownership_sale? + return false if form.start_year_2024_or_later? && log.discounted_ownership_sale? super end diff --git a/app/models/form/sales/pages/managing_organisation.rb b/app/models/form/sales/pages/managing_organisation.rb index 3d8e59383..bf51602a4 100644 --- a/app/models/form/sales/pages/managing_organisation.rb +++ b/app/models/form/sales/pages/managing_organisation.rb @@ -13,7 +13,7 @@ class Form::Sales::Pages::ManagingOrganisation < ::Form::Page def routed_to?(log, current_user) return false unless current_user - if form.start_year_after_2024? + if form.start_year_2024_or_later? organisation = current_user.support? ? log.owning_organisation : current_user.organisation return false unless organisation diff --git a/app/models/form/sales/pages/property_local_authority.rb b/app/models/form/sales/pages/property_local_authority.rb index 649a445f9..fe9ad1bc0 100644 --- a/app/models/form/sales/pages/property_local_authority.rb +++ b/app/models/form/sales/pages/property_local_authority.rb @@ -3,8 +3,8 @@ class Form::Sales::Pages::PropertyLocalAuthority < ::Form::Page super @id = "property_local_authority" @depends_on = [ - { "is_la_inferred" => false, "form.start_year_after_2024?" => false }, - { "is_la_inferred" => false, "form.start_year_after_2024?" => true, "address_search_given?" => true }, + { "is_la_inferred" => false, "form.start_year_2024_or_later?" => false }, + { "is_la_inferred" => false, "form.start_year_2024_or_later?" => true, "address_search_given?" => true }, ] end diff --git a/app/models/form/sales/pages/uprn.rb b/app/models/form/sales/pages/uprn.rb index fce51e543..a78b87c2f 100644 --- a/app/models/form/sales/pages/uprn.rb +++ b/app/models/form/sales/pages/uprn.rb @@ -13,7 +13,7 @@ class Form::Sales::Pages::Uprn < ::Form::Page end def skip_text - if form.start_year_after_2024? + if form.start_year_2024_or_later? "Search for address instead" else "Enter address instead" @@ -23,7 +23,7 @@ class Form::Sales::Pages::Uprn < ::Form::Page def skip_href(log = nil) return unless log - if form.start_year_after_2024? + if form.start_year_2024_or_later? "address-matcher" else "address" 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 2bbe4939f..619c958f9 100644 --- a/app/models/form/sales/questions/buyer1_ethnic_background_white.rb +++ b/app/models/form/sales/questions/buyer1_ethnic_background_white.rb @@ -9,7 +9,7 @@ class Form::Sales::Questions::Buyer1EthnicBackgroundWhite < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "English, Welsh, Northern Irish, Scottish or British" }, "2" => { "value" => "Irish" }, 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 232e0f99e..be3e3ccff 100644 --- a/app/models/form/sales/questions/buyer2_ethnic_background_white.rb +++ b/app/models/form/sales/questions/buyer2_ethnic_background_white.rb @@ -9,7 +9,7 @@ class Form::Sales::Questions::Buyer2EthnicBackgroundWhite < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "English, Welsh, Northern Irish, Scottish or British" }, "2" => { "value" => "Irish" }, 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 3f0fc299c..9520ace67 100644 --- a/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb +++ b/app/models/form/sales/questions/buyer2_relationship_to_buyer1.rb @@ -16,7 +16,7 @@ class Form::Sales::Questions::Buyer2RelationshipToBuyer1 < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "P" => { "value" => "Partner" }, diff --git a/app/models/form/sales/questions/buyer_previous.rb b/app/models/form/sales/questions/buyer_previous.rb index dfc0c2fd2..4daf963bf 100644 --- a/app/models/form/sales/questions/buyer_previous.rb +++ b/app/models/form/sales/questions/buyer_previous.rb @@ -22,7 +22,7 @@ class Form::Sales::Questions::BuyerPrevious < ::Form::Question end def derived?(_log) - form.start_year_after_2024? + form.start_year_2024_or_later? end QUESTION_NUMBER_FROM_YEAR = { 2023 => 84 }.freeze diff --git a/app/models/form/sales/questions/discount.rb b/app/models/form/sales/questions/discount.rb index 1d8c5a46b..3807a8cfc 100644 --- a/app/models/form/sales/questions/discount.rb +++ b/app/models/form/sales/questions/discount.rb @@ -5,7 +5,7 @@ class Form::Sales::Questions::Discount < ::Form::Question @type = "numeric" @copy_key = "sales.sale_information.discount" @min = 0 - @max = form.start_year_after_2024? ? 70 : 100 + @max = form.start_year_2024_or_later? ? 70 : 100 @step = 0.1 @width = 5 @suffix = "%" diff --git a/app/models/form/sales/questions/mortgage_lender.rb b/app/models/form/sales/questions/mortgage_lender.rb index c5a10efb4..a4aa55f17 100644 --- a/app/models/form/sales/questions/mortgage_lender.rb +++ b/app/models/form/sales/questions/mortgage_lender.rb @@ -60,7 +60,7 @@ class Form::Sales::Questions::MortgageLender < ::Form::Question OPTIONS_NOT_DISPLAYED = %w[0].freeze def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? ANSWER_OPTIONS else ANSWER_OPTIONS.dup.reject { |k, _v| OPTIONS_INTRODUCED_2024.include?(k) } diff --git a/app/models/form/sales/questions/mortgageused.rb b/app/models/form/sales/questions/mortgageused.rb index 341d3ff60..e4a101072 100644 --- a/app/models/form/sales/questions/mortgageused.rb +++ b/app/models/form/sales/questions/mortgageused.rb @@ -11,7 +11,7 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question end def displayed_answer_options(log, _user = nil) - if log.outright_sale? && log.saledate && !form.start_year_after_2024? + if log.outright_sale? && log.saledate && !form.start_year_2024_or_later? answer_options_without_dont_know elsif log.stairowned == 100 || log.outright_sale? ANSWER_OPTIONS diff --git a/app/models/form/sales/questions/ownership_scheme.rb b/app/models/form/sales/questions/ownership_scheme.rb index 6b33a2566..f42f03f37 100644 --- a/app/models/form/sales/questions/ownership_scheme.rb +++ b/app/models/form/sales/questions/ownership_scheme.rb @@ -7,7 +7,7 @@ class Form::Sales::Questions::OwnershipScheme < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Yes - a shared ownership scheme", "hint" => "When the purchaser buys an initial share of up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion, or a subsequent staircasing transaction" }, "2" => { "value" => "Yes - a discounted ownership scheme" }, 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 af3f2a78b..9ac0791a4 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 @@ -16,7 +16,7 @@ class Form::Sales::Questions::PersonRelationshipToBuyer1 < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "P" => { "value" => "Partner" }, "C" => { "value" => "Child" }, diff --git a/app/models/form/sales/questions/privacy_notice.rb b/app/models/form/sales/questions/privacy_notice.rb index 57f77041b..5e73e7a3a 100644 --- a/app/models/form/sales/questions/privacy_notice.rb +++ b/app/models/form/sales/questions/privacy_notice.rb @@ -10,7 +10,7 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question end def answer_options - declaration_text = if form.start_year_after_2024? + declaration_text = if form.start_year_2024_or_later? "The #{@joint_purchase ? 'buyers have' : 'buyer has'} seen or been given access to the MHCLG privacy notice" else "The #{@joint_purchase ? 'buyers have' : 'buyer has'} seen the MHCLG privacy notice" @@ -21,7 +21,7 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question def unanswered_error_message buyer_or_buyers = @joint_purchase ? "buyers" : "buyer" - if form.start_year_after_2024? + if form.start_year_2024_or_later? I18n.t("validations.privacynotice.missing.post_2024", buyer_or_buyers:) else I18n.t("validations.privacynotice.missing.pre_2024", buyer_or_buyers:) diff --git a/app/models/form/sales/questions/uprn_confirmation.rb b/app/models/form/sales/questions/uprn_confirmation.rb index 94c1afa36..fed35f665 100644 --- a/app/models/form/sales/questions/uprn_confirmation.rb +++ b/app/models/form/sales/questions/uprn_confirmation.rb @@ -6,7 +6,7 @@ class Form::Sales::Questions::UprnConfirmation < ::Form::Question end def answer_options - if form.start_year_after_2024? + if form.start_year_2024_or_later? { "1" => { "value" => "Yes" }, "0" => { "value" => "No, I want to search for the address instead" }, diff --git a/app/models/form/sales/subsections/household_characteristics.rb b/app/models/form/sales/subsections/household_characteristics.rb index afbbe4278..f1f01ba62 100644 --- a/app/models/form/sales/subsections/household_characteristics.rb +++ b/app/models/form/sales/subsections/household_characteristics.rb @@ -8,13 +8,13 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection def pages @pages ||= [ - (Form::Sales::Pages::BuyerInterview.new("buyer_interview_joint_purchase", nil, self, joint_purchase: true) unless form.start_year_after_2024?), - (Form::Sales::Pages::BuyerInterview.new("buyer_interview", nil, self, joint_purchase: false) unless form.start_year_after_2024?), - (Form::Sales::Pages::PrivacyNotice.new("privacy_notice_joint_purchase", nil, self, joint_purchase: true) unless form.start_year_after_2024?), - (Form::Sales::Pages::PrivacyNotice.new("privacy_notice", nil, self, joint_purchase: false) unless form.start_year_after_2024?), + (Form::Sales::Pages::BuyerInterview.new("buyer_interview_joint_purchase", nil, self, joint_purchase: true) unless form.start_year_2024_or_later?), + (Form::Sales::Pages::BuyerInterview.new("buyer_interview", nil, self, joint_purchase: false) unless form.start_year_2024_or_later?), + (Form::Sales::Pages::PrivacyNotice.new("privacy_notice_joint_purchase", nil, self, joint_purchase: true) unless form.start_year_2024_or_later?), + (Form::Sales::Pages::PrivacyNotice.new("privacy_notice", nil, self, joint_purchase: false) unless form.start_year_2024_or_later?), Form::Sales::Pages::Age1.new(nil, nil, self), Form::Sales::Pages::RetirementValueCheck.new("age_1_retirement_value_check", nil, self, person_index: 1), - (Form::Sales::Pages::NotRetiredValueCheck.new("age_1_not_retired_value_check", nil, self, person_index: 1) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("age_1_not_retired_value_check", nil, self, person_index: 1) if form.start_year_2024_or_later?), Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck.new("age_1_old_persons_shared_ownership_joint_purchase_value_check", nil, self, joint_purchase: true), Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck.new("age_1_old_persons_shared_ownership_value_check", nil, self, joint_purchase: false), Form::Sales::Pages::GenderIdentity1.new(nil, nil, self), @@ -27,7 +27,7 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Sales::Pages::Buyer1Nationality.new(nil, nil, self), Form::Sales::Pages::Buyer1WorkingSituation.new(nil, nil, self), Form::Sales::Pages::RetirementValueCheck.new("working_situation_1_retirement_value_check", nil, self, person_index: 1), - (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_1_not_retired_value_check", nil, self, person_index: 1) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_1_not_retired_value_check", nil, self, person_index: 1) if form.start_year_2024_or_later?), Form::Sales::Pages::Buyer1IncomeMinValueCheck.new("working_situation_buyer_1_income_min_value_check", nil, self), Form::Sales::Pages::Buyer1LiveInProperty.new(nil, nil, self), Form::Sales::Pages::BuyerLiveInValueCheck.new("buyer_1_live_in_property_value_check", nil, self, person_index: 1), @@ -37,13 +37,13 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck.new("age_2_old_persons_shared_ownership_joint_purchase_value_check", nil, self, joint_purchase: true), Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck.new("age_2_old_persons_shared_ownership_value_check", nil, self, joint_purchase: false), Form::Sales::Pages::RetirementValueCheck.new("age_2_buyer_retirement_value_check", nil, self, person_index: 2), - (Form::Sales::Pages::NotRetiredValueCheck.new("age_2_buyer_not_retired_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("age_2_buyer_not_retired_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("buyer_2_age_student_not_child_value_check", nil, self, person_index: 2), Form::Sales::Pages::GenderIdentity2.new(nil, nil, self), buyer_2_ethnicity_nationality_pages, Form::Sales::Pages::Buyer2WorkingSituation.new(nil, nil, self), Form::Sales::Pages::RetirementValueCheck.new("working_situation_2_retirement_value_check_joint_purchase", nil, self, person_index: 2), - (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_2_not_retired_value_check_joint_purchase", nil, self, person_index: 2) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_2_not_retired_value_check_joint_purchase", nil, self, person_index: 2) if form.start_year_2024_or_later?), Form::Sales::Pages::Buyer2IncomeMinValueCheck.new("working_situation_buyer_2_income_min_value_check", nil, self), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("buyer_2_working_situation_student_not_child_value_check", nil, self, person_index: 2), Form::Sales::Pages::Buyer2LiveInProperty.new(nil, nil, self), @@ -52,78 +52,78 @@ class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Sales::Pages::NumberOfOthersInProperty.new("number_of_others_in_property_joint_purchase", nil, self, joint_purchase: true), Form::Sales::Pages::PersonKnown.new("person_2_known", nil, self, person_index: 2), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_2_relationship_to_buyer_1", nil, self, person_index: 2), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), - (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), + (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_2_student_not_child_value_check", nil, self, person_index: 2), Form::Sales::Pages::PersonAge.new("person_2_age", nil, self, person_index: 2), Form::Sales::Pages::RetirementValueCheck.new("age_2_retirement_value_check", nil, self, person_index: 2), - (Form::Sales::Pages::NotRetiredValueCheck.new("age_2_not_retired_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("age_2_not_retired_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_2_student_not_child_value_check", nil, self, person_index: 2), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonGenderIdentity.new("person_2_gender_identity", nil, self, person_index: 2), Form::Sales::Pages::PersonWorkingSituation.new("person_2_working_situation", nil, self, person_index: 2), Form::Sales::Pages::RetirementValueCheck.new("working_situation_2_retirement_value_check", nil, self, person_index: 2), - (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_2_not_retired_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_2_not_retired_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_2_student_not_child_value_check", nil, self, person_index: 2), Form::Sales::Pages::PersonKnown.new("person_3_known", nil, self, person_index: 3), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_3_relationship_to_buyer_1", nil, self, person_index: 3), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), - (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?), + (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_3_student_not_child_value_check", nil, self, person_index: 3), Form::Sales::Pages::PersonAge.new("person_3_age", nil, self, person_index: 3), Form::Sales::Pages::RetirementValueCheck.new("age_3_retirement_value_check", nil, self, person_index: 3), - (Form::Sales::Pages::NotRetiredValueCheck.new("age_3_not_retired_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("age_3_not_retired_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_3_student_not_child_value_check", nil, self, person_index: 3), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonGenderIdentity.new("person_3_gender_identity", nil, self, person_index: 3), Form::Sales::Pages::PersonWorkingSituation.new("person_3_working_situation", nil, self, person_index: 3), Form::Sales::Pages::RetirementValueCheck.new("working_situation_3_retirement_value_check", nil, self, person_index: 3), - (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_3_not_retired_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_3_not_retired_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_3_student_not_child_value_check", nil, self, person_index: 3), Form::Sales::Pages::PersonKnown.new("person_4_known", nil, self, person_index: 4), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_4_relationship_to_buyer_1", nil, self, person_index: 4), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), - (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?), + (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_4_student_not_child_value_check", nil, self, person_index: 4), Form::Sales::Pages::PersonAge.new("person_4_age", nil, self, person_index: 4), Form::Sales::Pages::RetirementValueCheck.new("age_4_retirement_value_check", nil, self, person_index: 4), - (Form::Sales::Pages::NotRetiredValueCheck.new("age_4_not_retired_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("age_4_not_retired_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_4_student_not_child_value_check", nil, self, person_index: 4), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonGenderIdentity.new("person_4_gender_identity", nil, self, person_index: 4), Form::Sales::Pages::PersonWorkingSituation.new("person_4_working_situation", nil, self, person_index: 4), Form::Sales::Pages::RetirementValueCheck.new("working_situation_4_retirement_value_check", nil, self, person_index: 4), - (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_4_not_retired_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_4_not_retired_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_4_student_not_child_value_check", nil, self, person_index: 4), Form::Sales::Pages::PersonKnown.new("person_5_known", nil, self, person_index: 5), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_5_relationship_to_buyer_1", nil, self, person_index: 5), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), - (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?), + (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_5_student_not_child_value_check", nil, self, person_index: 5), Form::Sales::Pages::PersonAge.new("person_5_age", nil, self, person_index: 5), Form::Sales::Pages::RetirementValueCheck.new("age_5_retirement_value_check", nil, self, person_index: 5), - (Form::Sales::Pages::NotRetiredValueCheck.new("age_5_not_retired_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("age_5_not_retired_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_5_student_not_child_value_check", nil, self, person_index: 5), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonGenderIdentity.new("person_5_gender_identity", nil, self, person_index: 5), Form::Sales::Pages::PersonWorkingSituation.new("person_5_working_situation", nil, self, person_index: 5), Form::Sales::Pages::RetirementValueCheck.new("working_situation_5_retirement_value_check", nil, self, person_index: 5), - (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_5_not_retired_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_5_not_retired_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_5_student_not_child_value_check", nil, self, person_index: 5), Form::Sales::Pages::PersonKnown.new("person_6_known", nil, self, person_index: 6), Form::Sales::Pages::PersonRelationshipToBuyer1.new("person_6_relationship_to_buyer_1", nil, self, person_index: 6), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), - (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?), + (Form::Sales::Pages::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("relationship_6_student_not_child_value_check", nil, self, person_index: 6), Form::Sales::Pages::PersonAge.new("person_6_age", nil, self, person_index: 6), Form::Sales::Pages::RetirementValueCheck.new("age_6_retirement_value_check", nil, self, person_index: 6), - (Form::Sales::Pages::NotRetiredValueCheck.new("age_6_not_retired_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("age_6_not_retired_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("age_6_student_not_child_value_check", nil, self, person_index: 6), - (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), + (Form::Sales::Pages::PartnerUnder16ValueCheck.new("age_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonGenderIdentity.new("person_6_gender_identity", nil, self, person_index: 6), Form::Sales::Pages::PersonWorkingSituation.new("person_6_working_situation", nil, self, person_index: 6), Form::Sales::Pages::RetirementValueCheck.new("working_situation_6_retirement_value_check", nil, self, person_index: 6), - (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_6_not_retired_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), + (Form::Sales::Pages::NotRetiredValueCheck.new("working_situation_6_not_retired_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?), Form::Sales::Pages::PersonStudentNotChildValueCheck.new("working_situation_6_student_not_child_value_check", nil, self, person_index: 6), ].flatten.compact end diff --git a/app/models/form/sales/subsections/outright_sale.rb b/app/models/form/sales/subsections/outright_sale.rb index 6b29313a1..af63c8179 100644 --- a/app/models/form/sales/subsections/outright_sale.rb +++ b/app/models/form/sales/subsections/outright_sale.rb @@ -14,8 +14,8 @@ class Form::Sales::Subsections::OutrightSale < ::Form::Subsection Form::Sales::Pages::MortgageValueCheck.new("outright_sale_mortgage_used_mortgage_value_check", nil, self), Form::Sales::Pages::MortgageAmount.new("mortgage_amount_outright_sale", nil, self, ownershipsch: 3), Form::Sales::Pages::MortgageValueCheck.new("outright_sale_mortgage_amount_mortgage_value_check", nil, self), - (Form::Sales::Pages::MortgageLender.new("mortgage_lender_outright_sale", nil, self, ownershipsch: 3) unless form.start_year_after_2024?), - (Form::Sales::Pages::MortgageLenderOther.new("mortgage_lender_other_outright_sale", nil, self, ownershipsch: 3) unless form.start_year_after_2024?), + (Form::Sales::Pages::MortgageLender.new("mortgage_lender_outright_sale", nil, self, ownershipsch: 3) unless form.start_year_2024_or_later?), + (Form::Sales::Pages::MortgageLenderOther.new("mortgage_lender_other_outright_sale", nil, self, ownershipsch: 3) unless form.start_year_2024_or_later?), Form::Sales::Pages::MortgageLength.new("mortgage_length_outright_sale", nil, self, ownershipsch: 3), Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_outright_sale", nil, self, ownershipsch: 3), Form::Sales::Pages::Deposit.new("deposit_outright_sale", nil, self, ownershipsch: 3, optional: false), diff --git a/app/models/form/sales/subsections/property_information.rb b/app/models/form/sales/subsections/property_information.rb index c59c159ae..32df98af5 100644 --- a/app/models/form/sales/subsections/property_information.rb +++ b/app/models/form/sales/subsections/property_information.rb @@ -21,7 +21,7 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection end def uprn_questions - if form.start_year_after_2024? + if form.start_year_2024_or_later? [ Form::Sales::Pages::Uprn.new(nil, nil, self), Form::Sales::Pages::UprnConfirmation.new(nil, nil, self), diff --git a/app/models/form/sales/subsections/setup.rb b/app/models/form/sales/subsections/setup.rb index f954e24e6..de623e769 100644 --- a/app/models/form/sales/subsections/setup.rb +++ b/app/models/form/sales/subsections/setup.rb @@ -20,10 +20,10 @@ class Form::Sales::Subsections::Setup < ::Form::Subsection Form::Sales::Pages::BuyerLive.new(nil, nil, self), Form::Sales::Pages::JointPurchase.new(nil, nil, self), Form::Sales::Pages::NumberJointBuyers.new(nil, nil, self), - (Form::Sales::Pages::BuyerInterview.new("buyer_interview_joint_purchase", nil, self, joint_purchase: true) if form.start_year_after_2024?), - (Form::Sales::Pages::BuyerInterview.new("buyer_interview", nil, self, joint_purchase: false) if form.start_year_after_2024?), - (Form::Sales::Pages::PrivacyNotice.new("privacy_notice_joint_purchase", nil, self, joint_purchase: true) if form.start_year_after_2024?), - (Form::Sales::Pages::PrivacyNotice.new("privacy_notice", nil, self, joint_purchase: false) if form.start_year_after_2024?), + (Form::Sales::Pages::BuyerInterview.new("buyer_interview_joint_purchase", nil, self, joint_purchase: true) if form.start_year_2024_or_later?), + (Form::Sales::Pages::BuyerInterview.new("buyer_interview", nil, self, joint_purchase: false) if form.start_year_2024_or_later?), + (Form::Sales::Pages::PrivacyNotice.new("privacy_notice_joint_purchase", nil, self, joint_purchase: true) if form.start_year_2024_or_later?), + (Form::Sales::Pages::PrivacyNotice.new("privacy_notice", nil, self, joint_purchase: false) if form.start_year_2024_or_later?), ].flatten.compact end end diff --git a/app/models/form/sales/subsections/shared_ownership_scheme.rb b/app/models/form/sales/subsections/shared_ownership_scheme.rb index c955929dc..3fba8ef70 100644 --- a/app/models/form/sales/subsections/shared_ownership_scheme.rb +++ b/app/models/form/sales/subsections/shared_ownership_scheme.rb @@ -40,11 +40,11 @@ class Form::Sales::Subsections::SharedOwnershipScheme < ::Form::Subsection Form::Sales::Pages::MortgageLength.new("mortgage_length_shared_ownership", nil, self, ownershipsch: 1), Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_shared_ownership", nil, self, ownershipsch: 1), Form::Sales::Pages::Deposit.new("deposit_shared_ownership", nil, self, ownershipsch: 1, optional: false), - (Form::Sales::Pages::Deposit.new("deposit_shared_ownership_optional", nil, self, ownershipsch: 1, optional: true) if form.start_year_after_2024?), + (Form::Sales::Pages::Deposit.new("deposit_shared_ownership_optional", nil, self, ownershipsch: 1, optional: true) if form.start_year_2024_or_later?), Form::Sales::Pages::DepositValueCheck.new("deposit_joint_purchase_value_check", nil, self, joint_purchase: true), Form::Sales::Pages::DepositValueCheck.new("deposit_value_check", nil, self, joint_purchase: false), Form::Sales::Pages::DepositDiscount.new("deposit_discount", nil, self, optional: false), - (Form::Sales::Pages::DepositDiscount.new("deposit_discount_optional", nil, self, optional: true) if form.start_year_after_2024?), + (Form::Sales::Pages::DepositDiscount.new("deposit_discount_optional", nil, self, optional: true) if form.start_year_2024_or_later?), Form::Sales::Pages::SharedOwnershipDepositValueCheck.new("shared_ownership_deposit_value_check", nil, self), Form::Sales::Pages::MonthlyRent.new(nil, nil, self), Form::Sales::Pages::LeaseholdCharges.new("leasehold_charges_shared_ownership", nil, self, ownershipsch: 1), diff --git a/app/models/lettings_log.rb b/app/models/lettings_log.rb index 7cab576c4..d8732c3ea 100644 --- a/app/models/lettings_log.rb +++ b/app/models/lettings_log.rb @@ -391,7 +391,7 @@ class LettingsLog < Log end def is_beds_inferred? - form.start_year_after_2024? && is_bedsit? + form.start_year_2024_or_later? && is_bedsit? end def is_shared_housing? @@ -899,7 +899,7 @@ private def should_process_address_change? return unless uprn_selection || select_best_address_match return unless startdate - return unless form.start_year_after_2024? + return unless form.start_year_2024_or_later? if select_best_address_match address_line1_input.present? && postcode_full_input.present? diff --git a/app/models/sales_log.rb b/app/models/sales_log.rb index aca80ef94..23438142f 100644 --- a/app/models/sales_log.rb +++ b/app/models/sales_log.rb @@ -131,7 +131,7 @@ class SalesLog < Log not_required << "proplen" if proplen_optional? not_required << "mortlen" if mortlen_optional? not_required << "frombeds" if frombeds_optional? - not_required << "deposit" if form.start_year_after_2024? && stairowned_100? + not_required << "deposit" if form.start_year_2024_or_later? && stairowned_100? not_required |= %w[address_line2 county postcode_full] if saledate && collection_start_year_for_date(saledate) >= 2023 @@ -453,7 +453,7 @@ class SalesLog < Log def should_process_address_change? return unless uprn_selection || select_best_address_match return unless saledate - return unless form.start_year_after_2024? + return unless form.start_year_2024_or_later? if select_best_address_match address_line1_input.present? && postcode_full_input.present? @@ -515,7 +515,7 @@ class SalesLog < Log end def soctenant_is_inferred? - form.start_year_after_2024? + form.start_year_2024_or_later? end def duplicates diff --git a/app/models/validations/household_validations.rb b/app/models/validations/household_validations.rb index 8fe940ae5..626925631 100644 --- a/app/models/validations/household_validations.rb +++ b/app/models/validations/household_validations.rb @@ -35,7 +35,7 @@ module Validations::HouseholdValidations record.errors.add :reason, I18n.t("validations.household.reason.not_internal_transfer") end - return unless record.form.start_year_after_2024? + return unless record.form.start_year_2024_or_later? if record.reason == 20 && PHRASES_INDICATING_HOMELESSNESS_REGEX.match?(record.reasonother) record.errors.add :reason, I18n.t("validations.household.reason.other_not_settled") @@ -56,7 +56,7 @@ module Validations::HouseholdValidations end def validate_person_1_economic(record) - return unless record.age1 && record.ecstat1 && !record.form.start_year_after_2024? + return unless record.age1 && record.ecstat1 && !record.form.start_year_2024_or_later? if record.age1 < 16 && !economic_status_is_child_other_or_refused?(record.ecstat1) record.errors.add "ecstat1", I18n.t("validations.household.ecstat.child_under_16", person_num: 1) @@ -74,7 +74,7 @@ module Validations::HouseholdValidations economic_status = record.public_send("ecstat#{person_num}") next unless age && economic_status - if age < 16 && !economic_status_is_child_other_or_refused?(economic_status) && !record.form.start_year_after_2024? + if age < 16 && !economic_status_is_child_other_or_refused?(economic_status) && !record.form.start_year_2024_or_later? record.errors.add "ecstat#{person_num}", I18n.t("validations.household.ecstat.child_under_16", person_num:) record.errors.add "age#{person_num}", I18n.t("validations.household.age.child_under_16_ecstat", person_num:) end @@ -86,7 +86,7 @@ module Validations::HouseholdValidations end def validate_person_age_matches_relationship(record) - return unless record.startdate && !record.form.start_year_after_2024? + return unless record.startdate && !record.form.start_year_2024_or_later? (2..8).each do |person_num| age = record.public_send("age#{person_num}") @@ -101,7 +101,7 @@ module Validations::HouseholdValidations end def validate_person_age_and_relationship_matches_economic_status(record) - return unless record.startdate && !record.form.start_year_after_2024? + return unless record.startdate && !record.form.start_year_2024_or_later? (2..8).each do |person_num| age = record.public_send("age#{person_num}") diff --git a/app/models/validations/property_validations.rb b/app/models/validations/property_validations.rb index 52afecb49..e0246ff1f 100644 --- a/app/models/validations/property_validations.rb +++ b/app/models/validations/property_validations.rb @@ -35,7 +35,7 @@ module Validations::PropertyValidations def validate_shared_housing_rooms(record) return unless record.unittype_gn - if record.is_bedsit? && record.beds != 1 && record.beds.present? && !record.form.start_year_after_2024? + if record.is_bedsit? && record.beds != 1 && record.beds.present? && !record.form.start_year_2024_or_later? record.errors.add :unittype_gn, I18n.t("validations.property.unittype_gn.one_bedroom_bedsit") record.errors.add :beds, I18n.t("validations.property.unittype_gn.one_bedroom_bedsit") end diff --git a/app/models/validations/sales/financial_validations.rb b/app/models/validations/sales/financial_validations.rb index 9a119475f..c1046e035 100644 --- a/app/models/validations/sales/financial_validations.rb +++ b/app/models/validations/sales/financial_validations.rb @@ -54,7 +54,7 @@ module Validations::Sales::FinancialValidations def validate_percentage_bought_not_equal_percentage_owned(record) return unless record.stairbought && record.stairowned - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? if record.stairbought == record.stairowned record.errors.add :stairbought, I18n.t("validations.financial.staircasing.percentage_bought_equal_percentage_owned", stairbought: sprintf("%g", record.stairbought), stairowned: sprintf("%g", record.stairowned)) @@ -105,7 +105,7 @@ module Validations::Sales::FinancialValidations def validate_equity_less_than_staircase_difference(record) return unless record.equity && record.stairbought && record.stairowned - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? if record.equity > record.stairowned - record.stairbought formatted_equity = sprintf("%g", record.equity) diff --git a/app/models/validations/sales/household_validations.rb b/app/models/validations/sales/household_validations.rb index fb1ea65c2..23b2e9ee1 100644 --- a/app/models/validations/sales/household_validations.rb +++ b/app/models/validations/sales/household_validations.rb @@ -16,7 +16,7 @@ module Validations::Sales::HouseholdValidations end def validate_buyer1_previous_tenure(record) - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? return unless record.discounted_ownership_sale? && record.prevten if [3, 4, 5, 6, 7, 9, 0].include?(record.prevten) @@ -26,7 +26,7 @@ module Validations::Sales::HouseholdValidations end def validate_person_age_matches_relationship(record) - return unless record.saledate && !record.form.start_year_after_2024? + return unless record.saledate && !record.form.start_year_2024_or_later? (2..6).each do |person_num| age = record.public_send("age#{person_num}") @@ -44,7 +44,7 @@ module Validations::Sales::HouseholdValidations end def validate_person_age_and_relationship_matches_economic_status(record) - return unless record.saledate && !record.form.start_year_after_2024? + return unless record.saledate && !record.form.start_year_2024_or_later? (2..6).each do |person_num| age = record.public_send("age#{person_num}") @@ -77,7 +77,7 @@ module Validations::Sales::HouseholdValidations economic_status = record.public_send("ecstat#{person_num}") next unless age && economic_status - if age < 16 && !economic_status_is_child_other_or_refused?(economic_status) && !record.form.start_year_after_2024? + if age < 16 && !economic_status_is_child_other_or_refused?(economic_status) && !record.form.start_year_2024_or_later? record.errors.add "ecstat#{person_num}", I18n.t("validations.sales.household.ecstat.child_under_16", person_num:) record.errors.add "age#{person_num}", I18n.t("validations.sales.household.age.child_under_16_ecstat", person_num:) end @@ -89,7 +89,7 @@ module Validations::Sales::HouseholdValidations end def validate_child_12_years_younger(record) - return unless record.saledate && !record.form.start_year_after_2024? + return unless record.saledate && !record.form.start_year_2024_or_later? (2..6).each do |person_num| buyer_1_age = record.public_send("age1") @@ -106,7 +106,7 @@ module Validations::Sales::HouseholdValidations end def validate_buyer_not_child(record) - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? record.errors.add "ecstat1", I18n.t("validations.sales.household.ecstat1.buyer_cannot_be_child") if person_is_economic_child?(record.ecstat1) record.errors.add "ecstat2", I18n.t("validations.sales.household.ecstat2.buyer_cannot_be_child") if person_is_economic_child?(record.ecstat2) && record.joint_purchase? diff --git a/app/models/validations/sales/property_validations.rb b/app/models/validations/sales/property_validations.rb index 59d616c9a..c4a42c630 100644 --- a/app/models/validations/sales/property_validations.rb +++ b/app/models/validations/sales/property_validations.rb @@ -1,6 +1,6 @@ module Validations::Sales::PropertyValidations def validate_postcodes_match_if_discounted_ownership(record) - return unless record.saledate && !record.form.start_year_after_2024? + return unless record.saledate && !record.form.start_year_2024_or_later? return unless record.ppostcode_full.present? && record.postcode_full.present? if record.discounted_ownership_sale? && record.ppostcode_full != record.postcode_full diff --git a/app/models/validations/sales/sale_information_validations.rb b/app/models/validations/sales/sale_information_validations.rb index 700867e66..3c5e3f2b9 100644 --- a/app/models/validations/sales/sale_information_validations.rb +++ b/app/models/validations/sales/sale_information_validations.rb @@ -12,7 +12,7 @@ module Validations::Sales::SaleInformationValidations 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? + if record.saledate - record.hodate >= 3.years && record.form.start_year_2024_or_later? 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 @@ -42,7 +42,7 @@ module Validations::Sales::SaleInformationValidations end def validate_discounted_ownership_value(record) - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? return unless record.value && record.deposit && record.ownershipsch return unless record.mortgage || record.mortgageused == 2 || record.mortgageused == 3 return unless record.discount || record.grant || record.type == 29 @@ -65,7 +65,7 @@ module Validations::Sales::SaleInformationValidations end def validate_outright_sale_value_matches_mortgage_plus_deposit(record) - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? return unless record.outright_sale? return unless record.mortgage_used? && record.mortgage return unless record.deposit && record.value @@ -96,7 +96,7 @@ module Validations::Sales::SaleInformationValidations end def validate_grant_amount(record) - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? return unless record.grant && (record.type == 8 || record.type == 21) unless record.grant.between?(9_000, 16_000) @@ -106,7 +106,7 @@ module Validations::Sales::SaleInformationValidations def validate_stairbought(record) return unless record.stairbought && record.type - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? max_stairbought = case record.type when 30, 16, 28, 31, 32 @@ -124,7 +124,7 @@ module Validations::Sales::SaleInformationValidations end def validate_discount_and_value(record) - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? return unless record.discount && record.value && record.la if record.london_property? && record.discount_value > 136_400 @@ -139,7 +139,7 @@ module Validations::Sales::SaleInformationValidations end def validate_non_staircasing_mortgage(record) - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? return unless record.value && record.deposit && record.equity return unless record.shared_ownership_scheme? && record.type && record.mortgageused && record.is_not_staircasing? @@ -151,7 +151,7 @@ module Validations::Sales::SaleInformationValidations end def validate_staircasing_mortgage(record) - return unless record.saledate && record.form.start_year_after_2024? + return unless record.saledate && record.form.start_year_2024_or_later? return unless record.value && record.deposit && record.stairbought return unless record.shared_ownership_scheme? && record.type && record.mortgageused && record.is_staircase? @@ -334,7 +334,7 @@ module Validations::Sales::SaleInformationValidations if record.discounted_ownership_sale? record.errors.add :mortgageused, I18n.t("validations.invalid_option", question: "was a mortgage used for the purchase of this property?") end - if record.outright_sale? && record.saledate && !record.form.start_year_after_2024? + if record.outright_sale? && record.saledate && !record.form.start_year_2024_or_later? 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.sales.sale_information.saledate.mortgage_used_year") end diff --git a/app/models/validations/sales/soft_validations.rb b/app/models/validations/sales/soft_validations.rb index fccd9bf83..fe05ec13c 100644 --- a/app/models/validations/sales/soft_validations.rb +++ b/app/models/validations/sales/soft_validations.rb @@ -68,7 +68,7 @@ module Validations::Sales::SoftValidations end def extra_borrowing_expected_but_not_reported? - return unless saledate && !form.start_year_after_2024? + return unless saledate && !form.start_year_2024_or_later? return unless extrabor && mortgage && deposit && value && discount extrabor != 1 && mortgage + deposit > value - value * discount / 100 @@ -118,7 +118,7 @@ module Validations::Sales::SoftValidations def grant_outside_common_range? return unless grant && type && saledate - return if form.start_year_after_2024? && (type == 21 || type == 8) + return if form.start_year_2024_or_later? && (type == 21 || type == 8) !grant.between?(9_000, 16_000) end diff --git a/app/models/validations/shared_validations.rb b/app/models/validations/shared_validations.rb index a2ae916c1..2eb5fff5a 100644 --- a/app/models/validations/shared_validations.rb +++ b/app/models/validations/shared_validations.rb @@ -126,7 +126,7 @@ module Validations::SharedValidations end def shared_validate_partner_count(record, max_people) - return if record.form.start_year_after_2024? + return if record.form.start_year_2024_or_later? partner_numbers = (2..max_people).select { |n| person_is_partner?(record["relat#{n}"]) } if partner_numbers.count > 1 diff --git a/app/services/exports/lettings_log_export_service.rb b/app/services/exports/lettings_log_export_service.rb index b21099a06..97f495e0c 100644 --- a/app/services/exports/lettings_log_export_service.rb +++ b/app/services/exports/lettings_log_export_service.rb @@ -146,8 +146,8 @@ module Exports field_name.starts_with?(details_known_prefix) || pattern_age.match(field_name) || !EXPORT_FIELDS.include?(field_name) || - (lettings_log.form.start_year_after_2024? && PRE_2024_EXPORT_FIELDS.include?(field_name)) || - (!lettings_log.form.start_year_after_2024? && POST_2024_EXPORT_FIELDS.include?(field_name)) + (lettings_log.form.start_year_2024_or_later? && PRE_2024_EXPORT_FIELDS.include?(field_name)) || + (!lettings_log.form.start_year_2024_or_later? && POST_2024_EXPORT_FIELDS.include?(field_name)) end def build_export_xml(lettings_logs) diff --git a/spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb b/spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb index b095af406..43dc70378 100644 --- a/spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb +++ b/spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Pages::FirstTimePropertyLetAsSocialHousing, type: let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb b/spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb index 1f2986064..b75e57674 100644 --- a/spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb +++ b/spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Pages::LeadTenantEthnicBackgroundWhite, type: :mo let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/pages/person_age_spec.rb b/spec/models/form/lettings/pages/person_age_spec.rb index dfcc82406..2043052fd 100644 --- a/spec/models/form/lettings/pages/person_age_spec.rb +++ b/spec/models/form/lettings/pages/person_age_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Form::Lettings::Pages::PersonAge, type: :model do subject(:page) { described_class.new(nil, page_definition, subsection, person_index:) } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: false)) } let(:person_index) { 2 } it "has correct subsection" do diff --git a/spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb b/spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb index a0ebb9cbc..829d55ad0 100644 --- a/spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb +++ b/spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Form::Lettings::Pages::PersonRelationshipToLead, type: :model do subject(:page) { described_class.new(nil, page_definition, subsection, person_index:) } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: false)) } let(:person_index) { 2 } it "has correct subsection" do diff --git a/spec/models/form/lettings/pages/previous_local_authority_spec.rb b/spec/models/form/lettings/pages/previous_local_authority_spec.rb index 9e6d91be3..37ae11133 100644 --- a/spec/models/form/lettings/pages/previous_local_authority_spec.rb +++ b/spec/models/form/lettings/pages/previous_local_authority_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Pages::PreviousLocalAuthority, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/lettings/pages/previous_postcode_spec.rb b/spec/models/form/lettings/pages/previous_postcode_spec.rb index eba9af065..354f78a98 100644 --- a/spec/models/form/lettings/pages/previous_postcode_spec.rb +++ b/spec/models/form/lettings/pages/previous_postcode_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Lettings::Pages::PreviousPostcode, type: :model do let(:page_id) { "previous_postcode" } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/lettings/pages/property_local_authority_spec.rb b/spec/models/form/lettings/pages/property_local_authority_spec.rb index fe5363d97..75d680ddd 100644 --- a/spec/models/form/lettings/pages/property_local_authority_spec.rb +++ b/spec/models/form/lettings/pages/property_local_authority_spec.rb @@ -37,7 +37,7 @@ RSpec.describe Form::Lettings::Pages::PropertyLocalAuthority, type: :model do context "with form before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "is routed to when la is not inferred and it is general needs log" do @@ -61,7 +61,7 @@ RSpec.describe Form::Lettings::Pages::PropertyLocalAuthority, type: :model do context "with form after 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "is routed to when la is not inferred, it is general needs log and address search has been given" do diff --git a/spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb b/spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb index 90da08fb6..8090c6ed4 100644 --- a/spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb +++ b/spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Lettings::Pages::PropertyWheelchairAccessible, type: :model let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1))) } before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct subsection" do diff --git a/spec/models/form/lettings/pages/renewal_spec.rb b/spec/models/form/lettings/pages/renewal_spec.rb index edeeaff1b..77ba3aec8 100644 --- a/spec/models/form/lettings/pages/renewal_spec.rb +++ b/spec/models/form/lettings/pages/renewal_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Pages::Renewal, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/pages/rent_type_spec.rb b/spec/models/form/lettings/pages/rent_type_spec.rb index 41dc0a1a9..3cec8e01e 100644 --- a/spec/models/form/lettings/pages/rent_type_spec.rb +++ b/spec/models/form/lettings/pages/rent_type_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Pages::RentType, type: :model do before do allow(subsection).to receive(:form).and_return(form) - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct subsection" do diff --git a/spec/models/form/lettings/pages/starter_tenancy_type_spec.rb b/spec/models/form/lettings/pages/starter_tenancy_type_spec.rb index 6842f7d3e..005b546a8 100644 --- a/spec/models/form/lettings/pages/starter_tenancy_type_spec.rb +++ b/spec/models/form/lettings/pages/starter_tenancy_type_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Form::Lettings::Pages::StarterTenancyType, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/pages/uprn_spec.rb b/spec/models/form/lettings/pages/uprn_spec.rb index 2ab83c76a..81f1aec40 100644 --- a/spec/models/form/lettings/pages/uprn_spec.rb +++ b/spec/models/form/lettings/pages/uprn_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Pages::Uprn, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(subsection).to receive(:form).and_return(form) end @@ -57,7 +57,7 @@ RSpec.describe Form::Lettings::Pages::Uprn, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "points to address search page" do diff --git a/spec/models/form/lettings/questions/age1_known_spec.rb b/spec/models/form/lettings/questions/age1_known_spec.rb index 6ec594359..94c36d3d5 100644 --- a/spec/models/form/lettings/questions/age1_known_spec.rb +++ b/spec/models/form/lettings/questions/age1_known_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Questions::Age1Known, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/age_spec.rb b/spec/models/form/lettings/questions/age_spec.rb index e456007f7..639f695fd 100644 --- a/spec/models/form/lettings/questions/age_spec.rb +++ b/spec/models/form/lettings/questions/age_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Form::Lettings::Questions::Age, type: :model do subject(:question) { described_class.new(nil, question_definition, page, person_index:) } 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, 4), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), start_year_2024_or_later?: false))) } let(:person_index) { 2 } it "has correct page" do diff --git a/spec/models/form/lettings/questions/declaration_spec.rb b/spec/models/form/lettings/questions/declaration_spec.rb index fe1ae882d..25705414c 100644 --- a/spec/models/form/lettings/questions/declaration_spec.rb +++ b/spec/models/form/lettings/questions/declaration_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Declaration, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?) + allow(form).to receive(:start_year_2024_or_later?) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -33,7 +33,7 @@ RSpec.describe Form::Lettings::Questions::Declaration, type: :model do context "when the form year is before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has the correct answer_options" do @@ -57,7 +57,7 @@ RSpec.describe Form::Lettings::Questions::Declaration, type: :model do context "when the form year is >= 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/ethnic_white_spec.rb b/spec/models/form/lettings/questions/ethnic_white_spec.rb index 7857893a1..ab20dd8ca 100644 --- a/spec/models/form/lettings/questions/ethnic_white_spec.rb +++ b/spec/models/form/lettings/questions/ethnic_white_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::EthnicWhite, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -44,7 +44,7 @@ RSpec.describe Form::Lettings::Questions::EthnicWhite, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb b/spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb index 7f38f0108..756f5e84e 100644 --- a/spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb +++ b/spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing, t let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -34,7 +34,7 @@ RSpec.describe Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing, t context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/gender_identity1_spec.rb b/spec/models/form/lettings/questions/gender_identity1_spec.rb index 2a943cbe0..19503ea33 100644 --- a/spec/models/form/lettings/questions/gender_identity1_spec.rb +++ b/spec/models/form/lettings/questions/gender_identity1_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Lettings::Questions::GenderIdentity1, type: :model do let(:question_definition) { nil } let(:page) { instance_double(Form::Page) } let(:subsection) { instance_double(Form::Subsection) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false) } before do allow(page).to receive(:subsection).and_return(subsection) diff --git a/spec/models/form/lettings/questions/hb_spec.rb b/spec/models/form/lettings/questions/hb_spec.rb index ed8f19cd5..9a1477954 100644 --- a/spec/models/form/lettings/questions/hb_spec.rb +++ b/spec/models/form/lettings/questions/hb_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Hb, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/housingneeds_other_spec.rb b/spec/models/form/lettings/questions/housingneeds_other_spec.rb index f7be373e1..ead58bb35 100644 --- a/spec/models/form/lettings/questions/housingneeds_other_spec.rb +++ b/spec/models/form/lettings/questions/housingneeds_other_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::HousingneedsOther, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -42,7 +42,7 @@ RSpec.describe Form::Lettings::Questions::HousingneedsOther, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/is_carehome_spec.rb b/spec/models/form/lettings/questions/is_carehome_spec.rb index 958873599..b82ddeaeb 100644 --- a/spec/models/form/lettings/questions/is_carehome_spec.rb +++ b/spec/models/form/lettings/questions/is_carehome_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::IsCarehome, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -42,7 +42,7 @@ RSpec.describe Form::Lettings::Questions::IsCarehome, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options in the correct order" do diff --git a/spec/models/form/lettings/questions/joint_spec.rb b/spec/models/form/lettings/questions/joint_spec.rb index 1207d97d4..d856e9c18 100644 --- a/spec/models/form/lettings/questions/joint_spec.rb +++ b/spec/models/form/lettings/questions/joint_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Joint, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/layear_spec.rb b/spec/models/form/lettings/questions/layear_spec.rb index 04296beae..5ea537514 100644 --- a/spec/models/form/lettings/questions/layear_spec.rb +++ b/spec/models/form/lettings/questions/layear_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Layear, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -49,7 +49,7 @@ RSpec.describe Form::Lettings::Questions::Layear, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/letting_allocation_spec.rb b/spec/models/form/lettings/questions/letting_allocation_spec.rb index 63c750e5d..980c8fea5 100644 --- a/spec/models/form/lettings/questions/letting_allocation_spec.rb +++ b/spec/models/form/lettings/questions/letting_allocation_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::LettingAllocation, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -45,7 +45,7 @@ RSpec.describe Form::Lettings::Questions::LettingAllocation, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/person_relationship_spec.rb b/spec/models/form/lettings/questions/person_relationship_spec.rb index 20d05e316..0023c60ef 100644 --- a/spec/models/form/lettings/questions/person_relationship_spec.rb +++ b/spec/models/form/lettings/questions/person_relationship_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Form::Lettings::Questions::PersonRelationship, type: :model do subject(:question) { described_class.new(nil, question_definition, page, person_index:) } 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, 4), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), start_year_2024_or_later?: false))) } let(:person_index) { 2 } it "has correct page" do diff --git a/spec/models/form/lettings/questions/ppcodenk_spec.rb b/spec/models/form/lettings/questions/ppcodenk_spec.rb index 8a29b032d..7186875d3 100644 --- a/spec/models/form/lettings/questions/ppcodenk_spec.rb +++ b/spec/models/form/lettings/questions/ppcodenk_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Questions::Ppcodenk, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/previous_la_known_spec.rb b/spec/models/form/lettings/questions/previous_la_known_spec.rb index defb56bdf..f05d376ab 100644 --- a/spec/models/form/lettings/questions/previous_la_known_spec.rb +++ b/spec/models/form/lettings/questions/previous_la_known_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Questions::PreviousLaKnown, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/previous_let_type_spec.rb b/spec/models/form/lettings/questions/previous_let_type_spec.rb index 0739fe386..95c1451cd 100644 --- a/spec/models/form/lettings/questions/previous_let_type_spec.rb +++ b/spec/models/form/lettings/questions/previous_let_type_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -44,7 +44,7 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do context "with collection year on or after 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer options" do diff --git a/spec/models/form/lettings/questions/reason_renewal_spec.rb b/spec/models/form/lettings/questions/reason_renewal_spec.rb index 3cdff75e7..e58a33a21 100644 --- a/spec/models/form/lettings/questions/reason_renewal_spec.rb +++ b/spec/models/form/lettings/questions/reason_renewal_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::ReasonRenewal, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -54,7 +54,7 @@ RSpec.describe Form::Lettings::Questions::ReasonRenewal, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/reason_spec.rb b/spec/models/form/lettings/questions/reason_spec.rb index 0b82eca42..4b71ee176 100644 --- a/spec/models/form/lettings/questions/reason_spec.rb +++ b/spec/models/form/lettings/questions/reason_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Reason, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -84,7 +84,7 @@ RSpec.describe Form::Lettings::Questions::Reason, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/reasonpref_spec.rb b/spec/models/form/lettings/questions/reasonpref_spec.rb index 5957d4979..43326b7c0 100644 --- a/spec/models/form/lettings/questions/reasonpref_spec.rb +++ b/spec/models/form/lettings/questions/reasonpref_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Questions::Reasonpref, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/referral_prp_spec.rb b/spec/models/form/lettings/questions/referral_prp_spec.rb index e11bf250c..a10b6d383 100644 --- a/spec/models/form/lettings/questions/referral_prp_spec.rb +++ b/spec/models/form/lettings/questions/referral_prp_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::ReferralPrp, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -64,7 +64,7 @@ RSpec.describe Form::Lettings::Questions::ReferralPrp, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/referral_spec.rb b/spec/models/form/lettings/questions/referral_spec.rb index b3f526697..75e6c2f42 100644 --- a/spec/models/form/lettings/questions/referral_spec.rb +++ b/spec/models/form/lettings/questions/referral_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Referral, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -62,7 +62,7 @@ RSpec.describe Form::Lettings::Questions::Referral, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/referral_supported_housing_prp_spec.rb b/spec/models/form/lettings/questions/referral_supported_housing_prp_spec.rb index ab13acd26..3059c122d 100644 --- a/spec/models/form/lettings/questions/referral_supported_housing_prp_spec.rb +++ b/spec/models/form/lettings/questions/referral_supported_housing_prp_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::ReferralSupportedHousingPrp, type: :mo let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -64,7 +64,7 @@ RSpec.describe Form::Lettings::Questions::ReferralSupportedHousingPrp, type: :mo let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/referral_supported_housing_spec.rb b/spec/models/form/lettings/questions/referral_supported_housing_spec.rb index 5e05bf65b..5a4af55e5 100644 --- a/spec/models/form/lettings/questions/referral_supported_housing_spec.rb +++ b/spec/models/form/lettings/questions/referral_supported_housing_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::ReferralSupportedHousing, type: :model let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -62,7 +62,7 @@ RSpec.describe Form::Lettings::Questions::ReferralSupportedHousing, type: :model let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/renewal_spec.rb b/spec/models/form/lettings/questions/renewal_spec.rb index 27fe1bf86..af2c22c15 100644 --- a/spec/models/form/lettings/questions/renewal_spec.rb +++ b/spec/models/form/lettings/questions/renewal_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Renewal, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/rent_type_spec.rb b/spec/models/form/lettings/questions/rent_type_spec.rb index 0716cdbf7..7d45320ad 100644 --- a/spec/models/form/lettings/questions/rent_type_spec.rb +++ b/spec/models/form/lettings/questions/rent_type_spec.rb @@ -12,7 +12,7 @@ RSpec.describe Form::Lettings::Questions::RentType, type: :model do before do allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct page" do @@ -37,7 +37,7 @@ RSpec.describe Form::Lettings::Questions::RentType, type: :model do context "when 2023" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has the correct answer_options" do @@ -58,7 +58,7 @@ RSpec.describe Form::Lettings::Questions::RentType, type: :model do context "when 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/rsnvac_spec.rb b/spec/models/form/lettings/questions/rsnvac_spec.rb index 45469cebb..5eb37ddb5 100644 --- a/spec/models/form/lettings/questions/rsnvac_spec.rb +++ b/spec/models/form/lettings/questions/rsnvac_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::Rsnvac, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -78,7 +78,7 @@ RSpec.describe Form::Lettings::Questions::Rsnvac, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/scheme_id_spec.rb b/spec/models/form/lettings/questions/scheme_id_spec.rb index c490cded4..ba5734b3b 100644 --- a/spec/models/form/lettings/questions/scheme_id_spec.rb +++ b/spec/models/form/lettings/questions/scheme_id_spec.rb @@ -12,7 +12,7 @@ RSpec.describe Form::Lettings::Questions::SchemeId, type: :model do before do allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct page" do diff --git a/spec/models/form/lettings/questions/sheltered_spec.rb b/spec/models/form/lettings/questions/sheltered_spec.rb index 33b1007d2..1f21a92eb 100644 --- a/spec/models/form/lettings/questions/sheltered_spec.rb +++ b/spec/models/form/lettings/questions/sheltered_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Lettings::Questions::Sheltered, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -40,7 +40,7 @@ RSpec.describe Form::Lettings::Questions::Sheltered, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb b/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb index d3022dfcf..1100796c8 100644 --- a/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb +++ b/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Form::Lettings::Questions::StarterTenancyType, type: :model do context "with 2023/24 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has the correct answer options" do @@ -50,7 +50,7 @@ RSpec.describe Form::Lettings::Questions::StarterTenancyType, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer options" do diff --git a/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb b/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb index 4bab9187a..ba9a72001 100644 --- a/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthAffordableRent, type: :mo let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb b/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb index a3f9c80e2..55b51ccfa 100644 --- a/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthIntermediateRent, type: : let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/lettings/questions/tenancy_type_spec.rb b/spec/models/form/lettings/questions/tenancy_type_spec.rb index 08818d3ea..82a5ae3e7 100644 --- a/spec/models/form/lettings/questions/tenancy_type_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_type_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Lettings::Questions::TenancyType, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -31,7 +31,7 @@ RSpec.describe Form::Lettings::Questions::TenancyType, type: :model do context "with 2023/24 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has the correct answer options" do @@ -65,7 +65,7 @@ RSpec.describe Form::Lettings::Questions::TenancyType, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer options" do diff --git a/spec/models/form/lettings/questions/waityear_spec.rb b/spec/models/form/lettings/questions/waityear_spec.rb index 5f1f344b9..5d9a5b3a9 100644 --- a/spec/models/form/lettings/questions/waityear_spec.rb +++ b/spec/models/form/lettings/questions/waityear_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Lettings::Questions::Waityear, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -59,7 +59,7 @@ RSpec.describe Form::Lettings::Questions::Waityear, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/lettings/questions/wheelchair_spec.rb b/spec/models/form/lettings/questions/wheelchair_spec.rb index 984a2209f..0a9226ada 100644 --- a/spec/models/form/lettings/questions/wheelchair_spec.rb +++ b/spec/models/form/lettings/questions/wheelchair_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Lettings::Questions::Wheelchair, type: :model do before do allow(page).to receive(:subsection).and_return(subsection) - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct page" do diff --git a/spec/models/form/lettings/subsections/household_characteristics_spec.rb b/spec/models/form/lettings/subsections/household_characteristics_spec.rb index e199f55d3..b97717077 100644 --- a/spec/models/form/lettings/subsections/household_characteristics_spec.rb +++ b/spec/models/form/lettings/subsections/household_characteristics_spec.rb @@ -18,7 +18,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod context "with start year before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct pages" do @@ -152,7 +152,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod context "with start year >= 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do diff --git a/spec/models/form/lettings/subsections/household_situation_spec.rb b/spec/models/form/lettings/subsections/household_situation_spec.rb index dd6f20d89..b9f65dbdd 100644 --- a/spec/models/form/lettings/subsections/household_situation_spec.rb +++ b/spec/models/form/lettings/subsections/household_situation_spec.rb @@ -18,7 +18,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdSituation, type: :model do context "with form year before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct pages" do @@ -48,7 +48,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdSituation, type: :model do context "with form year >= 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do diff --git a/spec/models/form/lettings/subsections/property_information_spec.rb b/spec/models/form/lettings/subsections/property_information_spec.rb index d333ff669..cc12f621a 100644 --- a/spec/models/form/lettings/subsections/property_information_spec.rb +++ b/spec/models/form/lettings/subsections/property_information_spec.rb @@ -14,7 +14,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do let(:form) { instance_double(Form, start_date:) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end context "when 2023" do @@ -51,7 +51,7 @@ RSpec.describe Form::Lettings::Subsections::PropertyInformation, type: :model do let(:start_date) { Time.utc(2024, 2, 8) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do diff --git a/spec/models/form/lettings/subsections/setup_spec.rb b/spec/models/form/lettings/subsections/setup_spec.rb index 074f7ae5e..997f4d08e 100644 --- a/spec/models/form/lettings/subsections/setup_spec.rb +++ b/spec/models/form/lettings/subsections/setup_spec.rb @@ -18,7 +18,7 @@ RSpec.describe Form::Lettings::Subsections::Setup, type: :model do context "with start year before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct pages" do @@ -43,7 +43,7 @@ RSpec.describe Form::Lettings::Subsections::Setup, type: :model do context "with start year >= 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do diff --git a/spec/models/form/lettings/subsections/tenancy_information_spec.rb b/spec/models/form/lettings/subsections/tenancy_information_spec.rb index 0c69f89ab..fce8e57fb 100644 --- a/spec/models/form/lettings/subsections/tenancy_information_spec.rb +++ b/spec/models/form/lettings/subsections/tenancy_information_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Form::Lettings::Subsections::TenancyInformation, type: :model do let(:form) { instance_double(Form, start_date:) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end context "when 2023" do @@ -33,7 +33,7 @@ RSpec.describe Form::Lettings::Subsections::TenancyInformation, type: :model do let(:start_date) { Time.utc(2024, 2, 8) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_arab_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_arab_spec.rb index 68328a5db..a5cf4dd07 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_arab_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_arab_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundArab, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_asian_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_asian_spec.rb index b4c8a198d..c0eb8a108 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_asian_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_asian_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundAsian, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_black_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_black_spec.rb index 7650f49fa..0a04ff806 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_black_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_black_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundBlack, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_mixed_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_mixed_spec.rb index 42420774f..e7cae6445 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_mixed_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_mixed_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundMixed, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_white_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_white_spec.rb index 79dddc53a..ff45cd2c3 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_white_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_white_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundWhite, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/sales/pages/buyer1_ethnic_group_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_group_spec.rb index dcc90fe51..9a94fc0fd 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_group_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_group_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicGroup, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/buyer1_live_in_property_spec.rb b/spec/models/form/sales/pages/buyer1_live_in_property_spec.rb index 2f3c92aa7..edc53bd79 100644 --- a/spec/models/form/sales/pages/buyer1_live_in_property_spec.rb +++ b/spec/models/form/sales/pages/buyer1_live_in_property_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::Buyer1LiveInProperty, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/buyer1_nationality_spec.rb b/spec/models/form/sales/pages/buyer1_nationality_spec.rb index a9cb1e381..a84a44009 100644 --- a/spec/models/form/sales/pages/buyer1_nationality_spec.rb +++ b/spec/models/form/sales/pages/buyer1_nationality_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Pages::Buyer1Nationality, type: :model do before do allow(subsection).to receive(:form).and_return(form) - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct subsection" do @@ -33,7 +33,7 @@ RSpec.describe Form::Sales::Pages::Buyer1Nationality, type: :model do context "with year 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct questions" do diff --git a/spec/models/form/sales/pages/buyer1_working_situation_spec.rb b/spec/models/form/sales/pages/buyer1_working_situation_spec.rb index 2ae7f0f1e..fb8529967 100644 --- a/spec/models/form/sales/pages/buyer1_working_situation_spec.rb +++ b/spec/models/form/sales/pages/buyer1_working_situation_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::Buyer1WorkingSituation, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/buyer2_nationality_spec.rb b/spec/models/form/sales/pages/buyer2_nationality_spec.rb index 97b5f7caf..e01215d21 100644 --- a/spec/models/form/sales/pages/buyer2_nationality_spec.rb +++ b/spec/models/form/sales/pages/buyer2_nationality_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Pages::Buyer2Nationality, type: :model do before do allow(subsection).to receive(:form).and_return(form) - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct subsection" do @@ -42,7 +42,7 @@ RSpec.describe Form::Sales::Pages::Buyer2Nationality, type: :model do context "with year 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct questions" do diff --git a/spec/models/form/sales/pages/buyer2_relationship_to_buyer1_spec.rb b/spec/models/form/sales/pages/buyer2_relationship_to_buyer1_spec.rb index 96a67f5bf..6fbd835c5 100644 --- a/spec/models/form/sales/pages/buyer2_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/pages/buyer2_relationship_to_buyer1_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::Buyer2RelationshipToBuyer1, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/buyer_interview_spec.rb b/spec/models/form/sales/pages/buyer_interview_spec.rb index 24704526d..f7c6bbb70 100644 --- a/spec/models/form/sales/pages/buyer_interview_spec.rb +++ b/spec/models/form/sales/pages/buyer_interview_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::BuyerInterview, type: :model do let(:page_id) { "buyer_interview" } let(:page_definition) { nil } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false) } let(:subsection) { instance_double(Form::Subsection, form:, id: "setup") } it "has correct subsection" do @@ -45,7 +45,7 @@ RSpec.describe Form::Sales::Pages::BuyerInterview, type: :model do end 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) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: true) } context "when there are joint buyers" do subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) } diff --git a/spec/models/form/sales/pages/buyer_live_spec.rb b/spec/models/form/sales/pages/buyer_live_spec.rb index dd237214c..ac5ac2c27 100644 --- a/spec/models/form/sales/pages/buyer_live_spec.rb +++ b/spec/models/form/sales/pages/buyer_live_spec.rb @@ -11,7 +11,7 @@ RSpec.describe Form::Sales::Pages::BuyerLive, type: :model do let(:form) { instance_double(Form, start_date: current_collection_start_date) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/sales/pages/buyer_previous_spec.rb b/spec/models/form/sales/pages/buyer_previous_spec.rb index d55243dec..8e1486ee6 100644 --- a/spec/models/form/sales/pages/buyer_previous_spec.rb +++ b/spec/models/form/sales/pages/buyer_previous_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Sales::Pages::BuyerPrevious, type: :model do let(:page_definition) { nil } let(:subsection) { instance_double(Form::Subsection, depends_on: nil, enabled?: true, form:) } let(:start_date_after_2024) { false } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: start_date_after_2024, depends_on_met: true) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: start_date_after_2024, depends_on_met: true) } let(:joint_purchase) { false } it "has correct subsection" do diff --git a/spec/models/form/sales/pages/deposit_discount_spec.rb b/spec/models/form/sales/pages/deposit_discount_spec.rb index d183e379b..f94c46707 100644 --- a/spec/models/form/sales/pages/deposit_discount_spec.rb +++ b/spec/models/form/sales/pages/deposit_discount_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Pages::DepositDiscount, type: :model do let(:subsection) { instance_double(Form::Subsection) } before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct subsection" do @@ -45,7 +45,7 @@ RSpec.describe Form::Sales::Pages::DepositDiscount, type: :model do context "when it's a 2024 form" do before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: true, start_date: Time.zone.local(2024, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: true, start_date: Time.zone.local(2024, 4, 1))) end it "has correct depends_on" do diff --git a/spec/models/form/sales/pages/deposit_spec.rb b/spec/models/form/sales/pages/deposit_spec.rb index b33604176..ea309bffc 100644 --- a/spec/models/form/sales/pages/deposit_spec.rb +++ b/spec/models/form/sales/pages/deposit_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Sales::Pages::Deposit, type: :model do let(:page_id) { nil } let(:page_definition) { nil } let(:subsection) { instance_double(Form::Subsection, enabled?: true, depends_on: true) } - let(:form) { instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1), depends_on_met: true) } + let(:form) { instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1), depends_on_met: true) } let(:optional) { false } before do @@ -31,7 +31,7 @@ RSpec.describe Form::Sales::Pages::Deposit, type: :model do context "when routing with start year after 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end context "and optional is false" do @@ -131,7 +131,7 @@ RSpec.describe Form::Sales::Pages::Deposit, type: :model do context "when routing with start year before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end context "and optional is false" do diff --git a/spec/models/form/sales/pages/discount_spec.rb b/spec/models/form/sales/pages/discount_spec.rb index 4585b7f19..c9fb16095 100644 --- a/spec/models/form/sales/pages/discount_spec.rb +++ b/spec/models/form/sales/pages/discount_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Pages::Discount, type: :model do let(:subsection) { instance_double(Form::Subsection) } before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct subsection" do diff --git a/spec/models/form/sales/pages/la_nominations_spec.rb b/spec/models/form/sales/pages/la_nominations_spec.rb index b69f88f1f..036e26092 100644 --- a/spec/models/form/sales/pages/la_nominations_spec.rb +++ b/spec/models/form/sales/pages/la_nominations_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Pages::LaNominations, type: :model do let(:page_id) { nil } let(:page_definition) { nil } let(:start_year_after_2024) { false } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: start_year_after_2024) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: start_year_after_2024) } let(:subsection) { instance_double(Form::Subsection, form:) } before do diff --git a/spec/models/form/sales/pages/last_accommodation_la_spec.rb b/spec/models/form/sales/pages/last_accommodation_la_spec.rb index b73cf07f0..9cdd64957 100644 --- a/spec/models/form/sales/pages/last_accommodation_la_spec.rb +++ b/spec/models/form/sales/pages/last_accommodation_la_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Sales::Pages::LastAccommodationLa, type: :model do let(:page_id) { nil } let(:page_definition) { nil } let(:start_year_after_2024) { false } - let(:form) { instance_double(Form, depends_on_met: true, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: start_year_after_2024) } + let(:form) { instance_double(Form, depends_on_met: true, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: start_year_after_2024) } let(:subsection) { instance_double(Form::Subsection, form:, depends_on: nil, enabled?: true) } let(:log) { build(:sales_log, :completed) } diff --git a/spec/models/form/sales/pages/last_accommodation_spec.rb b/spec/models/form/sales/pages/last_accommodation_spec.rb index 8c3dbdbbf..fbc581b4b 100644 --- a/spec/models/form/sales/pages/last_accommodation_spec.rb +++ b/spec/models/form/sales/pages/last_accommodation_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Pages::LastAccommodation, type: :model do let(:page_id) { nil } let(:page_definition) { nil } let(:start_year_after_2024) { false } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: start_year_after_2024) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: start_year_after_2024) } let(:subsection) { instance_double(Form::Subsection, form:, depends_on: nil) } it "has correct subsection" do diff --git a/spec/models/form/sales/pages/managing_organisation_spec.rb b/spec/models/form/sales/pages/managing_organisation_spec.rb index ea90add64..30383a1f5 100644 --- a/spec/models/form/sales/pages/managing_organisation_spec.rb +++ b/spec/models/form/sales/pages/managing_organisation_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Sales::Pages::ManagingOrganisation, type: :model do let(:page_id) { nil } let(:page_definition) { nil } let(:subsection) { instance_double(Form::Subsection, form:) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false) } it "has correct subsection" do expect(page.subsection).to eq(subsection) @@ -103,7 +103,7 @@ RSpec.describe Form::Sales::Pages::ManagingOrganisation, type: :model do describe "#routed_to? with 2024 logs" do let(:log) { create(:sales_log) } let(:organisation) { create(:organisation) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: true) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: true) } context "when user nil" do it "is not shown" do diff --git a/spec/models/form/sales/pages/person_relationship_to_buyer1_spec.rb b/spec/models/form/sales/pages/person_relationship_to_buyer1_spec.rb index 126f2f0b5..aeb196337 100644 --- a/spec/models/form/sales/pages/person_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/pages/person_relationship_to_buyer1_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Form::Sales::Pages::PersonRelationshipToBuyer1, 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, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false)) } let(:person_index) { 1 } let(:page_id) { "person_1_relationship_to_buyer_1" } diff --git a/spec/models/form/sales/pages/privacy_notice_spec.rb b/spec/models/form/sales/pages/privacy_notice_spec.rb index 7510e60d9..80be7ae66 100644 --- a/spec/models/form/sales/pages/privacy_notice_spec.rb +++ b/spec/models/form/sales/pages/privacy_notice_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do let(:page_id) { "privacy_notice" } let(:page_definition) { nil } 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) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false) } before do allow(subsection).to receive(:form).and_return(form) @@ -40,7 +40,7 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do 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) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: true) } it "has the expected copy_key" do expect(page.copy_key).to eq("sales.setup.privacynotice.joint_purchase") @@ -64,7 +64,7 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do 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) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: true) } it "has the expected copy_key" do expect(page.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase") diff --git a/spec/models/form/sales/pages/property_local_authority_spec.rb b/spec/models/form/sales/pages/property_local_authority_spec.rb index faba75665..88d049bce 100644 --- a/spec/models/form/sales/pages/property_local_authority_spec.rb +++ b/spec/models/form/sales/pages/property_local_authority_spec.rb @@ -44,7 +44,7 @@ RSpec.describe Form::Sales::Pages::PropertyLocalAuthority, type: :model do context "with form before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "is routed to when la is not inferred" do @@ -60,7 +60,7 @@ RSpec.describe Form::Sales::Pages::PropertyLocalAuthority, type: :model do context "with form after 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "is routed to when la is not inferred and address search has been given" do diff --git a/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb b/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb index 9d60c5f3c..01dcb7ce7 100644 --- a/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb +++ b/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Pages::PropertyWheelchairAccessible, type: :model do let(:subsection) { instance_double(Form::Subsection) } before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct subsection" do diff --git a/spec/models/form/sales/pages/purchase_price_spec.rb b/spec/models/form/sales/pages/purchase_price_spec.rb index e5bfb176a..ad857ee9f 100644 --- a/spec/models/form/sales/pages/purchase_price_spec.rb +++ b/spec/models/form/sales/pages/purchase_price_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Pages::PurchasePrice, type: :model do let(:subsection) { instance_double(Form::Subsection) } before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct subsection" do diff --git a/spec/models/form/sales/pages/shared_ownership_type_spec.rb b/spec/models/form/sales/pages/shared_ownership_type_spec.rb index d12c49b57..e6ae7d55d 100644 --- a/spec/models/form/sales/pages/shared_ownership_type_spec.rb +++ b/spec/models/form/sales/pages/shared_ownership_type_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Form::Sales::Pages::SharedOwnershipType, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: current_collection_start_date, start_year_after_2024?: true)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: current_collection_start_date, start_year_2024_or_later?: true)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/uprn_spec.rb b/spec/models/form/sales/pages/uprn_spec.rb index 17ef3179b..03e1197bc 100644 --- a/spec/models/form/sales/pages/uprn_spec.rb +++ b/spec/models/form/sales/pages/uprn_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Form::Sales::Pages::Uprn, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(subsection).to receive(:form).and_return(form) end @@ -57,7 +57,7 @@ RSpec.describe Form::Sales::Pages::Uprn, type: :model do context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "points to address search page" do diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb index 593a525d2..c5f243745 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundArab, type: :model 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), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb index f49d64437..6cf9306b2 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundAsian, type: :model 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), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb index 6afe4eaf5..cb040ffbd 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundBlack, type: :model 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), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb index d6e51de58..aced8cb58 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundMixed, type: :model 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), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb index d08ece820..6aa547e8b 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundWhite, type: :model let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -44,7 +44,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundWhite, type: :model context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/sales/questions/buyer1_ethnic_group_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_group_spec.rb index 0bdc6d9c0..8a859100d 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_group_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_group_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicGroup, 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), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/sales/questions/buyer1_live_in_property_spec.rb b/spec/models/form/sales/questions/buyer1_live_in_property_spec.rb index eccb172f7..038e0ce5d 100644 --- a/spec/models/form/sales/questions/buyer1_live_in_property_spec.rb +++ b/spec/models/form/sales/questions/buyer1_live_in_property_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::Buyer1LiveInProperty, 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), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/sales/questions/buyer1_working_situation_spec.rb b/spec/models/form/sales/questions/buyer1_working_situation_spec.rb index c99e64527..e25eb2aaf 100644 --- a/spec/models/form/sales/questions/buyer1_working_situation_spec.rb +++ b/spec/models/form/sales/questions/buyer1_working_situation_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::Buyer1WorkingSituation, 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), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb index 8d81e8897..6cab95147 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundWhite, type: :model let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -44,7 +44,7 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundWhite, type: :model context "with 2024/25 form" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb b/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb index 1d478faa9..99185a592 100644 --- a/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::Buyer2RelationshipToBuyer1, type: :model 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), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/sales/questions/buyer_interview_spec.rb b/spec/models/form/sales/questions/buyer_interview_spec.rb index e2b39c50f..0db43407f 100644 --- a/spec/models/form/sales/questions/buyer_interview_spec.rb +++ b/spec/models/form/sales/questions/buyer_interview_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do let(:question_id) { nil } let(:question_definition) { nil } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: true) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: true) } let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form:, id: "setup")) } it "has correct page" do @@ -36,7 +36,7 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do 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) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 3, 1), start_year_2024_or_later?: false) } it "has the expected copy_key" do expect(question.copy_key).to eq("sales.household_characteristics.noint.joint_purchase") @@ -44,7 +44,7 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do 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) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: true) } it "has the expected copy_key" do expect(question.copy_key).to eq("sales.setup.noint.joint_purchase") @@ -57,7 +57,7 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do 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) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false) } it "has the expected copy_key" do expect(question.copy_key).to eq("sales.household_characteristics.noint.not_joint_purchase") @@ -65,7 +65,7 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do 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) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: true) } it "has the expected copy_key" do expect(question.copy_key).to eq("sales.setup.noint.not_joint_purchase") diff --git a/spec/models/form/sales/questions/buyer_live_spec.rb b/spec/models/form/sales/questions/buyer_live_spec.rb index 12dfc8be6..4356db5dd 100644 --- a/spec/models/form/sales/questions/buyer_live_spec.rb +++ b/spec/models/form/sales/questions/buyer_live_spec.rb @@ -12,7 +12,7 @@ RSpec.describe Form::Sales::Questions::BuyerLive, type: :model do let(:form) { instance_double(Form, start_date: current_collection_start_date) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end diff --git a/spec/models/form/sales/questions/buyer_previous_spec.rb b/spec/models/form/sales/questions/buyer_previous_spec.rb index 8c37c2ff2..88204ad1a 100644 --- a/spec/models/form/sales/questions/buyer_previous_spec.rb +++ b/spec/models/form/sales/questions/buyer_previous_spec.rb @@ -48,7 +48,7 @@ RSpec.describe Form::Sales::Questions::BuyerPrevious, type: :model do context "when form year is before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "is not marked as derived" do @@ -58,7 +58,7 @@ RSpec.describe Form::Sales::Questions::BuyerPrevious, type: :model do context "when form year is >= 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "is marked as derived" do diff --git a/spec/models/form/sales/questions/discount_spec.rb b/spec/models/form/sales/questions/discount_spec.rb index 5037e2b4e..09c2fa076 100644 --- a/spec/models/form/sales/questions/discount_spec.rb +++ b/spec/models/form/sales/questions/discount_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Sales::Questions::Discount, type: :model do before do allow(page).to receive(:subsection).and_return(subsection) - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct page" do @@ -47,7 +47,7 @@ RSpec.describe Form::Sales::Questions::Discount, type: :model do context "with form start year after 2024" do before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: true, start_date: Time.zone.local(2024, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: true, start_date: Time.zone.local(2024, 4, 1))) end it "has correct max" do diff --git a/spec/models/form/sales/questions/mortgage_lender_spec.rb b/spec/models/form/sales/questions/mortgage_lender_spec.rb index a7abd4c16..b4ce1bf86 100644 --- a/spec/models/form/sales/questions/mortgage_lender_spec.rb +++ b/spec/models/form/sales/questions/mortgage_lender_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Sales::Questions::MortgageLender, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?) + allow(form).to receive(:start_year_2024_or_later?) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -46,7 +46,7 @@ RSpec.describe Form::Sales::Questions::MortgageLender, type: :model do context "when form year is before 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has the correct answer_options" do @@ -145,7 +145,7 @@ RSpec.describe Form::Sales::Questions::MortgageLender, type: :model do context "when form year is >= 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/sales/questions/mortgageused_spec.rb b/spec/models/form/sales/questions/mortgageused_spec.rb index 7c37cbd78..e85238a4d 100644 --- a/spec/models/form/sales/questions/mortgageused_spec.rb +++ b/spec/models/form/sales/questions/mortgageused_spec.rb @@ -35,7 +35,7 @@ RSpec.describe Form::Sales::Questions::Mortgageused, type: :model do context "and the saledate is before 24/25" do before do - allow(form).to receive(:start_year_after_2024?).and_return false + allow(form).to receive(:start_year_2024_or_later?).and_return false end it "does not show the don't know option" do @@ -45,7 +45,7 @@ RSpec.describe Form::Sales::Questions::Mortgageused, type: :model do context "and the saledate is 24/25 or after" do before do - allow(form).to receive(:start_year_after_2024?).and_return true + allow(form).to receive(:start_year_2024_or_later?).and_return true end it "shows the don't know option" do diff --git a/spec/models/form/sales/questions/nationality_all_group_spec.rb b/spec/models/form/sales/questions/nationality_all_group_spec.rb index a88bf1867..4c2b2a39e 100644 --- a/spec/models/form/sales/questions/nationality_all_group_spec.rb +++ b/spec/models/form/sales/questions/nationality_all_group_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::NationalityAllGroup, type: :model do let(:buyer_index) { 1 } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } it "has correct page" do expect(question.page).to be page diff --git a/spec/models/form/sales/questions/number_joint_buyers_spec.rb b/spec/models/form/sales/questions/number_joint_buyers_spec.rb index 9529b3aac..bf53d7d88 100644 --- a/spec/models/form/sales/questions/number_joint_buyers_spec.rb +++ b/spec/models/form/sales/questions/number_joint_buyers_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Sales::Questions::NumberJointBuyers, type: :model do before do allow(page).to receive(:subsection).and_return(subsection) - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct page" do diff --git a/spec/models/form/sales/questions/ownership_scheme_spec.rb b/spec/models/form/sales/questions/ownership_scheme_spec.rb index 99ec32684..222ec180d 100644 --- a/spec/models/form/sales/questions/ownership_scheme_spec.rb +++ b/spec/models/form/sales/questions/ownership_scheme_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Sales::Questions::OwnershipScheme, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -41,7 +41,7 @@ RSpec.describe Form::Sales::Questions::OwnershipScheme, type: :model do context "with collection year on or after 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has the correct answer_options" do diff --git a/spec/models/form/sales/questions/person_age_spec.rb b/spec/models/form/sales/questions/person_age_spec.rb index 5faa046bb..772ee20e0 100644 --- a/spec/models/form/sales/questions/person_age_spec.rb +++ b/spec/models/form/sales/questions/person_age_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do let(:question_id) { "age3" } 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), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } let(:person_index) { 2 } it "has correct page" do diff --git a/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb b/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb index 32fb055cd..0bc00c179 100644 --- a/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model let(:question_id) { "relat2" } 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), start_year_after_2024?: false))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: false))) } let(:person_index) { 2 } it "has correct page" do diff --git a/spec/models/form/sales/questions/privacy_notice_spec.rb b/spec/models/form/sales/questions/privacy_notice_spec.rb index 3f8c030b0..5f764c7af 100644 --- a/spec/models/form/sales/questions/privacy_notice_spec.rb +++ b/spec/models/form/sales/questions/privacy_notice_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } before do - allow(form).to receive(:start_year_after_2024?) + allow(form).to receive(:start_year_2024_or_later?) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -35,7 +35,7 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do let(:subsection) { instance_double(Form::Subsection, id: "household_characteristics") } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end context "and there is a single buyer" do @@ -83,7 +83,7 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do context "when the form year is >= 2024" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end context "and there is a single buyer" do diff --git a/spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb b/spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb index 6b89deff2..a08a6d0f8 100644 --- a/spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb +++ b/spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Form::Sales::Questions::PropertyWheelchairAccessible, type: :mode before do allow(page).to receive(:subsection).and_return(subsection) - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct page" do diff --git a/spec/models/form/sales/questions/shared_ownership_type_spec.rb b/spec/models/form/sales/questions/shared_ownership_type_spec.rb index 91cf6da9e..aa75b381a 100644 --- a/spec/models/form/sales/questions/shared_ownership_type_spec.rb +++ b/spec/models/form/sales/questions/shared_ownership_type_spec.rb @@ -13,7 +13,7 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do let(:page) { instance_double(Form::Page, subsection:) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct page" do @@ -36,7 +36,7 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do let(:start_date) { Time.zone.local(2023, 4, 2) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has the correct answer_options" do @@ -59,7 +59,7 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do context "when form start date is on or after 2024/25" do before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "shows shows correct top_guidance_partial" do diff --git a/spec/models/form/sales/subsections/household_characteristics_spec.rb b/spec/models/form/sales/subsections/household_characteristics_spec.rb index 7c6546d79..3eb5042d8 100644 --- a/spec/models/form/sales/subsections/household_characteristics_spec.rb +++ b/spec/models/form/sales/subsections/household_characteristics_spec.rb @@ -19,7 +19,7 @@ RSpec.describe Form::Sales::Subsections::HouseholdCharacteristics, type: :model context "with 2022/23 form" do before do allow(form).to receive(:start_date).and_return(Time.zone.local(2022, 4, 1)) - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct pages" do @@ -120,7 +120,7 @@ RSpec.describe Form::Sales::Subsections::HouseholdCharacteristics, type: :model context "with 2023/24 form" do before do allow(form).to receive(:start_date).and_return(Time.zone.local(2023, 4, 1)) - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct pages" do @@ -228,7 +228,7 @@ RSpec.describe Form::Sales::Subsections::HouseholdCharacteristics, type: :model context "with 2024/25 form" do before do allow(form).to receive(:start_date).and_return(Time.zone.local(2024, 4, 1)) - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do diff --git a/spec/models/form/sales/subsections/outright_sale_spec.rb b/spec/models/form/sales/subsections/outright_sale_spec.rb index 0d28330f2..52941d0a9 100644 --- a/spec/models/form/sales/subsections/outright_sale_spec.rb +++ b/spec/models/form/sales/subsections/outright_sale_spec.rb @@ -22,7 +22,7 @@ RSpec.describe Form::Sales::Subsections::OutrightSale, type: :model do context "when 2022" do before do allow(form).to receive(:start_date).and_return(Time.zone.local(2022, 2, 8)) - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct pages" do @@ -51,7 +51,7 @@ RSpec.describe Form::Sales::Subsections::OutrightSale, type: :model do before do allow(form).to receive(:start_date).and_return(Time.zone.local(2023, 2, 8)) - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct pages" do @@ -80,7 +80,7 @@ RSpec.describe Form::Sales::Subsections::OutrightSale, type: :model do context "when 2024" do before do allow(form).to receive(:start_date).and_return(Time.zone.local(2024, 2, 8)) - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do diff --git a/spec/models/form/sales/subsections/property_information_spec.rb b/spec/models/form/sales/subsections/property_information_spec.rb index 6e181f738..d29ee85fe 100644 --- a/spec/models/form/sales/subsections/property_information_spec.rb +++ b/spec/models/form/sales/subsections/property_information_spec.rb @@ -14,7 +14,7 @@ RSpec.describe Form::Sales::Subsections::PropertyInformation, type: :model do let(:form) { instance_double(Form, start_date:) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) end context "when 2023" do @@ -47,7 +47,7 @@ RSpec.describe Form::Sales::Subsections::PropertyInformation, type: :model do let(:start_date) { Time.utc(2024, 2, 8) } before do - allow(form).to receive(:start_year_after_2024?).and_return(true) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do diff --git a/spec/models/form/sales/subsections/setup_spec.rb b/spec/models/form/sales/subsections/setup_spec.rb index 2d6612663..70d52977f 100644 --- a/spec/models/form/sales/subsections/setup_spec.rb +++ b/spec/models/form/sales/subsections/setup_spec.rb @@ -22,7 +22,7 @@ RSpec.describe Form::Sales::Subsections::Setup, type: :model do context "when start year is before 2024" do before do - allow(section.form).to receive(:start_year_after_2024?).and_return(false) + allow(section.form).to receive(:start_year_2024_or_later?).and_return(false) end it "has correct pages" do @@ -48,7 +48,7 @@ RSpec.describe Form::Sales::Subsections::Setup, type: :model do context "when start year is >= 2024" do before do - allow(section.form).to receive(:start_year_after_2024?).and_return(true) + allow(section.form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do diff --git a/spec/models/form/sales/subsections/shared_ownership_scheme_spec.rb b/spec/models/form/sales/subsections/shared_ownership_scheme_spec.rb index 922281fd0..8c5674d0b 100644 --- a/spec/models/form/sales/subsections/shared_ownership_scheme_spec.rb +++ b/spec/models/form/sales/subsections/shared_ownership_scheme_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Sales::Subsections::SharedOwnershipScheme, type: :model do let(:section) { instance_double(Form::Sales::Sections::SaleInformation) } before do - allow(section).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: false, start_date: Time.zone.local(2023, 4, 1))) + allow(section).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) end it "has correct section" do diff --git a/spec/models/validations/property_validations_spec.rb b/spec/models/validations/property_validations_spec.rb index 3f6f9877c..8cf484f91 100644 --- a/spec/models/validations/property_validations_spec.rb +++ b/spec/models/validations/property_validations_spec.rb @@ -50,7 +50,7 @@ RSpec.describe Validations::PropertyValidations do context "and the log is from before 24/25" do it "adds an error" do - allow(log.form).to receive(:start_year_after_2024?).and_return false + allow(log.form).to receive(:start_year_2024_or_later?).and_return false property_validator.validate_shared_housing_rooms(log) @@ -76,7 +76,7 @@ RSpec.describe Validations::PropertyValidations do context "and the log is from before 24/25" do it "adds an error" do - allow(log.form).to receive(:start_year_after_2024?).and_return false + allow(log.form).to receive(:start_year_2024_or_later?).and_return false property_validator.validate_shared_housing_rooms(log) From 1ff5c0841a755eca9776bf5f567b6773e3cc2043 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Thu, 7 Nov 2024 17:09:11 +0000 Subject: [PATCH 4/9] CLDC-3066++: Show filters button bug (#2759) * Ensure the app-filter-toggle class is always present regardless of the user's permissions, you can move it outside of the conditional logic --- app/components/create_log_actions_component.html.erb | 4 ++-- app/views/organisations/schemes.html.erb | 11 ++++++----- app/views/organisations/users.html.erb | 5 +++-- app/views/schemes/index.html.erb | 11 ++++++----- app/views/users/index.html.erb | 9 +++++---- 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/app/components/create_log_actions_component.html.erb b/app/components/create_log_actions_component.html.erb index 2e88034d7..53e2bb57b 100644 --- a/app/components/create_log_actions_component.html.erb +++ b/app/components/create_log_actions_component.html.erb @@ -1,5 +1,5 @@ +
"> <% if display_actions? %> -
<%= govuk_button_to create_button_copy, create_button_href, class: "govuk-!-margin-right-3" %> <% unless user.support? %> <%= govuk_button_link_to upload_button_copy, upload_button_href, secondary: true %> @@ -7,5 +7,5 @@ <% if user.support? %> <%= govuk_button_link_to view_uploads_button_copy, view_uploads_button_href, secondary: true %> <% end %> -
<% end %> +
diff --git a/app/views/organisations/schemes.html.erb b/app/views/organisations/schemes.html.erb index 0fda1d359..a6f225bd8 100644 --- a/app/views/organisations/schemes.html.erb +++ b/app/views/organisations/schemes.html.erb @@ -22,11 +22,12 @@ <% end %>
- <% if SchemePolicy.new(current_user, nil).create? %> -
- <%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %> -
- <% end %> + <% display_actions = SchemePolicy.new(current_user, nil).create? %> +
"> + <% if display_actions %> + <%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %> + <% end %> +
<%= govuk_details( classes: "govuk-!-width-two-thirds", diff --git a/app/views/organisations/users.html.erb b/app/views/organisations/users.html.erb index 73a460276..109d8c24a 100644 --- a/app/views/organisations/users.html.erb +++ b/app/views/organisations/users.html.erb @@ -13,8 +13,9 @@ <% end %>
-
- <% if current_user.data_coordinator? || current_user.support? %> + <% display_actions = current_user.data_coordinator? || current_user.support? %> +
"> + <% if display_actions %> <%= govuk_button_link_to "Invite user", new_user_path(organisation_id: @organisation.id), html: { method: :get } %> <% end %>
diff --git a/app/views/schemes/index.html.erb b/app/views/schemes/index.html.erb index 9cbc95fdb..1ca69691e 100644 --- a/app/views/schemes/index.html.erb +++ b/app/views/schemes/index.html.erb @@ -6,11 +6,12 @@ <%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Supported housing schemes", sub: nil } : { main: "Supported housing schemes", sub: current_user.organisation.name } %>
- <% if SchemePolicy.new(current_user, nil).create? %> -
- <%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %> -
- <% end %> + <% display_actions = SchemePolicy.new(current_user, nil).create? %> +
"> + <% if display_actions %> + <%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %> + <% end %> +
<%= render partial: "schemes/scheme_filters" %>
<%= render SearchComponent.new(current_user:, search_label: "Search by postcode, scheme name, scheme code or location name", value: @searched) %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index dd454464d..47d714dbc 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -6,11 +6,12 @@ <%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Users", sub: nil } : { main: "Users", sub: current_user.organisation.name } %>
-<% if current_user.data_coordinator? || current_user.support? %> -
- <%= govuk_button_link_to "Invite user", new_user_path, html: { method: :get } %> + <% display_actions = current_user.data_coordinator? || current_user.support? %> +
"> + <% if display_actions %> + <%= govuk_button_link_to "Invite user", new_user_path, html: { method: :get } %> + <% end %>
-<% end %> <%= render partial: "users/user_filters" %>
<%= render SearchComponent.new(current_user:, search_label: "Search by name or email address", value: @searched) %> From 020b8a4f4c14eb7a4bb2e566b3d4ec19f85f0076 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Mon, 11 Nov 2024 14:51:12 +0000 Subject: [PATCH 5/9] CLDC-3686 Extract lettings soft validations copy (#2735) * Extract household characteristics soft validations * Extract household needs soft validations * Extract household situation soft validations * Extract income and benefits soft validations * Extract property information soft validations * Update tests and 2024 soft validations * Update some test forms * Re-add sales validation * Update BU tests * Fixes * Change higher to longer * Update model test * Update model test * Add 2025 translations copied from 2024 * Update pregnancy and retirement copy --------- Co-authored-by: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Co-authored-by: Rachael Booth --- app/helpers/interruption_screen_helper.rb | 2 +- .../pages/care_home_charges_value_check.rb | 8 +- ...pregnant_household_lead_age_value_check.rb | 9 +- ...gnant_household_lead_hhmemb_value_check.rb | 9 +- ..._in_pregnant_household_lead_value_check.rb | 9 +- ...egnant_household_person_age_value_check.rb | 21 +-- ...n_pregnant_household_person_value_check.rb | 22 +-- ...range_in_pregnant_household_value_check.rb | 9 +- ...lead_tenant_over_retirement_value_check.rb | 6 +- ...ead_tenant_under_retirement_value_check.rb | 8 +- .../pages/multiple_partners_value_check.rb | 8 +- .../lettings/pages/net_income_value_check.rb | 5 +- ...pregnant_household_lead_age_value_check.rb | 9 +- ...gnant_household_lead_hhmemb_value_check.rb | 9 +- ...les_pregnant_household_lead_value_check.rb | 9 +- ...egnant_household_person_age_value_check.rb | 9 +- ...s_pregnant_household_person_value_check.rb | 9 +- ..._females_pregnant_household_value_check.rb | 9 +- .../pages/partner_under_16_value_check.rb | 8 +- .../person_over_retirement_value_check.rb | 6 +- .../person_under_retirement_value_check.rb | 8 +- .../property_major_repairs_value_check.rb | 5 +- .../lettings/pages/pscharge_value_check.rb | 8 +- .../lettings/pages/reasonother_value_check.rb | 5 +- .../lettings/pages/referral_value_check.rb | 5 +- .../form/lettings/pages/rent_value_check.rb | 5 +- .../lettings/pages/scharge_value_check.rb | 8 +- .../lettings/pages/supcharg_value_check.rb | 8 +- .../lettings/pages/void_date_value_check.rb | 5 +- .../care_home_charges_value_check.rb | 3 +- .../major_repairs_date_value_check.rb | 3 +- .../multiple_partners_value_check.rb | 3 +- .../questions/net_income_value_check.rb | 3 +- .../questions/no_retirement_value_check.rb | 3 +- .../questions/partner_under_16_value_check.rb | 3 +- .../questions/pregnancy_value_check.rb | 3 +- .../questions/pscharge_value_check.rb | 4 +- .../questions/reasonother_value_check.rb | 3 +- .../questions/referral_value_check.rb | 3 +- .../lettings/questions/rent_value_check.rb | 4 +- .../questions/retirement_value_check.rb | 3 +- .../lettings/questions/scharge_value_check.rb | 4 +- .../questions/supcharg_value_check.rb | 4 +- .../questions/void_date_value_check.rb | 3 +- config/forms/2021_2022.json | 4 +- config/forms/2022_2023.json | 4 +- config/locales/en.yml | 45 ------ .../2023/lettings/soft_validations.en.yml | 132 ++++++++++++++++++ .../2024/lettings/soft_validations.en.yml | 132 ++++++++++++++++++ .../2025/lettings/soft_validations.en.yml | 132 ++++++++++++++++++ spec/fixtures/forms/2021_2022.json | 4 +- .../interruption_screen_helper_spec.rb | 2 +- .../care_home_charges_value_check_spec.rb | 4 +- ...t_household_person_age_value_check_spec.rb | 40 ++---- ...gnant_household_person_value_check_spec.rb | 40 ++---- .../multiple_partners_value_check_spec.rb | 11 +- .../pages/net_income_value_check_spec.rb | 4 +- ...t_household_person_age_value_check_spec.rb | 40 ++---- ...gnant_household_person_value_check_spec.rb | 40 ++---- .../pages/partner_under16_value_check_spec.rb | 27 ++-- ...person_over_retirement_value_check_spec.rb | 10 +- ...erson_under_retirement_value_check_spec.rb | 8 +- .../household_characteristics_spec.rb | 2 +- .../subsections/household_needs_spec.rb | 3 +- .../subsections/household_situation_spec.rb | 2 +- .../subsections/income_and_benefits_spec.rb | 3 +- .../lettings/year2023/row_parser_spec.rb | 4 +- .../lettings/year2024/row_parser_spec.rb | 4 +- 68 files changed, 630 insertions(+), 357 deletions(-) create mode 100644 config/locales/forms/2023/lettings/soft_validations.en.yml create mode 100644 config/locales/forms/2024/lettings/soft_validations.en.yml create mode 100644 config/locales/forms/2025/lettings/soft_validations.en.yml diff --git a/app/helpers/interruption_screen_helper.rb b/app/helpers/interruption_screen_helper.rb index 7d9a38ddf..e4c09a050 100644 --- a/app/helpers/interruption_screen_helper.rb +++ b/app/helpers/interruption_screen_helper.rb @@ -1,7 +1,7 @@ module InterruptionScreenHelper def display_informative_text(informative_text, log) return informative_text if informative_text.is_a? String - return "" if informative_text.nil? + return "" if informative_text.blank? return "" unless informative_text["arguments"] translation_params = {} diff --git a/app/models/form/lettings/pages/care_home_charges_value_check.rb b/app/models/form/lettings/pages/care_home_charges_value_check.rb index 2cf253bf6..78e598e86 100644 --- a/app/models/form/lettings/pages/care_home_charges_value_check.rb +++ b/app/models/form/lettings/pages/care_home_charges_value_check.rb @@ -2,11 +2,15 @@ class Form::Lettings::Pages::CareHomeChargesValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "care_home_charges_value_check" + @copy_key = "lettings.soft_validations.care_home_charges_value_check" @depends_on = [{ "care_home_charge_expected_not_provided?" => true }] @title_text = { - "translation" => "soft_validations.care_home_charges.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + } + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } - @informative_text = "" end def questions diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb index d91794525..5b06d6a28 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadAgeValu def initialize(id, hsh, subsection) super(id, hsh, subsection) @id = "females_in_soft_age_range_in_pregnant_household_lead_age_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb index 6fc8bdd16..3e961b283 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadHhmembV def initialize(id, hsh, subsection) super(id, hsh, subsection) @id = "females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb index 9a2b707b3..af568b039 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadValueCh def initialize(id, hsh, subsection) super @id = "females_in_soft_age_range_in_pregnant_household_lead_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb index 0b2e2451f..ddc8789f9 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeVa def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @id = "females_in_soft_age_range_in_pregnant_household_person_#{person_index}_age_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" @depends_on = [ { "female_in_pregnant_household_in_soft_validation_range?" => true, @@ -9,24 +10,12 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeVa }, ] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } @person_index = person_index end diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb index c8d484bf4..099bea5d9 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb @@ -2,6 +2,8 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValue def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @id = "females_in_soft_age_range_in_pregnant_household_person_#{person_index}_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" + @depends_on = [ { "female_in_pregnant_household_in_soft_validation_range?" => true, @@ -9,24 +11,12 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValue }, ] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } @person_index = person_index end diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb index c816fb0b2..3822ec940 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdValueCheck def initialize(id, hsh, subsection) super @id = "females_in_soft_age_range_in_pregnant_household_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/lead_tenant_over_retirement_value_check.rb b/app/models/form/lettings/pages/lead_tenant_over_retirement_value_check.rb index b5add868b..43b00844c 100644 --- a/app/models/form/lettings/pages/lead_tenant_over_retirement_value_check.rb +++ b/app/models/form/lettings/pages/lead_tenant_over_retirement_value_check.rb @@ -2,11 +2,13 @@ class Form::Lettings::Pages::LeadTenantOverRetirementValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @depends_on = [{ "person_1_not_retired_over_soft_max_age?" => true }] + @copy_key = "lettings.soft_validations.retirement_value_check" @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/lettings/pages/lead_tenant_under_retirement_value_check.rb b/app/models/form/lettings/pages/lead_tenant_under_retirement_value_check.rb index 0c7a3ed2e..66a87c2bf 100644 --- a/app/models/form/lettings/pages/lead_tenant_under_retirement_value_check.rb +++ b/app/models/form/lettings/pages/lead_tenant_under_retirement_value_check.rb @@ -2,8 +2,9 @@ class Form::Lettings::Pages::LeadTenantUnderRetirementValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @depends_on = [{ "person_1_retired_under_soft_min_age?" => true }] + @copy_key = "lettings.soft_validations.no_retirement_value_check" @title_text = { - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "age1", @@ -12,7 +13,10 @@ class Form::Lettings::Pages::LeadTenantUnderRetirementValueCheck < ::Form::Page }, ], } - @informative_text = {} + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } end def questions diff --git a/app/models/form/lettings/pages/multiple_partners_value_check.rb b/app/models/form/lettings/pages/multiple_partners_value_check.rb index 3f9cdb3ae..4e9167a12 100644 --- a/app/models/form/lettings/pages/multiple_partners_value_check.rb +++ b/app/models/form/lettings/pages/multiple_partners_value_check.rb @@ -6,12 +6,16 @@ class Form::Lettings::Pages::MultiplePartnersValueCheck < Form::Page "multiple_partners?" => true, }, ] + @copy_key = "lettings.soft_validations.multiple_partners_value_check" @person_index = person_index @title_text = { - "translation" => "soft_validations.multiple_partners_lettings.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/lettings/pages/net_income_value_check.rb b/app/models/form/lettings/pages/net_income_value_check.rb index ccb2b2a08..9bdce131d 100644 --- a/app/models/form/lettings/pages/net_income_value_check.rb +++ b/app/models/form/lettings/pages/net_income_value_check.rb @@ -2,9 +2,10 @@ class Form::Lettings::Pages::NetIncomeValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "net_income_value_check" + @copy_key = "lettings.soft_validations.net_income_value_check" @depends_on = [{ "net_income_soft_validation_triggered?" => true }] @title_text = { - "translation" => "soft_validations.net_income.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "incfreq", @@ -20,7 +21,7 @@ class Form::Lettings::Pages::NetIncomeValueCheck < ::Form::Page } @informative_text = { - "translation" => "soft_validations.net_income.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [ { "key" => "net_income_higher_or_lower_text", diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_lead_age_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_lead_age_value_check.rb index 68b1c7f09..7e530a9ad 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_lead_age_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_lead_age_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadAgeValueCheck < ::For def initialize(id, hsh, subsection) super(id, hsh, subsection) @id = "no_females_pregnant_household_lead_age_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_lead_hhmemb_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_lead_hhmemb_value_check.rb index e1d1235ef..47ac7493b 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_lead_hhmemb_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_lead_hhmemb_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadHhmembValueCheck < :: def initialize(id, hsh, subsection) super @id = "no_females_pregnant_household_lead_hhmemb_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_lead_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_lead_value_check.rb index 416845735..edfe2c631 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_lead_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_lead_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadValueCheck < ::Form:: def initialize(id, hsh, subsection) super @id = "no_females_pregnant_household_lead_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check.rb index 12db3a08e..5e808b853 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck < ::F def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @id = "no_females_pregnant_household_person_#{person_index}_age_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true, "age#{person_index}_known" => 0 }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } @person_index = person_index end diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_person_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_person_value_check.rb index f04333ec0..fb77eec18 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_person_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_person_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck < ::Form def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @id = "no_females_pregnant_household_person_#{person_index}_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true, "details_known_#{person_index}" => 0 }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } @person_index = person_index end diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_value_check.rb index 9c84a953f..bce8a87ae 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "no_females_pregnant_household_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/partner_under_16_value_check.rb b/app/models/form/lettings/pages/partner_under_16_value_check.rb index 87d5865c4..b33a827d4 100644 --- a/app/models/form/lettings/pages/partner_under_16_value_check.rb +++ b/app/models/form/lettings/pages/partner_under_16_value_check.rb @@ -6,9 +6,10 @@ class Form::Lettings::Pages::PartnerUnder16ValueCheck < Form::Page "person_#{person_index}_partner_under_16?" => true, }, ] + @copy_key = "lettings.soft_validations.partner_under_16_value_check" @person_index = person_index @title_text = { - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "age#{person_index}", @@ -17,7 +18,10 @@ class Form::Lettings::Pages::PartnerUnder16ValueCheck < Form::Page }, ], } - @informative_text = {} + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } end def questions diff --git a/app/models/form/lettings/pages/person_over_retirement_value_check.rb b/app/models/form/lettings/pages/person_over_retirement_value_check.rb index dbaf2d2e2..c094d4a93 100644 --- a/app/models/form/lettings/pages/person_over_retirement_value_check.rb +++ b/app/models/form/lettings/pages/person_over_retirement_value_check.rb @@ -2,11 +2,13 @@ class Form::Lettings::Pages::PersonOverRetirementValueCheck < ::Form::Page def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @depends_on = [{ "person_#{person_index}_not_retired_over_soft_max_age?" => true }] + @copy_key = "lettings.soft_validations.retirement_value_check" @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" => [], } @person_index = person_index end diff --git a/app/models/form/lettings/pages/person_under_retirement_value_check.rb b/app/models/form/lettings/pages/person_under_retirement_value_check.rb index ab9c81beb..853afafe0 100644 --- a/app/models/form/lettings/pages/person_under_retirement_value_check.rb +++ b/app/models/form/lettings/pages/person_under_retirement_value_check.rb @@ -2,8 +2,9 @@ class Form::Lettings::Pages::PersonUnderRetirementValueCheck < ::Form::Page def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @depends_on = [{ "person_#{person_index}_retired_under_soft_min_age?" => true }] + @copy_key = "lettings.soft_validations.no_retirement_value_check" @title_text = { - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "age#{person_index}", @@ -12,7 +13,10 @@ class Form::Lettings::Pages::PersonUnderRetirementValueCheck < ::Form::Page }, ], } - @informative_text = {} + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } @person_index = person_index end diff --git a/app/models/form/lettings/pages/property_major_repairs_value_check.rb b/app/models/form/lettings/pages/property_major_repairs_value_check.rb index 08672aff6..d1c7be34c 100644 --- a/app/models/form/lettings/pages/property_major_repairs_value_check.rb +++ b/app/models/form/lettings/pages/property_major_repairs_value_check.rb @@ -2,10 +2,11 @@ class Form::Lettings::Pages::PropertyMajorRepairsValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "property_major_repairs_value_check" + @copy_key = "lettings.soft_validations.major_repairs_date_value_check" @depends_on = [{ "major_repairs_date_in_soft_range?" => true }] - @title_text = { "translation" => "soft_validations.major_repairs_date.title_text" } + @title_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text" } @informative_text = { - "translation" => "soft_validations.major_repairs_date.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } end diff --git a/app/models/form/lettings/pages/pscharge_value_check.rb b/app/models/form/lettings/pages/pscharge_value_check.rb index 6c8ada196..8ff953afd 100644 --- a/app/models/form/lettings/pages/pscharge_value_check.rb +++ b/app/models/form/lettings/pages/pscharge_value_check.rb @@ -2,16 +2,20 @@ class Form::Lettings::Pages::PschargeValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "pscharge_value_check" + @copy_key = "lettings.soft_validations.pscharge_value_check" @depends_on = [{ "pscharge_in_soft_max_range?" => true }] @title_text = { - "translation" => "soft_validations.pscharge.over_soft_max_title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [{ "key" => "pscharge", "label" => true, "i18n_template" => "pscharge", }], } - @informative_text = I18n.t("soft_validations.charges.informative_text") + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } end def questions diff --git a/app/models/form/lettings/pages/reasonother_value_check.rb b/app/models/form/lettings/pages/reasonother_value_check.rb index ccda997a7..ccc6be70d 100644 --- a/app/models/form/lettings/pages/reasonother_value_check.rb +++ b/app/models/form/lettings/pages/reasonother_value_check.rb @@ -2,13 +2,14 @@ class Form::Lettings::Pages::ReasonotherValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "reasonother_value_check" + @copy_key = "lettings.soft_validations.reasonother_value_check" @depends_on = [{ "reasonother_might_be_existing_category?" => true }] @title_text = { - "translation" => "soft_validations.reasonother.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [{ "key" => "reasonother", "i18n_template" => "reasonother" }], } @informative_text = { - "translation" => "soft_validations.reasonother.informative_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } end diff --git a/app/models/form/lettings/pages/referral_value_check.rb b/app/models/form/lettings/pages/referral_value_check.rb index 55f6f3e8b..aa3a34200 100644 --- a/app/models/form/lettings/pages/referral_value_check.rb +++ b/app/models/form/lettings/pages/referral_value_check.rb @@ -2,12 +2,13 @@ class Form::Lettings::Pages::ReferralValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "referral_value_check" + @copy_key = "lettings.soft_validations.referral_value_check" @depends_on = [{ "la_referral_for_general_needs?" => true }] @title_text = { - "translation" => "soft_validations.referral.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", } @informative_text = { - "translation" => "soft_validations.referral.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } end diff --git a/app/models/form/lettings/pages/rent_value_check.rb b/app/models/form/lettings/pages/rent_value_check.rb index a80dc7339..5a1ecc847 100644 --- a/app/models/form/lettings/pages/rent_value_check.rb +++ b/app/models/form/lettings/pages/rent_value_check.rb @@ -2,8 +2,9 @@ class Form::Lettings::Pages::RentValueCheck < ::Form::Page def initialize(id, hsh, subsection, check_answers_card_number: nil) super(id, hsh, subsection) @depends_on = [{ "rent_soft_validation_triggered?" => true }] + @copy_key = "lettings.soft_validations.rent_value_check" @title_text = { - "translation" => "soft_validations.rent.outside_range_title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "brent", @@ -13,7 +14,7 @@ class Form::Lettings::Pages::RentValueCheck < ::Form::Page ], } @informative_text = { - "translation" => "soft_validations.rent.informative_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [ { "key" => "rent_soft_validation_higher_or_lower_text", diff --git a/app/models/form/lettings/pages/scharge_value_check.rb b/app/models/form/lettings/pages/scharge_value_check.rb index 73ee41920..bd9accfc1 100644 --- a/app/models/form/lettings/pages/scharge_value_check.rb +++ b/app/models/form/lettings/pages/scharge_value_check.rb @@ -2,16 +2,20 @@ class Form::Lettings::Pages::SchargeValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "scharge_value_check" + @copy_key = "lettings.soft_validations.scharge_value_check" @depends_on = [{ "scharge_in_soft_max_range?" => true }] @title_text = { - "translation" => "soft_validations.scharge.over_soft_max_title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [{ "key" => "scharge", "label" => true, "i18n_template" => "scharge", }], } - @informative_text = I18n.t("soft_validations.charges.informative_text") + @title_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } end def questions diff --git a/app/models/form/lettings/pages/supcharg_value_check.rb b/app/models/form/lettings/pages/supcharg_value_check.rb index a974a8f89..89dcc89c1 100644 --- a/app/models/form/lettings/pages/supcharg_value_check.rb +++ b/app/models/form/lettings/pages/supcharg_value_check.rb @@ -2,16 +2,20 @@ class Form::Lettings::Pages::SupchargValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "supcharg_value_check" + @copy_key = "lettings.soft_validations.supcharg_value_check" @depends_on = [{ "supcharg_in_soft_max_range?" => true }] @title_text = { - "translation" => "soft_validations.supcharg.over_soft_max_title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [{ "key" => "supcharg", "label" => true, "i18n_template" => "supcharg", }], } - @informative_text = I18n.t("soft_validations.charges.informative_text") + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } end def questions diff --git a/app/models/form/lettings/pages/void_date_value_check.rb b/app/models/form/lettings/pages/void_date_value_check.rb index 6ebd3a175..b5d7fdadd 100644 --- a/app/models/form/lettings/pages/void_date_value_check.rb +++ b/app/models/form/lettings/pages/void_date_value_check.rb @@ -2,10 +2,11 @@ class Form::Lettings::Pages::VoidDateValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "void_date_value_check" + @copy_key = "lettings.soft_validations.void_date_value_check" @depends_on = [{ "voiddate_in_soft_range?" => true }] - @title_text = { "translation" => "soft_validations.void_date.title_text" } + @title_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text" } @informative_text = { - "translation" => "soft_validations.void_date.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } end diff --git a/app/models/form/lettings/questions/care_home_charges_value_check.rb b/app/models/form/lettings/questions/care_home_charges_value_check.rb index fdb5aabbd..a5f0d2522 100644 --- a/app/models/form/lettings/questions/care_home_charges_value_check.rb +++ b/app/models/form/lettings/questions/care_home_charges_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::CareHomeChargesValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "carehome_charges_value_check" - @check_answer_label = "Care home charges confirmation" - @header = "Are you sure there are no care home charges?" + @copy_key = "lettings.soft_validations.care_home_charges_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/major_repairs_date_value_check.rb b/app/models/form/lettings/questions/major_repairs_date_value_check.rb index d024f1a8d..0e9cb4171 100644 --- a/app/models/form/lettings/questions/major_repairs_date_value_check.rb +++ b/app/models/form/lettings/questions/major_repairs_date_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::MajorRepairsDateValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "major_repairs_date_value_check" - @check_answer_label = "Major repairs date confirmation" - @header = "Are you sure the property has been vacant for this long?" + @copy_key = "lettings.soft_validations.major_repairs_date_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/multiple_partners_value_check.rb b/app/models/form/lettings/questions/multiple_partners_value_check.rb index 65320ffdf..9dd9f7015 100644 --- a/app/models/form/lettings/questions/multiple_partners_value_check.rb +++ b/app/models/form/lettings/questions/multiple_partners_value_check.rb @@ -2,7 +2,7 @@ class Form::Lettings::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 = "lettings.soft_validations.multiple_partners_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Lettings::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/lettings/questions/net_income_value_check.rb b/app/models/form/lettings/questions/net_income_value_check.rb index 8267b3b22..4e85fee90 100644 --- a/app/models/form/lettings/questions/net_income_value_check.rb +++ b/app/models/form/lettings/questions/net_income_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::NetIncomeValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "net_income_value_check" - @check_answer_label = "Net income confirmation" - @header = "Are you sure this is correct?" + @copy_key = "lettings.soft_validations.net_income_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/no_retirement_value_check.rb b/app/models/form/lettings/questions/no_retirement_value_check.rb index 0e2033c61..82784dec8 100644 --- a/app/models/form/lettings/questions/no_retirement_value_check.rb +++ b/app/models/form/lettings/questions/no_retirement_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::NoRetirementValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "retirement_value_check" - @check_answer_label = "Retirement confirmation" - @header = "Are you sure this person is retired?" + @copy_key = "lettings.soft_validations.no_retirement_value_check" @type = "interruption_screen" @check_answers_card_number = person_index @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/partner_under_16_value_check.rb b/app/models/form/lettings/questions/partner_under_16_value_check.rb index 7cda45cb5..bc11aec47 100644 --- a/app/models/form/lettings/questions/partner_under_16_value_check.rb +++ b/app/models/form/lettings/questions/partner_under_16_value_check.rb @@ -2,7 +2,7 @@ class Form::Lettings::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 = "lettings.soft_validations.partner_under_16_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Lettings::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/lettings/questions/pregnancy_value_check.rb b/app/models/form/lettings/questions/pregnancy_value_check.rb index 9ef1778c2..0ddddecec 100644 --- a/app/models/form/lettings/questions/pregnancy_value_check.rb +++ b/app/models/form/lettings/questions/pregnancy_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::PregnancyValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "pregnancy_value_check" - @check_answer_label = "Pregnancy confirmation" - @header = "Are you sure this is correct?" + @copy_key = page.copy_key @type = "interruption_screen" @check_answers_card_number = person_index @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/pscharge_value_check.rb b/app/models/form/lettings/questions/pscharge_value_check.rb index b44979ae1..efb94fb53 100644 --- a/app/models/form/lettings/questions/pscharge_value_check.rb +++ b/app/models/form/lettings/questions/pscharge_value_check.rb @@ -2,13 +2,11 @@ class Form::Lettings::Questions::PschargeValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "pscharge_value_check" - @check_answer_label = "Personal service charge confirmation" - @header = "Are you sure?" + @copy_key = "lettings.soft_validations.pscharge_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "pscharge_value_check" => 0 }, { "pscharge_value_check" => 1 }] } - @hint_text = I18n.t("soft_validations.charges.hint_text") end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/reasonother_value_check.rb b/app/models/form/lettings/questions/reasonother_value_check.rb index 865f38764..9fb5618fc 100644 --- a/app/models/form/lettings/questions/reasonother_value_check.rb +++ b/app/models/form/lettings/questions/reasonother_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::ReasonotherValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "reasonother_value_check" - @check_answer_label = "Reason other confirmation" - @header = "Are you sure this doesn’t fit an existing category?" + @copy_key = "lettings.soft_validations.reasonother_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/referral_value_check.rb b/app/models/form/lettings/questions/referral_value_check.rb index 30aa45f4c..04dfadd9e 100644 --- a/app/models/form/lettings/questions/referral_value_check.rb +++ b/app/models/form/lettings/questions/referral_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::ReferralValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "referral_value_check" - @check_answer_label = "Referral confirmation" - @header = "Are you sure?" + @copy_key = "lettings.soft_validations.referral_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/rent_value_check.rb b/app/models/form/lettings/questions/rent_value_check.rb index 688499259..fb7ac8d16 100644 --- a/app/models/form/lettings/questions/rent_value_check.rb +++ b/app/models/form/lettings/questions/rent_value_check.rb @@ -2,10 +2,8 @@ class Form::Lettings::Questions::RentValueCheck < ::Form::Question def initialize(id, hsh, page, check_answers_card_number:) super(id, hsh, page) @id = "rent_value_check" - @check_answer_label = "Total rent confirmation" - @header = "Are you sure this is correct?" + @copy_key = "lettings.soft_validations.rent_value_check" @type = "interruption_screen" - @hint_text = I18n.t("soft_validations.rent.hint_text") @check_answers_card_number = check_answers_card_number @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] } diff --git a/app/models/form/lettings/questions/retirement_value_check.rb b/app/models/form/lettings/questions/retirement_value_check.rb index 63a286d61..23d077fbf 100644 --- a/app/models/form/lettings/questions/retirement_value_check.rb +++ b/app/models/form/lettings/questions/retirement_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::RetirementValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "retirement_value_check" - @check_answer_label = "Retirement confirmation" - @header = "Are you sure this person isn’t retired?" + @copy_key = "lettings.soft_validations.retirement_value_check" @type = "interruption_screen" @check_answers_card_number = person_index @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/scharge_value_check.rb b/app/models/form/lettings/questions/scharge_value_check.rb index 1946d603f..0f761b7aa 100644 --- a/app/models/form/lettings/questions/scharge_value_check.rb +++ b/app/models/form/lettings/questions/scharge_value_check.rb @@ -2,13 +2,11 @@ class Form::Lettings::Questions::SchargeValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "scharge_value_check" - @check_answer_label = "Service charge confirmation" - @header = "Are you sure?" + @copy_key = "lettings.soft_validations.scharge_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "scharge_value_check" => 0 }, { "scharge_value_check" => 1 }] } - @hint_text = I18n.t("soft_validations.charges.hint_text") end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/supcharg_value_check.rb b/app/models/form/lettings/questions/supcharg_value_check.rb index 978c5e3ef..10fd6562c 100644 --- a/app/models/form/lettings/questions/supcharg_value_check.rb +++ b/app/models/form/lettings/questions/supcharg_value_check.rb @@ -2,13 +2,11 @@ class Form::Lettings::Questions::SupchargValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "supcharg_value_check" - @check_answer_label = "Support charge confirmation" - @header = "Are you sure?" + @copy_key = "lettings.soft_validations.supcharg_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "supcharg_value_check" => 0 }, { "supcharg_value_check" => 1 }] } - @hint_text = I18n.t("soft_validations.charges.hint_text") end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/void_date_value_check.rb b/app/models/form/lettings/questions/void_date_value_check.rb index 22446061f..faf507a1b 100644 --- a/app/models/form/lettings/questions/void_date_value_check.rb +++ b/app/models/form/lettings/questions/void_date_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::VoidDateValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "void_date_value_check" - @check_answer_label = "Void date confirmation" - @header = "Are you sure the property has been vacant for this long?" + @copy_key = "lettings.soft_validations.void_date_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index 6ebc090b6..ac615b0e2 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -7411,10 +7411,10 @@ } ], "title_text": { - "translation": "soft_validations.net_income.title_text" + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.title_text" }, "informative_text": { - "translation": "soft_validations.net_income.hint_text", + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.informative_text", "arguments": [ { "key": "ecstat1", diff --git a/config/forms/2022_2023.json b/config/forms/2022_2023.json index 54cd67fd4..7d6f44b20 100644 --- a/config/forms/2022_2023.json +++ b/config/forms/2022_2023.json @@ -7870,7 +7870,7 @@ } ], "title_text": { - "translation": "soft_validations.net_income.title_text", + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.title_text", "arguments": [ { "key": "incfreq", @@ -7885,7 +7885,7 @@ ] }, "informative_text": { - "translation": "soft_validations.net_income.hint_text", + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.informative_text", "arguments": [ { "key": "net_income_higher_or_lower_text", diff --git a/config/locales/en.yml b/config/locales/en.yml index 81c94b8c4..55044b7a6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -553,17 +553,6 @@ en: organisation_not_selected: "Select an organisation from the search list." soft_validations: - net_income: - title_text: "You told us that the household’s income is %{earnings} %{incfreq}." - hint_text: "This is %{net_income_higher_or_lower_text} than we would expect for the household’s working situation." - in_soft_min_range: - message: "Net income is lower than expected based on the household’s working situation. Are you sure this is correct?" - in_soft_max_range: - message: "Net income is higher than expected based on the household’s working situation. Are you sure this is correct?" - rent: - outside_range_title: "You told us the rent is %{brent}." - informative_text: "This is %{higher_or_lower} than we would expect." - hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the rent type is correct, for example affordable or social rent
" retirement: min: title: "You told us this person is aged %{age} years and retired." @@ -571,40 +560,6 @@ en: max: title: "You told us this person is over 66 and not retired." hint_text: "The minimum expected retirement age in England is 66." - pregnancy: - title: "You told us somebody in the household is pregnant." - all_male_tenants: "You also told us that all the tenants living at the property are male." - females_not_in_soft_age_range: "You also told us that any female tenants living at the property are in the following age ranges:
  • under 16 years old
  • over 50 years old
" - major_repairs_date: - title_text: "You told us the property has been vacant for 2 years." - hint_text: "This is higher than we would expect." - void_date: - title_text: "You told us that the property has been vacant for more than 2 years." - hint_text: "This is higher than we would expect." - referral: - title_text: "Are you sure?" - hint_text: "This is a general needs log, and this referral type is for supported housing." - scharge: - over_soft_max_title: "You told us the service charge is %{scharge}." - pscharge: - over_soft_max_title: "You told us the personal service charge is %{pscharge}." - supcharg: - over_soft_max_title: "You told us the support charge is %{supcharg}." - charges: - informative_text: "This is higher than we would expect." - hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" - reasonother: - title_text: "You told us that the tenant’s main reason for leaving their last settled home was %{reasonother}." - informative_text: "The reason you have entered looks very similar to one of the existing response categories. - Please check the categories and select the appropriate one. - If the existing categories are not suitable, please confirm here to move onto the next question." - saledate: - must_be_less_than_3_years_from_hodate: "You told us sale completion date is more than 3 years after practical completion or handover date." - partner_under_16_lettings: - title: "You told us this person is aged %{age} years and has 'Partner' relationship to the lead tenant." - multiple_partners_lettings: - title: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant." - devise: two_factor_authentication: success: "Two-factor authentication successful." diff --git a/config/locales/forms/2023/lettings/soft_validations.en.yml b/config/locales/forms/2023/lettings/soft_validations.en.yml new file mode 100644 index 000000000..d0354f127 --- /dev/null +++ b/config/locales/forms/2023/lettings/soft_validations.en.yml @@ -0,0 +1,132 @@ +en: + forms: + 2023: + lettings: + soft_validations: + pregnancy_value_check: + no_females_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that all the tenants living at the property are male." + females_in_soft_age_range_in_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that any female tenants living at the property are in the following age ranges:
  • under 16 years old
  • over 50 years old
" + + no_retirement_value_check: + 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." + + retirement_value_check: + 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: "" + + 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 the lead tenant." + 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 the lead tenant." + informative_text: "Are you sure this is correct?" + + reasonother_value_check: + page_header: "" + check_answer_label: "Reason other confirmation" + hint_text: "" + question_text: "Are you sure this doesn’t fit an existing category?" + title_text: "You told us that the tenant’s main reason for leaving their last settled home was %{reasonother}." + informative_text: "The reason you have entered looks very similar to one of the existing response categories. Please check the categories and select the appropriate one. If the existing categories are not suitable, please confirm here to move onto the next question." + + referral_value_check: + page_header: "" + check_answer_label: "Referral confirmation" + hint_text: "" + question_text: "Are you sure?" + title_text: "Are you sure?" + informative_text: "This is a general needs log, and this referral type is for supported housing." + + net_income_value_check: + page_header: "" + check_answer_label: "Net income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that the household’s income is %{earnings} %{incfreq}." + informative_text: "This is %{net_income_higher_or_lower_text} than we would expect for the household’s working situation." + + care_home_charges_value_check: + page_header: "" + check_answer_label: "Care home charges confirmation" + hint_text: "" + question_text: "Are you sure there are no care home charges?" + title_text: "Care home charges should be provided if this is a care home accommodation." + informative_text: "Are you sure there are no care home charges?" + + rent_value_check: + page_header: "" + check_answer_label: "Total rent confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the rent type is correct, for example affordable or social rent
" + question_text: "Are you sure this is correct?" + title_text: "You told us the rent is %{brent}." + informative_text: "This is %{higher_or_lower} than we would expect." + + scharge_value_check: + page_header: "" + check_answer_label: "Service charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the service charge is %{scharge}." + informative_text: "This is higher than we would expect." + + pscharge_value_check: + page_header: "" + check_answer_label: "Personal service charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the personal service charge is %{pscharge}." + informative_text: "This is higher than we would expect." + + supcharg_value_check: + page_header: "" + check_answer_label: "Support charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the support charge is %{supcharg}." + informative_text: "This is higher than we would expect." + + void_date_value_check: + page_header: "" + check_answer_label: "Void date confirmation" + hint_text: "" + question_text: "Are you sure the property has been vacant for this long?" + title_text: "You told us that the property has been vacant for more than 2 years." + informative_text: "This is higher than we would expect." + + major_repairs_date_value_check: + page_header: "" + check_answer_label: "Major repairs date confirmation" + hint_text: "" + question_text: "Are you sure the property has been vacant for this long?" + title_text: "You told us the property has been vacant for 2 years." + informative_text: "This is higher than we would expect." diff --git a/config/locales/forms/2024/lettings/soft_validations.en.yml b/config/locales/forms/2024/lettings/soft_validations.en.yml new file mode 100644 index 000000000..ada093d39 --- /dev/null +++ b/config/locales/forms/2024/lettings/soft_validations.en.yml @@ -0,0 +1,132 @@ +en: + forms: + 2024: + lettings: + soft_validations: + pregnancy_value_check: + no_females_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that all the tenants living at the property are male." + females_in_soft_age_range_in_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that any female tenants living at the property are in the following age ranges:
  • under 16 years old
  • over 50 years old
" + + no_retirement_value_check: + 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." + + retirement_value_check: + 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: "Are you sure this person isn’t retired?" + + 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 the lead tenant." + 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 the lead tenant." + informative_text: "Are you sure this is correct?" + + reasonother_value_check: + page_header: "" + check_answer_label: "Reason other confirmation" + hint_text: "" + question_text: "Are you sure this doesn’t fit an existing category?" + title_text: "You told us that the tenant’s main reason for leaving their last settled home was %{reasonother}." + informative_text: "The reason you have entered looks very similar to one of the existing response categories. Please check the categories and select the appropriate one. If the existing categories are not suitable, please confirm here to move onto the next question." + + referral_value_check: + page_header: "" + check_answer_label: "Referral confirmation" + hint_text: "" + question_text: "Are you sure?" + title_text: "Are you sure?" + informative_text: "This is a general needs log, and this referral type is for supported housing." + + net_income_value_check: + page_header: "" + check_answer_label: "Net income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that the household’s income is %{earnings} %{incfreq}." + informative_text: "This is %{net_income_higher_or_lower_text} than we would expect for the household’s working situation." + + care_home_charges_value_check: + page_header: "" + check_answer_label: "Care home charges confirmation" + hint_text: "" + question_text: "Are you sure there are no care home charges?" + title_text: "Care home charges should be provided if this is a care home accommodation." + informative_text: "Are you sure there are no care home charges?" + + rent_value_check: + page_header: "" + check_answer_label: "Total rent confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the rent type is correct, for example affordable or social rent
" + question_text: "Are you sure this is correct?" + title_text: "You told us the rent is %{brent}." + informative_text: "This is %{higher_or_lower} than we would expect." + + scharge_value_check: + page_header: "" + check_answer_label: "Service charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the service charge is %{scharge}." + informative_text: "This is higher than we would expect." + + pscharge_value_check: + page_header: "" + check_answer_label: "Personal service charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the personal service charge is %{pscharge}." + informative_text: "This is higher than we would expect." + + supcharg_value_check: + page_header: "" + check_answer_label: "Support charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the support charge is %{supcharg}." + informative_text: "This is higher than we would expect." + + void_date_value_check: + page_header: "" + check_answer_label: "Void date confirmation" + hint_text: "" + question_text: "Are you sure the property has been vacant for this long?" + title_text: "You told us that the property has been vacant for more than 2 years." + informative_text: "This is longer than we would expect." + + major_repairs_date_value_check: + page_header: "" + check_answer_label: "Major repairs date confirmation" + hint_text: "" + question_text: "Are you sure the property has been vacant for this long?" + title_text: "You told us the property has been vacant for 2 years." + informative_text: "This is longer than we would expect." diff --git a/config/locales/forms/2025/lettings/soft_validations.en.yml b/config/locales/forms/2025/lettings/soft_validations.en.yml new file mode 100644 index 000000000..03a3cbb3d --- /dev/null +++ b/config/locales/forms/2025/lettings/soft_validations.en.yml @@ -0,0 +1,132 @@ +en: + forms: + 2025: + lettings: + soft_validations: + pregnancy_value_check: + no_females_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that all the tenants living at the property are male." + females_in_soft_age_range_in_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that any female tenants living at the property are in the following age ranges:
  • under 16 years old
  • over 50 years old
" + + no_retirement_value_check: + 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." + + retirement_value_check: + 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: "Are you sure this person isn’t retired?" + + 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 the lead tenant." + 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 the lead tenant." + informative_text: "Are you sure this is correct?" + + reasonother_value_check: + page_header: "" + check_answer_label: "Reason other confirmation" + hint_text: "" + question_text: "Are you sure this doesn’t fit an existing category?" + title_text: "You told us that the tenant’s main reason for leaving their last settled home was %{reasonother}." + informative_text: "The reason you have entered looks very similar to one of the existing response categories. Please check the categories and select the appropriate one. If the existing categories are not suitable, please confirm here to move onto the next question." + + referral_value_check: + page_header: "" + check_answer_label: "Referral confirmation" + hint_text: "" + question_text: "Are you sure?" + title_text: "Are you sure?" + informative_text: "This is a general needs log, and this referral type is for supported housing." + + net_income_value_check: + page_header: "" + check_answer_label: "Net income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that the household’s income is %{earnings} %{incfreq}." + informative_text: "This is %{net_income_higher_or_lower_text} than we would expect for the household’s working situation." + + care_home_charges_value_check: + page_header: "" + check_answer_label: "Care home charges confirmation" + hint_text: "" + question_text: "Are you sure there are no care home charges?" + title_text: "Care home charges should be provided if this is a care home accommodation." + informative_text: "Are you sure there are no care home charges?" + + rent_value_check: + page_header: "" + check_answer_label: "Total rent confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the rent type is correct, for example affordable or social rent
" + question_text: "Are you sure this is correct?" + title_text: "You told us the rent is %{brent}." + informative_text: "This is %{higher_or_lower} than we would expect." + + scharge_value_check: + page_header: "" + check_answer_label: "Service charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the service charge is %{scharge}." + informative_text: "This is higher than we would expect." + + pscharge_value_check: + page_header: "" + check_answer_label: "Personal service charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the personal service charge is %{pscharge}." + informative_text: "This is higher than we would expect." + + supcharg_value_check: + page_header: "" + check_answer_label: "Support charge confirmation" + hint_text: "Check the following:
  • the decimal point
  • the frequency, for example every week or every calendar month
  • the needs type
" + question_text: "Are you sure?" + title_text: "You told us the support charge is %{supcharg}." + informative_text: "This is higher than we would expect." + + void_date_value_check: + page_header: "" + check_answer_label: "Void date confirmation" + hint_text: "" + question_text: "Are you sure the property has been vacant for this long?" + title_text: "You told us that the property has been vacant for more than 2 years." + informative_text: "This is longer than we would expect." + + major_repairs_date_value_check: + page_header: "" + check_answer_label: "Major repairs date confirmation" + hint_text: "" + question_text: "Are you sure the property has been vacant for this long?" + title_text: "You told us the property has been vacant for 2 years." + informative_text: "This is longer than we would expect." diff --git a/spec/fixtures/forms/2021_2022.json b/spec/fixtures/forms/2021_2022.json index 3159459ad..cb0aaf06e 100644 --- a/spec/fixtures/forms/2021_2022.json +++ b/spec/fixtures/forms/2021_2022.json @@ -740,7 +740,7 @@ } ], "title_text": { - "translation": "soft_validations.net_income.title_text", + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.title_text", "arguments": [ { "key": "incfreq", @@ -755,7 +755,7 @@ ] }, "informative_text": { - "translation": "soft_validations.net_income.hint_text", + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.informative_text", "arguments": [ { "key": "net_income_higher_or_lower_text", diff --git a/spec/helpers/interruption_screen_helper_spec.rb b/spec/helpers/interruption_screen_helper_spec.rb index 60cd71131..0d4456f2a 100644 --- a/spec/helpers/interruption_screen_helper_spec.rb +++ b/spec/helpers/interruption_screen_helper_spec.rb @@ -93,7 +93,7 @@ RSpec.describe InterruptionScreenHelper do context "when 1 out of 2 arguments are given" do it "returns an empty string" do informative_text = { - "translation" => "soft_validations.net_income.hint_text", + "translation" => "forms.2024.lettings.soft_validations.net_income_value_check.informative_text", "arguments" => [ { "key" => "ecstat1", diff --git a/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb b/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb index 0530cf445..e9c1d5879 100644 --- a/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb +++ b/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb @@ -30,12 +30,12 @@ RSpec.describe Form::Lettings::Pages::CareHomeChargesValueCheck, type: :model do it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.care_home_charges.title_text", + "translation" => "forms.2024.lettings.soft_validations.care_home_charges_value_check.title_text", }) end it "has the correct informative_text" do - expect(page.informative_text).to eq("") + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.care_home_charges_value_check.informative_text" }) end it "has the correct interruption_screen_question_ids" do diff --git a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb index 0b3d770b3..865fc6fd2 100644 --- a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb +++ b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb @@ -37,27 +37,15 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end @@ -82,27 +70,15 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end diff --git a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb index f380a5cb9..8ce2e5451 100644 --- a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb +++ b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb @@ -37,27 +37,15 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end @@ -82,27 +70,15 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end diff --git a/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb b/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb index 551a3b070..f116cb601 100644 --- a/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb +++ b/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb @@ -4,7 +4,8 @@ RSpec.describe Form::Lettings::Pages::MultiplePartnersValueCheck, type: :model d 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::Lettings::Pages::MultiplePartnersValueCheck, type: :model d it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.multiple_partners_lettings.title", + "translation" => "forms.2024.lettings.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.lettings.soft_validations.multiple_partners_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -71,13 +72,13 @@ RSpec.describe Form::Lettings::Pages::MultiplePartnersValueCheck, type: :model d it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.multiple_partners_lettings.title", + "translation" => "forms.2024.lettings.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.lettings.soft_validations.multiple_partners_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do diff --git a/spec/models/form/lettings/pages/net_income_value_check_spec.rb b/spec/models/form/lettings/pages/net_income_value_check_spec.rb index 523e02c8b..fe98919ae 100644 --- a/spec/models/form/lettings/pages/net_income_value_check_spec.rb +++ b/spec/models/form/lettings/pages/net_income_value_check_spec.rb @@ -24,13 +24,13 @@ RSpec.describe Form::Lettings::Pages::NetIncomeValueCheck, type: :model do end it "has the correct title_text" do - expect(page.title_text).to eq({ "translation" => "soft_validations.net_income.title_text", "arguments" => [{ "i18n_template" => "incfreq", "key" => "incfreq", "label" => true }, { "arguments_for_key" => "earnings", "i18n_template" => "earnings", "key" => "field_formatted_as_currency" }] }) + expect(page.title_text).to eq({ "translation" => "forms.2024.lettings.soft_validations.net_income_value_check.title_text", "arguments" => [{ "i18n_template" => "incfreq", "key" => "incfreq", "label" => true }, { "arguments_for_key" => "earnings", "i18n_template" => "earnings", "key" => "field_formatted_as_currency" }] }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ "arguments" => [{ "i18n_template" => "net_income_higher_or_lower_text", "key" => "net_income_higher_or_lower_text", "label" => false }], - "translation" => "soft_validations.net_income.hint_text", + "translation" => "forms.2024.lettings.soft_validations.net_income_value_check.informative_text", }) end end diff --git a/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb b/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb index 286ac6183..6cf6302f8 100644 --- a/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb +++ b/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb @@ -37,27 +37,15 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCh it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end @@ -82,27 +70,15 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCh it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end diff --git a/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb b/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb index 205f19ae1..f986f17d2 100644 --- a/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb +++ b/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb @@ -37,27 +37,15 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end @@ -82,27 +70,15 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end diff --git a/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb b/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb index a769f95cc..168f4ca91 100644 --- a/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb +++ b/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb @@ -4,7 +4,8 @@ RSpec.describe Form::Lettings::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::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age1", @@ -51,7 +52,7 @@ RSpec.describe Form::Lettings::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.lettings.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::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age2", @@ -89,7 +90,7 @@ RSpec.describe Form::Lettings::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.lettings.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::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age3", @@ -127,7 +128,7 @@ RSpec.describe Form::Lettings::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.lettings.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::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age4", @@ -165,7 +166,7 @@ RSpec.describe Form::Lettings::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.lettings.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::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age5", @@ -203,7 +204,7 @@ RSpec.describe Form::Lettings::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.lettings.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::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age6", @@ -241,7 +242,7 @@ RSpec.describe Form::Lettings::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.lettings.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do diff --git a/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb b/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb index ec00f0d75..c8a482ee4 100644 --- a/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb +++ b/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb @@ -28,13 +28,14 @@ RSpec.describe Form::Lettings::Pages::PersonOverRetirementValueCheck, type: :mod it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.max.title", + "translation" => "forms.2024.lettings.soft_validations.retirement_value_check.title_text", }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.retirement.max.hint_text", + "translation" => "forms.2024.lettings.soft_validations.retirement_value_check.informative_text", + "arguments" => [], }) end end @@ -50,13 +51,14 @@ RSpec.describe Form::Lettings::Pages::PersonOverRetirementValueCheck, type: :mod it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.max.title", + "translation" => "forms.2024.lettings.soft_validations.retirement_value_check.title_text", }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.retirement.max.hint_text", + "translation" => "forms.2024.lettings.soft_validations.retirement_value_check.informative_text", + "arguments" => [], }) end end diff --git a/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb b/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb index 37ca94f9e..6226e0309 100644 --- a/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb +++ b/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb @@ -28,7 +28,7 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.lettings.soft_validations.no_retirement_value_check.title_text", "arguments" => [ { "key" => "age2", @@ -40,7 +40,7 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo end it "has the correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.no_retirement_value_check.informative_text" }) end end @@ -55,7 +55,7 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.lettings.soft_validations.no_retirement_value_check.title_text", "arguments" => [ { "key" => "age3", @@ -67,7 +67,7 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo end it "has the correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.no_retirement_value_check.informative_text" }) end end end diff --git a/spec/models/form/lettings/subsections/household_characteristics_spec.rb b/spec/models/form/lettings/subsections/household_characteristics_spec.rb index b97717077..b45f86fce 100644 --- a/spec/models/form/lettings/subsections/household_characteristics_spec.rb +++ b/spec/models/form/lettings/subsections/household_characteristics_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod let(:subsection_id) { nil } let(:subsection_definition) { nil } let(:section) { instance_double(Form::Lettings::Sections::Household) } - let(:form) { instance_double(Form) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do allow(section).to receive(:form).and_return(form) diff --git a/spec/models/form/lettings/subsections/household_needs_spec.rb b/spec/models/form/lettings/subsections/household_needs_spec.rb index 6e4dd25f1..dcd957601 100644 --- a/spec/models/form/lettings/subsections/household_needs_spec.rb +++ b/spec/models/form/lettings/subsections/household_needs_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Lettings::Subsections::HouseholdNeeds, type: :model do let(:subsection_id) { nil } let(:subsection_definition) { nil } - let(:section) { instance_double(Form::Lettings::Sections::Household) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:section) { instance_double(Form::Lettings::Sections::Household, form:) } it "has correct section" do expect(household_needs.section).to eq(section) diff --git a/spec/models/form/lettings/subsections/household_situation_spec.rb b/spec/models/form/lettings/subsections/household_situation_spec.rb index b9f65dbdd..d672b3ccc 100644 --- a/spec/models/form/lettings/subsections/household_situation_spec.rb +++ b/spec/models/form/lettings/subsections/household_situation_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdSituation, type: :model do let(:subsection_id) { nil } let(:subsection_definition) { nil } let(:section) { instance_double(Form::Lettings::Sections::Household) } - let(:form) { instance_double(Form) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do allow(section).to receive(:form).and_return(form) diff --git a/spec/models/form/lettings/subsections/income_and_benefits_spec.rb b/spec/models/form/lettings/subsections/income_and_benefits_spec.rb index 4c92faaf6..7bdc26bfa 100644 --- a/spec/models/form/lettings/subsections/income_and_benefits_spec.rb +++ b/spec/models/form/lettings/subsections/income_and_benefits_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Lettings::Subsections::IncomeAndBenefits, type: :model do let(:subsection_id) { nil } let(:subsection_definition) { nil } - let(:section) { instance_double(Form::Lettings::Sections::RentAndCharges) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:section) { instance_double(Form::Lettings::Sections::RentAndCharges, form:) } it "has correct section" do expect(income_and_benefits.section).to eq(section) diff --git a/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb index 8161f8a00..591ffdd53 100644 --- a/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb @@ -1851,8 +1851,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "populates with correct error message" do parser.valid? - expect(parser.errors.where(:field_46, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") - expect(parser.errors.where(:field_50, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") + expect(parser.errors.where(:field_46, 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_50, 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/lettings/year2024/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb index e33458eb4..e9047b2ae 100644 --- a/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb @@ -1881,8 +1881,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "populates with correct error message" do parser.valid? - expect(parser.errors.where(:field_42, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") - expect(parser.errors.where(:field_46, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") + expect(parser.errors.where(:field_42, 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_46, 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 From 61eb0057f637b110bc83b9c1b7ca1c6190aeb3b7 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Mon, 11 Nov 2024 16:41:13 +0000 Subject: [PATCH 6/9] CLDC-3693: Extract shared validations (#2744) * Extract lettings household validation from shared validations * Extract lettings setup validation from shared validations * Extract only shared validations --- app/models/user.rb | 2 +- .../validations/household_validations.rb | 9 ++- .../validations/property_validations.rb | 8 ++ .../sales/household_validations.rb | 9 ++- .../validations/sales/property_validations.rb | 8 ++ .../validations/sales/setup_validations.rb | 8 ++ app/models/validations/setup_validations.rb | 49 ++++++++++-- app/models/validations/shared_validations.rb | 80 +++---------------- config/locales/en.yml | 35 +------- .../validations/lettings/household.en.yml | 7 ++ .../lettings/property_information.en.yml | 6 ++ .../locales/validations/lettings/setup.en.yml | 35 ++++++-- .../sales/property_information.en.yml | 7 +- config/locales/validations/sales/setup.en.yml | 1 + config/locales/validations/shared.en.yml | 19 +++++ .../generate_lettings_documentation.rake | 4 +- lib/tasks/generate_sales_documentation.rake | 4 +- .../form/sales/pages/la_nominations_spec.rb | 8 +- .../sales/pages/last_accommodation_la_spec.rb | 6 +- .../sales/pages/last_accommodation_spec.rb | 6 +- .../validations/date_validations_spec.rb | 2 +- .../validations/household_validations_spec.rb | 14 ++-- .../validations/setup_validations_spec.rb | 42 +++++----- .../validations/shared_validations_spec.rb | 34 ++++---- .../validations/tenancy_validations_spec.rb | 4 +- .../requests/lettings_logs_controller_spec.rb | 2 +- 26 files changed, 222 insertions(+), 187 deletions(-) create mode 100644 config/locales/validations/lettings/household.en.yml create mode 100644 config/locales/validations/lettings/property_information.en.yml create mode 100644 config/locales/validations/shared.en.yml diff --git a/app/models/user.rb b/app/models/user.rb index 75b5a366b..3d6dbe893 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -19,7 +19,7 @@ class User < ApplicationRecord validates :password, presence: { if: :password_required? } validates :password, length: { within: Devise.password_length, allow_blank: true } validates :password, confirmation: { if: :password_required? } - validates :phone_extension, format: { with: /\A\d+\z/, allow_blank: true, message: I18n.t("validations.numeric.format", field: "") } + validates :phone_extension, format: { with: /\A\d+\z/, allow_blank: true, message: I18n.t("validations.not_number", field: "") } after_validation :send_data_protection_confirmation_reminder, if: :is_dpo_changed? diff --git a/app/models/validations/household_validations.rb b/app/models/validations/household_validations.rb index 626925631..703e9f394 100644 --- a/app/models/validations/household_validations.rb +++ b/app/models/validations/household_validations.rb @@ -52,7 +52,14 @@ module Validations::HouseholdValidations end def validate_partner_count(record) - shared_validate_partner_count(record, 8) + return if record.form.start_year_2024_or_later? + + partner_numbers = (2..8).select { |n| person_is_partner?(record["relat#{n}"]) } + if partner_numbers.count > 1 + partner_numbers.each do |n| + record.errors.add "relat#{n}", I18n.t("validations.lettings.household.relat.one_partner") + end + end end def validate_person_1_economic(record) diff --git a/app/models/validations/property_validations.rb b/app/models/validations/property_validations.rb index e0246ff1f..1864adc5c 100644 --- a/app/models/validations/property_validations.rb +++ b/app/models/validations/property_validations.rb @@ -57,4 +57,12 @@ module Validations::PropertyValidations record.errors.add :uprn, I18n.t("validations.property.uprn.invalid") end + + def validate_property_postcode(record) + postcode = record.postcode_full + if record.postcode_known? && (postcode.blank? || !postcode.match(POSTCODE_REGEXP)) + error_message = I18n.t("validations.lettings.property_information.postcode_full.invalid") + record.errors.add :postcode_full, :wrong_format, message: error_message + end + end end diff --git a/app/models/validations/sales/household_validations.rb b/app/models/validations/sales/household_validations.rb index 23b2e9ee1..175474098 100644 --- a/app/models/validations/sales/household_validations.rb +++ b/app/models/validations/sales/household_validations.rb @@ -2,7 +2,14 @@ module Validations::Sales::HouseholdValidations include Validations::SharedValidations def validate_partner_count(record) - shared_validate_partner_count(record, 6) + return if record.form.start_year_2024_or_later? + + partner_numbers = (2..6).select { |n| person_is_partner?(record["relat#{n}"]) } + if partner_numbers.count > 1 + partner_numbers.each do |n| + record.errors.add "relat#{n}", I18n.t("validations.sales.household.relat.one_partner") + end + end end def validate_buyers_living_in_property(record) diff --git a/app/models/validations/sales/property_validations.rb b/app/models/validations/sales/property_validations.rb index c4a42c630..5cf70ed8d 100644 --- a/app/models/validations/sales/property_validations.rb +++ b/app/models/validations/sales/property_validations.rb @@ -28,4 +28,12 @@ module Validations::Sales::PropertyValidations record.errors.add :uprn, I18n.t("validations.sales.property_information.uprn.invalid") end + + def validate_property_postcode(record) + postcode = record.postcode_full + if record.postcode_known? && (postcode.blank? || !postcode.match(POSTCODE_REGEXP)) + error_message = I18n.t("validations.sales.property_information.postcode_full.invalid") + record.errors.add :postcode_full, :wrong_format, message: error_message + end + end end diff --git a/app/models/validations/sales/setup_validations.rb b/app/models/validations/sales/setup_validations.rb index 6fdc2f1a3..75e79f15a 100644 --- a/app/models/validations/sales/setup_validations.rb +++ b/app/models/validations/sales/setup_validations.rb @@ -58,6 +58,14 @@ module Validations::Sales::SetupValidations end end + def validate_owning_organisation_data_sharing_agremeent_signed(record) + return if record.skip_dpo_validation + + if record.owning_organisation_id_changed? && record.owning_organisation.present? && !record.owning_organisation.data_protection_confirmed? + record.errors.add :owning_organisation_id, I18n.t("validations.sales.setup.owning_organisation.data_sharing_agreement_not_signed") + end + end + private def active_collection_start_date diff --git a/app/models/validations/setup_validations.rb b/app/models/validations/setup_validations.rb index d8e5dbf93..8d1884fc2 100644 --- a/app/models/validations/setup_validations.rb +++ b/app/models/validations/setup_validations.rb @@ -72,17 +72,15 @@ module Validations::SetupValidations end end - def validate_scheme_has_confirmed_locations_validation(record) + def validate_scheme(record) return unless record.scheme - unless record.scheme.locations.confirmed.any? - record.errors.add :scheme_id, :no_completed_locations, message: I18n.t("validations.lettings.setup.scheme.no_completed_locations") + if record.scheme.status == :incomplete + record.errors.add :scheme_id, :incomplete, message: I18n.t("validations.lettings.setup.scheme.incomplete") end - end - def validate_scheme(record) - if record.scheme&.status == :incomplete - record.errors.add :scheme_id, :incomplete, message: I18n.t("validations.lettings.setup.scheme.incomplete") + if record.scheme.locations.nil? || (record.scheme.locations.present? && record.scheme.locations.confirmed.none?) + record.errors.add :scheme_id, :no_completed_locations, message: I18n.t("validations.lettings.setup.scheme.no_completed_locations") end scheme_during_startdate_validation(record) @@ -98,6 +96,35 @@ module Validations::SetupValidations end end + def location_during_startdate_validation(record) + location_inactive_status = inactive_status(record.startdate, record.location) + + if location_inactive_status.present? + date, scope, deactivation_date = location_inactive_status.values_at(:date, :scope, :deactivation_date) + record.errors.add :startdate, :not_active, message: I18n.t("validations.lettings.setup.startdate.location.#{scope}.startdate", postcode: record.location.postcode, date:, deactivation_date:) + record.errors.add :location_id, :not_active, message: I18n.t("validations.lettings.setup.startdate.location.#{scope}.location_id", postcode: record.location.postcode, date:, deactivation_date:) + record.errors.add :scheme_id, :not_active, message: I18n.t("validations.lettings.setup.startdate.location.#{scope}.location_id", postcode: record.location.postcode, date:, deactivation_date:) + end + end + + def scheme_during_startdate_validation(record) + scheme_inactive_status = inactive_status(record.startdate, record.scheme) + + if scheme_inactive_status.present? + date, scope, deactivation_date = scheme_inactive_status.values_at(:date, :scope, :deactivation_date) + record.errors.add :startdate, I18n.t("validations.lettings.setup.startdate.scheme.#{scope}.startdate", name: record.scheme.service_name, date:, deactivation_date:) + record.errors.add :scheme_id, I18n.t("validations.lettings.setup.startdate.scheme.#{scope}.scheme_id", name: record.scheme.service_name, date:, deactivation_date:) + end + end + + def tenancy_startdate_with_scheme_locations(record) + return if record.scheme.blank? || record.startdate.blank? + return if record.scheme.has_active_locations_on_date?(record.startdate) + + record.errors.add :startdate, I18n.t("validations.lettings.setup.startdate.scheme.locations_inactive.startdate", name: record.scheme.service_name) + record.errors.add :scheme_id, I18n.t("validations.lettings.setup.startdate.scheme.locations_inactive.scheme_id", name: record.scheme.service_name) + end + def validate_managing_organisation_data_sharing_agremeent_signed(record) return if record.skip_dpo_validation @@ -106,6 +133,14 @@ module Validations::SetupValidations end end + def validate_owning_organisation_data_sharing_agremeent_signed(record) + return if record.skip_dpo_validation + + if record.owning_organisation_id_changed? && record.owning_organisation.present? && !record.owning_organisation.data_protection_confirmed? + record.errors.add :owning_organisation_id, I18n.t("validations.lettings.setup.owning_organisation.data_sharing_agreement_not_signed") + end + end + private def active_collection_start_date diff --git a/app/models/validations/shared_validations.rb b/app/models/validations/shared_validations.rb index 2eb5fff5a..da79599ee 100644 --- a/app/models/validations/shared_validations.rb +++ b/app/models/validations/shared_validations.rb @@ -7,12 +7,12 @@ module Validations::SharedValidations main_field_label = main_label || main_field.to_s.humanize(capitalize: false) other_field_label = other_label || other_field.to_s.humanize(capitalize: false) if record[main_field] == value_other && record[other_field].blank? - record.errors.add main_field.to_sym, I18n.t("validations.other_field_missing", main_field_label:, other_field_label:) - record.errors.add other_field.to_sym, I18n.t("validations.other_field_missing", main_field_label:, other_field_label:) + record.errors.add main_field.to_sym, I18n.t("validations.shared.other_field_missing", main_field_label:, other_field_label:) + record.errors.add other_field.to_sym, I18n.t("validations.shared.other_field_missing", main_field_label:, other_field_label:) end if record[main_field] != value_other && record[other_field].present? - record.errors.add other_field.to_sym, I18n.t("validations.other_field_not_required", main_field_label:, other_field_label:) + record.errors.add other_field.to_sym, I18n.t("validations.shared.other_field_not_required", main_field_label:, other_field_label:) end end @@ -22,7 +22,7 @@ module Validations::SharedValidations next if record.send("#{question.id}_before_type_cast").to_s.match?(/\A\d+(\.\d+)?\z/) field = question.check_answer_label || question.id - record.errors.add question.id.to_sym, I18n.t("validations.numeric.format", field:) + record.errors.add question.id.to_sym, I18n.t("validations.shared.numeric.format", field:) end end @@ -55,46 +55,17 @@ module Validations::SharedValidations incorrect_accuracy = (value.to_d * 100) % (question.step * 100) != 0 if question.step < 1 && incorrect_accuracy - record.errors.add question.id.to_sym, I18n.t("validations.numeric.nearest_hundredth", field:) + record.errors.add question.id.to_sym, I18n.t("validations.shared.numeric.nearest_hundredth", field:) elsif incorrect_accuracy || value.to_d != value.to_i # if the user enters a value in exponent notation (eg '4e1') the to_i method does not convert this to the correct value field = question.check_answer_label || question.id case question.step - when 1 then record.errors.add question.id.to_sym, :not_integer, message: I18n.t("validations.numeric.whole_number", field:) - when 10 then record.errors.add question.id.to_sym, I18n.t("validations.numeric.nearest_ten", field:) + when 1 then record.errors.add question.id.to_sym, :not_integer, message: I18n.t("validations.shared.numeric.whole_number", field:) + when 10 then record.errors.add question.id.to_sym, I18n.t("validations.shared.numeric.nearest_ten", field:) end end end end - def validate_property_postcode(record) - postcode = record.postcode_full - if record.postcode_known? && (postcode.blank? || !postcode.match(POSTCODE_REGEXP)) - error_message = I18n.t("validations.postcode") - record.errors.add :postcode_full, :wrong_format, message: error_message - end - end - - def location_during_startdate_validation(record) - location_inactive_status = inactive_status(record.startdate, record.location) - - if location_inactive_status.present? - date, scope, deactivation_date = location_inactive_status.values_at(:date, :scope, :deactivation_date) - record.errors.add :startdate, :not_active, message: I18n.t("validations.setup.startdate.location.#{scope}.startdate", postcode: record.location.postcode, date:, deactivation_date:) - record.errors.add :location_id, :not_active, message: I18n.t("validations.setup.startdate.location.#{scope}.location_id", postcode: record.location.postcode, date:, deactivation_date:) - record.errors.add :scheme_id, :not_active, message: I18n.t("validations.setup.startdate.location.#{scope}.location_id", postcode: record.location.postcode, date:, deactivation_date:) - end - end - - def scheme_during_startdate_validation(record) - scheme_inactive_status = inactive_status(record.startdate, record.scheme) - - if scheme_inactive_status.present? - date, scope, deactivation_date = scheme_inactive_status.values_at(:date, :scope, :deactivation_date) - record.errors.add :startdate, I18n.t("validations.setup.startdate.scheme.#{scope}.startdate", name: record.scheme.service_name, date:, deactivation_date:) - record.errors.add :scheme_id, I18n.t("validations.setup.startdate.scheme.#{scope}.scheme_id", name: record.scheme.service_name, date:, deactivation_date:) - end - end - def inactive_status(date, resource) return if date.blank? || resource.blank? @@ -117,46 +88,15 @@ module Validations::SharedValidations { scope: status, date: date&.to_formatted_s(:govuk_date), deactivation_date: closest_reactivation&.deactivation_date&.to_formatted_s(:govuk_date) } end - def tenancy_startdate_with_scheme_locations(record) - return if record.scheme.blank? || record.startdate.blank? - return if record.scheme.has_active_locations_on_date?(record.startdate) - - record.errors.add :startdate, I18n.t("validations.setup.startdate.scheme.locations_inactive.startdate", name: record.scheme.service_name) - record.errors.add :scheme_id, I18n.t("validations.setup.startdate.scheme.locations_inactive.scheme_id", name: record.scheme.service_name) - end - - def shared_validate_partner_count(record, max_people) - return if record.form.start_year_2024_or_later? - - partner_numbers = (2..max_people).select { |n| person_is_partner?(record["relat#{n}"]) } - if partner_numbers.count > 1 - partner_numbers.each do |n| - if record.sales? - record.errors.add "relat#{n}", I18n.t("validations.sales.household.relat.one_partner") - else - record.errors.add "relat#{n}", I18n.t("validations.household.relat.one_partner") - end - end - end - end - def date_valid?(question, record) if record[question].is_a?(ActiveSupport::TimeWithZone) && record[question].year.zero? - record.errors.add question, I18n.t("validations.date.invalid_date") + record.errors.add question, I18n.t("validations.shared.date.invalid_date") false else true end end - def validate_owning_organisation_data_sharing_agremeent_signed(record) - return if record.skip_dpo_validation - - if record.owning_organisation_id_changed? && record.owning_organisation.present? && !record.owning_organisation.data_protection_confirmed? - record.errors.add :owning_organisation_id, I18n.t("validations.setup.owning_organisation.data_sharing_agreement_not_signed") - end - end - private def person_is_partner?(relationship) @@ -169,9 +109,9 @@ private max = [question.prefix, number_with_delimiter(question.max, delimiter: ","), question.suffix].join("") if question.max if min && max - record.errors.add question.id.to_sym, :outside_the_range, message: I18n.t("validations.numeric.within_range", field:, min:, max:) + record.errors.add question.id.to_sym, :outside_the_range, message: I18n.t("validations.shared.numeric.within_range", field:, min:, max:) elsif min - record.errors.add question.id.to_sym, :under_min, message: I18n.t("validations.numeric.above_min", field:, min:) + record.errors.add question.id.to_sym, :under_min, message: I18n.t("validations.shared.numeric.above_min", field:, min:) end end end diff --git a/config/locales/en.yml b/config/locales/en.yml index 55044b7a6..4c601b353 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -239,23 +239,12 @@ en: merged: "That organisation has already been merged. Select a different organisation." scheme_duplicates_not_resolved: "You must resolve all duplicates or indicate that there are no duplicates" not_answered: "You must answer %{question}" + not_number: "%{field} must be a number." invalid_option: "Enter a valid value for %{question}" invalid_number: "Enter a number for %{question}" no_address_found: "We could not find this address. Check the address data in your CSV file is correct and complete, or select the correct address using the CORE site." - other_field_missing: "If %{main_field_label} is other then %{other_field_label} must be provided." - other_field_not_required: "%{other_field_label} must not be provided if %{main_field_label} was not other." - numeric: - within_range: "%{field} must be between %{min} and %{max}." - above_min: "%{field} must be at least %{min}." - whole_number: "%{field} must be a whole number." - nearest_ten: "%{field} must be given to the nearest ten." - nearest_hundredth: "%{field} must be given to the nearest hundredth." - normal_format: "Enter a number." - format: "%{field} must be a number." - date: - invalid_date: "Enter a date in the correct format, for example 31 1 2024." outside_collection_window: "Enter a date within the %{year_combo} collection year, which is between 1st April %{start_year} and 31st March %{end_year}." postcode: "Enter a postcode in the correct format, for example AA1 1AA." location_admin_district: "Select a local authority." @@ -271,29 +260,8 @@ en: year_not_two_or_four_digits: "Sale completion year must be 2 or 4 digits." type: percentage_bought_must_be_at_least_threshold: "The minimum increase in equity while staircasing is %{threshold}% for this shared ownership type." - startdate: before_scheme_end_date: "The tenancy start date must be before the end date for this supported housing scheme." - location: - deactivated: - startdate: "The location %{postcode} is inactive on this date. Enter another date or choose another location." - location_id: "This location is not active on the tenancy start date. Choose another location or edit the tenancy start date." - activating_soon: - startdate: "The location %{postcode} is not available until %{date}. Enter a tenancy start date after %{date}." - location_id: "The location %{postcode} is not available until %{date}. Select another location or edit the tenancy start date." - reactivating_soon: - startdate: "The location %{postcode} is not available until %{date}. Enter a tenancy start date after %{date}." - location_id: "The location %{postcode} is not available until %{date}. Select another location or edit the tenancy start date." - scheme: - deactivated: - startdate: "The scheme %{name} was deactivated on %{date} and was not available on the day you entered. Select another scheme or edit the tenancy start date." - scheme_id: "The scheme %{name} was deactivated on %{date} and was not available on the day you entered. Select another scheme or edit the tenancy start date." - reactivating_soon: - startdate: "The scheme %{name} is not available until %{date}. Enter a tenancy start date after %{date}." - scheme_id: "The scheme %{name} is not available until %{date}. Select another scheme or edit the tenancy start date." - locations_inactive: - startdate: "The scheme %{name} has no locations that are active on this date. Enter another date or choose another scheme." - scheme_id: "The scheme %{name} has no locations that are active on this date. Enter another date or choose another scheme." owning_organisation: data_sharing_agreement_not_signed: "The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation." property: @@ -451,7 +419,6 @@ en: cannot_be_student: "Person cannot be a student if they are aged 16-19 but are not a child." relat: child_under_16_lettings: "Answer cannot be ‘partner’ as you told us person %{person_num}'s age is under 16." - one_partner: "Number of partners cannot be greater than 1." not_student_16_19: "Answer cannot be ‘child’ as you told us the person %{person_num} is between 16 and 19 and is not a full-time student." student_16_19: cannot_be_child: diff --git a/config/locales/validations/lettings/household.en.yml b/config/locales/validations/lettings/household.en.yml new file mode 100644 index 000000000..b9573f4d2 --- /dev/null +++ b/config/locales/validations/lettings/household.en.yml @@ -0,0 +1,7 @@ +en: + validations: + lettings: + household: + relat: + one_partner: "Number of partners cannot be greater than 1." + diff --git a/config/locales/validations/lettings/property_information.en.yml b/config/locales/validations/lettings/property_information.en.yml new file mode 100644 index 000000000..ed42acb4c --- /dev/null +++ b/config/locales/validations/lettings/property_information.en.yml @@ -0,0 +1,6 @@ +en: + validations: + lettings: + property_information: + postcode_full: + invalid: "Enter a postcode in the correct format, for example AA1 1AA." diff --git a/config/locales/validations/lettings/setup.en.yml b/config/locales/validations/lettings/setup.en.yml index d2ee9bf0f..96b5af04b 100644 --- a/config/locales/validations/lettings/setup.en.yml +++ b/config/locales/validations/lettings/setup.en.yml @@ -21,12 +21,40 @@ en: owning_organisation: "Enter a date when the owning organisation was active. %{owning_organisation} became active on %{available_from}." managing_organisation: "Enter a date when the managing organisation was active. %{managing_organisation} became active on %{available_from}." different_organisations: "Enter a date when the owning and managing organisations were active. %{owning_organisation} became active on %{owning_organisation_active_from}, and %{managing_organisation} became active on %{managing_organisation_active_from}." + location: + deactivated: + startdate: "The location %{postcode} is inactive on this date. Enter another date or choose another location." + location_id: "This location is not active on the tenancy start date. Choose another location or edit the tenancy start date." + activating_soon: + startdate: "The location %{postcode} is not available until %{date}. Enter a tenancy start date after %{date}." + location_id: "The location %{postcode} is not available until %{date}. Select another location or edit the tenancy start date." + reactivating_soon: + startdate: "The location %{postcode} is not available until %{date}. Enter a tenancy start date after %{date}." + location_id: "The location %{postcode} is not available until %{date}. Select another location or edit the tenancy start date." + scheme: + deactivated: + startdate: "The scheme %{name} was deactivated on %{date} and was not available on the day you entered. Select another scheme or edit the tenancy start date." + scheme_id: "The scheme %{name} was deactivated on %{date} and was not available on the day you entered. Select another scheme or edit the tenancy start date." + reactivating_soon: + startdate: "The scheme %{name} is not available until %{date}. Enter a tenancy start date after %{date}." + scheme_id: "The scheme %{name} is not available until %{date}. Select another scheme or edit the tenancy start date." + locations_inactive: + startdate: "The scheme %{name} has no locations that are active on this date. Enter another date or choose another scheme." + scheme_id: "The scheme %{name} has no locations that are active on this date. Enter another date or choose another scheme." + + scheme: + incomplete: "This scheme is incomplete. Select another scheme or update this one." + no_completed_locations: "This scheme cannot be chosen as it has no completed locations." + + location: + incomplete: "This location is incomplete. Select another location or update this one." assigned_to: invalid: "Please select the owning organisation or managing organisation that you belong to." owning_organisation: invalid: "Please select the owning organisation or managing organisation that you belong to." + data_sharing_agreement_not_signed: "The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation." inactive: merged_organisation: "The owning organisation must be active on the tenancy start date. %{owning_organisation} became inactive on %{merge_date} and was replaced by %{absorbing_organisation}." @@ -44,10 +72,3 @@ en: intermediate_rent_product_name: blank: "Enter name of other intermediate rent product." - - scheme: - incomplete: "This scheme is incomplete. Select another scheme or update this one." - no_completed_locations: "This scheme cannot be chosen as it has no completed locations." - - location: - incomplete: "This location is incomplete. Select another location or update this one." diff --git a/config/locales/validations/sales/property_information.en.yml b/config/locales/validations/sales/property_information.en.yml index e69f90edf..a91e47849 100644 --- a/config/locales/validations/sales/property_information.en.yml +++ b/config/locales/validations/sales/property_information.en.yml @@ -3,11 +3,12 @@ en: sales: property_information: postcode_full: - postcode_must_match_previous: + postcode_must_match_previous: joint_purchase: "Buyers’ last accommodation and discounted ownership postcodes must match." not_joint_purchase: "Buyer’s last accommodation and discounted ownership postcodes must match." + invalid: "Enter a postcode in the correct format, for example AA1 1AA." ppostcode_full: - postcode_must_match_previous: + postcode_must_match_previous: joint_purchase: "Buyers’ last accommodation and discounted ownership postcodes must match." not_joint_purchase: "Buyer’s last accommodation and discounted ownership postcodes must match." ownershipsch: @@ -15,7 +16,7 @@ en: joint_purchase: "Buyers’ last accommodation and discounted ownership postcodes must match." not_joint_purchase: "Buyer’s last accommodation and discounted ownership postcodes must match." uprn: - postcode_must_match_previous: + postcode_must_match_previous: joint_purchase: "Buyers’ last accommodation and discounted ownership postcodes must match." not_joint_purchase: "Buyer’s last accommodation and discounted ownership postcodes must match." invalid: "UPRN must be 12 digits or less." diff --git a/config/locales/validations/sales/setup.en.yml b/config/locales/validations/sales/setup.en.yml index 9dd13b525..62819a029 100644 --- a/config/locales/validations/sales/setup.en.yml +++ b/config/locales/validations/sales/setup.en.yml @@ -17,6 +17,7 @@ en: "Enter a date when the owning organisation was active. %{owning_organisation} became active on %{available_from}." owning_organisation: + data_sharing_agreement_not_signed: "The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation." inactive: merged_organisation: "The owning organisation must be active on the sale completion date. %{owning_organisation} became inactive on %{merge_date} and was replaced by %{absorbing_organisation}." diff --git a/config/locales/validations/shared.en.yml b/config/locales/validations/shared.en.yml new file mode 100644 index 000000000..a29d2bd74 --- /dev/null +++ b/config/locales/validations/shared.en.yml @@ -0,0 +1,19 @@ +en: + validations: + shared: + other_field_missing: "If %{main_field_label} is other then %{other_field_label} must be provided." + other_field_not_required: "%{other_field_label} must not be provided if %{main_field_label} was not other." + + numeric: + within_range: "%{field} must be between %{min} and %{max}." + above_min: "%{field} must be at least %{min}." + whole_number: "%{field} must be a whole number." + nearest_ten: "%{field} must be given to the nearest ten." + nearest_hundredth: "%{field} must be given to the nearest hundredth." + normal_format: "Enter a number." + format: "%{field} must be a number." + + postcode: "Enter a postcode in the correct format, for example AA1 1AA." + + date: + invalid_date: "Enter a date in the correct format, for example 31 1 2024." diff --git a/lib/tasks/generate_lettings_documentation.rake b/lib/tasks/generate_lettings_documentation.rake index 8b11e3ff5..3dc8e71b4 100644 --- a/lib/tasks/generate_lettings_documentation.rake +++ b/lib/tasks/generate_lettings_documentation.rake @@ -60,13 +60,13 @@ namespace :generate_lettings_documentation do min = [question.prefix, question.min].join("") if question.min max = [question.prefix, question.max].join("") if question.max - error_message = I18n.t("validations.numeric.above_min", field:, min:) + error_message = I18n.t("validations.shared.numeric.above_min", field:, min:) validation_name = "minimum" validation_description = "Field value is lower than the minimum value" if min && max validation_name = "range" - error_message = I18n.t("validations.numeric.within_range", field:, min:, max:) + error_message = I18n.t("validations.shared.numeric.within_range", field:, min:, max:) validation_description = "Field value is lower than the minimum value or higher than the maximum value" end diff --git a/lib/tasks/generate_sales_documentation.rake b/lib/tasks/generate_sales_documentation.rake index 62272f6f8..c595c4f18 100644 --- a/lib/tasks/generate_sales_documentation.rake +++ b/lib/tasks/generate_sales_documentation.rake @@ -59,13 +59,13 @@ namespace :generate_sales_documentation do min = [question.prefix, question.min].join("") if question.min max = [question.prefix, question.max].join("") if question.max - error_message = I18n.t("validations.numeric.above_min", field:, min:) + error_message = I18n.t("validations.shared.numeric.above_min", field:, min:) validation_name = "minimum" validation_description = "Field value is lower than the minimum value" if min && max validation_name = "range" - error_message = I18n.t("validations.numeric.within_range", field:, min:, max:) + error_message = I18n.t("validations.shared.numeric.within_range", field:, min:, max:) validation_description = "Field value is lower than the minimum value or higher than the maximum value" end diff --git a/spec/models/form/sales/pages/la_nominations_spec.rb b/spec/models/form/sales/pages/la_nominations_spec.rb index 036e26092..190afaa86 100644 --- a/spec/models/form/sales/pages/la_nominations_spec.rb +++ b/spec/models/form/sales/pages/la_nominations_spec.rb @@ -7,8 +7,8 @@ RSpec.describe Form::Sales::Pages::LaNominations, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:start_year_after_2024) { false } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: start_year_after_2024) } + let(:start_year_2024_or_later) { false } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: start_year_2024_or_later) } let(:subsection) { instance_double(Form::Subsection, form:) } before do @@ -32,7 +32,7 @@ RSpec.describe Form::Sales::Pages::LaNominations, type: :model do end context "with 23/24 log" do - let(:start_year_after_2024) { false } + let(:start_year_2024_or_later) { false } it "has correct routed to" do log.staircase = 1 @@ -41,7 +41,7 @@ RSpec.describe Form::Sales::Pages::LaNominations, type: :model do end context "with 24/25 log" do - let(:start_year_after_2024) { true } + let(:start_year_2024_or_later) { true } it "has correct routed to when staircase is yes" do log.staircase = 1 diff --git a/spec/models/form/sales/pages/last_accommodation_la_spec.rb b/spec/models/form/sales/pages/last_accommodation_la_spec.rb index 9cdd64957..7689e7dfd 100644 --- a/spec/models/form/sales/pages/last_accommodation_la_spec.rb +++ b/spec/models/form/sales/pages/last_accommodation_la_spec.rb @@ -5,8 +5,8 @@ RSpec.describe Form::Sales::Pages::LastAccommodationLa, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:start_year_after_2024) { false } - let(:form) { instance_double(Form, depends_on_met: true, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: start_year_after_2024) } + let(:start_year_2024_or_later) { false } + let(:form) { instance_double(Form, depends_on_met: true, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: start_year_2024_or_later) } let(:subsection) { instance_double(Form::Subsection, form:, depends_on: nil, enabled?: true) } let(:log) { build(:sales_log, :completed) } @@ -38,7 +38,7 @@ RSpec.describe Form::Sales::Pages::LastAccommodationLa, type: :model do end context "with 2024 form" do - let(:start_year_after_2024) { true } + let(:start_year_2024_or_later) { true } it "is routed to for 2024 non discounted sale logs" do log.update!(ownershipsch: 1) diff --git a/spec/models/form/sales/pages/last_accommodation_spec.rb b/spec/models/form/sales/pages/last_accommodation_spec.rb index fbc581b4b..1b2d1ee0a 100644 --- a/spec/models/form/sales/pages/last_accommodation_spec.rb +++ b/spec/models/form/sales/pages/last_accommodation_spec.rb @@ -7,8 +7,8 @@ RSpec.describe Form::Sales::Pages::LastAccommodation, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:start_year_after_2024) { false } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: start_year_after_2024) } + let(:start_year_2024_or_later) { false } + let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2024_or_later?: start_year_2024_or_later) } let(:subsection) { instance_double(Form::Subsection, form:, depends_on: nil) } it "has correct subsection" do @@ -37,7 +37,7 @@ RSpec.describe Form::Sales::Pages::LastAccommodation, type: :model do end context "with 2024 form" do - let(:start_year_after_2024) { true } + let(:start_year_2024_or_later) { true } it "is routed to for 2024 non discounted sale logs" do log.update!(ownershipsch: 1) diff --git a/spec/models/validations/date_validations_spec.rb b/spec/models/validations/date_validations_spec.rb index f6c81a088..3ca259b16 100644 --- a/spec/models/validations/date_validations_spec.rb +++ b/spec/models/validations/date_validations_spec.rb @@ -12,7 +12,7 @@ RSpec.describe Validations::DateValidations do it "must be a valid date" do record.startdate = Time.zone.local(0, 7, 1) date_validator.validate_startdate(record) - expect(record.errors["startdate"]).to include(match I18n.t("validations.date.invalid_date")) + expect(record.errors["startdate"]).to include(match I18n.t("validations.shared.date.invalid_date")) end it "does not raise an error when valid" do diff --git a/spec/models/validations/household_validations_spec.rb b/spec/models/validations/household_validations_spec.rb index b240b7b2a..ea472f618 100644 --- a/spec/models/validations/household_validations_spec.rb +++ b/spec/models/validations/household_validations_spec.rb @@ -27,13 +27,13 @@ RSpec.describe Validations::HouseholdValidations do end describe "reason for leaving last settled home validations" do - let(:field) { "validations.other_field_not_required" } + let(:field) { "validations.shared.other_field_not_required" } let(:main_field_label) { "reason" } let(:other_field_label) { "reasonother" } let(:expected_error) { I18n.t(field, main_field_label:, other_field_label:) } context "when reason is other" do - let(:field) { "validations.other_field_missing" } + let(:field) { "validations.shared.other_field_missing" } it "validates that a reason is provided" do record.reason = 20 @@ -251,14 +251,14 @@ RSpec.describe Validations::HouseholdValidations do record.hhmemb = 0 household_validator.validate_numeric_min_max(record) expect(record.errors["hhmemb"]) - .to include(match I18n.t("validations.numeric.within_range", field: "Number of household members", min: 1, max: 8)) + .to include(match I18n.t("validations.shared.numeric.within_range", field: "Number of household members", min: 1, max: 8)) end it "validates that the number of household members cannot be more than 8" do record.hhmemb = 9 household_validator.validate_numeric_min_max(record) expect(record.errors["hhmemb"]) - .to include(match I18n.t("validations.numeric.within_range", field: "Number of household members", min: 1, max: 8)) + .to include(match I18n.t("validations.shared.numeric.within_range", field: "Number of household members", min: 1, max: 8)) end it "expects that the number of other household members is between the min and max" do @@ -276,11 +276,11 @@ RSpec.describe Validations::HouseholdValidations do record.relat3 = "P" household_validator.validate_partner_count(record) expect(record.errors["relat2"]) - .to include(match I18n.t("validations.household.relat.one_partner")) + .to include(match I18n.t("validations.lettings.household.relat.one_partner")) expect(record.errors["relat3"]) - .to include(match I18n.t("validations.household.relat.one_partner")) + .to include(match I18n.t("validations.lettings.household.relat.one_partner")) expect(record.errors["relat4"]) - .not_to include(match I18n.t("validations.household.relat.one_partner")) + .not_to include(match I18n.t("validations.lettings.household.relat.one_partner")) end it "expects that a tenant can have a partner" do diff --git a/spec/models/validations/setup_validations_spec.rb b/spec/models/validations/setup_validations_spec.rb index 0c99d3628..5b4f03365 100644 --- a/spec/models/validations/setup_validations_spec.rb +++ b/spec/models/validations/setup_validations_spec.rb @@ -436,9 +436,9 @@ RSpec.describe Validations::SetupValidations do record.scheme = scheme setup_validator.validate_scheme(record) expect(record.errors["startdate"]) - .to include(match I18n.t("validations.setup.startdate.scheme.deactivated.startdate", name: scheme.service_name, date: "4 June 2022")) + .to include(match I18n.t("validations.lettings.setup.startdate.scheme.deactivated.startdate", name: scheme.service_name, date: "4 June 2022")) expect(record.errors["scheme_id"]) - .to include(match I18n.t("validations.setup.startdate.scheme.deactivated.scheme_id", name: scheme.service_name, date: "4 June 2022")) + .to include(match I18n.t("validations.lettings.setup.startdate.scheme.deactivated.scheme_id", name: scheme.service_name, date: "4 June 2022")) end it "produces no error when tenancy start date is during an active scheme period" do @@ -465,9 +465,9 @@ RSpec.describe Validations::SetupValidations do record.scheme = scheme setup_validator.validate_scheme(record) expect(record.errors["startdate"]) - .to include(match I18n.t("validations.setup.startdate.scheme.reactivating_soon.startdate", name: scheme.service_name, date: "4 August 2022")) + .to include(match I18n.t("validations.lettings.setup.startdate.scheme.reactivating_soon.startdate", name: scheme.service_name, date: "4 August 2022")) expect(record.errors["scheme_id"]) - .to include(match I18n.t("validations.setup.startdate.scheme.reactivating_soon.scheme_id", name: scheme.service_name, date: "4 August 2022")) + .to include(match I18n.t("validations.lettings.setup.startdate.scheme.reactivating_soon.scheme_id", name: scheme.service_name, date: "4 August 2022")) end it "produces no error when tenancy start date is during an active scheme period" do @@ -498,9 +498,9 @@ RSpec.describe Validations::SetupValidations do record.scheme = scheme setup_validator.validate_scheme(record) expect(record.errors["startdate"]) - .to include(match I18n.t("validations.setup.startdate.scheme.reactivating_soon.startdate", name: scheme.service_name, date: "4 September 2022")) + .to include(match I18n.t("validations.lettings.setup.startdate.scheme.reactivating_soon.startdate", name: scheme.service_name, date: "4 September 2022")) expect(record.errors["scheme_id"]) - .to include(match I18n.t("validations.setup.startdate.scheme.reactivating_soon.scheme_id", name: scheme.service_name, date: "4 September 2022")) + .to include(match I18n.t("validations.lettings.setup.startdate.scheme.reactivating_soon.scheme_id", name: scheme.service_name, date: "4 September 2022")) end it "produces no error when tenancy start date is during an active scheme period" do @@ -526,8 +526,8 @@ RSpec.describe Validations::SetupValidations do record.startdate = Time.zone.local(2022, 7, 5) record.scheme = scheme setup_validator.validate_scheme(record) - expect(record.errors["startdate"]).to include(match I18n.t("validations.setup.startdate.scheme.locations_inactive.startdate", name: scheme.service_name)) - expect(record.errors["scheme_id"]).to include(match I18n.t("validations.setup.startdate.scheme.locations_inactive.startdate", name: scheme.service_name)) + expect(record.errors["startdate"]).to include(match I18n.t("validations.lettings.setup.startdate.scheme.locations_inactive.startdate", name: scheme.service_name)) + expect(record.errors["scheme_id"]).to include(match I18n.t("validations.lettings.setup.startdate.scheme.locations_inactive.startdate", name: scheme.service_name)) end it "produces no error when scheme has active locations on the tenancy start date" do @@ -553,8 +553,8 @@ RSpec.describe Validations::SetupValidations do record.scheme = scheme record.location = location setup_validator.validate_scheme(record) - expect(record.errors["startdate"]).to include(match I18n.t("validations.setup.startdate.scheme.locations_inactive.startdate", name: scheme.service_name)) - expect(record.errors["startdate"]).not_to include(match I18n.t("validations.setup.startdate.location.deactivated.startdate", postcode: location.postcode)) + expect(record.errors["startdate"]).to include(match I18n.t("validations.lettings.setup.startdate.scheme.locations_inactive.startdate", name: scheme.service_name)) + expect(record.errors["startdate"]).not_to include(match I18n.t("validations.lettings.setup.startdate.location.deactivated.startdate", postcode: location.postcode)) end it "produces no error when scheme has active locations on the tenancy start date" do @@ -593,9 +593,9 @@ RSpec.describe Validations::SetupValidations do record.location = location setup_validator.validate_location(record) expect(record.errors["startdate"]) - .to include(match I18n.t("validations.setup.startdate.location.deactivated.startdate", postcode: location.postcode, date: "4 June 2022")) + .to include(match I18n.t("validations.lettings.setup.startdate.location.deactivated.startdate", postcode: location.postcode, date: "4 June 2022")) expect(record.errors["location_id"]) - .to include(match I18n.t("validations.setup.startdate.location.deactivated.location_id", postcode: location.postcode, date: "4 June 2022")) + .to include(match I18n.t("validations.lettings.setup.startdate.location.deactivated.location_id", postcode: location.postcode, date: "4 June 2022")) end it "produces no error when tenancy start date is during an active location period" do @@ -622,9 +622,9 @@ RSpec.describe Validations::SetupValidations do record.location = location setup_validator.validate_location(record) expect(record.errors["startdate"]) - .to include(match I18n.t("validations.setup.startdate.location.reactivating_soon.startdate", postcode: location.postcode, date: "4 August 2022")) + .to include(match I18n.t("validations.lettings.setup.startdate.location.reactivating_soon.startdate", postcode: location.postcode, date: "4 August 2022")) expect(record.errors["location_id"]) - .to include(match I18n.t("validations.setup.startdate.location.reactivating_soon.location_id", postcode: location.postcode, date: "4 August 2022")) + .to include(match I18n.t("validations.lettings.setup.startdate.location.reactivating_soon.location_id", postcode: location.postcode, date: "4 August 2022")) end it "produces no error when tenancy start date is during an active location period" do @@ -655,9 +655,9 @@ RSpec.describe Validations::SetupValidations do record.location = location setup_validator.validate_location(record) expect(record.errors["startdate"]) - .to include(match I18n.t("validations.setup.startdate.location.reactivating_soon.startdate", postcode: location.postcode, date: "4 September 2022")) + .to include(match I18n.t("validations.lettings.setup.startdate.location.reactivating_soon.startdate", postcode: location.postcode, date: "4 September 2022")) expect(record.errors["location_id"]) - .to include(match I18n.t("validations.setup.startdate.location.reactivating_soon.location_id", postcode: location.postcode, date: "4 September 2022")) + .to include(match I18n.t("validations.lettings.setup.startdate.location.reactivating_soon.location_id", postcode: location.postcode, date: "4 September 2022")) end it "produces no error when tenancy start date is during an active location period" do @@ -686,9 +686,9 @@ RSpec.describe Validations::SetupValidations do record.location = location setup_validator.validate_location(record) expect(record.errors["startdate"]) - .to include(match I18n.t("validations.setup.startdate.location.activating_soon.startdate", postcode: location.postcode, date: "15 September 2022")) + .to include(match I18n.t("validations.lettings.setup.startdate.location.activating_soon.startdate", postcode: location.postcode, date: "15 September 2022")) expect(record.errors["location_id"]) - .to include(match I18n.t("validations.setup.startdate.location.activating_soon.location_id", postcode: location.postcode, date: "15 September 2022")) + .to include(match I18n.t("validations.lettings.setup.startdate.location.activating_soon.location_id", postcode: location.postcode, date: "15 September 2022")) end end @@ -726,7 +726,7 @@ RSpec.describe Validations::SetupValidations do record.startdate = Time.zone.local(2022, 7, 5) record.location = location setup_validator.validate_location(record) - expect(record.errors["startdate"]).to include(match I18n.t("validations.setup.startdate.location.deactivated.startdate", postcode: location.postcode)) + expect(record.errors["startdate"]).to include(match I18n.t("validations.lettings.setup.startdate.location.deactivated.startdate", postcode: location.postcode)) end it "produces no error when the chosen location is active on the tenancy start date" do @@ -900,7 +900,7 @@ RSpec.describe Validations::SetupValidations do it "produces an error" do record.scheme = scheme - setup_validator.validate_scheme_has_confirmed_locations_validation(record) + setup_validator.validate_scheme(record) expect(record.errors["scheme_id"]) .to include(match I18n.t("validations.lettings.setup.scheme.no_completed_locations")) end @@ -914,7 +914,7 @@ RSpec.describe Validations::SetupValidations do it "does not produce an error" do record.scheme = scheme - setup_validator.validate_scheme_has_confirmed_locations_validation(record) + setup_validator.validate_scheme(record) expect(record.errors["scheme_id"]) .to be_empty end diff --git a/spec/models/validations/shared_validations_spec.rb b/spec/models/validations/shared_validations_spec.rb index b4d7fb0b8..53efc6675 100644 --- a/spec/models/validations/shared_validations_spec.rb +++ b/spec/models/validations/shared_validations_spec.rb @@ -18,42 +18,42 @@ RSpec.describe Validations::SharedValidations do lettings_log.age1 = "random" shared_validator.validate_numeric_min_max(lettings_log) expect(lettings_log.errors["age1"]) - .to include(match I18n.t("validations.numeric.within_range", field: "Lead tenant’s age", min: 16, max: 120)) + .to include(match I18n.t("validations.shared.numeric.within_range", field: "Lead tenant’s age", min: 16, max: 120)) end it "validates that other household member ages are a number" do lettings_log.age2 = "random" shared_validator.validate_numeric_min_max(lettings_log) expect(lettings_log.errors["age2"]) - .to include(match I18n.t("validations.numeric.within_range", field: "Person 2’s age", min: 1, max: 120)) + .to include(match I18n.t("validations.shared.numeric.within_range", field: "Person 2’s age", min: 1, max: 120)) end it "validates that person 1's age is greater than 16" do lettings_log.age1 = 15 shared_validator.validate_numeric_min_max(lettings_log) expect(lettings_log.errors["age1"]) - .to include(match I18n.t("validations.numeric.within_range", field: "Lead tenant’s age", min: 16, max: 120)) + .to include(match I18n.t("validations.shared.numeric.within_range", field: "Lead tenant’s age", min: 16, max: 120)) end it "validates that other household member ages are greater than 1" do lettings_log.age2 = 0 shared_validator.validate_numeric_min_max(lettings_log) expect(lettings_log.errors["age2"]) - .to include(match I18n.t("validations.numeric.within_range", field: "Person 2’s age", min: 1, max: 120)) + .to include(match I18n.t("validations.shared.numeric.within_range", field: "Person 2’s age", min: 1, max: 120)) end it "validates that person 1's age is less than 121" do lettings_log.age1 = 121 shared_validator.validate_numeric_min_max(lettings_log) expect(lettings_log.errors["age1"]) - .to include(match I18n.t("validations.numeric.within_range", field: "Lead tenant’s age", min: 16, max: 120)) + .to include(match I18n.t("validations.shared.numeric.within_range", field: "Lead tenant’s age", min: 16, max: 120)) end it "validates that other household member ages are greater than 121" do lettings_log.age2 = 123 shared_validator.validate_numeric_min_max(lettings_log) expect(lettings_log.errors["age2"]) - .to include(match I18n.t("validations.numeric.within_range", field: "Person 2’s age", min: 1, max: 120)) + .to include(match I18n.t("validations.shared.numeric.within_range", field: "Person 2’s age", min: 1, max: 120)) end it "validates that person 1's age is between 16 and 120" do @@ -91,7 +91,7 @@ RSpec.describe Validations::SharedValidations do sales_log.savings = -10 sales_log.jointpur = 1 shared_validator.validate_numeric_min_max(sales_log) - expect(sales_log.errors["savings"]).to include(match I18n.t("validations.numeric.above_min", field: "Buyers’ total savings before any deposit paid", min: "£0")) + expect(sales_log.errors["savings"]).to include(match I18n.t("validations.shared.numeric.above_min", field: "Buyers’ total savings before any deposit paid", min: "£0")) end context "when validating percent" do @@ -101,7 +101,7 @@ RSpec.describe Validations::SharedValidations do sales_log.stairbought = 150 shared_validator.validate_numeric_min_max(sales_log) expect(sales_log.errors["stairbought"]) - .to include(match I18n.t("validations.numeric.within_range", field: "Percentage bought in this staircasing transaction", min: "0%", max: "100%")) + .to include(match I18n.t("validations.shared.numeric.within_range", field: "Percentage bought in this staircasing transaction", min: "0%", max: "100%")) end end @@ -110,7 +110,7 @@ RSpec.describe Validations::SharedValidations do sales_log.income1 = -5 shared_validator.validate_numeric_min_max(sales_log) expect(sales_log.errors["income1"]) - .to include(match I18n.t("validations.numeric.within_range", field: "Buyer 1’s gross annual income", min: "£0", max: "£999,999")) + .to include(match I18n.t("validations.shared.numeric.within_range", field: "Buyer 1’s gross annual income", min: "£0", max: "£999,999")) end end end @@ -120,13 +120,13 @@ RSpec.describe Validations::SharedValidations do it "adds an error if input is a decimal" do sales_log.income1 = 30_000.5 shared_validator.validate_numeric_step(sales_log) - expect(sales_log.errors[:income1]).to include I18n.t("validations.numeric.whole_number", field: "Buyer 1’s gross annual income") + expect(sales_log.errors[:income1]).to include I18n.t("validations.shared.numeric.whole_number", field: "Buyer 1’s gross annual income") end it "adds an error if the user attempts to input a number in exponent format" do sales_log.income1 = "3e5" shared_validator.validate_numeric_step(sales_log) - expect(sales_log.errors[:income1]).to include I18n.t("validations.numeric.whole_number", field: "Buyer 1’s gross annual income") + expect(sales_log.errors[:income1]).to include I18n.t("validations.shared.numeric.whole_number", field: "Buyer 1’s gross annual income") end it "does not add an error if input is an integer" do @@ -141,14 +141,14 @@ RSpec.describe Validations::SharedValidations do sales_log.savings = 30_005 sales_log.jointpur = 1 shared_validator.validate_numeric_step(sales_log) - expect(sales_log.errors[:savings]).to include I18n.t("validations.numeric.nearest_ten", field: "Buyers’ total savings before any deposit paid") + expect(sales_log.errors[:savings]).to include I18n.t("validations.shared.numeric.nearest_ten", field: "Buyers’ total savings before any deposit paid") end it "adds an error if the user attempts to input a number in exponent format" do sales_log.savings = "3e5" sales_log.jointpur = 1 shared_validator.validate_numeric_step(sales_log) - expect(sales_log.errors[:savings]).to include I18n.t("validations.numeric.nearest_ten", field: "Buyers’ total savings before any deposit paid") + expect(sales_log.errors[:savings]).to include I18n.t("validations.shared.numeric.nearest_ten", field: "Buyers’ total savings before any deposit paid") end it "does not add an error if input is a multiple of ten" do @@ -162,7 +162,7 @@ RSpec.describe Validations::SharedValidations do it "adds an error if input has more than 2 decimal places" do sales_log.mscharge = 30.7418 shared_validator.validate_numeric_step(sales_log) - expect(sales_log.errors[:mscharge]).to include I18n.t("validations.numeric.nearest_hundredth", field: "Monthly leasehold charges") + expect(sales_log.errors[:mscharge]).to include I18n.t("validations.shared.numeric.nearest_hundredth", field: "Monthly leasehold charges") end it "does not add an error if the user attempts to input a number in exponent format" do @@ -220,13 +220,13 @@ RSpec.describe Validations::SharedValidations do it "does not allow letters" do sales_log.income1 = "abc" shared_validator.validate_numeric_input(sales_log) - expect(sales_log.errors[:income1]).to include I18n.t("validations.numeric.format", field: "Buyer 1’s gross annual income") + expect(sales_log.errors[:income1]).to include I18n.t("validations.shared.numeric.format", field: "Buyer 1’s gross annual income") end it "does not allow special characters" do sales_log.income1 = "3%5" shared_validator.validate_numeric_input(sales_log) - expect(sales_log.errors[:income1]).to include I18n.t("validations.numeric.format", field: "Buyer 1’s gross annual income") + expect(sales_log.errors[:income1]).to include I18n.t("validations.shared.numeric.format", field: "Buyer 1’s gross annual income") end it "allows a digit" do @@ -244,7 +244,7 @@ RSpec.describe Validations::SharedValidations do it "does not allow decimal point in a wrong format" do sales_log.income1 = "300.09.78" shared_validator.validate_numeric_input(sales_log) - expect(sales_log.errors[:income1]).to include I18n.t("validations.numeric.format", field: "Buyer 1’s gross annual income") + expect(sales_log.errors[:income1]).to include I18n.t("validations.shared.numeric.format", field: "Buyer 1’s gross annual income") end end end diff --git a/spec/models/validations/tenancy_validations_spec.rb b/spec/models/validations/tenancy_validations_spec.rb index 751506c07..aa9ca8f6d 100644 --- a/spec/models/validations/tenancy_validations_spec.rb +++ b/spec/models/validations/tenancy_validations_spec.rb @@ -276,7 +276,7 @@ RSpec.describe Validations::TenancyValidations do describe "tenancy type validations" do let(:record) { FactoryBot.build(:lettings_log, :setup_completed) } - let(:field) { "validations.other_field_missing" } + let(:field) { "validations.shared.other_field_missing" } let(:main_field_label) { "tenancy type" } let(:other_field) { "tenancyother" } let(:other_field_label) { "other tenancy type" } @@ -299,7 +299,7 @@ RSpec.describe Validations::TenancyValidations do end context "when tenancy type is not other" do - let(:field) { "validations.other_field_not_required" } + let(:field) { "validations.shared.other_field_not_required" } it "validates that other tenancy type is not provided" do record.tenancy = 2 diff --git a/spec/requests/lettings_logs_controller_spec.rb b/spec/requests/lettings_logs_controller_spec.rb index 308b90c1e..3d2c27400 100644 --- a/spec/requests/lettings_logs_controller_spec.rb +++ b/spec/requests/lettings_logs_controller_spec.rb @@ -82,7 +82,7 @@ RSpec.describe LettingsLogsController, type: :request do it "validates lettings log parameters" do json_response = JSON.parse(response.body) expect(response).to have_http_status(:unprocessable_entity) - expect(json_response["errors"]).to match_array([["offered", [I18n.t("validations.numeric.within_range", field: "Times previously offered since becoming available", min: 0, max: 20)]], ["age1", [I18n.t("validations.numeric.within_range", field: "Lead tenant’s age", min: 16, max: 120)]]]) + expect(json_response["errors"]).to match_array([["offered", [I18n.t("validations.shared.numeric.within_range", field: "Times previously offered since becoming available", min: 0, max: 20)]], ["age1", [I18n.t("validations.shared.numeric.within_range", field: "Lead tenant’s age", min: 16, max: 120)]]]) end end From 224e49825e561e188f12ee4ae32d111bed4b9bfb Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Mon, 11 Nov 2024 17:05:55 +0000 Subject: [PATCH 7/9] CLDC-3719: Move sale completion date question to start of setup section (#2750) * CLDC-3716: Allow 25/26 form use on dev, review, and staging environments * Remove empty line * CLDC-3719: Move sale completion date question to start of setup section * Fix test * Update test fixture csv order --- app/models/form/sales/subsections/setup.rb | 2 +- spec/fixtures/files/sales_logs_csv_export_codes_23.csv | 6 +++--- spec/fixtures/files/sales_logs_csv_export_codes_24.csv | 6 +++--- spec/fixtures/files/sales_logs_csv_export_labels_23.csv | 6 +++--- spec/fixtures/files/sales_logs_csv_export_labels_24.csv | 6 +++--- .../files/sales_logs_csv_export_non_support_labels_24.csv | 6 +++--- spec/models/form/sales/subsections/setup_spec.rb | 4 ++-- spec/models/form_spec.rb | 4 ---- 8 files changed, 18 insertions(+), 22 deletions(-) diff --git a/app/models/form/sales/subsections/setup.rb b/app/models/form/sales/subsections/setup.rb index de623e769..e5b5b3f84 100644 --- a/app/models/form/sales/subsections/setup.rb +++ b/app/models/form/sales/subsections/setup.rb @@ -7,10 +7,10 @@ class Form::Sales::Subsections::Setup < ::Form::Subsection def pages @pages ||= [ + Form::Sales::Pages::SaleDate.new(nil, nil, self), Form::Sales::Pages::OwningOrganisation.new(nil, nil, self), Form::Sales::Pages::ManagingOrganisation.new(nil, nil, self), Form::Sales::Pages::CreatedBy.new(nil, nil, self), - Form::Sales::Pages::SaleDate.new(nil, nil, self), Form::Sales::Pages::PurchaserCode.new(nil, nil, self), Form::Sales::Pages::OwnershipScheme.new(nil, nil, self), Form::Sales::Pages::SharedOwnershipType.new(nil, nil, self), diff --git a/spec/fixtures/files/sales_logs_csv_export_codes_23.csv b/spec/fixtures/files/sales_logs_csv_export_codes_23.csv index 198f89e20..68d7de56b 100644 --- a/spec/fixtures/files/sales_logs_csv_export_codes_23.csv +++ b/spec/fixtures/files/sales_logs_csv_export_codes_23.csv @@ -1,3 +1,3 @@ -Log ID,Status of log,ID of a set of duplicate logs,Time and date the log was created,Time and date the log was last updated,The ID on the old service,Year collection period opened,Was the log submitted in-service or via bulk upload?,Is the user in the created_by column the data protection officer?,Which organisation owned this property before the sale?,Which organisation reported the sale?,User that created the log,User the log is assigned to,Day of sale completion date,Month of sale completion date,Year of sale completion date,What is the purchaser code?,Was this purchase made through an ownership scheme?,What is the type of shared ownership/discounted ownership/outright sale?,"If type = 'Other', what is the type of outright sale?",Is the buyer a company?,Will the buyer(s) live in the property?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,How many bedrooms does the property have?,What type of unit is the property?,Which type of building is the property?,What is the UPRN of the property?,We found an address that might be this property. Is this the property address?,Address line 1,Address line 2,Town/City,County,Part 1 of the property's postcode,Part 2 of the property's postcode,LA code,LA name,Is the property built or adapted to wheelchair-user standards?,Did you interview the buyer to answer these questions?,Has the buyer seen the MHCLG privacy notice?,What is buyer 1's age?,Which of these best describes buyer 1's gender identity?,What is buyer 1's ethnic group?,Which of the following best describes buyer 1's ethnic background?,What is buyer 1's nationality?,Which of these best describes buyer 1's working situation?,Will buyer 1 live in the property?,What is buyer 2 or person 2's relationship to buyer 1?,What is buyer 2 or person 2's age?,Which of these best describes buyer 2 or person 2's gender identity?,What is buyer 2's ethnic group?,Which of the following best describes buyer 2's ethnic background?,What is buyer 2's nationality?,What is buyer 2 or person 2's working situation?,Will buyer 2 live in the property?,"Besides the buyer(s), how many other people live or will live in the property?",What is person 3's relationship to buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,What is person 4's relationship to buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,What is person 5's relationship to buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,What is person 6's relationship to buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,What was buyer 1's previous tenure?,Do you know the postcode of buyer 1's last settled accommodation?,Part 1 of postcode of buyer 1's last settled accommodation,Part 2 of postcode of buyer 1's last settled accommodation,Do you know the local authority of buyer 1's last settled accommodation?,The local authority code of buyer 1's last settled accommodation,The local authority name of buyer 1's last settled accommodation,Was the buyer registered with their PRP (HA)?,Was the buyer registered with another PRP (HA)?,Was the buyer registered with the local authority?,Was the buyer registered with a Help to Buy agent?,"Populated if pregyrha, pregother, pregla and pregghb are blank","At the time of purchase, was buyer 2 living at the same address as buyer 1?",What was buyer 2's previous tenure?,Have any of the buyers ever served as a regular in the UK armed forces?,Is the buyer still serving in the UK armed forces?,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?,Does anyone in the household consider themselves to have a disability?,Does anyone in the household use a wheelchair?,Is buyer 1's annual income known?,What is buyer 1's annual income?,Was buyer 1's income used for a mortgage application?,Is buyer 1's annual income known?,What is buyer 2's annual income?,Was buyer 2's income used for a mortgage application?,Were the buyers receiving any of these housing-related benefits immediately before buying this property?,Is the the total amount the buyers had in savings known?,What is the total amount the buyers had in savings before they paid any deposit for the property?,Have any of the buyers previously owned a property?,Was the previous property under shared ownership?,How long did the buyer(s) live in the property before purchasing it?,Is this a staircasing transaction?,What percentage of the property has been bought in this staircasing transaction?,What percentage of the property do the buyers now own in total?,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?,Is this a resale?,Day of the exchange of contracts,Month of the exchange of contracts,Year of the exchange of contracts,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,Was the household rehoused under a local authority nominations agreement?,"Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?",How many bedrooms did the buyer's previous property have?,What was the previous property type?,What was the rent type of buyer's previous tenure?,What is the full purchase price?,Populated if a soft validation is confirmed.,What was the initial percentage equity stake purchased?,Was a mortgage used to buy this property?,What is the mortgage amount?,What is the name of the mortgage lender?,"If mortgagelender = 'Other', what is the name of the mortgage lender?",What is the length of the mortgage in years?,Does this include any extra borrowing?,How much was the cash deposit paid on the property?,How much cash discount was given through Social Homebuy?,What is the basic monthly rent?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property?,Populated if a soft validation is confirmed.,What was the percentage discount?,"What was the amount of any loan, grant, discount or subsidy given?" -ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,FORM,COLLECTIONYEAR,CREATIONMETHOD,DATAPROTECT,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,BEDS,PROPTYPE,BUILTYPE,UPRN,UPRNCONFIRMED,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,PCODE1,PCODE2,LA,LANAME,WCHAIR,NOINT,PRIVACYNOTICE,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONAL,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONAL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT -,completed,,2023-12-08T00:00:00+00:00,2024-01-01T00:00:00+00:00,,2023,1,false,MHCLG,MHCLG,billyboy@eyeklaud.com,billyboy@eyeklaud.com,8,12,2023,,2,8,,,,1,1,2,1,1,,,Address line 1,,Town or city,,SW1A,1AA,E09000033,Westminster,1,2,1,30,X,17,17,18,1,1,P,35,X,17,,13,1,1,3,C,14,X,,X,-9,X,3,R,-9,R,10,,,,,1,1,,,0,,,1,1,1,1,,3,,1,4,5,1,1,0,10000,1,0,10000,1,4,1,,1,2,10,,,,,,,,,,,,,,,,,110000.0,,,1,20000.0,5,,10,1,80000.0,,,1,100.0,,,10000.0 +Log ID,Status of log,ID of a set of duplicate logs,Time and date the log was created,Time and date the log was last updated,The ID on the old service,Year collection period opened,Was the log submitted in-service or via bulk upload?,Is the user in the created_by column the data protection officer?,Day of sale completion date,Month of sale completion date,Year of sale completion date,Which organisation owned this property before the sale?,Which organisation reported the sale?,User that created the log,User the log is assigned to,What is the purchaser code?,Was this purchase made through an ownership scheme?,What is the type of shared ownership/discounted ownership/outright sale?,"If type = 'Other', what is the type of outright sale?",Is the buyer a company?,Will the buyer(s) live in the property?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,How many bedrooms does the property have?,What type of unit is the property?,Which type of building is the property?,What is the UPRN of the property?,We found an address that might be this property. Is this the property address?,Address line 1,Address line 2,Town/City,County,Part 1 of the property's postcode,Part 2 of the property's postcode,LA code,LA name,Is the property built or adapted to wheelchair-user standards?,Did you interview the buyer to answer these questions?,Has the buyer seen the MHCLG privacy notice?,What is buyer 1's age?,Which of these best describes buyer 1's gender identity?,What is buyer 1's ethnic group?,Which of the following best describes buyer 1's ethnic background?,What is buyer 1's nationality?,Which of these best describes buyer 1's working situation?,Will buyer 1 live in the property?,What is buyer 2 or person 2's relationship to buyer 1?,What is buyer 2 or person 2's age?,Which of these best describes buyer 2 or person 2's gender identity?,What is buyer 2's ethnic group?,Which of the following best describes buyer 2's ethnic background?,What is buyer 2's nationality?,What is buyer 2 or person 2's working situation?,Will buyer 2 live in the property?,"Besides the buyer(s), how many other people live or will live in the property?",What is person 3's relationship to buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,What is person 4's relationship to buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,What is person 5's relationship to buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,What is person 6's relationship to buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,What was buyer 1's previous tenure?,Do you know the postcode of buyer 1's last settled accommodation?,Part 1 of postcode of buyer 1's last settled accommodation,Part 2 of postcode of buyer 1's last settled accommodation,Do you know the local authority of buyer 1's last settled accommodation?,The local authority code of buyer 1's last settled accommodation,The local authority name of buyer 1's last settled accommodation,Was the buyer registered with their PRP (HA)?,Was the buyer registered with another PRP (HA)?,Was the buyer registered with the local authority?,Was the buyer registered with a Help to Buy agent?,"Populated if pregyrha, pregother, pregla and pregghb are blank","At the time of purchase, was buyer 2 living at the same address as buyer 1?",What was buyer 2's previous tenure?,Have any of the buyers ever served as a regular in the UK armed forces?,Is the buyer still serving in the UK armed forces?,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?,Does anyone in the household consider themselves to have a disability?,Does anyone in the household use a wheelchair?,Is buyer 1's annual income known?,What is buyer 1's annual income?,Was buyer 1's income used for a mortgage application?,Is buyer 1's annual income known?,What is buyer 2's annual income?,Was buyer 2's income used for a mortgage application?,Were the buyers receiving any of these housing-related benefits immediately before buying this property?,Is the the total amount the buyers had in savings known?,What is the total amount the buyers had in savings before they paid any deposit for the property?,Have any of the buyers previously owned a property?,Was the previous property under shared ownership?,How long did the buyer(s) live in the property before purchasing it?,Is this a staircasing transaction?,What percentage of the property has been bought in this staircasing transaction?,What percentage of the property do the buyers now own in total?,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?,Is this a resale?,Day of the exchange of contracts,Month of the exchange of contracts,Year of the exchange of contracts,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,Was the household rehoused under a local authority nominations agreement?,"Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?",How many bedrooms did the buyer's previous property have?,What was the previous property type?,What was the rent type of buyer's previous tenure?,What is the full purchase price?,Populated if a soft validation is confirmed.,What was the initial percentage equity stake purchased?,Was a mortgage used to buy this property?,What is the mortgage amount?,What is the name of the mortgage lender?,"If mortgagelender = 'Other', what is the name of the mortgage lender?",What is the length of the mortgage in years?,Does this include any extra borrowing?,How much was the cash deposit paid on the property?,How much cash discount was given through Social Homebuy?,What is the basic monthly rent?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property?,Populated if a soft validation is confirmed.,What was the percentage discount?,"What was the amount of any loan, grant, discount or subsidy given?" +ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,FORM,COLLECTIONYEAR,CREATIONMETHOD,DATAPROTECT,DAY,MONTH,YEAR,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,BEDS,PROPTYPE,BUILTYPE,UPRN,UPRNCONFIRMED,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,PCODE1,PCODE2,LA,LANAME,WCHAIR,NOINT,PRIVACYNOTICE,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONAL,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONAL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT +,completed,,2023-12-08T00:00:00+00:00,2024-01-01T00:00:00+00:00,,2023,1,false,8,12,2023,MHCLG,MHCLG,billyboy@eyeklaud.com,billyboy@eyeklaud.com,,2,8,,,,1,1,2,1,1,,,Address line 1,,Town or city,,SW1A,1AA,E09000033,Westminster,1,2,1,30,X,17,17,18,1,1,P,35,X,17,,13,1,1,3,C,14,X,,X,-9,X,3,R,-9,R,10,,,,,1,1,,,0,,,1,1,1,1,,3,,1,4,5,1,1,0,10000,1,0,10000,1,4,1,,1,2,10,,,,,,,,,,,,,,,,,110000.0,,,1,20000.0,5,,10,1,80000.0,,,1,100.0,,,10000.0 diff --git a/spec/fixtures/files/sales_logs_csv_export_codes_24.csv b/spec/fixtures/files/sales_logs_csv_export_codes_24.csv index 6cacd2ef2..a93f0521f 100644 --- a/spec/fixtures/files/sales_logs_csv_export_codes_24.csv +++ b/spec/fixtures/files/sales_logs_csv_export_codes_24.csv @@ -1,3 +1,3 @@ -Log ID,Status of log,ID of a set of duplicate logs,Time and date the log was created,Time and date the log was last updated,Year collection period opened,Was the log submitted in-service or via bulk upload?,ID of a set of bulk uploaded logs,Is the user in the created_by column the data protection officer?,Which organisation owned this property before the sale?,Which organisation reported the sale?,User that created the log,User the log is assigned to,Day of sale completion date,Month of sale completion date,Year of sale completion date,What is the purchaser code?,Was this purchase made through an ownership scheme?,What is the type of shared ownership/discounted ownership/outright sale?,"If type = 'Other', what is the type of outright sale?",Is the buyer a company?,Will the buyer(s) live in the property?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,Did you interview the buyer to answer these questions?,Has the buyer seen the MHCLG privacy notice?,What is the UPRN of the property?,Address line 1,Address line 2,Town/City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,LA name,LA code,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,How many bedrooms does the property have?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,What is buyer 1's age?,Which of these best describes buyer 1's gender identity?,What is buyer 1's ethnic group?,Which of the following best describes buyer 1's ethnic background?,What is buyer 1's nationality?,Which of these best describes buyer 1's working situation?,Will buyer 1 live in the property?,What is buyer 2 or person 2's relationship to buyer 1?,What is buyer 2 or person 2's age?,Which of these best describes buyer 2 or person 2's gender identity?,What is buyer 2's ethnic group?,Which of the following best describes buyer 2's ethnic background?,What is buyer 2's nationality?,What is buyer 2 or person 2's working situation?,Will buyer 2 live in the property?,"Besides the buyer(s), how many other people live or will live in the property?",What is person 3's relationship to buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,What is person 4's relationship to buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,What is person 5's relationship to buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,What is person 6's relationship to buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,What was buyer 1's previous tenure?,Do you know the postcode of buyer 1's last settled accommodation?,Part 1 of postcode of buyer 1's last settled accommodation,Part 2 of postcode of buyer 1's last settled accommodation,Do you know the local authority of buyer 1's last settled accommodation?,The local authority code of buyer 1's last settled accommodation,The local authority name of buyer 1's last settled accommodation,Was the buyer registered with their PRP (HA)?,Was the buyer registered with another PRP (HA)?,Was the buyer registered with the local authority?,Was the buyer registered with a Help to Buy agent?,"Populated if pregyrha, pregother, pregla and pregghb are blank","At the time of purchase, was buyer 2 living at the same address as buyer 1?",What was buyer 2's previous tenure?,Have any of the buyers ever served as a regular in the UK armed forces?,Is the buyer still serving in the UK armed forces?,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?,Does anyone in the household consider themselves to have a disability?,Does anyone in the household use a wheelchair?,Is buyer 1's annual income known?,What is buyer 1's annual income?,Was buyer 1's income used for a mortgage application?,Is buyer 1's annual income known?,What is buyer 2's annual income?,Was buyer 2's income used for a mortgage application?,Were the buyers receiving any of these housing-related benefits immediately before buying this property?,Is the the total amount the buyers had in savings known?,What is the total amount the buyers had in savings before they paid any deposit for the property?,Have any of the buyers previously owned a property?,Was the previous property under shared ownership?,How long did the buyer(s) live in the property before purchasing it?,Is this a staircasing transaction?,What percentage of the property has been bought in this staircasing transaction?,What percentage of the property do the buyers now own in total?,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?,Is this a resale?,Day of the exchange of contracts,Month of the exchange of contracts,Year of the exchange of contracts,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,Was the household rehoused under a local authority nominations agreement?,"Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?",How many bedrooms did the buyer's previous property have?,What was the previous property type?,What was the rent type of buyer's previous tenure?,What is the full purchase price?,Populated if a soft validation is confirmed.,What was the initial percentage equity stake purchased?,Was a mortgage used to buy this property?,What is the mortgage amount?,What is the name of the mortgage lender?,"If mortgagelender = 'Other', what is the name of the mortgage lender?",What is the length of the mortgage in years?,Does this include any extra borrowing?,How much was the cash deposit paid on the property?,How much cash discount was given through Social Homebuy?,What is the basic monthly rent?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property?,Populated if a soft validation is confirmed.,What was the percentage discount?,"What was the amount of any loan, grant, discount or subsidy given?" -ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,COLLECTIONYEAR,CREATIONMETHOD,BULKUPLOADID,DATAPROTECT,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,NOINT,PRIVACYNOTICE,UPRN,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,POSTCODE,ISLAINFERRED,LANAME,LA,UPRNSELECTED,ADDRESS_SEARCH_VALUE_CHECK,ADDRESS1INPUT,POSTCODEINPUT,BULKADDRESS1,BULKADDRESS2,BULKTOWNCITY,BULKCOUNTY,BULKPOSTCODE,BULKLA,BEDS,PROPTYPE,BUILTYPE,WCHAIR,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONALITYALL1,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONALITYALL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT -,completed,,2024-05-01T00:00:00+01:00,2024-05-01T00:00:00+01:00,2024,1,,false,MHCLG,MHCLG,billyboy@eyeklaud.com,billyboy@eyeklaud.com,1,5,2024,,2,8,,,,1,1,2,1,1,"1, Test Street",,Test Town,,AA1 1AA,true,Westminster,E09000033,,,Address line 1,SW1A 1AA,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,2,1,1,1,30,X,17,17,826,1,1,P,35,X,17,,826,1,1,3,C,14,X,9,X,-9,X,3,R,-9,R,10,,,,,1,0,SW1A,1AA,1,E09000033,Westminster,1,1,1,1,,3,,1,4,5,1,1,0,10000,1,0,10000,1,4,1,,1,2,10,,,,,,,,,,,,,,,,,110000.0,,,1,20000.0,5,,10,1,80000.0,,,1,100.0,,,10000.0 +Log ID,Status of log,ID of a set of duplicate logs,Time and date the log was created,Time and date the log was last updated,Year collection period opened,Was the log submitted in-service or via bulk upload?,ID of a set of bulk uploaded logs,Is the user in the created_by column the data protection officer?,Day of sale completion date,Month of sale completion date,Year of sale completion date,Which organisation owned this property before the sale?,Which organisation reported the sale?,User that created the log,User the log is assigned to,What is the purchaser code?,Was this purchase made through an ownership scheme?,What is the type of shared ownership/discounted ownership/outright sale?,"If type = 'Other', what is the type of outright sale?",Is the buyer a company?,Will the buyer(s) live in the property?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,Did you interview the buyer to answer these questions?,Has the buyer seen the MHCLG privacy notice?,What is the UPRN of the property?,Address line 1,Address line 2,Town/City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,LA name,LA code,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,How many bedrooms does the property have?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,What is buyer 1's age?,Which of these best describes buyer 1's gender identity?,What is buyer 1's ethnic group?,Which of the following best describes buyer 1's ethnic background?,What is buyer 1's nationality?,Which of these best describes buyer 1's working situation?,Will buyer 1 live in the property?,What is buyer 2 or person 2's relationship to buyer 1?,What is buyer 2 or person 2's age?,Which of these best describes buyer 2 or person 2's gender identity?,What is buyer 2's ethnic group?,Which of the following best describes buyer 2's ethnic background?,What is buyer 2's nationality?,What is buyer 2 or person 2's working situation?,Will buyer 2 live in the property?,"Besides the buyer(s), how many other people live or will live in the property?",What is person 3's relationship to buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,What is person 4's relationship to buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,What is person 5's relationship to buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,What is person 6's relationship to buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,What was buyer 1's previous tenure?,Do you know the postcode of buyer 1's last settled accommodation?,Part 1 of postcode of buyer 1's last settled accommodation,Part 2 of postcode of buyer 1's last settled accommodation,Do you know the local authority of buyer 1's last settled accommodation?,The local authority code of buyer 1's last settled accommodation,The local authority name of buyer 1's last settled accommodation,Was the buyer registered with their PRP (HA)?,Was the buyer registered with another PRP (HA)?,Was the buyer registered with the local authority?,Was the buyer registered with a Help to Buy agent?,"Populated if pregyrha, pregother, pregla and pregghb are blank","At the time of purchase, was buyer 2 living at the same address as buyer 1?",What was buyer 2's previous tenure?,Have any of the buyers ever served as a regular in the UK armed forces?,Is the buyer still serving in the UK armed forces?,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?,Does anyone in the household consider themselves to have a disability?,Does anyone in the household use a wheelchair?,Is buyer 1's annual income known?,What is buyer 1's annual income?,Was buyer 1's income used for a mortgage application?,Is buyer 1's annual income known?,What is buyer 2's annual income?,Was buyer 2's income used for a mortgage application?,Were the buyers receiving any of these housing-related benefits immediately before buying this property?,Is the the total amount the buyers had in savings known?,What is the total amount the buyers had in savings before they paid any deposit for the property?,Have any of the buyers previously owned a property?,Was the previous property under shared ownership?,How long did the buyer(s) live in the property before purchasing it?,Is this a staircasing transaction?,What percentage of the property has been bought in this staircasing transaction?,What percentage of the property do the buyers now own in total?,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?,Is this a resale?,Day of the exchange of contracts,Month of the exchange of contracts,Year of the exchange of contracts,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,Was the household rehoused under a local authority nominations agreement?,"Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?",How many bedrooms did the buyer's previous property have?,What was the previous property type?,What was the rent type of buyer's previous tenure?,What is the full purchase price?,Populated if a soft validation is confirmed.,What was the initial percentage equity stake purchased?,Was a mortgage used to buy this property?,What is the mortgage amount?,What is the name of the mortgage lender?,"If mortgagelender = 'Other', what is the name of the mortgage lender?",What is the length of the mortgage in years?,Does this include any extra borrowing?,How much was the cash deposit paid on the property?,How much cash discount was given through Social Homebuy?,What is the basic monthly rent?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property?,Populated if a soft validation is confirmed.,What was the percentage discount?,"What was the amount of any loan, grant, discount or subsidy given?" +ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,COLLECTIONYEAR,CREATIONMETHOD,BULKUPLOADID,DATAPROTECT,DAY,MONTH,YEAR,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,NOINT,PRIVACYNOTICE,UPRN,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,POSTCODE,ISLAINFERRED,LANAME,LA,UPRNSELECTED,ADDRESS_SEARCH_VALUE_CHECK,ADDRESS1INPUT,POSTCODEINPUT,BULKADDRESS1,BULKADDRESS2,BULKTOWNCITY,BULKCOUNTY,BULKPOSTCODE,BULKLA,BEDS,PROPTYPE,BUILTYPE,WCHAIR,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONALITYALL1,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONALITYALL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT +,completed,,2024-05-01T00:00:00+01:00,2024-05-01T00:00:00+01:00,2024,1,,false,1,5,2024,MHCLG,MHCLG,billyboy@eyeklaud.com,billyboy@eyeklaud.com,,2,8,,,,1,1,2,1,1,"1, Test Street",,Test Town,,AA1 1AA,true,Westminster,E09000033,,,Address line 1,SW1A 1AA,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,2,1,1,1,30,X,17,17,826,1,1,P,35,X,17,,826,1,1,3,C,14,X,9,X,-9,X,3,R,-9,R,10,,,,,1,0,SW1A,1AA,1,E09000033,Westminster,1,1,1,1,,3,,1,4,5,1,1,0,10000,1,0,10000,1,4,1,,1,2,10,,,,,,,,,,,,,,,,,110000.0,,,1,20000.0,5,,10,1,80000.0,,,1,100.0,,,10000.0 diff --git a/spec/fixtures/files/sales_logs_csv_export_labels_23.csv b/spec/fixtures/files/sales_logs_csv_export_labels_23.csv index 10850a9db..349ea54ea 100644 --- a/spec/fixtures/files/sales_logs_csv_export_labels_23.csv +++ b/spec/fixtures/files/sales_logs_csv_export_labels_23.csv @@ -1,3 +1,3 @@ -Log ID,Status of log,ID of a set of duplicate logs,Time and date the log was created,Time and date the log was last updated,The ID on the old service,Year collection period opened,Was the log submitted in-service or via bulk upload?,Is the user in the created_by column the data protection officer?,Which organisation owned this property before the sale?,Which organisation reported the sale?,User that created the log,User the log is assigned to,Day of sale completion date,Month of sale completion date,Year of sale completion date,What is the purchaser code?,Was this purchase made through an ownership scheme?,What is the type of shared ownership/discounted ownership/outright sale?,"If type = 'Other', what is the type of outright sale?",Is the buyer a company?,Will the buyer(s) live in the property?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,How many bedrooms does the property have?,What type of unit is the property?,Which type of building is the property?,What is the UPRN of the property?,We found an address that might be this property. Is this the property address?,Address line 1,Address line 2,Town/City,County,Part 1 of the property's postcode,Part 2 of the property's postcode,LA code,LA name,Is the property built or adapted to wheelchair-user standards?,Did you interview the buyer to answer these questions?,Has the buyer seen the MHCLG privacy notice?,What is buyer 1's age?,Which of these best describes buyer 1's gender identity?,What is buyer 1's ethnic group?,Which of the following best describes buyer 1's ethnic background?,What is buyer 1's nationality?,Which of these best describes buyer 1's working situation?,Will buyer 1 live in the property?,What is buyer 2 or person 2's relationship to buyer 1?,What is buyer 2 or person 2's age?,Which of these best describes buyer 2 or person 2's gender identity?,What is buyer 2's ethnic group?,Which of the following best describes buyer 2's ethnic background?,What is buyer 2's nationality?,What is buyer 2 or person 2's working situation?,Will buyer 2 live in the property?,"Besides the buyer(s), how many other people live or will live in the property?",What is person 3's relationship to buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,What is person 4's relationship to buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,What is person 5's relationship to buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,What is person 6's relationship to buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,What was buyer 1's previous tenure?,Do you know the postcode of buyer 1's last settled accommodation?,Part 1 of postcode of buyer 1's last settled accommodation,Part 2 of postcode of buyer 1's last settled accommodation,Do you know the local authority of buyer 1's last settled accommodation?,The local authority code of buyer 1's last settled accommodation,The local authority name of buyer 1's last settled accommodation,Was the buyer registered with their PRP (HA)?,Was the buyer registered with another PRP (HA)?,Was the buyer registered with the local authority?,Was the buyer registered with a Help to Buy agent?,"Populated if pregyrha, pregother, pregla and pregghb are blank","At the time of purchase, was buyer 2 living at the same address as buyer 1?",What was buyer 2's previous tenure?,Have any of the buyers ever served as a regular in the UK armed forces?,Is the buyer still serving in the UK armed forces?,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?,Does anyone in the household consider themselves to have a disability?,Does anyone in the household use a wheelchair?,Is buyer 1's annual income known?,What is buyer 1's annual income?,Was buyer 1's income used for a mortgage application?,Is buyer 1's annual income known?,What is buyer 2's annual income?,Was buyer 2's income used for a mortgage application?,Were the buyers receiving any of these housing-related benefits immediately before buying this property?,Is the the total amount the buyers had in savings known?,What is the total amount the buyers had in savings before they paid any deposit for the property?,Have any of the buyers previously owned a property?,Was the previous property under shared ownership?,How long did the buyer(s) live in the property before purchasing it?,Is this a staircasing transaction?,What percentage of the property has been bought in this staircasing transaction?,What percentage of the property do the buyers now own in total?,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?,Is this a resale?,Day of the exchange of contracts,Month of the exchange of contracts,Year of the exchange of contracts,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,Was the household rehoused under a local authority nominations agreement?,"Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?",How many bedrooms did the buyer's previous property have?,What was the previous property type?,What was the rent type of buyer's previous tenure?,What is the full purchase price?,Populated if a soft validation is confirmed.,What was the initial percentage equity stake purchased?,Was a mortgage used to buy this property?,What is the mortgage amount?,What is the name of the mortgage lender?,"If mortgagelender = 'Other', what is the name of the mortgage lender?",What is the length of the mortgage in years?,Does this include any extra borrowing?,How much was the cash deposit paid on the property?,How much cash discount was given through Social Homebuy?,What is the basic monthly rent?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property?,Populated if a soft validation is confirmed.,What was the percentage discount?,"What was the amount of any loan, grant, discount or subsidy given?" -ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,FORM,COLLECTIONYEAR,CREATIONMETHOD,DATAPROTECT,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,BEDS,PROPTYPE,BUILTYPE,UPRN,UPRNCONFIRMED,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,PCODE1,PCODE2,LA,LANAME,WCHAIR,NOINT,PRIVACYNOTICE,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONAL,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONAL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT -,completed,,2023-12-08T00:00:00+00:00,2024-01-01T00:00:00+00:00,,2023,single log,false,MHCLG,MHCLG,billyboy@eyeklaud.com,billyboy@eyeklaud.com,8,12,2023,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,2,Flat or maisonette,Purpose built,,,Address line 1,,Town or city,,SW1A,1AA,E09000033,Westminster,Yes,Yes,1,30,Non-binary,Buyer prefers not to say,17,United Kingdom,Full-time - 30 hours or more,Yes,Partner,35,Non-binary,Buyer prefers not to say,,Buyer prefers not to say,Full-time - 30 hours or more,Yes,3,Child,14,Non-binary,,Other,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,Local authority tenant,No,,,No,,,1,1,1,1,,Don't know,,Yes,Yes,No,Yes,Yes,Yes,10000,Yes,Yes,10000,Yes,Don’t know ,No,,Yes,No,10,,,,,,,,,,,,,,,,,110000.0,,,Yes,20000.0,Cambridge Building Society,,10,Yes,80000.0,,,Yes,100.0,,,10000.0 +Log ID,Status of log,ID of a set of duplicate logs,Time and date the log was created,Time and date the log was last updated,The ID on the old service,Year collection period opened,Was the log submitted in-service or via bulk upload?,Is the user in the created_by column the data protection officer?,Day of sale completion date,Month of sale completion date,Year of sale completion date,Which organisation owned this property before the sale?,Which organisation reported the sale?,User that created the log,User the log is assigned to,What is the purchaser code?,Was this purchase made through an ownership scheme?,What is the type of shared ownership/discounted ownership/outright sale?,"If type = 'Other', what is the type of outright sale?",Is the buyer a company?,Will the buyer(s) live in the property?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,How many bedrooms does the property have?,What type of unit is the property?,Which type of building is the property?,What is the UPRN of the property?,We found an address that might be this property. Is this the property address?,Address line 1,Address line 2,Town/City,County,Part 1 of the property's postcode,Part 2 of the property's postcode,LA code,LA name,Is the property built or adapted to wheelchair-user standards?,Did you interview the buyer to answer these questions?,Has the buyer seen the MHCLG privacy notice?,What is buyer 1's age?,Which of these best describes buyer 1's gender identity?,What is buyer 1's ethnic group?,Which of the following best describes buyer 1's ethnic background?,What is buyer 1's nationality?,Which of these best describes buyer 1's working situation?,Will buyer 1 live in the property?,What is buyer 2 or person 2's relationship to buyer 1?,What is buyer 2 or person 2's age?,Which of these best describes buyer 2 or person 2's gender identity?,What is buyer 2's ethnic group?,Which of the following best describes buyer 2's ethnic background?,What is buyer 2's nationality?,What is buyer 2 or person 2's working situation?,Will buyer 2 live in the property?,"Besides the buyer(s), how many other people live or will live in the property?",What is person 3's relationship to buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,What is person 4's relationship to buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,What is person 5's relationship to buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,What is person 6's relationship to buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,What was buyer 1's previous tenure?,Do you know the postcode of buyer 1's last settled accommodation?,Part 1 of postcode of buyer 1's last settled accommodation,Part 2 of postcode of buyer 1's last settled accommodation,Do you know the local authority of buyer 1's last settled accommodation?,The local authority code of buyer 1's last settled accommodation,The local authority name of buyer 1's last settled accommodation,Was the buyer registered with their PRP (HA)?,Was the buyer registered with another PRP (HA)?,Was the buyer registered with the local authority?,Was the buyer registered with a Help to Buy agent?,"Populated if pregyrha, pregother, pregla and pregghb are blank","At the time of purchase, was buyer 2 living at the same address as buyer 1?",What was buyer 2's previous tenure?,Have any of the buyers ever served as a regular in the UK armed forces?,Is the buyer still serving in the UK armed forces?,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?,Does anyone in the household consider themselves to have a disability?,Does anyone in the household use a wheelchair?,Is buyer 1's annual income known?,What is buyer 1's annual income?,Was buyer 1's income used for a mortgage application?,Is buyer 1's annual income known?,What is buyer 2's annual income?,Was buyer 2's income used for a mortgage application?,Were the buyers receiving any of these housing-related benefits immediately before buying this property?,Is the the total amount the buyers had in savings known?,What is the total amount the buyers had in savings before they paid any deposit for the property?,Have any of the buyers previously owned a property?,Was the previous property under shared ownership?,How long did the buyer(s) live in the property before purchasing it?,Is this a staircasing transaction?,What percentage of the property has been bought in this staircasing transaction?,What percentage of the property do the buyers now own in total?,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?,Is this a resale?,Day of the exchange of contracts,Month of the exchange of contracts,Year of the exchange of contracts,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,Was the household rehoused under a local authority nominations agreement?,"Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?",How many bedrooms did the buyer's previous property have?,What was the previous property type?,What was the rent type of buyer's previous tenure?,What is the full purchase price?,Populated if a soft validation is confirmed.,What was the initial percentage equity stake purchased?,Was a mortgage used to buy this property?,What is the mortgage amount?,What is the name of the mortgage lender?,"If mortgagelender = 'Other', what is the name of the mortgage lender?",What is the length of the mortgage in years?,Does this include any extra borrowing?,How much was the cash deposit paid on the property?,How much cash discount was given through Social Homebuy?,What is the basic monthly rent?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property?,Populated if a soft validation is confirmed.,What was the percentage discount?,"What was the amount of any loan, grant, discount or subsidy given?" +ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,FORM,COLLECTIONYEAR,CREATIONMETHOD,DATAPROTECT,DAY,MONTH,YEAR,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,BEDS,PROPTYPE,BUILTYPE,UPRN,UPRNCONFIRMED,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,PCODE1,PCODE2,LA,LANAME,WCHAIR,NOINT,PRIVACYNOTICE,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONAL,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONAL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT +,completed,,2023-12-08T00:00:00+00:00,2024-01-01T00:00:00+00:00,,2023,single log,false,8,12,2023,MHCLG,MHCLG,billyboy@eyeklaud.com,billyboy@eyeklaud.com,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,2,Flat or maisonette,Purpose built,,,Address line 1,,Town or city,,SW1A,1AA,E09000033,Westminster,Yes,Yes,1,30,Non-binary,Buyer prefers not to say,17,United Kingdom,Full-time - 30 hours or more,Yes,Partner,35,Non-binary,Buyer prefers not to say,,Buyer prefers not to say,Full-time - 30 hours or more,Yes,3,Child,14,Non-binary,,Other,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,Local authority tenant,No,,,No,,,1,1,1,1,,Don't know,,Yes,Yes,No,Yes,Yes,Yes,10000,Yes,Yes,10000,Yes,Don’t know ,No,,Yes,No,10,,,,,,,,,,,,,,,,,110000.0,,,Yes,20000.0,Cambridge Building Society,,10,Yes,80000.0,,,Yes,100.0,,,10000.0 diff --git a/spec/fixtures/files/sales_logs_csv_export_labels_24.csv b/spec/fixtures/files/sales_logs_csv_export_labels_24.csv index 3fc32f421..cd16ee79c 100644 --- a/spec/fixtures/files/sales_logs_csv_export_labels_24.csv +++ b/spec/fixtures/files/sales_logs_csv_export_labels_24.csv @@ -1,3 +1,3 @@ -Log ID,Status of log,ID of a set of duplicate logs,Time and date the log was created,Time and date the log was last updated,Year collection period opened,Was the log submitted in-service or via bulk upload?,ID of a set of bulk uploaded logs,Is the user in the created_by column the data protection officer?,Which organisation owned this property before the sale?,Which organisation reported the sale?,User that created the log,User the log is assigned to,Day of sale completion date,Month of sale completion date,Year of sale completion date,What is the purchaser code?,Was this purchase made through an ownership scheme?,What is the type of shared ownership/discounted ownership/outright sale?,"If type = 'Other', what is the type of outright sale?",Is the buyer a company?,Will the buyer(s) live in the property?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,Did you interview the buyer to answer these questions?,Has the buyer seen the MHCLG privacy notice?,"What is the UPRN of the property?",Address line 1,Address line 2,Town/City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,LA name,LA code,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,How many bedrooms does the property have?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,What is buyer 1's age?,Which of these best describes buyer 1's gender identity?,What is buyer 1's ethnic group?,Which of the following best describes buyer 1's ethnic background?,What is buyer 1's nationality?,Which of these best describes buyer 1's working situation?,Will buyer 1 live in the property?,What is buyer 2 or person 2's relationship to buyer 1?,What is buyer 2 or person 2's age?,Which of these best describes buyer 2 or person 2's gender identity?,What is buyer 2's ethnic group?,Which of the following best describes buyer 2's ethnic background?,What is buyer 2's nationality?,What is buyer 2 or person 2's working situation?,Will buyer 2 live in the property?,"Besides the buyer(s), how many other people live or will live in the property?",What is person 3's relationship to buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,What is person 4's relationship to buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,What is person 5's relationship to buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,What is person 6's relationship to buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,What was buyer 1's previous tenure?,Do you know the postcode of buyer 1's last settled accommodation?,Part 1 of postcode of buyer 1's last settled accommodation,Part 2 of postcode of buyer 1's last settled accommodation,Do you know the local authority of buyer 1's last settled accommodation?,The local authority code of buyer 1's last settled accommodation,The local authority name of buyer 1's last settled accommodation,Was the buyer registered with their PRP (HA)?,Was the buyer registered with another PRP (HA)?,Was the buyer registered with the local authority?,Was the buyer registered with a Help to Buy agent?,"Populated if pregyrha, pregother, pregla and pregghb are blank","At the time of purchase, was buyer 2 living at the same address as buyer 1?",What was buyer 2's previous tenure?,Have any of the buyers ever served as a regular in the UK armed forces?,Is the buyer still serving in the UK armed forces?,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?,Does anyone in the household consider themselves to have a disability?,Does anyone in the household use a wheelchair?,Is buyer 1's annual income known?,What is buyer 1's annual income?,Was buyer 1's income used for a mortgage application?,Is buyer 1's annual income known?,What is buyer 2's annual income?,Was buyer 2's income used for a mortgage application?,Were the buyers receiving any of these housing-related benefits immediately before buying this property?,Is the the total amount the buyers had in savings known?,What is the total amount the buyers had in savings before they paid any deposit for the property?,Have any of the buyers previously owned a property?,Was the previous property under shared ownership?,How long did the buyer(s) live in the property before purchasing it?,Is this a staircasing transaction?,What percentage of the property has been bought in this staircasing transaction?,What percentage of the property do the buyers now own in total?,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?,Is this a resale?,Day of the exchange of contracts,Month of the exchange of contracts,Year of the exchange of contracts,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,Was the household rehoused under a local authority nominations agreement?,"Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?",How many bedrooms did the buyer's previous property have?,What was the previous property type?,What was the rent type of buyer's previous tenure?,What is the full purchase price?,Populated if a soft validation is confirmed.,What was the initial percentage equity stake purchased?,Was a mortgage used to buy this property?,What is the mortgage amount?,What is the name of the mortgage lender?,"If mortgagelender = 'Other', what is the name of the mortgage lender?",What is the length of the mortgage in years?,Does this include any extra borrowing?,How much was the cash deposit paid on the property?,How much cash discount was given through Social Homebuy?,What is the basic monthly rent?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property?,Populated if a soft validation is confirmed.,What was the percentage discount?,"What was the amount of any loan, grant, discount or subsidy given?" -ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,COLLECTIONYEAR,CREATIONMETHOD,BULKUPLOADID,DATAPROTECT,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,NOINT,PRIVACYNOTICE,UPRN,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,POSTCODE,ISLAINFERRED,LANAME,LA,UPRNSELECTED,ADDRESS_SEARCH_VALUE_CHECK,ADDRESS1INPUT,POSTCODEINPUT,BULKADDRESS1,BULKADDRESS2,BULKTOWNCITY,BULKCOUNTY,BULKPOSTCODE,BULKLA,BEDS,PROPTYPE,BUILTYPE,WCHAIR,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONALITYALL1,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONALITYALL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT -,completed,,2024-05-01T00:00:00+01:00,2024-05-01T00:00:00+01:00,2024,single log,,false,MHCLG,MHCLG,billyboy@eyeklaud.com,billyboy@eyeklaud.com,1,5,2024,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,Yes,1,1,"1, Test Street",,Test Town,,AA1 1AA,Yes,Westminster,E09000033,,,Address line 1,SW1A 1AA,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,2,Flat or maisonette,Purpose built,Yes,30,Non-binary,Buyer prefers not to say,17,United Kingdom,Full-time - 30 hours or more,Yes,Partner,35,Non-binary,Buyer prefers not to say,,United Kingdom,Full-time - 30 hours or more,Yes,3,Child,14,Non-binary,Child under 16,Other,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,Local authority tenant,Yes,AA1,1AA,Yes,E09000033,Westminster,1,1,1,1,,Don't know,,Yes,Yes,No,Yes,Yes,Yes,10000,Yes,Yes,10000,Yes,Don’t know ,No,,Yes,No,10,,,,,,,,,,,,,,,,,110000.0,,,Yes,20000.0,Cambridge Building Society,,10,Yes,80000.0,,,Yes,100.0,,,10000.0 +Log ID,Status of log,ID of a set of duplicate logs,Time and date the log was created,Time and date the log was last updated,Year collection period opened,Was the log submitted in-service or via bulk upload?,ID of a set of bulk uploaded logs,Is the user in the created_by column the data protection officer?,Day of sale completion date,Month of sale completion date,Year of sale completion date,Which organisation owned this property before the sale?,Which organisation reported the sale?,User that created the log,User the log is assigned to,What is the purchaser code?,Was this purchase made through an ownership scheme?,What is the type of shared ownership/discounted ownership/outright sale?,"If type = 'Other', what is the type of outright sale?",Is the buyer a company?,Will the buyer(s) live in the property?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,Did you interview the buyer to answer these questions?,Has the buyer seen the MHCLG privacy notice?,"What is the UPRN of the property?",Address line 1,Address line 2,Town/City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,LA name,LA code,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,How many bedrooms does the property have?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,What is buyer 1's age?,Which of these best describes buyer 1's gender identity?,What is buyer 1's ethnic group?,Which of the following best describes buyer 1's ethnic background?,What is buyer 1's nationality?,Which of these best describes buyer 1's working situation?,Will buyer 1 live in the property?,What is buyer 2 or person 2's relationship to buyer 1?,What is buyer 2 or person 2's age?,Which of these best describes buyer 2 or person 2's gender identity?,What is buyer 2's ethnic group?,Which of the following best describes buyer 2's ethnic background?,What is buyer 2's nationality?,What is buyer 2 or person 2's working situation?,Will buyer 2 live in the property?,"Besides the buyer(s), how many other people live or will live in the property?",What is person 3's relationship to buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,What is person 4's relationship to buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,What is person 5's relationship to buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,What is person 6's relationship to buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,What was buyer 1's previous tenure?,Do you know the postcode of buyer 1's last settled accommodation?,Part 1 of postcode of buyer 1's last settled accommodation,Part 2 of postcode of buyer 1's last settled accommodation,Do you know the local authority of buyer 1's last settled accommodation?,The local authority code of buyer 1's last settled accommodation,The local authority name of buyer 1's last settled accommodation,Was the buyer registered with their PRP (HA)?,Was the buyer registered with another PRP (HA)?,Was the buyer registered with the local authority?,Was the buyer registered with a Help to Buy agent?,"Populated if pregyrha, pregother, pregla and pregghb are blank","At the time of purchase, was buyer 2 living at the same address as buyer 1?",What was buyer 2's previous tenure?,Have any of the buyers ever served as a regular in the UK armed forces?,Is the buyer still serving in the UK armed forces?,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?,Does anyone in the household consider themselves to have a disability?,Does anyone in the household use a wheelchair?,Is buyer 1's annual income known?,What is buyer 1's annual income?,Was buyer 1's income used for a mortgage application?,Is buyer 1's annual income known?,What is buyer 2's annual income?,Was buyer 2's income used for a mortgage application?,Were the buyers receiving any of these housing-related benefits immediately before buying this property?,Is the the total amount the buyers had in savings known?,What is the total amount the buyers had in savings before they paid any deposit for the property?,Have any of the buyers previously owned a property?,Was the previous property under shared ownership?,How long did the buyer(s) live in the property before purchasing it?,Is this a staircasing transaction?,What percentage of the property has been bought in this staircasing transaction?,What percentage of the property do the buyers now own in total?,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?,Is this a resale?,Day of the exchange of contracts,Month of the exchange of contracts,Year of the exchange of contracts,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,Was the household rehoused under a local authority nominations agreement?,"Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?",How many bedrooms did the buyer's previous property have?,What was the previous property type?,What was the rent type of buyer's previous tenure?,What is the full purchase price?,Populated if a soft validation is confirmed.,What was the initial percentage equity stake purchased?,Was a mortgage used to buy this property?,What is the mortgage amount?,What is the name of the mortgage lender?,"If mortgagelender = 'Other', what is the name of the mortgage lender?",What is the length of the mortgage in years?,Does this include any extra borrowing?,How much was the cash deposit paid on the property?,How much cash discount was given through Social Homebuy?,What is the basic monthly rent?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property?,Populated if a soft validation is confirmed.,What was the percentage discount?,"What was the amount of any loan, grant, discount or subsidy given?" +ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,COLLECTIONYEAR,CREATIONMETHOD,BULKUPLOADID,DATAPROTECT,DAY,MONTH,YEAR,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,NOINT,PRIVACYNOTICE,UPRN,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,POSTCODE,ISLAINFERRED,LANAME,LA,UPRNSELECTED,ADDRESS_SEARCH_VALUE_CHECK,ADDRESS1INPUT,POSTCODEINPUT,BULKADDRESS1,BULKADDRESS2,BULKTOWNCITY,BULKCOUNTY,BULKPOSTCODE,BULKLA,BEDS,PROPTYPE,BUILTYPE,WCHAIR,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONALITYALL1,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONALITYALL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT +,completed,,2024-05-01T00:00:00+01:00,2024-05-01T00:00:00+01:00,2024,single log,,false,1,5,2024,MHCLG,MHCLG,billyboy@eyeklaud.com,billyboy@eyeklaud.com,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,Yes,1,1,"1, Test Street",,Test Town,,AA1 1AA,Yes,Westminster,E09000033,,,Address line 1,SW1A 1AA,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,2,Flat or maisonette,Purpose built,Yes,30,Non-binary,Buyer prefers not to say,17,United Kingdom,Full-time - 30 hours or more,Yes,Partner,35,Non-binary,Buyer prefers not to say,,United Kingdom,Full-time - 30 hours or more,Yes,3,Child,14,Non-binary,Child under 16,Other,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,Local authority tenant,Yes,AA1,1AA,Yes,E09000033,Westminster,1,1,1,1,,Don't know,,Yes,Yes,No,Yes,Yes,Yes,10000,Yes,Yes,10000,Yes,Don’t know ,No,,Yes,No,10,,,,,,,,,,,,,,,,,110000.0,,,Yes,20000.0,Cambridge Building Society,,10,Yes,80000.0,,,Yes,100.0,,,10000.0 diff --git a/spec/fixtures/files/sales_logs_csv_export_non_support_labels_24.csv b/spec/fixtures/files/sales_logs_csv_export_non_support_labels_24.csv index 8c5943c21..05e18a415 100644 --- a/spec/fixtures/files/sales_logs_csv_export_non_support_labels_24.csv +++ b/spec/fixtures/files/sales_logs_csv_export_non_support_labels_24.csv @@ -1,3 +1,3 @@ -Log ID,Status of log,ID of a set of duplicate logs,Time and date the log was created,Time and date the log was last updated,Year collection period opened,Was the log submitted in-service or via bulk upload?,,Is the user in the assigned_to column the data protection officer?,Which organisation owned this property before the sale?,Which organisation reported the sale?,User the log is assigned to,Day of sale completion date,Month of sale completion date,Year of sale completion date,What is the purchaser code?,Was this purchase made through an ownership scheme?,What is the type of shared ownership/discounted ownership/outright sale?,"If type = 'Other', what is the type of outright sale?",Is the buyer a company?,Will the buyer(s) live in the property?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,Did you interview the buyer to answer these questions?,Has the buyer seen the MHCLG privacy notice?,What is the UPRN of the property?,We found an address that might be this property. Is this the property address?,Address line 1 input from address matching feature,Postcode input from address matching feature,UPRN of the address selected,Address line 1,Address line 2,Town/City,County,Part 1 of the property's postcode,Part 2 of the property's postcode,LA code,LA name,How many bedrooms does the property have?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,What is buyer 1's age?,Which of these best describes buyer 1's gender identity?,What is buyer 1's ethnic group?,Which of the following best describes buyer 1's ethnic background?,What is buyer 1's nationality?,Which of these best describes buyer 1's working situation?,Will buyer 1 live in the property?,What is buyer 2 or person 2's relationship to buyer 1?,What is buyer 2 or person 2's age?,Which of these best describes buyer 2 or person 2's gender identity?,What is buyer 2's ethnic group?,Which of the following best describes buyer 2's ethnic background?,What is buyer 2's nationality?,What is buyer 2 or person 2's working situation?,Will buyer 2 live in the property?,"Besides the buyer(s), how many other people live or will live in the property?",What is person 3's relationship to buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,What is person 4's relationship to buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,What is person 5's relationship to buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,What is person 6's relationship to buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,What was buyer 1's previous tenure?,Do you know the postcode of buyer 1's last settled accommodation?,Part 1 of postcode of buyer 1's last settled accommodation,Part 2 of postcode of buyer 1's last settled accommodation,Do you know the local authority of buyer 1's last settled accommodation?,The local authority code of buyer 1's last settled accommodation,The local authority name of buyer 1's last settled accommodation,Was the buyer registered with their PRP (HA)?,Was the buyer registered with another PRP (HA)?,Was the buyer registered with the local authority?,Was the buyer registered with a Help to Buy agent?,"Populated if pregyrha, pregother, pregla and pregghb are blank","At the time of purchase, was buyer 2 living at the same address as buyer 1?",What was buyer 2's previous tenure?,Have any of the buyers ever served as a regular in the UK armed forces?,Is the buyer still serving in the UK armed forces?,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?,Does anyone in the household consider themselves to have a disability?,Does anyone in the household use a wheelchair?,Is buyer 1's annual income known?,What is buyer 1's annual income?,Was buyer 1's income used for a mortgage application?,Is buyer 2's annual income known?,What is buyer 2's annual income?,Was buyer 2's income used for a mortgage application?,Were the buyers receiving any of these housing-related benefits immediately before buying this property?,Is the the total amount the buyers had in savings known?,What is the total amount the buyers had in savings before they paid any deposit for the property?,Have any of the buyers previously owned a property?,Was the previous property under shared ownership?,How long did the buyer(s) live in the property before purchasing it?,Is this a staircasing transaction?,What percentage of the property has been bought in this staircasing transaction?,What percentage of the property do the buyers now own in total?,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?,Is this a resale?,Day of the exchange of contracts,Month of the exchange of contracts,Year of the exchange of contracts,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,Was the household rehoused under a local authority nominations agreement?,"Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?",How many bedrooms did the buyer's previous property have?,What was the previous property type?,What was the rent type of buyer's previous tenure?,What is the full purchase price?,What was the initial percentage equity stake purchased?,Was a mortgage used to buy this property?,What is the mortgage amount?,What is the name of the mortgage lender?,"If mortgagelender = 'Other', what is the name of the mortgage lender?",What is the length of the mortgage in years?,Does this include any extra borrowing?,How much was the cash deposit paid on the property?,How much cash discount was given through Social Homebuy?,What is the basic monthly rent?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property?,What was the percentage discount?,"What was the amount of any loan, grant, discount or subsidy given?" -id,status,duplicate_set_id,created_at,updated_at,collection_start_year,creation_method,bulk_upload_id,is_dpo,owning_organisation_name,managing_organisation_name,assigned_to,day,month,year,purchid,ownershipsch,type,othtype,companybuy,buylivein,jointpur,jointmore,noint,privacynotice,uprn,uprn_confirmed,address_line1_input,postcode_full_input,uprn_selection,address_line1,address_line2,town_or_city,county,pcode1,pcode2,la,la_label,beds,proptype,builtype,wchair,age1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,buy1livein,relat2,age2,sex2,ethnic_group2,ethnicbuy2,nationality_all_buyer2,ecstat2,buy2livein,hholdcount,relat3,age3,sex3,ecstat3,relat4,age4,sex4,ecstat4,relat5,age5,sex5,ecstat5,relat6,age6,sex6,ecstat6,prevten,ppcodenk,ppostc1,ppostc2,previous_la_known,prevloc,prevloc_label,pregyrha,pregother,pregla,pregghb,pregblank,buy2living,prevtenbuy2,hhregres,hhregresstill,armedforcesspouse,disabled,wheel,income1nk,income1,inc1mort,income2nk,income2,inc2mort,hb,savingsnk,savings,prevown,prevshared,proplen,staircase,stairbought,stairowned,staircasesale,resale,exday,exmonth,exyear,hoday,homonth,hoyear,lanomagr,soctenant,frombeds,fromprop,socprevten,value,equity,mortgageused,mortgage,mortgagelender,mortgagelenderother,mortlen,extrabor,deposit,cashdis,mrent,has_mscharge,mscharge,discount,grant -,completed,,2024-05-01T00:00:00+01:00,2024-05-01T00:00:00+01:00,2024,single log,,false,MHCLG,MHCLG,billyboy@eyeklaud.com,1,5,2024,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,Yes,1,1,Yes,Address line 1,SW1A 1AA,,"1, Test Street",,Test Town,,AA1,1AA,E09000033,Westminster,2,Flat or maisonette,Purpose built,Yes,30,Non-binary,Buyer prefers not to say,17,United Kingdom,Full-time - 30 hours or more,Yes,Partner,35,Non-binary,Buyer prefers not to say,,United Kingdom,Full-time - 30 hours or more,Yes,3,Child,14,Non-binary,Child under 16,Other,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,Local authority tenant,Yes,AA1,1AA,Yes,E09000033,Westminster,1,1,1,1,,Don't know,,Yes,Yes,No,Yes,Yes,Yes,10000,Yes,Yes,10000,Yes,Don’t know ,No,,Yes,No,10,,,,,,,,,,,,,,,,,110000.0,,Yes,20000.0,Cambridge Building Society,,10,Yes,80000.0,,,Yes,100.0,,10000.0 +Log ID,Status of log,ID of a set of duplicate logs,Time and date the log was created,Time and date the log was last updated,Year collection period opened,Was the log submitted in-service or via bulk upload?,,Is the user in the assigned_to column the data protection officer?,Day of sale completion date,Month of sale completion date,Year of sale completion date,Which organisation owned this property before the sale?,Which organisation reported the sale?,User the log is assigned to,What is the purchaser code?,Was this purchase made through an ownership scheme?,What is the type of shared ownership/discounted ownership/outright sale?,"If type = 'Other', what is the type of outright sale?",Is the buyer a company?,Will the buyer(s) live in the property?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,Did you interview the buyer to answer these questions?,Has the buyer seen the MHCLG privacy notice?,What is the UPRN of the property?,We found an address that might be this property. Is this the property address?,Address line 1 input from address matching feature,Postcode input from address matching feature,UPRN of the address selected,Address line 1,Address line 2,Town/City,County,Part 1 of the property's postcode,Part 2 of the property's postcode,LA code,LA name,How many bedrooms does the property have?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,What is buyer 1's age?,Which of these best describes buyer 1's gender identity?,What is buyer 1's ethnic group?,Which of the following best describes buyer 1's ethnic background?,What is buyer 1's nationality?,Which of these best describes buyer 1's working situation?,Will buyer 1 live in the property?,What is buyer 2 or person 2's relationship to buyer 1?,What is buyer 2 or person 2's age?,Which of these best describes buyer 2 or person 2's gender identity?,What is buyer 2's ethnic group?,Which of the following best describes buyer 2's ethnic background?,What is buyer 2's nationality?,What is buyer 2 or person 2's working situation?,Will buyer 2 live in the property?,"Besides the buyer(s), how many other people live or will live in the property?",What is person 3's relationship to buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,What is person 4's relationship to buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,What is person 5's relationship to buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,What is person 6's relationship to buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,What was buyer 1's previous tenure?,Do you know the postcode of buyer 1's last settled accommodation?,Part 1 of postcode of buyer 1's last settled accommodation,Part 2 of postcode of buyer 1's last settled accommodation,Do you know the local authority of buyer 1's last settled accommodation?,The local authority code of buyer 1's last settled accommodation,The local authority name of buyer 1's last settled accommodation,Was the buyer registered with their PRP (HA)?,Was the buyer registered with another PRP (HA)?,Was the buyer registered with the local authority?,Was the buyer registered with a Help to Buy agent?,"Populated if pregyrha, pregother, pregla and pregghb are blank","At the time of purchase, was buyer 2 living at the same address as buyer 1?",What was buyer 2's previous tenure?,Have any of the buyers ever served as a regular in the UK armed forces?,Is the buyer still serving in the UK armed forces?,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?,Does anyone in the household consider themselves to have a disability?,Does anyone in the household use a wheelchair?,Is buyer 1's annual income known?,What is buyer 1's annual income?,Was buyer 1's income used for a mortgage application?,Is buyer 2's annual income known?,What is buyer 2's annual income?,Was buyer 2's income used for a mortgage application?,Were the buyers receiving any of these housing-related benefits immediately before buying this property?,Is the the total amount the buyers had in savings known?,What is the total amount the buyers had in savings before they paid any deposit for the property?,Have any of the buyers previously owned a property?,Was the previous property under shared ownership?,How long did the buyer(s) live in the property before purchasing it?,Is this a staircasing transaction?,What percentage of the property has been bought in this staircasing transaction?,What percentage of the property do the buyers now own in total?,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?,Is this a resale?,Day of the exchange of contracts,Month of the exchange of contracts,Year of the exchange of contracts,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,Was the household rehoused under a local authority nominations agreement?,"Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?",How many bedrooms did the buyer's previous property have?,What was the previous property type?,What was the rent type of buyer's previous tenure?,What is the full purchase price?,What was the initial percentage equity stake purchased?,Was a mortgage used to buy this property?,What is the mortgage amount?,What is the name of the mortgage lender?,"If mortgagelender = 'Other', what is the name of the mortgage lender?",What is the length of the mortgage in years?,Does this include any extra borrowing?,How much was the cash deposit paid on the property?,How much cash discount was given through Social Homebuy?,What is the basic monthly rent?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property?,What was the percentage discount?,"What was the amount of any loan, grant, discount or subsidy given?" +id,status,duplicate_set_id,created_at,updated_at,collection_start_year,creation_method,bulk_upload_id,is_dpo,day,month,year,owning_organisation_name,managing_organisation_name,assigned_to,purchid,ownershipsch,type,othtype,companybuy,buylivein,jointpur,jointmore,noint,privacynotice,uprn,uprn_confirmed,address_line1_input,postcode_full_input,uprn_selection,address_line1,address_line2,town_or_city,county,pcode1,pcode2,la,la_label,beds,proptype,builtype,wchair,age1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,buy1livein,relat2,age2,sex2,ethnic_group2,ethnicbuy2,nationality_all_buyer2,ecstat2,buy2livein,hholdcount,relat3,age3,sex3,ecstat3,relat4,age4,sex4,ecstat4,relat5,age5,sex5,ecstat5,relat6,age6,sex6,ecstat6,prevten,ppcodenk,ppostc1,ppostc2,previous_la_known,prevloc,prevloc_label,pregyrha,pregother,pregla,pregghb,pregblank,buy2living,prevtenbuy2,hhregres,hhregresstill,armedforcesspouse,disabled,wheel,income1nk,income1,inc1mort,income2nk,income2,inc2mort,hb,savingsnk,savings,prevown,prevshared,proplen,staircase,stairbought,stairowned,staircasesale,resale,exday,exmonth,exyear,hoday,homonth,hoyear,lanomagr,soctenant,frombeds,fromprop,socprevten,value,equity,mortgageused,mortgage,mortgagelender,mortgagelenderother,mortlen,extrabor,deposit,cashdis,mrent,has_mscharge,mscharge,discount,grant +,completed,,2024-05-01T00:00:00+01:00,2024-05-01T00:00:00+01:00,2024,single log,,false,1,5,2024,MHCLG,MHCLG,billyboy@eyeklaud.com,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,Yes,1,1,Yes,Address line 1,SW1A 1AA,,"1, Test Street",,Test Town,,AA1,1AA,E09000033,Westminster,2,Flat or maisonette,Purpose built,Yes,30,Non-binary,Buyer prefers not to say,17,United Kingdom,Full-time - 30 hours or more,Yes,Partner,35,Non-binary,Buyer prefers not to say,,United Kingdom,Full-time - 30 hours or more,Yes,3,Child,14,Non-binary,Child under 16,Other,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,Local authority tenant,Yes,AA1,1AA,Yes,E09000033,Westminster,1,1,1,1,,Don't know,,Yes,Yes,No,Yes,Yes,Yes,10000,Yes,Yes,10000,Yes,Don’t know ,No,,Yes,No,10,,,,,,,,,,,,,,,,,110000.0,,Yes,20000.0,Cambridge Building Society,,10,Yes,80000.0,,,Yes,100.0,,10000.0 diff --git a/spec/models/form/sales/subsections/setup_spec.rb b/spec/models/form/sales/subsections/setup_spec.rb index 70d52977f..1e49d11e6 100644 --- a/spec/models/form/sales/subsections/setup_spec.rb +++ b/spec/models/form/sales/subsections/setup_spec.rb @@ -28,10 +28,10 @@ RSpec.describe Form::Sales::Subsections::Setup, type: :model do it "has correct pages" do expect(setup.pages.map(&:id)).to eq( %w[ + completion_date owning_organisation managing_organisation assigned_to - completion_date purchaser_code ownership_scheme shared_ownership_type @@ -54,10 +54,10 @@ RSpec.describe Form::Sales::Subsections::Setup, type: :model do it "has correct pages" do expect(setup.pages.map(&:id)).to eq( %w[ + completion_date owning_organisation managing_organisation assigned_to - completion_date purchaser_code ownership_scheme shared_ownership_type diff --git a/spec/models/form_spec.rb b/spec/models/form_spec.rb index c51f71d3f..bb03cef59 100644 --- a/spec/models/form_spec.rb +++ b/spec/models/form_spec.rb @@ -387,10 +387,6 @@ RSpec.describe Form, type: :model do expect(form.sections[0].class).to eq(Form::Sales::Sections::Setup) expect(form.subsections.count).to eq(1) expect(form.subsections.first.id).to eq("setup") - expect(form.pages.count).to eq(13) - expect(form.pages.first.id).to eq("owning_organisation") - expect(form.questions.count).to eq(14) - expect(form.questions.first.id).to eq("owning_organisation_id") expect(form.start_date).to eq(Time.zone.parse("2022-04-01")) expect(form.new_logs_end_date).to eq(Time.zone.parse("2023-11-20")) expect(form.edit_end_date).to eq(Time.zone.parse("2023-11-20")) From afc7cf86b42cb9cd2a28d5efd931681b41f0b802 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Tue, 12 Nov 2024 09:51:15 +0000 Subject: [PATCH 8/9] Exctract financial validations (#2740) --- app/models/lettings_log.rb | 6 - .../validations/financial_validations.rb | 126 ++++++++---------- config/locales/en.yml | 67 ---------- .../validations/lettings/financial.yml | 86 ++++++++++++ .../validations/financial_validations_spec.rb | 105 +++++++-------- 5 files changed, 190 insertions(+), 200 deletions(-) create mode 100644 config/locales/validations/lettings/financial.yml diff --git a/app/models/lettings_log.rb b/app/models/lettings_log.rb index d8732c3ea..d1ff6f738 100644 --- a/app/models/lettings_log.rb +++ b/app/models/lettings_log.rb @@ -508,12 +508,6 @@ class LettingsLog < Log hb == 10 end - # Option 7 has been removed starting from 22/23 - def receives_universal_credit_but_no_housing_benefit? - # 7: Universal Credit (without housing element) - hb == 7 - end - def receives_housing_related_benefits? if collection_start_year <= 2021 receives_housing_benefit_only? || receives_uc_with_housing_element_excl_housing_benefit? || diff --git a/app/models/validations/financial_validations.rb b/app/models/validations/financial_validations.rb index 724fa9b6e..19209f2d8 100644 --- a/app/models/validations/financial_validations.rb +++ b/app/models/validations/financial_validations.rb @@ -6,8 +6,8 @@ module Validations::FinancialValidations # or 'validate_' to run on submit as well def validate_outstanding_rent_amount(record) if !record.has_housing_benefit_rent_shortfall? && record.tshortfall.present? - record.errors.add :tshortfall, :no_outstanding_charges, message: I18n.t("validations.financial.tshortfall.outstanding_amount_not_expected") - record.errors.add :hbrentshortfall, :no_outstanding_charges, message: I18n.t("validations.financial.hbrentshortfall.outstanding_amount_not_expected") + record.errors.add :tshortfall, :no_outstanding_charges, message: I18n.t("validations.lettings.financial.tshortfall.outstanding_amount_not_expected") + record.errors.add :hbrentshortfall, :no_outstanding_charges, message: I18n.t("validations.lettings.financial.hbrentshortfall.outstanding_amount_not_expected") end end @@ -19,7 +19,7 @@ module Validations::FinancialValidations relationship = record["relat#{n}"] is_partner_or_main = relationship == "P" || (relationship.nil? && economic_status.present?) if is_employed && is_partner_or_main && record.benefits&.zero? - record.errors.add :benefits, I18n.t("validations.financial.benefits.part_or_full_time") + record.errors.add :benefits, I18n.t("validations.lettings.financial.benefits.part_or_full_time") end end end @@ -32,25 +32,25 @@ module Validations::FinancialValidations record.errors.add( :earnings, :over_hard_max, - message: I18n.t("validations.financial.earnings.over_hard_max", hard_max:), + message: I18n.t("validations.lettings.financial.earnings.over_hard_max", hard_max:), ) record.errors.add( :hhmemb, :over_hard_max, - message: I18n.t("validations.financial.hhmemb.earnings.over_hard_max", earnings: format_as_currency(record.earnings), frequency:), + message: I18n.t("validations.lettings.financial.hhmemb.earnings_over_hard_max", earnings: format_as_currency(record.earnings), frequency:), ) (1..record.hhmemb).each do |n| record.errors.add( "ecstat#{n}", :over_hard_max, - message: I18n.t("validations.financial.ecstat.over_hard_max", earnings: format_as_currency(record.earnings), frequency:), + message: I18n.t("validations.lettings.financial.ecstat.earnings_over_hard_max", earnings: format_as_currency(record.earnings), frequency:), ) next unless record["ecstat#{n}"] == 9 record.errors.add( "age#{n}", :over_hard_max, - message: I18n.t("validations.financial.age.earnings_over_hard_max", earnings: format_as_currency(record.earnings), frequency:), + message: I18n.t("validations.lettings.financial.age.earnings_over_hard_max", earnings: format_as_currency(record.earnings), frequency:), ) end end @@ -61,18 +61,18 @@ module Validations::FinancialValidations record.errors.add( :earnings, :under_hard_min, - message: I18n.t("validations.financial.earnings.under_hard_min", hard_min:), + message: I18n.t("validations.lettings.financial.earnings.under_hard_min", hard_min:), ) record.errors.add( :hhmemb, :under_hard_min, - message: I18n.t("validations.financial.hhmemb.earnings.under_hard_min", earnings: format_as_currency(record.earnings), frequency:), + message: I18n.t("validations.lettings.financial.hhmemb.earnings_under_hard_min", earnings: format_as_currency(record.earnings), frequency:), ) (1..record.hhmemb).each do |n| record.errors.add( "ecstat#{n}", :under_hard_min, - message: I18n.t("validations.financial.ecstat.under_hard_min", earnings: format_as_currency(record.earnings), frequency:), + message: I18n.t("validations.lettings.financial.ecstat.earnings_under_hard_min", earnings: format_as_currency(record.earnings), frequency:), ) # N.B. It is not possible for a change to an age field to increase the hard min end @@ -80,69 +80,61 @@ module Validations::FinancialValidations end if record.earnings.present? && record.incfreq.blank? - record.errors.add :incfreq, I18n.t("validations.financial.earnings.freq_missing") - record.errors.add :earnings, I18n.t("validations.financial.earnings.freq_missing") + record.errors.add :incfreq, I18n.t("validations.lettings.financial.incfreq.incfreq_missing") + record.errors.add :earnings, I18n.t("validations.lettings.financial.earnings.incfreq_missing") end if record.incfreq.present? && record.earnings.blank? - record.errors.add :earnings, I18n.t("validations.financial.earnings.earnings_missing") - record.errors.add :incfreq, I18n.t("validations.financial.earnings.earnings_missing") + record.errors.add :earnings, I18n.t("validations.lettings.financial.earnings.earnings_missing") + record.errors.add :incfreq, I18n.t("validations.lettings.financial.incfreq.earnings_missing") end end def validate_negative_currency(record) - t = %w[earnings brent scharge pscharge supcharg] - t.each do |x| - if record[x].present? && record[x].negative? - record.errors.add x.to_sym, I18n.t("validations.financial.negative_currency") + fields = %w[earnings brent scharge pscharge supcharg] + fields.each do |field| + if record[field].present? && record[field].negative? + record.errors.add field.to_sym, I18n.t("validations.lettings.financial.#{field}.negative_currency") end end end def validate_tshortfall(record) if record.has_housing_benefit_rent_shortfall? && no_known_benefits?(record) - record.errors.add :tshortfall, I18n.t("validations.financial.hbrentshortfall.outstanding_no_benefits") + record.errors.add :tshortfall, I18n.t("validations.lettings.financial.tshortfall.outstanding_no_benefits") end end def no_known_benefits?(record) return true unless record.collection_start_year - if record.collection_start_year <= 2021 - record.benefits_unknown? || - record.receives_no_benefits? || - record.receives_universal_credit_but_no_housing_benefit? - else - record.benefits_unknown? || - record.receives_no_benefits? || - record.tenant_refuses_to_say_benefits? - end + record.benefits_unknown? || record.receives_no_benefits? || record.tenant_refuses_to_say_benefits? end def validate_rent_amount(record) if record.wtshortfall if record.is_supported_housing? && record.wchchrg && (record.wtshortfall > record.wchchrg) - record.errors.add :tshortfall, message: I18n.t("validations.financial.tshortfall.more_than_carehome_charge") - record.errors.add :chcharge, I18n.t("validations.financial.carehome.less_than_shortfall") + record.errors.add :tshortfall, message: I18n.t("validations.lettings.financial.tshortfall.more_than_carehome_charge") + record.errors.add :chcharge, I18n.t("validations.lettings.financial.chcharge.less_than_shortfall") end if record.wtcharge && (record.wtshortfall > record.wtcharge) - record.errors.add :tshortfall, :more_than_rent, message: I18n.t("validations.financial.tshortfall.more_than_total_charge") - record.errors.add :tcharge, I18n.t("validations.financial.tcharge.less_than_shortfall") + record.errors.add :tshortfall, :more_than_rent, message: I18n.t("validations.lettings.financial.tshortfall.more_than_total_charge") + record.errors.add :tcharge, I18n.t("validations.lettings.financial.tcharge.less_than_shortfall") elsif record.wtshortfall < 0.01 - record.errors.add :tshortfall, :must_be_positive, message: I18n.t("validations.financial.tshortfall.must_be_positive") + record.errors.add :tshortfall, :must_be_positive, message: I18n.t("validations.lettings.financial.tshortfall.must_be_positive") end end if record.tcharge.present? && weekly_value_in_range(record, "tcharge", 0, 9.99) - record.errors.add :tcharge, :under_10, message: I18n.t("validations.financial.tcharge.under_10") + record.errors.add :tcharge, :under_10, message: I18n.t("validations.lettings.financial.tcharge.under_10") end answered_questions = [record.tcharge, record.chcharge].concat(record.household_charge && record.household_charge == 1 ? [record.household_charge] : []) if answered_questions.count(&:present?) > 1 - record.errors.add :tcharge, :complete_1_of_3, message: I18n.t("validations.financial.charges.complete_1_of_3") if record.tcharge.present? - record.errors.add :chcharge, I18n.t("validations.financial.charges.complete_1_of_3") if record.chcharge.present? - record.errors.add :household_charge, I18n.t("validations.financial.charges.complete_1_of_3") if record.household_charge.present? + record.errors.add :tcharge, :complete_1_of_3, message: I18n.t("validations.lettings.financial.tcharge.complete_1_of_3") if record.tcharge.present? + record.errors.add :chcharge, I18n.t("validations.lettings.financial.chcharge.complete_1_of_3") if record.chcharge.present? + record.errors.add :household_charge, I18n.t("validations.lettings.financial.household_charge.complete_1_of_3") if record.household_charge.present? end validate_charges(record) @@ -154,12 +146,12 @@ module Validations::FinancialValidations unless record.managing_organisation.rent_periods.include? record.period record.errors.add :period, :wrong_rent_period, message: I18n.t( - "validations.financial.rent_period.invalid_for_org.period", + "validations.lettings.financial.period.invalid_period_for_org", org_name: record.managing_organisation.name, rent_period: record.form.get_question("period", record).label_from_value(record.period).downcase, ) record.errors.add :managing_organisation_id, :skip_bu_error, message: I18n.t( - "validations.financial.rent_period.invalid_for_org.managing_org", + "validations.lettings.financial.managing_organisation_id.invalid_period_for_org", org_name: record.managing_organisation.name, rent_period: record.form.get_question("period", record).label_from_value(record.period).downcase, ) @@ -169,18 +161,12 @@ module Validations::FinancialValidations def validate_care_home_charges(record) if record.is_carehome? period = record.form.get_question("period", record).label_from_value(record.period).downcase - # NOTE: This is a temporary change to allow `ccharge` values despite `is_carehome` being true. This value - # is going to be moved to a soft validation in CLDC-2074, so we can safely do this. - if record.chcharge.blank? - # record.errors.add :is_carehome, I18n.t("validations.financial.carehome.not_provided", period:) - # record.errors.add :chcharge, I18n.t("validations.financial.carehome.not_provided", period:) - elsif !weekly_value_in_range(record, "chcharge", 10, 5000) + if record.chcharge.present? && !weekly_value_in_range(record, "chcharge", 10, 5000) max_chcharge = record.weekly_to_value_per_period(5000) min_chcharge = record.weekly_to_value_per_period(10) - message = I18n.t("validations.financial.carehome.out_of_range", period:, min_chcharge:, max_chcharge:) - record.errors.add :period, message - record.errors.add :chcharge, :out_of_range, message: + record.errors.add :period, I18n.t("validations.lettings.financial.period.chcharge_out_of_range", period:, min_chcharge:, max_chcharge:) + record.errors.add :chcharge, :out_of_range, message: I18n.t("validations.lettings.financial.chcharge.out_of_range", period:, min_chcharge:, max_chcharge:) end end end @@ -202,8 +188,8 @@ private provider_type_label = PROVIDER_TYPE[provider_type].to_s.humanize(capitalize: false) maximum_per_period = record.weekly_to_value_per_period(maximum_per_week) - record.errors.add charge, :outside_the_range, message: I18n.t("validations.financial.rent.out_of_range", charge_name:, maximum_per_period:, frequency:, letting_type:, provider_type: provider_type_label) - record.errors.add :period, :outside_the_range, message: I18n.t("validations.financial.rent.out_of_range", charge_name:, maximum_per_period:, frequency:, letting_type:, provider_type: provider_type_label) + record.errors.add charge, :outside_the_range, message: I18n.t("validations.lettings.financial.#{charge}.rent_out_of_range", charge_name:, maximum_per_period:, frequency:, letting_type:, provider_type: provider_type_label) + record.errors.add :period, :outside_the_range, message: I18n.t("validations.lettings.financial.period.rent_out_of_range", charge_name:, maximum_per_period:, frequency:, letting_type:, provider_type: provider_type_label) end end @@ -225,29 +211,29 @@ private if rent_range.present? && !weekly_value_in_range(record, "brent", rent_range.hard_min, rent_range.hard_max) && record.brent.present? && record.period.present? if record.weekly_value(record["brent"]) < rent_range.hard_min - record.errors.add :brent, :below_hard_min, message: I18n.t("validations.financial.brent.below_hard_min") - record.errors.add :beds, I18n.t("validations.financial.brent.beds.below_hard_min") - record.errors.add :uprn, I18n.t("validations.financial.brent.uprn.below_hard_min") - record.errors.add :la, I18n.t("validations.financial.brent.la.below_hard_min") - record.errors.add :postcode_known, I18n.t("validations.financial.brent.postcode_known.below_hard_min") - record.errors.add :scheme_id, I18n.t("validations.financial.brent.scheme_id.below_hard_min") - record.errors.add :location_id, I18n.t("validations.financial.brent.location_id.below_hard_min") - record.errors.add :rent_type, I18n.t("validations.financial.brent.rent_type.below_hard_min") - record.errors.add :needstype, I18n.t("validations.financial.brent.needstype.below_hard_min") - record.errors.add :period, I18n.t("validations.financial.brent.period.below_hard_min") + record.errors.add :brent, :below_hard_min, message: I18n.t("validations.lettings.financial.brent.below_hard_min") + record.errors.add :beds, I18n.t("validations.lettings.financial.beds.rent_below_hard_min") + record.errors.add :uprn, I18n.t("validations.lettings.financial.uprn.rent_below_hard_min") + record.errors.add :la, I18n.t("validations.lettings.financial.la.rent_below_hard_min") + record.errors.add :postcode_known, I18n.t("validations.lettings.financial.postcode_known.rent_below_hard_min") + record.errors.add :scheme_id, I18n.t("validations.lettings.financial.scheme_id.rent_below_hard_min") + record.errors.add :location_id, I18n.t("validations.lettings.financial.location_id.rent_below_hard_min") + record.errors.add :rent_type, I18n.t("validations.lettings.financial.rent_type.rent_below_hard_min") + record.errors.add :needstype, I18n.t("validations.lettings.financial.needstype.rent_below_hard_min") + record.errors.add :period, I18n.t("validations.lettings.financial.period.rent_below_hard_min") end if record.weekly_value(record["brent"]) > rent_range.hard_max - record.errors.add :brent, :over_hard_max, message: I18n.t("validations.financial.brent.above_hard_max") - record.errors.add :beds, I18n.t("validations.financial.brent.beds.above_hard_max") - record.errors.add :uprn, I18n.t("validations.financial.brent.uprn.above_hard_max") - record.errors.add :la, I18n.t("validations.financial.brent.la.above_hard_max") - record.errors.add :postcode_known, I18n.t("validations.financial.brent.postcode_known.above_hard_max") - record.errors.add :scheme_id, I18n.t("validations.financial.brent.scheme_id.above_hard_max") - record.errors.add :location_id, I18n.t("validations.financial.brent.location_id.above_hard_max") - record.errors.add :rent_type, I18n.t("validations.financial.brent.rent_type.above_hard_max") - record.errors.add :needstype, I18n.t("validations.financial.brent.needstype.above_hard_max") - record.errors.add :period, I18n.t("validations.financial.brent.period.above_hard_max") + record.errors.add :brent, :over_hard_max, message: I18n.t("validations.lettings.financial.brent.above_hard_max") + record.errors.add :beds, I18n.t("validations.lettings.financial.beds.rent_above_hard_max") + record.errors.add :uprn, I18n.t("validations.lettings.financial.uprn.rent_above_hard_max") + record.errors.add :la, I18n.t("validations.lettings.financial.la.rent_above_hard_max") + record.errors.add :postcode_known, I18n.t("validations.lettings.financial.postcode_known.rent_above_hard_max") + record.errors.add :scheme_id, I18n.t("validations.lettings.financial.scheme_id.rent_above_hard_max") + record.errors.add :location_id, I18n.t("validations.lettings.financial.location_id.rent_above_hard_max") + record.errors.add :rent_type, I18n.t("validations.lettings.financial.rent_type.rent_above_hard_max") + record.errors.add :needstype, I18n.t("validations.lettings.financial.needstype.rent_above_hard_max") + record.errors.add :period, I18n.t("validations.lettings.financial.period.rent_above_hard_max") end end end diff --git a/config/locales/en.yml b/config/locales/en.yml index 4c601b353..8cf9634b5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -285,83 +285,16 @@ en: one_three_bedroom_single_tenant_shared: "A shared house with fewer than two tenants must have 1 to 3 bedrooms." financial: - tshortfall: - outstanding_amount_not_expected: "You cannot answer the outstanding amount question if you don’t have outstanding rent or charges." - more_than_total_charge: "Enter a value less than the total charge." - more_than_carehome_charge: "Enter a value less than the care home charge." - must_be_positive: "Enter a value over £0.01 as you told us there is an outstanding amount." - hbrentshortfall: - outstanding_amount_not_expected: "Answer must be ‘yes’ as you have answered the outstanding amount question." - outstanding_no_benefits: "Answer cannot be ‘yes’ to outstanding amount for basic rent or charges if tenant does not receive housing benefit or Universal Credit or you‘re not sure." - benefits: - part_or_full_time: "Answer cannot be ‘all’ for income from Universal Credit, state pensions or benefits if the tenant or their partner works part-time or full-time." - earnings: - over_hard_max: "The household’s income cannot be greater than %{hard_max} per week given the household’s working situation." - under_hard_min: "The household’s income cannot be less than %{hard_min} per week given the household’s working situation." - freq_missing: "Select how often the household receives income." - earnings_missing: "Enter how much income the household has in total." income: outside_london_income_range: "Income must be between £0 and £90,000 for properties within a London local authority." outside_non_london_income_range: "Income must be between £0 and £80,000 for properties in a non-London local authority." combined_over_hard_max_for_london: "Combined income must be £90,000 or lower for properties within a London local authority." combined_over_hard_max_for_outside_london: "Combined income must be £80,000 or lower for properties outside London local authorities." child_has_income: "Child's income must be £0." - negative_currency: "Enter an amount above 0." - rent: - out_of_range: "Enter a value for the %{charge_name} between £0 and %{maximum_per_period} paid %{frequency}. %{maximum_per_period} is the max limit for rent and charges paid %{frequency} for %{letting_type} lettings owned by a %{provider_type}." - ecstat: - over_hard_max: "The household’s income of %{earnings} %{frequency} is too high given the household’s working situation." - under_hard_min: "The household’s income of %{earnings} %{frequency} is too low given the household’s working situation." - age: - earnings_over_hard_max: "The household’s income of %{earnings} %{frequency} is too high for the number of adults. Change either the household income or the age of the tenants." - hhmemb: - earnings: - over_hard_max: "The household’s income of %{earnings} %{frequency} is too high for this number of tenants. Change either the household income or number of tenants." - under_hard_min: "The household’s income of %{earnings} %{frequency} is too low for this number of tenants. Change either the household income or number of tenants." - brent: - below_hard_min: "Rent is below the absolute minimum expected for a property of this type. Please check the rent, rent period, local authority and (if general needs) number of bedrooms." - above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type. Please check the rent, rent period, local authority and (if general needs) number of bedrooms." - scheme_id: - below_hard_min: "Rent is below the absolute minimum expected for a property of this type. Please check the rent, rent period and local authority." - above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type. Please check the rent, rent period and local authority." - location_id: - below_hard_min: "Rent is below the absolute minimum expected for a property of this type. Please check the rent, rent period and local authority." - above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type. Please check the rent, rent period and local authority." - postcode_known: - below_hard_min: "Rent is below the absolute minimum expected for a property of this type. Please check the rent, rent period, local authority and number of bedrooms." - above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type. Please check the rent, rent period, local authority and number of bedrooms." - uprn: - below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this UPRN." - above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this UPRN." - la: - below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this local authority." - above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this local authority." - beds: - below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this number of bedrooms." - above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this number of bedrooms." - needstype: - below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this lettings type." - above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this lettings type." - rent_type: - below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this lettings type." - above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this lettings type." - period: - below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this period." - above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this period." charges: - complete_1_of_3: "Answer either the ‘household rent and charges’ question or ‘is this accommodation a care home‘, or select ‘no’ for ‘does the household pay rent or charges for the accommodation?’" missing_charges: "Please enter the %{sentence_fragment}. If there is no %{sentence_fragment}, please enter '0'." - tcharge: - under_10: "Enter a total charge that is at least £10.00 per week." - less_than_shortfall: "The total charge must be more than the outstanding amount." - rent_period: - invalid_for_org: - period: "%{org_name} does not use %{rent_period} as a rent period. Choose another rent period, or a data coordinator can add rent periods to your organisation." - managing_org: "%{org_name} does not use %{rent_period} as a rent period. Set another rent period on this log, or a data coordinator can add rent periods to this organisation." carehome: - out_of_range: "Household rent and other charges must be between %{min_chcharge} and %{max_chcharge} if paying %{period}." not_provided: "Enter how much rent and other charges the household pays %{period}." - less_than_shortfall: "The care home charge must be more than the outstanding amount." cash_discount_invalid: "Cash discount must be £0 - £999,999." staircasing: percentage_bought_must_be_greater_than_percentage_owned: "Total percentage %{buyer_now_owns} must be more than percentage bought in this transaction." diff --git a/config/locales/validations/lettings/financial.yml b/config/locales/validations/lettings/financial.yml new file mode 100644 index 000000000..f77e23e17 --- /dev/null +++ b/config/locales/validations/lettings/financial.yml @@ -0,0 +1,86 @@ +en: + validations: + lettings: + financial: + tshortfall: + outstanding_amount_not_expected: "You cannot answer the outstanding amount question if you don’t have outstanding rent or charges." + more_than_total_charge: "Enter a value less than the total charge." + more_than_carehome_charge: "Enter a value less than the care home charge." + must_be_positive: "Enter a value over £0.01 as you told us there is an outstanding amount." + outstanding_no_benefits: "Answer cannot be ‘yes’ to outstanding amount for basic rent or charges if tenant does not receive housing benefit or Universal Credit or you‘re not sure." + hbrentshortfall: + outstanding_amount_not_expected: "Answer must be ‘yes’ as you have answered the outstanding amount question." + benefits: + part_or_full_time: "Answer cannot be ‘all’ for income from Universal Credit, state pensions or benefits if the tenant or their partner works part-time or full-time." + earnings: + over_hard_max: "The household’s income cannot be greater than %{hard_max} per week given the household’s working situation." + under_hard_min: "The household’s income cannot be less than %{hard_min} per week given the household’s working situation." + incfreq_missing: "Select how often the household receives income." + earnings_missing: "Enter how much income the household has in total." + negative_currency: "Enter an amount above 0." + hhmemb: + earnings_over_hard_max: "The household’s income of %{earnings} %{frequency} is too high for this number of tenants. Change either the household income or number of tenants." + earnings_under_hard_min: "The household’s income of %{earnings} %{frequency} is too low for this number of tenants. Change either the household income or number of tenants." + ecstat: + earnings_over_hard_max: "The household’s income of %{earnings} %{frequency} is too high given the household’s working situation." + earnings_under_hard_min: "The household’s income of %{earnings} %{frequency} is too low given the household’s working situation." + age: + earnings_over_hard_max: "The household’s income of %{earnings} %{frequency} is too high for the number of adults. Change either the household income or the age of the tenants." + incfreq: + incfreq_missing: "Select how often the household receives income." + earnings_missing: "Enter how much income the household has in total." + brent: + negative_currency: "Enter an amount above 0." + below_hard_min: "Rent is below the absolute minimum expected for a property of this type. Please check the rent, rent period, local authority and (if general needs) number of bedrooms." + above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type. Please check the rent, rent period, local authority and (if general needs) number of bedrooms." + scharge: + negative_currency: "Enter an amount above 0." + rent_out_of_range: "Enter a value for the %{charge_name} between £0 and %{maximum_per_period} paid %{frequency}. %{maximum_per_period} is the max limit for rent and charges paid %{frequency} for %{letting_type} lettings owned by a %{provider_type}." + pscharge: + negative_currency: "Enter an amount above 0." + rent_out_of_range: "Enter a value for the %{charge_name} between £0 and %{maximum_per_period} paid %{frequency}. %{maximum_per_period} is the max limit for rent and charges paid %{frequency} for %{letting_type} lettings owned by a %{provider_type}." + supcharg: + negative_currency: "Enter an amount above 0." + rent_out_of_range: "Enter a value for the %{charge_name} between £0 and %{maximum_per_period} paid %{frequency}. %{maximum_per_period} is the max limit for rent and charges paid %{frequency} for %{letting_type} lettings owned by a %{provider_type}." + chcharge: + less_than_shortfall: "The care home charge must be more than the outstanding amount." + complete_1_of_3: "Answer either the ‘household rent and charges’ question or ‘is this accommodation a care home‘, or select ‘no’ for ‘does the household pay rent or charges for the accommodation?’" + out_of_range: "Household rent and other charges must be between %{min_chcharge} and %{max_chcharge} if paying %{period}." + tcharge: + under_10: "Enter a total charge that is at least £10.00 per week." + less_than_shortfall: "The total charge must be more than the outstanding amount." + complete_1_of_3: "Answer either the ‘household rent and charges’ question or ‘is this accommodation a care home‘, or select ‘no’ for ‘does the household pay rent or charges for the accommodation?’" + household_charge: + complete_1_of_3: "Answer either the ‘household rent and charges’ question or ‘is this accommodation a care home‘, or select ‘no’ for ‘does the household pay rent or charges for the accommodation?’" + period: + invalid_period_for_org: "%{org_name} does not use %{rent_period} as a rent period. Choose another rent period, or a data coordinator can add rent periods to your organisation." + chcharge_out_of_range: "Household rent and other charges must be between %{min_chcharge} and %{max_chcharge} if paying %{period}." + rent_out_of_range: "Enter a value for the %{charge_name} between £0 and %{maximum_per_period} paid %{frequency}. %{maximum_per_period} is the max limit for rent and charges paid %{frequency} for %{letting_type} lettings owned by a %{provider_type}." + rent_below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this period." + rent_above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this period." + managing_organisation_id: + invalid_period_for_org: "%{org_name} does not use %{rent_period} as a rent period. Set another rent period on this log, or a data coordinator can add rent periods to this organisation." + beds: + rent_below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this number of bedrooms." + rent_above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this number of bedrooms." + uprn: + rent_below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this UPRN." + rent_above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this UPRN." + la: + rent_below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this local authority." + rent_above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this local authority." + postcode_known: + rent_below_hard_min: "Rent is below the absolute minimum expected for a property of this type. Please check the rent, rent period, local authority and number of bedrooms." + rent_above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type. Please check the rent, rent period, local authority and number of bedrooms." + scheme_id: + rent_below_hard_min: "Rent is below the absolute minimum expected for a property of this type. Please check the rent, rent period and local authority." + rent_above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type. Please check the rent, rent period and local authority." + location_id: + rent_below_hard_min: "Rent is below the absolute minimum expected for a property of this type. Please check the rent, rent period and local authority." + rent_above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type. Please check the rent, rent period and local authority." + rent_type: + rent_below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this lettings type." + rent_above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this lettings type." + needstype: + rent_below_hard_min: "Rent is below the absolute minimum expected for a property of this type based on this lettings type." + rent_above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type based on this lettings type." diff --git a/spec/models/validations/financial_validations_spec.rb b/spec/models/validations/financial_validations_spec.rb index f35cdd097..a2d51f7f9 100644 --- a/spec/models/validations/financial_validations_spec.rb +++ b/spec/models/validations/financial_validations_spec.rb @@ -17,9 +17,9 @@ RSpec.describe Validations::FinancialValidations do record.incfreq = nil financial_validator.validate_net_income(record) expect(record.errors["incfreq"]) - .to include(match I18n.t("validations.financial.earnings.freq_missing")) + .to include(match I18n.t("validations.lettings.financial.incfreq.incfreq_missing")) expect(record.errors["earnings"]) - .to include(match I18n.t("validations.financial.earnings.freq_missing")) + .to include(match I18n.t("validations.lettings.financial.earnings.incfreq_missing")) end it "when income frequency is provided it validates that earnings must be provided" do @@ -27,9 +27,9 @@ RSpec.describe Validations::FinancialValidations do record.incfreq = 1 financial_validator.validate_net_income(record) expect(record.errors["earnings"]) - .to include(match I18n.t("validations.financial.earnings.earnings_missing")) + .to include(match I18n.t("validations.lettings.financial.earnings.earnings_missing")) expect(record.errors["incfreq"]) - .to include(match I18n.t("validations.financial.earnings.earnings_missing")) + .to include(match I18n.t("validations.lettings.financial.earnings.earnings_missing")) end end @@ -39,14 +39,14 @@ RSpec.describe Validations::FinancialValidations do record.benefits = 0 record.ecstat1 = 1 financial_validator.validate_net_income_uc_proportion(record) - expect(record.errors["benefits"]).to include(match I18n.t("validations.financial.benefits.part_or_full_time")) + expect(record.errors["benefits"]).to include(match I18n.t("validations.lettings.financial.benefits.part_or_full_time")) end it "validates that the lead tenant is not in part time employment" do record.benefits = 0 record.ecstat1 = 0 financial_validator.validate_net_income_uc_proportion(record) - expect(record.errors["benefits"]).to include(match I18n.t("validations.financial.benefits.part_or_full_time")) + expect(record.errors["benefits"]).to include(match I18n.t("validations.lettings.financial.benefits.part_or_full_time")) end it "expects that the lead tenant is not in full-time or part-time employment" do @@ -61,7 +61,7 @@ RSpec.describe Validations::FinancialValidations do record.ecstat2 = 0 record.relat2 = "P" financial_validator.validate_net_income_uc_proportion(record) - expect(record.errors["benefits"]).to include(match I18n.t("validations.financial.benefits.part_or_full_time")) + expect(record.errors["benefits"]).to include(match I18n.t("validations.lettings.financial.benefits.part_or_full_time")) end it "expects that the tenant’s partner is not in full-time or part-time employment" do @@ -81,7 +81,7 @@ RSpec.describe Validations::FinancialValidations do record.tshortfall = 99 financial_validator.validate_outstanding_rent_amount(record) expect(record.errors["tshortfall"]) - .to include(match I18n.t("validations.financial.tshortfall.outstanding_amount_not_expected")) + .to include(match I18n.t("validations.lettings.financial.tshortfall.outstanding_amount_not_expected")) end end @@ -104,7 +104,7 @@ RSpec.describe Validations::FinancialValidations do record.set_derived_fields! financial_validator.validate_rent_amount(record) expect(record.errors["tshortfall"]) - .to include(match I18n.t("validations.financial.tshortfall.must_be_positive")) + .to include(match I18n.t("validations.lettings.financial.tshortfall.must_be_positive")) end it "validates that total charge is no less than the shortfall" do @@ -118,9 +118,9 @@ RSpec.describe Validations::FinancialValidations do record.set_derived_fields! financial_validator.validate_rent_amount(record) expect(record.errors["tcharge"]) - .to include(match I18n.t("validations.financial.tcharge.less_than_shortfall")) + .to include(match I18n.t("validations.lettings.financial.tcharge.less_than_shortfall")) expect(record.errors["tshortfall"]) - .to include(match I18n.t("validations.financial.tshortfall.more_than_total_charge")) + .to include(match I18n.t("validations.lettings.financial.tshortfall.more_than_total_charge")) end it "validates that carehome charge is no less than the shortfall" do @@ -134,9 +134,9 @@ RSpec.describe Validations::FinancialValidations do record.set_derived_fields! financial_validator.validate_rent_amount(record) expect(record.errors["chcharge"]) - .to include(match I18n.t("validations.financial.carehome.less_than_shortfall")) + .to include(match I18n.t("validations.lettings.financial.chcharge.less_than_shortfall")) expect(record.errors["tshortfall"]) - .to include(match I18n.t("validations.financial.tshortfall.more_than_carehome_charge")) + .to include(match I18n.t("validations.lettings.financial.tshortfall.more_than_carehome_charge")) end it "expects that rent can be less than the shortfall if total charge is higher" do @@ -181,13 +181,13 @@ RSpec.describe Validations::FinancialValidations do financial_validator.validate_rent_period(record) expect(record.errors["period"]) .to include(match I18n.t( - "validations.financial.rent_period.invalid_for_org.period", + "validations.lettings.financial.period.invalid_period_for_org", org_name: user.organisation.name, rent_period: "every 4 weeks", )) expect(record.errors["managing_organisation_id"]) .to include(match I18n.t( - "validations.financial.rent_period.invalid_for_org.managing_org", + "validations.lettings.financial.managing_organisation_id.invalid_period_for_org", org_name: user.organisation.name, rent_period: "every 4 weeks", )) @@ -204,7 +204,7 @@ RSpec.describe Validations::FinancialValidations do record.hb = 9 financial_validator.validate_tshortfall(record) expect(record.errors["tshortfall"]) - .to include(match I18n.t("validations.financial.hbrentshortfall.outstanding_no_benefits")) + .to include(match I18n.t("validations.lettings.financial.tshortfall.outstanding_no_benefits")) end it "validates that housing benefit is not don't know" do @@ -212,16 +212,7 @@ RSpec.describe Validations::FinancialValidations do record.hb = 3 financial_validator.validate_tshortfall(record) expect(record.errors["tshortfall"]) - .to include(match I18n.t("validations.financial.hbrentshortfall.outstanding_no_benefits")) - end - - it "validates that housing benefit is not Universal Credit without housing benefit (prior to 22/23)" do - record.startdate = Time.zone.local(2022, 3, 1) - record.hbrentshortfall = 1 - record.hb = 7 - financial_validator.validate_tshortfall(record) - expect(record.errors["tshortfall"]) - .to include(match I18n.t("validations.financial.hbrentshortfall.outstanding_no_benefits")) + .to include(match I18n.t("validations.lettings.financial.tshortfall.outstanding_no_benefits")) end it "validates that housing benefit is provided" do @@ -375,15 +366,15 @@ RSpec.describe Validations::FinancialValidations do financial_validator.validate_negative_currency(record) expect(record.errors["earnings"]) - .to include(match I18n.t("validations.financial.negative_currency")) + .to include(match I18n.t("validations.lettings.financial.earnings.negative_currency")) expect(record.errors["brent"]) - .to include(match I18n.t("validations.financial.negative_currency")) + .to include(match I18n.t("validations.lettings.financial.brent.negative_currency")) expect(record.errors["scharge"]) - .to include(match I18n.t("validations.financial.negative_currency")) + .to include(match I18n.t("validations.lettings.financial.scharge.negative_currency")) expect(record.errors["pscharge"]) - .to include(match I18n.t("validations.financial.negative_currency")) + .to include(match I18n.t("validations.lettings.financial.pscharge.negative_currency")) expect(record.errors["supcharg"]) - .to include(match I18n.t("validations.financial.negative_currency")) + .to include(match I18n.t("validations.lettings.financial.supcharg.negative_currency")) end end @@ -466,7 +457,7 @@ RSpec.describe Validations::FinancialValidations do record[test_case[:charge][:field]] = test_case[:charge][:value] financial_validator.validate_rent_amount(record) expect(record.errors[test_case[:charge][:field]]) - .to include(match I18n.t("validations.financial.rent.out_of_range", charge_name: test_case[:charge_name], maximum_per_period: test_case[:maximum_per_period], frequency: test_case[:period][:label], letting_type: "general needs", provider_type: "private registered provider")) + .to include(match I18n.t("validations.lettings.financial.#{test_case[:charge][:field]}.rent_out_of_range", charge_name: test_case[:charge_name], maximum_per_period: test_case[:maximum_per_period], frequency: test_case[:period][:label], letting_type: "general needs", provider_type: "private registered provider")) end end @@ -578,7 +569,7 @@ RSpec.describe Validations::FinancialValidations do record[test_case[:charge][:field]] = test_case[:charge][:value] financial_validator.validate_rent_amount(record) expect(record.errors[test_case[:charge][:field]]) - .to include(match I18n.t("validations.financial.rent.out_of_range", charge_name: test_case[:charge_name], maximum_per_period: test_case[:maximum_per_period], frequency: test_case[:period][:label], letting_type: "supported housing", provider_type: "private registered provider")) + .to include(match I18n.t("validations.lettings.financial.#{test_case[:charge][:field]}.rent_out_of_range", charge_name: test_case[:charge_name], maximum_per_period: test_case[:maximum_per_period], frequency: test_case[:period][:label], letting_type: "supported housing", provider_type: "private registered provider")) end end @@ -694,7 +685,7 @@ RSpec.describe Validations::FinancialValidations do record[test_case[:charge][:field]] = test_case[:charge][:value] financial_validator.validate_rent_amount(record) expect(record.errors[test_case[:charge][:field]]) - .to include(match I18n.t("validations.financial.rent.out_of_range", charge_name: test_case[:charge_name], maximum_per_period: test_case[:maximum_per_period], frequency: test_case[:period][:label], letting_type: "general needs", provider_type: "local authority")) + .to include(match I18n.t("validations.lettings.financial.#{test_case[:charge][:field]}.rent_out_of_range", charge_name: test_case[:charge_name], maximum_per_period: test_case[:maximum_per_period], frequency: test_case[:period][:label], letting_type: "general needs", provider_type: "local authority")) end end @@ -806,7 +797,7 @@ RSpec.describe Validations::FinancialValidations do record[test_case[:charge][:field]] = test_case[:charge][:value] financial_validator.validate_rent_amount(record) expect(record.errors[test_case[:charge][:field]]) - .to include(match I18n.t("validations.financial.rent.out_of_range", charge_name: test_case[:charge_name], maximum_per_period: test_case[:maximum_per_period], frequency: test_case[:period][:label], letting_type: "supported housing", provider_type: "local authority")) + .to include(match I18n.t("validations.lettings.financial.#{test_case[:charge][:field]}.rent_out_of_range", charge_name: test_case[:charge_name], maximum_per_period: test_case[:maximum_per_period], frequency: test_case[:period][:label], letting_type: "supported housing", provider_type: "local authority")) end end @@ -885,7 +876,7 @@ RSpec.describe Validations::FinancialValidations do record.tcharge = 9 financial_validator.validate_rent_amount(record) expect(record.errors["tcharge"]) - .to include(match I18n.t("validations.financial.tcharge.under_10")) + .to include(match I18n.t("validations.lettings.financial.tcharge.under_10")) end it "allows the total charge to be over 10 per week" do @@ -903,7 +894,7 @@ RSpec.describe Validations::FinancialValidations do record.tcharge = 19.99 financial_validator.validate_rent_amount(record) expect(record.errors["tcharge"]) - .to include(match I18n.t("validations.financial.tcharge.under_10")) + .to include(match I18n.t("validations.lettings.financial.tcharge.under_10")) end it "allows the total charge to be over 10 per week" do @@ -922,11 +913,11 @@ RSpec.describe Validations::FinancialValidations do record.household_charge = 1 financial_validator.validate_rent_amount(record) expect(record.errors["tcharge"]) - .to include(match I18n.t("validations.financial.charges.complete_1_of_3")) + .to include(match I18n.t("validations.lettings.financial.tcharge.complete_1_of_3")) expect(record.errors["chcharge"]) - .to include(match I18n.t("validations.financial.charges.complete_1_of_3")) + .to include(match I18n.t("validations.lettings.financial.chcharge.complete_1_of_3")) expect(record.errors["household_charge"]) - .to include(match I18n.t("validations.financial.charges.complete_1_of_3")) + .to include(match I18n.t("validations.lettings.financial.household_charge.complete_1_of_3")) end it "returns an error for tcharge and chcharge types selected" do @@ -936,9 +927,9 @@ RSpec.describe Validations::FinancialValidations do expect(record.errors["household_charge"]) .to be_empty expect(record.errors["tcharge"]) - .to include(match I18n.t("validations.financial.charges.complete_1_of_3")) + .to include(match I18n.t("validations.lettings.financial.tcharge.complete_1_of_3")) expect(record.errors["chcharge"]) - .to include(match I18n.t("validations.financial.charges.complete_1_of_3")) + .to include(match I18n.t("validations.lettings.financial.chcharge.complete_1_of_3")) end it "returns an error for tcharge type and household_charge not paid selected" do @@ -948,9 +939,9 @@ RSpec.describe Validations::FinancialValidations do expect(record.errors["chcharge"]) .to be_empty expect(record.errors["tcharge"]) - .to include(match I18n.t("validations.financial.charges.complete_1_of_3")) + .to include(match I18n.t("validations.lettings.financial.tcharge.complete_1_of_3")) expect(record.errors["household_charge"]) - .to include(match I18n.t("validations.financial.charges.complete_1_of_3")) + .to include(match I18n.t("validations.lettings.financial.household_charge.complete_1_of_3")) end it "returns an error for chcharge type and household_charge not paid selected" do @@ -960,9 +951,9 @@ RSpec.describe Validations::FinancialValidations do expect(record.errors["tcharge"]) .to be_empty expect(record.errors["chcharge"]) - .to include(match I18n.t("validations.financial.charges.complete_1_of_3")) + .to include(match I18n.t("validations.lettings.financial.chcharge.complete_1_of_3")) expect(record.errors["household_charge"]) - .to include(match I18n.t("validations.financial.charges.complete_1_of_3")) + .to include(match I18n.t("validations.lettings.financial.household_charge.complete_1_of_3")) end end @@ -1038,7 +1029,7 @@ RSpec.describe Validations::FinancialValidations do financial_validator.validate_rent_amount(record) expect(record.errors["brent"]) - .to include(match I18n.t("validations.financial.brent.below_hard_min")) + .to include(match I18n.t("validations.lettings.financial.brent.below_hard_min")) end it "validates hard minimum for supported housing" do @@ -1051,11 +1042,11 @@ RSpec.describe Validations::FinancialValidations do financial_validator.validate_rent_amount(record) expect(record.errors["brent"]) - .to include(match I18n.t("validations.financial.brent.below_hard_min")) + .to include(match I18n.t("validations.lettings.financial.brent.below_hard_min")) %w[beds la postcode_known scheme_id location_id rent_type needstype period].each do |field| expect(record.errors[field]) - .to include(match I18n.t("validations.financial.brent.#{field}.below_hard_min")) + .to include(match I18n.t("validations.lettings.financial.#{field}.rent_below_hard_min")) end end @@ -1070,11 +1061,11 @@ RSpec.describe Validations::FinancialValidations do financial_validator.validate_rent_amount(record) expect(record.errors["brent"]) - .to include(match I18n.t("validations.financial.brent.above_hard_max")) + .to include(match I18n.t("validations.lettings.financial.brent.above_hard_max")) %w[beds la postcode_known scheme_id location_id rent_type needstype period].each do |field| expect(record.errors[field]) - .to include(match I18n.t("validations.financial.brent.#{field}.above_hard_max")) + .to include(match I18n.t("validations.lettings.financial.#{field}.rent_above_hard_max")) end end @@ -1088,11 +1079,11 @@ RSpec.describe Validations::FinancialValidations do financial_validator.validate_rent_amount(record) expect(record.errors["brent"]) - .to include(match I18n.t("validations.financial.brent.above_hard_max")) + .to include(match I18n.t("validations.lettings.financial.brent.above_hard_max")) %w[beds la postcode_known scheme_id location_id rent_type needstype period].each do |field| expect(record.errors[field]) - .to include(match I18n.t("validations.financial.brent.#{field}.above_hard_max")) + .to include(match I18n.t("validations.lettings.financial.#{field}.rent_above_hard_max")) end end @@ -1106,11 +1097,11 @@ RSpec.describe Validations::FinancialValidations do financial_validator.validate_rent_amount(record) expect(record.errors["brent"]) - .to include(match I18n.t("validations.financial.brent.above_hard_max")) + .to include(match I18n.t("validations.lettings.financial.brent.above_hard_max")) %w[beds la postcode_known scheme_id location_id rent_type needstype period].each do |field| expect(record.errors[field]) - .to include(match I18n.t("validations.financial.brent.#{field}.above_hard_max")) + .to include(match I18n.t("validations.lettings.financial.#{field}.rent_above_hard_max")) end end @@ -1213,9 +1204,9 @@ RSpec.describe Validations::FinancialValidations do record.chcharge = nil financial_validator.validate_care_home_charges(record) expect(record.errors["chcharge"]) - .to include(match I18n.t("validations.financial.carehome.not_provided", period: "every 4 weeks")) + .to include(match I18n.t("validations.lettings.financial.carehome.not_provided", period: "every 4 weeks")) expect(record.errors["is_carehome"]) - .to include(match I18n.t("validations.financial.carehome.not_provided", period: "every 4 weeks")) + .to include(match I18n.t("validations.lettings.financial.carehome.not_provided", period: "every 4 weeks")) end end From b681b101f3b494409c19722088a4bcb9c9c4766e Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 12 Nov 2024 10:39:53 +0000 Subject: [PATCH 9/9] CLDC-3715: Sales - Remove Q8 (What is the type of outright sale?) (25/26) (#2753) --- app/models/form/sales/subsections/setup.rb | 2 +- config/locales/forms/2025/sales/setup.en.yml | 10 ------ .../form/sales/subsections/setup_spec.rb | 34 ++++++++++++++++++- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/app/models/form/sales/subsections/setup.rb b/app/models/form/sales/subsections/setup.rb index e5b5b3f84..b0c7025c7 100644 --- a/app/models/form/sales/subsections/setup.rb +++ b/app/models/form/sales/subsections/setup.rb @@ -15,7 +15,7 @@ class Form::Sales::Subsections::Setup < ::Form::Subsection Form::Sales::Pages::OwnershipScheme.new(nil, nil, self), Form::Sales::Pages::SharedOwnershipType.new(nil, nil, self), Form::Sales::Pages::DiscountedOwnershipType.new(nil, nil, self), - Form::Sales::Pages::OutrightOwnershipType.new(nil, nil, self), + (Form::Sales::Pages::OutrightOwnershipType.new(nil, nil, self) unless form.start_year_2025_or_later?), Form::Sales::Pages::BuyerCompany.new(nil, nil, self), Form::Sales::Pages::BuyerLive.new(nil, nil, self), Form::Sales::Pages::JointPurchase.new(nil, nil, self), diff --git a/config/locales/forms/2025/sales/setup.en.yml b/config/locales/forms/2025/sales/setup.en.yml index 4f00ab0c2..105d0ad0d 100644 --- a/config/locales/forms/2025/sales/setup.en.yml +++ b/config/locales/forms/2025/sales/setup.en.yml @@ -50,16 +50,6 @@ en: check_answer_label: "Type of discounted ownership sale" hint_text: "" question_text: "What is the type of discounted ownership sale?" - outright_ownership: - page_header: "Type of outright sale" - type: - check_answer_label: "Type of outright sale" - hint_text: "" - question_text: "What is the type of outright sale?" - othtype: - check_answer_label: "Type of other sale" - hint_text: "" - question_text: "What type of sale is it?" companybuy: page_header: "" diff --git a/spec/models/form/sales/subsections/setup_spec.rb b/spec/models/form/sales/subsections/setup_spec.rb index 1e49d11e6..1cd363105 100644 --- a/spec/models/form/sales/subsections/setup_spec.rb +++ b/spec/models/form/sales/subsections/setup_spec.rb @@ -23,6 +23,7 @@ RSpec.describe Form::Sales::Subsections::Setup, type: :model do context "when start year is before 2024" do before do allow(section.form).to receive(:start_year_2024_or_later?).and_return(false) + allow(section.form).to receive(:start_year_2025_or_later?).and_return(false) end it "has correct pages" do @@ -46,9 +47,10 @@ RSpec.describe Form::Sales::Subsections::Setup, type: :model do end end - context "when start year is >= 2024" do + context "when start year is 2024" do before do allow(section.form).to receive(:start_year_2024_or_later?).and_return(true) + allow(section.form).to receive(:start_year_2025_or_later?).and_return(false) end it "has correct pages" do @@ -75,4 +77,34 @@ RSpec.describe Form::Sales::Subsections::Setup, type: :model do ) end end + + context "when start year is >= 2025" do + before do + allow(section.form).to receive(:start_year_2024_or_later?).and_return(true) + allow(section.form).to receive(:start_year_2025_or_later?).and_return(true) + end + + it "has correct pages" do + expect(setup.pages.map(&:id)).to eq( + %w[ + completion_date + owning_organisation + managing_organisation + assigned_to + purchaser_code + ownership_scheme + shared_ownership_type + discounted_ownership_type + buyer_company + buyer_live + joint_purchase + number_joint_buyers + buyer_interview_joint_purchase + buyer_interview + privacy_notice_joint_purchase + privacy_notice + ], + ) + end + end end