From 410e1750b1462b7f50f4790c9d7c19547137e353 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Mon, 10 Feb 2025 10:29:00 +0000 Subject: [PATCH 01/15] CLDC-3863 Enable adding question numbers to page headers (#2930) * CLDC-3863 Enable adding question numbers to page headers * Test page headers * Lint * Lint --- .../form/lettings/pages/address_fallback.rb | 3 +++ app/models/form/page.rb | 3 ++- .../form/sales/pages/address_fallback.rb | 3 +++ app/views/form/page.html.erb | 2 +- .../2024/lettings/property_information.en.yml | 2 +- .../2024/sales/property_information.en.yml | 2 +- .../2025/lettings/property_information.en.yml | 2 +- .../2025/sales/property_information.en.yml | 2 +- spec/features/sales_log_spec.rb | 24 +++++++++++++++++++ 9 files changed, 37 insertions(+), 6 deletions(-) diff --git a/app/models/form/lettings/pages/address_fallback.rb b/app/models/form/lettings/pages/address_fallback.rb index 2d5249671..763f9d3da 100644 --- a/app/models/form/lettings/pages/address_fallback.rb +++ b/app/models/form/lettings/pages/address_fallback.rb @@ -11,6 +11,7 @@ class Form::Lettings::Pages::AddressFallback < ::Form::Page { "is_supported_housing?" => false, "uprn_known" => 0, "address_options_present?" => false }, { "is_supported_housing?" => false, "uprn_confirmed" => 0, "address_options_present?" => false }, ] + @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end def questions @@ -22,4 +23,6 @@ class Form::Lettings::Pages::AddressFallback < ::Form::Page Form::Lettings::Questions::PostcodeForFullAddress.new(nil, nil, self), ] end + + QUESTION_NUMBER_FROM_YEAR = { 2024 => 13, 2025 => 13 }.freeze end diff --git a/app/models/form/page.rb b/app/models/form/page.rb index c1c09c362..6aa93d766 100644 --- a/app/models/form/page.rb +++ b/app/models/form/page.rb @@ -1,7 +1,7 @@ class Form::Page attr_accessor :id, :header_partial, :description, :questions, :depends_on, :title_text, :informative_text, :subsection, :hide_subsection_label, :next_unresolved_page_id, - :skip_text, :interruption_screen_question_ids, :submit_text + :skip_text, :interruption_screen_question_ids, :submit_text, :question_number def initialize(id, hsh, subsection) @id = id @@ -11,6 +11,7 @@ class Form::Page @header_partial = hsh["header_partial"] @description = hsh["description"] @questions = hsh["questions"].map { |q_id, q| Form::Question.new(q_id, q, self) } + @question_number = hsh["question_number"] @depends_on = hsh["depends_on"] @title_text = hsh["title_text"] @informative_text = hsh["informative_text"] diff --git a/app/models/form/sales/pages/address_fallback.rb b/app/models/form/sales/pages/address_fallback.rb index 1f0a3f1e8..b6818ae0c 100644 --- a/app/models/form/sales/pages/address_fallback.rb +++ b/app/models/form/sales/pages/address_fallback.rb @@ -11,6 +11,7 @@ class Form::Sales::Pages::AddressFallback < ::Form::Page { "uprn_known" => 0, "address_options_present?" => false }, { "uprn_confirmed" => 0, "address_options_present?" => false }, ] + @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end def questions @@ -22,4 +23,6 @@ class Form::Sales::Pages::AddressFallback < ::Form::Page Form::Sales::Questions::PostcodeForFullAddress.new(nil, nil, self), ] end + + QUESTION_NUMBER_FROM_YEAR = { 2024 => 16, 2025 => 16 }.freeze end diff --git a/app/views/form/page.html.erb b/app/views/form/page.html.erb index 1d4f0e7a1..42097c4e6 100644 --- a/app/views/form/page.html.erb +++ b/app/views/form/page.html.erb @@ -27,7 +27,7 @@ <% if @page.header_partial.present? %> <%= render partial: "form/headers/#{@page.header_partial}", locals: { log: @log } %> <% else %> - <%= @page.header %> + <%= @page.question_number ? "Q#{@page.question_number} - #{@page.header}" : @page.header %> <% end %> <% end %> diff --git a/config/locales/forms/2024/lettings/property_information.en.yml b/config/locales/forms/2024/lettings/property_information.en.yml index 383a788ce..9e7326040 100644 --- a/config/locales/forms/2024/lettings/property_information.en.yml +++ b/config/locales/forms/2024/lettings/property_information.en.yml @@ -51,7 +51,7 @@ en: question_text: "Select the correct address" address: - page_header: "Q12 - What is the property's address?" + page_header: "What is the property's address?" address_line1: check_answer_label: "Address lines 1 and 2" check_answer_prompt: "Enter address lines 1 and 2" diff --git a/config/locales/forms/2024/sales/property_information.en.yml b/config/locales/forms/2024/sales/property_information.en.yml index dd9a04240..b40e40267 100644 --- a/config/locales/forms/2024/sales/property_information.en.yml +++ b/config/locales/forms/2024/sales/property_information.en.yml @@ -44,7 +44,7 @@ en: question_text: "Select the correct address" address: - page_header: "Q12 - What is the property's address?" + page_header: "What is the property's address?" address_line1: check_answer_label: "Address lines 1 and 2" check_answer_prompt: "Enter address lines 1 and 2" diff --git a/config/locales/forms/2025/lettings/property_information.en.yml b/config/locales/forms/2025/lettings/property_information.en.yml index 71a2b6124..65c6c0cca 100644 --- a/config/locales/forms/2025/lettings/property_information.en.yml +++ b/config/locales/forms/2025/lettings/property_information.en.yml @@ -51,7 +51,7 @@ en: question_text: "Select the correct address" address: - page_header: "Q12 - What is the property's address?" + page_header: "What is the property's address?" address_line1: check_answer_label: "Address lines 1 and 2" check_answer_prompt: "Enter address lines 1 and 2" diff --git a/config/locales/forms/2025/sales/property_information.en.yml b/config/locales/forms/2025/sales/property_information.en.yml index 96c227b3c..332219a6b 100644 --- a/config/locales/forms/2025/sales/property_information.en.yml +++ b/config/locales/forms/2025/sales/property_information.en.yml @@ -44,7 +44,7 @@ en: question_text: "Select the correct address" address: - page_header: "Q12 - What is the property's address?" + page_header: "What is the property's address?" address_line1: check_answer_label: "Address lines 1 and 2" check_answer_prompt: "Enter address lines 1 and 2" diff --git a/spec/features/sales_log_spec.rb b/spec/features/sales_log_spec.rb index b94ecd464..3030d6d6a 100644 --- a/spec/features/sales_log_spec.rb +++ b/spec/features/sales_log_spec.rb @@ -228,6 +228,30 @@ RSpec.describe "Sales Log Features" do expect(page).to have_current_path("/sales-logs/csv-download?codes_only=false&search=1") end end + + context "when displaying the question number in the page header" do + let(:sales_log) { FactoryBot.create(:sales_log, :shared_ownership_setup_complete, jointpur: 2, owning_organisation: user.organisation, assigned_to: user) } + + context "when visiting the address page" do + before do + visit("/sales-logs/#{sales_log.id}/address") + end + + it "displays the question number in the page header" do + expect(page).to have_content("Q16") + end + end + + context "when visiting the about staircasing page" do + before do + visit("/sales-logs/#{sales_log.id}/about-staircasing-not-joint-purchase") + end + + it "displays the question number in the page header" do + expect(page).to have_content(/Shared ownership scheme\s*About the staircasing transaction/) + end + end + end end end From 76409fff9841e21ae7731f11ea245eccc79dfb20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:09:07 +0000 Subject: [PATCH 02/15] Bump net-imap from 0.5.1 to 0.5.6 (#2937) Bumps [net-imap](https://github.com/ruby/net-imap) from 0.5.1 to 0.5.6. - [Release notes](https://github.com/ruby/net-imap/releases) - [Commits](https://github.com/ruby/net-imap/compare/v0.5.1...v0.5.6) --- updated-dependencies: - dependency-name: net-imap dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5017836a1..942521e82 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -278,7 +278,7 @@ GEM nested_form (0.3.2) net-http (0.4.1) uri - net-imap (0.5.1) + net-imap (0.5.6) date net-protocol net-pop (0.1.2) @@ -494,7 +494,7 @@ GEM thor (1.3.2) thread_safe (0.3.6) timecop (0.9.8) - timeout (0.4.2) + timeout (0.4.3) turbo-rails (2.0.11) actionpack (>= 6.0.0) railties (>= 6.0.0) From c47b264e2139a2288d26ad71aa801e8574f0c201 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Tue, 11 Feb 2025 15:57:34 +0000 Subject: [PATCH 03/15] Update sheltered accommodation question (#2934) --- app/models/form/lettings/questions/sheltered.rb | 8 +++++--- .../forms/2025/lettings/property_information.en.yml | 8 ++++---- spec/models/form/lettings/questions/sheltered_spec.rb | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/models/form/lettings/questions/sheltered.rb b/app/models/form/lettings/questions/sheltered.rb index 65e13d864..d1aa8454a 100644 --- a/app/models/form/lettings/questions/sheltered.rb +++ b/app/models/form/lettings/questions/sheltered.rb @@ -9,12 +9,14 @@ class Form::Lettings::Questions::Sheltered < ::Form::Question def answer_options if form.start_year_2025_or_later? - { "1" => { "value" => "Yes – sheltered housing for tenants with low support needs" }, + { + "7" => { "value" => "Yes – for tenants with low support needs" }, "2" => { "value" => "Yes – extra care housing" }, - "7" => { "value" => "Yes - other" }, + "8" => { "value" => "Yes – other" }, "3" => { "value" => "No" }, "divider" => { "value" => true }, - "4" => { "value" => "Don’t know" } } + "4" => { "value" => "Don’t know" }, + } else { "1" => { "value" => "Yes – specialist retirement housing" }, "2" => { "value" => "Yes – extra care housing" }, diff --git a/config/locales/forms/2025/lettings/property_information.en.yml b/config/locales/forms/2025/lettings/property_information.en.yml index 65c6c0cca..22a0d12db 100644 --- a/config/locales/forms/2025/lettings/property_information.en.yml +++ b/config/locales/forms/2025/lettings/property_information.en.yml @@ -149,7 +149,7 @@ en: sheltered: page_header: "" - check_answer_label: "Letting in sheltered accommodation" - check_answer_prompt: "Tell us if letting is in sheltered accommodation" - hint_text: "Sheltered housing and special retirement housing are for tenants with low-level care and support needs. This typically provides some limited support to enable independent living, such as alarm-based assistance or a scheme manager.

Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission." - question_text: "Is this letting in sheltered accommodation?" + check_answer_label: "Letting is older people’s housing" + check_answer_prompt: "Tell us if letting is older people’s housing" + hint_text: "This includes retirement living, sheltered housing and extra care housing. There is no national set limit for \"older people\", please answer based on your own policies.

Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission." + question_text: "Is this property older people’s housing?" diff --git a/spec/models/form/lettings/questions/sheltered_spec.rb b/spec/models/form/lettings/questions/sheltered_spec.rb index 429b8a725..7b3ee9d86 100644 --- a/spec/models/form/lettings/questions/sheltered_spec.rb +++ b/spec/models/form/lettings/questions/sheltered_spec.rb @@ -52,9 +52,9 @@ RSpec.describe Form::Lettings::Questions::Sheltered, type: :model do it "has the correct answer_options" do expect(question.answer_options).to eq({ - "1" => { "value" => "Yes – sheltered housing for tenants with low support needs" }, + "7" => { "value" => "Yes – for tenants with low support needs" }, "2" => { "value" => "Yes – extra care housing" }, - "7" => { "value" => "Yes - other" }, + "8" => { "value" => "Yes – other" }, "3" => { "value" => "No" }, "divider" => { "value" => true }, "4" => { "value" => "Don’t know" }, From e40dbb2a84437bff32c2af472cdd78d8f32972e5 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Tue, 11 Feb 2025 15:57:45 +0000 Subject: [PATCH 04/15] CLDC-3866 Update previous tenure answer options (#2935) * Update previous tenure answer options * Fix page test --- .../lettings/questions/previous_tenure.rb | 5 +- .../questions/previous_tenure_renewal.rb | 8 ++- ...previous_housing_situation_renewal_spec.rb | 2 +- .../questions/previous_tenure_renewal_spec.rb | 31 ++++++--- .../questions/previous_tenure_spec.rb | 65 ++++++++++--------- 5 files changed, 66 insertions(+), 45 deletions(-) diff --git a/app/models/form/lettings/questions/previous_tenure.rb b/app/models/form/lettings/questions/previous_tenure.rb index 73585c412..c35d08d13 100644 --- a/app/models/form/lettings/questions/previous_tenure.rb +++ b/app/models/form/lettings/questions/previous_tenure.rb @@ -43,15 +43,14 @@ class Form::Lettings::Questions::PreviousTenure < ::Form::Question "32" => { "value" => "Fixed-term private registered provider (PRP) general needs tenancy" }, "31" => { "value" => "Lifetime local authority general needs tenancy" }, "33" => { "value" => "Lifetime private registered provider (PRP) general needs tenancy" }, - "34" => { "value" => "Specialist retirement housing" }, - "36" => { "value" => "Sheltered housing for adults aged under 55 years" }, "35" => { "value" => "Extra care housing" }, + "38" => { "value" => "Older people’s housing for tenants with low support needs" }, "6" => { "value" => "Other supported housing" }, "3" => { "value" => "Private sector tenancy" }, "27" => { "value" => "Owner occupation (low-cost home ownership)" }, "26" => { "value" => "Owner occupation (private)" }, "28" => { "value" => "Living with friends and family (long-term)" }, - "38" => { "value" => "Sofa surfing (moving regularly between family and friends, no permanent bed)" }, + "39" => { "value" => "Sofa surfing (moving regularly between family and friends, no permanent bed)" }, "14" => { "value" => "Bed and breakfast" }, "7" => { "value" => "Direct access hostel" }, "10" => { "value" => "Hospital" }, diff --git a/app/models/form/lettings/questions/previous_tenure_renewal.rb b/app/models/form/lettings/questions/previous_tenure_renewal.rb index c882eb6fe..e932fd218 100644 --- a/app/models/form/lettings/questions/previous_tenure_renewal.rb +++ b/app/models/form/lettings/questions/previous_tenure_renewal.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::PreviousTenureRenewal < ::Form::Question @copy_key = "lettings.household_situation.prevten.renewal" @type = "radio" @check_answers_card_number = 0 - @answer_options = ANSWER_OPTIONS + @answer_options = form.start_year_2025_or_later? ? ANSWER_OPTIONS_2025 : ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end @@ -16,5 +16,11 @@ class Form::Lettings::Questions::PreviousTenureRenewal < ::Form::Question "6" => { "value" => "Other supported housing" }, }.freeze + ANSWER_OPTIONS_2025 = { + "35" => { "value" => "Extra care housing" }, + "38" => { "value" => "Older people’s housing for tenants with low support needs" }, + "6" => { "value" => "Other supported housing" }, + }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 78, 2024 => 77 }.freeze end diff --git a/spec/models/form/lettings/pages/previous_housing_situation_renewal_spec.rb b/spec/models/form/lettings/pages/previous_housing_situation_renewal_spec.rb index af8e7b5fc..a310185c5 100644 --- a/spec/models/form/lettings/pages/previous_housing_situation_renewal_spec.rb +++ b/spec/models/form/lettings/pages/previous_housing_situation_renewal_spec.rb @@ -3,7 +3,7 @@ require "rails_helper" RSpec.describe Form::Lettings::Pages::PreviousHousingSituationRenewal, type: :model do subject(:page) { described_class.new(nil, nil, subsection) } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1))) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2025_or_later?: false)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/lettings/questions/previous_tenure_renewal_spec.rb b/spec/models/form/lettings/questions/previous_tenure_renewal_spec.rb index d672c573b..850949de9 100644 --- a/spec/models/form/lettings/questions/previous_tenure_renewal_spec.rb +++ b/spec/models/form/lettings/questions/previous_tenure_renewal_spec.rb @@ -3,7 +3,8 @@ require "rails_helper" RSpec.describe Form::Lettings::Questions::PreviousTenureRenewal, type: :model do subject(:question) { described_class.new(nil, nil, page) } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)))) } + let(:start_year_after_2025) { false } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2025_or_later?: start_year_after_2025))) } it "has the correct id" do expect(question.id).to eq("prevten") @@ -21,12 +22,26 @@ RSpec.describe Form::Lettings::Questions::PreviousTenureRenewal, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct answer_options" do - expect(question.answer_options).to eq({ - "34" => { "value" => "Specialist retirement housing" }, - "35" => { "value" => "Extra care housing" }, - "36" => { "value" => "Sheltered housing for adults aged under 55 years" }, - "6" => { "value" => "Other supported housing" }, - }) + context "with logs before 2025" do + it "has the correct answer_options" do + expect(question.answer_options).to eq({ + "34" => { "value" => "Specialist retirement housing" }, + "35" => { "value" => "Extra care housing" }, + "36" => { "value" => "Sheltered housing for adults aged under 55 years" }, + "6" => { "value" => "Other supported housing" }, + }) + end + end + + context "with logs on or after 2025" do + let(:start_year_after_2025) { true } + + it "has the correct answer_options" do + expect(question.answer_options).to eq({ + "35" => { "value" => "Extra care housing" }, + "38" => { "value" => "Older people’s housing for tenants with low support needs" }, + "6" => { "value" => "Other supported housing" }, + }) + end end end diff --git a/spec/models/form/lettings/questions/previous_tenure_spec.rb b/spec/models/form/lettings/questions/previous_tenure_spec.rb index d5eaae5fe..1380d1b1f 100644 --- a/spec/models/form/lettings/questions/previous_tenure_spec.rb +++ b/spec/models/form/lettings/questions/previous_tenure_spec.rb @@ -22,35 +22,37 @@ RSpec.describe Form::Lettings::Questions::PreviousTenure, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct answer_options" do - expect(question.answer_options).to eq({ - "30" => { "value" => "Fixed-term local authority general needs tenancy" }, - "32" => { "value" => "Fixed-term private registered provider (PRP) general needs tenancy" }, - "31" => { "value" => "Lifetime local authority general needs tenancy" }, - "33" => { "value" => "Lifetime private registered provider (PRP) general needs tenancy" }, - "34" => { "value" => "Specialist retirement housing" }, - "35" => { "value" => "Extra care housing" }, - "6" => { "value" => "Other supported housing" }, - "3" => { "value" => "Private sector tenancy" }, - "27" => { "value" => "Owner occupation (low-cost home ownership)" }, - "26" => { "value" => "Owner occupation (private)" }, - "28" => { "value" => "Living with friends or family" }, - "14" => { "value" => "Bed and breakfast" }, - "7" => { "value" => "Direct access hostel" }, - "10" => { "value" => "Hospital" }, - "29" => { "value" => "Prison or approved probation hostel" }, - "19" => { "value" => "Rough sleeping" }, - "18" => { "value" => "Any other temporary accommodation" }, - "13" => { "value" => "Children’s home or foster care" }, - "24" => { "value" => "Home Office Asylum Support" }, - "23" => { "value" => "Mobile home or caravan" }, - "21" => { "value" => "Refuge" }, - "9" => { "value" => "Residential care home" }, - "4" => { "value" => "Tied housing or rented with job" }, - "36" => { "value" => "Sheltered housing for adults aged under 55 years" }, - "37" => { "value" => "Host family or similar refugee accommodation" }, - "25" => { "value" => "Any other accommodation" }, - }) + context "with start year before 2025" do + it "has the correct answer_options" do + expect(question.answer_options).to eq({ + "30" => { "value" => "Fixed-term local authority general needs tenancy" }, + "32" => { "value" => "Fixed-term private registered provider (PRP) general needs tenancy" }, + "31" => { "value" => "Lifetime local authority general needs tenancy" }, + "33" => { "value" => "Lifetime private registered provider (PRP) general needs tenancy" }, + "34" => { "value" => "Specialist retirement housing" }, + "35" => { "value" => "Extra care housing" }, + "6" => { "value" => "Other supported housing" }, + "3" => { "value" => "Private sector tenancy" }, + "27" => { "value" => "Owner occupation (low-cost home ownership)" }, + "26" => { "value" => "Owner occupation (private)" }, + "28" => { "value" => "Living with friends or family" }, + "14" => { "value" => "Bed and breakfast" }, + "7" => { "value" => "Direct access hostel" }, + "10" => { "value" => "Hospital" }, + "29" => { "value" => "Prison or approved probation hostel" }, + "19" => { "value" => "Rough sleeping" }, + "18" => { "value" => "Any other temporary accommodation" }, + "13" => { "value" => "Children’s home or foster care" }, + "24" => { "value" => "Home Office Asylum Support" }, + "23" => { "value" => "Mobile home or caravan" }, + "21" => { "value" => "Refuge" }, + "9" => { "value" => "Residential care home" }, + "4" => { "value" => "Tied housing or rented with job" }, + "36" => { "value" => "Sheltered housing for adults aged under 55 years" }, + "37" => { "value" => "Host family or similar refugee accommodation" }, + "25" => { "value" => "Any other accommodation" }, + }) + end end context "with 2025 logs" do @@ -62,14 +64,14 @@ RSpec.describe Form::Lettings::Questions::PreviousTenure, type: :model do "32" => { "value" => "Fixed-term private registered provider (PRP) general needs tenancy" }, "31" => { "value" => "Lifetime local authority general needs tenancy" }, "33" => { "value" => "Lifetime private registered provider (PRP) general needs tenancy" }, - "34" => { "value" => "Specialist retirement housing" }, "35" => { "value" => "Extra care housing" }, + "38" => { "value" => "Older people’s housing for tenants with low support needs" }, "6" => { "value" => "Other supported housing" }, "3" => { "value" => "Private sector tenancy" }, "27" => { "value" => "Owner occupation (low-cost home ownership)" }, "26" => { "value" => "Owner occupation (private)" }, "28" => { "value" => "Living with friends and family (long-term)" }, - "38" => { "value" => "Sofa surfing (moving regularly between family and friends, no permanent bed)" }, + "39" => { "value" => "Sofa surfing (moving regularly between family and friends, no permanent bed)" }, "14" => { "value" => "Bed and breakfast" }, "7" => { "value" => "Direct access hostel" }, "10" => { "value" => "Hospital" }, @@ -82,7 +84,6 @@ RSpec.describe Form::Lettings::Questions::PreviousTenure, type: :model do "21" => { "value" => "Refuge" }, "9" => { "value" => "Residential care home" }, "4" => { "value" => "Tied housing or rented with job" }, - "36" => { "value" => "Sheltered housing for adults aged under 55 years" }, "37" => { "value" => "Host family or similar refugee accommodation" }, "25" => { "value" => "Any other accommodation" }, }) From 87d6f24d619f66a89540a7cf56500177cfbcd10c Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Thu, 13 Feb 2025 10:11:47 +0000 Subject: [PATCH 05/15] CLDC-3858 Correctly set checkbox values (#2931) * Set unselected checkbox options to 0 * Correct checkbox values for existing logs * Update CSV fixtures * Update if statements * Update a test --- app/controllers/form_controller.rb | 6 +- .../lettings_log_variables.rb | 15 ++ lib/tasks/correct_checkbox_values.rake | 20 ++ .../lettings_log_csv_export_codes_23.csv | 2 +- .../lettings_log_csv_export_codes_24.csv | 2 +- .../lettings_log_csv_export_labels_23.csv | 2 +- .../lettings_log_csv_export_labels_24.csv | 2 +- ...gs_log_csv_export_non_support_codes_23.csv | 2 +- ...gs_log_csv_export_non_support_codes_24.csv | 2 +- ...s_log_csv_export_non_support_labels_23.csv | 2 +- ...s_log_csv_export_non_support_labels_24.csv | 2 +- .../lib/tasks/correct_checkbox_values_spec.rb | 216 ++++++++++++++++++ .../lettings/year2024/row_parser_spec.rb | 62 +++++ 13 files changed, 324 insertions(+), 11 deletions(-) create mode 100644 lib/tasks/correct_checkbox_values.rake create mode 100644 spec/lib/tasks/correct_checkbox_values_spec.rb diff --git a/app/controllers/form_controller.rb b/app/controllers/form_controller.rb index e2b7f59ac..2cb65edaf 100644 --- a/app/controllers/form_controller.rb +++ b/app/controllers/form_controller.rb @@ -155,9 +155,9 @@ private next unless question_params - if %w[checkbox validation_override].include?(question.type) + if question.type == "checkbox" question.answer_keys_without_dividers.each do |option| - result[option] = question_params.include?(option) ? 1 : 0 + result[option] = 1 if question_params.include?(option) end elsif question.type != "date" result[question.id] = question_params @@ -347,7 +347,7 @@ private end def question_missing_response?(responses_for_page, question) - if %w[checkbox validation_override].include?(question.type) + if question.type == "checkbox" answered = question.answer_keys_without_dividers.map do |option| session["fields"][option] = @log[option] = params[@log.log_type][question.id].include?(option) ? 1 : 0 params[@log.log_type][question.id].exclude?(option) diff --git a/app/models/derived_variables/lettings_log_variables.rb b/app/models/derived_variables/lettings_log_variables.rb index 90d4e9db2..f584b6238 100644 --- a/app/models/derived_variables/lettings_log_variables.rb +++ b/app/models/derived_variables/lettings_log_variables.rb @@ -142,6 +142,8 @@ module DerivedVariables::LettingsLogVariables end reset_address_fields! if is_supported_housing? + + set_checkbox_values! end private @@ -362,4 +364,17 @@ private return 2 if rent_type == 4 return 3 if rent_type == 5 end + + def set_checkbox_values! + form.questions.select { |q| q.type == "checkbox" }.each do |question| + options = question.answer_keys_without_dividers + next unless options.any? { |option| self[option] == 1 } + + options.each do |option| + if self[option].nil? + self[option] = 0 + end + end + end + end end diff --git a/lib/tasks/correct_checkbox_values.rake b/lib/tasks/correct_checkbox_values.rake new file mode 100644 index 000000000..0bd7c6974 --- /dev/null +++ b/lib/tasks/correct_checkbox_values.rake @@ -0,0 +1,20 @@ +desc "Update BU reasonable preference and illness type checkbox values" +task correct_checkbox_values: :environment do + any_reasonpref_selected = "rp_homeless = 1 OR rp_hardship = 1 OR rp_medwel = 1 OR rp_insan_unsat = 1 OR rp_dontknow = 1" + any_reasonpref_is_null = "rp_homeless IS NULL OR rp_hardship IS NULL OR rp_medwel IS NULL OR rp_insan_unsat IS NULL OR rp_dontknow IS NULL" + + LettingsLog.filter_by_year(2024).where(reasonpref: 1).where(any_reasonpref_selected).where(any_reasonpref_is_null).find_each do |lettings_log| + unless lettings_log.save + Rails.logger.info("Failed to save reasonpref for LettingsLog with id #{lettings_log.id}: #{lettings_log.errors.full_messages}") + end + end + + any_illness_selected = "illness_type_1 = 1 OR illness_type_2 = 1 OR illness_type_3 = 1 OR illness_type_4 = 1 OR illness_type_5 = 1 OR illness_type_6 = 1 OR illness_type_7 = 1 OR illness_type_8 = 1 OR illness_type_9 = 1 OR illness_type_10 = 1" + any_illness_is_null = "illness_type_1 IS NULL OR illness_type_2 IS NULL OR illness_type_3 IS NULL OR illness_type_4 IS NULL OR illness_type_5 IS NULL OR illness_type_6 IS NULL OR illness_type_7 IS NULL OR illness_type_8 IS NULL OR illness_type_9 IS NULL OR illness_type_10 IS NULL" + + LettingsLog.filter_by_year(2024).where(illness: 1).where(any_illness_selected).where(any_illness_is_null).find_each do |lettings_log| + unless lettings_log.save + Rails.logger.info("Failed to save illness for LettingsLog with id #{lettings_log.id}: #{lettings_log.errors.full_messages}") + end + end +end diff --git a/spec/fixtures/files/lettings_log_csv_export_codes_23.csv b/spec/fixtures/files/lettings_log_csv_export_codes_23.csv index ea69e9176..6d9da8872 100644 --- a/spec/fixtures/files/lettings_log_csv_export_codes_23.csv +++ b/spec/fixtures/files/lettings_log_csv_export_codes_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,1,,,2023,MHCLG,MHCLG,1,7,0,2023-11-26,2,2,,,2,HIJKLMN,ABCDEFG,0,,,Address line 1,,London,,NW9 5LL,false,Barnet,E09000003,0,2,6,2,2,7,1,1,3,2023-11-24,1,,1,2023-11-25,,3,1,4,,2,,1,4,,1,4,0,0,2,35,,F,0,2,13,0,0,P,32,M,6,1,R,-9,R,10,0,R,-9,R,10,,,,,,,,,,,,,,,,,,,,,1,4,1,2,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,2,7,4,,6,1,0,TN23 6LZ,1,false,Ashford,E07000105,1,0,1,0,0,0,0,0,1,,2,,0,0,1,268,,6,1,1,,0,2,,,,,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,1,0,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,1,,,2023,MHCLG,MHCLG,1,7,0,2023-11-26,2,2,,,2,HIJKLMN,ABCDEFG,0,,,Address line 1,,London,,NW9 5LL,false,Barnet,E09000003,0,2,6,2,2,7,1,1,3,2023-11-24,1,,1,2023-11-25,,3,1,4,,2,,1,4,,1,4,0,0,2,35,,F,0,2,13,0,0,P,32,M,6,1,R,-9,R,10,0,R,-9,R,10,,,,,,,,,,,,,,,,,,,,,1,4,1,2,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,2,7,4,,6,1,0,TN23 6LZ,1,false,Ashford,E07000105,1,0,1,0,0,0,0,0,1,0,2,,0,0,1,268,,6,1,1,,0,2,,,,,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,1,0,12.0,6.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_codes_24.csv b/spec/fixtures/files/lettings_log_csv_export_codes_24.csv index b7a0efd85..6a84b7568 100644 --- a/spec/fixtures/files/lettings_log_csv_export_codes_24.csv +++ b/spec/fixtures/files/lettings_log_csv_export_codes_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,1,2024,,MHCLG,MHCLG,1,7,0,2024-04-01,2,2,,,2,HIJKLMN,ABCDEFG,1,,Address line 1,,London,,NW9 5LL,false,Barnet,E09000003,0,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,0,2,6,2,7,1,1,3,2024-03-30,1,,1,2024-03-31,,3,1,4,,2,,4,,1,4,0,0,2,35,,F,0,2,36,0,0,P,,,32,M,6,1,R,-9,R,10,0,R,-9,R,10,,,,,,,,,,,,,,,,,,,,,1,4,1,2,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,2,7,4,,,6,1,0,TN23 6LZ,1,false,Ashford,E07000105,1,0,1,0,0,0,0,0,1,0,,2,,0,0,1,268,,6,1,1,,0,2,,,,,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,1,0,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,1,2024,,MHCLG,MHCLG,1,7,0,2024-04-01,2,2,,,2,HIJKLMN,ABCDEFG,1,,Address line 1,,London,,NW9 5LL,false,Barnet,E09000003,0,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,0,2,6,2,7,1,1,3,2024-03-30,1,,1,2024-03-31,,3,1,4,,2,,4,,1,4,0,0,2,35,,F,0,2,36,0,0,P,,,32,M,6,1,R,-9,R,10,0,R,-9,R,10,,,,,,,,,,,,,,,,,,,,,1,4,1,2,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,2,7,4,,,6,1,0,TN23 6LZ,1,false,Ashford,E07000105,1,0,1,0,0,0,0,0,1,0,0,2,,0,0,1,268,,6,1,1,,0,2,,,,,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,1,0,12.0,6.0,,,,,,,,,,,,,,,,,,,, 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 44fd9d897..96db80bbd 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,,Tenant applied directly (no referral or nomination),,Yes,No,Weekly,268,,Universal Credit housing element,Yes,All,,No,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,,No,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 53043b320..ce1bbb6de 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,,Tenant applied directly (no referral or nomination),,Yes,No,Weekly,268,,Universal Credit housing element,Yes,All,,No,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,,No,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_codes_23.csv b/spec/fixtures/files/lettings_log_csv_export_non_support_codes_23.csv index 3c8f4ea7c..67afa0aa4 100644 --- a/spec/fixtures/files/lettings_log_csv_export_non_support_codes_23.csv +++ b/spec/fixtures/files/lettings_log_csv_export_non_support_codes_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,1,2023,MHCLG,MHCLG,1,7,0,2023-11-26,2,2,,,2,HIJKLMN,ABCDEFG,0,,Address line 1,,London,,NW9 5LL,Barnet,0,2,6,2,2,7,1,1,3,2023-11-24,1,1,2023-11-25,3,1,4,,2,,1,4,1,35,F,0,2,13,0,P,32,M,6,R,-9,R,10,R,-9,R,10,,,,,,,,,,,,,,,,,1,4,1,2,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,2,7,4,,6,1,0,TN23 6LZ,Ashford,1,0,1,0,0,0,0,0,1,,2,0,1,268,6,1,1,,0,2,,,,200.0,50.0,40.0,35.0,325.0,1,12.0,,,,,,,,,,,,,,,,,,,, +,completed,,choreographer@owtluk.com,false,2023-11-26T00:00:00+00:00,,2023-11-26T00:00:00+00:00,1,2023,MHCLG,MHCLG,1,7,0,2023-11-26,2,2,,,2,HIJKLMN,ABCDEFG,0,,Address line 1,,London,,NW9 5LL,Barnet,0,2,6,2,2,7,1,1,3,2023-11-24,1,1,2023-11-25,3,1,4,,2,,1,4,1,35,F,0,2,13,0,P,32,M,6,R,-9,R,10,R,-9,R,10,,,,,,,,,,,,,,,,,1,4,1,2,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,2,7,4,,6,1,0,TN23 6LZ,Ashford,1,0,1,0,0,0,0,0,1,0,2,0,1,268,6,1,1,,0,2,,,,200.0,50.0,40.0,35.0,325.0,1,12.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_non_support_codes_24.csv b/spec/fixtures/files/lettings_log_csv_export_non_support_codes_24.csv index 04dfd87da..894d69470 100644 --- a/spec/fixtures/files/lettings_log_csv_export_non_support_codes_24.csv +++ b/spec/fixtures/files/lettings_log_csv_export_non_support_codes_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,1,2024,,MHCLG,MHCLG,1,7,0,2024-04-01,2,2,,,2,HIJKLMN,ABCDEFG,1,0,,Address line 1,,London,,NW9 5LL,Barnet,0,2,6,2,7,1,1,3,2024-03-30,1,1,2024-03-31,3,1,4,,2,,4,1,35,F,0,2,36,0,P,32,M,6,R,-9,R,10,R,-9,R,10,,,,,,,,,,,,,,,,,1,4,1,2,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,2,7,4,,6,1,0,TN23 6LZ,Ashford,1,0,1,0,0,0,0,0,1,0,,2,0,1,268,6,1,1,,0,2,,,,200.0,50.0,40.0,35.0,325.0,1,12.0,,,,,,,,,,,,,,,,,,,, +,in_progress,,choreographer@owtluk.com,false,2024-04-01T00:00:00+01:00,,2024-04-01T00:00:00+01:00,1,2024,,MHCLG,MHCLG,1,7,0,2024-04-01,2,2,,,2,HIJKLMN,ABCDEFG,1,0,,Address line 1,,London,,NW9 5LL,Barnet,0,2,6,2,7,1,1,3,2024-03-30,1,1,2024-03-31,3,1,4,,2,,4,1,35,F,0,2,36,0,P,32,M,6,R,-9,R,10,R,-9,R,10,,,,,,,,,,,,,,,,,1,4,1,2,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,2,7,4,,6,1,0,TN23 6LZ,Ashford,1,0,1,0,0,0,0,0,1,0,0,2,0,1,268,6,1,1,,0,2,,,,200.0,50.0,40.0,35.0,325.0,1,12.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 095625fc9..d17aa47a6 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,,Tenant applied directly (no referral or nomination),No,Weekly,268,Universal Credit housing element,Yes,All,,No,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,,No,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 a63104c8f..caf21819b 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,,Tenant applied directly (no referral or nomination),No,Weekly,268,Universal Credit housing element,Yes,All,,No,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,,No,Every 2 weeks,,,,200.0,50.0,40.0,35.0,325.0,Yes,12.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/lib/tasks/correct_checkbox_values_spec.rb b/spec/lib/tasks/correct_checkbox_values_spec.rb new file mode 100644 index 000000000..8adc7eda3 --- /dev/null +++ b/spec/lib/tasks/correct_checkbox_values_spec.rb @@ -0,0 +1,216 @@ +require "rails_helper" +require "rake" + +RSpec.describe "correct_checkbox_values" do + describe ":correct_checkbox_values", type: :task do + subject(:task) { Rake::Task["correct_checkbox_values"] } + + let(:organisation) { create(:organisation, rent_periods: [2]) } + let(:user) { create(:user, organisation:) } + + before do + Rake.application.rake_require("tasks/correct_checkbox_values") + Rake::Task.define_task(:environment) + task.reenable + end + + context "when the rake task is run" do + context "and any of the reasonable_preference_reason options are 1" do + let(:bulk_upload) { create(:bulk_upload, :lettings, year: 2024, rent_type_fix_status: BulkUpload.rent_type_fix_statuses[:not_applied]) } + + it "sets the remaining options to 0" do + log = build(:lettings_log, :completed, reasonpref: 1, rp_homeless: 1, rp_hardship: nil, rp_medwel: nil, rp_insan_unsat: nil, rp_dontknow: nil, + bulk_upload:, assigned_to: user) + log.save!(validate: false) + initial_updated_at = log.updated_at + + task.invoke + log.reload + + expect(log.updated_at).not_to eq(initial_updated_at) + expect(log.status).to eq("completed") + expect(log.rp_homeless).to be(1) + expect(log.rp_hardship).to be(0) + expect(log.rp_medwel).to be(0) + expect(log.rp_insan_unsat).to be(0) + expect(log.rp_dontknow).to be(0) + end + + it "updates the reasonable preference reason values on a pending log" do + log = build(:lettings_log, :completed, status: "pending", reasonpref: 1, rp_homeless: 1, rp_hardship: nil, rp_medwel: 1, rp_insan_unsat: nil, rp_dontknow: nil, bulk_upload:, assigned_to: user) + log.save!(validate: false) + initial_updated_at = log.updated_at + expect(log.status).to eq("pending") + + task.invoke + log.reload + expect(log.rp_homeless).to be(1) + expect(log.rp_hardship).to be(0) + expect(log.rp_medwel).to be(1) + expect(log.rp_insan_unsat).to be(0) + expect(log.rp_dontknow).to be(0) + expect(log.status).to eq("pending") + expect(log.updated_at).not_to eq(initial_updated_at) + end + + it "does not update logs if all unselected reasonable preference reason are alredy 0" do + log = build(:lettings_log, :completed, reasonpref: 1, rp_homeless: 0, rp_hardship: 1, rp_medwel: 0, rp_insan_unsat: 0, rp_dontknow: 0, bulk_upload:, assigned_to: user) + log.save!(validate: false) + initial_updated_at = log.updated_at + expect(log.status).to eq("completed") + + task.invoke + log.reload + + expect(log.status).to eq("completed") + expect(log.updated_at).to eq(initial_updated_at) + end + + it "updates the reasonable preference reason values if some of the checkbox values are nil" do + log = build(:lettings_log, :completed, status: "pending", reasonpref: 1, rp_homeless: 0, rp_hardship: nil, rp_medwel: 1, rp_insan_unsat: 0, rp_dontknow: 0, bulk_upload:, assigned_to: user) + log.save!(validate: false) + initial_updated_at = log.updated_at + expect(log.status).to eq("pending") + + task.invoke + log.reload + expect(log.rp_homeless).to be(0) + expect(log.rp_hardship).to be(0) + expect(log.rp_medwel).to be(1) + expect(log.rp_insan_unsat).to be(0) + expect(log.rp_dontknow).to be(0) + expect(log.status).to eq("pending") + expect(log.updated_at).not_to eq(initial_updated_at) + end + + it "does not update the reasonable preference reason values on a 2023 log" do + log = build(:lettings_log, :completed, startdate: Time.zone.local(2023, 6, 6), reasonpref: 1, rp_homeless: 0, rp_hardship: nil, rp_medwel: 1, rp_insan_unsat: 0, rp_dontknow: 0, bulk_upload:, assigned_to: user) + log.save!(validate: false) + initial_updated_at = log.updated_at + + task.invoke + log.reload + + expect(log.updated_at).to eq(initial_updated_at) + end + + it "does not update and logs error if a validation triggers" do + log = build(:lettings_log, :completed, postcode_full: "0", reasonpref: 1, rp_homeless: 0, rp_hardship: nil, rp_medwel: 1, rp_insan_unsat: 0, rp_dontknow: 0, bulk_upload:, assigned_to: user) + log.save!(validate: false) + initial_updated_at = log.updated_at + + task.invoke + log.reload + + expect(log.updated_at).to eq(initial_updated_at) + end + end + + context "and any of the illness_type options are 1" do + let(:bulk_upload) { create(:bulk_upload, :lettings, year: 2024, rent_type_fix_status: BulkUpload.rent_type_fix_statuses[:not_applied]) } + + it "sets the remaining options to 0" do + log = build(:lettings_log, :completed, illness: 1, illness_type_1: 1, illness_type_2: nil, illness_type_3: nil, illness_type_4: nil, illness_type_5: nil, illness_type_6: nil, illness_type_7: nil, illness_type_8: nil, illness_type_9: nil, illness_type_10: nil, + bulk_upload:, assigned_to: user) + log.save!(validate: false) + initial_updated_at = log.updated_at + + task.invoke + log.reload + + expect(log.updated_at).not_to eq(initial_updated_at) + expect(log.status).to eq("completed") + expect(log.illness_type_1).to be(1) + expect(log.illness_type_2).to be(0) + expect(log.illness_type_3).to be(0) + expect(log.illness_type_4).to be(0) + expect(log.illness_type_5).to be(0) + expect(log.illness_type_6).to be(0) + expect(log.illness_type_7).to be(0) + expect(log.illness_type_8).to be(0) + expect(log.illness_type_9).to be(0) + expect(log.illness_type_10).to be(0) + end + + it "updates the reasonable preference reason values on a pending log" do + log = build(:lettings_log, :completed, status: "pending", illness: 1, illness_type_1: 1, illness_type_2: nil, illness_type_3: nil, illness_type_4: nil, illness_type_5: nil, illness_type_6: nil, illness_type_7: nil, illness_type_8: nil, illness_type_9: nil, illness_type_10: nil, bulk_upload:, assigned_to: user) + log.save!(validate: false) + initial_updated_at = log.updated_at + expect(log.status).to eq("pending") + + task.invoke + log.reload + expect(log.illness_type_1).to be(1) + expect(log.illness_type_2).to be(0) + expect(log.illness_type_3).to be(0) + expect(log.illness_type_4).to be(0) + expect(log.illness_type_5).to be(0) + expect(log.illness_type_6).to be(0) + expect(log.illness_type_7).to be(0) + expect(log.illness_type_8).to be(0) + expect(log.illness_type_9).to be(0) + expect(log.illness_type_10).to be(0) + expect(log.status).to eq("pending") + expect(log.updated_at).not_to eq(initial_updated_at) + end + + it "does not update logs if all unselected reasonable preference reason are alredy 0" do + log = build(:lettings_log, :completed, 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, bulk_upload:, assigned_to: user) + log.save!(validate: false) + initial_updated_at = log.updated_at + expect(log.status).to eq("completed") + + task.invoke + log.reload + + expect(log.status).to eq("completed") + expect(log.updated_at).to eq(initial_updated_at) + end + + it "updates the reasonable preference reason values if some of the checkbox values are nil" do + log = build(:lettings_log, :completed, status: "pending", illness: 1, illness_type_1: 0, illness_type_2: nil, illness_type_3: 1, illness_type_4: 0, illness_type_5: 0, illness_type_6: nil, illness_type_7: nil, illness_type_8: nil, illness_type_9: nil, illness_type_10: nil, bulk_upload:, assigned_to: user) + log.save!(validate: false) + initial_updated_at = log.updated_at + expect(log.status).to eq("pending") + + task.invoke + log.reload + expect(log.illness_type_1).to be(0) + expect(log.illness_type_2).to be(0) + expect(log.illness_type_3).to be(1) + expect(log.illness_type_4).to be(0) + expect(log.illness_type_5).to be(0) + expect(log.illness_type_6).to be(0) + expect(log.illness_type_7).to be(0) + expect(log.illness_type_8).to be(0) + expect(log.illness_type_9).to be(0) + expect(log.illness_type_10).to be(0) + expect(log.status).to eq("pending") + expect(log.updated_at).not_to eq(initial_updated_at) + end + + it "does not update the reasonable preference reason values on a 2023 log" do + log = build(:lettings_log, :completed, startdate: Time.zone.local(2023, 6, 6), illness: 1, illness_type_1: 0, illness_type_2: nil, illness_type_3: 1, illness_type_4: 0, illness_type_5: 0, illness_type_6: nil, illness_type_7: nil, illness_type_8: nil, illness_type_9: nil, illness_type_10: nil, bulk_upload:, assigned_to: user) + log.save!(validate: false) + initial_updated_at = log.updated_at + + task.invoke + log.reload + + expect(log.updated_at).to eq(initial_updated_at) + end + + it "does not update and logs error if a validation triggers" do + log = build(:lettings_log, :completed, postcode_full: "0", illness: 1, illness_type_1: 0, illness_type_2: nil, illness_type_3: 1, illness_type_4: 0, illness_type_5: 0, illness_type_6: nil, illness_type_7: nil, illness_type_8: nil, illness_type_9: nil, illness_type_10: nil, bulk_upload:, assigned_to: user) + log.save!(validate: false) + initial_updated_at = log.updated_at + + task.invoke + log.reload + + expect(log.updated_at).to eq(initial_updated_at) + end + end + end + end +end diff --git a/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb index b6ea44040..33ab390f4 100644 --- a/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb @@ -1246,6 +1246,32 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do expect(parser.errors[:field_111]).to be_present end end + + context "when some reasonable preference options are seleceted" do + let(:attributes) { setup_section_params.merge({ bulk_upload:, field_106: "1", field_107: "1", field_108: nil, field_109: "1", field_110: nil, field_111: nil }) } + + it "sets the rest of the options to 0" do + parser.valid? + expect(parser.log.rp_homeless).to eq(1) + expect(parser.log.rp_insan_unsat).to eq(0) + expect(parser.log.rp_medwel).to eq(1) + expect(parser.log.rp_hardship).to eq(0) + expect(parser.log.rp_dontknow).to eq(0) + end + end + + context "when some reasonable preference options are seleceted but reasonpref is No" do + let(:attributes) { setup_section_params.merge({ bulk_upload:, field_106: "2", field_107: "1", field_108: nil, field_109: "1", field_110: nil, field_111: nil }) } + + it "sets the options to nil" do + parser.valid? + expect(parser.log.rp_homeless).to be_nil + expect(parser.log.rp_insan_unsat).to be_nil + expect(parser.log.rp_medwel).to be_nil + expect(parser.log.rp_hardship).to be_nil + expect(parser.log.rp_dontknow).to be_nil + end + end end describe "#field_116" do # referral @@ -2484,6 +2510,42 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do end end end + + context "when some illness type values are seleceted" do + let(:attributes) { setup_section_params.merge({ bulk_upload:, field_85: "1", field_94: "1", field_87: "1" }) } + + it "sets the rest of the values to 0" do + parser.valid? + expect(parser.log.illness_type_1).to eq(1) + expect(parser.log.illness_type_2).to eq(0) + expect(parser.log.illness_type_3).to eq(0) + expect(parser.log.illness_type_4).to eq(0) + expect(parser.log.illness_type_5).to eq(1) + expect(parser.log.illness_type_6).to eq(0) + expect(parser.log.illness_type_7).to eq(0) + expect(parser.log.illness_type_8).to eq(0) + expect(parser.log.illness_type_9).to eq(0) + expect(parser.log.illness_type_10).to eq(0) + end + end + + context "when none of the illness type values are seleceted" do + let(:attributes) { setup_section_params.merge({ bulk_upload:, field_85: "1" }) } + + it "sets the values to nil" do + parser.valid? + expect(parser.log.illness_type_1).to be_nil + expect(parser.log.illness_type_2).to be_nil + expect(parser.log.illness_type_3).to be_nil + expect(parser.log.illness_type_4).to be_nil + expect(parser.log.illness_type_5).to be_nil + expect(parser.log.illness_type_6).to be_nil + expect(parser.log.illness_type_7).to be_nil + expect(parser.log.illness_type_8).to be_nil + expect(parser.log.illness_type_9).to be_nil + expect(parser.log.illness_type_10).to be_nil + end + end end describe "#irproduct_other" do From 8acdd169dda8d64fef08b87c5cce17e74a802c88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 10:13:38 +0000 Subject: [PATCH 06/15] Bump rack from 3.1.8 to 3.1.10 (#2942) Bumps [rack](https://github.com/rack/rack) from 3.1.8 to 3.1.10. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/v3.1.8...v3.1.10) --- updated-dependencies: - dependency-name: rack dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 942521e82..7a689fd6a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -337,7 +337,7 @@ GEM activesupport (>= 3.0.0) raabro (1.4.0) racc (1.8.1) - rack (3.1.8) + rack (3.1.10) rack-attack (6.7.0) rack (>= 1.0, < 4) rack-mini-profiler (3.3.1) From 637f1fb8907070215e113dc120f89d664a98ec2d Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Fri, 14 Feb 2025 10:14:46 +0000 Subject: [PATCH 07/15] CLDC-3862 Update potential errors wording (#2933) * Update potential errors wording * More content updates * Update test --- app/components/bulk_upload_error_row_component.html.erb | 6 +++--- app/components/bulk_upload_summary_component.html.erb | 2 +- app/helpers/tag_helper.rb | 2 +- app/mailers/bulk_upload_mailer.rb | 2 +- app/models/bulk_upload_error.rb | 1 + app/views/bulk_upload_lettings_results/show.html.erb | 3 ++- app/views/bulk_upload_sales_results/show.html.erb | 3 ++- spec/components/bulk_upload_error_row_component_spec.rb | 2 +- spec/components/bulk_upload_summary_component_spec.rb | 4 ++-- spec/mailers/bulk_upload_mailer_spec.rb | 2 +- 10 files changed, 15 insertions(+), 12 deletions(-) diff --git a/app/components/bulk_upload_error_row_component.html.erb b/app/components/bulk_upload_error_row_component.html.erb index db1ceab7a..8cfdb674e 100644 --- a/app/components/bulk_upload_error_row_component.html.erb +++ b/app/components/bulk_upload_error_row_component.html.erb @@ -37,14 +37,14 @@ <% end %> <% if potential_errors.any? %> -

Potential errors

-

The following groups of cells might have conflicting data. Check the answers and fix any incorrect data.

If the answers are correct, fix the critical errors and upload the file again. You'll need to confirm that the following data is correct when the file only contains potential errors.

+

Confirmation needed

+

Potential data discrepancies exist in the following cells.

Please resolve all critical errors and review the cells with data discrepancies before re-uploading the file. Bulk confirmation of potential discrepancies is accessible only after all critical errors have been resolved.

<%= govuk_table(html_attributes: { class: "no-bottom-border" }) do |table| %> <%= table.with_head do |head| %> <% head.with_row do |row| %> <% row.with_cell(header: true, text: "Cell") %> <% row.with_cell(header: true, text: "Question") %> - <% row.with_cell(header: true, text: "Potential error") %> + <% row.with_cell(header: true, text: "Confirmation needed") %> <% row.with_cell(header: true, text: "Specification") %> <% end %> <% end %> diff --git a/app/components/bulk_upload_summary_component.html.erb b/app/components/bulk_upload_summary_component.html.erb index a7ac57da3..77192eaee 100644 --- a/app/components/bulk_upload_summary_component.html.erb +++ b/app/components/bulk_upload_summary_component.html.erb @@ -28,7 +28,7 @@ [bulk_upload.total_logs_count, "total log"], [setup_errors_count, "error on important questions", "errors on important questions"], [critical_errors_count, "critical error"], - [potential_errors_count, "potential error"], + [potential_errors_count, "confirmation needed", "confirmations needed"], ) %> <% end %> diff --git a/app/helpers/tag_helper.rb b/app/helpers/tag_helper.rb index 3ecea6d25..110198550 100644 --- a/app/helpers/tag_helper.rb +++ b/app/helpers/tag_helper.rb @@ -24,7 +24,7 @@ module TagHelper processing_error: "Error processing CSV", important_errors: "Errors on important questions in CSV", critical_errors: "Critical errors in CSV", - potential_errors: "Potential errors in CSV", + potential_errors: "Confirmation needed in CSV", logs_uploaded_with_errors: "Logs uploaded with errors", errors_fixed_in_service: "Errors fixed on site", logs_uploaded_no_errors: "Logs uploaded with no errors", diff --git a/app/mailers/bulk_upload_mailer.rb b/app/mailers/bulk_upload_mailer.rb index 7c62f71a1..3029a7998 100644 --- a/app/mailers/bulk_upload_mailer.rb +++ b/app/mailers/bulk_upload_mailer.rb @@ -29,7 +29,7 @@ class BulkUploadMailer < NotifyMailer def send_check_soft_validations_mail(bulk_upload:) title = "Check your file data" - description = "Some of your #{bulk_upload.year_combo} #{bulk_upload.log_type} data might not be right. Click the link below to review the potential errors, and check your file to see if the data is correct." + description = "We’ve identified potential discrepancies in your #{bulk_upload.year_combo} #{bulk_upload.log_type} data. Please review the flagged information via the link below and cross-reference it with your records to confirm data accuracy." cta_link = if bulk_upload.lettings? bulk_upload_lettings_soft_validations_check_url(bulk_upload, page: "confirm-soft-errors") else diff --git a/app/models/bulk_upload_error.rb b/app/models/bulk_upload_error.rb index 154fca2fc..85c362e7c 100644 --- a/app/models/bulk_upload_error.rb +++ b/app/models/bulk_upload_error.rb @@ -6,6 +6,7 @@ class BulkUploadError < ApplicationRecord scope :order_by_col, -> { order(Arel.sql("LPAD(col, 10, '0')")) } scope :important, -> { where(category: "setup") } scope :potential, -> { where(category: "soft_validation") } + scope :not_potential, -> { where.not(category: "soft_validation").or(where(category: nil)) } scope :critical, -> { where(category: nil).or(where.not(category: %w[setup soft_validation])) } scope :critical_or_important, -> { critical.or(important) } end diff --git a/app/views/bulk_upload_lettings_results/show.html.erb b/app/views/bulk_upload_lettings_results/show.html.erb index 8aba5eaf7..5eedefe49 100644 --- a/app/views/bulk_upload_lettings_results/show.html.erb +++ b/app/views/bulk_upload_lettings_results/show.html.erb @@ -7,7 +7,8 @@
Upload lettings logs in bulk (<%= @bulk_upload.year_combo %>) -

We found <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> in your file

+ <% error_word = @bulk_upload.bulk_upload_errors.not_potential.any? ? "error" : "discrepancy" %> +

We found <%= pluralize(@bulk_upload.bulk_upload_errors.count, error_word) %> in your file

Here’s a list of everything that you need to fix your spreadsheet. You can download the <%= govuk_link_to "specification", Forms::BulkUploadForm::PrepareYourFile.new(year: @bulk_upload.year, log_type: "lettings").specification_path, target: "_blank" %> to help you fix the cells in your CSV file. diff --git a/app/views/bulk_upload_sales_results/show.html.erb b/app/views/bulk_upload_sales_results/show.html.erb index f455ad849..2276285fe 100644 --- a/app/views/bulk_upload_sales_results/show.html.erb +++ b/app/views/bulk_upload_sales_results/show.html.erb @@ -7,7 +7,8 @@
Upload sales logs in bulk (<%= @bulk_upload.year_combo %>) -

We found <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> in your file

+ <% error_word = @bulk_upload.bulk_upload_errors.not_potential.any? ? "error" : "discrepancy" %> +

We found <%= pluralize(@bulk_upload.bulk_upload_errors.count, error_word) %> in your file

Here’s a list of everything that you need to fix your spreadsheet. You can download the <%= govuk_link_to "specification", Forms::BulkUploadForm::PrepareYourFile.new(year: @bulk_upload.year, log_type: "sales").specification_path, target: "_blank" %> to help you fix the cells in your CSV file. diff --git a/spec/components/bulk_upload_error_row_component_spec.rb b/spec/components/bulk_upload_error_row_component_spec.rb index b593a0048..2576e7801 100644 --- a/spec/components/bulk_upload_error_row_component_spec.rb +++ b/spec/components/bulk_upload_error_row_component_spec.rb @@ -148,7 +148,7 @@ RSpec.describe BulkUploadErrorRowComponent, type: :component do it "renders the potential errors section" do result = render_inline(described_class.new(bulk_upload_errors:)) - expect(result).to have_content("Potential errors") + expect(result).to have_content("Confirmation needed") end it "renders the potential error message" do diff --git a/spec/components/bulk_upload_summary_component_spec.rb b/spec/components/bulk_upload_summary_component_spec.rb index 544befcb3..b68d8a5a2 100644 --- a/spec/components/bulk_upload_summary_component_spec.rb +++ b/spec/components/bulk_upload_summary_component_spec.rb @@ -64,8 +64,8 @@ RSpec.describe BulkUploadSummaryComponent, type: :component do it "shows the potential errors status and error count" do result = render_inline(described_class.new(bulk_upload:)) - expect(result).to have_content("Potential errors in CSV") - expect(result).to have_content("2 potential errors") + expect(result).to have_content("Confirmation needed in CSV") + expect(result).to have_content("2 confirmations needed") expect(result).to have_content("16 total logs") expect(result).to have_no_content("errors on important") expect(result).to have_no_content("critical") diff --git a/spec/mailers/bulk_upload_mailer_spec.rb b/spec/mailers/bulk_upload_mailer_spec.rb index 910bca4a9..de9321650 100644 --- a/spec/mailers/bulk_upload_mailer_spec.rb +++ b/spec/mailers/bulk_upload_mailer_spec.rb @@ -113,7 +113,7 @@ RSpec.describe BulkUploadMailer do title: "Check your file data", filename: bulk_upload.filename, upload_timestamp: bulk_upload.created_at.to_fs(:govuk_date_and_time), - description: "Some of your #{bulk_upload.year_combo} lettings data might not be right. Click the link below to review the potential errors, and check your file to see if the data is correct.", + description: "We’ve identified potential discrepancies in your #{bulk_upload.year_combo} lettings data. Please review the flagged information via the link below and cross-reference it with your records to confirm data accuracy.", cta_link: bulk_upload_lettings_soft_validations_check_url(bulk_upload, page: "confirm-soft-errors"), }, ) From fd29c683c4e8e6b824713075c0277f1c0f28020d Mon Sep 17 00:00:00 2001 From: carolynbarker <8038496+carolynbarker@users.noreply.github.com> Date: Tue, 18 Feb 2025 11:23:30 +0000 Subject: [PATCH 08/15] Remove invalid option causing migration errors (#2944) * remove invalid option causing errors * specify default precision --------- Co-authored-by: Carolyn --- ...1126142105_user_case_logs_belong_to_organisation.rb | 4 ++-- ...220323094418_create_data_protection_confirmation.rb | 2 +- .../20220427160536_add_created_by_to_case_logs.rb | 2 +- db/migrate/20220826093411_add_sales_log.rb | 6 +++--- db/migrate/20221207141947_add_updated_by_to_logs.rb | 4 ++-- .../20230530094653_add_data_sharing_agreement.rb | 2 +- .../20231121131725_add_sales_managing_organisation.rb | 2 +- db/migrate/20240408102550_add_created_by.rb | 4 ++-- db/schema.rb | 10 +++++----- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/db/migrate/20211126142105_user_case_logs_belong_to_organisation.rb b/db/migrate/20211126142105_user_case_logs_belong_to_organisation.rb index d689910bf..d889d8db9 100644 --- a/db/migrate/20211126142105_user_case_logs_belong_to_organisation.rb +++ b/db/migrate/20211126142105_user_case_logs_belong_to_organisation.rb @@ -5,8 +5,8 @@ class UserCaseLogsBelongToOrganisation < ActiveRecord::Migration[6.1] t.belongs_to :organisation end change_table :case_logs, bulk: true do |t| - t.belongs_to :owning_organisation, class_name: "Organisation" - t.belongs_to :managing_organisation, class_name: "Organisation" + t.belongs_to :owning_organisation + t.belongs_to :managing_organisation end end diff --git a/db/migrate/20220323094418_create_data_protection_confirmation.rb b/db/migrate/20220323094418_create_data_protection_confirmation.rb index 4223022c2..a0d0d2436 100644 --- a/db/migrate/20220323094418_create_data_protection_confirmation.rb +++ b/db/migrate/20220323094418_create_data_protection_confirmation.rb @@ -2,7 +2,7 @@ class CreateDataProtectionConfirmation < ActiveRecord::Migration[7.0] def change create_table :data_protection_confirmations do |t| t.belongs_to :organisation - t.belongs_to :data_protection_officer, class_name: "User", index: { name: :dpo_user_id } + t.belongs_to :data_protection_officer, index: { name: :dpo_user_id } t.column :confirmed, :boolean t.column :old_id, :string t.column :old_org_id, :string diff --git a/db/migrate/20220427160536_add_created_by_to_case_logs.rb b/db/migrate/20220427160536_add_created_by_to_case_logs.rb index 557f17a1a..4d5928176 100644 --- a/db/migrate/20220427160536_add_created_by_to_case_logs.rb +++ b/db/migrate/20220427160536_add_created_by_to_case_logs.rb @@ -1,7 +1,7 @@ class AddCreatedByToCaseLogs < ActiveRecord::Migration[7.0] def change change_table :case_logs, bulk: true do |t| - t.belongs_to :created_by, class_name: "User" + t.belongs_to :created_by end end end diff --git a/db/migrate/20220826093411_add_sales_log.rb b/db/migrate/20220826093411_add_sales_log.rb index 8b14d7f5b..eddea3ad5 100644 --- a/db/migrate/20220826093411_add_sales_log.rb +++ b/db/migrate/20220826093411_add_sales_log.rb @@ -4,9 +4,9 @@ class AddSalesLog < ActiveRecord::Migration[7.0] t.integer :status, default: 0 t.datetime :saledate t.timestamps - t.references :owning_organisation, class_name: "Organisation", foreign_key: { to_table: :organisations, on_delete: :cascade } - t.references :managing_organisation, class_name: "Organisation" - t.references :created_by, class_name: "User" + t.references :owning_organisation, foreign_key: { to_table: :organisations, on_delete: :cascade } + t.references :managing_organisation + t.references :created_by end end end diff --git a/db/migrate/20221207141947_add_updated_by_to_logs.rb b/db/migrate/20221207141947_add_updated_by_to_logs.rb index 9bc80c526..a97ea9e7d 100644 --- a/db/migrate/20221207141947_add_updated_by_to_logs.rb +++ b/db/migrate/20221207141947_add_updated_by_to_logs.rb @@ -1,10 +1,10 @@ class AddUpdatedByToLogs < ActiveRecord::Migration[7.0] def change change_table :lettings_logs, bulk: true do |t| - t.belongs_to :updated_by, class_name: "User" + t.belongs_to :updated_by end change_table :sales_logs, bulk: true do |t| - t.belongs_to :updated_by, class_name: "User" + t.belongs_to :updated_by end end end diff --git a/db/migrate/20230530094653_add_data_sharing_agreement.rb b/db/migrate/20230530094653_add_data_sharing_agreement.rb index a148b32cc..a65aa279c 100644 --- a/db/migrate/20230530094653_add_data_sharing_agreement.rb +++ b/db/migrate/20230530094653_add_data_sharing_agreement.rb @@ -2,7 +2,7 @@ class AddDataSharingAgreement < ActiveRecord::Migration[7.0] def change create_table :data_sharing_agreements do |t| t.belongs_to :organisation - t.belongs_to :data_protection_officer, class_name: "User" + t.belongs_to :data_protection_officer t.datetime :signed_at, null: false t.string :organisation_name, null: false diff --git a/db/migrate/20231121131725_add_sales_managing_organisation.rb b/db/migrate/20231121131725_add_sales_managing_organisation.rb index f4085414a..a77b75c79 100644 --- a/db/migrate/20231121131725_add_sales_managing_organisation.rb +++ b/db/migrate/20231121131725_add_sales_managing_organisation.rb @@ -1,7 +1,7 @@ class AddSalesManagingOrganisation < ActiveRecord::Migration[7.0] def change change_table :sales_logs, bulk: true do |t| - t.references :managing_organisation, class_name: "Organisation" + t.references :managing_organisation end end end diff --git a/db/migrate/20240408102550_add_created_by.rb b/db/migrate/20240408102550_add_created_by.rb index b47e382a5..b7fc65674 100644 --- a/db/migrate/20240408102550_add_created_by.rb +++ b/db/migrate/20240408102550_add_created_by.rb @@ -1,11 +1,11 @@ class AddCreatedBy < ActiveRecord::Migration[7.0] def change change_table :sales_logs do |t| - t.references :created_by, class_name: "User" + t.references :created_by end change_table :lettings_logs do |t| - t.references :created_by, class_name: "User" + t.references :created_by end end end diff --git a/db/schema.rb b/db/schema.rb index 08f6ae3b6..894bb1638 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -245,14 +245,14 @@ ActiveRecord::Schema[7.2].define(version: 2025_01_10_150609) do t.integer "hb" t.integer "hbrentshortfall" t.integer "property_relet" - t.datetime "mrcdate" + t.datetime "mrcdate", precision: nil t.integer "incref" - t.datetime "startdate" + t.datetime "startdate", precision: nil t.integer "armedforces" t.integer "first_time_property_let_as_social_housing" t.integer "unitletas" t.integer "builtype" - t.datetime "voiddate" + t.datetime "voiddate", precision: nil t.bigint "owning_organisation_id" t.bigint "managing_organisation_id" t.integer "renttype" @@ -822,8 +822,8 @@ ActiveRecord::Schema[7.2].define(version: 2025_01_10_150609) do t.string "name" t.bigint "organisation_id" t.integer "sign_in_count", default: 0, null: false - t.datetime "current_sign_in_at" - t.datetime "last_sign_in_at" + t.datetime "current_sign_in_at", precision: nil + t.datetime "last_sign_in_at", precision: nil t.string "current_sign_in_ip" t.string "last_sign_in_ip" t.integer "role" From 04e05354e34677e976988669cfa27c91eb9a3f5b Mon Sep 17 00:00:00 2001 From: carolynbarker <8038496+carolynbarker@users.noreply.github.com> Date: Tue, 18 Feb 2025 11:40:28 +0000 Subject: [PATCH 09/15] add db_host variable to example env file (#2946) Co-authored-by: Carolyn --- .env.example | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.example b/.env.example index 329016da2..600ec8f83 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,6 @@ DB_USERNAME=postgres-user DB_PASSWORD=postgres-password +DB_HOST=localhost GOVUK_NOTIFY_API_KEY= OTP_SECRET_ENCRYPTION_KEY="" From c7265867072efbeb201a0e35474ee331d073cef2 Mon Sep 17 00:00:00 2001 From: Paige-Robbins <149089826+Paige-Robbins@users.noreply.github.com> Date: Wed, 19 Feb 2025 10:39:57 +0000 Subject: [PATCH 10/15] Updating renewal error message (#2949) --- config/locales/validations/lettings/2024/bulk_upload.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/validations/lettings/2024/bulk_upload.en.yml b/config/locales/validations/lettings/2024/bulk_upload.en.yml index a22f65fa5..18d051b4d 100644 --- a/config/locales/validations/lettings/2024/bulk_upload.en.yml +++ b/config/locales/validations/lettings/2024/bulk_upload.en.yml @@ -38,7 +38,7 @@ en: condition_effects: no_choices: "You cannot answer this question as you told us nobody in the household has a physical or mental health condition (or other illness) expected to last 12 months or more." reason: - renewal_reason_needed: "The reason for leaving must be \"End of social or private sector tenancy - no fault\", \"End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)\", \"End of social or private sector tenancy - evicted due to rent arrears\" or \"End of social or private sector tenancy - evicted for any other reason\"." + renewal_reason_needed: "You said this letting is a renewal to the same tenant in the same property in the set up section. This means the tenant's main reason for the household leaving their last settled home must be \"End of social or private sector tenancy - no fault\", \"End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)\", \"End of social or private sector tenancy - evicted due to rent arrears\" or \"End of social or private sector tenancy - evicted for any other reason\"." referral: general_needs_prp_referred_by_la: "The source of the referral cannot be referred by local authority housing department for a general needs log." nominated_by_local_ha_but_la: "The source of the referral cannot be Nominated by local housing authority as your organisation is a local authority." From 551b726ab07067a08d6d01839afcc6ab4f21b542 Mon Sep 17 00:00:00 2001 From: carolynbarker <8038496+carolynbarker@users.noreply.github.com> Date: Wed, 19 Feb 2025 11:36:50 +0000 Subject: [PATCH 11/15] Fix spelling typo in tab title (#2941) Co-authored-by: Carolyn --- app/views/csv_downloads/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/csv_downloads/show.html.erb b/app/views/csv_downloads/show.html.erb index 18f8a67fe..c8cd6b2f8 100644 --- a/app/views/csv_downloads/show.html.erb +++ b/app/views/csv_downloads/show.html.erb @@ -1,4 +1,4 @@ -<% title = "Downlaod CSV file" %> +<% title = "Download CSV file" %> <% content_for :title, title %>
From ca5f11eee3ed02af6dbbd78ae45f2aaa934407a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 15:38:03 +0000 Subject: [PATCH 12/15] Bump nokogiri from 1.16.5 to 1.18.3 in /docs (#2950) * Bump nokogiri from 1.16.5 to 1.18.3 in /docs Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.16.5 to 1.18.3. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.18.3/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.16.5...v1.18.3) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] * update nokogiri --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kat <54268893+kosiakkatrina@users.noreply.github.com> --- Dockerfile | 2 +- Gemfile.lock | 22 ++++++++++------------ docs/Gemfile.lock | 10 +++++----- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index c1a5e7cc3..5150b5b89 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN apk add --update --no-cache tzdata && \ RUN apk add --no-cache build-base=0.5-r3 busybox=1.36.1-r7 nodejs-current=20.8.1-r0 yarn=1.22.19-r0 postgresql13-dev=13.18-r0 bash=5.2.15-r5 # Bundler version should be the same version as what the Gemfile.lock was bundled with -RUN gem install bundler:2.3.14 --no-document +RUN gem install bundler:2.6.4 --no-document COPY .ruby-version Gemfile Gemfile.lock /app/ RUN bundle config set without "development test" diff --git a/Gemfile.lock b/Gemfile.lock index 7a689fd6a..e1a34c6ed 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -288,11 +288,13 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.4) - nokogiri (1.17.1-arm64-darwin) + nokogiri (1.18.3-arm64-darwin) racc (~> 1.4) - nokogiri (1.17.1-x86_64-darwin) + nokogiri (1.18.3-x86_64-darwin) racc (~> 1.4) - nokogiri (1.17.1-x86_64-linux) + nokogiri (1.18.3-x86_64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.3-x86_64-linux-musl) racc (~> 1.4) notifications-ruby-client (6.0.0) jwt (>= 1.5, < 3) @@ -534,14 +536,10 @@ GEM zeitwerk (2.6.18) PLATFORMS - arm64-darwin-21 - arm64-darwin-22 - arm64-darwin-23 - x86_64-darwin-19 - x86_64-darwin-20 - x86_64-darwin-21 - x86_64-darwin-22 - x86_64-linux + arm64-darwin + x86_64-darwin + x86_64-linux-gnu + x86_64-linux-musl DEPENDENCIES auto_strip_attributes @@ -611,4 +609,4 @@ RUBY VERSION ruby 3.1.4p223 BUNDLED WITH - 2.3.14 + 2.6.4 diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index d102b14ef..8abf94d7a 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -210,11 +210,11 @@ GEM jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) minitest (5.19.0) - nokogiri (1.16.5-arm64-darwin) + nokogiri (1.18.3-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.5-x86_64-darwin) + nokogiri (1.18.3-x86_64-darwin) racc (~> 1.4) - nokogiri (1.16.5-x86_64-linux) + nokogiri (1.18.3-x86_64-linux-gnu) racc (~> 1.4) octokit (4.25.1) faraday (>= 1, < 3) @@ -222,7 +222,7 @@ GEM pathutil (0.16.2) forwardable-extended (~> 2.6) public_suffix (4.0.7) - racc (1.7.3) + racc (1.8.1) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) @@ -264,4 +264,4 @@ DEPENDENCIES webrick BUNDLED WITH - 2.3.14 + 2.6.4 From 68c433bb9bf64030e15a9402b1abdd6581d2d263 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Thu, 20 Feb 2025 16:12:57 +0000 Subject: [PATCH 13/15] Update question 5 sales copy in 2025/26 (#2952) --- config/locales/forms/2025/sales/setup.en.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/forms/2025/sales/setup.en.yml b/config/locales/forms/2025/sales/setup.en.yml index a3cca0609..3f29f9a18 100644 --- a/config/locales/forms/2025/sales/setup.en.yml +++ b/config/locales/forms/2025/sales/setup.en.yml @@ -42,8 +42,8 @@ en: page_header: "" check_answer_label: "Purchase made under ownership scheme" check_answer_prompt: "Tell us if purchase made under ownership scheme" - hint_text: "" - question_text: "Was this purchase made through an ownership scheme?" + hint_text: "Sales logs are not required for outright and other sales." + question_text: "Select the type of sale" staircasing: page_header: "" From b8fb9726a3c5945c18fe96b3b51cb7f42a206b59 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Thu, 20 Feb 2025 17:18:50 +0000 Subject: [PATCH 14/15] CLDC-3807: Update lettings 2025/26 question numbering (#2953) * Update lettings 2025/26 question numbering * Add some question number tests * lint * Update address question numbers * Update uprn question --- .../form/lettings/pages/address_fallback.rb | 2 +- .../form/lettings/questions/address_line1.rb | 2 +- .../form/lettings/questions/brent_4_weekly.rb | 2 +- .../lettings/questions/brent_bi_weekly.rb | 2 +- .../form/lettings/questions/brent_monthly.rb | 2 +- .../form/lettings/questions/brent_weekly.rb | 2 +- app/models/form/lettings/questions/county.rb | 2 +- ...rst_time_property_let_as_social_housing.rb | 2 +- .../lettings/questions/hbrentshortfall.rb | 2 +- app/models/form/lettings/questions/joint.rb | 2 +- app/models/form/lettings/questions/la.rb | 2 +- .../questions/postcode_for_full_address.rb | 2 +- .../lettings/questions/previous_let_type.rb | 2 +- .../lettings/questions/pscharge_4_weekly.rb | 2 +- .../lettings/questions/pscharge_bi_weekly.rb | 2 +- .../lettings/questions/pscharge_monthly.rb | 2 +- .../lettings/questions/pscharge_weekly.rb | 2 +- app/models/form/lettings/questions/rsnvac.rb | 2 +- .../lettings/questions/rsnvac_first_let.rb | 2 +- .../lettings/questions/scharge_4_weekly.rb | 2 +- .../lettings/questions/scharge_bi_weekly.rb | 2 +- .../lettings/questions/scharge_monthly.rb | 2 +- .../form/lettings/questions/scharge_weekly.rb | 2 +- .../form/lettings/questions/sheltered.rb | 2 +- .../questions/starter_tenancy_type.rb | 2 +- .../form/lettings/questions/startertenancy.rb | 2 +- .../lettings/questions/supcharg_4_weekly.rb | 2 +- .../lettings/questions/supcharg_bi_weekly.rb | 2 +- .../lettings/questions/supcharg_monthly.rb | 2 +- .../lettings/questions/supcharg_weekly.rb | 2 +- .../form/lettings/questions/tenancy_length.rb | 2 +- .../tenancy_length_affordable_rent.rb | 2 +- .../tenancy_length_intermediate_rent.rb | 2 +- .../questions/tenancy_length_periodic.rb | 2 +- .../form/lettings/questions/tenancy_other.rb | 2 +- .../form/lettings/questions/tenancy_type.rb | 2 +- .../form/lettings/questions/town_or_city.rb | 2 +- .../form/lettings/questions/tshortfall.rb | 2 +- .../lettings/questions/tshortfall_known.rb | 2 +- app/models/form/lettings/questions/uprn.rb | 2 +- .../form/lettings/questions/uprn_known.rb | 2 +- ...ime_property_let_as_social_housing_spec.rb | 18 +++++++++++++ .../form/lettings/questions/joint_spec.rb | 24 +++++++++++++++++ .../models/form/lettings/questions/la_spec.rb | 24 +++++++++++++++++ .../questions/previous_let_type_spec.rb | 12 +++++++++ .../form/lettings/questions/rsnvac_spec.rb | 22 +++++++++++++-- .../form/lettings/questions/sheltered_spec.rb | 12 +++++++++ .../questions/starter_tenancy_type_spec.rb | 18 +++++++++++++ .../tenancy_length_affordable_rent_spec.rb | 27 ++++++++++++++++++- .../tenancy_length_intermediate_rent_spec.rb | 27 ++++++++++++++++++- .../questions/tenancy_length_periodic_spec.rb | 27 ++++++++++++++++++- .../lettings/questions/tenancy_length_spec.rb | 27 ++++++++++++++++++- .../lettings/questions/tenancy_other_spec.rb | 27 ++++++++++++++++++- .../lettings/questions/tenancy_type_spec.rb | 21 ++++++++++++++- 54 files changed, 319 insertions(+), 49 deletions(-) diff --git a/app/models/form/lettings/pages/address_fallback.rb b/app/models/form/lettings/pages/address_fallback.rb index 763f9d3da..fd580a3ed 100644 --- a/app/models/form/lettings/pages/address_fallback.rb +++ b/app/models/form/lettings/pages/address_fallback.rb @@ -24,5 +24,5 @@ class Form::Lettings::Pages::AddressFallback < ::Form::Page ] end - QUESTION_NUMBER_FROM_YEAR = { 2024 => 13, 2025 => 13 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2024 => 13, 2025 => 17 }.freeze end diff --git a/app/models/form/lettings/questions/address_line1.rb b/app/models/form/lettings/questions/address_line1.rb index 7da9720eb..4b1f67931 100644 --- a/app/models/form/lettings/questions/address_line1.rb +++ b/app/models/form/lettings/questions/address_line1.rb @@ -18,5 +18,5 @@ class Form::Lettings::Questions::AddressLine1 < ::Form::Question ].select(&:present?).join("\n") end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13, 2025 => 17 }.freeze end diff --git a/app/models/form/lettings/questions/brent_4_weekly.rb b/app/models/form/lettings/questions/brent_4_weekly.rb index 2dc18ba56..dab6b26da 100644 --- a/app/models/form/lettings/questions/brent_4_weekly.rb +++ b/app/models/form/lettings/questions/brent_4_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::Brent4Weekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94, 2025 => 92 }.freeze end diff --git a/app/models/form/lettings/questions/brent_bi_weekly.rb b/app/models/form/lettings/questions/brent_bi_weekly.rb index d8bcfa136..a7f97f93d 100644 --- a/app/models/form/lettings/questions/brent_bi_weekly.rb +++ b/app/models/form/lettings/questions/brent_bi_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::BrentBiWeekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94, 2025 => 92 }.freeze end diff --git a/app/models/form/lettings/questions/brent_monthly.rb b/app/models/form/lettings/questions/brent_monthly.rb index a96239d7a..f653b5177 100644 --- a/app/models/form/lettings/questions/brent_monthly.rb +++ b/app/models/form/lettings/questions/brent_monthly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::BrentMonthly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94, 2025 => 92 }.freeze end diff --git a/app/models/form/lettings/questions/brent_weekly.rb b/app/models/form/lettings/questions/brent_weekly.rb index 155addfec..4a120b603 100644 --- a/app/models/form/lettings/questions/brent_weekly.rb +++ b/app/models/form/lettings/questions/brent_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::BrentWeekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94, 2025 => 92 }.freeze end diff --git a/app/models/form/lettings/questions/county.rb b/app/models/form/lettings/questions/county.rb index 27e17645e..12585fa8e 100644 --- a/app/models/form/lettings/questions/county.rb +++ b/app/models/form/lettings/questions/county.rb @@ -10,5 +10,5 @@ class Form::Lettings::Questions::County < ::Form::Question @hide_question_number_on_page = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13, 2025 => 17 }.freeze end diff --git a/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb b/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb index bc1c66cb4..0f737fa6e 100644 --- a/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb +++ b/app/models/form/lettings/questions/first_time_property_let_as_social_housing.rb @@ -22,5 +22,5 @@ class Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing < ::Form::Q form.start_year_2024_or_later? ? "This is a re-let of existing social housing stock." : "This is a re-let of existing social housing." end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 14, 2024 => 15 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 14, 2024 => 15, 2025 => 12 }.freeze end diff --git a/app/models/form/lettings/questions/hbrentshortfall.rb b/app/models/form/lettings/questions/hbrentshortfall.rb index a34df70e0..15f7744d9 100644 --- a/app/models/form/lettings/questions/hbrentshortfall.rb +++ b/app/models/form/lettings/questions/hbrentshortfall.rb @@ -14,5 +14,5 @@ class Form::Lettings::Questions::Hbrentshortfall < ::Form::Question "3" => { "value" => "Don’t know" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 99, 2024 => 98 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 99, 2024 => 98, 2025 => 96 }.freeze end diff --git a/app/models/form/lettings/questions/joint.rb b/app/models/form/lettings/questions/joint.rb index e28a0085c..b80856495 100644 --- a/app/models/form/lettings/questions/joint.rb +++ b/app/models/form/lettings/questions/joint.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::Joint < ::Form::Question "3" => { "value" => "Don’t know" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 25 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 25, 2024 => 25, 2025 => 26 }.freeze end diff --git a/app/models/form/lettings/questions/la.rb b/app/models/form/lettings/questions/la.rb index 5e1c8ae2b..c6d6f8240 100644 --- a/app/models/form/lettings/questions/la.rb +++ b/app/models/form/lettings/questions/la.rb @@ -13,5 +13,5 @@ class Form::Lettings::Questions::La < ::Form::Question { "" => "Select an option" }.merge(LocalAuthority.active(form.start_date).england.map { |la| [la.code, la.name] }.to_h) end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 13, 2024 => 14 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 13, 2024 => 14, 2025 => 18 }.freeze end diff --git a/app/models/form/lettings/questions/postcode_for_full_address.rb b/app/models/form/lettings/questions/postcode_for_full_address.rb index d6ee9859f..a4c775a55 100644 --- a/app/models/form/lettings/questions/postcode_for_full_address.rb +++ b/app/models/form/lettings/questions/postcode_for_full_address.rb @@ -22,5 +22,5 @@ class Form::Lettings::Questions::PostcodeForFullAddress < ::Form::Question @hide_question_number_on_page = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13, 2025 => 17 }.freeze end diff --git a/app/models/form/lettings/questions/previous_let_type.rb b/app/models/form/lettings/questions/previous_let_type.rb index 509e43503..8270d621c 100644 --- a/app/models/form/lettings/questions/previous_let_type.rb +++ b/app/models/form/lettings/questions/previous_let_type.rb @@ -42,7 +42,7 @@ class Form::Lettings::Questions::PreviousLetType < ::Form::Question "3" => { "value" => "Don’t know" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 16, 2024 => 17 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 16, 2024 => 17, 2025 => 14 }.freeze def answer_options return ANSWER_OPTIONS_AFTER_2025 if form.start_year_2025_or_later? diff --git a/app/models/form/lettings/questions/pscharge_4_weekly.rb b/app/models/form/lettings/questions/pscharge_4_weekly.rb index 56d2e60b8..410f06ada 100644 --- a/app/models/form/lettings/questions/pscharge_4_weekly.rb +++ b/app/models/form/lettings/questions/pscharge_4_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::Pscharge4Weekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96, 2025 => 94 }.freeze end diff --git a/app/models/form/lettings/questions/pscharge_bi_weekly.rb b/app/models/form/lettings/questions/pscharge_bi_weekly.rb index 6022f6019..dcf557cda 100644 --- a/app/models/form/lettings/questions/pscharge_bi_weekly.rb +++ b/app/models/form/lettings/questions/pscharge_bi_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::PschargeBiWeekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96, 2025 => 94 }.freeze end diff --git a/app/models/form/lettings/questions/pscharge_monthly.rb b/app/models/form/lettings/questions/pscharge_monthly.rb index 225db53d3..ce92783d7 100644 --- a/app/models/form/lettings/questions/pscharge_monthly.rb +++ b/app/models/form/lettings/questions/pscharge_monthly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::PschargeMonthly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96, 2025 => 94 }.freeze end diff --git a/app/models/form/lettings/questions/pscharge_weekly.rb b/app/models/form/lettings/questions/pscharge_weekly.rb index 2ff06301c..5f0d90deb 100644 --- a/app/models/form/lettings/questions/pscharge_weekly.rb +++ b/app/models/form/lettings/questions/pscharge_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::PschargeWeekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96, 2025 => 94 }.freeze end diff --git a/app/models/form/lettings/questions/rsnvac.rb b/app/models/form/lettings/questions/rsnvac.rb index 3f767d311..377641c94 100644 --- a/app/models/form/lettings/questions/rsnvac.rb +++ b/app/models/form/lettings/questions/rsnvac.rb @@ -99,5 +99,5 @@ class Form::Lettings::Questions::Rsnvac < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 17, 2024 => 18 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 17, 2024 => 18, 2025 => 15 }.freeze end diff --git a/app/models/form/lettings/questions/rsnvac_first_let.rb b/app/models/form/lettings/questions/rsnvac_first_let.rb index 4b87d059f..27c43896d 100644 --- a/app/models/form/lettings/questions/rsnvac_first_let.rb +++ b/app/models/form/lettings/questions/rsnvac_first_let.rb @@ -14,5 +14,5 @@ class Form::Lettings::Questions::RsnvacFirstLet < ::Form::Question "15" => { "value" => "First let of new-build property" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 15, 2024 => 16 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 15, 2024 => 16, 2025 => 13 }.freeze end diff --git a/app/models/form/lettings/questions/scharge_4_weekly.rb b/app/models/form/lettings/questions/scharge_4_weekly.rb index e91dadab3..8903cff00 100644 --- a/app/models/form/lettings/questions/scharge_4_weekly.rb +++ b/app/models/form/lettings/questions/scharge_4_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::Scharge4Weekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95, 2025 => 93 }.freeze end diff --git a/app/models/form/lettings/questions/scharge_bi_weekly.rb b/app/models/form/lettings/questions/scharge_bi_weekly.rb index 59138835d..ef0948bdf 100644 --- a/app/models/form/lettings/questions/scharge_bi_weekly.rb +++ b/app/models/form/lettings/questions/scharge_bi_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::SchargeBiWeekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95, 2025 => 93 }.freeze end diff --git a/app/models/form/lettings/questions/scharge_monthly.rb b/app/models/form/lettings/questions/scharge_monthly.rb index 33404a8ce..c26b106b0 100644 --- a/app/models/form/lettings/questions/scharge_monthly.rb +++ b/app/models/form/lettings/questions/scharge_monthly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::SchargeMonthly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95, 2025 => 93 }.freeze end diff --git a/app/models/form/lettings/questions/scharge_weekly.rb b/app/models/form/lettings/questions/scharge_weekly.rb index d8e16986e..e62dd577a 100644 --- a/app/models/form/lettings/questions/scharge_weekly.rb +++ b/app/models/form/lettings/questions/scharge_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::SchargeWeekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95, 2025 => 93 }.freeze end diff --git a/app/models/form/lettings/questions/sheltered.rb b/app/models/form/lettings/questions/sheltered.rb index d1aa8454a..4c0ec4c07 100644 --- a/app/models/form/lettings/questions/sheltered.rb +++ b/app/models/form/lettings/questions/sheltered.rb @@ -28,5 +28,5 @@ class Form::Lettings::Questions::Sheltered < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 29 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 29, 2024 => 29, 2025 => 25 }.freeze end diff --git a/app/models/form/lettings/questions/starter_tenancy_type.rb b/app/models/form/lettings/questions/starter_tenancy_type.rb index 03d3fee88..dfda74bc0 100644 --- a/app/models/form/lettings/questions/starter_tenancy_type.rb +++ b/app/models/form/lettings/questions/starter_tenancy_type.rb @@ -65,5 +65,5 @@ class Form::Lettings::Questions::StarterTenancyType < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 27 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 27, 2024 => 27, 2025 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/startertenancy.rb b/app/models/form/lettings/questions/startertenancy.rb index 44b592cd6..6bec6a360 100644 --- a/app/models/form/lettings/questions/startertenancy.rb +++ b/app/models/form/lettings/questions/startertenancy.rb @@ -10,5 +10,5 @@ class Form::Lettings::Questions::Startertenancy < ::Form::Question ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "2" => { "value" => "No" } }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 26 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 26, 2024 => 26, 2025 => 27 }.freeze end diff --git a/app/models/form/lettings/questions/supcharg_4_weekly.rb b/app/models/form/lettings/questions/supcharg_4_weekly.rb index cd3b7beed..c8139c2bf 100644 --- a/app/models/form/lettings/questions/supcharg_4_weekly.rb +++ b/app/models/form/lettings/questions/supcharg_4_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::Supcharg4Weekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97, 2025 => 95 }.freeze end diff --git a/app/models/form/lettings/questions/supcharg_bi_weekly.rb b/app/models/form/lettings/questions/supcharg_bi_weekly.rb index dba861ebe..1a73883dc 100644 --- a/app/models/form/lettings/questions/supcharg_bi_weekly.rb +++ b/app/models/form/lettings/questions/supcharg_bi_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::SupchargBiWeekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97, 2025 => 95 }.freeze end diff --git a/app/models/form/lettings/questions/supcharg_monthly.rb b/app/models/form/lettings/questions/supcharg_monthly.rb index 3b5b3e41c..481766de9 100644 --- a/app/models/form/lettings/questions/supcharg_monthly.rb +++ b/app/models/form/lettings/questions/supcharg_monthly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::SupchargMonthly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97, 2025 => 95 }.freeze end diff --git a/app/models/form/lettings/questions/supcharg_weekly.rb b/app/models/form/lettings/questions/supcharg_weekly.rb index f48a8ccfe..f85052001 100644 --- a/app/models/form/lettings/questions/supcharg_weekly.rb +++ b/app/models/form/lettings/questions/supcharg_weekly.rb @@ -15,5 +15,5 @@ class Form::Lettings::Questions::SupchargWeekly < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97, 2025 => 95 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length.rb b/app/models/form/lettings/questions/tenancy_length.rb index 1bf868377..a3155f8c0 100644 --- a/app/models/form/lettings/questions/tenancy_length.rb +++ b/app/models/form/lettings/questions/tenancy_length.rb @@ -12,5 +12,5 @@ class Form::Lettings::Questions::TenancyLength < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 28, 2025 => 29 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb b/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb index 8e79924aa..58b83fe90 100644 --- a/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb +++ b/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb @@ -12,5 +12,5 @@ class Form::Lettings::Questions::TenancyLengthAffordableRent < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 28, 2025 => 29 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb b/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb index 1bf3bd7cc..c85583d95 100644 --- a/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb +++ b/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb @@ -12,5 +12,5 @@ class Form::Lettings::Questions::TenancyLengthIntermediateRent < ::Form::Questio @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 28, 2025 => 29 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length_periodic.rb b/app/models/form/lettings/questions/tenancy_length_periodic.rb index c65f41399..e7f9336ec 100644 --- a/app/models/form/lettings/questions/tenancy_length_periodic.rb +++ b/app/models/form/lettings/questions/tenancy_length_periodic.rb @@ -12,5 +12,5 @@ class Form::Lettings::Questions::TenancyLengthPeriodic < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 28 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 28, 2025 => 29 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_other.rb b/app/models/form/lettings/questions/tenancy_other.rb index 3fb3469ee..8a8a94108 100644 --- a/app/models/form/lettings/questions/tenancy_other.rb +++ b/app/models/form/lettings/questions/tenancy_other.rb @@ -8,5 +8,5 @@ class Form::Lettings::Questions::TenancyOther < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 27 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 27, 2024 => 27, 2025 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_type.rb b/app/models/form/lettings/questions/tenancy_type.rb index c67895bef..96fda2687 100644 --- a/app/models/form/lettings/questions/tenancy_type.rb +++ b/app/models/form/lettings/questions/tenancy_type.rb @@ -65,5 +65,5 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 27 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 27, 2024 => 27, 2025 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/town_or_city.rb b/app/models/form/lettings/questions/town_or_city.rb index 14ed19dfc..5673b7f01 100644 --- a/app/models/form/lettings/questions/town_or_city.rb +++ b/app/models/form/lettings/questions/town_or_city.rb @@ -10,5 +10,5 @@ class Form::Lettings::Questions::TownOrCity < ::Form::Question @hide_question_number_on_page = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13, 2025 => 17 }.freeze end diff --git a/app/models/form/lettings/questions/tshortfall.rb b/app/models/form/lettings/questions/tshortfall.rb index 3219c7689..aa6c2edbc 100644 --- a/app/models/form/lettings/questions/tshortfall.rb +++ b/app/models/form/lettings/questions/tshortfall.rb @@ -24,5 +24,5 @@ class Form::Lettings::Questions::Tshortfall < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 100, 2024 => 99 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 100, 2024 => 99, 2025 => 97 }.freeze end diff --git a/app/models/form/lettings/questions/tshortfall_known.rb b/app/models/form/lettings/questions/tshortfall_known.rb index 7a5da7127..8ba0b038c 100644 --- a/app/models/form/lettings/questions/tshortfall_known.rb +++ b/app/models/form/lettings/questions/tshortfall_known.rb @@ -12,5 +12,5 @@ class Form::Lettings::Questions::TshortfallKnown < ::Form::Question ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 100, 2024 => 99 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 100, 2024 => 99, 2025 => 97 }.freeze end diff --git a/app/models/form/lettings/questions/uprn.rb b/app/models/form/lettings/questions/uprn.rb index e6741d25b..7f1f240f9 100644 --- a/app/models/form/lettings/questions/uprn.rb +++ b/app/models/form/lettings/questions/uprn.rb @@ -35,5 +35,5 @@ class Form::Lettings::Questions::Uprn < ::Form::Question "\n\n#{value.join("\n")}" end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 11, 2024 => 12 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 11, 2024 => 12, 2025 => 16 }.freeze end diff --git a/app/models/form/lettings/questions/uprn_known.rb b/app/models/form/lettings/questions/uprn_known.rb index 29d415134..6ac70e415 100644 --- a/app/models/form/lettings/questions/uprn_known.rb +++ b/app/models/form/lettings/questions/uprn_known.rb @@ -30,5 +30,5 @@ class Form::Lettings::Questions::UprnKnown < ::Form::Question I18n.t("validations.property.uprn_known.invalid") end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 11, 2024 => 12 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 11, 2024 => 12, 2025 => 16 }.freeze end diff --git a/spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb b/spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb index 756f5e84e..552734991 100644 --- a/spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb +++ b/spec/models/form/lettings/questions/first_time_property_let_as_social_housing_spec.rb @@ -33,6 +33,8 @@ RSpec.describe Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing, t end context "with 2024/25 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + before do allow(form).to receive(:start_year_2024_or_later?).and_return(true) end @@ -43,5 +45,21 @@ RSpec.describe Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing, t "0" => { "value" => "No", "hint" => "This is a re-let of existing social housing stock." }, }) end + + it "has the correct question number" do + expect(question.question_number).to eq(15) + end + end + + context "with 2025/26 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2025, 4, 1)) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(12) + end end end diff --git a/spec/models/form/lettings/questions/joint_spec.rb b/spec/models/form/lettings/questions/joint_spec.rb index d856e9c18..2a10bc5cf 100644 --- a/spec/models/form/lettings/questions/joint_spec.rb +++ b/spec/models/form/lettings/questions/joint_spec.rb @@ -39,4 +39,28 @@ RSpec.describe Form::Lettings::Questions::Joint, type: :model do it "is not marked as derived" do expect(question.derived?(nil)).to be false end + + context "with 2024/25 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(25) + end + end + + context "with 2025/26 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2025, 4, 1)) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(26) + end + end end diff --git a/spec/models/form/lettings/questions/la_spec.rb b/spec/models/form/lettings/questions/la_spec.rb index 5f8d650f4..9812500c6 100644 --- a/spec/models/form/lettings/questions/la_spec.rb +++ b/spec/models/form/lettings/questions/la_spec.rb @@ -310,4 +310,28 @@ RSpec.describe Form::Lettings::Questions::La, type: :model do "E06000065" => "North Yorkshire", }) end + + context "with 2024/25 form" do + let(:start_date) { Time.utc(2024, 4, 1) } + + before do + allow(subsection.form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(14) + end + end + + context "with 2025/26 form" do + let(:start_date) { Time.utc(2025, 4, 1) } + + before do + allow(subsection.form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(18) + end + end end diff --git a/spec/models/form/lettings/questions/previous_let_type_spec.rb b/spec/models/form/lettings/questions/previous_let_type_spec.rb index 856d88bf5..27ad8b0b0 100644 --- a/spec/models/form/lettings/questions/previous_let_type_spec.rb +++ b/spec/models/form/lettings/questions/previous_let_type_spec.rb @@ -44,6 +44,8 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do end context "with collection year on or after 2024" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + before do allow(form).to receive(:start_year_2024_or_later?).and_return(true) end @@ -60,9 +62,15 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do "3" => { "value" => "Don’t know" }, }) end + + it "has the correct question number" do + expect(question.question_number).to eq(17) + end end context "with collection year on or after 2025" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2025, 4, 1)) } + before do allow(form).to receive(:start_year_2025_or_later?).and_return(true) end @@ -80,5 +88,9 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do "3" => { "value" => "Don’t know" }, }) end + + it "has the correct question number" do + expect(question.question_number).to eq(14) + end end end diff --git a/spec/models/form/lettings/questions/rsnvac_spec.rb b/spec/models/form/lettings/questions/rsnvac_spec.rb index 5eb37ddb5..6d4145f95 100644 --- a/spec/models/form/lettings/questions/rsnvac_spec.rb +++ b/spec/models/form/lettings/questions/rsnvac_spec.rb @@ -76,7 +76,13 @@ RSpec.describe Form::Lettings::Questions::Rsnvac, type: :model do end end + it "has the correct check_answers_card_number" do + expect(question.check_answers_card_number).to eq(0) + end + context "with 2024/25 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + before do allow(form).to receive(:start_year_2024_or_later?).and_return(true) end @@ -129,9 +135,21 @@ RSpec.describe Form::Lettings::Questions::Rsnvac, type: :model do }, }) end + + it "has the correct question number" do + expect(question.question_number).to eq(18) + end end - it "has the correct check_answers_card_number" do - expect(question.check_answers_card_number).to eq(0) + context "with 2025/26 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2025, 4, 1)) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(15) + end end end diff --git a/spec/models/form/lettings/questions/sheltered_spec.rb b/spec/models/form/lettings/questions/sheltered_spec.rb index 7b3ee9d86..4ff9268da 100644 --- a/spec/models/form/lettings/questions/sheltered_spec.rb +++ b/spec/models/form/lettings/questions/sheltered_spec.rb @@ -26,6 +26,8 @@ RSpec.describe Form::Lettings::Questions::Sheltered, type: :model do end context "with 2024/25 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + before do allow(form).to receive(:start_year_2024_or_later?).and_return(true) allow(form).to receive(:start_year_2025_or_later?).and_return(false) @@ -42,9 +44,15 @@ RSpec.describe Form::Lettings::Questions::Sheltered, type: :model do "4" => { "value" => "Don’t know" }, }) end + + it "has the correct question number" do + expect(question.question_number).to eq(29) + end end context "with 2025/26 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2025, 4, 1)) } + before do allow(form).to receive(:start_year_2024_or_later?).and_return(true) allow(form).to receive(:start_year_2025_or_later?).and_return(true) @@ -60,6 +68,10 @@ RSpec.describe Form::Lettings::Questions::Sheltered, type: :model do "4" => { "value" => "Don’t know" }, }) end + + it "has the correct question number" do + expect(question.question_number).to eq(25) + end end it "is not marked as derived" do diff --git a/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb b/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb index 1100796c8..b6ae1ed92 100644 --- a/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb +++ b/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb @@ -49,6 +49,8 @@ RSpec.describe Form::Lettings::Questions::StarterTenancyType, type: :model do end context "with 2024/25 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + before do allow(form).to receive(:start_year_2024_or_later?).and_return(true) end @@ -84,5 +86,21 @@ RSpec.describe Form::Lettings::Questions::StarterTenancyType, type: :model do }, ) end + + it "has the correct question number" do + expect(question.question_number).to eq(27) + end + end + + context "with 2025/26 form" do + let(:form) { instance_double(Form, start_date: Time.zone.local(2025, 4, 1)) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(28) + end end end diff --git a/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb b/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb index ba9a72001..2763bfd42 100644 --- a/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb @@ -7,7 +7,8 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthAffordableRent, type: :mo let(:question_definition) { nil } let(:page) { instance_double(Form::Page, id: "affordable_tenancy_length") } let(:subsection) { instance_double(Form::Subsection) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } + let(:form) { instance_double(Form, start_date:) } + let(:start_date) { Time.utc(2023, 4, 1) } before do allow(form).to receive(:start_year_2024_or_later?).and_return(false) @@ -26,4 +27,28 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthAffordableRent, type: :mo it "has the correct type" do expect(question.type).to eq("numeric") end + + context "with 2024/25 form" do + let(:start_date) { Time.utc(2024, 4, 1) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(28) + end + end + + context "with 2025/26 form" do + let(:start_date) { Time.utc(2025, 4, 1) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(29) + end + end end diff --git a/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb b/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb index 55b51ccfa..5b58d55db 100644 --- a/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb @@ -7,7 +7,8 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthIntermediateRent, type: : let(:question_definition) { nil } let(:page) { instance_double(Form::Page, id: "intermediate_tenancy_length") } let(:subsection) { instance_double(Form::Subsection) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } + let(:form) { instance_double(Form, start_date:) } + let(:start_date) { Time.utc(2023, 4, 1) } before do allow(form).to receive(:start_year_2024_or_later?).and_return(false) @@ -26,4 +27,28 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthIntermediateRent, type: : it "has the correct type" do expect(question.type).to eq("numeric") end + + context "with 2024/25 form" do + let(:start_date) { Time.utc(2024, 4, 1) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(28) + end + end + + context "with 2025/26 form" do + let(:start_date) { Time.utc(2025, 4, 1) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(29) + end + end end diff --git a/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb b/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb index 449677736..4bb511dbc 100644 --- a/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthPeriodic, type: :model do let(:question_id) { nil } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))), id: "periodic_tenancy_length") } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date:)), id: "periodic_tenancy_length") } + let(:start_date) { Time.utc(2023, 4, 1) } it "has correct page" do expect(question.page).to eq(page) @@ -18,4 +19,28 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthPeriodic, type: :model do it "has the correct type" do expect(question.type).to eq("numeric") end + + context "with 2024/25 form" do + let(:start_date) { Time.utc(2024, 4, 1) } + + before do + allow(page.subsection.form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(28) + end + end + + context "with 2025/26 form" do + let(:start_date) { Time.utc(2025, 4, 1) } + + before do + allow(page.subsection.form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(29) + end + end end diff --git a/spec/models/form/lettings/questions/tenancy_length_spec.rb b/spec/models/form/lettings/questions/tenancy_length_spec.rb index cc7bf9f9f..3046c290f 100644 --- a/spec/models/form/lettings/questions/tenancy_length_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_spec.rb @@ -3,7 +3,8 @@ require "rails_helper" RSpec.describe Form::Lettings::Questions::TenancyLength, type: :model do subject(:question) { described_class.new(nil, nil, page) } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))), id: "tenancy_length") } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date:)), id: "tenancy_length") } + let(:start_date) { Time.utc(2023, 4, 1) } it "has correct page" do expect(question.page).to eq(page) @@ -29,4 +30,28 @@ RSpec.describe Form::Lettings::Questions::TenancyLength, type: :model do it "is not marked as derived" do expect(question.derived?(nil)).to be false end + + context "with 2024/25 form" do + let(:start_date) { Time.utc(2024, 4, 1) } + + before do + allow(page.subsection.form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(28) + end + end + + context "with 2025/26 form" do + let(:start_date) { Time.utc(2025, 4, 1) } + + before do + allow(page.subsection.form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(29) + end + end end diff --git a/spec/models/form/lettings/questions/tenancy_other_spec.rb b/spec/models/form/lettings/questions/tenancy_other_spec.rb index a6a2962dc..38bd87d05 100644 --- a/spec/models/form/lettings/questions/tenancy_other_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_other_spec.rb @@ -3,7 +3,8 @@ require "rails_helper" RSpec.describe Form::Lettings::Questions::TenancyOther, type: :model do subject(:question) { described_class.new(nil, nil, page) } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))), id: "tenancy_type") } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date:)), id: "tenancy_type") } + let(:start_date) { Time.utc(2023, 4, 1) } it "has correct page" do expect(question.page).to eq(page) @@ -20,4 +21,28 @@ RSpec.describe Form::Lettings::Questions::TenancyOther, type: :model do it "is not marked as derived" do expect(question.derived?(nil)).to be false end + + context "with 2024/25 form" do + let(:start_date) { Time.utc(2024, 4, 1) } + + before do + allow(page.subsection.form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(27) + end + end + + context "with 2025/26 form" do + let(:start_date) { Time.utc(2025, 4, 1) } + + before do + allow(page.subsection.form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(28) + end + end end diff --git a/spec/models/form/lettings/questions/tenancy_type_spec.rb b/spec/models/form/lettings/questions/tenancy_type_spec.rb index 82a5ae3e7..13cb5bb77 100644 --- a/spec/models/form/lettings/questions/tenancy_type_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_type_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Lettings::Questions::TenancyType, type: :model do let(:page) { instance_double(Form::Page, id: "tenancy_type") } let(:subsection) { instance_double(Form::Subsection) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } + let(:form) { instance_double(Form, start_date:) } + let(:start_date) { Time.utc(2023, 4, 1) } before do allow(form).to receive(:start_year_2024_or_later?).and_return(false) @@ -64,6 +65,8 @@ RSpec.describe Form::Lettings::Questions::TenancyType, type: :model do end context "with 2024/25 form" do + let(:start_date) { Time.utc(2024, 4, 1) } + before do allow(form).to receive(:start_year_2024_or_later?).and_return(true) end @@ -99,6 +102,22 @@ RSpec.describe Form::Lettings::Questions::TenancyType, type: :model do }, ) end + + it "has the correct question number" do + expect(question.question_number).to eq(27) + end + end + + context "with 2025/26 form" do + let(:start_date) { Time.utc(2025, 4, 1) } + + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + end + + it "has the correct question number" do + expect(question.question_number).to eq(28) + end end it "is not marked as derived" do From a57d79fd1d6b50b30fd81aaf98cf10174fb06996 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Fri, 21 Feb 2025 08:16:14 +0000 Subject: [PATCH 15/15] Update alpine and ruby versions (#2951) * Update ruby and alpine * install libpq-dev * Run bundle install --- .ruby-version | 2 +- Dockerfile | 4 ++-- Gemfile | 2 +- Gemfile.lock | 2 +- docs/setup.md | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.ruby-version b/.ruby-version index 0aec50e6e..9cec7165a 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.4 +3.1.6 diff --git a/Dockerfile b/Dockerfile index 5150b5b89..281fd6ca2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.1.4-alpine3.18 as base +FROM ruby:3.1.6-alpine3.20 as base WORKDIR /app @@ -10,7 +10,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-r7 nodejs-current=20.8.1-r0 yarn=1.22.19-r0 postgresql13-dev=13.18-r0 bash=5.2.15-r5 +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 # Bundler version should be the same version as what the Gemfile.lock was bundled with RUN gem install bundler:2.6.4 --no-document diff --git a/Gemfile b/Gemfile index 033706b39..ad13e4959 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby "3.1.4" +ruby "3.1.6" # 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 e1a34c6ed..2ac846554 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -606,7 +606,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 3.1.4p223 + ruby 3.1.6p260 BUNDLED WITH 2.6.4 diff --git a/docs/setup.md b/docs/setup.md index 4400a7ae2..7b7eed9b9 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -66,8 +66,8 @@ We recommend using [nvm](https://github.com/nvm-sh/nvm) to manage NodeJS version 4. Install Ruby and Bundler ```bash - rbenv install 3.1.4 - rbenv global 3.1.4 + rbenv install 3.1.6 + rbenv global 3.1.6 source ~/.bashrc gem install bundler ```