From d28098936e1c8bf96ad4acec0e479832a7ef8ec3 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Thu, 2 Apr 2026 15:24:03 +0100 Subject: [PATCH 01/21] CLDC-4355: Add hyphens to housing-related (#3283) --- .../forms/2025/lettings/income_and_benefits.en.yml | 10 +++++----- .../2025/sales/income_benefits_and_savings.en.yml | 8 ++++---- .../forms/2026/lettings/income_and_benefits.en.yml | 10 +++++----- .../2026/sales/income_benefits_and_savings.en.yml | 8 ++++---- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/config/locales/forms/2025/lettings/income_and_benefits.en.yml b/config/locales/forms/2025/lettings/income_and_benefits.en.yml index c8a29cbc2..a062ddb91 100644 --- a/config/locales/forms/2025/lettings/income_and_benefits.en.yml +++ b/config/locales/forms/2025/lettings/income_and_benefits.en.yml @@ -25,10 +25,10 @@ en: hb: page_header: "" - check_answer_label: "Housing related benefits received" - check_answer_prompt: "Tell us if household receives housing related benefits" - 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?" + check_answer_label: "Housing-related benefits received" + check_answer_prompt: "Tell us if household receives housing-related benefits" + 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: "" @@ -112,7 +112,7 @@ en: check_answer_label: "Any outstanding amount for basic rent and charges" check_answer_prompt: "Tell us if 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?" + 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: "" 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 index 12ee21d8b..729e701ec 100644 --- a/config/locales/forms/2025/sales/income_benefits_and_savings.en.yml +++ b/config/locales/forms/2025/sales/income_benefits_and_savings.en.yml @@ -46,16 +46,16 @@ en: housing_benefits: joint_purchase: page_header: "" - check_answer_label: "Housing related benefits buyers received before buying this property" + check_answer_label: "Housing-related benefits buyers received before buying this property" check_answer_prompt: "" hint_text: "" - question_text: "Were the buyers receiving any of these housing related benefits immediately before buying this property?" + 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" + check_answer_label: "Housing-related benefits buyer received before buying this property" check_answer_prompt: "" hint_text: "" - question_text: "Was the buyer receiving any of these housing related benefits immediately before buying this property?" + question_text: "Was the buyer receiving any of these housing-related benefits immediately before buying this property?" savings: joint_purchase: diff --git a/config/locales/forms/2026/lettings/income_and_benefits.en.yml b/config/locales/forms/2026/lettings/income_and_benefits.en.yml index 9148da77b..0be61af18 100644 --- a/config/locales/forms/2026/lettings/income_and_benefits.en.yml +++ b/config/locales/forms/2026/lettings/income_and_benefits.en.yml @@ -25,10 +25,10 @@ en: hb: page_header: "" - check_answer_label: "Housing related benefits received" - check_answer_prompt: "Tell us if household receives housing related benefits" - 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?" + check_answer_label: "Housing-related benefits received" + check_answer_prompt: "Tell us if household receives housing-related benefits" + 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: "" @@ -112,7 +112,7 @@ en: check_answer_label: "Any outstanding amount for basic rent and charges" check_answer_prompt: "Tell us if 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?" + 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: "" diff --git a/config/locales/forms/2026/sales/income_benefits_and_savings.en.yml b/config/locales/forms/2026/sales/income_benefits_and_savings.en.yml index 5642ee9b1..6648b8c17 100644 --- a/config/locales/forms/2026/sales/income_benefits_and_savings.en.yml +++ b/config/locales/forms/2026/sales/income_benefits_and_savings.en.yml @@ -46,16 +46,16 @@ en: housing_benefits: joint_purchase: page_header: "" - check_answer_label: "Housing related benefits buyers received before buying this property" + check_answer_label: "Housing-related benefits buyers received before buying this property" check_answer_prompt: "" hint_text: "" - question_text: "Were the buyers receiving any of these housing related benefits immediately before buying this property?" + 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" + check_answer_label: "Housing-related benefits buyer received before buying this property" check_answer_prompt: "" hint_text: "" - question_text: "Was the buyer receiving any of these housing related benefits immediately before buying this property?" + question_text: "Was the buyer receiving any of these housing-related benefits immediately before buying this property?" savings: joint_purchase: From 2ad2529c576955511e72e2312078f65a2a998679 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Tue, 7 Apr 2026 09:32:20 +0100 Subject: [PATCH 02/21] CLDC-4114: Silence DPO warning if DSA is signed (#3143) * CLDC-4114: Silence DPO warning if DSA is signed also restructure redundant logic in the file * CLDC-4114: Update tests * fixup! CLDC-4114: Silence DPO warning if DSA is signed Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com> * CLDC-4114: Restructure data protection confirmation banner tests * fixup! CLDC-4114: Restructure data protection confirmation banner tests * fixup! CLDC-4114: Restructure data protection confirmation banner tests fix typo Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com> * CLDC-4114: Lint after merge since rubocop updated --------- Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com> --- ...rotection_confirmation_banner_component.rb | 38 +++--- ...tion_confirmation_banner_component_spec.rb | 111 ++++-------------- 2 files changed, 43 insertions(+), 106 deletions(-) diff --git a/app/components/data_protection_confirmation_banner_component.rb b/app/components/data_protection_confirmation_banner_component.rb index 7ce852ae0..079b90b98 100644 --- a/app/components/data_protection_confirmation_banner_component.rb +++ b/app/components/data_protection_confirmation_banner_component.rb @@ -12,16 +12,16 @@ class DataProtectionConfirmationBannerComponent < ViewComponent::Base def display_banner? return false if user.support? && organisation.blank? - return true if org_without_dpo? + return true if show_no_dpo_message? return false if !org_or_user_org.holds_own_stock? && org_or_user_org.stock_owners.empty? && org_or_user_org.absorbed_organisations.empty? - !org_or_user_org.data_protection_confirmed? || !org_or_user_org.organisation_or_stock_owner_signed_dsa_and_holds_own_stock? + !dsa_signed? || !org_or_user_org.organisation_or_stock_owner_signed_dsa_and_holds_own_stock? end def header_text - if org_without_dpo? + if show_no_dpo_message? "To create logs your organisation must state a data protection officer. They must sign the Data Sharing Agreement." - elsif !org_or_user_org.holds_own_stock? && org_or_user_org.data_protection_confirmed? + elsif show_no_stock_owner_message? "Your organisation does not own stock. To create logs your stock owner(s) must accept the Data Sharing Agreement on CORE." elsif user.is_dpo? "Your organisation must accept the Data Sharing Agreement before you can create any logs." @@ -31,7 +31,7 @@ class DataProtectionConfirmationBannerComponent < ViewComponent::Base end def banner_text - if org_without_dpo? || user.is_dpo? || !org_or_user_org.holds_own_stock? + if show_no_dpo_message? || user.is_dpo? || !org_or_user_org.holds_own_stock? govuk_link_to( link_text, link_href, @@ -51,9 +51,9 @@ private end def link_text - if dpo_required? + if show_no_dpo_message? "Contact helpdesk to assign a data protection officer" - elsif !org_or_user_org.holds_own_stock? && org_or_user_org.data_protection_confirmed? + elsif show_no_stock_owner_message? "View or add stock owners" else "Read the Data Sharing Agreement" @@ -61,24 +61,32 @@ private end def link_href - if dpo_required? + if show_no_dpo_message? GlobalConstants::HELPDESK_URL - elsif !org_or_user_org.holds_own_stock? && org_or_user_org.data_protection_confirmed? + elsif show_no_stock_owner_message? stock_owners_organisation_path(org_or_user_org) else data_sharing_agreement_organisation_path(org_or_user_org) end end - def dpo_required? - org_or_user_org.data_protection_officers.empty? + def show_no_dpo_message? + # it is fine if an org has a DSA and the DPO has moved on + # CORE staff do this sometimes as a single DPO covers multiple 'orgs' that exist as branches of the same real world org + # so, they move the DPO to all the mini orgs and have them sign each DSA + # so the DSA being signed can silence this warning + org_or_user_org.data_protection_officers.empty? && !dsa_signed? end - def org_or_user_org - organisation.presence || user.organisation + def dsa_signed? + org_or_user_org.data_protection_confirmed? + end + + def show_no_stock_owner_message? + !org_or_user_org.holds_own_stock? && dsa_signed? end - def org_without_dpo? - org_or_user_org.data_protection_officers.empty? + def org_or_user_org + organisation.presence || user.organisation end end diff --git a/spec/components/data_protection_confirmation_banner_component_spec.rb b/spec/components/data_protection_confirmation_banner_component_spec.rb index 022f44310..0beeca626 100644 --- a/spec/components/data_protection_confirmation_banner_component_spec.rb +++ b/spec/components/data_protection_confirmation_banner_component_spec.rb @@ -23,13 +23,25 @@ RSpec.describe DataProtectionConfirmationBannerComponent, type: :component do organisation.users.where(is_dpo: true).destroy_all end - it "displays the banner" do - expect(component.display_banner?).to be(true) - expect(render).to have_link( - "Contact helpdesk to assign a data protection officer", - href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11", - ) - expect(render).to have_selector("p", text: "To create logs your organisation must state a data protection officer. They must sign the Data Sharing Agreement.") + context "when org does not have a signed data sharing agreement" do + let(:organisation) { create(:organisation, :without_dpc) } + let(:user) { create(:user, organisation:, with_dsa: false) } + + it "displays the banner" do + expect(component.display_banner?).to be(true) + expect(render).to have_link( + "Contact helpdesk to assign a data protection officer", + href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11", + ) + expect(render).to have_selector("p", text: "To create logs your organisation must state a data protection officer. They must sign the Data Sharing Agreement.") + end + end + + context "when org does have a signed data sharing agreement" do + it "does not display banner" do + expect(component.display_banner?).to be(false) + expect(render.content).to be_empty + end end end @@ -81,7 +93,7 @@ RSpec.describe DataProtectionConfirmationBannerComponent, type: :component do end end - context "when org has a signed data sharing agremeent" do + context "when org has a signed data sharing agreement" do it "does not display banner" do expect(component.display_banner?).to be(false) expect(render.content).to be_empty @@ -121,88 +133,5 @@ RSpec.describe DataProtectionConfirmationBannerComponent, type: :component do end end end - - context "when org does not have a DPO" do - before do - organisation.users.where(is_dpo: true).destroy_all - end - - it "displays the banner" do - expect(component.display_banner?).to be(true) - expect(render).to have_link( - "Contact helpdesk to assign a data protection officer", - href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11", - ) - expect(render).to have_selector("p", text: "To create logs your organisation must state a data protection officer. They must sign the Data Sharing Agreement.") - end - end - - context "when org has a DPO" do - context "when org does not have a signed data sharing agreement" do - context "when user is not a DPO" do - let(:organisation) { create(:organisation, :without_dpc) } - let(:user) { create(:user, organisation:, with_dsa: false) } - let!(:dpo) { create(:user, :data_protection_officer, organisation:, with_dsa: false) } - - it "displays the banner and shows DPOs" do - expect(component.display_banner?).to be(true) - expect(render.css("a")).to be_empty - expect(render).to have_selector("p", text: "Your data protection officer must accept the Data Sharing Agreement on CORE before you can create any logs.") - expect(render).to have_selector("p", text: "You can ask: #{dpo.name}") - end - - context "and has a parent organisation that owns stock and has signed DSA" do - before do - parent_organisation = create(:organisation, holds_own_stock: true) - create(:organisation_relationship, child_organisation: organisation, parent_organisation:) - end - - it "displays the banner and shows DPOs" do - expect(component.display_banner?).to be(true) - expect(render.css("a")).to be_empty - expect(render).to have_selector("p", text: "Your data protection officer must accept the Data Sharing Agreement on CORE before you can create any logs.") - expect(render).to have_selector("p", text: "You can ask: #{dpo.name}") - end - end - end - - context "when user is a DPO" do - let(:organisation) { create(:organisation, :without_dpc) } - let(:user) { create(:user, :data_protection_officer, organisation:, with_dsa: false) } - - it "displays the banner and asks to sign" do - expect(component.display_banner?).to be(true) - expect(render).to have_link( - "Read the Data Sharing Agreement", - href: "/organisations/#{organisation.id}/data-sharing-agreement", - ) - expect(render).to have_selector("p", text: "Your organisation must accept the Data Sharing Agreement before you can create any logs.") - end - - context "and has a parent organisation that owns stock and has signed DSA" do - before do - parent_organisation = create(:organisation, holds_own_stock: true) - create(:organisation_relationship, child_organisation: organisation, parent_organisation:) - end - - it "displays the banner and asks to sign" do - expect(component.display_banner?).to be(true) - expect(render).to have_link( - "Read the Data Sharing Agreement", - href: "/organisations/#{organisation.id}/data-sharing-agreement", - ) - expect(render).to have_selector("p", text: "Your organisation must accept the Data Sharing Agreement before you can create any logs.") - end - end - end - end - - context "when org has a signed data sharing agremeent" do - it "does not display banner" do - expect(component.display_banner?).to be(false) - expect(render.content).to be_empty - end - end - end end end From 7a121f2b979ab75d2641b143427438f482335422 Mon Sep 17 00:00:00 2001 From: Frank Ma <36454654+kwunkiuma@users.noreply.github.com> Date: Tue, 7 Apr 2026 09:36:13 +0100 Subject: [PATCH 03/21] CLDC-4029: Add additional user filters (#3124) * CLDC-4029: Add new filters * CLDC-4029: Add tests * CLDC-4029: Address linter issues * CLDC-4029: Pass argument by keyword when required * CLDC-4029: Reference scopes directly * CLDC-4029: Add tests for user filters displaying * CLDC-4029: Use enum names for user filters --------- Co-authored-by: Samuel Young Co-authored-by: Nat Dean-Lewis <94526761+natdeanlewissoftwire@users.noreply.github.com> --- app/helpers/filters_helper.rb | 18 +++++++++- app/models/user.rb | 23 +++++++++++++ app/services/filter_manager.rb | 8 +++++ app/views/users/_user_filters.html.erb | 30 ++++++++++++---- spec/features/user_spec.rb | 20 +++++++++++ spec/services/filter_manager_spec.rb | 47 ++++++++++++++++++++++++++ 6 files changed, 139 insertions(+), 7 deletions(-) diff --git a/app/helpers/filters_helper.rb b/app/helpers/filters_helper.rb index 57a3cabc3..2ebbfdda1 100644 --- a/app/helpers/filters_helper.rb +++ b/app/helpers/filters_helper.rb @@ -52,6 +52,22 @@ module FiltersHelper }.freeze end + def user_role_type_filters(include_support: false) + roles = { + "data_provider" => "Data provider", + "data_coordinator" => "Data coordinator", + } + roles["support"] = "Support" if include_support + roles.freeze + end + + def user_additional_responsibilities_filters + { + "data_protection_officer" => "Data protection officer", + "key_contact" => "Key contact", + }.freeze + end + def scheme_status_filters { "incomplete" => "Incomplete", @@ -306,7 +322,7 @@ private def filters_count(filters) filters.each.sum do |category, category_filters| - if %w[years status needstypes bulk_upload_id].include?(category) + if %w[years status needstypes bulk_upload_id role additional_responsibilities].include?(category) category_filters.count(&:present?) elsif %w[user owning_organisation managing_organisation user_text_search owning_organisation_text_search managing_organisation_text_search uploading_organisation].include?(category) 1 diff --git a/app/models/user.rb b/app/models/user.rb index 10638efce..ea8289e53 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -81,6 +81,29 @@ class User < ApplicationRecord filtered_records } + scope :filter_by_role, ->(role, _user = nil) { where(role:) } + scope :filter_by_additional_responsibilities, lambda { |additional_responsibilities, _user| + filtered_records = all + scopes = [] + + additional_responsibilities.each do |responsibility| + case responsibility + when "key_contact" + scopes << is_key_contact + when "data_protection_officer" + scopes << is_data_protection_officer + end + end + + if scopes.any? + filtered_records = filtered_records.merge(scopes.reduce(&:or)) + end + + filtered_records + } + + scope :is_key_contact, -> { where(is_key_contact: true) } + scope :is_data_protection_officer, -> { where(is_dpo: true) } scope :not_signed_in, -> { where(last_sign_in_at: nil, active: true) } scope :deactivated, -> { where(active: false) } scope :activated, -> { where(active: true) } diff --git a/app/services/filter_manager.rb b/app/services/filter_manager.rb index 69e895809..0e9890d47 100644 --- a/app/services/filter_manager.rb +++ b/app/services/filter_manager.rb @@ -130,6 +130,14 @@ class FilterManager new_filters["status"] = params["status"] end + if filter_type.include?("users") && params["role"].present? + new_filters["role"] = params["role"] + end + + if filter_type.include?("users") && params["additional_responsibilities"].present? + new_filters["additional_responsibilities"] = params["additional_responsibilities"] + end + if filter_type.include?("schemes") current_user.scheme_filters(specific_org:).each do |filter| new_filters[filter] = params[filter] if params[filter].present? diff --git a/app/views/users/_user_filters.html.erb b/app/views/users/_user_filters.html.erb index aa9185c8d..876c8925f 100644 --- a/app/views/users/_user_filters.html.erb +++ b/app/views/users/_user_filters.html.erb @@ -17,12 +17,30 @@ <%= render partial: "filters/checkbox_filter", locals: { - f:, - options: user_status_filters, - label: "Status", - category: "status", - size: "s", - } %> + f:, + options: user_status_filters, + label: "Status", + category: "status", + size: "s", + } %> + + <%= render partial: "filters/checkbox_filter", + locals: { + f:, + options: user_role_type_filters(include_support: current_user.support?), + label: "Role type", + category: "role", + size: "s", + } %> + + <%= render partial: "filters/checkbox_filter", + locals: { + f:, + options: user_additional_responsibilities_filters, + label: "Additional responsibilities", + category: "additional_responsibilities", + size: "s", + } %> <% if request.params["search"].present? %> <%= f.hidden_field :search, value: request.params["search"] %> diff --git a/spec/features/user_spec.rb b/spec/features/user_spec.rb index 0f75a562a..e4acfbbf0 100644 --- a/spec/features/user_spec.rb +++ b/spec/features/user_spec.rb @@ -282,6 +282,12 @@ RSpec.describe "User Features" do end end end + + it "shows correct filters" do + expect(page).to have_selector("label", text: "Data provider") + expect(page).to have_selector("label", text: "Data coordinator") + expect(page).not_to have_selector("label", text: "Support") + end end end @@ -619,6 +625,20 @@ RSpec.describe "User Features" do expect(page).to have_button("Resend invite link") end end + + context "when filtering users" do + before do + allow(user).to receive(:need_two_factor_authentication?).and_return(false) + sign_in(user) + visit(users_path) + end + + it "shows correct filters" do + expect(page).to have_selector("label", text: "Data provider") + expect(page).to have_selector("label", text: "Data coordinator") + expect(page).to have_selector("label", text: "Support") + end + end end context "when the user is a customer support person" do diff --git a/spec/services/filter_manager_spec.rb b/spec/services/filter_manager_spec.rb index 78923d7be..006ef0697 100644 --- a/spec/services/filter_manager_spec.rb +++ b/spec/services/filter_manager_spec.rb @@ -94,4 +94,51 @@ describe FilterManager do expect(described_class.filter_schemes(Scheme.all, nil, {}, nil, nil)).to eq(alphabetical_order_schemes) end end + + describe "filter_users" do + let(:data_provider_user) { FactoryBot.create(:user, role: "data_provider") } + let(:data_coordinator_user) { FactoryBot.create(:user, role: "data_coordinator") } + let(:support_user) { FactoryBot.create(:user, role: "support") } + let(:key_contact_user) { FactoryBot.create(:user, is_key_contact: true) } + let(:dpo_user) { FactoryBot.create(:user, is_dpo: true) } + let(:key_contact_dpo_user) { FactoryBot.create(:user, is_key_contact: true, is_dpo: true) } + + context "when filtering by role" do + it "returns users with the role" do + filter = { "role" => %w[data_provider] } + result = described_class.filter_users(User.all, nil, filter, nil) + expect(result).to include(data_provider_user) + expect(result).not_to include(data_coordinator_user) + expect(result).not_to include(support_user) + end + + it "returns users with multiple roles selected" do + filter = { "role" => %w[data_provider data_coordinator] } + result = described_class.filter_users(User.all, nil, filter, nil) + expect(result).to include(data_provider_user) + expect(result).to include(data_coordinator_user) + expect(result).not_to include(support_user) + end + end + + context "when filtering by additional responsibilities" do + it "returns users with the additional responsibilities" do + filter = { "additional_responsibilities" => %w[data_protection_officer] } + result = described_class.filter_users(User.all, nil, filter, nil) + expect(result).to include(dpo_user) + expect(result).to include(key_contact_dpo_user) + expect(result).not_to include(key_contact_user) + expect(result).not_to include(support_user) + end + + it "returns users with multiple additional responsibilities selected" do + filter = { "additional_responsibilities" => %w[data_protection_officer key_contact] } + result = described_class.filter_users(User.all, nil, filter, nil) + expect(result).to include(dpo_user) + expect(result).to include(key_contact_dpo_user) + expect(result).to include(key_contact_user) + expect(result).not_to include(support_user) + end + end + end end From 6e768b4aa89c898b0463a8449de36fa14c23009a Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Tue, 7 Apr 2026 14:57:47 +0100 Subject: [PATCH 04/21] =?UTF-8?q?Revert=20"Revert=20"CLDC-4340:=20Account?= =?UTF-8?q?=20for=20nil=20location=20name=20on=20location=20select=20(?= =?UTF-8?q?=E2=80=A6"=20(#3281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0a10512dc664f6a091beb4432303b868f20335d0. --- .../form/lettings/questions/location_id.rb | 7 ++--- .../lettings/questions/location_id_spec.rb | 26 +++++++++---------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/app/models/form/lettings/questions/location_id.rb b/app/models/form/lettings/questions/location_id.rb index 80e34aac0..2964298ed 100644 --- a/app/models/form/lettings/questions/location_id.rb +++ b/app/models/form/lettings/questions/location_id.rb @@ -30,11 +30,8 @@ class Form::Lettings::Questions::LocationId < ::Form::Question scheme_location_ids = lettings_log.scheme.locations.visible.confirmed.pluck(:id) answer_options.select { |k, _v| scheme_location_ids.include?(k.to_i) } - .sort_by { |_, v| - name = v["hint"].match(/[a-zA-Z].*/).to_s - number = v["hint"].match(/\d+/).to_s.to_i - [name, number] - }.to_h + .sort_by { |_, v| v["value"] } + .to_h end def hidden_in_check_answers?(lettings_log, _current_user = nil) diff --git a/spec/models/form/lettings/questions/location_id_spec.rb b/spec/models/form/lettings/questions/location_id_spec.rb index 2ea72c705..755c1f1a6 100644 --- a/spec/models/form/lettings/questions/location_id_spec.rb +++ b/spec/models/form/lettings/questions/location_id_spec.rb @@ -142,27 +142,27 @@ RSpec.describe Form::Lettings::Questions::LocationId, type: :model do context "and some locations start with numbers" do before do - FactoryBot.create(:location, scheme:, startdate: Time.utc(2022, 5, 5), name: "2 Abe Road") - FactoryBot.create(:location, scheme:, startdate: Time.utc(2022, 5, 6), name: "1 Abe Road") - FactoryBot.create(:location, scheme:, startdate: Time.utc(2022, 5, 7), name: "1 Lake Lane") - FactoryBot.create(:location, scheme:, startdate: Time.utc(2022, 5, 8), name: "3 Abe Road") - FactoryBot.create(:location, scheme:, startdate: Time.utc(2022, 5, 9), name: "2 Lake Lane") - FactoryBot.create(:location, scheme:, startdate: Time.utc(2022, 5, 10), name: "Smith Avenue") - FactoryBot.create(:location, scheme:, startdate: Time.utc(2022, 5, 11), name: "Abacus Road") - FactoryBot.create(:location, scheme:, startdate: Time.utc(2022, 5, 12), name: "Hawthorne Road") + FactoryBot.create(:location, scheme:, startdate: Time.utc(2022, 5, 5), name: "2 Abe Road", postcode: "AA1 1AA") + FactoryBot.create(:location, scheme:, startdate: Time.utc(2022, 5, 6), name: "1 Abe Road", postcode: "AA1 2AA") + FactoryBot.create(:location, scheme:, startdate: Time.utc(2022, 5, 7), name: "1 Lake Lane", postcode: "AA1 3AA") + FactoryBot.create(:location, scheme:, startdate: Time.utc(2022, 5, 8), name: "3 Abe Road", postcode: "AA1 4AA") + FactoryBot.create(:location, scheme:, startdate: Time.utc(2022, 5, 9), name: "2 Lake Lane", postcode: "AA1 5AA") + FactoryBot.create(:location, scheme:, startdate: Time.utc(2022, 5, 10), name: "Smith Avenue", postcode: "AA1 6AA") + FactoryBot.create(:location, scheme:, startdate: Time.utc(2022, 5, 11), name: "Abacus Road", postcode: "AA1 7AA") + FactoryBot.create(:location, scheme:, startdate: Time.utc(2022, 5, 12), name: "Hawthorne Road", postcode: "AA1 8AA") lettings_log.update!(scheme:) end - it "orders the locations by name then numerically" do + it "orders the locations by postcode" do expect(question.displayed_answer_options(lettings_log).values.map { |v| v["hint"] }).to eq([ - "Abacus Road", - "1 Abe Road", "2 Abe Road", - "3 Abe Road", - "Hawthorne Road", + "1 Abe Road", "1 Lake Lane", + "3 Abe Road", "2 Lake Lane", "Smith Avenue", + "Abacus Road", + "Hawthorne Road", ]) end end From 1214a7e8be5aac6217b15d694aabfcfef5c4c143 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Tue, 7 Apr 2026 15:40:46 +0100 Subject: [PATCH 05/21] CLDC-4363: Fix tests failing 31st June (#3301) * CLDC-4363: Set date to 1st August * CLDC-4363: Update lettings log csv service spec * CLDC-4363: Update collection resources controller spec * CLDC-4363: Update lettings log derived fields * CLDC-4363: Update remaining model tests * CLDC-4363: Test August 2nd * CLDC-4363: Test July 31st * CLDC-4363: Test back in present * fixup! CLDC-4363: Update remaining model tests wrong field --- app/helpers/collection_time_helper.rb | 4 + .../pages/property_building_type_spec.rb | 49 ++--- .../property_wheelchair_accessible_spec.rb | 49 ++--- .../lettings_log_derived_fields_spec.rb | 39 ---- .../validations/date_validations_spec.rb | 104 +++------ .../sales/soft_validations_spec.rb | 51 +---- .../collection_resources_controller_spec.rb | 6 +- .../csv/lettings_log_csv_service_spec.rb | 197 +----------------- 8 files changed, 70 insertions(+), 429 deletions(-) diff --git a/app/helpers/collection_time_helper.rb b/app/helpers/collection_time_helper.rb index 93852c597..acd9cf7a5 100644 --- a/app/helpers/collection_time_helper.rb +++ b/app/helpers/collection_time_helper.rb @@ -29,6 +29,10 @@ module CollectionTimeHelper Time.zone.local(current_collection_start_year, 4, 1) end + def current_collection_after_crossover_start_date + Form::DEADLINES[current_collection_start_year][:edit_end_date] + 1.day + end + def collection_end_date(date) Time.zone.local(collection_start_year_for_date(date) + 1, 3, 31).end_of_day end diff --git a/spec/models/form/sales/pages/property_building_type_spec.rb b/spec/models/form/sales/pages/property_building_type_spec.rb index b9c6bddca..b5051cb35 100644 --- a/spec/models/form/sales/pages/property_building_type_spec.rb +++ b/spec/models/form/sales/pages/property_building_type_spec.rb @@ -1,12 +1,15 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::PropertyBuildingType, type: :model do + include CollectionTimeHelper + subject(:page) { described_class.new(page_id, page_definition, subsection) } let(:page_id) { nil } let(:page_definition) { nil } - let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:form) { instance_double(Form, start_date: current_collection_start_date) } let(:subsection) { instance_double(Form::Subsection, enabled?: true, form:) } + let(:saledate) { current_collection_start_date } it "has correct subsection" do expect(page.subsection).to eq(subsection) @@ -24,45 +27,21 @@ RSpec.describe Form::Sales::Pages::PropertyBuildingType, type: :model do expect(page.description).to be_nil end - context "with form year 2024" do - let(:form) { Form.new(nil, 2024, [], "sales") } - let(:saledate) { Time.zone.local(2024, 4, 1) } - - context "with a staircasing log" do - let(:log) { build(:sales_log, :shared_ownership_setup_complete, staircase: 1, saledate:) } - - it "is routed to" do - expect(page.routed_to?(log, nil)).to be true - end - end - - context "with a non-staircasing log" do - let(:log) { build(:sales_log, staircase: nil, saledate:) } + context "with a staircasing log" do + let(:form) { Form.new(nil, current_collection_start_year, [], "sales") } + let(:log) { build(:sales_log, :shared_ownership_setup_complete, staircase: 1, saledate:) } - it "is routed to" do - expect(page.routed_to?(log, nil)).to be true - end + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false end end - context "with form year 2025" do - let(:form) { Form.new(nil, 2025, [], "sales") } - let(:saledate) { Time.zone.local(2025, 4, 1) } - - context "with a staircasing log" do - let(:log) { build(:sales_log, :shared_ownership_setup_complete, staircase: 1, saledate:) } - - it "is not routed to" do - expect(page.routed_to?(log, nil)).to be false - end - end - - context "with a non-staircasing log" do - let(:log) { build(:sales_log, staircase: nil, saledate:) } + context "with a non-staircasing log" do + let(:form) { Form.new(nil, current_collection_start_year, [], "sales") } + let(:log) { build(:sales_log, staircase: nil, saledate:) } - it "is routed to" do - expect(page.routed_to?(log, nil)).to be true - end + it "is routed to" do + expect(page.routed_to?(log, nil)).to be true end end end 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 bf0493a6d..8227432db 100644 --- a/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb +++ b/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb @@ -1,12 +1,15 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::PropertyWheelchairAccessible, type: :model do + include CollectionTimeHelper + subject(:page) { described_class.new(page_id, page_definition, subsection) } let(:page_id) { nil } let(:page_definition) { nil } - let(:form) { instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1)) } + let(:form) { instance_double(Form, start_year_2024_or_later?: true, start_date: current_collection_start_date) } let(:subsection) { instance_double(Form::Subsection, enabled?: true, form:) } + let(:saledate) { current_collection_start_date } it "has correct subsection" do expect(page.subsection).to eq(subsection) @@ -24,45 +27,21 @@ RSpec.describe Form::Sales::Pages::PropertyWheelchairAccessible, type: :model do expect(page.description).to be_nil end - context "with form year 2024" do - let(:form) { Form.new(nil, 2024, [], "sales") } - let(:saledate) { Time.zone.local(2024, 4, 1) } - - context "with a staircasing log" do - let(:log) { build(:sales_log, :shared_ownership_setup_complete, staircase: 1, saledate:) } - - it "is routed to" do - expect(page.routed_to?(log, nil)).to be true - end - end - - context "with a non-staircasing log" do - let(:log) { build(:sales_log, :shared_ownership_setup_complete, staircase: 2, saledate:) } + context "with a staircasing log" do + let(:form) { Form.new(nil, current_collection_start_year, [], "sales") } + let(:log) { build(:sales_log, :shared_ownership_setup_complete, staircase: 1, saledate:) } - it "is routed to" do - expect(page.routed_to?(log, nil)).to be true - end + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false end end - context "with form year 2025" do - let(:form) { Form.new(nil, 2025, [], "sales") } - let(:saledate) { Time.zone.local(2025, 4, 1) } - - context "with a staircasing log" do - let(:log) { build(:sales_log, :shared_ownership_setup_complete, staircase: 1, saledate:) } - - it "is not routed to" do - expect(page.routed_to?(log, nil)).to be false - end - end - - context "with a non-staircasing log" do - let(:log) { build(:sales_log, :shared_ownership_setup_complete, staircase: 2, saledate:) } + context "with a non-staircasing log" do + let(:form) { Form.new(nil, current_collection_start_year, [], "sales") } + let(:log) { build(:sales_log, :shared_ownership_setup_complete, staircase: 2, saledate:) } - it "is routed to" do - expect(page.routed_to?(log, nil)).to be true - end + it "is routed to" do + expect(page.routed_to?(log, nil)).to be true end end end diff --git a/spec/models/lettings_log_derived_fields_spec.rb b/spec/models/lettings_log_derived_fields_spec.rb index 056b0a5e7..95a25fe08 100644 --- a/spec/models/lettings_log_derived_fields_spec.rb +++ b/spec/models/lettings_log_derived_fields_spec.rb @@ -111,45 +111,6 @@ RSpec.describe LettingsLog, type: :model do end describe "deriving household member fields" do - context "when it is 2024", metadata: { year: 24 } do - let(:startdate) { collection_start_date_for_year(2024) } - - before do - log.assign_attributes( - relat2: "X", - relat3: "C", - relat4: "X", - relat5: "C", - relat7: "C", - relat8: "X", - age1: 22, - age2: 16, - age4: 60, - age6: 88, - age7: 14, - age8: 42, - ) - - log.set_derived_fields! - end - - it "correctly derives totchild" do - expect(log.totchild).to eq 3 - end - - it "correctly derives totelder" do - expect(log.totelder).to eq 2 - end - - it "correctly derives totadult" do - expect(log.totadult).to eq 3 - end - - it "correctly derives economic status for tenants under 16" do - expect(log.ecstat7).to eq 9 - end - end - context "when it is 2025", metadata: { year: 25 } do let(:startdate) { collection_start_date_for_year(2025) } diff --git a/spec/models/validations/date_validations_spec.rb b/spec/models/validations/date_validations_spec.rb index 626093e89..59fc94f12 100644 --- a/spec/models/validations/date_validations_spec.rb +++ b/spec/models/validations/date_validations_spec.rb @@ -1,6 +1,8 @@ require "rails_helper" RSpec.describe Validations::DateValidations do + include CollectionTimeHelper + subject(:date_validator) { validator_class.new } let(:validator_class) { Class.new { include Validations::DateValidations } } @@ -54,44 +56,22 @@ RSpec.describe Validations::DateValidations do expect(record.errors["mrcdate"]).to be_empty end - context "with 2024 logs or earlier" do - it "cannot be more than 10 years before the tenancy start date" do - record.startdate = Time.zone.local(2024, 4, 1) - record.mrcdate = Time.zone.local(2014, 1, 31) - date_validator.validate_property_major_repairs(record) - expect(record.errors["mrcdate"]) - .to include(match I18n.t("validations.lettings.date.mrcdate.ten_years_before_tenancy_start")) - expect(record.errors["startdate"]) - .to include(match I18n.t("validations.lettings.date.startdate.ten_years_after_mrc_date")) - end - - it "must be within 10 years of the tenancy start date" do - record.startdate = Time.zone.local(2024, 2, 1) - record.mrcdate = Time.zone.local(2014, 2, 1) - date_validator.validate_property_major_repairs(record) - expect(record.errors["mrcdate"]).to be_empty - expect(record.errors["startdate"]).to be_empty - end + it "cannot be more than 20 years before the tenancy start date" do + record.startdate = current_collection_start_date + record.mrcdate = current_collection_start_date - 20.years - 1.day + date_validator.validate_property_major_repairs(record) + expect(record.errors["mrcdate"]) + .to include(match I18n.t("validations.lettings.date.mrcdate.twenty_years_before_tenancy_start")) + expect(record.errors["startdate"]) + .to include(match I18n.t("validations.lettings.date.startdate.twenty_years_after_mrc_date")) end - context "with 2025 logs or later" do - it "cannot be more than 20 years before the tenancy start date" do - record.startdate = Time.zone.local(2026, 2, 1) - record.mrcdate = Time.zone.local(2006, 1, 31) - date_validator.validate_property_major_repairs(record) - expect(record.errors["mrcdate"]) - .to include(match I18n.t("validations.lettings.date.mrcdate.twenty_years_before_tenancy_start")) - expect(record.errors["startdate"]) - .to include(match I18n.t("validations.lettings.date.startdate.twenty_years_after_mrc_date")) - end - - it "must be within 20 years of the tenancy start date" do - record.startdate = Time.zone.local(2026, 2, 1) - record.mrcdate = Time.zone.local(2006, 2, 1) - date_validator.validate_property_major_repairs(record) - expect(record.errors["mrcdate"]).to be_empty - expect(record.errors["startdate"]).to be_empty - end + it "can be within 20 years of the tenancy start date" do + record.startdate = current_collection_start_date + record.mrcdate = current_collection_start_date - 20.years + date_validator.validate_property_major_repairs(record) + expect(record.errors["mrcdate"]).to be_empty + expect(record.errors["startdate"]).to be_empty end context "when reason for vacancy is first let of property" do @@ -148,45 +128,23 @@ RSpec.describe Validations::DateValidations do expect(record.errors["voiddate"]).to be_empty end - context "with 2024 logs or earlier" do - it "cannot be more than 10 years before the tenancy start date" do - record.startdate = Time.zone.local(2024, 4, 1) - record.voiddate = Time.zone.local(2014, 1, 31) - date_validator.validate_property_void_date(record) - expect(record.errors["voiddate"]) - .to include(match I18n.t("validations.lettings.date.void_date.ten_years_before_tenancy_start")) - expect(record.errors["startdate"]) - .to include(match I18n.t("validations.lettings.date.startdate.ten_years_after_void_date")) - end - - it "must be within 10 years of the tenancy start date" do - record.startdate = Time.zone.local(2024, 2, 1) - record.voiddate = Time.zone.local(2014, 2, 1) - date_validator.validate_property_void_date(record) - expect(record.errors["voiddate"]).to be_empty - expect(record.errors["startdate"]).to be_empty - end + it "cannot be more than 20 years before the tenancy start date" do + record.startdate = current_collection_start_date + record.voiddate = current_collection_start_date - 20.years - 1.day + date_validator.validate_property_void_date(record) + date_validator.validate_startdate(record) + expect(record.errors["voiddate"]) + .to include(match I18n.t("validations.lettings.date.void_date.twenty_years_before_tenancy_start")) + expect(record.errors["startdate"]) + .to include(match I18n.t("validations.lettings.date.startdate.twenty_years_after_void_date")) end - context "with 2025 logs or later" do - it "cannot be more than 20 years before the tenancy start date" do - record.startdate = Time.zone.local(2026, 2, 1) - record.voiddate = Time.zone.local(2006, 1, 31) - date_validator.validate_property_void_date(record) - date_validator.validate_startdate(record) - expect(record.errors["voiddate"]) - .to include(match I18n.t("validations.lettings.date.void_date.twenty_years_before_tenancy_start")) - expect(record.errors["startdate"]) - .to include(match I18n.t("validations.lettings.date.startdate.twenty_years_after_void_date")) - end - - it "must be within 20 years of the tenancy start date" do - record.startdate = Time.zone.local(2026, 2, 1) - record.voiddate = Time.zone.local(2006, 2, 1) - date_validator.validate_property_void_date(record) - expect(record.errors["voiddate"]).to be_empty - expect(record.errors["startdate"]).to be_empty - end + it "can be within 20 years of the tenancy start date" do + record.startdate = current_collection_start_date + record.voiddate = current_collection_start_date - 20.years + date_validator.validate_property_void_date(record) + expect(record.errors["voiddate"]).to be_empty + expect(record.errors["startdate"]).to be_empty end context "when major repairs have been carried out" do diff --git a/spec/models/validations/sales/soft_validations_spec.rb b/spec/models/validations/sales/soft_validations_spec.rb index 0f8ff16c4..e2cd26f47 100644 --- a/spec/models/validations/sales/soft_validations_spec.rb +++ b/spec/models/validations/sales/soft_validations_spec.rb @@ -30,57 +30,8 @@ RSpec.describe Validations::Sales::SoftValidations do expect(record).not_to be_income2_outside_soft_range_for_ecstat end - context "when log year is before 2025" do - let(:record) { build(:sales_log, saledate: Time.zone.local(2024, 12, 25)) } - - it "does not trigger for low income1 if ecstat1 has no soft min" do - record.income1 = 50 - record.ecstat1 = 4 - expect(record).not_to be_income1_outside_soft_range_for_ecstat - end - - it "returns true if income1 is below soft min for ecstat1" do - record.income1 = 4500 - record.ecstat1 = 1 - expect(record).to be_income1_outside_soft_range_for_ecstat - end - - it "returns false if income1 is >= soft min for ecstat1" do - record.income1 = 1500 - record.ecstat1 = 2 - expect(record).not_to be_income1_outside_soft_range_for_ecstat - end - - it "does not trigger for income2 if ecstat2 has no soft min" do - record.income2 = 50 - record.ecstat2 = 8 - expect(record).not_to be_income2_outside_soft_range_for_ecstat - end - - it "returns true if income2 is below soft min for ecstat2" do - record.income2 = 999 - record.ecstat2 = 3 - expect(record).to be_income2_outside_soft_range_for_ecstat - end - - it "returns false if income2 is >= soft min for ecstat2" do - record.income2 = 2500 - record.ecstat2 = 5 - expect(record).not_to be_income2_outside_soft_range_for_ecstat - end - - it "does not trigger for being over maxima" do - record.ecstat1 = 1 - record.income1 = 200_000 - record.ecstat2 = 2 - record.income2 = 100_000 - expect(record).not_to be_income1_outside_soft_range_for_ecstat - expect(record).not_to be_income2_outside_soft_range_for_ecstat - end - end - context "when log year is 2025" do - let(:record) { build(:sales_log, saledate: Time.zone.local(2025, 12, 25)) } + let(:record) { build(:sales_log, saledate: collection_start_date_for_year(2025)) } it "returns true if income1 is below soft min for ecstat1" do record.income1 = 13_399 diff --git a/spec/requests/collection_resources_controller_spec.rb b/spec/requests/collection_resources_controller_spec.rb index bc7468213..a7d9e301a 100644 --- a/spec/requests/collection_resources_controller_spec.rb +++ b/spec/requests/collection_resources_controller_spec.rb @@ -734,7 +734,7 @@ RSpec.describe CollectionResourcesController, type: :request do end describe "GET #edit_additional_collection_resource" do - let(:collection_resource) { create(:collection_resource, :additional, year: 2025, log_type: "sales", short_display_name: "additional resource", download_filename: "additional.pdf") } + let(:collection_resource) { create(:collection_resource, :additional, year: current_collection_start_year, log_type: "sales", short_display_name: "additional resource", download_filename: "additional.pdf") } context "when user is not signed in" do it "redirects to the sign in page" do @@ -773,7 +773,7 @@ RSpec.describe CollectionResourcesController, type: :request do let(:user) { create(:user, :support) } before do - allow(Time.zone).to receive(:today).and_return(Time.zone.local(2025, 1, 8)) + allow(Time.zone).to receive(:today).and_return(current_collection_after_crossover_start_date) allow(user).to receive(:need_two_factor_authentication?).and_return(false) sign_in user end @@ -786,7 +786,7 @@ RSpec.describe CollectionResourcesController, type: :request do it "displays update collection resources page content" do get collection_resource_edit_path(collection_resource) - expect(page).to have_content("Sales 2025 to 2026") + expect(page).to have_content("Sales #{current_collection_start_year} to #{current_collection_end_year}") expect(page).to have_content("Change the additional resource") expect(page).to have_content("This file will be available for all users to download.") expect(page).to have_content("Upload file") diff --git a/spec/services/csv/lettings_log_csv_service_spec.rb b/spec/services/csv/lettings_log_csv_service_spec.rb index 0b4396b9e..f2fd786c6 100644 --- a/spec/services/csv/lettings_log_csv_service_spec.rb +++ b/spec/services/csv/lettings_log_csv_service_spec.rb @@ -2,6 +2,8 @@ require "rails_helper" require "rake" RSpec.describe Csv::LettingsLogCsvService do + include CollectionTimeHelper + subject(:task) { Rake::Task["data_import:add_variable_definitions"] } before do @@ -16,7 +18,7 @@ RSpec.describe Csv::LettingsLogCsvService do let(:user) { create(:user, :support, email: "s.port@jeemayle.com") } let(:service) { described_class.new(user:, export_type:, year:) } let(:export_type) { "labels" } - let(:year) { 2024 } + let(:year) { current_collection_start_year } let(:csv) { CSV.parse(service.prepare_csv(LettingsLog.where(id: logs.map(&:id)))) } let(:logs) { [log] } let(:definition_line) { csv.first } @@ -582,199 +584,6 @@ RSpec.describe Csv::LettingsLogCsvService do end end end - - context "when the requested log year is 2024" do - let(:year) { 2024 } - let(:organisation) { create(:organisation, provider_type: "LA", name: "MHCLG") } - let(:log) do - create( - :lettings_log, - :ignore_validation_errors, - created_by: user, - assigned_to: user, - created_at: Time.zone.local(2024, 4, 1), - updated_at: Time.zone.local(2024, 4, 1), - owning_organisation: organisation, - managing_organisation: organisation, - needstype: 1, - renewal: 0, - startdate: Time.zone.local(2024, 4, 1), - rent_type: 1, - tenancycode: "HIJKLMN", - propcode: "ABCDEFG", - declaration: 1, - address_line1: "Address line 1", - town_or_city: "London", - postcode_full: "NW9 5LL", - la: "E09000003", - is_la_inferred: false, - address_line1_as_entered: "address line 1 as entered", - address_line2_as_entered: "address line 2 as entered", - town_or_city_as_entered: "town or city as entered", - county_as_entered: "county as entered", - postcode_full_as_entered: "AB1 2CD", - la_as_entered: "la as entered", - first_time_property_let_as_social_housing: 0, - unitletas: 2, - rsnvac: 6, - unittype_gn: 7, - builtype: 1, - wchair: 1, - beds: 3, - voiddate: Time.zone.local(2024, 3, 30), - majorrepairs: 1, - mrcdate: Time.zone.local(2024, 3, 31), - joint: 3, - startertenancy: 1, - tenancy: 4, - tenancylength: 2, - hhmemb: 4, - age1_known: 0, - age1: 35, - sex1: "F", - ethnic_group: 0, - ethnic: 2, - nationality_all: 36, - ecstat1: 0, - details_known_2: 0, - relat2: "P", - age2_known: 0, - age2: 32, - sex2: "M", - ecstat2: 6, - details_known_3: 1, - details_known_4: 0, - relat4: "R", - age4_known: 1, - sex4: "R", - ecstat4: 10, - armedforces: 1, - leftreg: 4, - reservist: 1, - preg_occ: 2, - housingneeds: 1, - housingneeds_type: 0, - housingneeds_a: 1, - housingneeds_b: 0, - housingneeds_c: 0, - housingneeds_f: 0, - housingneeds_g: 0, - housingneeds_h: 0, - housingneeds_other: 0, - illness: 1, - illness_type_1: 0, - illness_type_2: 1, - illness_type_3: 0, - illness_type_4: 0, - illness_type_5: 0, - illness_type_6: 0, - illness_type_7: 0, - illness_type_8: 0, - illness_type_9: 0, - illness_type_10: 0, - layear: 2, - waityear: 7, - reason: 4, - prevten: 6, - homeless: 1, - ppcodenk: 1, - ppostcode_full: "TN23 6LZ", - previous_la_known: 1, - prevloc: "E07000105", - reasonpref: 1, - rp_homeless: 0, - rp_insan_unsat: 1, - rp_medwel: 0, - rp_hardship: 0, - rp_dontknow: 0, - cbl: 0, - chr: 1, - cap: 0, - accessible_register: 0, - referral: 2, - net_income_known: 0, - incref: 0, - incfreq: 1, - earnings: 268, - hb: 6, - has_benefits: 1, - benefits: 1, - period: 2, - brent: 200, - scharge: 50, - pscharge: 40, - supcharg: 35, - tcharge: 325, - hbrentshortfall: 1, - tshortfall_known: 1, - tshortfall: 12, - ) - end - - context "when exporting with human readable labels" do - let(:export_type) { "labels" } - - context "when the current user is a support user" do - let(:user) { create(:user, :support, organisation:, email: "s.port@jeemayle.com") } - - it "exports the CSV with 2024 ordering and all values correct" do - expected_content = CSV.read("spec/fixtures/files/lettings_log_csv_export_labels_24.csv") - values_to_delete = %w[id] - values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil - end - expect(csv).to eq expected_content - end - end - - context "when the current user is not a support user" do - let(:user) { create(:user, :data_provider, organisation:, email: "choreographer@owtluk.com") } - - it "exports the CSV with all values correct" do - expected_content = CSV.read("spec/fixtures/files/lettings_log_csv_export_non_support_labels_24.csv") - values_to_delete = %w[id] - values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil - end - expect(csv).to eq expected_content - end - end - end - - context "when exporting values as codes" do - let(:export_type) { "codes" } - - context "when the current user is a support user" do - let(:user) { create(:user, :support, organisation:, email: "s.port@jeemayle.com") } - - it "exports the CSV with all values correct" do - expected_content = CSV.read("spec/fixtures/files/lettings_log_csv_export_codes_24.csv") - values_to_delete = %w[id] - values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil - end - expect(csv).to eq expected_content - end - end - - context "when the current user is not a support user" do - let(:user) { create(:user, :data_provider, organisation:, email: "choreographer@owtluk.com") } - - it "exports the CSV with all values correct" do - expected_content = CSV.read("spec/fixtures/files/lettings_log_csv_export_non_support_codes_24.csv") - values_to_delete = %w[id] - values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil - end - expect(csv).to eq expected_content - end - end - end - end end end end From 47c47ae85536079c9fa9373d0194482d75c2ec1c Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis <94526761+natdeanlewissoftwire@users.noreply.github.com> Date: Tue, 7 Apr 2026 17:07:32 +0100 Subject: [PATCH 06/21] CLDC-4338: remove test logs button on staging (#3290) --- app/services/feature_toggle.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/feature_toggle.rb b/app/services/feature_toggle.rb index 39fe22f1f..2f301294c 100644 --- a/app/services/feature_toggle.rb +++ b/app/services/feature_toggle.rb @@ -28,7 +28,7 @@ class FeatureToggle end def self.create_test_logs_enabled? - Rails.env.development? || Rails.env.review? || Rails.env.staging? + Rails.env.development? || Rails.env.review? end def self.sales_export_enabled? From 8d7d12116f91cd36fd4d95e33a49017da4e246c0 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Thu, 9 Apr 2026 09:44:10 +0100 Subject: [PATCH 07/21] CLDC-4304: Update person known page copy for 2026 (#3278) to account for this question now being total person count --- app/views/form/headers/_person_2_known_page.erb | 6 +++++- app/views/form/headers/_person_3_known_page.erb | 6 +++++- app/views/form/headers/_person_4_known_page.erb | 6 +++++- app/views/form/headers/_person_5_known_page.erb | 6 +++++- app/views/form/headers/_person_6_known_page.erb | 6 +++++- 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/app/views/form/headers/_person_2_known_page.erb b/app/views/form/headers/_person_2_known_page.erb index b179fcdb8..734a5383f 100644 --- a/app/views/form/headers/_person_2_known_page.erb +++ b/app/views/form/headers/_person_2_known_page.erb @@ -1 +1,5 @@ -You have given us the details for 0 of the <%= log.hholdcount %> other people in the household +<% if log.form.start_year_2026_or_later? %> + You have given us the details for 1 of the <%= log.hholdcount %> people in the household +<% else %> + You have given us the details for 0 of the <%= log.hholdcount %> other people in the household +<% end %> diff --git a/app/views/form/headers/_person_3_known_page.erb b/app/views/form/headers/_person_3_known_page.erb index 678db7c27..3efe7f926 100644 --- a/app/views/form/headers/_person_3_known_page.erb +++ b/app/views/form/headers/_person_3_known_page.erb @@ -1 +1,5 @@ -You have given us the details for <%= log.joint_purchase? ? 0 : 1 %> of the <%= log.hholdcount %> other people in the household +<% if log.form.start_year_2026_or_later? %> + You have given us the details for 2 of the <%= log.hholdcount %> people in the household +<% else %> + You have given us the details for <%= log.joint_purchase? ? 0 : 1 %> of the <%= log.hholdcount %> other people in the household +<% end %> diff --git a/app/views/form/headers/_person_4_known_page.erb b/app/views/form/headers/_person_4_known_page.erb index 5b82c4776..1ef9ba254 100644 --- a/app/views/form/headers/_person_4_known_page.erb +++ b/app/views/form/headers/_person_4_known_page.erb @@ -1 +1,5 @@ -You have given us the details for <%= log.joint_purchase? ? 1 : 2 %> of the <%= log.hholdcount %> other people in the household +<% if log.form.start_year_2026_or_later? %> + You have given us the details for 3 of the <%= log.hholdcount %> people in the household +<% else %> + You have given us the details for <%= log.joint_purchase? ? 1 : 2 %> of the <%= log.hholdcount %> other people in the household +<% end %> diff --git a/app/views/form/headers/_person_5_known_page.erb b/app/views/form/headers/_person_5_known_page.erb index 5d53e86be..52e05ea27 100644 --- a/app/views/form/headers/_person_5_known_page.erb +++ b/app/views/form/headers/_person_5_known_page.erb @@ -1 +1,5 @@ -You have given us the details for <%= log.joint_purchase? ? 2 : 3 %> of the <%= log.hholdcount %> other people in the household +<% if log.form.start_year_2026_or_later? %> + You have given us the details for 4 of the <%= log.hholdcount %> people in the household +<% else %> + You have given us the details for <%= log.joint_purchase? ? 2 : 3 %> of the <%= log.hholdcount %> other people in the household +<% end %> diff --git a/app/views/form/headers/_person_6_known_page.erb b/app/views/form/headers/_person_6_known_page.erb index 96cc94fd3..c07727f3d 100644 --- a/app/views/form/headers/_person_6_known_page.erb +++ b/app/views/form/headers/_person_6_known_page.erb @@ -1 +1,5 @@ -You have given us the details for <%= log.joint_purchase? ? 3 : 4 %> of the <%= log.hholdcount %> other people in the household +<% if log.form.start_year_2026_or_later? %> + You have given us the details for 5 of the <%= log.hholdcount %> people in the household +<% else %> + You have given us the details for <%= log.joint_purchase? ? 3 : 4 %> of the <%= log.hholdcount %> other people in the household +<% end %> From b8915c499f8f73db47442e9015fbbe8a5279f5cf Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Thu, 9 Apr 2026 09:44:49 +0100 Subject: [PATCH 08/21] CLDC-4356: Add hyphen to builtype Purpose-built (#3284) * CLDC-4356: Add hyphen to builtype Purpose-built in lettings * CLDC-4356: Add hyphen to building type Purpose-built in sales * CLDC-4356: Update CSV export tests * CLDC-4356: Update model tests --- app/models/form/lettings/questions/builtype.rb | 2 +- app/models/form/sales/questions/property_building_type.rb | 2 +- spec/fixtures/files/lettings_log_csv_export_labels_23.csv | 2 +- spec/fixtures/files/lettings_log_csv_export_labels_24.csv | 2 +- spec/fixtures/files/lettings_log_csv_export_labels_25.csv | 2 +- .../files/lettings_log_csv_export_non_support_labels_23.csv | 2 +- .../files/lettings_log_csv_export_non_support_labels_24.csv | 2 +- .../files/lettings_log_csv_export_non_support_labels_25.csv | 2 +- spec/fixtures/files/sales_logs_csv_export_labels_24.csv | 2 +- spec/fixtures/files/sales_logs_csv_export_labels_25.csv | 2 +- spec/fixtures/files/sales_logs_csv_export_labels_26.csv | 2 +- .../files/sales_logs_csv_export_non_support_labels_24.csv | 2 +- .../files/sales_logs_csv_export_non_support_labels_25.csv | 2 +- .../files/sales_logs_csv_export_non_support_labels_26.csv | 2 +- spec/models/form/sales/questions/property_building_type_spec.rb | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/models/form/lettings/questions/builtype.rb b/app/models/form/lettings/questions/builtype.rb index 55f76536c..205970cec 100644 --- a/app/models/form/lettings/questions/builtype.rb +++ b/app/models/form/lettings/questions/builtype.rb @@ -9,7 +9,7 @@ class Form::Lettings::Questions::Builtype < ::Form::Question ANSWER_OPTIONS = { "2" => { "value" => "Converted from previous residential or non-residential property" }, - "1" => { "value" => "Purpose built" }, + "1" => { "value" => "Purpose-built" }, }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 20, 2024 => 20, 2025 => 20 }.freeze diff --git a/app/models/form/sales/questions/property_building_type.rb b/app/models/form/sales/questions/property_building_type.rb index a1bc3a7d8..25e07bfa7 100644 --- a/app/models/form/sales/questions/property_building_type.rb +++ b/app/models/form/sales/questions/property_building_type.rb @@ -9,7 +9,7 @@ class Form::Sales::Questions::PropertyBuildingType < ::Form::Question end ANSWER_OPTIONS = { - "1" => { "value" => "Purpose built" }, + "1" => { "value" => "Purpose-built" }, "2" => { "value" => "Converted from previous residential or non-residential property" }, }.freeze diff --git a/spec/fixtures/files/lettings_log_csv_export_labels_23.csv b/spec/fixtures/files/lettings_log_csv_export_labels_23.csv index 62dc32c91..40247f067 100644 --- a/spec/fixtures/files/lettings_log_csv_export_labels_23.csv +++ b/spec/fixtures/files/lettings_log_csv_export_labels_23.csv @@ -1,3 +1,3 @@ Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,The (internal) ID on the old service,The ID the users saw on the old service,Year collection period opened,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Is the UPRN known?,"If known, property's UPRN",We found an address that might be this property. Is this the property address?,Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,How many times was the property offered between becoming vacant and this letting?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,Is this letting in sheltered accommodation?,Has the tenant seen the MHCLG privacy notice?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,Which of these best describes the lead tenant's gender identity?,What is the lead tenant's ethnic group?,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant's nationality?,Which of these best describes the lead tenant's working situation?,Are the details of tenant 2 known?,What is person 2's relationship to the lead tenant?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,Are the details of tenant 3 known?,What is person 3's relationship to the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,Are the details of tenant 4 known?,What is person 4's relationship to the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,Are the details of tenant 5 known?,What is person 5's relationship to the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,Are the details of tenant 6 known?,What is person 6's relationship to the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,Are the details of tenant 7 known?,What is person 7's relationship to the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,Are the details of tenant 8 known?,What is person 8's relationship to the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Was the local authority of the household's last settled home known?,The internal value to indicate if the previous LA was inferred from the postcode,Previous location LA name,Previous location's ONS LA Code,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",What was the source of referral for this letting?,"The following soft validation was confirmed: Are you sure? This is a general needs log, and this referral type is for supported housing.",Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,Is this accommodation a care home?,"If this is a care home, how much does the household pay every [time period]?",Weekly care home charge,Populated when the soft validation and confirmed in the service,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,old_id,old_form_id,collection_start_year,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,uprn_known,uprn,uprn_confirmed,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,offered,unittype_gn,builtype,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,joint,startertenancy,tenancy,tenancyother,tenancylength,sheltered,declaration,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sex1,ethnic_group,ethnic,national,ecstat1,details_known_2,relat2,age2,sex2,ecstat2,details_known_3,relat3,age3,sex3,ecstat3,details_known_4,relat4,age4,sex4,ecstat4,details_known_5,relat5,age5,sex5,ecstat5,details_known_6,relat6,age6,sex6,ecstat6,details_known_7,relat7,age7,sex7,ecstat7,details_known_8,relat8,age8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,prevten,homeless,ppcodenk,ppostcode_full,previous_la_known,is_previous_la_inferred,prevloc_label,prevloc,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,letting_allocation_none,referral,referral_value_check,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,is_carehome,chcharge,wchchrg,carehome_charges_value_check,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate -,completed,,s.port@jeemayle.com,s.port@jeemayle.com,false,2023-11-26T00:00:00+00:00,,2023-11-26T00:00:00+00:00,single log,,,2023,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2023-11-26,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,No,,,Address line 1,,London,,NW9 5LL,No,Barnet,E09000003,No,Affordable rent basis,Tenant abandoned property,No,2,House,Purpose built,Yes,3,2023-11-24,1,,Yes,2023-11-25,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,,Yes,4,,Yes,4,0,0,2,35,,Female,White,Irish,Tenant prefers not to say,Other,Yes,Partner,32,Male,Not seeking work,No,Prefers not to say,Not known,Prefers not to say,Prefers not to say,Yes,Person prefers not to say,Not known,Person prefers not to say,Person prefers not to say,,,,,,,,,,,,,,,,,,,,,Yes – the person is a current or former regular,No – they left up to and including 5 years ago,Yes,No,Yes,Fully wheelchair accessible housing,Yes,No,No,No,No,No,No,Yes,No,No,Yes,No,No,No,No,No,No,No,Less than 1 year,1 year but under 2 years,Loss of tied accommodation,,Other supported housing,No,Yes,TN23 6LZ,Yes,No,Ashford,E07000105,Yes,,Yes,,,,No,No,Yes,No,Tenant applied directly (no referral or nomination),,Yes,No,Weekly,268,,Universal Credit housing element,Yes,All,,,Every 2 weeks,,,,,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,Yes,Yes,12.0,6.0,,,,,,,,,,,,,,,,,,,, +,completed,,s.port@jeemayle.com,s.port@jeemayle.com,false,2023-11-26T00:00:00+00:00,,2023-11-26T00:00:00+00:00,single log,,,2023,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2023-11-26,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,No,,,Address line 1,,London,,NW9 5LL,No,Barnet,E09000003,No,Affordable rent basis,Tenant abandoned property,No,2,House,Purpose-built,Yes,3,2023-11-24,1,,Yes,2023-11-25,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,,Yes,4,,Yes,4,0,0,2,35,,Female,White,Irish,Tenant prefers not to say,Other,Yes,Partner,32,Male,Not seeking work,No,Prefers not to say,Not known,Prefers not to say,Prefers not to say,Yes,Person prefers not to say,Not known,Person prefers not to say,Person prefers not to say,,,,,,,,,,,,,,,,,,,,,Yes – the person is a current or former regular,No – they left up to and including 5 years ago,Yes,No,Yes,Fully wheelchair accessible housing,Yes,No,No,No,No,No,No,Yes,No,No,Yes,No,No,No,No,No,No,No,Less than 1 year,1 year but under 2 years,Loss of tied accommodation,,Other supported housing,No,Yes,TN23 6LZ,Yes,No,Ashford,E07000105,Yes,,Yes,,,,No,No,Yes,No,Tenant applied directly (no referral or nomination),,Yes,No,Weekly,268,,Universal Credit housing element,Yes,All,,,Every 2 weeks,,,,,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,Yes,Yes,12.0,6.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_labels_24.csv b/spec/fixtures/files/lettings_log_csv_export_labels_24.csv index 8a538b0d8..0291915d3 100644 --- a/spec/fixtures/files/lettings_log_csv_export_labels_24.csv +++ b/spec/fixtures/files/lettings_log_csv_export_labels_24.csv @@ -1,3 +1,3 @@ Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is the UPRN known?,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,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,Is this letting in sheltered accommodation?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,Which of these best describes the lead tenant's gender identity?,What is the lead tenant's ethnic group?,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant's nationality?,Which of these best describes the lead tenant's working situation?,Are the details of tenant 2 known?,What is person 2's relationship to the lead tenant?,"The following soft validation was confirmed: You said that [person X]'s relationship to lead tenant is partner, and that their age is [AGEX]. Are you sure this is correct?",The following soft validation was confirmed: You said that more than one person in the household is the partner of the lead tenant. Are you sure this is correct?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,Are the details of tenant 3 known?,What is person 3's relationship to the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,Are the details of tenant 4 known?,What is person 4's relationship to the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,Are the details of tenant 5 known?,What is person 5's relationship to the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,Are the details of tenant 6 known?,What is person 6's relationship to the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,Are the details of tenant 7 known?,What is person 7's relationship to the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,Are the details of tenant 8 known?,What is person 8's relationship to the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",The soft validation was confirmed,Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Was the local authority of the household's last settled home known?,The internal value to indicate if the previous LA was inferred from the postcode,Previous location LA name,Previous location's ONS LA Code,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,Was the letting made under the Accessible Register?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",What was the source of referral for this letting?,"The following soft validation was confirmed: Are you sure? This is a general needs log, and this referral type is for supported housing.",Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,Is this accommodation a care home?,"If this is a care home, how much does the household pay every [time period]?",Weekly care home charge,Populated when the soft validation and confirmed in the service,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,uprn,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,uprn_known,uprn_selection,address_search_value_check,address_line1_input,postcode_full_input,address_line1_as_entered,address_line2_as_entered,town_or_city_as_entered,county_as_entered,postcode_full_as_entered,la_as_entered,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,unittype_gn,builtype,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,joint,startertenancy,tenancy,tenancyother,tenancylength,sheltered,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sex1,ethnic_group,ethnic,nationality_all,ecstat1,details_known_2,relat2,partner_under_16_value_check,multiple_partners_value_check,age2,sex2,ecstat2,details_known_3,relat3,age3,sex3,ecstat3,details_known_4,relat4,age4,sex4,ecstat4,details_known_5,relat5,age5,sex5,ecstat5,details_known_6,relat6,age6,sex6,ecstat6,details_known_7,relat7,age7,sex7,ecstat7,details_known_8,relat8,age8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,reasonother_value_check,prevten,homeless,ppcodenk,ppostcode_full,previous_la_known,is_previous_la_inferred,prevloc_label,prevloc,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,accessible_register,letting_allocation_none,referral,referral_value_check,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,is_carehome,chcharge,wchchrg,carehome_charges_value_check,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate -,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2024-04-01T00:00:00+01:00,,2024-04-01T00:00:00+01:00,single log,2024,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2024-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,,Address line 1,,London,,NW9 5LL,No,Barnet,E09000003,No,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,No,Affordable rent basis,Tenant abandoned property,No,House,Purpose built,Yes,3,2024-03-30,1,,Yes,2024-03-31,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,,4,,Yes,4,0,0,2,35,,Female,White,Irish,Australia,Other,Yes,Partner,,,32,Male,Not seeking work,No,Prefers not to say,Not known,Prefers not to say,Prefers not to say,Yes,Person prefers not to say,Not known,Person prefers not to say,Person prefers not to say,,,,,,,,,,,,,,,,,,,,,Yes – the person is a current or former regular,No – they left up to and including 5 years ago,Yes,No,Yes,Fully wheelchair accessible housing,Yes,No,No,No,No,No,No,Yes,No,No,Yes,No,No,No,No,No,No,No,Less than 1 year,1 year but under 2 years,Loss of tied accommodation,,,Other supported housing,No,Yes,TN23 6LZ,Yes,No,Ashford,E07000105,Yes,,Yes,,,,No,No,Yes,No,No,Tenant applied directly (no referral or nomination),,Yes,No,Weekly,268,,Universal Credit housing element,Yes,All,,,Every 2 weeks,,,,,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,Yes,Yes,12.0,6.0,,,,,,,,,,,,,,,,,,,, +,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2024-04-01T00:00:00+01:00,,2024-04-01T00:00:00+01:00,single log,2024,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2024-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,,Address line 1,,London,,NW9 5LL,No,Barnet,E09000003,No,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,No,Affordable rent basis,Tenant abandoned property,No,House,Purpose-built,Yes,3,2024-03-30,1,,Yes,2024-03-31,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,,4,,Yes,4,0,0,2,35,,Female,White,Irish,Australia,Other,Yes,Partner,,,32,Male,Not seeking work,No,Prefers not to say,Not known,Prefers not to say,Prefers not to say,Yes,Person prefers not to say,Not known,Person prefers not to say,Person prefers not to say,,,,,,,,,,,,,,,,,,,,,Yes – the person is a current or former regular,No – they left up to and including 5 years ago,Yes,No,Yes,Fully wheelchair accessible housing,Yes,No,No,No,No,No,No,Yes,No,No,Yes,No,No,No,No,No,No,No,Less than 1 year,1 year but under 2 years,Loss of tied accommodation,,,Other supported housing,No,Yes,TN23 6LZ,Yes,No,Ashford,E07000105,Yes,,Yes,,,,No,No,Yes,No,No,Tenant applied directly (no referral or nomination),,Yes,No,Weekly,268,,Universal Credit housing element,Yes,All,,,Every 2 weeks,,,,,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,Yes,Yes,12.0,6.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_labels_25.csv b/spec/fixtures/files/lettings_log_csv_export_labels_25.csv index 92ed08f82..d06f25efe 100644 --- a/spec/fixtures/files/lettings_log_csv_export_labels_25.csv +++ b/spec/fixtures/files/lettings_log_csv_export_labels_25.csv @@ -1,3 +1,3 @@ Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is the UPRN known?,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,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,Which of these best describes the lead tenant's gender identity?,What is the lead tenant's ethnic group?,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant's nationality?,Which of these best describes the lead tenant's working situation?,Are the details of tenant 2 known?,What is person 2's relationship to the lead tenant?,"The following soft validation was confirmed: You said that [person X]'s relationship to lead tenant is partner, and that their age is [AGEX]. Are you sure this is correct?",The following soft validation was confirmed: You said that more than one person in the household is the partner of the lead tenant. Are you sure this is correct?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,Are the details of tenant 3 known?,What is person 3's relationship to the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,Are the details of tenant 4 known?,What is person 4's relationship to the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,Are the details of tenant 5 known?,What is person 5's relationship to the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,Are the details of tenant 6 known?,What is person 6's relationship to the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,Are the details of tenant 7 known?,What is person 7's relationship to the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,Are the details of tenant 8 known?,What is person 8's relationship to the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",The soft validation was confirmed,Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Was the local authority of the household's last settled home known?,The internal value to indicate if the previous LA was inferred from the postcode,Previous location LA name,Previous location's ONS LA Code,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,Was the letting made under the Accessible Register?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",,What was the source of referral for this letting?,"The following soft validation was confirmed: Are you sure? This is a general needs log, and this referral type is for supported housing.",Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,uprn_known,uprn_selection,address_search_value_check,address_line1_input,postcode_full_input,address_line1_as_entered,address_line2_as_entered,town_or_city_as_entered,county_as_entered,postcode_full_as_entered,la_as_entered,unittype_gn,builtype,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sex1,ethnic_group,ethnic,nationality_all,ecstat1,details_known_2,relat2,partner_under_16_value_check,multiple_partners_value_check,age2,sex2,ecstat2,details_known_3,relat3,age3,sex3,ecstat3,details_known_4,relat4,age4,sex4,ecstat4,details_known_5,relat5,age5,sex5,ecstat5,details_known_6,relat6,age6,sex6,ecstat6,details_known_7,relat7,age7,sex7,ecstat7,details_known_8,relat8,age8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,reasonother_value_check,prevten,homeless,ppcodenk,ppostcode_full,previous_la_known,is_previous_la_inferred,prevloc_label,prevloc,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,accessible_register,letting_allocation_none,referral_type,referral,referral_value_check,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate -,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2025-04-01T00:00:00+01:00,,2025-04-01T00:00:00+01:00,single log,2025,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2025-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,Affordable rent basis,Tenant abandoned property,No,,Address line 1,,London,,NW9 5LL,No,Barnet,E09000003,No,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,House,Purpose built,Yes,3,2025-03-30,1,,Yes,2025-03-31,,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,4,,Yes,4,0,0,2,35,,Female,White,Irish,Australia,Other,Yes,Yes,,,32,Male,Not seeking work,No,Prefers not to say,Not known,Prefers not to say,Prefers not to say,Yes,Tenant prefers not to say,Not known,Person prefers not to say,Person prefers not to say,,,,,,,,,,,,,,,,,,,,,Yes – the person is a current or former regular,No – they left up to and including 5 years ago,Yes,No,Yes,Fully wheelchair accessible housing,Yes,No,No,No,No,No,No,Yes,No,No,Yes,No,No,No,No,No,No,No,Under 1 year,1 year but under 2 years,Loss of tied accommodation,,,Other supported housing,No,Yes,TN23 6LZ,Yes,No,Ashford,E07000105,Yes,,Yes,,,,No,No,Yes,No,No,,,,Yes,No,Weekly,268,,Universal Credit housing element,Yes,All,,,Every 2 weeks,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,Yes,Yes,12.0,6.0,,,,,,,,,,,,,,,,,,,, +,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2025-04-01T00:00:00+01:00,,2025-04-01T00:00:00+01:00,single log,2025,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2025-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,Affordable rent basis,Tenant abandoned property,No,,Address line 1,,London,,NW9 5LL,No,Barnet,E09000003,No,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,House,Purpose-built,Yes,3,2025-03-30,1,,Yes,2025-03-31,,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,4,,Yes,4,0,0,2,35,,Female,White,Irish,Australia,Other,Yes,Yes,,,32,Male,Not seeking work,No,Prefers not to say,Not known,Prefers not to say,Prefers not to say,Yes,Tenant prefers not to say,Not known,Person prefers not to say,Person prefers not to say,,,,,,,,,,,,,,,,,,,,,Yes – the person is a current or former regular,No – they left up to and including 5 years ago,Yes,No,Yes,Fully wheelchair accessible housing,Yes,No,No,No,No,No,No,Yes,No,No,Yes,No,No,No,No,No,No,No,Under 1 year,1 year but under 2 years,Loss of tied accommodation,,,Other supported housing,No,Yes,TN23 6LZ,Yes,No,Ashford,E07000105,Yes,,Yes,,,,No,No,Yes,No,No,,,,Yes,No,Weekly,268,,Universal Credit housing element,Yes,All,,,Every 2 weeks,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,Yes,Yes,12.0,6.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_non_support_labels_23.csv b/spec/fixtures/files/lettings_log_csv_export_non_support_labels_23.csv index 296073a12..7280ac2ce 100644 --- a/spec/fixtures/files/lettings_log_csv_export_non_support_labels_23.csv +++ b/spec/fixtures/files/lettings_log_csv_export_non_support_labels_23.csv @@ -1,3 +1,3 @@ Log ID,Status of log,ID of a set of duplicate logs,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Is the UPRN known?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,What is the property's local authority?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,How many times was the property offered between becoming vacant and this letting?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,Is this letting in sheltered accommodation?,Has the tenant seen the MHCLG privacy notice?,How many people live in the household at this letting?,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8",What is the lead tenant's age?,Which of these best describes the lead tenant's gender identity?,What is the lead tenant's ethnic group?,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant's nationality?,Which of these best describes the lead tenant's working situation?,What is person 2's relationship to the lead tenant?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,What is person 3's relationship to the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,What is person 4's relationship to the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,What is person 5's relationship to the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,What is person 6's relationship to the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,What is person 7's relationship to the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,What is person 8's relationship to the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Previous location LA name,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",What was the source of referral for this letting?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,Is this accommodation a care home?,"If this is a care home, how much does the household pay every [time period]?",Weekly care home charge,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge to the tenant,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Estimated outstanding amount,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? id,status,duplicate_set_id,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,uprn_known,uprn,address_line1,address_line2,town_or_city,county,postcode_full,la_label,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,offered,unittype_gn,builtype,wchair,beds,voiddate,vacdays,majorrepairs,mrcdate,joint,startertenancy,tenancy,tenancyother,tenancylength,sheltered,declaration,hhmemb,refused,age1,sex1,ethnic_group,ethnic,national,ecstat1,relat2,age2,sex2,ecstat2,relat3,age3,sex3,ecstat3,relat4,age4,sex4,ecstat4,relat5,age5,sex5,ecstat5,relat6,age6,sex6,ecstat6,relat7,age7,sex7,ecstat7,relat8,age8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,prevten,homeless,ppcodenk,ppostcode_full,prevloc_label,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,letting_allocation_none,referral,incref,incfreq,earnings,hb,has_benefits,benefits,household_charge,nocharge,period,is_carehome,chcharge,wchchrg,brent,scharge,pscharge,supcharg,tcharge,hbrentshortfall,tshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate -,completed,,choreographer@owtluk.com,false,2023-11-26T00:00:00+00:00,,2023-11-26T00:00:00+00:00,single log,2023,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2023-11-26,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,No,,Address line 1,,London,,NW9 5LL,Barnet,No,Affordable rent basis,Tenant abandoned property,No,2,House,Purpose built,Yes,3,2023-11-24,1,Yes,2023-11-25,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,,Yes,4,Yes,35,Female,White,Irish,Tenant prefers not to say,Other,Partner,32,Male,Not seeking work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,Person prefers not to say,Not known,Person prefers not to say,Person prefers not to say,,,,,,,,,,,,,,,,,Yes – the person is a current or former regular,No – they left up to and including 5 years ago,Yes,No,Yes,Fully wheelchair accessible housing,Yes,No,No,No,No,No,No,Yes,No,No,Yes,No,No,No,No,No,No,No,Less than 1 year,1 year but under 2 years,Loss of tied accommodation,,Other supported housing,No,Yes,TN23 6LZ,Ashford,Yes,,Yes,,,,No,No,Yes,No,Tenant applied directly (no referral or nomination),No,Weekly,268,Universal Credit housing element,Yes,All,,,Every 2 weeks,,,,200.0,50.0,40.0,35.0,325.0,Yes,12.0,,,,,,,,,,,,,,,,,,,, +,completed,,choreographer@owtluk.com,false,2023-11-26T00:00:00+00:00,,2023-11-26T00:00:00+00:00,single log,2023,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2023-11-26,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,No,,Address line 1,,London,,NW9 5LL,Barnet,No,Affordable rent basis,Tenant abandoned property,No,2,House,Purpose-built,Yes,3,2023-11-24,1,Yes,2023-11-25,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,,Yes,4,Yes,35,Female,White,Irish,Tenant prefers not to say,Other,Partner,32,Male,Not seeking work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,Person prefers not to say,Not known,Person prefers not to say,Person prefers not to say,,,,,,,,,,,,,,,,,Yes – the person is a current or former regular,No – they left up to and including 5 years ago,Yes,No,Yes,Fully wheelchair accessible housing,Yes,No,No,No,No,No,No,Yes,No,No,Yes,No,No,No,No,No,No,No,Less than 1 year,1 year but under 2 years,Loss of tied accommodation,,Other supported housing,No,Yes,TN23 6LZ,Ashford,Yes,,Yes,,,,No,No,Yes,No,Tenant applied directly (no referral or nomination),No,Weekly,268,Universal Credit housing element,Yes,All,,,Every 2 weeks,,,,200.0,50.0,40.0,35.0,325.0,Yes,12.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_non_support_labels_24.csv b/spec/fixtures/files/lettings_log_csv_export_non_support_labels_24.csv index 4184b90c7..c4c9a17a3 100644 --- a/spec/fixtures/files/lettings_log_csv_export_non_support_labels_24.csv +++ b/spec/fixtures/files/lettings_log_csv_export_non_support_labels_24.csv @@ -1,3 +1,3 @@ Log ID,Status of log,ID of a set of duplicate logs,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is the UPRN known?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,What is the property's local authority?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,Is this letting in sheltered accommodation?,How many people live in the household at this letting?,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8",What is the lead tenant's age?,Which of these best describes the lead tenant's gender identity?,What is the lead tenant's ethnic group?,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant's nationality?,Which of these best describes the lead tenant's working situation?,What is person 2's relationship to the lead tenant?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,What is person 3's relationship to the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,What is person 4's relationship to the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,What is person 5's relationship to the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,What is person 6's relationship to the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,What is person 7's relationship to the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,What is person 8's relationship to the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Previous location LA name,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,Was the letting made under the Accessible Register?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",What was the source of referral for this letting?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,Is this accommodation a care home?,"If this is a care home, how much does the household pay every [time period]?",Weekly care home charge,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge to the tenant,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Estimated outstanding amount,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? id,status,duplicate_set_id,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,uprn_known,uprn,address_line1,address_line2,town_or_city,county,postcode_full,la_label,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,unittype_gn,builtype,wchair,beds,voiddate,vacdays,majorrepairs,mrcdate,joint,startertenancy,tenancy,tenancyother,tenancylength,sheltered,hhmemb,refused,age1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,relat2,age2,sex2,ecstat2,relat3,age3,sex3,ecstat3,relat4,age4,sex4,ecstat4,relat5,age5,sex5,ecstat5,relat6,age6,sex6,ecstat6,relat7,age7,sex7,ecstat7,relat8,age8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,prevten,homeless,ppcodenk,ppostcode_full,prevloc_label,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,accessible_register,letting_allocation_none,referral,incref,incfreq,earnings,hb,has_benefits,benefits,household_charge,nocharge,period,is_carehome,chcharge,wchchrg,brent,scharge,pscharge,supcharg,tcharge,hbrentshortfall,tshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate -,in_progress,,choreographer@owtluk.com,false,2024-04-01T00:00:00+01:00,,2024-04-01T00:00:00+01:00,single log,2024,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2024-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,,Address line 1,,London,,NW9 5LL,Barnet,No,Affordable rent basis,Tenant abandoned property,No,House,Purpose built,Yes,3,2024-03-30,1,Yes,2024-03-31,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,,4,Yes,35,Female,White,Irish,Australia,Other,Partner,32,Male,Not seeking work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,Person prefers not to say,Not known,Person prefers not to say,Person prefers not to say,,,,,,,,,,,,,,,,,Yes – the person is a current or former regular,No – they left up to and including 5 years ago,Yes,No,Yes,Fully wheelchair accessible housing,Yes,No,No,No,No,No,No,Yes,No,No,Yes,No,No,No,No,No,No,No,Less than 1 year,1 year but under 2 years,Loss of tied accommodation,,Other supported housing,No,Yes,TN23 6LZ,Ashford,Yes,,Yes,,,,No,No,Yes,No,No,Tenant applied directly (no referral or nomination),No,Weekly,268,Universal Credit housing element,Yes,All,,,Every 2 weeks,,,,200.0,50.0,40.0,35.0,325.0,Yes,12.0,,,,,,,,,,,,,,,,,,,, +,in_progress,,choreographer@owtluk.com,false,2024-04-01T00:00:00+01:00,,2024-04-01T00:00:00+01:00,single log,2024,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2024-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,,Address line 1,,London,,NW9 5LL,Barnet,No,Affordable rent basis,Tenant abandoned property,No,House,Purpose-built,Yes,3,2024-03-30,1,Yes,2024-03-31,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,,4,Yes,35,Female,White,Irish,Australia,Other,Partner,32,Male,Not seeking work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,Person prefers not to say,Not known,Person prefers not to say,Person prefers not to say,,,,,,,,,,,,,,,,,Yes – the person is a current or former regular,No – they left up to and including 5 years ago,Yes,No,Yes,Fully wheelchair accessible housing,Yes,No,No,No,No,No,No,Yes,No,No,Yes,No,No,No,No,No,No,No,Less than 1 year,1 year but under 2 years,Loss of tied accommodation,,Other supported housing,No,Yes,TN23 6LZ,Ashford,Yes,,Yes,,,,No,No,Yes,No,No,Tenant applied directly (no referral or nomination),No,Weekly,268,Universal Credit housing element,Yes,All,,,Every 2 weeks,,,,200.0,50.0,40.0,35.0,325.0,Yes,12.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_non_support_labels_25.csv b/spec/fixtures/files/lettings_log_csv_export_non_support_labels_25.csv index 9873aa207..59a96669f 100644 --- a/spec/fixtures/files/lettings_log_csv_export_non_support_labels_25.csv +++ b/spec/fixtures/files/lettings_log_csv_export_non_support_labels_25.csv @@ -1,3 +1,3 @@ Log ID,Status of log,ID of a set of duplicate logs,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,Is the UPRN known?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,What is the property's local authority?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8",What is the lead tenant's age?,Which of these best describes the lead tenant's gender identity?,What is the lead tenant's ethnic group?,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant's nationality?,Which of these best describes the lead tenant's working situation?,What is person 2's relationship to the lead tenant?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,What is person 3's relationship to the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,What is person 4's relationship to the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,What is person 5's relationship to the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,What is person 6's relationship to the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,What is person 7's relationship to the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,What is person 8's relationship to the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Previous location LA name,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,Was the letting made under the Accessible Register?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",,What was the source of referral for this letting?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge to the tenant,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Estimated outstanding amount,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? id,status,duplicate_set_id,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn_known,uprn,address_line1,address_line2,town_or_city,county,postcode_full,la_label,unittype_gn,builtype,wchair,beds,voiddate,vacdays,majorrepairs,mrcdate,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,refused,age1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,relat2,age2,sex2,ecstat2,relat3,age3,sex3,ecstat3,relat4,age4,sex4,ecstat4,relat5,age5,sex5,ecstat5,relat6,age6,sex6,ecstat6,relat7,age7,sex7,ecstat7,relat8,age8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,prevten,homeless,ppcodenk,ppostcode_full,prevloc_label,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,accessible_register,letting_allocation_none,referral_type,referral,incref,incfreq,earnings,hb,has_benefits,benefits,household_charge,nocharge,period,brent,scharge,pscharge,supcharg,tcharge,hbrentshortfall,tshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate -,in_progress,,choreographer@owtluk.com,false,2025-04-01T00:00:00+01:00,,2025-04-01T00:00:00+01:00,single log,2025,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2025-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,Affordable rent basis,Tenant abandoned property,No,No,,Address line 1,,London,,NW9 5LL,Barnet,House,Purpose built,Yes,3,2025-03-30,1,Yes,2025-03-31,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,4,Yes,35,Female,White,Irish,Australia,Other,Yes,32,Male,Not seeking work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,Tenant prefers not to say,Not known,Person prefers not to say,Person prefers not to say,,,,,,,,,,,,,,,,,Yes – the person is a current or former regular,No – they left up to and including 5 years ago,Yes,No,Yes,Fully wheelchair accessible housing,Yes,No,No,No,No,No,No,Yes,No,No,Yes,No,No,No,No,No,No,No,Under 1 year,1 year but under 2 years,Loss of tied accommodation,,Other supported housing,No,Yes,TN23 6LZ,Ashford,Yes,,Yes,,,,No,No,Yes,No,No,,,No,Weekly,268,Universal Credit housing element,Yes,All,,,Every 2 weeks,200.0,50.0,40.0,35.0,325.0,Yes,12.0,,,,,,,,,,,,,,,,,,,, +,in_progress,,choreographer@owtluk.com,false,2025-04-01T00:00:00+01:00,,2025-04-01T00:00:00+01:00,single log,2025,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2025-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,Affordable rent basis,Tenant abandoned property,No,No,,Address line 1,,London,,NW9 5LL,Barnet,House,Purpose-built,Yes,3,2025-03-30,1,Yes,2025-03-31,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,4,Yes,35,Female,White,Irish,Australia,Other,Yes,32,Male,Not seeking work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,Tenant prefers not to say,Not known,Person prefers not to say,Person prefers not to say,,,,,,,,,,,,,,,,,Yes – the person is a current or former regular,No – they left up to and including 5 years ago,Yes,No,Yes,Fully wheelchair accessible housing,Yes,No,No,No,No,No,No,Yes,No,No,Yes,No,No,No,No,No,No,No,Under 1 year,1 year but under 2 years,Loss of tied accommodation,,Other supported housing,No,Yes,TN23 6LZ,Ashford,Yes,,Yes,,,,No,No,Yes,No,No,,,No,Weekly,268,Universal Credit housing element,Yes,All,,,Every 2 weeks,200.0,50.0,40.0,35.0,325.0,Yes,12.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 7b2c0f183..c02f1313e 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?,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-04-01T00:00:00+01:00,2024-04-01T00:00:00+01:00,2024,single log,,false,1,4,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,1,,,,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,SW1A,1AA,Yes,E09000033,Westminster,1,1,1,1,,Don’t know,,Yes,Yes,No,Yes,Yes,Yes,13400,Yes,Yes,13400,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 +,completed,,2024-04-01T00:00:00+01:00,2024-04-01T00:00:00+01:00,2024,single log,,false,1,4,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,1,,,,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,SW1A,1AA,Yes,E09000033,Westminster,1,1,1,1,,Don’t know,,Yes,Yes,No,Yes,Yes,Yes,13400,Yes,Yes,13400,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_25.csv b/spec/fixtures/files/sales_logs_csv_export_labels_25.csv index bd43a851f..245ee6ab2 100644 --- a/spec/fixtures/files/sales_logs_csv_export_labels_25.csv +++ b/spec/fixtures/files/sales_logs_csv_export_labels_25.csv @@ -1,3 +1,3 @@ Log ID,Status of log,ID of a set of duplicate logs,Which organisation owned this property before the sale?,Which organisation owned this property before the sale? (ID),Which organisation reported the sale?,Which organisation reported the sale? (ID),Time and date the log was created,User that created the log (email),User that created the log (ID),User the log is assigned to (email),User the log is assigned to (ID),Time and date the log was last updated,User that last amended the log (email),User that last amended the log (ID),Was the log submitted in-service or via bulk upload?,ID of a set of bulk uploaded logs,Year collection period opened,Day of sale completion date,Month of sale completion date,Year of sale completion date,What is the purchaser code?,Shared or discounted ownership,Type of ownership,Is this a staircasing transaction?,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,What type of unit is the property?,How many bedrooms does the property have?,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?,Is buyer 2 or person 2 the partner of 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?",Is person 3 the partner of buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,Is person 4 the partner of buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,Is person 5 the partner of buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,Is person 6 the partner of buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,Household type,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,"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?,Is this a resale?,How long did the buyer(s) live in the property before purchasing it?,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,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 length of the mortgage in years?,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 service charges?,Monthly service charges amount,Does the property have an estate management fee?,Monthly estate management fee amount,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 the first time the shared owner has engaged in staircasing in the home?,"Including this time, how many times has the shared owner engaged in staircasing in the home?",Day of last staircasing transaction,Month of last staircasing transaction,Year of last staircasing transaction,Day of initial staircasing transaction,Month of initial staircasing transaction,Year of initial staircasing transaction,What was the basic monthly rent prior to staircasing?,"What was the amount of any loan, grant, discount or subsidy given?",What was the percentage discount?,Does this include any extra borrowing?,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 ID,STATUS,DUPLICATESET,OWNINGORGNAME,OWNINGORGID,MANINGORGNAME,MANINGORGID,CREATEDDATE,CREATEDBY,CREATEDBYID,USERNAME,USERNAMEID,UPLOADDATE,AMENDEDBY,AMENDEDBYID,CREATIONMETHOD,BULKUPLOADID,COLLECTIONYEAR,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,STAIRCASE,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,PROPTYPE,BEDS,BUILTYPE,WCHAIR,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONALITYALL1,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONALITYALL2,ECSTAT2,LIVEINBUYER2,HHOLDCOUNT,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,HHTYPE,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,RESALE,PROPLEN,HODAY,HOMONTH,HOYEAR,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTLEN1,DEPOSIT,CASHDIS,MRENT,HASSERVICECHARGES,SERVICECHARGES,HASESTATEFEE,ESTATEFEE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,FIRSTSTAIR,NUMSTAIR,STAIRLASTDAY,STAIRLASTMONTH,STAIRLASTYEAR,STAIRINITIALDAY,STAIRINITIALMONTH,STAIRINITIALYEAR,MRENTPRESTAIRCASING,GRANT,DISCOUNT,EXTRABOR,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK -,completed,,MHCLG,,MHCLG,,2025-04-01T00:00:00+01:00,billyboy@eyeklaud.com,,billyboy@eyeklaud.com,,2025-04-01T00:00:00+01:00,,,single log,,2025,1,4,2025,,Discounted Ownership,Right to Acquire (RTA),,Yes,Yes,Yes,1,1,"1, Test Street",,Test Town,,AA1 1AA,Yes,Westminster,E09000033,1,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,Flat or maisonette,2,Purpose built,Yes,30,Non-binary,Buyer prefers not to say,17,United Kingdom,Full-time – 30 hours or more per week,Yes,Yes,35,Non-binary,Buyer prefers not to say,,United Kingdom,Full-time – 30 hours or more per week,Yes,3,No,14,Non-binary,Child under 16,No,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,6,Local authority tenant,Yes,SW1A,1AA,Yes,E09000033,Westminster,Don’t know,,Yes,Yes,No,Yes,Yes,Yes,13400,Yes,Yes,13400,Yes,Don’t know ,No,,Yes,No,,10,,,,,,,110000.0,,,Yes,20000.0,10,80000.0,,,,,,,,,,,,,,,,,,,10000.0,,Yes,Yes,100.0, +,completed,,MHCLG,,MHCLG,,2025-04-01T00:00:00+01:00,billyboy@eyeklaud.com,,billyboy@eyeklaud.com,,2025-04-01T00:00:00+01:00,,,single log,,2025,1,4,2025,,Discounted Ownership,Right to Acquire (RTA),,Yes,Yes,Yes,1,1,"1, Test Street",,Test Town,,AA1 1AA,Yes,Westminster,E09000033,1,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,Flat or maisonette,2,Purpose-built,Yes,30,Non-binary,Buyer prefers not to say,17,United Kingdom,Full-time – 30 hours or more per week,Yes,Yes,35,Non-binary,Buyer prefers not to say,,United Kingdom,Full-time – 30 hours or more per week,Yes,3,No,14,Non-binary,Child under 16,No,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,6,Local authority tenant,Yes,SW1A,1AA,Yes,E09000033,Westminster,Don’t know,,Yes,Yes,No,Yes,Yes,Yes,13400,Yes,Yes,13400,Yes,Don’t know ,No,,Yes,No,,10,,,,,,,110000.0,,,Yes,20000.0,10,80000.0,,,,,,,,,,,,,,,,,,,10000.0,,Yes,Yes,100.0, diff --git a/spec/fixtures/files/sales_logs_csv_export_labels_26.csv b/spec/fixtures/files/sales_logs_csv_export_labels_26.csv index 2cf82726d..be98441fb 100644 --- a/spec/fixtures/files/sales_logs_csv_export_labels_26.csv +++ b/spec/fixtures/files/sales_logs_csv_export_labels_26.csv @@ -1,3 +1,3 @@ Log ID,Status of log,ID of a set of duplicate logs,Which organisation owned this property before the sale?,,Which organisation reported the sale?,,Time and date the log was created,User that created the log,,User the log is assigned to,,Time and date the log was last updated,,,Was the log submitted in-service or via bulk upload?,ID of a set of bulk uploaded logs,Year collection period opened,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?,Is this a staircasing transaction?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,Did you interview the buyer(s) 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,What type of unit is the property?,What is the building height classification?,How many bedrooms does the property have?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,What is buyer 1's age?,What was buyer 1's sex at birth?,Is the gender buyer 1 identifies with the same as their sex registered at birth?,"If 'No', enter 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?,What was buyer/person 2's sex at birth?,Is the gender buyer/person 2 identifies with the same as their sex registered at birth?,"If 'No', enter buyer/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?,"In total, how many people live in the property?",What is person 3's relationship to buyer 1?,What is person 3's age?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter 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 was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter 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 was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter 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 was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",What is person 6's working situation?,Household type,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,"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?,Is this a resale?,How long did the buyer(s) live in the property before purchasing it?,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,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 length of the mortgage in years?,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?,,,,,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?,,,,,,,,,,"What was the amount of any loan, grant, discount or subsidy given?",What was the percentage discount?,Does this include any extra borrowing?,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.,Will the service charge change after this staircasing transaction takes place?,What are the new total monthly service charges for the property? ID,STATUS,DUPLICATESET,OWNINGORGNAME,OWNINGORGID,MANINGORGNAME,MANINGORGID,CREATEDDATE,CREATEDBY,CREATEDBYID,USERNAME,USERNAMEID,UPLOADDATE,AMENDEDBY,AMENDEDBYID,CREATIONMETHOD,BULKUPLOADID,COLLECTIONYEAR,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,STAIRCASE,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,PROPTYPE,BUILDHEIGHTCLASS,BEDS,BUILTYPE,WCHAIR,AGE1,SEXRAB1,GENDER_SAME_AS_SEX1,GENDER_DESCRIPTION1,ETHNICGROUP1,ETHNIC,NATIONALITYALL1,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEXRAB2,GENDER_SAME_AS_SEX2,GENDER_DESCRIPTION2,ETHNICGROUP2,ETHNIC2,NATIONALITYALL2,ECSTAT2,LIVEINBUYER2,HHOLDCOUNT,RELAT3,AGE3,SEXRAB3,GENDER_SAME_AS_SEX3,GENDER_DESCRIPTION3,ECSTAT3,RELAT4,AGE4,SEXRAB4,GENDER_SAME_AS_SEX4,GENDER_DESCRIPTION4,ECSTAT4,RELAT5,AGE5,SEXRAB5,GENDER_SAME_AS_SEX5,GENDER_DESCRIPTION5,ECSTAT5,RELAT6,AGE6,SEXRAB6,GENDER_SAME_AS_SEX6,GENDER_DESCRIPTION6,ECSTAT6,HHTYPE,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,RESALE,PROPLEN,HODAY,HOMONTH,HOYEAR,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTLEN1,DEPOSIT,CASHDIS,MRENT,HASSERVICECHARGES,SERVICECHARGES,HASESTATEFEE,ESTATEFEE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,FIRSTSTAIR,NUMSTAIR,STAIRLASTDAY,STAIRLASTMONTH,STAIRLASTYEAR,STAIRINITIALDAY,STAIRINITIALMONTH,STAIRINITIALYEAR,MRENTPRESTAIRCASING,GRANT,DISCOUNT,EXTRABOR,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,HASSERVICECHARGESCHANGED,NEWSERVICECHARGES -,completed,,MHCLG,,MHCLG,,2026-04-01T00:00:00+01:00,billyboy@eyeklaud.com,,billyboy@eyeklaud.com,,2026-04-01T00:00:00+01:00,,,single log,,2026,1,4,2026,,Discounted Ownership,Right to Acquire (RTA),,Yes,Yes,Yes,1,1,"1, Test Street",,Test Town,,AA1 1AA,Yes,Westminster,E09000033,1,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,Flat or maisonette,Low-rise,2,Purpose built,Yes,30,Female,Yes,,Buyer prefers not to say,17,United Kingdom,Full-time – 30 hours or more per week,Yes,Yes,35,Male,"No, enter gender identity",Nonbinary,Buyer prefers not to say,,United Kingdom,Full-time – 30 hours or more per week,Yes,5,No,14,Female,Yes,,Child under 16,No,Not known,Prefers not to say,"No, enter gender identity",Genderfluid,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,Prefers not to say,,,,,,,6,Local authority tenant,Yes,SW1A,1AA,Yes,E09000033,Westminster,Don’t know,,Yes,Yes,No,Yes,Yes,Yes,13400,Yes,Yes,13400,Yes,Don’t know ,No,,Yes,No,,10,,,,,,,110000.0,,,Yes,20000.0,10,80000.0,,,,,,,,,,,,,,,,,,,10000.0,,Yes,Yes,100.0,,, +,completed,,MHCLG,,MHCLG,,2026-04-01T00:00:00+01:00,billyboy@eyeklaud.com,,billyboy@eyeklaud.com,,2026-04-01T00:00:00+01:00,,,single log,,2026,1,4,2026,,Discounted Ownership,Right to Acquire (RTA),,Yes,Yes,Yes,1,1,"1, Test Street",,Test Town,,AA1 1AA,Yes,Westminster,E09000033,1,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,Flat or maisonette,Low-rise,2,Purpose-built,Yes,30,Female,Yes,,Buyer prefers not to say,17,United Kingdom,Full-time – 30 hours or more per week,Yes,Yes,35,Male,"No, enter gender identity",Nonbinary,Buyer prefers not to say,,United Kingdom,Full-time – 30 hours or more per week,Yes,5,No,14,Female,Yes,,Child under 16,No,Not known,Prefers not to say,"No, enter gender identity",Genderfluid,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,Prefers not to say,,,,,,,6,Local authority tenant,Yes,SW1A,1AA,Yes,E09000033,Westminster,Don’t know,,Yes,Yes,No,Yes,Yes,Yes,13400,Yes,Yes,13400,Yes,Don’t know ,No,,Yes,No,,10,,,,,,,110000.0,,,Yes,20000.0,10,80000.0,,,,,,,,,,,,,,,,,,,10000.0,,Yes,Yes,100.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 a1390a940..b745b7089 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?,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-04-01T00:00:00+01:00,2024-04-01T00:00:00+01:00,2024,single log,,false,1,4,2024,MHCLG,MHCLG,billyboy@eyeklaud.com,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,Yes,1,1,Yes,,,1,"1, Test Street",,Test Town,,SW1A,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,SW1A,1AA,Yes,E09000033,Westminster,1,1,1,1,,Don’t know,,Yes,Yes,No,Yes,Yes,Yes,13400,Yes,Yes,13400,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 +,completed,,2024-04-01T00:00:00+01:00,2024-04-01T00:00:00+01:00,2024,single log,,false,1,4,2024,MHCLG,MHCLG,billyboy@eyeklaud.com,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,Yes,1,1,Yes,,,1,"1, Test Street",,Test Town,,SW1A,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,SW1A,1AA,Yes,E09000033,Westminster,1,1,1,1,,Don’t know,,Yes,Yes,No,Yes,Yes,Yes,13400,Yes,Yes,13400,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_25.csv b/spec/fixtures/files/sales_logs_csv_export_non_support_labels_25.csv index b0d461902..880c5ba40 100644 --- a/spec/fixtures/files/sales_logs_csv_export_non_support_labels_25.csv +++ b/spec/fixtures/files/sales_logs_csv_export_non_support_labels_25.csv @@ -1,3 +1,3 @@ Log ID,Status of log,ID of a set of duplicate logs,Which organisation owned this property before the sale?,Which organisation owned this property before the sale? (ID),Which organisation reported the sale?,Which organisation reported the sale? (ID),Time and date the log was created,User the log is assigned to (email),User the log is assigned to (ID),Time and date the log was last updated,User that last amended the log (email),User that last amended the log (ID),Was the log submitted in-service or via bulk upload?,ID of a set of bulk uploaded logs,Year collection period opened,Day of sale completion date,Month of sale completion date,Year of sale completion date,What is the purchaser code?,Shared or discounted ownership,Type of ownership,Is this a staircasing transaction?,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,What type of unit is the property?,How many bedrooms does the property have?,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?,Is buyer 2 or person 2 the partner of 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?",Is person 3 the partner of buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,Is person 4 the partner of buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,Is person 5 the partner of buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,Is person 6 the partner of buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,Household type,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,"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?,Is this a resale?,How long did the buyer(s) live in the property before purchasing it?,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,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 length of the mortgage in years?,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 service charges?,Monthly service charges amount,Does the property have an estate management fee?,Monthly estate management fee amount,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 the first time the shared owner has engaged in staircasing in the home?,"Including this time, how many times has the shared owner engaged in staircasing in the home?",Day of last staircasing transaction,Month of last staircasing transaction,Year of last staircasing transaction,Day of initial staircasing transaction,Month of initial staircasing transaction,Year of initial staircasing transaction,What was the basic monthly rent prior to staircasing?,"What was the amount of any loan, grant, discount or subsidy given?",What was the percentage discount?,Does this include any extra borrowing?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property? id,status,duplicate_set_id,owning_organisation_name,owning_organisation_id,managing_organisation_name,managing_organisation_id,created_at,assigned_to,assigned_to_id,updated_at,updated_by,updated_by_id,creation_method,bulk_upload_id,collection_start_year,day,month,year,purchid,ownershipsch,type,staircase,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,proptype,beds,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,hhtype,prevten,ppcodenk,ppostc1,ppostc2,previous_la_known,prevloc,prevloc_label,buy2living,prevtenbuy2,hhregres,hhregresstill,armedforcesspouse,disabled,wheel,income1nk,income1,inc1mort,income2nk,income2,inc2mort,hb,savingsnk,savings,prevown,prevshared,resale,proplen,hoday,homonth,hoyear,frombeds,fromprop,socprevten,value,equity,mortgageused,mortgage,mortlen,deposit,cashdis,mrent,has_servicecharges,servicecharges,has_management_fee,management_fee,stairbought,stairowned,staircasesale,firststair,numstair,stairlastday,stairlastmonth,stairlastyear,stairinitialday,stairinitialmonth,stairinitialyear,mrentprestaircasing,grant,discount,extrabor,has_mscharge,mscharge -,completed,,MHCLG,,MHCLG,,2025-04-01T00:00:00+01:00,billyboy@eyeklaud.com,,2025-04-01T00:00:00+01:00,,,single log,,2025,1,4,2025,,Discounted Ownership,Right to Acquire (RTA),,Yes,Yes,Yes,1,1,Yes,,,1,"1, Test Street",,Test Town,,SW1A,1AA,E09000033,Westminster,Flat or maisonette,2,Purpose built,Yes,30,Non-binary,Buyer prefers not to say,17,United Kingdom,Full-time – 30 hours or more per week,Yes,Yes,35,Non-binary,Buyer prefers not to say,,United Kingdom,Full-time – 30 hours or more per week,Yes,3,No,14,Non-binary,Child under 16,No,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,6,Local authority tenant,Yes,SW1A,1AA,Yes,E09000033,Westminster,Don’t know,,Yes,Yes,No,Yes,Yes,Yes,13400,Yes,Yes,13400,Yes,Don’t know ,No,,Yes,No,,10,,,,,,,110000.0,,Yes,20000.0,10,80000.0,,,,,,,,,,,,,,,,,,,10000.0,,Yes,Yes,100.0 +,completed,,MHCLG,,MHCLG,,2025-04-01T00:00:00+01:00,billyboy@eyeklaud.com,,2025-04-01T00:00:00+01:00,,,single log,,2025,1,4,2025,,Discounted Ownership,Right to Acquire (RTA),,Yes,Yes,Yes,1,1,Yes,,,1,"1, Test Street",,Test Town,,SW1A,1AA,E09000033,Westminster,Flat or maisonette,2,Purpose-built,Yes,30,Non-binary,Buyer prefers not to say,17,United Kingdom,Full-time – 30 hours or more per week,Yes,Yes,35,Non-binary,Buyer prefers not to say,,United Kingdom,Full-time – 30 hours or more per week,Yes,3,No,14,Non-binary,Child under 16,No,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,6,Local authority tenant,Yes,SW1A,1AA,Yes,E09000033,Westminster,Don’t know,,Yes,Yes,No,Yes,Yes,Yes,13400,Yes,Yes,13400,Yes,Don’t know ,No,,Yes,No,,10,,,,,,,110000.0,,Yes,20000.0,10,80000.0,,,,,,,,,,,,,,,,,,,10000.0,,Yes,Yes,100.0 diff --git a/spec/fixtures/files/sales_logs_csv_export_non_support_labels_26.csv b/spec/fixtures/files/sales_logs_csv_export_non_support_labels_26.csv index dd8a657fb..9167c2627 100644 --- a/spec/fixtures/files/sales_logs_csv_export_non_support_labels_26.csv +++ b/spec/fixtures/files/sales_logs_csv_export_non_support_labels_26.csv @@ -1,3 +1,3 @@ Log ID,Status of log,ID of a set of duplicate logs,Which organisation owned this property before the sale?,Which organisation owned this property before the sale? (ID),Which organisation reported the sale?,Which organisation reported the sale? (ID),Time and date the log was created,User the log is assigned to (email),User the log is assigned to (ID),Time and date the log was last updated,User that last amended the log (email),User that last amended the log (ID),Was the log submitted in-service or via bulk upload?,ID of a set of bulk uploaded logs,Year collection period opened,Day of sale completion date,Month of sale completion date,Year of sale completion date,What is the purchaser code?,Shared or discounted ownership,Type of ownership,Is this a staircasing transaction?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,Did you interview the buyer(s) 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,What type of unit is the property?,What is the building height classification?,How many bedrooms does the property have?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,What is buyer 1's age?,What is buyer 1's sex registered at birth?,Is the gender buyer 1 identifies with the same as their sex registered at birth?,"If 'No', enter 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?,Is buyer 2 or person 2 the partner of buyer 1?,What is buyer 2 or person 2's age?,What is buyer 2 or person 2's sex registered at birth?,Is the gender buyer/person 2 identifies with the same as their sex registered at birth?,"If 'No', enter buyer/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?,"In total, how many people live in the property?",Is person 3 the partner of buyer 1?,What is person 3's age?,What is person 3's sex registered at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",What is person 3's working situation?,Is person 4 the partner of buyer 1?,What is person 4's age?,What is person 4's sex registered at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",What is person 4's working situation?,Is person 5 the partner of buyer 1?,What is person 5's age?,What is person 5's sex registered at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",What is person 5's working situation?,Is person 6 the partner of buyer 1?,What is person 6's age?,What is person 6's sex registered at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",What is person 6's working situation?,Household type,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,"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?,Is this a resale?,How long did the buyer(s) live in the property before purchasing it?,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,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 length of the mortgage in years?,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 service charges?,Monthly service charges amount,Does the property have an estate management fee?,Monthly estate management fee amount,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 the first time the shared owner has engaged in staircasing in the home?,"Including this time, how many times has the shared owner engaged in staircasing in the home?",Day of last staircasing transaction,Month of last staircasing transaction,Year of last staircasing transaction,Day of initial staircasing transaction,Month of initial staircasing transaction,Year of initial staircasing transaction,What was the basic monthly rent prior to staircasing?,"What was the amount of any loan, grant, discount or subsidy given?",What was the percentage discount?,Does this include any extra borrowing?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property?,Will the service charge change after this staircasing transaction takes place?,What are the new total monthly service charges for the property? id,status,duplicate_set_id,owning_organisation_name,owning_organisation_id,managing_organisation_name,managing_organisation_id,created_at,assigned_to,assigned_to_id,updated_at,updated_by,updated_by_id,creation_method,bulk_upload_id,collection_start_year,day,month,year,purchid,ownershipsch,type,staircase,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,proptype,buildheightclass,beds,builtype,wchair,age1,sexrab1,gender_same_as_sex1,gender_description1,ethnic_group,ethnic,nationality_all,ecstat1,buy1livein,relat2,age2,sexrab2,gender_same_as_sex2,gender_description2,ethnic_group2,ethnicbuy2,nationality_all_buyer2,ecstat2,buy2livein,hholdcount,relat3,age3,sexrab3,gender_same_as_sex3,gender_description3,ecstat3,relat4,age4,sexrab4,gender_same_as_sex4,gender_description4,ecstat4,relat5,age5,sexrab5,gender_same_as_sex5,gender_description5,ecstat5,relat6,age6,sexrab6,gender_same_as_sex6,gender_description6,ecstat6,hhtype,prevten,ppcodenk,ppostc1,ppostc2,previous_la_known,prevloc,prevloc_label,buy2living,prevtenbuy2,hhregres,hhregresstill,armedforcesspouse,disabled,wheel,income1nk,income1,inc1mort,income2nk,income2,inc2mort,hb,savingsnk,savings,prevown,prevshared,resale,proplen,hoday,homonth,hoyear,frombeds,fromprop,socprevten,value,equity,mortgageused,mortgage,mortlen,deposit,cashdis,mrent,has_servicecharges,servicecharges,has_management_fee,management_fee,stairbought,stairowned,staircasesale,firststair,numstair,stairlastday,stairlastmonth,stairlastyear,stairinitialday,stairinitialmonth,stairinitialyear,mrentprestaircasing,grant,discount,extrabor,has_mscharge,mscharge,hasservicechargeschanged,newservicecharges -,completed,,MHCLG,,MHCLG,,2026-04-01T00:00:00+01:00,billyboy@eyeklaud.com,,2026-04-01T00:00:00+01:00,,,single log,,2026,1,4,2026,,Discounted Ownership,Right to Acquire (RTA),,Yes,Yes,Yes,1,1,Yes,,,1,"1, Test Street",,Test Town,,SW1A,1AA,E09000033,Westminster,Flat or maisonette,Low-rise,2,Purpose built,Yes,30,Female,Yes,,Buyer prefers not to say,17,United Kingdom,Full-time – 30 hours or more per week,Yes,Yes,35,Male,"No, enter gender identity",Nonbinary,Buyer prefers not to say,,United Kingdom,Full-time – 30 hours or more per week,Yes,5,No,14,Female,Yes,,Child under 16,No,Not known,Prefers not to say,"No, enter gender identity",Genderfluid,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,Prefers not to say,,,,,,,6,Local authority tenant,Yes,SW1A,1AA,Yes,E09000033,Westminster,Don’t know,,Yes,Yes,No,Yes,Yes,Yes,13400,Yes,Yes,13400,Yes,Don’t know ,No,,Yes,No,,10,,,,,,,110000.0,,Yes,20000.0,10,80000.0,,,,,,,,,,,,,,,,,,,10000.0,,Yes,Yes,100.0,, +,completed,,MHCLG,,MHCLG,,2026-04-01T00:00:00+01:00,billyboy@eyeklaud.com,,2026-04-01T00:00:00+01:00,,,single log,,2026,1,4,2026,,Discounted Ownership,Right to Acquire (RTA),,Yes,Yes,Yes,1,1,Yes,,,1,"1, Test Street",,Test Town,,SW1A,1AA,E09000033,Westminster,Flat or maisonette,Low-rise,2,Purpose-built,Yes,30,Female,Yes,,Buyer prefers not to say,17,United Kingdom,Full-time – 30 hours or more per week,Yes,Yes,35,Male,"No, enter gender identity",Nonbinary,Buyer prefers not to say,,United Kingdom,Full-time – 30 hours or more per week,Yes,5,No,14,Female,Yes,,Child under 16,No,Not known,Prefers not to say,"No, enter gender identity",Genderfluid,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,Prefers not to say,,,,,,,6,Local authority tenant,Yes,SW1A,1AA,Yes,E09000033,Westminster,Don’t know,,Yes,Yes,No,Yes,Yes,Yes,13400,Yes,Yes,13400,Yes,Don’t know ,No,,Yes,No,,10,,,,,,,110000.0,,Yes,20000.0,10,80000.0,,,,,,,,,,,,,,,,,,,10000.0,,Yes,Yes,100.0,, diff --git a/spec/models/form/sales/questions/property_building_type_spec.rb b/spec/models/form/sales/questions/property_building_type_spec.rb index c8a0aecf0..2097f42cb 100644 --- a/spec/models/form/sales/questions/property_building_type_spec.rb +++ b/spec/models/form/sales/questions/property_building_type_spec.rb @@ -25,7 +25,7 @@ RSpec.describe Form::Sales::Questions::PropertyBuildingType, type: :model do it "has the correct answer_options" do expect(question.answer_options).to eq({ - "1" => { "value" => "Purpose built" }, + "1" => { "value" => "Purpose-built" }, "2" => { "value" => "Converted from previous residential or non-residential property" }, }) end From 441a01990a8eb77043ada45999ac47fc45cc73eb Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Fri, 10 Apr 2026 09:40:04 +0100 Subject: [PATCH 09/21] CLDC-4289: Ensure numbers can be parsed to floats before totaling (#3292) --- app/frontend/controllers/numeric_question_controller.js | 2 +- spec/features/form/progressive_total_field_spec.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/frontend/controllers/numeric_question_controller.js b/app/frontend/controllers/numeric_question_controller.js index 56c76f636..83f8e2fef 100644 --- a/app/frontend/controllers/numeric_question_controller.js +++ b/app/frontend/controllers/numeric_question_controller.js @@ -11,7 +11,7 @@ export default class extends Controller { calculateFields () { const affectedField = this.element.dataset.target const fieldsToAdd = JSON.parse(this.element.dataset.calculated).map(x => `lettings-log-${x.replaceAll('_', '-')}-field`) - const valuesToAdd = fieldsToAdd.map(x => getFieldValue(x)).filter(x => x) + const valuesToAdd = fieldsToAdd.map(x => getFieldValue(x)).filter(x => x && !isNaN(parseFloat(x))) const newValue = valuesToAdd.map(x => parseFloat(x)).reduce((a, b) => a + b, 0).toFixed(2) const elementToUpdate = document.getElementById(affectedField) elementToUpdate.value = newValue diff --git a/spec/features/form/progressive_total_field_spec.rb b/spec/features/form/progressive_total_field_spec.rb index 1f90a4483..814eefb1d 100644 --- a/spec/features/form/progressive_total_field_spec.rb +++ b/spec/features/form/progressive_total_field_spec.rb @@ -58,4 +58,13 @@ RSpec.describe "Accessible Autocomplete" do fill_in("lettings-log-supcharg-field-error", with: 50) expect(find("#lettings-log-tcharge-field").value).to eq("550.00") end + + it "does not show 'NaN' if one of the inputs is not a number", :js do + visit("/lettings-logs/#{lettings_log.id}/rent") + expect(page).to have_selector("#tcharge_div") + fill_in("lettings-log-brent-field", with: 5) + expect(find("#lettings-log-tcharge-field").value).to eq("5.00") + fill_in("lettings-log-pscharge-field", with: "something else") + expect(find("#lettings-log-tcharge-field").value).to eq("5.00") + end end From 5806eb8d72a43a8b1802d41bd3420b9142549fa1 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Mon, 13 Apr 2026 17:33:48 +0100 Subject: [PATCH 10/21] CLDC-4298: Ensure value must be a whole number (#3297) * CLDC-4298: Update purchase price step for 2026 * CLDC-4298: Add a rake task to round value values * fixup! CLDC-4298: Add a rake task to round value values remove redundant query update desc remove unneeded comment --- app/models/form/sales/questions/purchase_price.rb | 2 +- lib/tasks/round_value_for_2026_sales_logs.rake | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 lib/tasks/round_value_for_2026_sales_logs.rake diff --git a/app/models/form/sales/questions/purchase_price.rb b/app/models/form/sales/questions/purchase_price.rb index 24aecd7ec..8a919b55f 100644 --- a/app/models/form/sales/questions/purchase_price.rb +++ b/app/models/form/sales/questions/purchase_price.rb @@ -4,7 +4,7 @@ class Form::Sales::Questions::PurchasePrice < ::Form::Question @id = "value" @type = "numeric" @min = form.start_year_2026_or_later? ? 15_000 : 0 - @step = 0.01 + @step = form.start_year_2026_or_later? ? 1 : 0.01 # 0.01 was a mistake that was fixed in 2026 @width = 5 @prefix = "£" @ownership_sch = ownershipsch diff --git a/lib/tasks/round_value_for_2026_sales_logs.rake b/lib/tasks/round_value_for_2026_sales_logs.rake new file mode 100644 index 000000000..c0f584799 --- /dev/null +++ b/lib/tasks/round_value_for_2026_sales_logs.rake @@ -0,0 +1,11 @@ +desc "Rounds purchase price (the 'value' field) for sales logs in the database if not a whole number" +task round_value_for_2026_sales_logs: :environment do + logs = SalesLog.filter_by_year(2026).where("value % 1 != 0") + puts "Correcting #{logs.count} sales logs, #{logs.map(&:id)}" + + logs.find_each do |log| + log.update(value: log.value.round) + end + + puts "Done" +end From 31e707495a30ac259e12f1fbf8f25741902e239e Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Tue, 14 Apr 2026 11:16:00 +0100 Subject: [PATCH 11/21] CLDC-4406: Add a script to delete logs in batches (#3306) --- lib/tasks/delete_logs_before_year.rake | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 lib/tasks/delete_logs_before_year.rake diff --git a/lib/tasks/delete_logs_before_year.rake b/lib/tasks/delete_logs_before_year.rake new file mode 100644 index 000000000..1343ed4ae --- /dev/null +++ b/lib/tasks/delete_logs_before_year.rake @@ -0,0 +1,34 @@ +desc "Deletes all logs in a given collection year and earlier. Note that this operation is PERMANENT and this will bypass callbacks/paper trail. Use only as instructed in a yearly cleanup task." +task :delete_logs_before_year, %i[year] => :environment do |_task, args| + year = args[:year].to_i + + if year < 2020 + raise ArgumentError, "Year must be above 2020. Make sure you've written out the entire year" + end + + if year > Time.zone.now.year - 3 + raise ArgumentError, "Year cannot be the last 3 years, as these may contain visible logs" + end + + puts "Deleting Logs before #{year}" + + puts "Deleting Sales Logs in batches of 10000" + logs = SalesLog.filter_by_year_or_earlier(year) + + logs.in_batches(of: 10_000).each_with_index do |logs, i| + puts "Deleting batch #{i + 1}" + logs.delete_all + end + puts "Done deleting Sales Logs" + + puts "Deleting Lettings Logs in batches of 10000" + logs = LettingsLog.filter_by_year_or_earlier(year) + + logs.in_batches(of: 10_000).each_with_index do |logs, i| + puts "Deleting batch #{i + 1}" + logs.delete_all + end + puts "Done deleting Lettings Logs" + + puts "Done deleting Logs before #{year}" +end From b44fcb8fd953a2154831eb2c6c3bbd8b7216580f Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis <94526761+natdeanlewissoftwire@users.noreply.github.com> Date: Tue, 14 Apr 2026 16:03:41 +0100 Subject: [PATCH 12/21] CLDC-4430: make dev containers mac compatible (#3309) --- aws-devcontainer/.devcontainer/Dockerfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/aws-devcontainer/.devcontainer/Dockerfile b/aws-devcontainer/.devcontainer/Dockerfile index 3fd23c4d4..82f969b4d 100644 --- a/aws-devcontainer/.devcontainer/Dockerfile +++ b/aws-devcontainer/.devcontainer/Dockerfile @@ -1,7 +1,13 @@ FROM homebrew/brew RUN brew install aws-vault && brew install awscli -RUN curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" -o "session-manager-plugin.deb" && sudo dpkg -i session-manager-plugin.deb +RUN if [ "$(dpkg --print-architecture)" = "arm64" ]; then \ + ARCH="ubuntu_arm64"; \ + else \ + ARCH="ubuntu_64bit"; \ + fi && \ + curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/${ARCH}/session-manager-plugin.deb" -o "session-manager-plugin.deb" && \ + sudo dpkg -i session-manager-plugin.deb ENV AWS_VAULT_BACKEND=file ENV AWS_VAULT_FILE_DIR=./vault From 5d45e04d0d2012f68574e45a31c5e220c97ebc68 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Tue, 14 Apr 2026 16:13:43 +0100 Subject: [PATCH 13/21] CLDC-4406: Update rake name to delete old logs (#3311) considering this is a very dangerous script best not to leave the name slightly ambiguous (since it deletes from the given year and before) --- ...ear.rake => delete_logs_in_collection_year_and_earlier.rake} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename lib/tasks/{delete_logs_before_year.rake => delete_logs_in_collection_year_and_earlier.rake} (92%) diff --git a/lib/tasks/delete_logs_before_year.rake b/lib/tasks/delete_logs_in_collection_year_and_earlier.rake similarity index 92% rename from lib/tasks/delete_logs_before_year.rake rename to lib/tasks/delete_logs_in_collection_year_and_earlier.rake index 1343ed4ae..b5ed4573b 100644 --- a/lib/tasks/delete_logs_before_year.rake +++ b/lib/tasks/delete_logs_in_collection_year_and_earlier.rake @@ -1,5 +1,5 @@ desc "Deletes all logs in a given collection year and earlier. Note that this operation is PERMANENT and this will bypass callbacks/paper trail. Use only as instructed in a yearly cleanup task." -task :delete_logs_before_year, %i[year] => :environment do |_task, args| +task :delete_logs_in_collection_year_and_earlier, %i[year] => :environment do |_task, args| year = args[:year].to_i if year < 2020 From f9f3edd11a754bcce7b026293ca52a8636167721 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Wed, 15 Apr 2026 17:46:09 +0100 Subject: [PATCH 14/21] CLDC-4373: Fix pregnancy check appearing twice (#3308) * CLDC-4373: Add a person_index to lead age pregnancy check * CLDC-4373: Ensure pregnancy validation is not shown for people without details --- ...o_household_member_likely_to_be_pregnant_check.rb | 12 ++++++++++-- .../subsections/household_characteristics.rb | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/models/form/lettings/pages/no_household_member_likely_to_be_pregnant_check.rb b/app/models/form/lettings/pages/no_household_member_likely_to_be_pregnant_check.rb index cefb98ceb..da0fdbb9f 100644 --- a/app/models/form/lettings/pages/no_household_member_likely_to_be_pregnant_check.rb +++ b/app/models/form/lettings/pages/no_household_member_likely_to_be_pregnant_check.rb @@ -2,7 +2,8 @@ class Form::Lettings::Pages::NoHouseholdMemberLikelyToBePregnantCheck < ::Form:: def initialize(id, hsh, subsection, person_index: 0) super(id, hsh, subsection) @copy_key = "lettings.soft_validations.pregnancy_value_check.no_household_member_likely_to_be_pregnant_check" - @depends_on = [{ "no_household_member_likely_to_be_pregnant?" => true }] + @person_index = person_index + @depends_on = depends_on @title_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [], @@ -11,7 +12,14 @@ class Form::Lettings::Pages::NoHouseholdMemberLikelyToBePregnantCheck < ::Form:: "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } - @person_index = person_index + end + + def depends_on + if @person_index >= 2 + [{ "no_household_member_likely_to_be_pregnant?" => true, "details_known_#{@person_index}" => 0 }] + else + [{ "no_household_member_likely_to_be_pregnant?" => true }] + end end def questions diff --git a/app/models/form/lettings/subsections/household_characteristics.rb b/app/models/form/lettings/subsections/household_characteristics.rb index 50e2cfa61..5ac573df3 100644 --- a/app/models/form/lettings/subsections/household_characteristics.rb +++ b/app/models/form/lettings/subsections/household_characteristics.rb @@ -16,7 +16,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::LeadTenantAge.new(nil, nil, self), (Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadAgeValueCheck.new(nil, nil, self) unless form.start_year_2026_or_later?), (Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadAgeValueCheck.new(nil, nil, self) unless form.start_year_2026_or_later?), - (Form::Lettings::Pages::NoHouseholdMemberLikelyToBePregnantCheck.new("no_household_member_likely_to_be_pregnant_lead_age_check", nil, self) if form.start_year_2026_or_later?), + (Form::Lettings::Pages::NoHouseholdMemberLikelyToBePregnantCheck.new("no_household_member_likely_to_be_pregnant_lead_age_check", nil, self, person_index: 1) if form.start_year_2026_or_later?), Form::Lettings::Pages::LeadTenantUnderRetirementValueCheck.new("age_lead_tenant_under_retirement_value_check", nil, self), Form::Lettings::Pages::LeadTenantOverRetirementValueCheck.new("age_lead_tenant_over_retirement_value_check", nil, self), (Form::Lettings::Pages::LeadTenantSexRegisteredAtBirth.new(nil, nil, self) if form.start_year_2026_or_later?), From 8020b2fbfb16718977dd800c60b1691d888b438b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Apr 2026 17:54:30 +0100 Subject: [PATCH 15/21] Bump addressable from 2.8.1 to 2.9.0 in /docs (#3304) Bumps [addressable](https://github.com/sporkmonger/addressable) from 2.8.1 to 2.9.0. - [Changelog](https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md) - [Commits](https://github.com/sporkmonger/addressable/compare/addressable-2.8.1...addressable-2.9.0) --- updated-dependencies: - dependency-name: addressable dependency-version: 2.9.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index cd65dd5a6..ada074c92 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -13,8 +13,8 @@ GEM minitest (>= 5.1, < 6) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) - addressable (2.8.1) - public_suffix (>= 2.0.2, < 6.0) + addressable (2.9.0) + public_suffix (>= 2.0.2, < 8.0) base64 (0.3.0) benchmark (0.5.0) bigdecimal (4.0.1) From aa22e8dc151bba225cd0431106382582ac8b3b90 Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis <94526761+natdeanlewissoftwire@users.noreply.github.com> Date: Fri, 17 Apr 2026 11:15:06 +0100 Subject: [PATCH 16/21] CLDC-4400: Buyer still serving answer remapping (#3310) * CLDC-4400: update 2025 options and hide 10 from ui * CLDC-4400: add rake task to remap values * CLDC-4400: tweak desc and rename * CLDC-4400: update spec * CLDC-4400: rename task file * CLDC-4400: rename task file * CLDC-4400: rename task file * CLDC-4400: refactor usage error * CLDC-4400: use datetime not date in case logs are made between release and rake task completion * CLDC-4400: before_date -> before_datetime * CLDC-4400: print log ids and use update! --- .../sales/questions/buyer_still_serving.rb | 11 +++++--- .../remap_2025_hhregresstill_values.rake | 24 +++++++++++++++++ .../questions/buyer_still_serving_spec.rb | 27 ++++++++++++++++--- 3 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 lib/tasks/remap_2025_hhregresstill_values.rake diff --git a/app/models/form/sales/questions/buyer_still_serving.rb b/app/models/form/sales/questions/buyer_still_serving.rb index fc7b9fcb2..6ef135f40 100644 --- a/app/models/form/sales/questions/buyer_still_serving.rb +++ b/app/models/form/sales/questions/buyer_still_serving.rb @@ -19,13 +19,18 @@ class Form::Sales::Questions::BuyerStillServing < ::Form::Question else { "4" => { "value" => "Yes" }, - "5" => { "value" => "No" }, - "6" => { "value" => "Buyer prefers not to say" }, + "5" => { "value" => "No - they left up to and including 2 years ago" }, + "6" => { "value" => "No - they left more than 2 years ago" }, "divider" => { "value" => true }, - "7" => { "value" => "Don’t know" }, + "9" => { "value" => "Don’t know" }, + "10" => { "value" => "No" }, }.freeze end end + def displayed_answer_options(_log, _user = nil) + answer_options.reject { |key, _v| key == "10" } + end + QUESTION_NUMBER_FROM_YEAR = { 2023 => 63, 2024 => 65, 2025 => 62, 2026 => 70 }.freeze end diff --git a/lib/tasks/remap_2025_hhregresstill_values.rake b/lib/tasks/remap_2025_hhregresstill_values.rake new file mode 100644 index 000000000..30ec38e10 --- /dev/null +++ b/lib/tasks/remap_2025_hhregresstill_values.rake @@ -0,0 +1,24 @@ +desc "Remaps hhregresstill values for manually created 2025/26 sales logs" +task :remap_2025_hhregresstill_values, %i[before_datetime] => :environment do |_task, args| + usage_message = "Usage: rake remap_2025_hhregresstill_values['before_datetime']. before_datetime must be in format YYYY-MM-DDTHH:MM:SS" + raise usage_message if args[:before_datetime].blank? + + before_datetime = Time.zone.parse(args[:before_datetime]) + raise usage_message if before_datetime.nil? + + logs = SalesLog.filter_by_year(2025).where(bulk_upload_id: nil).where(hhregresstill: [5, 6, 7]).where("created_at < ?", before_datetime) + puts "Updating #{logs.count} sales logs" + + updated_ids = [] + logs.find_each do |log| + new_value = case log.hhregresstill + when 5 then 10 + when 6, 7 then 9 + end + log.update!(hhregresstill: new_value) + updated_ids << log.id + end + + puts "Updated log IDs: #{updated_ids.join(', ')}" + puts "Done" +end diff --git a/spec/models/form/sales/questions/buyer_still_serving_spec.rb b/spec/models/form/sales/questions/buyer_still_serving_spec.rb index 4b89879f6..d9222fae2 100644 --- a/spec/models/form/sales/questions/buyer_still_serving_spec.rb +++ b/spec/models/form/sales/questions/buyer_still_serving_spec.rb @@ -32,10 +32,21 @@ RSpec.describe Form::Sales::Questions::BuyerStillServing, type: :model do it "has the correct answer_options" do expect(question.answer_options).to eq({ "4" => { "value" => "Yes" }, - "5" => { "value" => "No" }, - "6" => { "value" => "Buyer prefers not to say" }, + "5" => { "value" => "No - they left up to and including 2 years ago" }, + "6" => { "value" => "No - they left more than 2 years ago" }, "divider" => { "value" => true }, - "7" => { "value" => "Don’t know" }, + "9" => { "value" => "Don’t know" }, + "10" => { "value" => "No" }, + }) + end + + it "has the correct displayed_answer_options" do + expect(question.displayed_answer_options(nil)).to eq({ + "4" => { "value" => "Yes" }, + "5" => { "value" => "No - they left up to and including 2 years ago" }, + "6" => { "value" => "No - they left more than 2 years ago" }, + "divider" => { "value" => true }, + "9" => { "value" => "Don’t know" }, }) end end @@ -52,5 +63,15 @@ RSpec.describe Form::Sales::Questions::BuyerStillServing, type: :model do "9" => { "value" => "Don’t know" }, }) end + + it "has the correct displayed_answer_options" do + expect(question.displayed_answer_options(nil)).to eq({ + "4" => { "value" => "Yes" }, + "5" => { "value" => "No - they left up to and including 2 years ago" }, + "6" => { "value" => "No - they left more than 2 years ago" }, + "divider" => { "value" => true }, + "9" => { "value" => "Don’t know" }, + }) + end end end From 6bccc2676e25595e6346e4ae2f29390dc4a61739 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Fri, 17 Apr 2026 16:08:45 +0100 Subject: [PATCH 17/21] CLDC-4435: Always show LA question if it can't be derived (#3314) * CLDC-4435: Always show LA question if it can't be derived * CLDC-4435: Update tests * fixup! CLDC-4435: Update tests clean up sales prop la spec --- .../pages/property_local_authority.rb | 4 +- .../sales/pages/property_local_authority.rb | 4 +- .../pages/property_local_authority_spec.rb | 72 +++++-------------- .../pages/property_local_authority_spec.rb | 61 +++------------- spec/requests/check_errors_controller_spec.rb | 2 +- 5 files changed, 32 insertions(+), 111 deletions(-) diff --git a/app/models/form/lettings/pages/property_local_authority.rb b/app/models/form/lettings/pages/property_local_authority.rb index 339ccb4d8..5656ec2d9 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_2024_or_later?" => false }, - { "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_2024_or_later?" => true, "address_search_given?" => true }, + { "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_2025_or_later?" => false, "address_search_given?" => true }, + { "is_la_inferred" => false, "is_general_needs?" => true, "form.start_year_2025_or_later?" => true }, ] end diff --git a/app/models/form/sales/pages/property_local_authority.rb b/app/models/form/sales/pages/property_local_authority.rb index fe9ad1bc0..cd1d898e2 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_2024_or_later?" => false }, - { "is_la_inferred" => false, "form.start_year_2024_or_later?" => true, "address_search_given?" => true }, + { "is_la_inferred" => false, "form.start_year_2025_or_later?" => false, "address_search_given?" => true }, + { "is_la_inferred" => false, "form.start_year_2025_or_later?" => true }, ] end 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 75d680ddd..5e29424e3 100644 --- a/spec/models/form/lettings/pages/property_local_authority_spec.rb +++ b/spec/models/form/lettings/pages/property_local_authority_spec.rb @@ -35,66 +35,26 @@ RSpec.describe Form::Lettings::Pages::PropertyLocalAuthority, type: :model do context "when routing to the page" do let(:log) { build(:lettings_log) } - context "with form before 2024" do - before do - 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 - log.needstype = 1 - log.is_la_inferred = false - expect(page).to be_routed_to(log, nil) - end - - it "is not routed to when la is inferred" do - log.needstype = 1 - log.is_la_inferred = true - expect(page).not_to be_routed_to(log, nil) - end - - it "is not routed to when it's a supported housing log" do - log.needstype = 2 - log.is_la_inferred = false - expect(page).not_to be_routed_to(log, nil) - end + before do + allow(form).to receive(:start_year_2025_or_later?).and_return(true) end - context "with form after 2024" do - before do - 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 - log.needstype = 1 - log.is_la_inferred = false - log.address_line1_input = "1" - log.postcode_full_input = "A11AA" - expect(page).to be_routed_to(log, nil) - end - - it "is not routed to when la is inferred" do - log.needstype = 1 - log.is_la_inferred = true - log.address_line1_input = "1" - log.postcode_full_input = "A11AA" - expect(page).not_to be_routed_to(log, nil) - end + it "is routed to when la is not inferred and it is general needs log" do + log.needstype = 1 + log.is_la_inferred = false + expect(page).to be_routed_to(log, nil) + end - it "is not routed to when it's a supported housing log" do - log.needstype = 2 - log.is_la_inferred = false - log.address_line1_input = "1" - log.postcode_full_input = "A11AA" - expect(page).not_to be_routed_to(log, nil) - end + it "is not routed to when la is inferred" do + log.needstype = 1 + log.is_la_inferred = true + expect(page).not_to be_routed_to(log, nil) + end - it "is not routed to when address search is not given" do - log.needstype = 1 - log.is_la_inferred = false - log.address_line1_input = nil - log.postcode_full_input = "A11AA" - expect(page).not_to be_routed_to(log, nil) - end + it "is not routed to when it's a supported housing log" do + log.needstype = 2 + log.is_la_inferred = false + expect(page).not_to be_routed_to(log, nil) end end end diff --git a/spec/models/form/sales/pages/property_local_authority_spec.rb b/spec/models/form/sales/pages/property_local_authority_spec.rb index 88d049bce..579b3d48a 100644 --- a/spec/models/form/sales/pages/property_local_authority_spec.rb +++ b/spec/models/form/sales/pages/property_local_authority_spec.rb @@ -17,18 +17,8 @@ RSpec.describe Form::Sales::Pages::PropertyLocalAuthority, type: :model do expect(page.subsection).to eq(subsection) end - describe "has correct questions" do - context "when 2023" do - let(:start_date) { Time.utc(2023, 2, 8) } - - it "has correct questions" do - expect(page.questions.map(&:id)).to eq( - %w[ - la - ], - ) - end - end + it "has correct questions" do + expect(page.questions.map(&:id)).to eq(%w[la]) end it "has the correct id" do @@ -42,47 +32,18 @@ RSpec.describe Form::Sales::Pages::PropertyLocalAuthority, type: :model do context "when routing to the page" do let(:log) { build(:sales_log) } - context "with form before 2024" do - before do - allow(form).to receive(:start_year_2024_or_later?).and_return(false) - end - - it "is routed to when la is not inferred" do - log.is_la_inferred = false - expect(page).to be_routed_to(log, nil) - end - - it "is not routed to when la is inferred" do - log.is_la_inferred = true - expect(page).not_to be_routed_to(log, nil) - end + before do + allow(form).to receive(:start_year_2025_or_later?).and_return(true) end - context "with form after 2024" do - before do - 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 - log.is_la_inferred = false - log.address_line1_input = "1" - log.postcode_full_input = "A11AA" - expect(page).to be_routed_to(log, nil) - end - - it "is not routed to when la is inferred" do - log.is_la_inferred = true - log.address_line1_input = "1" - log.postcode_full_input = "A11AA" - expect(page).not_to be_routed_to(log, nil) - end + it "is routed to when la is not inferred" do + log.is_la_inferred = false + expect(page).to be_routed_to(log, nil) + end - it "is not routed to when address search is not given" do - log.is_la_inferred = false - log.address_line1_input = nil - log.postcode_full_input = "A11AA" - expect(page).not_to be_routed_to(log, nil) - end + it "is not routed to when la is inferred" do + log.is_la_inferred = true + expect(page).not_to be_routed_to(log, nil) end end end diff --git a/spec/requests/check_errors_controller_spec.rb b/spec/requests/check_errors_controller_spec.rb index 017879d89..168931d71 100644 --- a/spec/requests/check_errors_controller_spec.rb +++ b/spec/requests/check_errors_controller_spec.rb @@ -84,7 +84,7 @@ RSpec.describe CheckErrorsController, type: :request do end it "displays correct clear and change links" do - expect(page.all(:button, value: "Clear").count).to eq(1) + expect(page.all(:button, value: "Clear").count).to eq(2) expect(page).to have_link("Change", count: 1) expect(page).to have_button("Clear all") end From 02c3d00bf688b6f752b21c583e8ca2820ec1fac9 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Mon, 20 Apr 2026 16:09:27 +0100 Subject: [PATCH 18/21] CLDC-4436: Add a script to recalculate LA of logs in a year (#3315) * CLDC-4436: Add a script to recalculate LA of logs in a year * fixup! CLDC-4436: Add a script to recalculate LA of logs in a year dont filter by BU, if this is nil we ought to try to correct it only set back completed logs * fixup! CLDC-4436: Add a script to recalculate LA of logs in a year report count both before and after processing * fixup! CLDC-4436: Add a script to recalculate LA of logs in a year fix SalesLog reference * CLDC-4436: Upgrade log LA fix script for every log it changes to in progress after setting LA, print this to the console this output can be copied and written to a file local. the two subsequent tasks will convert these to CSV files that can be shared with LAs combines them into a single namespace * CLDC-4436: Put final files into a folder for easy access * CLDC-4436: Print relation IDs as well * fixup! CLDC-4436: Upgrade log LA fix script * CLDC-4436: Add separate cols for la ecode and la name * CLDC-4436: Allow 30 logs in an org * fixup! CLDC-4436: Upgrade log LA fix script fix rows for sales too Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com> --------- Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com> --- lib/tasks/log_la_fix.rake | 129 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 lib/tasks/log_la_fix.rake diff --git a/lib/tasks/log_la_fix.rake b/lib/tasks/log_la_fix.rake new file mode 100644 index 000000000..1a13602be --- /dev/null +++ b/lib/tasks/log_la_fix.rake @@ -0,0 +1,129 @@ +namespace :log_la_fix do + desc "For all logs missing an LA that could have one, call the postcode changed method to request a new one from postcodes API. For logs where an LA still cannot be found, this will set them back to in progress." + task :search_for_la_on_logs_with_nil_la, [:year] => :environment do |_task, args| + include CollectionTimeHelper + + year = args[:year]&.to_i || current_collection_start_year + + lettings_logs = LettingsLog.filter_by_year(year).where(la: nil, needstype: 1, status: "completed") + sales_logs = SalesLog.filter_by_year(year).where(la: nil, status: "completed") + lettings_logs_count = lettings_logs.count + sales_logs_count = sales_logs.count + + puts "Checking LA on #{lettings_logs_count} lettings logs in #{year}" + + i = 0 + lettings_logs.find_each do |log| + next unless log.valid? + + log.process_postcode_changes! + unless log.save + puts "Failed to save lettings log #{log.id}" + puts "Errors: #{log.errors.full_messages}" + end + + if log.la.nil? && log.status == "in_progress" + puts "#lettings##{log.id},\"#{log.tenancycode}\",\"#{log.propcode}\",#{log.owning_organisation_id},\"#{log.owning_organisation&.name}\",#{log.managing_organisation_id},\"#{log.managing_organisation&.name}\",#{log.assigned_to_id},\"#{log.assigned_to&.name}\",#{log.startdate},\"#{log.address_line1}\",\"#{log.address_line2}\",\"#{log.town_or_city}\",\"#{log.county}\",\"#{log.postcode_full}\",\"\",\"\"" + end + + i += 1 + if (i % 100).zero? + puts "Processed #{i} lettings logs" + end + end + + puts "Done #{lettings_logs_count} lettings logs" + + puts "Checking LA on #{sales_logs_count} sales logs in #{year}" + + i = 0 + sales_logs.find_each do |log| + next unless log.valid? + + log.process_postcode_changes! + unless log.save + puts "Failed to save sales log #{log.id}" + puts "Errors: #{log.errors.full_messages}" + end + + if log.la.nil? && log.status == "in_progress" + puts "#sales##{log.id},\"#{log.purchid}\",#{log.owning_organisation_id},\"#{log.owning_organisation&.name}\",#{log.managing_organisation_id},\"#{log.managing_organisation&.name}\",#{log.assigned_to_id},\"#{log.assigned_to&.name}\",#{log.saledate},\"#{log.address_line1}\",\"#{log.address_line2}\",\"#{log.town_or_city}\",\"#{log.county}\",\"#{log.postcode_full}\",\"\",\"\"" + end + + i += 1 + if (i % 100).zero? + puts "Processed #{i} sales logs" + end + end + + puts "Done #{sales_logs_count} sales logs" + + puts "Done" + end + + desc "Parse the output of search_for_la_on_logs_with_nil_la into separate lettings and sales CSV files" + task parse_logs_moved_to_incomplete_with_no_la: :environment do + require "csv" + + file = "output.txt" + + lettings_headers = %w[id tenancycode propcode owning_organisation_id owning_organisation managing_organisation_id managing_organisation assigned_to_id assigned_to startdate address_line1 address_line2 town_or_city county postcode_full la_ecode la_name] + sales_headers = %w[id purchid owning_organisation_id owning_organisation managing_organisation_id managing_organisation assigned_to_id assigned_to saledate address_line1 address_line2 town_or_city county postcode_full la_ecode la_name] + + lettings_csv = CSV.open("lettings_logs_moved_to_incomplete_with_no_la.csv", "w") + sales_csv = CSV.open("sales_logs_moved_to_incomplete_with_no_la.csv", "w") + + lettings_csv << lettings_headers + sales_csv << sales_headers + + File.readlines(file).each do |line| + line = line.strip + if line.start_with?("#lettings#") + row = CSV.parse_line(line.delete_prefix("#lettings#")) + lettings_csv << row + elsif line.start_with?("#sales#") + row = CSV.parse_line(line.delete_prefix("#sales#")) + sales_csv << row + end + end + + lettings_csv.close + sales_csv.close + + puts "Written lettings_logs_moved_to_incomplete_with_no_la.csv" + puts "Written sales_logs_moved_to_incomplete_with_no_la.csv" + end + + desc "Split lettings and sales CSVs by managing organisation into separate files per org" + task split_logs_by_managing_org: :environment do + require "csv" + + %w[lettings sales].each do |log_type| + input_file = "#{log_type}_logs_moved_to_incomplete_with_no_la.csv" + + rows_by_org = Hash.new { |h, k| h[k] = [] } + table = CSV.read(input_file, headers: true) + + table.each do |row| + org_name = row["managing_organisation"] + rows_by_org[org_name] << row + end + + rows_by_org.each do |org_name, rows| + if rows.size < 30 + puts "Skipping #{org_name} (#{rows.size} rows)" + next + end + + FileUtils.mkdir_p("log_output") + sanitised_name = org_name.parameterize(separator: "_") + output_file = "log_output/#{sanitised_name}_#{log_type}_logs_moved_to_incomplete_with_no_la.csv" + CSV.open(output_file, "w") do |csv| + csv << table.headers + rows.each { |row| csv << row } + end + puts "Written #{output_file} (#{rows.size} rows)" + end + end + end +end From 51a684e5ca0fd414a121ea7856586d02b0651e92 Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis <94526761+natdeanlewissoftwire@users.noreply.github.com> Date: Tue, 21 Apr 2026 09:39:32 +0100 Subject: [PATCH 19/21] CLDC-4436: use liberal parsing for sales log with purchid in quotes (105099) (#3323) --- lib/tasks/log_la_fix.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/log_la_fix.rake b/lib/tasks/log_la_fix.rake index 1a13602be..61de339c2 100644 --- a/lib/tasks/log_la_fix.rake +++ b/lib/tasks/log_la_fix.rake @@ -79,10 +79,10 @@ namespace :log_la_fix do File.readlines(file).each do |line| line = line.strip if line.start_with?("#lettings#") - row = CSV.parse_line(line.delete_prefix("#lettings#")) + row = CSV.parse_line(line.delete_prefix("#lettings#"), liberal_parsing: true) lettings_csv << row elsif line.start_with?("#sales#") - row = CSV.parse_line(line.delete_prefix("#sales#")) + row = CSV.parse_line(line.delete_prefix("#sales#"), liberal_parsing: true) sales_csv << row end end From 2fae205cf17060936562b21e136cb49ee234b53d Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Tue, 21 Apr 2026 11:26:47 +0100 Subject: [PATCH 20/21] CLDC-4250: New universal credit validation (#3299) * CLDC-4250: Add a new validation for universal credit and household income sources * CLDC-4250: Add verifying tests * CLDC-4250: Add a post release script * fixup! CLDC-4250: Add verifying tests remove unneeded setup * fixup! CLDC-4250: Add verifying tests fix test name * CLDC-4250: make benefits also invalid as requested on ticket update rake --- app/models/lettings_log.rb | 21 ++-- .../validations/financial_validations.rb | 9 ++ .../validations/lettings/financial.en.yml | 3 + ...te_logs_with_invalid_hb_benefits_2026.rake | 10 ++ .../validations/financial_validations_spec.rb | 101 +++++++++++++++++- 5 files changed, 125 insertions(+), 19 deletions(-) create mode 100644 lib/tasks/update_logs_with_invalid_hb_benefits_2026.rake diff --git a/app/models/lettings_log.rb b/app/models/lettings_log.rb index 0ac9f728d..2e6b800eb 100644 --- a/app/models/lettings_log.rb +++ b/app/models/lettings_log.rb @@ -542,7 +542,7 @@ class LettingsLog < Log reason == 1 end - def receives_housing_benefit_only? + def receives_housing_benefit? # 1: Housing benefit hb == 1 end @@ -551,13 +551,7 @@ class LettingsLog < Log hb == 3 end - # Option 8 has been removed starting from 22/23 - def receives_housing_benefit_and_universal_credit? - # 8: Housing benefit and Universal Credit (without housing element) - hb == 8 - end - - def receives_uc_with_housing_element_excl_housing_benefit? + def receives_universal_credit # 6: Universal Credit with housing element (excluding housing benefit) hb == 6 end @@ -572,12 +566,11 @@ class LettingsLog < Log end def receives_housing_related_benefits? - if collection_start_year <= 2021 - receives_housing_benefit_only? || receives_uc_with_housing_element_excl_housing_benefit? || - receives_housing_benefit_and_universal_credit? - else - receives_housing_benefit_only? || receives_uc_with_housing_element_excl_housing_benefit? - end + receives_housing_benefit? || receives_universal_credit + end + + def no_household_income_comes_from_benefits? + benefits == 3 end def local_housing_referral? diff --git a/app/models/validations/financial_validations.rb b/app/models/validations/financial_validations.rb index 3dd6890be..a5794a5e3 100644 --- a/app/models/validations/financial_validations.rb +++ b/app/models/validations/financial_validations.rb @@ -175,6 +175,15 @@ module Validations::FinancialValidations end end + def validate_housing_benefits_matches_income_proportion(record) + return unless record.hb && record.benefits && record.form.start_year_2026_or_later? + + if (record.receives_universal_credit || record.receives_housing_benefit?) && record.no_household_income_comes_from_benefits? + record.errors.add :hb, I18n.t("validations.lettings.financial.hb.housing_benefits_not_match_income_source") + record.errors.add :benefits, I18n.t("validations.lettings.financial.benefits.housing_benefits_not_match_income_source") + end + end + private def validate_charges(record) diff --git a/config/locales/validations/lettings/financial.en.yml b/config/locales/validations/lettings/financial.en.yml index d91610602..6f83e85aa 100644 --- a/config/locales/validations/lettings/financial.en.yml +++ b/config/locales/validations/lettings/financial.en.yml @@ -12,6 +12,7 @@ en: 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." + housing_benefits_not_match_income_source: "You answered that none of the household’s income is from Universal Credit, state pensions or benefits, but also that the tenant is likely to be receiving Universal Credit or housing benefit." 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." @@ -87,3 +88,5 @@ en: 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." + hb: + housing_benefits_not_match_income_source: "You answered that none of the household’s income is from Universal Credit, state pensions or benefits, but also that the tenant is likely to be receiving Universal Credit or housing benefit." diff --git a/lib/tasks/update_logs_with_invalid_hb_benefits_2026.rake b/lib/tasks/update_logs_with_invalid_hb_benefits_2026.rake new file mode 100644 index 000000000..638d7d899 --- /dev/null +++ b/lib/tasks/update_logs_with_invalid_hb_benefits_2026.rake @@ -0,0 +1,10 @@ +desc "For logs that fail the validate_housing_universal_credit_matches_income_proportion check created before we released it, clear the answer to the question" +task update_logs_with_invalid_hb_benefits_2026: :environment do + impacted_logs = LettingsLog.filter_by_year(2026).where(hb: [1, 6], benefits: 3) + + puts "#{impacted_logs.count} logs will be updated #{impacted_logs.map(&:id)}" + + impacted_logs.update!(benefits: nil, hb: nil) + + puts "Done" +end diff --git a/spec/models/validations/financial_validations_spec.rb b/spec/models/validations/financial_validations_spec.rb index 14e2dfd0c..e4bdb2e82 100644 --- a/spec/models/validations/financial_validations_spec.rb +++ b/spec/models/validations/financial_validations_spec.rb @@ -5,11 +5,6 @@ RSpec.describe Validations::FinancialValidations do let(:validator_class) { Class.new { include Validations::FinancialValidations } } let(:record) { FactoryBot.create(:lettings_log) } - let(:fake_2021_2022_form) { Form.new("spec/fixtures/forms/2021_2022.json") } - - before do - allow(FormHandler.instance).to receive(:current_lettings_form).and_return(fake_2021_2022_form) - end describe "earnings and income frequency" do it "when earnings are provided it validates that income frequency must be provided" do @@ -1234,4 +1229,100 @@ RSpec.describe Validations::FinancialValidations do end end end + + describe "universal credit and income sources validations" do + before do + record.hb = hb + record.benefits = benefits + end + + context "with a 2025 form", metadata: { year: 25 } do + before do + allow(record.form).to receive(:start_year_2026_or_later?).and_return(false) + end + + context "when tenant receives universal credit and no household income comes from benefits" do + let(:hb) { 6 } + let(:benefits) { 3 } + + it "does not add errors" do + financial_validator.validate_housing_benefits_matches_income_proportion(record) + expect(record.errors["hb"]).to be_empty + expect(record.errors["benefits"]).to be_empty + end + end + end + + context "with a 2026 form", metadata: { year: 26 } do + before do + allow(record.form).to receive(:start_year_2026_or_later?).and_return(true) + end + + context "when tenant receives universal credit and no household income comes from benefits" do + let(:hb) { 6 } + let(:benefits) { 3 } + + it "adds errors to hb and benefits" do + financial_validator.validate_housing_benefits_matches_income_proportion(record) + expect(record.errors["hb"]).to include(match I18n.t("validations.lettings.financial.hb.housing_benefits_not_match_income_source")) + expect(record.errors["benefits"]).to include(match I18n.t("validations.lettings.financial.benefits.housing_benefits_not_match_income_source")) + end + end + + context "when tenant receives universal credit and some household income comes from benefits" do + let(:hb) { 6 } + let(:benefits) { 2 } + + it "does not add errors" do + financial_validator.validate_housing_benefits_matches_income_proportion(record) + expect(record.errors["hb"]).to be_empty + expect(record.errors["benefits"]).to be_empty + end + end + + context "when tenant receives housing benefit and no household income comes from benefits" do + let(:hb) { 1 } + let(:benefits) { 3 } + + it "adds errors to hb and benefits" do + financial_validator.validate_housing_benefits_matches_income_proportion(record) + expect(record.errors["hb"]).to include(match I18n.t("validations.lettings.financial.hb.housing_benefits_not_match_income_source")) + expect(record.errors["benefits"]).to include(match I18n.t("validations.lettings.financial.benefits.housing_benefits_not_match_income_source")) + end + end + + context "when tenant receives housing benefit and some household income comes from benefits" do + let(:hb) { 1 } + let(:benefits) { 2 } + + it "does not add errors" do + financial_validator.validate_housing_benefits_matches_income_proportion(record) + expect(record.errors["hb"]).to be_empty + expect(record.errors["benefits"]).to be_empty + end + end + + context "when hb is not set" do + let(:hb) { nil } + let(:benefits) { 3 } + + it "does not add errors" do + financial_validator.validate_housing_benefits_matches_income_proportion(record) + expect(record.errors["hb"]).to be_empty + expect(record.errors["benefits"]).to be_empty + end + end + + context "when benefits is not set" do + let(:hb) { 6 } + let(:benefits) { nil } + + it "does not add errors" do + financial_validator.validate_housing_benefits_matches_income_proportion(record) + expect(record.errors["hb"]).to be_empty + expect(record.errors["benefits"]).to be_empty + end + end + end + end end From 4f53210b6ada26dfd146f44d9123be74ddd9dc11 Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis <94526761+natdeanlewissoftwire@users.noreply.github.com> Date: Tue, 21 Apr 2026 15:10:36 +0100 Subject: [PATCH 21/21] CLDC-4429 and CLDC-4242: dependency updates (#3312) * CLDC-4429: push fix commented to test failure on review app * CLDC-4429: remove redundant fix * CLDC-4229: update alpine to 3.22 in dockerfile * CLDC-4229: update alpine to 3.21 to avoid upgrading node * CLDC-4229: allow node 22 * CLDC-4229: excplitlyupgrade for security patches * CLDC-4229: allow both node versions temporarily * CLDC-4229: upgrade ruby and node at the same tiem * CLDC-4229: upgrade gemfile * CLDC-4229: bump to node 24 * CLDC-4229: update docs * CLDC-4229: limit node to within 24 * CLDC-4229: upgrade at start of file * CLDC-4229: upgrade at start of file * CLDC-4229: remove stale ruby version references * CLDC-4429: respond to wiz comments * CLDC-4429: use same firefox --- .github/workflows/run_tests.yml | 20 +++++++------------- .nvmrc | 2 +- .ruby-version | 2 +- Dockerfile | 15 +++++++++------ Gemfile | 2 +- Gemfile.lock | 2 +- docs/setup.md | 10 ++++------ package.json | 2 +- 8 files changed, 25 insertions(+), 30 deletions(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index fde032a69..b4d4f697d 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -38,7 +38,6 @@ jobs: env: RAILS_ENV: test - GEMFILE_RUBY_VERSION: 3.1.1 DB_HOST: localhost DB_DATABASE: data_collector DB_USERNAME: postgres @@ -59,7 +58,7 @@ jobs: uses: actions/setup-node@v4 with: cache: yarn - node-version: 20 + node-version: 24 # This is temporary to fix flaky parallel tests due to `secret_key_base` being read before it's set - name: Create local secret @@ -102,7 +101,6 @@ jobs: env: RAILS_ENV: test - GEMFILE_RUBY_VERSION: 3.1.1 DB_HOST: localhost DB_DATABASE: data_collector DB_USERNAME: postgres @@ -122,7 +120,7 @@ jobs: uses: actions/setup-node@v4 with: cache: yarn - node-version: 20 + node-version: 24 - name: Create database run: | @@ -160,7 +158,6 @@ jobs: env: RAILS_ENV: test - GEMFILE_RUBY_VERSION: 3.1.1 DB_HOST: localhost DB_DATABASE: data_collector DB_USERNAME: postgres @@ -180,7 +177,7 @@ jobs: uses: actions/setup-node@v4 with: cache: yarn - node-version: 20 + node-version: 24 - name: Create database run: | @@ -218,7 +215,6 @@ jobs: env: RAILS_ENV: test - GEMFILE_RUBY_VERSION: 3.1.1 DB_HOST: localhost DB_DATABASE: data_collector DB_USERNAME: postgres @@ -239,7 +235,7 @@ jobs: uses: actions/setup-node@v4 with: cache: yarn - node-version: 20 + node-version: 24 - name: Create local secret run: | @@ -281,7 +277,6 @@ jobs: env: RAILS_ENV: test - GEMFILE_RUBY_VERSION: 3.1.1 DB_HOST: localhost DB_DATABASE: data_collector DB_USERNAME: postgres @@ -302,7 +297,7 @@ jobs: uses: actions/setup-node@v4 with: cache: yarn - node-version: 20 + node-version: 24 - name: Create local secret run: | @@ -344,7 +339,6 @@ jobs: env: RAILS_ENV: test - GEMFILE_RUBY_VERSION: 3.1.1 DB_HOST: localhost DB_DATABASE: data_collector DB_USERNAME: postgres @@ -365,7 +359,7 @@ jobs: uses: actions/setup-node@v4 with: cache: yarn - node-version: 20 + node-version: 24 - name: Create database run: | @@ -396,7 +390,7 @@ jobs: uses: actions/setup-node@v4 with: cache: yarn - node-version: 20 + node-version: 24 - name: Install packages and symlink local dependencies run: | diff --git a/.nvmrc b/.nvmrc index 209e3ef4b..a45fd52cc 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20 +24 diff --git a/.ruby-version b/.ruby-version index f9892605c..7bcbb3808 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.4.4 +3.4.9 diff --git a/Dockerfile b/Dockerfile index 88a7e6a79..ce24943c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,10 @@ -FROM ruby:3.4.4-alpine3.20 as base +FROM ruby:3.4.9-alpine3.23 as base WORKDIR /app +# Upgrade base packages to pick up latest security patches +RUN apk upgrade --no-cache + # Add the timezone as it's not configured by default in Alpine RUN apk add --update --no-cache tzdata && \ cp /usr/share/zoneinfo/Europe/London /etc/localtime && \ @@ -10,7 +13,7 @@ RUN apk add --update --no-cache tzdata && \ # build-base: compilation tools for bundle # yarn: node package manager # postgresql-dev: postgres driver and libraries -RUN apk add --no-cache build-base=0.5-r3 busybox=1.36.1-r29 nodejs=20.15.1-r0 yarn=1.22.22-r0 bash=5.2.26-r0 libpq-dev yaml-dev linux-headers +RUN apk add --no-cache build-base busybox nodejs yarn bash libpq-dev yaml-dev linux-headers # Bundler version should be the same version as what the Gemfile.lock was bundled with RUN gem install bundler:2.6.4 --no-document @@ -40,14 +43,14 @@ RUN bundle config set without "" RUN bundle install --jobs=4 --no-binstubs --no-cache # Install gecko driver for Capybara tests -RUN apk add firefox +RUN apk add firefox=145.0-r0 RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz \ && tar -xvzf geckodriver-v0.31.0-linux64.tar.gz \ && rm geckodriver-v0.31.0-linux64.tar.gz \ && chmod +x geckodriver \ && mv geckodriver /usr/local/bin/ -CMD bundle exec rake parallel:setup && bundle exec rake parallel:spec +CMD ["sh", "-c", "bundle exec rake parallel:setup && bundle exec rake parallel:spec"] FROM base as development @@ -61,7 +64,7 @@ RUN bundle install --jobs=4 --no-binstubs --no-cache USER nonroot -CMD bundle exec rails s -e ${RAILS_ENV} -p ${PORT} --binding=0.0.0.0 +CMD ["sh", "-c", "bundle exec rails s -e ${RAILS_ENV} -p ${PORT} --binding=0.0.0.0"] FROM base as production @@ -75,4 +78,4 @@ RUN chown -R nonroot performance_test USER nonroot -CMD bundle exec rails s -e ${RAILS_ENV} -p ${PORT} --binding=0.0.0.0 +CMD ["sh", "-c", "bundle exec rails s -e ${RAILS_ENV} -p ${PORT} --binding=0.0.0.0"] diff --git a/Gemfile b/Gemfile index 91ed6c8a8..c76a48bec 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby "3.4.4" +ruby "3.4.9" # Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main' gem "rails", "~> 7.2.2" diff --git a/Gemfile.lock b/Gemfile.lock index 85aa27b6d..c83c95414 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -648,7 +648,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 3.4.4p0 + ruby 3.4.9p82 BUNDLED WITH 2.6.4 diff --git a/docs/setup.md b/docs/setup.md index 8bf9c635f..9f66e234c 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -70,21 +70,19 @@ We recommend using [nvm](https://github.com/nvm-sh/nvm) to manage NodeJS version 4. Install Ruby and Bundler ```bash - rbenv install 3.4.4 - rbenv global 3.4.4 + rbenv install 3.4.9 + rbenv global 3.4.9 source ~/.bashrc gem install bundler ``` 5. Install JavaScript dependencies - Note that we currently use node v16, which is no longer the latest LTS version so you will need to specify the version number when installing - macOS (using nvm): ```bash - nvm install 20 - nvm use 20 + nvm install 24 + nvm use 24 brew install yarn ``` diff --git a/package.json b/package.json index c2efb5da1..837240f58 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "data-collector", "private": true, "engines": { - "node": "^20.0.0" + "node": "^24.0.0" }, "dependencies": { "@babel/core": "^7.17.7",