From 7821742b5c02a4450df339c02aa7fceb1a995aa0 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Thu, 19 Feb 2026 13:53:12 +0000 Subject: [PATCH 01/11] CLDC-4151: Split Referral into three questions (#3150) * CLDC-4151: Note deprecations of existing referral questions * CLDC-4151: Add new cols to lettings log model * CLDC-4151: Add new referrals questions * CLDC-4151: Remove referral value check * CLDC-4151: Add new fields to bulk upload use new fields as presented in bulk upload * CLDC-4151: Update tests also add bulk upload file to test with * CLDC-4151: Ignore tests failing for later tickets * fixup! CLDC-4151: Add new referrals questions start q nums from 2026 * CLDC-4151: Add model tests for new questions * fixup! CLDC-4151: Add new fields to bulk upload export old_visible_id set MAX_COLUMNS correctly check .prp? for prp cols * fixup! CLDC-4151: Update tests clarify tests that may update * fixup! CLDC-4151: Add new fields to bulk upload handle the old_visible_id not existing use override org ID only for the output owning ID. it's only passed as eg ORG1 * CLDC-4151: Add new questions to log factory * fixup! CLDC-4151: Add new fields to bulk upload leave field_131 validations till later * CLDC-4188: Add LA flow splits the referral_register question and pages into two, as its not easy to have the answers be dependent if the owning organisation changes type, reset the referral register question. the other questions do not need to be reset as they are no longer routed to * CLDC-4188: Infer referral_register for renewals needs a new dependencies array for 2026 this handles inferring as well as clearing inferred answers if the prior answer changes * CLDC-4188: Add validation between prevten and referral_register block two other validations from previous years * CLDC-4188: Update tests * CLDC-4188: Ignore tests failing for future tickets * CLDC-4188: Update existing tests needed as should_reset_referral_register? calls a .find() * fixup! CLDC-4188: Add validation between prevten and referral_register use .prp? improve grammar * fixup! CLDC-4188: Infer referral_register for renewals extract dependencies to common list * fixup! CLDC-4188: Update tests use before and context blocks better * fixup! CLDC-4188: Update tests lint * fixup! CLDC-4188: Update tests remove unneeded referral_type set * CLDC-4189: Add PRP flow * CLDC-4189: Update validation between prevten and referral_register * CLDC-4189: Add tests * fixup! CLDC-4189: Add PRP flow fix typo Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com> * fixup! CLDC-4189: Add tests fix typo * fixup! CLDC-4189: Add tests fix missing cases in page specs use a loop and before blocks for household validation tests * CLDC-4189: Ensure log is not classed as generan needs if prevten isnt answered * fixup! CLDC-4189: Add tests add cases for other internal transfer flow * CLDC-4151: Add final question numbers * fixup! CLDC-4189: Update validation between prevten and referral_register include new code 40 from CLDC-4149 * fixup! CLDC-4151: Add final question numbers reinstate fallback * CLDC-4190: Q84 Referral BU validations (#3155) * CLDC-4151: Note deprecations of existing referral questions * CLDC-4151: Add new cols to lettings log model * CLDC-4151: Add new referrals questions * CLDC-4151: Remove referral value check * CLDC-4151: Add new fields to bulk upload use new fields as presented in bulk upload * CLDC-4151: Update tests also add bulk upload file to test with * CLDC-4151: Ignore tests failing for later tickets * fixup! CLDC-4151: Add new referrals questions start q nums from 2026 * CLDC-4151: Add model tests for new questions * fixup! CLDC-4151: Add new fields to bulk upload export old_visible_id set MAX_COLUMNS correctly check .prp? for prp cols * fixup! CLDC-4151: Update tests clarify tests that may update * fixup! CLDC-4151: Add new fields to bulk upload handle the old_visible_id not existing use override org ID only for the output owning ID. it's only passed as eg ORG1 * CLDC-4151: Add new questions to log factory * fixup! CLDC-4151: Add new fields to bulk upload leave field_131 validations till later * CLDC-4188: Add LA flow splits the referral_register question and pages into two, as its not easy to have the answers be dependent if the owning organisation changes type, reset the referral register question. the other questions do not need to be reset as they are no longer routed to * CLDC-4188: Infer referral_register for renewals needs a new dependencies array for 2026 this handles inferring as well as clearing inferred answers if the prior answer changes * CLDC-4188: Add validation between prevten and referral_register block two other validations from previous years * CLDC-4188: Update tests * CLDC-4188: Ignore tests failing for future tickets * CLDC-4188: Update existing tests needed as should_reset_referral_register? calls a .find() * fixup! CLDC-4188: Add validation between prevten and referral_register use .prp? improve grammar * fixup! CLDC-4188: Infer referral_register for renewals extract dependencies to common list * fixup! CLDC-4188: Update tests use before and context blocks better * fixup! CLDC-4188: Update tests lint * fixup! CLDC-4188: Update tests remove unneeded referral_type set * CLDC-4189: Add PRP flow * CLDC-4189: Update validation between prevten and referral_register * CLDC-4189: Add tests * fixup! CLDC-4189: Add PRP flow fix typo Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com> * fixup! CLDC-4189: Add tests fix typo * fixup! CLDC-4189: Add tests fix missing cases in page specs use a loop and before blocks for household validation tests * CLDC-4189: Ensure log is not classed as generan needs if prevten isnt answered * fixup! CLDC-4189: Add tests add cases for other internal transfer flow * CLDC-4190: Invalidate all referral fields if any are wrong * CLDC-4190: Remove other validations on referral fields * CLDC-4190: Ignore referral validation if BU is renewal * CLDC-4190: Add tests * fixup! CLDC-4190: Invalidate all referral fields if any are wrong add punctuation to comment name validation fields better * fixup! CLDC-4190: Add tests make test names clearer * CLDC-4190: Final field fixes --------- Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com> * CLDC-4191: Q84 Referral CSV and XML export (#3157) * CLDC-4151: Note deprecations of existing referral questions * CLDC-4151: Add new cols to lettings log model * CLDC-4151: Add new referrals questions * CLDC-4151: Remove referral value check * CLDC-4151: Add new fields to bulk upload use new fields as presented in bulk upload * CLDC-4151: Update tests also add bulk upload file to test with * CLDC-4151: Ignore tests failing for later tickets * fixup! CLDC-4151: Add new referrals questions start q nums from 2026 * CLDC-4151: Add model tests for new questions * fixup! CLDC-4151: Add new fields to bulk upload export old_visible_id set MAX_COLUMNS correctly check .prp? for prp cols * fixup! CLDC-4151: Update tests clarify tests that may update * fixup! CLDC-4151: Add new fields to bulk upload handle the old_visible_id not existing use override org ID only for the output owning ID. it's only passed as eg ORG1 * CLDC-4151: Add new questions to log factory * fixup! CLDC-4151: Add new fields to bulk upload leave field_131 validations till later * CLDC-4188: Add LA flow splits the referral_register question and pages into two, as its not easy to have the answers be dependent if the owning organisation changes type, reset the referral register question. the other questions do not need to be reset as they are no longer routed to * CLDC-4188: Infer referral_register for renewals needs a new dependencies array for 2026 this handles inferring as well as clearing inferred answers if the prior answer changes * CLDC-4188: Add validation between prevten and referral_register block two other validations from previous years * CLDC-4188: Update tests * CLDC-4188: Ignore tests failing for future tickets * CLDC-4188: Update existing tests needed as should_reset_referral_register? calls a .find() * fixup! CLDC-4188: Add validation between prevten and referral_register use .prp? improve grammar * fixup! CLDC-4188: Infer referral_register for renewals extract dependencies to common list * fixup! CLDC-4188: Update tests use before and context blocks better * fixup! CLDC-4188: Update tests lint * fixup! CLDC-4188: Update tests remove unneeded referral_type set * CLDC-4189: Add PRP flow * CLDC-4189: Update validation between prevten and referral_register * CLDC-4189: Add tests * fixup! CLDC-4189: Add PRP flow fix typo Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com> * fixup! CLDC-4189: Add tests fix typo * fixup! CLDC-4189: Add tests fix missing cases in page specs use a loop and before blocks for household validation tests * CLDC-4189: Ensure log is not classed as generan needs if prevten isnt answered * fixup! CLDC-4189: Add tests add cases for other internal transfer flow * CLDC-4190: Invalidate all referral fields if any are wrong * CLDC-4190: Remove other validations on referral fields * CLDC-4190: Ignore referral validation if BU is renewal * CLDC-4190: Add tests * fixup! CLDC-4190: Invalidate all referral fields if any are wrong add punctuation to comment name validation fields better * fixup! CLDC-4190: Add tests make test names clearer * CLDC-4191: Update CSV export tests the export happens by default, no changes needed here * CLDC-4191: Add new referral fields to 2026 exports remove old referral fields from 2026 exports ensure new referral fields don't show in pre 2026 exports * CLDC-4190: Final field fixes --------- Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com> --------- Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com> --- .../bulk_upload/lettings_log_to_csv.rb | 7 +- .../lettings_log_variables.rb | 60 +++-- .../form/lettings/pages/referral_direct.rb | 2 + .../lettings/pages/referral_general_needs.rb | 1 + .../pages/referral_general_needs_prp.rb | 1 + .../form/lettings/pages/referral_hsc.rb | 2 + .../form/lettings/pages/referral_justice.rb | 2 + app/models/form/lettings/pages/referral_la.rb | 2 + .../form/lettings/pages/referral_noms_hr.rb | 15 ++ .../lettings/pages/referral_noms_la_hr.rb | 15 ++ .../pages/referral_org_directly_referred.rb | 15 ++ .../lettings/pages/referral_org_nominated.rb | 15 ++ .../form/lettings/pages/referral_prp.rb | 2 + .../lettings/pages/referral_register_la.rb | 15 ++ .../lettings/pages/referral_register_prp.rb | 15 ++ .../pages/referral_supported_housing.rb | 1 + .../pages/referral_supported_housing_prp.rb | 1 + .../form/lettings/pages/referral_type.rb | 2 + .../lettings/pages/referral_value_check.rb | 1 + .../lettings/questions/referral_direct.rb | 2 + .../questions/referral_general_needs.rb | 1 + .../questions/referral_general_needs_prp.rb | 1 + .../form/lettings/questions/referral_hsc.rb | 2 + .../lettings/questions/referral_justice.rb | 2 + .../form/lettings/questions/referral_la.rb | 2 + .../form/lettings/questions/referral_noms.rb | 49 ++++ .../form/lettings/questions/referral_org.rb | 85 ++++++ .../form/lettings/questions/referral_prp.rb | 2 + .../lettings/questions/referral_register.rb | 56 ++++ .../questions/referral_supported_housing.rb | 1 + .../referral_supported_housing_prp.rb | 1 + .../form/lettings/questions/referral_type.rb | 2 + .../subsections/household_situation.rb | 14 +- app/models/form/question.rb | 7 + app/models/lettings_log.rb | 43 ++- app/models/organisation.rb | 1 + .../validations/household_validations.rb | 11 +- .../lettings/year2026/csv_parser.rb | 4 +- .../lettings/year2026/row_parser.rb | 131 ++++++--- .../exports/lettings_log_export_constants.rb | 9 +- .../2026/lettings/household_situation.en.yml | 24 +- .../2026/lettings/soft_validations.en.yml | 9 - .../lettings/2026/bulk_upload.en.yml | 3 +- .../validations/lettings/household.en.yml | 4 + .../20260123150201_add2026_referral_fields.rb | 9 + db/schema.rb | 3 + spec/factories/lettings_log.rb | 3 + .../exports/general_needs_log_26_27.xml | 4 +- .../files/2026_27_lettings_bulk_upload.csv | 18 +- .../lettings_log_csv_export_codes_26.csv | 6 +- .../lettings_log_csv_export_labels_26.csv | 6 +- ...gs_log_csv_export_non_support_codes_26.csv | 6 +- ...s_log_csv_export_non_support_labels_26.csv | 6 +- .../lettings_download_26_27.csv | 3 + .../tasks/log_variable_definitions_spec.rb | 2 +- .../lettings/pages/referral_noms_hr_spec.rb | 79 ++++++ .../pages/referral_noms_la_hr_spec.rb | 79 ++++++ .../referral_org_directly_referred_spec.rb | 79 ++++++ .../pages/referral_org_nominated_spec.rb | 79 ++++++ .../pages/referral_register_la_spec.rb | 78 ++++++ .../pages/referral_register_prp_spec.rb | 78 ++++++ .../lettings/questions/referral_noms_spec.rb | 83 ++++++ .../lettings/questions/referral_org_spec.rb | 119 +++++++++ .../questions/referral_register_spec.rb | 104 ++++++++ .../subsections/household_situation_spec.rb | 37 +-- .../validations/household_validations_spec.rb | 204 +++++++++++++- .../bulk_upload/lettings/validator_spec.rb | 8 +- .../lettings/year2026/csv_parser_spec.rb | 6 +- .../lettings/year2026/row_parser_spec.rb | 249 ++++++++++++++++-- .../csv/lettings_log_csv_service_spec.rb | 4 +- .../merge/merge_organisations_service_spec.rb | 20 ++ 71 files changed, 1833 insertions(+), 179 deletions(-) create mode 100644 app/models/form/lettings/pages/referral_noms_hr.rb create mode 100644 app/models/form/lettings/pages/referral_noms_la_hr.rb create mode 100644 app/models/form/lettings/pages/referral_org_directly_referred.rb create mode 100644 app/models/form/lettings/pages/referral_org_nominated.rb create mode 100644 app/models/form/lettings/pages/referral_register_la.rb create mode 100644 app/models/form/lettings/pages/referral_register_prp.rb create mode 100644 app/models/form/lettings/questions/referral_noms.rb create mode 100644 app/models/form/lettings/questions/referral_org.rb create mode 100644 app/models/form/lettings/questions/referral_register.rb create mode 100644 db/migrate/20260123150201_add2026_referral_fields.rb create mode 100644 spec/models/form/lettings/pages/referral_noms_hr_spec.rb create mode 100644 spec/models/form/lettings/pages/referral_noms_la_hr_spec.rb create mode 100644 spec/models/form/lettings/pages/referral_org_directly_referred_spec.rb create mode 100644 spec/models/form/lettings/pages/referral_org_nominated_spec.rb create mode 100644 spec/models/form/lettings/pages/referral_register_la_spec.rb create mode 100644 spec/models/form/lettings/pages/referral_register_prp_spec.rb create mode 100644 spec/models/form/lettings/questions/referral_noms_spec.rb create mode 100644 spec/models/form/lettings/questions/referral_org_spec.rb create mode 100644 spec/models/form/lettings/questions/referral_register_spec.rb diff --git a/app/helpers/bulk_upload/lettings_log_to_csv.rb b/app/helpers/bulk_upload/lettings_log_to_csv.rb index c483f4754..ec36d1911 100644 --- a/app/helpers/bulk_upload/lettings_log_to_csv.rb +++ b/app/helpers/bulk_upload/lettings_log_to_csv.rb @@ -224,7 +224,7 @@ class BulkUpload::LettingsLogToCsv chr, cap, accessible_register, - log.referral, + log.owning_organisation.la? ? log.referral_register : nil, net_income_known, log.incfreq, log.earnings, @@ -263,7 +263,10 @@ class BulkUpload::LettingsLogToCsv log.gender_same_as_sex7, # 150 log.gender_description7, log.gender_same_as_sex8, - log.gender_description8, # 153 + log.gender_description8, + log.owning_organisation.prp? ? log.referral_register : nil, + log.referral_noms, + log.referral_org, # 156 ] end diff --git a/app/models/derived_variables/lettings_log_variables.rb b/app/models/derived_variables/lettings_log_variables.rb index eb01e459a..1533c6400 100644 --- a/app/models/derived_variables/lettings_log_variables.rb +++ b/app/models/derived_variables/lettings_log_variables.rb @@ -33,7 +33,7 @@ module DerivedVariables::LettingsLogVariables def set_derived_fields! clear_inapplicable_derived_values! - set_encoded_derived_values!(DEPENDENCIES) + set_encoded_derived_values!(dependencies) if rsnvac.present? self.newprop = has_first_let_vacancy_reason? ? 1 : 2 @@ -184,20 +184,15 @@ module DerivedVariables::LettingsLogVariables private - DEPENDENCIES = [ - { - conditions: { - renewal: 1, - }, - derived_values: { - referral: 1, - referral_type: 3, - waityear: 2, - offered: 0, - rsnvac: 14, - first_time_property_let_as_social_housing: 0, - }, - }, + def dependencies + if form.start_year_2026_or_later? + DEPENDENCIES_2026 + else + DEPENDENCIES_2025_2024 + end + end + + COMMON_DEPENDENCIES = [ { conditions: { net_income_known: 2, @@ -224,8 +219,41 @@ private }, ].freeze + DEPENDENCIES_2026 = [ + { + conditions: { + renewal: 1, + }, + derived_values: { + referral_register: 1, + waityear: 2, + offered: 0, + rsnvac: 14, + first_time_property_let_as_social_housing: 0, + }, + }, + *COMMON_DEPENDENCIES, + ].freeze + + DEPENDENCIES_2025_2024 = [ + { + conditions: { + renewal: 1, + }, + derived_values: { + referral: 1, + referral_type: 3, + waityear: 2, + offered: 0, + rsnvac: 14, + first_time_property_let_as_social_housing: 0, + }, + }, + *COMMON_DEPENDENCIES, + ].freeze + def clear_inapplicable_derived_values! - reset_invalidated_derived_values!(DEPENDENCIES) + reset_invalidated_derived_values!(dependencies) if (startdate_changed? || renewal_changed?) && (renewal_was == 1 && startdate_was&.between?(Time.zone.local(2021, 4, 1), Time.zone.local(2022, 3, 31))) self.underoccupation_benefitcap = nil end diff --git a/app/models/form/lettings/pages/referral_direct.rb b/app/models/form/lettings/pages/referral_direct.rb index df05aa997..79a8d4044 100644 --- a/app/models/form/lettings/pages/referral_direct.rb +++ b/app/models/form/lettings/pages/referral_direct.rb @@ -1,3 +1,5 @@ +# added in 2025 +# removed in 2026 class Form::Lettings::Pages::ReferralDirect < ::Form::Page def initialize(id, hsh, subsection) super diff --git a/app/models/form/lettings/pages/referral_general_needs.rb b/app/models/form/lettings/pages/referral_general_needs.rb index 5522d1f23..a55ed5553 100644 --- a/app/models/form/lettings/pages/referral_general_needs.rb +++ b/app/models/form/lettings/pages/referral_general_needs.rb @@ -1,3 +1,4 @@ +# removed in 2025 class Form::Lettings::Pages::ReferralGeneralNeeds < ::Form::Page def initialize(id, hsh, subsection) super diff --git a/app/models/form/lettings/pages/referral_general_needs_prp.rb b/app/models/form/lettings/pages/referral_general_needs_prp.rb index e3206ebdb..99e033ab6 100644 --- a/app/models/form/lettings/pages/referral_general_needs_prp.rb +++ b/app/models/form/lettings/pages/referral_general_needs_prp.rb @@ -1,3 +1,4 @@ +# removed in 2025 class Form::Lettings::Pages::ReferralGeneralNeedsPrp < ::Form::Page def initialize(id, hsh, subsection) super diff --git a/app/models/form/lettings/pages/referral_hsc.rb b/app/models/form/lettings/pages/referral_hsc.rb index 596852947..c7c16ba58 100644 --- a/app/models/form/lettings/pages/referral_hsc.rb +++ b/app/models/form/lettings/pages/referral_hsc.rb @@ -1,3 +1,5 @@ +# added in 2025 +# removed in 2026 class Form::Lettings::Pages::ReferralHsc < ::Form::Page def initialize(id, hsh, subsection) super diff --git a/app/models/form/lettings/pages/referral_justice.rb b/app/models/form/lettings/pages/referral_justice.rb index fa10bb727..564f9f98c 100644 --- a/app/models/form/lettings/pages/referral_justice.rb +++ b/app/models/form/lettings/pages/referral_justice.rb @@ -1,3 +1,5 @@ +# added in 2025 +# removed in 2026 class Form::Lettings::Pages::ReferralJustice < ::Form::Page def initialize(id, hsh, subsection) super diff --git a/app/models/form/lettings/pages/referral_la.rb b/app/models/form/lettings/pages/referral_la.rb index 3f04f3aaf..5e3adbf62 100644 --- a/app/models/form/lettings/pages/referral_la.rb +++ b/app/models/form/lettings/pages/referral_la.rb @@ -1,3 +1,5 @@ +# added in 2025 +# removed in 2026 class Form::Lettings::Pages::ReferralLa < ::Form::Page def initialize(id, hsh, subsection) super diff --git a/app/models/form/lettings/pages/referral_noms_hr.rb b/app/models/form/lettings/pages/referral_noms_hr.rb new file mode 100644 index 000000000..d1120bffd --- /dev/null +++ b/app/models/form/lettings/pages/referral_noms_hr.rb @@ -0,0 +1,15 @@ +# added in 2026 +class Form::Lettings::Pages::ReferralNomsHr < ::Form::Page + def initialize(id, hsh, subsection) + super + @id = "referral_noms_hr" + end + + def questions + @questions ||= [Form::Lettings::Questions::ReferralNoms.new(nil, nil, self, 7)] + end + + def routed_to?(log, _current_user) + log.owning_organisation&.prp? && !log.is_renewal? && log.referral_is_from_housing_register? + end +end diff --git a/app/models/form/lettings/pages/referral_noms_la_hr.rb b/app/models/form/lettings/pages/referral_noms_la_hr.rb new file mode 100644 index 000000000..cc0e27371 --- /dev/null +++ b/app/models/form/lettings/pages/referral_noms_la_hr.rb @@ -0,0 +1,15 @@ +# added in 2026 +class Form::Lettings::Pages::ReferralNomsLaHr < ::Form::Page + def initialize(id, hsh, subsection) + super + @id = "referral_noms_la_hr" + end + + def questions + @questions ||= [Form::Lettings::Questions::ReferralNoms.new(nil, nil, self, 6)] + end + + def routed_to?(log, _current_user) + log.owning_organisation&.prp? && !log.is_renewal? && log.referral_is_from_local_authority_housing_register? + end +end diff --git a/app/models/form/lettings/pages/referral_org_directly_referred.rb b/app/models/form/lettings/pages/referral_org_directly_referred.rb new file mode 100644 index 000000000..baf4c2747 --- /dev/null +++ b/app/models/form/lettings/pages/referral_org_directly_referred.rb @@ -0,0 +1,15 @@ +# added in 2026 +class Form::Lettings::Pages::ReferralOrgDirectlyReferred < ::Form::Page + def initialize(id, hsh, subsection) + super + @id = "referral_org_directly_referred" + end + + def questions + @questions ||= [Form::Lettings::Questions::ReferralOrg.new(nil, nil, self, 7)] + end + + def routed_to?(log, _current_user) + log.owning_organisation&.prp? && !log.is_renewal? && log.referral_is_directly_referred? + end +end diff --git a/app/models/form/lettings/pages/referral_org_nominated.rb b/app/models/form/lettings/pages/referral_org_nominated.rb new file mode 100644 index 000000000..8be5f8edc --- /dev/null +++ b/app/models/form/lettings/pages/referral_org_nominated.rb @@ -0,0 +1,15 @@ +# added in 2026 +class Form::Lettings::Pages::ReferralOrgNominated < ::Form::Page + def initialize(id, hsh, subsection) + super + @id = "referral_org_nominated" + end + + def questions + @questions ||= [Form::Lettings::Questions::ReferralOrg.new(nil, nil, self, 1)] + end + + def routed_to?(log, _current_user) + log.owning_organisation&.prp? && !log.is_renewal? && log.referral_is_nominated_by_local_authority? + end +end diff --git a/app/models/form/lettings/pages/referral_prp.rb b/app/models/form/lettings/pages/referral_prp.rb index 8d25edc44..492941e52 100644 --- a/app/models/form/lettings/pages/referral_prp.rb +++ b/app/models/form/lettings/pages/referral_prp.rb @@ -1,3 +1,5 @@ +# added in 2025 +# removed in 2026 class Form::Lettings::Pages::ReferralPrp < ::Form::Page def initialize(id, hsh, subsection) super diff --git a/app/models/form/lettings/pages/referral_register_la.rb b/app/models/form/lettings/pages/referral_register_la.rb new file mode 100644 index 000000000..ee570f1cb --- /dev/null +++ b/app/models/form/lettings/pages/referral_register_la.rb @@ -0,0 +1,15 @@ +# added in 2026 +class Form::Lettings::Pages::ReferralRegisterLa < ::Form::Page + def initialize(id, hsh, subsection) + super + @id = "referral_register_la" + end + + def questions + @questions ||= [Form::Lettings::Questions::ReferralRegister.new(nil, nil, self, :la)] + end + + def routed_to?(log, _current_user) + log.owning_organisation&.la? && !log.is_renewal? + end +end diff --git a/app/models/form/lettings/pages/referral_register_prp.rb b/app/models/form/lettings/pages/referral_register_prp.rb new file mode 100644 index 000000000..d0c5cdaf1 --- /dev/null +++ b/app/models/form/lettings/pages/referral_register_prp.rb @@ -0,0 +1,15 @@ +# added in 2026 +class Form::Lettings::Pages::ReferralRegisterPrp < ::Form::Page + def initialize(id, hsh, subsection) + super + @id = "referral_register_prp" + end + + def questions + @questions ||= [Form::Lettings::Questions::ReferralRegister.new(nil, nil, self, :prp)] + end + + def routed_to?(log, _current_user) + log.owning_organisation&.prp? && !log.is_renewal? + end +end diff --git a/app/models/form/lettings/pages/referral_supported_housing.rb b/app/models/form/lettings/pages/referral_supported_housing.rb index a3e915e26..b20a0a825 100644 --- a/app/models/form/lettings/pages/referral_supported_housing.rb +++ b/app/models/form/lettings/pages/referral_supported_housing.rb @@ -1,3 +1,4 @@ +# removed in 2025 class Form::Lettings::Pages::ReferralSupportedHousing < ::Form::Page def initialize(id, hsh, subsection) super diff --git a/app/models/form/lettings/pages/referral_supported_housing_prp.rb b/app/models/form/lettings/pages/referral_supported_housing_prp.rb index 66b6f370e..0f546b400 100644 --- a/app/models/form/lettings/pages/referral_supported_housing_prp.rb +++ b/app/models/form/lettings/pages/referral_supported_housing_prp.rb @@ -1,3 +1,4 @@ +# removed in 2025 class Form::Lettings::Pages::ReferralSupportedHousingPrp < ::Form::Page def initialize(id, hsh, subsection) super diff --git a/app/models/form/lettings/pages/referral_type.rb b/app/models/form/lettings/pages/referral_type.rb index 3cca2ca2b..08b19d14c 100644 --- a/app/models/form/lettings/pages/referral_type.rb +++ b/app/models/form/lettings/pages/referral_type.rb @@ -1,3 +1,5 @@ +# added in 2025 +# removed in 2026 class Form::Lettings::Pages::ReferralType < ::Form::Page def initialize(id, hsh, subsection) super diff --git a/app/models/form/lettings/pages/referral_value_check.rb b/app/models/form/lettings/pages/referral_value_check.rb index aa3a34200..265ba5312 100644 --- a/app/models/form/lettings/pages/referral_value_check.rb +++ b/app/models/form/lettings/pages/referral_value_check.rb @@ -1,3 +1,4 @@ +# removed in 2026 class Form::Lettings::Pages::ReferralValueCheck < ::Form::Page def initialize(id, hsh, subsection) super diff --git a/app/models/form/lettings/questions/referral_direct.rb b/app/models/form/lettings/questions/referral_direct.rb index ddadcc8b7..d79065df7 100644 --- a/app/models/form/lettings/questions/referral_direct.rb +++ b/app/models/form/lettings/questions/referral_direct.rb @@ -1,3 +1,5 @@ +# added in 2025 +# removed in 2026 class Form::Lettings::Questions::ReferralDirect < ::Form::Question def initialize(id, hsh, page) super diff --git a/app/models/form/lettings/questions/referral_general_needs.rb b/app/models/form/lettings/questions/referral_general_needs.rb index 6efdfc1f0..6c9f159e4 100644 --- a/app/models/form/lettings/questions/referral_general_needs.rb +++ b/app/models/form/lettings/questions/referral_general_needs.rb @@ -1,3 +1,4 @@ +# removed in 2025 class Form::Lettings::Questions::ReferralGeneralNeeds < ::Form::Question def initialize(id, hsh, page) super diff --git a/app/models/form/lettings/questions/referral_general_needs_prp.rb b/app/models/form/lettings/questions/referral_general_needs_prp.rb index afd26117b..492f32c8f 100644 --- a/app/models/form/lettings/questions/referral_general_needs_prp.rb +++ b/app/models/form/lettings/questions/referral_general_needs_prp.rb @@ -1,3 +1,4 @@ +# removed in 2025 class Form::Lettings::Questions::ReferralGeneralNeedsPrp < ::Form::Question def initialize(id, hsh, page) super diff --git a/app/models/form/lettings/questions/referral_hsc.rb b/app/models/form/lettings/questions/referral_hsc.rb index a5b9c32f0..f049b6359 100644 --- a/app/models/form/lettings/questions/referral_hsc.rb +++ b/app/models/form/lettings/questions/referral_hsc.rb @@ -1,3 +1,5 @@ +# added in 2025 +# removed in 2026 class Form::Lettings::Questions::ReferralHsc < ::Form::Question def initialize(id, hsh, page) super diff --git a/app/models/form/lettings/questions/referral_justice.rb b/app/models/form/lettings/questions/referral_justice.rb index 0e02e0c42..f222f5fe8 100644 --- a/app/models/form/lettings/questions/referral_justice.rb +++ b/app/models/form/lettings/questions/referral_justice.rb @@ -1,3 +1,5 @@ +# added in 2025 +# removed in 2026 class Form::Lettings::Questions::ReferralJustice < ::Form::Question def initialize(id, hsh, page) super diff --git a/app/models/form/lettings/questions/referral_la.rb b/app/models/form/lettings/questions/referral_la.rb index 7a654df88..352457964 100644 --- a/app/models/form/lettings/questions/referral_la.rb +++ b/app/models/form/lettings/questions/referral_la.rb @@ -1,3 +1,5 @@ +# added in 2025 +# removed in 2026 class Form::Lettings::Questions::ReferralLa < ::Form::Question def initialize(id, hsh, page) super diff --git a/app/models/form/lettings/questions/referral_noms.rb b/app/models/form/lettings/questions/referral_noms.rb new file mode 100644 index 000000000..4d1390fdd --- /dev/null +++ b/app/models/form/lettings/questions/referral_noms.rb @@ -0,0 +1,49 @@ +# added in 2026 +class Form::Lettings::Questions::ReferralNoms < ::Form::Question + def initialize(id, hsh, page, referral_register) + super(id, hsh, page) + @id = "referral_noms" + @copy_key = "lettings.household_situation.referral.noms" + @type = "radio" + @check_answers_card_number = 0 + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) + @referral_register = referral_register + end + + def answer_options + case @referral_register + when 6 + { + "1" => { + "value" => "Nominated by a local authority to a PRP", + }, + "2" => { + "value" => "Supported housing only - referred by a local authority to a PRP", + }, + "3" => { + "value" => "Internal transfer from another property owned by the same PRP landlord - for existing social tenants only", + }, + "4" => { + "value" => "Other", + }, + }.freeze + when 7 + { + "5" => { + "value" => "Internal transfer from another property owned by the same PRP landlord - for existing social tenants only", + }, + "6" => { + "value" => " A different PRP landlord - for existing social tenants only", + }, + "7" => { + "value" => "Directly referred by a third party", + }, + "8" => { + "value" => "Other", + }, + }.freeze + end + end + + QUESTION_NUMBER_FROM_YEAR = { 2026 => 92 }.freeze +end diff --git a/app/models/form/lettings/questions/referral_org.rb b/app/models/form/lettings/questions/referral_org.rb new file mode 100644 index 000000000..797e30074 --- /dev/null +++ b/app/models/form/lettings/questions/referral_org.rb @@ -0,0 +1,85 @@ +# added in 2026 +class Form::Lettings::Questions::ReferralOrg < ::Form::Question + def initialize(id, hsh, page, referral_noms) + super(id, hsh, page) + @id = "referral_org" + @copy_key = "lettings.household_situation.referral.org" + @type = "radio" + @check_answers_card_number = 0 + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) + @referral_noms = referral_noms + end + + def answer_options + case @referral_noms + when 1 + { + "1" => { + "value" => "Referred to LA by health service", + }, + "2" => { + "value" => "Referred to LA by community learning disability team", + }, + "3" => { + "value" => "Referred to LA by community mental health team", + }, + "4" => { + "value" => "Referred to LA by adult social services", + }, + "5" => { + "value" => "Referred to LA by children's social care", + }, + "6" => { + "value" => "Referred to LA by police, probation, prison or youth offending team following a custodial sentence", + }, + "7" => { + "value" => "Referred to LA by police, probation, prison or youth offending team without a custodial sentence", + }, + "8" => { + "value" => "Referred to LA by a voluntary agency", + }, + "9" => { + "value" => "Other referral", + }, + "10" => { + "value" => "Don't know", + }, + }.freeze + when 7 + { + "11" => { + "value" => "Health service", + }, + "12" => { + "value" => "Community learning disability team", + }, + "13" => { + "value" => "Community mental health team", + }, + "14" => { + "value" => "Adult social services", + }, + "15" => { + "value" => "Children's social care", + }, + "16" => { + "value" => "Police, probation, prison or youth offending team following a custodial sentence", + }, + "17" => { + "value" => "Police, probation, prison or youth offending team without a custodial sentence", + }, + "18" => { + "value" => "Voluntary agency", + }, + "19" => { + "value" => "Other third party", + }, + "20" => { + "value" => "Don't know", + }, + }.freeze + end + end + + QUESTION_NUMBER_FROM_YEAR = { 2026 => 92 }.freeze +end diff --git a/app/models/form/lettings/questions/referral_prp.rb b/app/models/form/lettings/questions/referral_prp.rb index 44799bb8c..825967a3f 100644 --- a/app/models/form/lettings/questions/referral_prp.rb +++ b/app/models/form/lettings/questions/referral_prp.rb @@ -1,3 +1,5 @@ +# added in 2025 +# removed in 2026 class Form::Lettings::Questions::ReferralPrp < ::Form::Question def initialize(id, hsh, page) super diff --git a/app/models/form/lettings/questions/referral_register.rb b/app/models/form/lettings/questions/referral_register.rb new file mode 100644 index 000000000..cc3c25e74 --- /dev/null +++ b/app/models/form/lettings/questions/referral_register.rb @@ -0,0 +1,56 @@ +# added in 2026 +class Form::Lettings::Questions::ReferralRegister < ::Form::Question + def initialize(id, hsh, page, provider_type) + super(id, hsh, page) + @id = "referral_register" + @copy_key = "lettings.household_situation.referral.register" + @type = "radio" + @check_answers_card_number = 0 + @provider_type = provider_type + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) + @question_number += 1 if @provider_type == :prp + end + + def answer_options + if @provider_type == :la + { + "1" => { + "value" => "Renewal to the same tenant in the same property", + }, + "2" => { + "value" => "Internal transfer from another property owned by the same local authority - for existing social tenants only", + }, + "3" => { + "value" => "From a housing register (waiting list)", + }, + "4" => { + "value" => "Tenant applied directly (not via a nomination or housing register)", + }, + }.freeze + else + { + "5" => { + "value" => "Renewal to the same tenant in the same property", + }, + "6" => { + "value" => "From a local authority housing register (waiting list) or a register with local authority involvement", + }, + "7" => { + "value" => "From a housing register (waiting list) with no local authority involvement", + }, + "8" => { + "value" => "Tenant applied directly (not via a nomination or waiting list)", + }, + "9" => { + "value" => "Don't know", + }, + }.freeze + end + end + + def derived?(log) + log.is_renewal? + end + + QUESTION_NUMBER_FROM_YEAR = { 2026 => 91 }.freeze +end diff --git a/app/models/form/lettings/questions/referral_supported_housing.rb b/app/models/form/lettings/questions/referral_supported_housing.rb index d8d05fade..3a7ba04ac 100644 --- a/app/models/form/lettings/questions/referral_supported_housing.rb +++ b/app/models/form/lettings/questions/referral_supported_housing.rb @@ -1,3 +1,4 @@ +# removed in 2025 class Form::Lettings::Questions::ReferralSupportedHousing < ::Form::Question def initialize(id, hsh, page) super diff --git a/app/models/form/lettings/questions/referral_supported_housing_prp.rb b/app/models/form/lettings/questions/referral_supported_housing_prp.rb index 75cc218fe..d0236f4af 100644 --- a/app/models/form/lettings/questions/referral_supported_housing_prp.rb +++ b/app/models/form/lettings/questions/referral_supported_housing_prp.rb @@ -1,3 +1,4 @@ +# removed in 2025 class Form::Lettings::Questions::ReferralSupportedHousingPrp < ::Form::Question def initialize(id, hsh, page) super diff --git a/app/models/form/lettings/questions/referral_type.rb b/app/models/form/lettings/questions/referral_type.rb index 5ff0f411e..b4bb87515 100644 --- a/app/models/form/lettings/questions/referral_type.rb +++ b/app/models/form/lettings/questions/referral_type.rb @@ -1,3 +1,5 @@ +# added in 2025 +# removed in 2026 class Form::Lettings::Questions::ReferralType < ::Form::Question def initialize(id, hsh, page) super diff --git a/app/models/form/lettings/subsections/household_situation.rb b/app/models/form/lettings/subsections/household_situation.rb index 8bf747f01..cc6ec59de 100644 --- a/app/models/form/lettings/subsections/household_situation.rb +++ b/app/models/form/lettings/subsections/household_situation.rb @@ -22,12 +22,20 @@ class Form::Lettings::Subsections::HouseholdSituation < ::Form::Subsection Form::Lettings::Pages::ReasonablePreferenceReason.new(nil, nil, self), Form::Lettings::Pages::AllocationSystem.new("allocation_system", nil, self), referral_questions, - Form::Lettings::Pages::ReferralValueCheck.new(nil, nil, self), ].flatten.compact end def referral_questions - if form.start_year_2025_or_later? + if form.start_year_2026_or_later? + [ + Form::Lettings::Pages::ReferralRegisterLa.new(nil, nil, self), + Form::Lettings::Pages::ReferralRegisterPrp.new(nil, nil, self), + Form::Lettings::Pages::ReferralNomsLaHr.new(nil, nil, self), + Form::Lettings::Pages::ReferralNomsHr.new(nil, nil, self), + Form::Lettings::Pages::ReferralOrgNominated.new(nil, nil, self), + Form::Lettings::Pages::ReferralOrgDirectlyReferred.new(nil, nil, self), + ] + elsif form.start_year_2025_or_later? [ Form::Lettings::Pages::ReferralType.new(nil, nil, self), Form::Lettings::Pages::ReferralDirect.new(nil, nil, self), @@ -35,6 +43,7 @@ class Form::Lettings::Subsections::HouseholdSituation < ::Form::Subsection Form::Lettings::Pages::ReferralPrp.new(nil, nil, self), Form::Lettings::Pages::ReferralHsc.new(nil, nil, self), Form::Lettings::Pages::ReferralJustice.new(nil, nil, self), + Form::Lettings::Pages::ReferralValueCheck.new(nil, nil, self), ] else [ @@ -42,6 +51,7 @@ class Form::Lettings::Subsections::HouseholdSituation < ::Form::Subsection Form::Lettings::Pages::ReferralGeneralNeedsPrp.new(nil, nil, self), Form::Lettings::Pages::ReferralSupportedHousing.new(nil, nil, self), Form::Lettings::Pages::ReferralSupportedHousingPrp.new(nil, nil, self), + Form::Lettings::Pages::ReferralValueCheck.new(nil, nil, self), ] end end diff --git a/app/models/form/question.rb b/app/models/form/question.rb index b6f3b8b2f..3a3cc6a34 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -362,6 +362,13 @@ private inferred_answer["value"] if inferred_answer.present? end + # every year currently visible should be specified. + # however, form_handler.rb will still initialise the next form even if its not visible. + # so we have a fallback to the latest year for these future years so all question have a question number. + def get_question_number_from_hash(hash) + hash[form.start_date.year] || hash[hash.keys.max] + end + RADIO_YES_VALUE = { renewal: [1], postcode_known: [1], diff --git a/app/models/lettings_log.rb b/app/models/lettings_log.rb index f2230c4e5..7f1586f88 100644 --- a/app/models/lettings_log.rb +++ b/app/models/lettings_log.rb @@ -35,6 +35,7 @@ class LettingsLog < Log before_validation :set_derived_fields! before_validation :process_uprn_change!, if: :should_process_uprn_change? before_validation :process_address_change!, if: :should_process_address_change? + before_validation :reset_referral_register!, if: :should_reset_referral_register? belongs_to :scheme, optional: true belongs_to :location, optional: true @@ -376,8 +377,12 @@ class LettingsLog < Log end def is_internal_transfer? - # 1: Internal Transfer - referral == 1 + if form.start_year_2026_or_later? + referral_register == 2 || (referral_register == 6 && referral_noms == 3) || (referral_register == 7 && referral_noms == 5) + else + # 1: Internal Transfer + referral == 1 + end end def is_from_prp_only_housing_register_or_waiting_list? @@ -544,6 +549,12 @@ class LettingsLog < Log [30, 31].any?(prevten) end + def is_prevten_general_needs? + return false unless prevten + + ![30, 31, 32, 33, 35, 38, 40, 6].include?(prevten) + end + def owning_organisation_name owning_organisation&.name end @@ -776,6 +787,22 @@ class LettingsLog < Log form.start_year_2026_or_later? || !is_supported_housing? end + def referral_is_from_local_authority_housing_register? + referral_register == 6 + end + + def referral_is_from_housing_register? + referral_register == 7 + end + + def referral_is_nominated_by_local_authority? + referral_is_from_local_authority_housing_register? && referral_noms == 1 + end + + def referral_is_directly_referred? + referral_is_from_housing_register? && referral_noms == 7 + end + private def reset_invalid_unresolved_log_fields! @@ -947,4 +974,16 @@ private uprn_selection_changed? || startdate_changed? end end + + def reset_referral_register! + self.referral_register = nil + end + + def should_reset_referral_register? + return unless owning_organisation_id_changed? && owning_organisation_id && owning_organisation_id_was + + old_owning_organisation = Organisation.find(owning_organisation_id_was) + + old_owning_organisation.provider_type != owning_organisation.provider_type + end end diff --git a/app/models/organisation.rb b/app/models/organisation.rb index 94390c3f9..b33d896c4 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -74,6 +74,7 @@ class Organisation < ApplicationRecord before_save :clear_group_member_fields_if_not_group_member alias_method :la?, :LA? + alias_method :prp?, :PRP? validates :name, presence: { message: I18n.t("validations.organisation.name_missing") } validates :name, uniqueness: { case_sensitive: false, message: I18n.t("validations.organisation.name_not_unique") } diff --git a/app/models/validations/household_validations.rb b/app/models/validations/household_validations.rb index 8ba58ba2b..cf1962be0 100644 --- a/app/models/validations/household_validations.rb +++ b/app/models/validations/household_validations.rb @@ -162,7 +162,7 @@ module Validations::HouseholdValidations # 27 Owner occupation (low-cost home ownership) # 28 Living with Friends or Family # 29 Prison / Approved Probation Hostel - if record.is_internal_transfer? && [3, 4, 7, 10, 13, 14, 19, 23, 24, 25, 26, 27, 28, 29].include?(record.prevten) + if record.is_internal_transfer? && [3, 4, 7, 10, 13, 14, 19, 23, 24, 25, 26, 27, 28, 29].include?(record.prevten) && !record.form.start_year_2026_or_later? label = record.form.get_question("prevten", record).present? ? record.form.get_question("prevten", record).label_from_value(record.prevten) : "" record.errors.add :prevten, :internal_transfer_non_social_housing, message: I18n.t("validations.lettings.household.prevten.internal_transfer", prevten: label) record.errors.add :referral, :internal_transfer_non_social_housing, message: I18n.t("validations.lettings.household.referral.prevten_invalid", prevten: label) @@ -172,7 +172,14 @@ module Validations::HouseholdValidations def validate_referral(record) return unless record.owning_organisation - if record.is_internal_transfer? && record.owning_organisation.provider_type == "PRP" && record.is_prevten_la_general_needs? + if record.form.start_year_2026_or_later? + if record.is_internal_transfer? && record.is_prevten_general_needs? + label = record.form.get_question("prevten", record).present? ? record.form.get_question("prevten", record).label_from_value(record.prevten) : "" + record.errors.add :prevten, message: I18n.t("validations.lettings.household.prevten.general_needs.internal_transfer", prevten: label) + record.errors.add :referral_register, message: I18n.t("validations.lettings.household.referral.general_needs.internal_transfer", prevten: label) + record.errors.add :referral_noms, message: I18n.t("validations.lettings.household.referral.general_needs.internal_transfer", prevten: label) + end + elsif record.is_internal_transfer? && record.owning_organisation.prp? && record.is_prevten_la_general_needs? record.errors.add :prevten, :internal_transfer_fixed_or_lifetime, message: I18n.t("validations.lettings.household.prevten.la_general_needs.internal_transfer") record.errors.add :referral, :internal_transfer_fixed_or_lifetime, message: I18n.t("validations.lettings.household.referral.la_general_needs.internal_transfer") end diff --git a/app/services/bulk_upload/lettings/year2026/csv_parser.rb b/app/services/bulk_upload/lettings/year2026/csv_parser.rb index 3e5933219..e8e91a6ca 100644 --- a/app/services/bulk_upload/lettings/year2026/csv_parser.rb +++ b/app/services/bulk_upload/lettings/year2026/csv_parser.rb @@ -4,7 +4,7 @@ class BulkUpload::Lettings::Year2026::CsvParser include CollectionTimeHelper # TODO: CLDC-4162: Update when 2026 format is known - FIELDS = 153 + FIELDS = 156 FORM_YEAR = 2026 attr_reader :path @@ -27,7 +27,7 @@ class BulkUpload::Lettings::Year2026::CsvParser def cols # TODO: CLDC-4162: Update when 2026 format is known - @cols ||= ("A".."EX").to_a + @cols ||= ("A".."FA").to_a end def row_parsers diff --git a/app/services/bulk_upload/lettings/year2026/row_parser.rb b/app/services/bulk_upload/lettings/year2026/row_parser.rb index 02484aafd..80f31e0f7 100644 --- a/app/services/bulk_upload/lettings/year2026/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2026/row_parser.rb @@ -120,7 +120,7 @@ class BulkUpload::Lettings::Year2026::RowParser field_113: "Was the letting made under the Common Allocation Policy (CAP)?", field_114: "Was the letting made under the Common Housing Register (CHR)?", field_115: "Was the letting made under the Accessible Register?", - field_116: "What was the source of referral for this letting?", + field_116: "What was the source of referral for this letting? - LA properties", field_117: "Do you know the household’s combined total income after tax?", field_118: "How often does the household receive income?", field_119: "How much income does the household have in total?", @@ -159,6 +159,10 @@ class BulkUpload::Lettings::Year2026::RowParser field_151: "If 'No', enter person 7's gender identity", field_152: "Is the gender person 8 identifies with the same as their sex registered at birth?", field_153: "If 'No', enter person 8's gender identity", + + field_154: "What was the source of referral for this letting? - PRP properties part 1", + field_155: "What was the source of referral for this letting? - PRP properties part 2", + field_156: "What was the source of referral for this letting? - PRP properties part 3", }.freeze RENT_TYPE_BU_MAPPING = { @@ -333,6 +337,10 @@ class BulkUpload::Lettings::Year2026::RowParser attribute :field_152, :integer attribute :field_153, :string + attribute :field_154, :integer + attribute :field_155, :integer + attribute :field_156, :integer + validate :validate_valid_radio_option, on: :before_log validates :field_11, @@ -458,8 +466,6 @@ class BulkUpload::Lettings::Year2026::RowParser validate :validate_needs_type_present, on: :after_log validate :validate_data_types, on: :after_log validate :validate_relevant_collection_window, on: :after_log - validate :validate_la_with_local_housing_referral, on: :after_log - validate :validate_cannot_be_la_referral_if_general_needs_and_la, on: :after_log validate :validate_leaving_reason_for_renewal, on: :after_log validate :validate_only_one_housing_needs_type, on: :after_log validate :validate_no_disabled_needs_conjunction, on: :after_log @@ -470,6 +476,7 @@ class BulkUpload::Lettings::Year2026::RowParser validate :validate_reasonable_preference_dont_know, on: :after_log validate :validate_condition_effects, on: :after_log validate :validate_if_log_already_exists, on: :after_log, if: -> { FeatureToggle.bulk_upload_duplicate_log_check_enabled? } + validate :validate_referral_fields, on: :after_log validate :validate_owning_org_data_given, on: :after_log validate :validate_owning_org_exists, on: :after_log @@ -730,7 +737,7 @@ private end def validate_prevten_value_when_renewal - return unless field_7 == 1 + return unless renewal? return if field_100.blank? || [6, 30, 31, 32, 33, 34, 35, 38].include?(field_100) errors.add(:field_100, I18n.t("#{ERROR_BASE_KEY}.prevten.invalid")) @@ -837,7 +844,7 @@ private end def validate_leaving_reason_for_renewal - if field_7 == 1 && ![50, 51, 52, 53].include?(field_98) + if renewal? && ![50, 51, 52, 53].include?(field_98) errors.add(:field_98, I18n.t("#{ERROR_BASE_KEY}.reason.renewal_reason_needed")) end end @@ -850,16 +857,8 @@ private field_4 == 2 end - def validate_cannot_be_la_referral_if_general_needs_and_la - if field_116 == 4 && general_needs? && owning_organisation && owning_organisation.la? - errors.add :field_116, I18n.t("#{ERROR_BASE_KEY}.referral.general_needs_prp_referred_by_la") - end - end - - def validate_la_with_local_housing_referral - if field_116 == 3 && owning_organisation && owning_organisation.la? - errors.add(:field_116, I18n.t("#{ERROR_BASE_KEY}.referral.nominated_by_local_ha_but_la")) - end + def renewal? + field_7 == 1 end def validate_relevant_collection_window @@ -1042,6 +1041,57 @@ private end end + def field_referral_register_la_valid? + if owning_organisation&.la? + [1, 2, 3, 4].include?(field_116) + else + field_116.blank? + end + end + + def field_referral_register_prp_valid? + if owning_organisation&.prp? + [5, 6, 7, 8, 9].include?(field_154) + else + field_154.blank? + end + end + + def field_referral_noms_valid? + case field_154 + when 6 + [1, 2, 3, 4].include?(field_155) + when 7 + [5, 6, 7, 8].include?(field_155) + else + field_155.blank? + end + end + + def field_referral_org_valid? + case field_155 + when 1 + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].include?(field_156) + when 7 + [11, 12, 13, 14, 15, 16, 17, 18, 19, 20].include?(field_156) + else + field_156.blank? + end + end + + def referral_fields_valid? + field_referral_register_la_valid? && field_referral_register_prp_valid? && field_referral_noms_valid? && field_referral_org_valid? + end + + def validate_referral_fields + return if renewal? + return if referral_fields_valid? + + %i[field_116 field_154 field_155 field_156].each do |field| + errors.add(field, I18n.t("#{ERROR_BASE_KEY}.referral.invalid_option")) + end + end + def field_mapping_for_errors { lettype: [:field_11], @@ -1154,8 +1204,9 @@ private accessible_register: %i[field_115], letting_allocation: %i[field_112 field_113 field_114 field_115], - referral_type: %i[field_116], - referral: %i[field_116], + referral_register: %i[field_116 field_154], + referral_noms: %i[field_155], + referral_org: %i[field_156], net_income_known: %i[field_117], incfreq: %i[field_118], @@ -1349,8 +1400,9 @@ private attributes["accessible_register"] = accessible_register attributes["letting_allocation_unknown"] = letting_allocation_unknown - attributes["referral_type"] = referral_type - attributes["referral"] = field_116 + attributes["referral_register"] = referral_register + attributes["referral_noms"] = referral_noms + attributes["referral_org"] = referral_org attributes["net_income_known"] = net_income_known attributes["earnings"] = earnings @@ -1768,21 +1820,36 @@ private false end - def referral_type - mapping = { - 1 => [20, 2, 8], - 2 => [21, 3, 4, 22], - 3 => [1, 10, 23], - 4 => [15, 9, 14, 24, 17], - 5 => [18, 19], - 6 => [7], - 7 => [16], - } + def referral_register + return unless owning_organisation + # by default CORE will ingest all these fields and nil questions that aren't asked. + # here, we specifically want the log to be invalid if any of the referral fields are wrong. + # BU will only consider a log invalid if its incomplete. + # so, nil these fields if any are invalid. + return unless referral_fields_valid? + + if owning_organisation.la? + field_116 + else + field_154 + end + end + + def referral_noms + return unless owning_organisation + return unless referral_fields_valid? - mapping.each do |key, values| - return key if values.include?(field_116) + if owning_organisation.prp? + field_155 end + end - 0 + def referral_org + return unless owning_organisation + return unless referral_fields_valid? + + if owning_organisation.prp? + field_156 + end end end diff --git a/app/services/exports/lettings_log_export_constants.rb b/app/services/exports/lettings_log_export_constants.rb index b954a5afd..99f73d143 100644 --- a/app/services/exports/lettings_log_export_constants.rb +++ b/app/services/exports/lettings_log_export_constants.rb @@ -77,7 +77,6 @@ module Exports::LettingsLogExportConstants "reason", "reasonother", "reasonpref", - "referral", "refused", "reghome", "renttype", @@ -158,6 +157,7 @@ module Exports::LettingsLogExportConstants "chcharge", "national", "offered", + "referral", ] YEAR_2022_EXPORT_FIELDS = Set[ @@ -165,6 +165,7 @@ module Exports::LettingsLogExportConstants "chcharge", "national", "offered", + "referral", ] YEAR_2023_EXPORT_FIELDS = Set[ @@ -172,6 +173,7 @@ module Exports::LettingsLogExportConstants "chcharge", "national", "offered", + "referral", ] YEAR_2024_EXPORT_FIELDS = Set[ @@ -192,6 +194,7 @@ module Exports::LettingsLogExportConstants "pscharge_value_check", "supcharg_value_check", "carehome_charges_value_check", + "referral", ] YEAR_2025_EXPORT_FIELDS = Set[ @@ -210,6 +213,7 @@ module Exports::LettingsLogExportConstants "scharge_value_check", "pscharge_value_check", "supcharg_value_check", + "referral", ] YEAR_2026_EXPORT_FIELDS = Set[ @@ -227,6 +231,9 @@ module Exports::LettingsLogExportConstants "scharge_value_check", "pscharge_value_check", "supcharg_value_check", + "referral_register", + "referral_noms", + "referral_org", ] (1..8).each do |index| diff --git a/config/locales/forms/2026/lettings/household_situation.en.yml b/config/locales/forms/2026/lettings/household_situation.en.yml index 02438edcc..133bcf6c3 100644 --- a/config/locales/forms/2026/lettings/household_situation.en.yml +++ b/config/locales/forms/2026/lettings/household_situation.en.yml @@ -112,37 +112,19 @@ en: question_text: "How was this letting allocated?" referral: - type: + register: page_header: "" check_answer_label: "Source of referral for letting" check_answer_prompt: "Select source of referral" hint_text: "" question_text: "What was the source of referral for this letting?" - direct: + noms: page_header: "" check_answer_label: "Source of referral for letting" check_answer_prompt: "Select source of referral" hint_text: "" question_text: "What was the source of referral for this letting?" - la: - page_header: "" - check_answer_label: "Source of referral for letting" - check_answer_prompt: "Select source of referral" - hint_text: "" - question_text: "What was the source of referral for this letting?" - prp: - page_header: "" - check_answer_label: "Source of referral for letting" - check_answer_prompt: "Select source of referral" - hint_text: "" - question_text: "What was the source of referral for this letting?" - hsc: - page_header: "" - check_answer_label: "Source of referral for letting" - check_answer_prompt: "Select source of referral" - hint_text: "" - question_text: "What was the source of referral for this letting?" - justice: + org: page_header: "" check_answer_label: "Source of referral for letting" check_answer_prompt: "Select source of referral" diff --git a/config/locales/forms/2026/lettings/soft_validations.en.yml b/config/locales/forms/2026/lettings/soft_validations.en.yml index a2fe12a1f..5a1d7d1a3 100644 --- a/config/locales/forms/2026/lettings/soft_validations.en.yml +++ b/config/locales/forms/2026/lettings/soft_validations.en.yml @@ -57,15 +57,6 @@ en: title_text: "You told us that the tenant’s main reason for leaving their last settled home was %{reasonother}." informative_text: "The reason you have entered looks very similar to one of the existing response categories. Please check the categories and select the appropriate one. If the existing categories are not suitable, please confirm here to move onto the next question." - referral_value_check: - page_header: "" - check_answer_label: "Referral confirmation" - check_answer_prompt: "Confirm referral type" - hint_text: "" - question_text: "Are you sure?" - title_text: "Are you sure?" - informative_text: "This is a general needs log, and this referral type is for supported housing." - net_income_value_check: page_header: "" check_answer_label: "Net income confirmation" diff --git a/config/locales/validations/lettings/2026/bulk_upload.en.yml b/config/locales/validations/lettings/2026/bulk_upload.en.yml index 8ac7fc378..bf65ae6bd 100644 --- a/config/locales/validations/lettings/2026/bulk_upload.en.yml +++ b/config/locales/validations/lettings/2026/bulk_upload.en.yml @@ -40,8 +40,7 @@ en: 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\"." 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." + invalid_option: "Your answers for each part of \"What is the source of referral for this letting?\" are incompatible with each other. Use the bulk upload specification or paper form to see which combinations are valid (available from ‘Collection resources’ on the homepage)." scheme: must_relate_to_org: "This scheme code does not belong to the owning organisation or managing organisation." location: diff --git a/config/locales/validations/lettings/household.en.yml b/config/locales/validations/lettings/household.en.yml index 297cbed02..3fe1d244f 100644 --- a/config/locales/validations/lettings/household.en.yml +++ b/config/locales/validations/lettings/household.en.yml @@ -98,8 +98,12 @@ en: internal_transfer: "Answer cannot be %{prevten} as this tenancy is an internal transfer." la_general_needs: internal_transfer: "Answer cannot be a fixed-term or lifetime local authority general needs tenancy as it’s an internal transfer and a private registered provider is on the tenancy agreement." + general_needs: + internal_transfer: "Answer cannot be %{prevten} as this tenancy is an internal transfer. Internal transfers are for existing social tenants only; your answer to where the household was immediately before this letting shows the tenant was not in the social sector immediately prior to this letting." referral: prevten_invalid: "Answer cannot be internal transfer as the household situation immediately before this letting was %{prevten}." la_general_needs: internal_transfer: "Answer cannot be internal transfer as it’s the same landlord on the tenancy agreement and the household had either a fixed-term or lifetime local authority general needs tenancy immediately before this letting." + general_needs: + internal_transfer: "Answer cannot be internal transfer as the household situation immediately before this letting was %{prevten}. Internal transfers are for existing social tenants only; your answer to where the household was immediately before this letting shows the tenant was not in the social sector immediately prior to this letting." diff --git a/db/migrate/20260123150201_add2026_referral_fields.rb b/db/migrate/20260123150201_add2026_referral_fields.rb new file mode 100644 index 000000000..32279fad5 --- /dev/null +++ b/db/migrate/20260123150201_add2026_referral_fields.rb @@ -0,0 +1,9 @@ +class Add2026ReferralFields < ActiveRecord::Migration[7.2] + def change + change_table :lettings_logs, bulk: true do |t| + t.integer :referral_register + t.integer :referral_noms + t.integer :referral_org + end + end +end diff --git a/db/schema.rb b/db/schema.rb index e314e201d..19faeed2a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -400,6 +400,9 @@ ActiveRecord::Schema[7.2].define(version: 2026_02_04_100051) do t.string "gender_description6" t.string "gender_description7" t.string "gender_description8" + t.integer "referral_register" + t.integer "referral_noms" + t.integer "referral_org" t.index ["assigned_to_id"], name: "index_lettings_logs_on_assigned_to_id" t.index ["bulk_upload_id"], name: "index_lettings_logs_on_bulk_upload_id" t.index ["created_by_id"], name: "index_lettings_logs_on_created_by_id" diff --git a/spec/factories/lettings_log.rb b/spec/factories/lettings_log.rb index 02744e87c..2c1aff71a 100644 --- a/spec/factories/lettings_log.rb +++ b/spec/factories/lettings_log.rb @@ -168,6 +168,9 @@ FactoryBot.define do first_time_property_let_as_social_housing { 0 } referral_type { 1 } referral { 2 } + referral_register { 1 } + referral_noms { 1 } + referral_org { 1 } uprn_known { 0 } joint { 3 } address_line1 { "Address line 1" } diff --git a/spec/fixtures/exports/general_needs_log_26_27.xml b/spec/fixtures/exports/general_needs_log_26_27.xml index 745497f0c..d92f74f10 100644 --- a/spec/fixtures/exports/general_needs_log_26_27.xml +++ b/spec/fixtures/exports/general_needs_log_26_27.xml @@ -123,7 +123,9 @@ 0 2 - 2 + 1 + + 200.0 50.0 40.0 diff --git a/spec/fixtures/files/2026_27_lettings_bulk_upload.csv b/spec/fixtures/files/2026_27_lettings_bulk_upload.csv index 547826f5b..4b66a7c71 100644 --- a/spec/fixtures/files/2026_27_lettings_bulk_upload.csv +++ b/spec/fixtures/files/2026_27_lettings_bulk_upload.csv @@ -1,4 +1,4 @@ -Section,Setting up this lettings log,,,,,,,,,,,,,,,Property information,,,,,,,,,,,,,,,,,,,,,Tenancy information,,,,,Household characteristics,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Household needs,,,,,,,,,,,,,,,,,,,,,Household situation,,,,,,,,,,,,,,,,,,,,,"Income, benefits and outgoings",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Section,Setting up this lettings log,,,,,,,,,,,,,,,Property information,,,,,,,,,,,,,,,,,,,,,Tenancy information,,,,,Household characteristics,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Household needs,,,,,,,,,,,,,,,,,,,,,Household situation,,,,,,,,,,,,,,,,,,,,,"Income, benefits and outgoings",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Question,Which organisation owns this property?,Which organisation manages this letting?,What is the CORE username of the account this letting log should be assigned to? ,What is the needs type?,What scheme does this letting belong to?,Which location is this letting for?,Is this letting a renewal of social housing to the same tenant in the same property?,What is the tenancy start date? - day DD,What is the tenancy start date? - month MM,What is the tenancy start date? - year YY,What is the rent type?,Which 'Other' type of Intermediate Rent is this letting?,What is the tenant code?,What is the property reference?,Has the tenant seen or been given access to the MHCLG privacy notice?,What is the reason for the property being vacant?,What type was the property most recently let as?,"If known, provide this property’s UPRN",Address Line 1,Address Line 2,Town or city,County,Part 1 of the property's postcode,Part 2 of the property's postcode,What is the property's local authority?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date? - day DD,What is the void date? - month MM,What is the void date? - year YY,What date were any major repairs completed on? - day DD,What date were any major repairs completed on? - month MM,What date were any major repairs completed on? - year YY,Is this property older people's housing?,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?,What is the lead tenant’s age?,Which of these best describes the lead tenant’s gender identity? ,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?,Is person 2 the partner of 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?,Is person 3 the partner of 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?,Is person 4 the partner of 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?,Is person 5 the partner of 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?,Is person 6 the partner of 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?,Is person 7 the partner of 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?,Is person 8 the partner of 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?,"Disabled access needs a) Fully wheelchair-accessible housing","Disabled access needs @@ -29,7 +29,7 @@ Common Allocations Policy (CAP)","How was this letting allocated? Common Housing Register (CHR)","How was this letting allocated? -Accessible Housing Register",What was the source of referral for this letting?,Do you know the household's combined total income after tax?,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?,"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?,How often does the household pay rent and other charges?,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",What do you expect the outstanding amount to be?,What was the lead tenant's sex at birth?,What was person 2's sex registered at birth?,What was person 3's sex registered at birth?,What was person 4's sex registered at birth?,What was person 5's sex registered at birth?,What was person 6's sex registered at birth?,What was person 7's sex registered at birth?,What was person 8's sex registered at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter lead tenant's gender identity",Is the gender the person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",Is the gender the person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",Is the gender the person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",Is the gender the person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",Is the gender the person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",Is the gender the person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",Is the gender the person 8 identifies with the same as their sex registered at birth?,"If 'No', enter person 8's gender identity" +Accessible Housing Register",What was the source of referral for this letting? - LA properties,Do you know the household's combined total income after tax?,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?,"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?,How often does the household pay rent and other charges?,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",What do you expect the outstanding amount to be?,What was the lead tenant's sex at birth?,What was person 2's sex registered at birth?,What was person 3's sex registered at birth?,What was person 4's sex registered at birth?,What was person 5's sex registered at birth?,What was person 6's sex registered at birth?,What was person 7's sex registered at birth?,What was person 8's sex registered at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter lead tenant's gender identity",Is the gender the person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",Is the gender the person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",Is the gender the person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",Is the gender the person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",Is the gender the person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",Is the gender the person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",Is the gender the person 8 identifies with the same as their sex registered at birth?,"If 'No', enter person 8's gender identity",What was the source of referral for this letting? - PRP properties part 1,What was the source of referral for this letting? - PRP properties part 2,What was the source of referral for this letting? - PRP properties part 3 Additional info,"You can find the org ID on the CORE service under 'Stock owners' or, if your organisation is the stock owner, under 'About your organisation'","You can find the org ID on the CORE service under 'Managing agents' or, if your organisation is the managing agent, under 'About your organisation'","If left empty, the letting log will be assigned to the account used to upload the log.","General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing includes direct access hostels, group homes, residential care and nursing homes.","Scheme code. Include the 'S' at the beginning if it has one. You can find the scheme code on the CORE service under 'Schemes', either by searching for the specific scheme or downloading a csv.","Location code. @@ -45,7 +45,7 @@ The UPRN may not be the same as the property reference assigned by your organisa 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.",This is where two or more people are named on the tenancy agreement.,"If the tenancy has an ‘introductory period’ answer ‘yes’. You should submit a CORE log at the beginning of the starter tenancy or introductory period, with the best information you have at the time. You do not need to submit a log when a tenant later rolls onto the main tenancy.",This is about the main tenancy after any starter or introductory period. See specification for definitions.,,Do not include the starter or introductory period. The minimum period is 2 years for social or affordable rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 2 years.,"This is the household member who does the most paid work. If several people do the same amount of paid work, it's the oldest household member.",This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.,,"If the lead tenant is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the tenant should decide which country to enter.","This is the household member who does the most paid work. If several people do the same amount of paid work, it's the oldest household member.",,Answer 1 for children aged under 1 year old,This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.,,,Answer 1 for children aged under 1 year old,This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.,,,Answer 1 for children aged under 1 year old,This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.,,,Answer 1 for children aged under 1 year old,This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.,,,Answer 1 for children aged under 1 year old,This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.,,,Answer 1 for children aged under 1 year old,This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.,,,Answer 1 for children aged under 1 year old,This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.,,"This excludes national service. -If several household members have these links, answer for regular first. If no regular, answer for reserve. If no reserve, answer for spouses or civil partners.",,,,,,,,,,,"For example, lifting and carrying objects, or using a keyboard",,"For example, deafness or partial hearing",,"For example, depression or anxiety","For example, walking short distances or climbing stairs","For example, anything associated with autism spectrum disorder (ASD), including Asperger’s or attention deficit hyperactivity disorder (ADHD)",,"For example, blindness or partial sight",,,,"The tenant's ‘last settled home' is their last long-standing home. For tenants who had temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living previously.",,,,"This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless.","Combined with field 104, it should be a postcode which lies within the local authority given in field 105.","Combined with field 103, it should be a postcode which lies within the local authority given in field 105.","This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless.",Households may be given ‘reasonable preference’ for social housing under one or more specific category by the local authority. This is also known as ‘priority need’.,,,,,,Where available vacant properties are advertised and applicants are able to bid for specific properties.,Where a common system agreed between a group of housing providers is used to determine applicants' priority for housing.,Where a single waiting list is used by a group of housing providers to receive and process housing applications. Providers may use different approaches to determine priority.,Where the 'access category' or another descriptor of whether an available vacant property meets a range of access needs is displayed to applicants during the allocations process.,,,,"Include any income after tax from employment, pensions, and Universal Credit. Don't include National Insurance (NI) contributions and tax, housing benefit, child benefit, or council tax support.","This is about when the tenant is in their new let. If they are unsure about the situation for their new let and their financial and working situation hasn’t changed significantly, answer based on what housing-related benefits they currently receive.",,"If rent is charged on the property then answer Yes, even if tenants do not pay it themselves.",,"This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent.","For example, cleaning. Households may get household benefits towards the service charge.",For example heating or hot water. This doesn’t include housing benefit or Universal Credit.,Any charges made to fund support services included in the tenancy agreement.,Also known as the 'outstanding amount',You only need to give an approximate figure.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,,,,,,,,,,,,,,,, +If several household members have these links, answer for regular first. If no regular, answer for reserve. If no reserve, answer for spouses or civil partners.",,,,,,,,,,,"For example, lifting and carrying objects, or using a keyboard",,"For example, deafness or partial hearing",,"For example, depression or anxiety","For example, walking short distances or climbing stairs","For example, anything associated with autism spectrum disorder (ASD), including Asperger’s or attention deficit hyperactivity disorder (ADHD)",,"For example, blindness or partial sight",,,,"The tenant's ‘last settled home' is their last long-standing home. For tenants who had temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living previously.",,,,"This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless.","Combined with field 104, it should be a postcode which lies within the local authority given in field 105.","Combined with field 103, it should be a postcode which lies within the local authority given in field 105.","This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless.",Households may be given ‘reasonable preference’ for social housing under one or more specific category by the local authority. This is also known as ‘priority need’.,,,,,,Where available vacant properties are advertised and applicants are able to bid for specific properties.,Where a common system agreed between a group of housing providers is used to determine applicants' priority for housing.,Where a single waiting list is used by a group of housing providers to receive and process housing applications. Providers may use different approaches to determine priority.,Where the 'access category' or another descriptor of whether an available vacant property meets a range of access needs is displayed to applicants during the allocations process.,,,,"Include any income after tax from employment, pensions, and Universal Credit. Don't include National Insurance (NI) contributions and tax, housing benefit, child benefit, or council tax support.","This is about when the tenant is in their new let. If they are unsure about the situation for their new let and their financial and working situation hasn’t changed significantly, answer based on what housing-related benefits they currently receive.",,"If rent is charged on the property then answer Yes, even if tenants do not pay it themselves.",,"This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent.","For example, cleaning. Households may get household benefits towards the service charge.",For example heating or hot water. This doesn’t include housing benefit or Universal Credit.,Any charges made to fund support services included in the tenancy agreement.,Also known as the 'outstanding amount',You only need to give an approximate figure.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,,,,,,,,,,,,,,,,,,, Values,Alphanumeric,,Email format,01-Feb,Alphanumeric,Numeric,01-Feb,Jan-31,01-Dec,25 - 26,01-Jul,Text,"Alphanumeric, max 13 characters","Alphanumeric, max 12 characters",1,"5 - 6, or 8 - 22",1 - 3 or 5 - 9,Numeric,Alphanumeric,,Text,,"Alphanumeric, 2 - 4 characters","Alphanumeric, 3 characters","9 character ONS code, beginning with 'E' (https://www.get-information-schools.service.gov.uk/Guidance/LaNameCodes) ","1 - 2, 4 or 6 - 10",01-Feb,01-Feb,01-Jul,Jan-31,01-Dec,Jun-26,Jan-31,01-Dec,Jun-26,"2 - 4, 7 - 8",01-Mar,01-Feb,02-Aug,Text,"1 - 99, see specification for more detail",16 - 120 or R,"F, M, X or R",Jan-20,"3 digit ISO country code, see specification",0 - 10,01-Mar,"Numeric, range 1 - 120 or text (upper case 'R') @@ -77,11 +77,11 @@ Must be >= 16 if working situation = 1 - 8 or 0 Must be <16 if working situation = 9","F, M, X or R","0 - 10 Must be 9 if age <16",01-Jun,03-Jun,01-Mar,,1 or empty,,,,,,01-Mar,1 or empty,,,,,,,,,,1 - 2 or 6 - 12,2 or 6 - 13,"1 - 2, 4, 8 - 14, 16 - 20, 28 - 31, 34 or 44 - 55",Text,"3 - 4, 6 - 7, 9 - 10, 13 - 14, 18 - 19, 21, 23 - 33, 35, 37 - 39 ",1 or 11,01-Feb,"Alphanumeric, 2 - 4 characters","Alphanumeric, -3 characters","9 character ONS code, beginning with 'E' (https://www.get-information-schools.service.gov.uk/Guidance/LaNameCodes) ",01-Mar,1 or empty,,,,,01-Feb,,,,"1 - 4, 7 - 10, 14 - 24",01-Mar,01-Mar,0 - 99999,"1, 3, 6, 9 or 10",01-Apr,0 - 1,01-Oct,xxxx.xx,,,,01-Mar,xxxx.xx,"F, M or R","F, M or R","F, M or R","F, M or R","F, M or R","F, M or R","F, M or R","F, M or R",1 - 3,Text,1 - 3,Text,1 - 3,Text,1 - 3,Text,1 - 3,Text,1 - 3,Text,1 - 3,Text,1 - 3,Text +3 characters","9 character ONS code, beginning with 'E' (https://www.get-information-schools.service.gov.uk/Guidance/LaNameCodes) ",01-Mar,1 or empty,,,,,01-Feb,,,,,01-Mar,01-Mar,0 - 99999,"1, 3, 6, 9 or 10",01-Apr,0 - 1,01-Oct,xxxx.xx,,,,01-Mar,xxxx.xx,"F, M or R","F, M or R","F, M or R","F, M or R","F, M or R","F, M or R","F, M or R","F, M or R",1 - 3,Text,1 - 3,Text,1 - 3,Text,1 - 3,Text,1 - 3,Text,1 - 3,Text,1 - 3,Text,1 - 3,Text,,, Can be empty?,No,,Yes,No,"Yes, if letting is general needs (if field 4 = 1)","Yes, if letting is general needs (if field 4 = 1)",No,,,,,"Yes, if letting is not 'Other intermediate rent product' (if field 11 is not 6)",Yes,,No,"Yes, if letting is a renewal (if field 7 = 1)","Yes, if letting is a renewal (if field 7 = 1) or a first-time let (if field 16 = 15 - 17)","Yes, if letting is supported housing (if field 4 = 2) or if the property's postcode is not empty (if fields 23 and 24 contain full and valid entries)","Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty)",Yes,"Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty)",Yes,"Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty)",,"Yes, if letting is supported housing (if field 4 = 2)",,,,,"Yes, if letting is a renewal (if field 7 = 1)",,,Yes,,,"Yes, if letting is general needs (if field 4 = 1)",No,,,"Yes, if 'Other' is not selected for tenancy type (if field 39 is not 3)","Yes, if letting is not a fixed-term tenancy (if field 39 is not 4 or 6)",No,,,,,"Yes, if all fields about person 2 are empty (fields 47 - 50)",,,,"Yes, if all fields about person 3 are empty (fields 51 - 54)",,,,"Yes, if all fields about person 4 are empty (fields 55 - 58)",,,,"Yes, if all fields about person 5 are empty (fields 59 - 62)",,,,"Yes, if all fields about person 6 are empty (fields 63 - 66)",,,,"Yes, if all fields about person 7 are empty (fields 67 - 70)",,,,"Yes, if all fields about person 8 are empty (fields 71 - 74)",,,,No,"Yes, if no one in the household is a current or former regular (if field 75 is not 1)","Yes, if no one in the household is a current or former regular or reserve (if field 75 is not 1 or 4)",No,"Yes, if no household members have access needs or if it is unknown (if field 83 or 84 = 1)",,,,"Yes, if a household member has an access need (if at least one of fields 79 to 82 = 1)",,No,"Yes, if a household member has an access need (if at least one of fields 79 to 82 = 1) If someone in the household does have such a condition (if field 89 = 1), then at least 1 of these fields must be 1.",,,,,,,,,,No,"Yes, if letting is a renewal (if field 7 = 1)",No,"Yes, if 'Other' is not selected for reason for leaving last settled home (if field 98 is not 20)",No,No,,"Yes, if postcode of household's last settled home is not known (if 102 = 2)",,Yes,No,"If household was given 'reasonable preference' (if field 107 = 1), at least one of these fields must be 1 -If household was not given 'reasonable preference' (if field 106 = 2 or 3), these fields will be ignored.",,,,,No,,,,"Yes, if letting is a renewal (if field 7 = 1)",No,"Yes, if household's income is unknown (if field 117 = 2 or 3)",,No,,"Yes, if letting is supported housing (if field 4 = 2)",No,"Yes, if the household does not pay rent (if field 122 = 1)",,,,"Yes, if the household doesn't receive housing benefits, or if it is unknown (if field 120 = 3, 9 or 10)","Yes, if the household does not need to pay rent or charges after receiving housing benefits (if field 128 is not 1)",,,,,,,,,,,,,,,,,,,,,,,, -Type of letting the question applies to,,,,,Supported housing only,,,,,,,Other Intermediate Rent only,,,,,,General needs only,,,,,,,,,,,,,,,,,,Supported housing only,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Supported housing only,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Duplicate check field?,Yes,,,,Yes,,,Yes,,,,,Yes,,,,,,,,,,Yes,,,,,,,,,,,,,,,,,,,Yes,,,,Yes,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Field number,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153 -,ORG1,ORG1,support@example.com,1,,,2,1,4,26,1,,1,1,1,5,1,,a,a,a,a,a1,1aa,E09000001,1,1,1,1,1,4,25,,,,,3,1,2,,,20,F,1,GBR,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,6,3,1,1,,,,,,1,1,,,,,,,,,,1,2,50,,30,1,2,,,,1,1,,,,,1,1,1,1,7,2,,,1,2,1,1,50,0,0,0,3,,F,,,,,,,,1,,,,,,,,,,,,,,, +If household was not given 'reasonable preference' (if field 106 = 2 or 3), these fields will be ignored.",,,,,No,,,,,No,"Yes, if household's income is unknown (if field 117 = 2 or 3)",,No,,"Yes, if letting is supported housing (if field 4 = 2)",No,"Yes, if the household does not pay rent (if field 122 = 1)",,,,"Yes, if the household doesn't receive housing benefits, or if it is unknown (if field 120 = 3, 9 or 10)","Yes, if the household does not need to pay rent or charges after receiving housing benefits (if field 128 is not 1)",,,,,,,,,,,,,,,,,,,,,,,,,,, +Type of letting the question applies to,,,,,Supported housing only,,,,,,,Other Intermediate Rent only,,,,,,General needs only,,,,,,,,,,,,,,,,,,Supported housing only,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Supported housing only,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Duplicate check field?,Yes,,,,Yes,,,Yes,,,,,Yes,,,,,,,,,,Yes,,,,,,,,,,,,,,,,,,,Yes,,,,Yes,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Field number,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156 +,ORG1,ORG1,support@example.com,1,,,2,1,4,26,1,,1,1,1,5,1,,a,a,a,a,a1,1aa,E09000001,1,1,1,1,1,4,25,,,,,3,1,2,,,20,F,1,GBR,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,6,3,1,1,,,,,,1,1,,,,,,,,,,1,2,50,,30,1,2,,,,1,1,,,,,1,1,1,1,1,2,,,1,2,1,1,50,0,0,0,3,,F,,,,,,,,1,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_codes_26.csv b/spec/fixtures/files/lettings_log_csv_export_codes_26.csv index a22448a5b..3634e6978 100644 --- a/spec/fixtures/files/lettings_log_csv_export_codes_26.csv +++ b/spec/fixtures/files/lettings_log_csv_export_codes_26.csv @@ -1,3 +1,3 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is the UPRN known?,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter the lead tenant's gender identity",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?,The following soft validation was confirmed: You have said that at least one person's situation is 'Unable to work because of long-term sickness or disability'.,Are the details of tenant 2 known?,What is person 2's age?,What is person 2's relationship to the lead tenant?,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 was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",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 age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",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 age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",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 age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",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 age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter person 8's gender identity",Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",The soft validation was confirmed,Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Was the local authority of the household's last settled home known?,The internal value to indicate if the previous LA was inferred from the postcode,Previous location LA name,Previous location's ONS LA Code,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,Was the letting made under the Accessible Register?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",,What was the source of referral for this letting?,"The following soft validation was confirmed: Are you sure? This is a general needs log, and this referral type is for supported housing.",Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? -id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,uprn_known,uprn_selection,address_search_value_check,address_line1_input,postcode_full_input,address_line1_as_entered,address_line2_as_entered,town_or_city_as_entered,county_as_entered,postcode_full_as_entered,la_as_entered,unittype_gn,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sexrab1,gender_same_as_sex1,gender_description1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,working_situation_illness_check,details_known_2,age2,relat2,multiple_partners_value_check,sexrab2,gender_same_as_sex2,gender_description2,sex2,ecstat2,details_known_3,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,sex3,ecstat3,details_known_4,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,sex4,ecstat4,details_known_5,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,sex5,ecstat5,details_known_6,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,sex6,ecstat6,details_known_7,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,sex7,ecstat7,details_known_8,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,reasonother_value_check,prevten,homeless,ppcodenk,ppostcode_full,previous_la_known,is_previous_la_inferred,prevloc_label,prevloc,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,accessible_register,letting_allocation_none,referral_type,referral,referral_value_check,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate -,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,1,2026,,MHCLG,MHCLG,1,7,0,2026-04-01,2,2,,,2,HIJKLMN,ABCDEFG,1,0,2,6,2,,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,7,1,3,2026-03-30,1,,1,2026-03-31,,,3,1,4,,2,4,,1,4,0,0,2,35,,F,1,,F,0,2,36,0,,0,32,P,,M,2,Non-binary,M,6,1,-9,R,R,3,,R,10,0,-9,R,R,3,,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,,,,0,0,1,268,,6,1,1,,,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,,,,,,,,,,,,,,,,,,,, +Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is the UPRN known?,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter the lead tenant's gender identity",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?,The following soft validation was confirmed: You have said that at least one person's situation is 'Unable to work because of long-term sickness or disability'.,Are the details of tenant 2 known?,What is person 2's age?,What is person 2's relationship to the lead tenant?,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 was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",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 age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",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 age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",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 age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",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 age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter person 8's gender identity",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?,What was the source of referral for this letting?,What was the source of referral for this letting?,Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? +id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,uprn_known,uprn_selection,address_search_value_check,address_line1_input,postcode_full_input,address_line1_as_entered,address_line2_as_entered,town_or_city_as_entered,county_as_entered,postcode_full_as_entered,la_as_entered,unittype_gn,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sexrab1,gender_same_as_sex1,gender_description1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,working_situation_illness_check,details_known_2,age2,relat2,multiple_partners_value_check,sexrab2,gender_same_as_sex2,gender_description2,sex2,ecstat2,details_known_3,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,sex3,ecstat3,details_known_4,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,sex4,ecstat4,details_known_5,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,sex5,ecstat5,details_known_6,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,sex6,ecstat6,details_known_7,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,sex7,ecstat7,details_known_8,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,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_register,referral_noms,referral_org,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate +,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,1,2026,,MHCLG,MHCLG,1,7,0,2026-04-01,2,2,,,2,HIJKLMN,ABCDEFG,1,0,2,6,2,,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,7,1,3,2026-03-30,1,,1,2026-03-31,,,3,1,4,,2,4,,1,4,0,0,2,35,,F,1,,F,0,2,36,0,,0,32,P,,M,2,Non-binary,M,6,1,-9,R,R,3,,R,10,0,-9,R,R,3,,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,1,,,0,0,1,268,,6,1,1,,,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_26.csv b/spec/fixtures/files/lettings_log_csv_export_labels_26.csv index f4d1d1240..7e8c7ec08 100644 --- a/spec/fixtures/files/lettings_log_csv_export_labels_26.csv +++ b/spec/fixtures/files/lettings_log_csv_export_labels_26.csv @@ -1,3 +1,3 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is the UPRN known?,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter the lead tenant's gender identity",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?,The following soft validation was confirmed: You have said that at least one person's situation is 'Unable to work because of long-term sickness or disability'.,Are the details of tenant 2 known?,What is person 2's age?,What is person 2's relationship to the lead tenant?,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 was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",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 age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",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 age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",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 age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",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 age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter person 8's gender identity",Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",The soft validation was confirmed,Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Was the local authority of the household's last settled home known?,The internal value to indicate if the previous LA was inferred from the postcode,Previous location LA name,Previous location's ONS LA Code,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,Was the letting made under the Accessible Register?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",,What was the source of referral for this letting?,"The following soft validation was confirmed: Are you sure? This is a general needs log, and this referral type is for supported housing.",Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? -id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,uprn_known,uprn_selection,address_search_value_check,address_line1_input,postcode_full_input,address_line1_as_entered,address_line2_as_entered,town_or_city_as_entered,county_as_entered,postcode_full_as_entered,la_as_entered,unittype_gn,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sexrab1,gender_same_as_sex1,gender_description1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,working_situation_illness_check,details_known_2,age2,relat2,multiple_partners_value_check,sexrab2,gender_same_as_sex2,gender_description2,sex2,ecstat2,details_known_3,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,sex3,ecstat3,details_known_4,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,sex4,ecstat4,details_known_5,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,sex5,ecstat5,details_known_6,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,sex6,ecstat6,details_known_7,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,sex7,ecstat7,details_known_8,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,reasonother_value_check,prevten,homeless,ppcodenk,ppostcode_full,previous_la_known,is_previous_la_inferred,prevloc_label,prevloc,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,accessible_register,letting_allocation_none,referral_type,referral,referral_value_check,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate -,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,single log,2026,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2026-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,Affordable rent basis,Tenant abandoned property,No,,Address line 1,,London,,NW9 5LL,No,Barnet,E09000003,No,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,House,Yes,3,2026-03-30,1,,Yes,2026-03-31,,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,4,,Yes,4,0,0,2,35,,Female,Yes,,Female,White,Irish,Australia,Other,,Yes,32,Yes,,Male,"No, enter gender identity",Non-binary,Male,Not seeking work,No,Not known,Prefers not to say,Prefers not to say,Prefers not to say,,Prefers not to say,Prefers not to say,Yes,Not known,Tenant prefers not to say,Prefers not to say,Prefers not to say,,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,,,,Yes,No,Weekly,268,,Universal Credit housing element,Yes,All,,,Every 2 weeks,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,Yes,Yes,12.0,6.0,,,,,,,,,,,,,,,,,,,, +Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is the UPRN known?,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter the lead tenant's gender identity",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?,The following soft validation was confirmed: You have said that at least one person's situation is 'Unable to work because of long-term sickness or disability'.,Are the details of tenant 2 known?,What is person 2's age?,What is person 2's relationship to the lead tenant?,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 was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",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 age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",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 age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",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 age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",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 age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter person 8's gender identity",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?,What was the source of referral for this letting?,What was the source of referral for this letting?,Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? +id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,uprn_known,uprn_selection,address_search_value_check,address_line1_input,postcode_full_input,address_line1_as_entered,address_line2_as_entered,town_or_city_as_entered,county_as_entered,postcode_full_as_entered,la_as_entered,unittype_gn,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sexrab1,gender_same_as_sex1,gender_description1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,working_situation_illness_check,details_known_2,age2,relat2,multiple_partners_value_check,sexrab2,gender_same_as_sex2,gender_description2,sex2,ecstat2,details_known_3,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,sex3,ecstat3,details_known_4,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,sex4,ecstat4,details_known_5,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,sex5,ecstat5,details_known_6,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,sex6,ecstat6,details_known_7,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,sex7,ecstat7,details_known_8,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,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_register,referral_noms,referral_org,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate +,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,single log,2026,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2026-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,Affordable rent basis,Tenant abandoned property,No,,Address line 1,,London,,NW9 5LL,No,Barnet,E09000003,No,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,House,Yes,3,2026-03-30,1,,Yes,2026-03-31,,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,4,,Yes,4,0,0,2,35,,Female,Yes,,Female,White,Irish,Australia,Other,,Yes,32,Yes,,Male,"No, enter gender identity",Non-binary,Male,Not seeking work,No,Not known,Prefers not to say,Prefers not to say,Prefers not to say,,Prefers not to say,Prefers not to say,Yes,Not known,Tenant prefers not to say,Prefers not to say,Prefers not to say,,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,Renewal to the same tenant in the same property,,,Yes,No,Weekly,268,,Universal Credit housing element,Yes,All,,,Every 2 weeks,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,Yes,Yes,12.0,6.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_non_support_codes_26.csv b/spec/fixtures/files/lettings_log_csv_export_non_support_codes_26.csv index ae4d47331..53263b201 100644 --- a/spec/fixtures/files/lettings_log_csv_export_non_support_codes_26.csv +++ b/spec/fixtures/files/lettings_log_csv_export_non_support_codes_26.csv @@ -1,3 +1,3 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,Is the UPRN known?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,What is the property's local authority?,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8",What is the lead tenant's age?,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter the lead tenant's gender identity",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 age?,What is person 2's relationship to the lead tenant?,What was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",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 age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",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 age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",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 age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",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 age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter person 8's gender identity",Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Previous location LA name,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,Was the letting made under the Accessible Register?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",,What was the source of referral for this letting?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge to the tenant,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Estimated outstanding amount,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? -id,status,duplicate_set_id,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn_known,uprn,address_line1,address_line2,town_or_city,county,postcode_full,la_label,unittype_gn,wchair,beds,voiddate,vacdays,majorrepairs,mrcdate,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,refused,age1,sexrab1,gender_same_as_sex1,gender_description1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,age2,relat2,sexrab2,gender_same_as_sex2,gender_description2,sex2,ecstat2,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,sex3,ecstat3,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,sex4,ecstat4,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,sex5,ecstat5,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,sex6,ecstat6,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,sex7,ecstat7,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,prevten,homeless,ppcodenk,ppostcode_full,prevloc_label,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,accessible_register,letting_allocation_none,referral_type,referral,incref,incfreq,earnings,hb,has_benefits,benefits,household_charge,nocharge,period,brent,scharge,pscharge,supcharg,tcharge,hbrentshortfall,tshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate -,in_progress,,choreographer@owtluk.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,1,2026,,MHCLG,MHCLG,1,7,0,2026-04-01,2,2,,,2,HIJKLMN,ABCDEFG,1,0,2,6,2,0,,Address line 1,,London,,NW9 5LL,Barnet,7,1,3,2026-03-30,1,1,2026-03-31,,3,1,4,,2,4,1,35,F,1,,F,0,2,36,0,32,P,M,2,Non-binary,M,6,-9,R,R,3,,R,10,-9,R,R,3,,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,,,0,1,268,6,1,1,,,2,200.0,50.0,40.0,35.0,325.0,1,12.0,,,,,,,,,,,,,,,,,,,, +Log ID,Status of log,ID of a set of duplicate logs,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,Is the UPRN known?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,What is the property's local authority?,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8",What is the lead tenant's age?,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter the lead tenant's gender identity",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 age?,What is person 2's relationship to the lead tenant?,What was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",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 age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",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 age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",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 age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",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 age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter person 8's gender identity",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?,What was the source of referral for this letting?,What was the source of referral for this letting?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge to the tenant,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Estimated outstanding amount,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? +id,status,duplicate_set_id,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn_known,uprn,address_line1,address_line2,town_or_city,county,postcode_full,la_label,unittype_gn,wchair,beds,voiddate,vacdays,majorrepairs,mrcdate,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,refused,age1,sexrab1,gender_same_as_sex1,gender_description1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,age2,relat2,sexrab2,gender_same_as_sex2,gender_description2,sex2,ecstat2,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,sex3,ecstat3,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,sex4,ecstat4,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,sex5,ecstat5,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,sex6,ecstat6,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,sex7,ecstat7,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,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_register,referral_noms,referral_org,incref,incfreq,earnings,hb,has_benefits,benefits,household_charge,nocharge,period,brent,scharge,pscharge,supcharg,tcharge,hbrentshortfall,tshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate +,in_progress,,choreographer@owtluk.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,1,2026,,MHCLG,MHCLG,1,7,0,2026-04-01,2,2,,,2,HIJKLMN,ABCDEFG,1,0,2,6,2,0,,Address line 1,,London,,NW9 5LL,Barnet,7,1,3,2026-03-30,1,1,2026-03-31,,3,1,4,,2,4,1,35,F,1,,F,0,2,36,0,32,P,M,2,Non-binary,M,6,-9,R,R,3,,R,10,-9,R,R,3,,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,1,,,0,1,268,6,1,1,,,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_26.csv b/spec/fixtures/files/lettings_log_csv_export_non_support_labels_26.csv index cd7736634..b012865a3 100644 --- a/spec/fixtures/files/lettings_log_csv_export_non_support_labels_26.csv +++ b/spec/fixtures/files/lettings_log_csv_export_non_support_labels_26.csv @@ -1,3 +1,3 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,Is the UPRN known?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,What is the property's local authority?,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8",What is the lead tenant's age?,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter the lead tenant's gender identity",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 age?,What is person 2's relationship to the lead tenant?,What was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",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 age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",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 age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",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 age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",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 age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter person 8's gender identity",Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Previous location LA name,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,Was the letting made under the Accessible Register?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",,What was the source of referral for this letting?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge to the tenant,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Estimated outstanding amount,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? -id,status,duplicate_set_id,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn_known,uprn,address_line1,address_line2,town_or_city,county,postcode_full,la_label,unittype_gn,wchair,beds,voiddate,vacdays,majorrepairs,mrcdate,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,refused,age1,sexrab1,gender_same_as_sex1,gender_description1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,age2,relat2,sexrab2,gender_same_as_sex2,gender_description2,sex2,ecstat2,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,sex3,ecstat3,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,sex4,ecstat4,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,sex5,ecstat5,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,sex6,ecstat6,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,sex7,ecstat7,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,prevten,homeless,ppcodenk,ppostcode_full,prevloc_label,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,accessible_register,letting_allocation_none,referral_type,referral,incref,incfreq,earnings,hb,has_benefits,benefits,household_charge,nocharge,period,brent,scharge,pscharge,supcharg,tcharge,hbrentshortfall,tshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate -,in_progress,,choreographer@owtluk.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,single log,2026,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2026-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,Affordable rent basis,Tenant abandoned property,No,No,,Address line 1,,London,,NW9 5LL,Barnet,House,Yes,3,2026-03-30,1,Yes,2026-03-31,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,4,Yes,35,Female,Yes,,Female,White,Irish,Australia,Other,32,Yes,Male,"No, enter gender identity",Non-binary,Male,Not seeking work,Not known,Prefers not to say,Prefers not to say,Prefers not to say,,Prefers not to say,Prefers not to say,Not known,Tenant prefers not to say,Prefers not to say,Prefers not to say,,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,,,No,Weekly,268,Universal Credit housing element,Yes,All,,,Every 2 weeks,200.0,50.0,40.0,35.0,325.0,Yes,12.0,,,,,,,,,,,,,,,,,,,, +Log ID,Status of log,ID of a set of duplicate logs,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,Is the UPRN known?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,What is the property's local authority?,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8",What is the lead tenant's age?,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter the lead tenant's gender identity",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 age?,What is person 2's relationship to the lead tenant?,What was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",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 age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",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 age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",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 age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",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 age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter person 8's gender identity",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?,What was the source of referral for this letting?,What was the source of referral for this letting?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge to the tenant,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Estimated outstanding amount,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? +id,status,duplicate_set_id,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn_known,uprn,address_line1,address_line2,town_or_city,county,postcode_full,la_label,unittype_gn,wchair,beds,voiddate,vacdays,majorrepairs,mrcdate,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,refused,age1,sexrab1,gender_same_as_sex1,gender_description1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,age2,relat2,sexrab2,gender_same_as_sex2,gender_description2,sex2,ecstat2,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,sex3,ecstat3,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,sex4,ecstat4,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,sex5,ecstat5,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,sex6,ecstat6,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,sex7,ecstat7,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,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_register,referral_noms,referral_org,incref,incfreq,earnings,hb,has_benefits,benefits,household_charge,nocharge,period,brent,scharge,pscharge,supcharg,tcharge,hbrentshortfall,tshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate +,in_progress,,choreographer@owtluk.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,single log,2026,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2026-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,Affordable rent basis,Tenant abandoned property,No,No,,Address line 1,,London,,NW9 5LL,Barnet,House,Yes,3,2026-03-30,1,Yes,2026-03-31,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,4,Yes,35,Female,Yes,,Female,White,Irish,Australia,Other,32,Yes,Male,"No, enter gender identity",Non-binary,Male,Not seeking work,Not known,Prefers not to say,Prefers not to say,Prefers not to say,,Prefers not to say,Prefers not to say,Not known,Tenant prefers not to say,Prefers not to say,Prefers not to say,,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,Renewal to the same tenant in the same property,,,No,Weekly,268,Universal Credit housing element,Yes,All,,,Every 2 weeks,200.0,50.0,40.0,35.0,325.0,Yes,12.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/variable_definitions/lettings_download_26_27.csv b/spec/fixtures/variable_definitions/lettings_download_26_27.csv index 609c3bd28..60153282c 100644 --- a/spec/fixtures/variable_definitions/lettings_download_26_27.csv +++ b/spec/fixtures/variable_definitions/lettings_download_26_27.csv @@ -23,3 +23,6 @@ gender_description5,If 'No', enter person 5's gender identity gender_description6,If 'No', enter person 6's gender identity gender_description7,If 'No', enter person 7's gender identity gender_description8,If 'No', enter person 8's gender identity +referral_register,What was the source of referral for this letting? +referral_noms,What was the source of referral for this letting? +referral_org,What was the source of referral for this letting? diff --git a/spec/lib/tasks/log_variable_definitions_spec.rb b/spec/lib/tasks/log_variable_definitions_spec.rb index 2c5894d88..73ec882c2 100644 --- a/spec/lib/tasks/log_variable_definitions_spec.rb +++ b/spec/lib/tasks/log_variable_definitions_spec.rb @@ -6,7 +6,7 @@ RSpec.describe "log_variable_definitions" do subject(:task) { Rake::Task["data_import:add_variable_definitions"] } let(:path) { "spec/fixtures/variable_definitions" } - let(:total_variable_definitions_count) { 447 } + let(:total_variable_definitions_count) { 450 } before do Rake.application.rake_require("tasks/log_variable_definitions") diff --git a/spec/models/form/lettings/pages/referral_noms_hr_spec.rb b/spec/models/form/lettings/pages/referral_noms_hr_spec.rb new file mode 100644 index 000000000..b3cd1e113 --- /dev/null +++ b/spec/models/form/lettings/pages/referral_noms_hr_spec.rb @@ -0,0 +1,79 @@ +require "rails_helper" + +RSpec.describe Form::Lettings::Pages::ReferralNomsHr, type: :model do + subject(:page) { described_class.new(page_id, page_definition, subsection) } + + let(:page_id) { nil } + let(:page_definition) { nil } + let(:subsection) { instance_double(Form::Subsection, form:) } + let(:form) { instance_double(Form, start_date: Time.zone.today) } + let(:prp?) { nil } + let(:organisation) { instance_double(Organisation, prp?: prp?) } + let(:is_renewal?) { nil } + let(:referral_is_from_housing_register?) { nil } + let(:log) { instance_double(LettingsLog, is_renewal?: is_renewal?, owning_organisation: organisation, referral_is_from_housing_register?: referral_is_from_housing_register?) } + + before do + allow(subsection).to receive(:form).and_return(form) + end + + it "has correct subsection" do + expect(page.subsection).to eq(subsection) + end + + it "has correct questions" do + expect(page.questions.map(&:id)).to eq(%w[referral_noms]) + end + + it "has the correct id" do + expect(page.id).to eq("referral_noms_hr") + end + + it "has the correct description" do + expect(page.description).to be_nil + end + + it "has the correct depends_on" do + expect(page.depends_on).to be nil + end + + context "and log owning organisation is not prp" do + let(:prp?) { false } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + + context "and log owning organisation is prp" do + let(:prp?) { true } + + context "when log is a renewal" do + let(:is_renewal?) { true } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + + context "and log is not a renewal" do + let(:is_renewal?) { false } + + context "and log referral is not from housing register" do + let(:referral_is_from_housing_register?) { false } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + + context "and log referral is from housing register" do + let(:referral_is_from_housing_register?) { true } + + it "is routed to" do + expect(page.routed_to?(log, nil)).to be true + end + end + end + end +end diff --git a/spec/models/form/lettings/pages/referral_noms_la_hr_spec.rb b/spec/models/form/lettings/pages/referral_noms_la_hr_spec.rb new file mode 100644 index 000000000..91fb8cadb --- /dev/null +++ b/spec/models/form/lettings/pages/referral_noms_la_hr_spec.rb @@ -0,0 +1,79 @@ +require "rails_helper" + +RSpec.describe Form::Lettings::Pages::ReferralNomsLaHr, type: :model do + subject(:page) { described_class.new(page_id, page_definition, subsection) } + + let(:page_id) { nil } + let(:page_definition) { nil } + let(:subsection) { instance_double(Form::Subsection, form:) } + let(:form) { instance_double(Form, start_date: Time.zone.today) } + let(:prp?) { nil } + let(:organisation) { instance_double(Organisation, prp?: prp?) } + let(:is_renewal?) { nil } + let(:referral_is_from_local_authority_housing_register?) { nil } + let(:log) { instance_double(LettingsLog, is_renewal?: is_renewal?, owning_organisation: organisation, referral_is_from_local_authority_housing_register?: referral_is_from_local_authority_housing_register?) } + + before do + allow(subsection).to receive(:form).and_return(form) + end + + it "has correct subsection" do + expect(page.subsection).to eq(subsection) + end + + it "has correct questions" do + expect(page.questions.map(&:id)).to eq(%w[referral_noms]) + end + + it "has the correct id" do + expect(page.id).to eq("referral_noms_la_hr") + end + + it "has the correct description" do + expect(page.description).to be_nil + end + + it "has the correct depends_on" do + expect(page.depends_on).to be nil + end + + context "and log owning organisation is not prp" do + let(:prp?) { false } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + + context "and log owning organisation is prp" do + let(:prp?) { true } + + context "when log is a renewal" do + let(:is_renewal?) { true } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + + context "and log is not a renewal" do + let(:is_renewal?) { false } + + context "and log referral is not from local authority housing register" do + let(:referral_is_from_local_authority_housing_register?) { false } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + + context "and log referral is from local authority housing register" do + let(:referral_is_from_local_authority_housing_register?) { true } + + it "is routed to" do + expect(page.routed_to?(log, nil)).to be true + end + end + end + end +end diff --git a/spec/models/form/lettings/pages/referral_org_directly_referred_spec.rb b/spec/models/form/lettings/pages/referral_org_directly_referred_spec.rb new file mode 100644 index 000000000..27e1cfa50 --- /dev/null +++ b/spec/models/form/lettings/pages/referral_org_directly_referred_spec.rb @@ -0,0 +1,79 @@ +require "rails_helper" + +RSpec.describe Form::Lettings::Pages::ReferralOrgDirectlyReferred, type: :model do + subject(:page) { described_class.new(page_id, page_definition, subsection) } + + let(:page_id) { nil } + let(:page_definition) { nil } + let(:subsection) { instance_double(Form::Subsection, form:) } + let(:form) { instance_double(Form, start_date: Time.zone.today) } + let(:prp?) { nil } + let(:organisation) { instance_double(Organisation, prp?: prp?) } + let(:is_renewal?) { nil } + let(:referral_is_directly_referred?) { nil } + let(:log) { instance_double(LettingsLog, is_renewal?: is_renewal?, owning_organisation: organisation, referral_is_directly_referred?: referral_is_directly_referred?) } + + before do + allow(subsection).to receive(:form).and_return(form) + end + + it "has correct subsection" do + expect(page.subsection).to eq(subsection) + end + + it "has correct questions" do + expect(page.questions.map(&:id)).to eq(%w[referral_org]) + end + + it "has the correct id" do + expect(page.id).to eq("referral_org_directly_referred") + end + + it "has the correct description" do + expect(page.description).to be_nil + end + + it "has the correct depends_on" do + expect(page.depends_on).to be nil + end + + context "and log owning organisation is not prp" do + let(:prp?) { false } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + + context "and log owning organisation is prp" do + let(:prp?) { true } + + context "when log is a renewal" do + let(:is_renewal?) { true } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + + context "and log is not a renewal" do + let(:is_renewal?) { false } + + context "and log referral is not nominated by local authority" do + let(:referral_is_directly_referred?) { false } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + + context "and log referral is nominated by local authority" do + let(:referral_is_directly_referred?) { true } + + it "is routed to" do + expect(page.routed_to?(log, nil)).to be true + end + end + end + end +end diff --git a/spec/models/form/lettings/pages/referral_org_nominated_spec.rb b/spec/models/form/lettings/pages/referral_org_nominated_spec.rb new file mode 100644 index 000000000..68a0a17f1 --- /dev/null +++ b/spec/models/form/lettings/pages/referral_org_nominated_spec.rb @@ -0,0 +1,79 @@ +require "rails_helper" + +RSpec.describe Form::Lettings::Pages::ReferralOrgNominated, type: :model do + subject(:page) { described_class.new(page_id, page_definition, subsection) } + + let(:page_id) { nil } + let(:page_definition) { nil } + let(:subsection) { instance_double(Form::Subsection, form:) } + let(:form) { instance_double(Form, start_date: Time.zone.today) } + let(:prp?) { nil } + let(:organisation) { instance_double(Organisation, prp?: prp?) } + let(:is_renewal?) { nil } + let(:referral_is_nominated_by_local_authority?) { nil } + let(:log) { instance_double(LettingsLog, is_renewal?: is_renewal?, owning_organisation: organisation, referral_is_nominated_by_local_authority?: referral_is_nominated_by_local_authority?) } + + before do + allow(subsection).to receive(:form).and_return(form) + end + + it "has correct subsection" do + expect(page.subsection).to eq(subsection) + end + + it "has correct questions" do + expect(page.questions.map(&:id)).to eq(%w[referral_org]) + end + + it "has the correct id" do + expect(page.id).to eq("referral_org_nominated") + end + + it "has the correct description" do + expect(page.description).to be_nil + end + + it "has the correct depends_on" do + expect(page.depends_on).to be nil + end + + context "and log owning organisation is not prp" do + let(:prp?) { false } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + + context "and log owning organisation is prp" do + let(:prp?) { true } + + context "when log is a renewal" do + let(:is_renewal?) { true } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + + context "and log is not a renewal" do + let(:is_renewal?) { false } + + context "and log referral is not nominated by local authority" do + let(:referral_is_nominated_by_local_authority?) { false } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + + context "and log referral is nominated by local authority" do + let(:referral_is_nominated_by_local_authority?) { true } + + it "is routed to" do + expect(page.routed_to?(log, nil)).to be true + end + end + end + end +end diff --git a/spec/models/form/lettings/pages/referral_register_la_spec.rb b/spec/models/form/lettings/pages/referral_register_la_spec.rb new file mode 100644 index 000000000..1f2459cbd --- /dev/null +++ b/spec/models/form/lettings/pages/referral_register_la_spec.rb @@ -0,0 +1,78 @@ +require "rails_helper" + +RSpec.describe Form::Lettings::Pages::ReferralRegisterLa, type: :model do + subject(:page) { described_class.new(page_id, page_definition, subsection) } + + let(:page_id) { nil } + let(:page_definition) { nil } + let(:subsection) { instance_double(Form::Subsection, form:) } + let(:form) { instance_double(Form, start_date: Time.zone.today) } + let(:la?) { nil } + let(:organisation) { instance_double(Organisation, la?: la?) } + let(:is_renewal?) { nil } + let(:log) { instance_double(LettingsLog, is_renewal?: is_renewal?, owning_organisation: organisation) } + + before do + allow(subsection).to receive(:form).and_return(form) + end + + it "has correct subsection" do + expect(page.subsection).to eq(subsection) + end + + it "has correct questions" do + expect(page.questions.map(&:id)).to eq(%w[referral_register]) + end + + it "has the correct id" do + expect(page.id).to eq("referral_register_la") + end + + it "has the correct description" do + expect(page.description).to be_nil + end + + it "has the correct depends_on" do + expect(page.depends_on).to be nil + end + + context "when log is a renewal" do + let(:is_renewal?) { true } + + context "and log owning organisation is la" do + let(:la?) { true } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + + context "and log owning organisation is not an la" do + let(:la?) { false } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + end + + context "when log is not a renewal" do + let(:is_renewal?) { false } + + context "and log owning organisation is la" do + let(:la?) { true } + + it "is routed to" do + expect(page.routed_to?(log, nil)).to be true + end + end + + context "and log owning organisation is not an la" do + let(:la?) { false } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + end +end diff --git a/spec/models/form/lettings/pages/referral_register_prp_spec.rb b/spec/models/form/lettings/pages/referral_register_prp_spec.rb new file mode 100644 index 000000000..bcb48562a --- /dev/null +++ b/spec/models/form/lettings/pages/referral_register_prp_spec.rb @@ -0,0 +1,78 @@ +require "rails_helper" + +RSpec.describe Form::Lettings::Pages::ReferralRegisterPrp, type: :model do + subject(:page) { described_class.new(page_id, page_definition, subsection) } + + let(:page_id) { nil } + let(:page_definition) { nil } + let(:subsection) { instance_double(Form::Subsection, form:) } + let(:form) { instance_double(Form, start_date: Time.zone.today) } + let(:prp?) { nil } + let(:organisation) { instance_double(Organisation, prp?: prp?) } + let(:is_renewal?) { nil } + let(:log) { instance_double(LettingsLog, is_renewal?: is_renewal?, owning_organisation: organisation) } + + before do + allow(subsection).to receive(:form).and_return(form) + end + + it "has correct subsection" do + expect(page.subsection).to eq(subsection) + end + + it "has correct questions" do + expect(page.questions.map(&:id)).to eq(%w[referral_register]) + end + + it "has the correct id" do + expect(page.id).to eq("referral_register_prp") + end + + it "has the correct description" do + expect(page.description).to be_nil + end + + it "has the correct depends_on" do + expect(page.depends_on).to be nil + end + + context "when log is a renewal" do + let(:is_renewal?) { true } + + context "and log owning organisation is prp" do + let(:prp?) { true } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + + context "and log owning organisation is not prp" do + let(:prp?) { false } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + end + + context "when log is not a renewal" do + let(:is_renewal?) { false } + + context "and log owning organisation is prp" do + let(:prp?) { true } + + it "is routed to" do + expect(page.routed_to?(log, nil)).to be true + end + end + + context "and log owning organisation is not prp" do + let(:prp?) { false } + + it "is not routed to" do + expect(page.routed_to?(log, nil)).to be false + end + end + end +end diff --git a/spec/models/form/lettings/questions/referral_noms_spec.rb b/spec/models/form/lettings/questions/referral_noms_spec.rb new file mode 100644 index 000000000..01fa26c9c --- /dev/null +++ b/spec/models/form/lettings/questions/referral_noms_spec.rb @@ -0,0 +1,83 @@ +require "rails_helper" + +RSpec.describe Form::Lettings::Questions::ReferralNoms, type: :model do + subject(:question) { described_class.new(question_id, question_definition, page, referral_register) } + + let(:question_id) { nil } + let(:question_definition) { nil } + let(:page) { instance_double(Form::Page) } + let(:referral_register) { nil } + let(:subsection) { instance_double(Form::Subsection) } + let(:form) { instance_double(Form, start_date: Time.zone.today) } + + before do + allow(page).to receive(:subsection).and_return(subsection) + allow(subsection).to receive(:form).and_return(form) + end + + it "has correct page" do + expect(question.page).to eq(page) + end + + it "has the correct id" do + expect(question.id).to eq("referral_noms") + end + + it "has the correct type" do + expect(question.type).to eq("radio") + end + + it "is not marked as derived" do + expect(question.derived?(nil)).to be false + end + + context "when referral_register is 6" do + let(:referral_register) { 6 } + + it "has the correct answer_options" do + expect(question.answer_options).to eq( + { + "1" => { + "value" => "Nominated by a local authority to a PRP", + }, + "2" => { + "value" => "Supported housing only - referred by a local authority to a PRP", + }, + "3" => { + "value" => "Internal transfer from another property owned by the same PRP landlord - for existing social tenants only", + }, + "4" => { + "value" => "Other", + }, + }.freeze, + ) + end + end + + context "when referral_register is 7" do + let(:referral_register) { 7 } + + it "has the correct answer_options" do + expect(question.answer_options).to eq( + { + "5" => { + "value" => "Internal transfer from another property owned by the same PRP landlord - for existing social tenants only", + }, + "6" => { + "value" => " A different PRP landlord - for existing social tenants only", + }, + "7" => { + "value" => "Directly referred by a third party", + }, + "8" => { + "value" => "Other", + }, + }.freeze, + ) + end + end + + it "has the correct question_number" do + expect(question.question_number).to eq(92) + end +end diff --git a/spec/models/form/lettings/questions/referral_org_spec.rb b/spec/models/form/lettings/questions/referral_org_spec.rb new file mode 100644 index 000000000..e6962be23 --- /dev/null +++ b/spec/models/form/lettings/questions/referral_org_spec.rb @@ -0,0 +1,119 @@ +require "rails_helper" + +RSpec.describe Form::Lettings::Questions::ReferralOrg, type: :model do + subject(:question) { described_class.new(question_id, question_definition, page, referral_noms) } + + let(:question_id) { nil } + let(:question_definition) { nil } + let(:page) { instance_double(Form::Page) } + let(:referral_noms) { nil } + let(:subsection) { instance_double(Form::Subsection) } + let(:form) { instance_double(Form, start_date: Time.zone.today) } + + before do + allow(page).to receive(:subsection).and_return(subsection) + allow(subsection).to receive(:form).and_return(form) + end + + it "has correct page" do + expect(question.page).to eq(page) + end + + it "has the correct id" do + expect(question.id).to eq("referral_org") + end + + it "has the correct type" do + expect(question.type).to eq("radio") + end + + it "is not marked as derived" do + expect(question.derived?(nil)).to be false + end + + context "when referral_noms is 1" do + let(:referral_noms) { 1 } + + it "has the correct answer_options" do + expect(question.answer_options).to eq( + { + "1" => { + "value" => "Referred to LA by health service", + }, + "2" => { + "value" => "Referred to LA by community learning disability team", + }, + "3" => { + "value" => "Referred to LA by community mental health team", + }, + "4" => { + "value" => "Referred to LA by adult social services", + }, + "5" => { + "value" => "Referred to LA by children's social care", + }, + "6" => { + "value" => "Referred to LA by police, probation, prison or youth offending team following a custodial sentence", + }, + "7" => { + "value" => "Referred to LA by police, probation, prison or youth offending team without a custodial sentence", + }, + "8" => { + "value" => "Referred to LA by a voluntary agency", + }, + "9" => { + "value" => "Other referral", + }, + "10" => { + "value" => "Don't know", + }, + }.freeze, + ) + end + end + + context "when referral_noms is 7" do + let(:referral_noms) { 7 } + + it "has the correct answer_options" do + expect(question.answer_options).to eq( + { + "11" => { + "value" => "Health service", + }, + "12" => { + "value" => "Community learning disability team", + }, + "13" => { + "value" => "Community mental health team", + }, + "14" => { + "value" => "Adult social services", + }, + "15" => { + "value" => "Children's social care", + }, + "16" => { + "value" => "Police, probation, prison or youth offending team following a custodial sentence", + }, + "17" => { + "value" => "Police, probation, prison or youth offending team without a custodial sentence", + }, + "18" => { + "value" => "Voluntary agency", + }, + "19" => { + "value" => "Other third party", + }, + "20" => { + "value" => "Don't know", + }, + }.freeze, + ) + end + end + + it "has the correct question_number" do + expect(question.question_number).to eq(92) + end +end diff --git a/spec/models/form/lettings/questions/referral_register_spec.rb b/spec/models/form/lettings/questions/referral_register_spec.rb new file mode 100644 index 000000000..3722adc1f --- /dev/null +++ b/spec/models/form/lettings/questions/referral_register_spec.rb @@ -0,0 +1,104 @@ +require "rails_helper" + +RSpec.describe Form::Lettings::Questions::ReferralRegister, type: :model do + subject(:question) { described_class.new(question_id, question_definition, page, provider_type) } + + let(:question_id) { nil } + let(:question_definition) { nil } + let(:page) { instance_double(Form::Page) } + let(:provider_type) { nil } + let(:subsection) { instance_double(Form::Subsection) } + let(:form) { instance_double(Form, start_date: Time.zone.today) } + let(:is_renewal?) { nil } + let(:log) { instance_double(LettingsLog, is_renewal?: is_renewal?) } + + before do + allow(page).to receive(:subsection).and_return(subsection) + allow(subsection).to receive(:form).and_return(form) + end + + it "has correct page" do + expect(question.page).to eq(page) + end + + it "has the correct id" do + expect(question.id).to eq("referral_register") + end + + it "has the correct type" do + expect(question.type).to eq("radio") + end + + context "when log is a renewal" do + let(:is_renewal?) { true } + + it "is marked as derived" do + expect(question.derived?(log)).to be true + end + end + + context "when log is not a renewal" do + let(:is_renewal?) { false } + + it "is not marked as derived" do + expect(question.derived?(log)).to be false + end + end + + context "when log is owned by an LA" do + let(:provider_type) { :la } + + it "has the correct answer_options" do + expect(question.answer_options).to eq( + { + "1" => { + "value" => "Renewal to the same tenant in the same property", + }, + "2" => { + "value" => "Internal transfer from another property owned by the same local authority - for existing social tenants only", + }, + "3" => { + "value" => "From a housing register (waiting list)", + }, + "4" => { + "value" => "Tenant applied directly (not via a nomination or housing register)", + }, + }.freeze, + ) + end + + it "has the correct question_number" do + expect(question.question_number).to eq(91) + end + end + + context "when log is owned by an PRP" do + let(:provider_type) { :prp } + + it "has the correct answer_options" do + expect(question.answer_options).to eq( + { + "5" => { + "value" => "Renewal to the same tenant in the same property", + }, + "6" => { + "value" => "From a local authority housing register (waiting list) or a register with local authority involvement", + }, + "7" => { + "value" => "From a housing register (waiting list) with no local authority involvement", + }, + "8" => { + "value" => "Tenant applied directly (not via a nomination or waiting list)", + }, + "9" => { + "value" => "Don't know", + }, + }.freeze, + ) + end + + it "has the correct question_number" do + expect(question.question_number).to eq(92) + end + end +end diff --git a/spec/models/form/lettings/subsections/household_situation_spec.rb b/spec/models/form/lettings/subsections/household_situation_spec.rb index eb056ca7a..3da63a140 100644 --- a/spec/models/form/lettings/subsections/household_situation_spec.rb +++ b/spec/models/form/lettings/subsections/household_situation_spec.rb @@ -10,16 +10,18 @@ RSpec.describe Form::Lettings::Subsections::HouseholdSituation, type: :model do before do allow(section).to receive(:form).and_return(form) + allow(form).to receive(:start_year_2024_or_later?).and_return(false) + allow(form).to receive(:start_year_2025_or_later?).and_return(false) + allow(form).to receive(:start_year_2026_or_later?).and_return(false) end it "has correct section" do expect(household_situation.section).to eq(section) end - context "with form year before 2024" do + context "with form year is 2024", metadata: { year: 24 } do before do - allow(form).to receive(:start_year_2024_or_later?).and_return(false) - allow(form).to receive(:start_year_2025_or_later?).and_return(false) + allow(form).to receive(:start_year_2024_or_later?).and_return(true) end it "has correct pages" do @@ -29,6 +31,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdSituation, type: :model do time_on_waiting_list reason_for_leaving_last_settled_home reason_for_leaving_last_settled_home_renewal + reasonother_value_check previous_housing_situation previous_housing_situation_renewal homelessness @@ -47,10 +50,10 @@ RSpec.describe Form::Lettings::Subsections::HouseholdSituation, type: :model do end end - context "with form year is 2024" do + context "with form year is 2025", metadata: { year: 25 } do 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) + allow(form).to receive(:start_year_2025_or_later?).and_return(true) end it "has correct pages" do @@ -69,20 +72,23 @@ RSpec.describe Form::Lettings::Subsections::HouseholdSituation, type: :model do reasonable_preference reasonable_preference_reason allocation_system - referral + referral_type + referral_direct + referral_la referral_prp - referral_supported_housing - referral_supported_housing_prp + referral_hsc + referral_justice referral_value_check ], ) end end - context "with form year is 2025" do + context "with form year is 2026", metadata: { year: 26 } do 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) + allow(form).to receive(:start_year_2026_or_later?).and_return(true) end it "has correct pages" do @@ -101,13 +107,12 @@ RSpec.describe Form::Lettings::Subsections::HouseholdSituation, type: :model do reasonable_preference reasonable_preference_reason allocation_system - referral_type - referral_direct - referral_la - referral_prp - referral_hsc - referral_justice - referral_value_check + referral_register_la + referral_register_prp + referral_noms_la_hr + referral_noms_hr + referral_org_nominated + referral_org_directly_referred ], ) end diff --git a/spec/models/validations/household_validations_spec.rb b/spec/models/validations/household_validations_spec.rb index f79f2c6e4..5d2d971e5 100644 --- a/spec/models/validations/household_validations_spec.rb +++ b/spec/models/validations/household_validations_spec.rb @@ -1,6 +1,8 @@ require "rails_helper" RSpec.describe Validations::HouseholdValidations do + include CollectionTimeHelper + subject(:household_validator) { validator_class.new } let(:validator_class) { Class.new { include Validations::HouseholdValidations } } @@ -488,6 +490,141 @@ RSpec.describe Validations::HouseholdValidations do expect(record.errors["homeless"]).to be_empty end end + + context "when start year is 2026" do + let(:startdate) { collection_start_date_for_year(2026) } + + [ + { + internal_transfer: true, + label: "LA", + referral_register: 2, + referral_noms: nil, + }, + { + internal_transfer: true, + label: "PRP", + referral_register: 6, + referral_noms: 3, + }, + { + internal_transfer: true, + label: "PRP", + referral_register: 7, + referral_noms: 5, + }, + { + internal_transfer: false, + label: "LA", + referral_register: 1, + referral_noms: nil, + }, + { + internal_transfer: false, + label: "PRP", + referral_register: 6, + referral_noms: 2, + }, + { + internal_transfer: false, + label: "PRP", + referral_register: 7, + referral_noms: 6, + }, + ] + .each do |scenario| + context "and record #{scenario[:internal_transfer] ? 'is ' : 'is not '}internal transfer via #{scenario[:label]} path" do + before do + record.owning_organisation.provider_type = scenario[:label] + record.referral_register = scenario[:referral_register] + record.referral_noms = scenario[:referral_noms] + end + + context "and prevten is nil" do + before do + record.prevten = nil + end + + it "does not add an error" do + household_validator.validate_referral(record) + expect(record.errors["prevten"]).to be_empty + expect(record.errors["referral_register"]).to be_empty + expect(record.errors["referral_noms"]).to be_empty + end + end + + [ + { code: 3, label: "Private sector tenancy" }, + { code: 27, label: "Owner occupation (low-cost home ownership)" }, + { code: 26, label: "Owner occupation (private)" }, + { code: 28, label: "Living with friends or family (long-term)" }, + { code: 39, label: "Sofa surfing (moving regularly between family or friends, no permanent bed)" }, + { code: 14, label: "Bed and breakfast" }, + { code: 7, label: "Direct access hostel" }, + { code: 10, label: "Hospital" }, + { code: 29, label: "Prison or approved probation hostel" }, + { code: 19, label: "Rough sleeping" }, + { code: 18, label: "Any other temporary accommodation" }, + { code: 13, label: "Children’s home or foster care" }, + { code: 24, label: "Home Office Asylum Support" }, + { code: 37, label: "Host family or similar refugee accommodation" }, + { code: 23, label: "Mobile home or caravan" }, + { code: 21, label: "Refuge" }, + { code: 9, label: "Residential care home" }, + { code: 4, label: "Tied housing or rented with job" }, + { code: 25, label: "Any other accommodation" }, + ].each do |prevten| + context "and prevten is #{prevten[:code]}" do + before do + record.prevten = prevten[:code] + end + + if scenario[:internal_transfer] + it "adds an error" do + household_validator.validate_referral(record) + expect(record.errors["prevten"]) + .to include(match I18n.t("validations.lettings.household.prevten.general_needs.internal_transfer", prevten: prevten[:label])) + expect(record.errors["referral_register"]) + .to include(match I18n.t("validations.lettings.household.referral.general_needs.internal_transfer", prevten: prevten[:label])) + expect(record.errors["referral_noms"]) + .to include(match I18n.t("validations.lettings.household.referral.general_needs.internal_transfer", prevten: prevten[:label])) + end + else + it "does not add an error" do + household_validator.validate_referral(record) + expect(record.errors["prevten"]).to be_empty + expect(record.errors["referral_register"]).to be_empty + expect(record.errors["referral_noms"]).to be_empty + end + end + end + end + + [ + { code: 30, label: "Fixed-term local authority general needs tenancy" }, + { code: 31, label: "Lifetime local authority general needs tenancy" }, + { code: 32, label: "Fixed-term private registered provider (PRP) general needs tenancy" }, + { code: 33, label: "Lifetime private registered provider (PRP) general needs tenancy" }, + { code: 35, label: "Extra care housing" }, + { code: 38, label: "Older people’s housing for tenants with low support needs" }, + { code: 6, label: "Other supported housing" }, + ].each do |prevten| + context "and prevten is #{prevten[:code]}" do + before do + record.prevten = prevten[:code] + end + + it "does not add an error" do + household_validator.validate_referral(record) + expect(record.errors["prevten"]).to be_empty + expect(record.errors["referral_register"]).to be_empty + expect(record.errors["referral_noms"]).to be_empty + end + end + end + end + end + end end describe "la validations" do @@ -564,10 +701,14 @@ RSpec.describe Validations::HouseholdValidations do end end - context "when the referral is internal transfer" do - it "prevten can be 9" do - record.referral_type = 3 + context "when the referral is internal transfer for 2025" do + let(:startdate) { collection_start_date_for_year(2025) } + + before do record.referral = 1 + end + + it "prevten can be 9" do record.prevten = 9 household_validator.validate_previous_housing_situation(record) expect(record.errors["prevten"]) @@ -593,16 +734,53 @@ RSpec.describe Validations::HouseholdValidations do { code: 28, label: "Living with friends or family" }, { code: 29, label: "Prison or approved probation hostel" }, ].each do |prevten| - it "prevten cannot be #{prevten[:code]}" do - record.referral_type = 3 - record.referral = 1 - record.prevten = prevten[:code] - household_validator.validate_previous_housing_situation(record) - label = record.form.start_year_2025_or_later? && prevten[:code] == 28 ? "Living with friends or family (long-term)" : prevten[:label] - expect(record.errors["prevten"]) - .to include(match I18n.t("validations.lettings.household.prevten.internal_transfer", prevten: label)) - expect(record.errors["referral"]) - .to include(match I18n.t("validations.lettings.household.referral.prevten_invalid", prevten: "")) + context "and prevten is #{prevten}" do + it "adds an error" do + record.prevten = prevten[:code] + household_validator.validate_previous_housing_situation(record) + label = record.form.start_year_2025_or_later? && prevten[:code] == 28 ? "Living with friends or family (long-term)" : prevten[:label] + expect(record.errors["prevten"]) + .to include(match I18n.t("validations.lettings.household.prevten.internal_transfer", prevten: label)) + expect(record.errors["referral"]) + .to include(match I18n.t("validations.lettings.household.referral.prevten_invalid", prevten: "")) + end + end + end + end + + context "when the referral is internal transfer for 2026" do + let(:startdate) { collection_start_date_for_year(2026) } + + before do + record.owning_organisation.provider_type = "LA" + record.referral_register = 2 + end + + [ + { code: 3, label: "Private sector tenancy" }, + { code: 4, label: "Tied housing or rented with job" }, + { code: 7, label: "Direct access hostel" }, + { code: 10, label: "Hospital" }, + { code: 13, label: "Children’s home or foster care" }, + { code: 14, label: "Bed and breakfast" }, + { code: 19, label: "Rough sleeping" }, + { code: 23, label: "Mobile home or caravan" }, + { code: 24, label: "Home Office Asylum Support" }, + { code: 25, label: "Any other accommodation" }, + { code: 26, label: "Owner occupation (private)" }, + { code: 28, label: "Living with friends or family" }, + { code: 29, label: "Prison or approved probation hostel" }, + ].each do |prevten| + context "and prevten is #{prevten}" do + before do + record.prevten = prevten[:code] + end + + it "does not add an error" do + household_validator.validate_previous_housing_situation(record) + expect(record.errors["prevten"]).to be_empty + expect(record.errors["referral"]).to be_empty + end end end end diff --git a/spec/services/bulk_upload/lettings/validator_spec.rb b/spec/services/bulk_upload/lettings/validator_spec.rb index d865196ee..ce5b854fc 100644 --- a/spec/services/bulk_upload/lettings/validator_spec.rb +++ b/spec/services/bulk_upload/lettings/validator_spec.rb @@ -172,8 +172,8 @@ RSpec.describe BulkUpload::Lettings::Validator do expect(error.tenant_code).to eql(log.tenancycode) expect(error.property_ref).to eql(log.propcode) expect(error.row).to eql("2") - expect(error.cell).to eql("CX2") - expect(error.col).to eql("CX") + expect(error.cell).to eql("CX2") # this may change when adding a new field as the cols are in a random order + expect(error.col).to eql("CX") # this may change when adding a new field as the cols are in a random order end end @@ -190,8 +190,8 @@ RSpec.describe BulkUpload::Lettings::Validator do expect(error.tenant_code).to eql(log.tenancycode) expect(error.property_ref).to eql(log.propcode) expect(error.row).to eql("2") - expect(error.cell).to eql("EF2") - expect(error.col).to eql("EF") + expect(error.cell).to eql("EH2") # this may change when adding a new field as the cols are in a random order + expect(error.col).to eql("EH") # this may change when adding a new field as the cols are in a random order end end end diff --git a/spec/services/bulk_upload/lettings/year2026/csv_parser_spec.rb b/spec/services/bulk_upload/lettings/year2026/csv_parser_spec.rb index 379680848..dc1b6e2d9 100644 --- a/spec/services/bulk_upload/lettings/year2026/csv_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2026/csv_parser_spec.rb @@ -244,9 +244,9 @@ RSpec.describe BulkUpload::Lettings::Year2026::CsvParser do end it "returns correct column" do - expect(service.column_for_field("field_5")).to eql("AG") - expect(service.column_for_field("field_22")).to eql("BO") - expect(service.column_for_field("field_26")).to eql("CD") + expect(service.column_for_field("field_5")).to eql("AI") + expect(service.column_for_field("field_22")).to eql("BR") + expect(service.column_for_field("field_26")).to eql("CG") expect(service.column_for_field("field_25")).to eql("E") end end diff --git a/spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb index a85bdebbb..68768d7d9 100644 --- a/spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb @@ -224,7 +224,7 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do field_114: "2", field_115: "2", - field_116: "2", + field_116: "1", field_117: "1", field_118: "2", @@ -648,12 +648,12 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do end context "when an invalid value error has been added" do - let(:attributes) { setup_section_params.merge({ field_116: "100" }) } + let(:attributes) { setup_section_params.merge({ field_115: "100" }) } it "does not add an additional error" do parser.valid? - expect(parser.errors[:field_116].length).to eq(1) - expect(parser.errors[:field_116]).to include(match I18n.t("validations.lettings.2026.bulk_upload.invalid_option", question: "")) + expect(parser.errors[:field_115].length).to eq(1) + expect(parser.errors[:field_115]).to include(match I18n.t("validations.lettings.2026.bulk_upload.invalid_option", question: "")) end end end @@ -1160,43 +1160,236 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do end end - describe "#field_116" do # referral - context "when 3 ie PRP nominated by LA and owning org is LA" do - let(:attributes) { { bulk_upload:, field_116: "3", field_1: owning_org.old_visible_id, field_2: owning_org.old_visible_id } } + describe "#field_116, field_154, field_155, field_156" do # referral + context "when org is LA" do + let(:owning_org) { create(:organisation, :la, :with_old_visible_id) } - it "is not permitted" do - parser.valid? - expect(parser.errors[:field_116]).to be_present + let(:org_attributes) { { bulk_upload:, field_1: owning_org.old_visible_id } } + + context "and not renewal" do + let(:renewal_attributes) { org_attributes.merge({ field_7: nil }) } + + context "and field_116 is valid" do + let(:attributes) { renewal_attributes.merge({ field_116: 1 }) } + + it "does not add an error" do + parser.valid? + expect(parser.errors[:field_116]).to be_blank + expect(parser.errors[:field_154]).to be_blank + expect(parser.errors[:field_155]).to be_blank + expect(parser.errors[:field_156]).to be_blank + end + end + + context "and field_116 is invalid" do + let(:attributes) { renewal_attributes.merge({ field_116: 5 }) } # PRP option + + it "adds errors to all referral fields" do + parser.valid? + expect(parser.errors[:field_116]).to be_present + expect(parser.errors[:field_154]).to be_present + expect(parser.errors[:field_155]).to be_present + expect(parser.errors[:field_156]).to be_present + end + end + + context "and field_116 is blank" do + let(:attributes) { renewal_attributes.merge({ field_116: nil }) } + + it "adds errors to all referral fields" do + parser.valid? + expect(parser.errors[:field_116]).to be_present + expect(parser.errors[:field_154]).to be_present + expect(parser.errors[:field_155]).to be_present + expect(parser.errors[:field_156]).to be_present + end + end + + context "and other fields are given" do + let(:attributes) { renewal_attributes.merge({ field_116: 1, field_154: 5, field_155: 1, field_152: 1 }) } + + it "adds errors to all referral fields" do + parser.valid? + expect(parser.errors[:field_116]).to be_present + expect(parser.errors[:field_154]).to be_present + expect(parser.errors[:field_155]).to be_present + expect(parser.errors[:field_156]).to be_present + end + end end - end - context "when 4 ie referred by LA and is general needs and owning org is LA" do - let(:attributes) { { bulk_upload:, field_116: "4", field_1: owning_org.old_visible_id, field_2: owning_org.old_visible_id, field_4: "1" } } + context "and is renewal" do + let(:attributes) { org_attributes.merge({ field_7: 1, field_116: 1, field_154: 5, field_155: 1, field_156: 1 }) } - it "is not permitted" do - parser.valid? - expect(parser.errors[:field_116]).to be_present + it "does not add an error for referral fields" do + parser.valid? + expect(parser.errors[:field_116]).to be_blank + expect(parser.errors[:field_154]).to be_blank + expect(parser.errors[:field_155]).to be_blank + expect(parser.errors[:field_156]).to be_blank + end end end - context "when 4 ie referred by LA and is general needs and owning org is PRP" do + context "when org is PRP" do let(:owning_org) { create(:organisation, :prp, :with_old_visible_id) } - let(:attributes) { { bulk_upload:, field_116: "4", field_1: owning_org.old_visible_id, field_2: owning_org.old_visible_id } } + let(:org_attributes) { { bulk_upload:, field_1: owning_org.old_visible_id } } - it "is permitted" do - parser.valid? - expect(parser.errors[:field_116]).to be_blank + context "and not renewal" do + let(:renewal_attributes) { org_attributes.merge({ field_7: nil }) } + + context "and field_154 is valid and does not expect an answer for field_155" do + let(:attributes) { renewal_attributes.merge({ field_154: 5 }) } + + it "does not add an error" do + parser.valid? + expect(parser.errors[:field_116]).to be_blank + expect(parser.errors[:field_154]).to be_blank + expect(parser.errors[:field_155]).to be_blank + expect(parser.errors[:field_156]).to be_blank + end + + context "and later fields are given" do + let(:attributes) { renewal_attributes.merge({ field_154: 5, field_155: 1, field_156: 1 }) } + + it "adds errors to all referral fields" do + parser.valid? + expect(parser.errors[:field_116]).to be_present + expect(parser.errors[:field_154]).to be_present + expect(parser.errors[:field_155]).to be_present + expect(parser.errors[:field_156]).to be_present + end + end + end + + context "and field_154 is invalid" do + let(:attributes) { renewal_attributes.merge({ field_154: 1 }) } # LA option + + it "adds errors to all referral fields" do + parser.valid? + expect(parser.errors[:field_116]).to be_present + expect(parser.errors[:field_154]).to be_present + expect(parser.errors[:field_155]).to be_present + expect(parser.errors[:field_156]).to be_present + end + end + + context "and field_154 is blank" do + let(:attributes) { renewal_attributes.merge({ field_154: nil }) } + + it "adds errors to all referral fields" do + parser.valid? + expect(parser.errors[:field_116]).to be_present + expect(parser.errors[:field_154]).to be_present + expect(parser.errors[:field_155]).to be_present + expect(parser.errors[:field_156]).to be_present + end + end + + context "and field_154 is valid and expects an answer for field_155" do + let(:field_154_attributes) { renewal_attributes.merge({ field_154: 6 }) } + + context "and field_155 is valid and does not expect an answer for field_156" do + let(:attributes) { field_154_attributes.merge({ field_155: 2 }) } + + it "does not add an error" do + parser.valid? + expect(parser.errors[:field_116]).to be_blank + expect(parser.errors[:field_154]).to be_blank + expect(parser.errors[:field_155]).to be_blank + expect(parser.errors[:field_156]).to be_blank + end + + context "and later fields are given" do + let(:attributes) { field_154_attributes.merge({ field_155: 2, field_156: 1 }) } + + it "adds errors to all referral fields" do + parser.valid? + expect(parser.errors[:field_116]).to be_present + expect(parser.errors[:field_154]).to be_present + expect(parser.errors[:field_155]).to be_present + expect(parser.errors[:field_156]).to be_present + end + end + end + + context "and field_155 is invalid" do + let(:attributes) { field_154_attributes.merge({ field_155: 5 }) } # needs field_154 to be 7 + + it "adds errors to all referral fields" do + parser.valid? + expect(parser.errors[:field_116]).to be_present + expect(parser.errors[:field_154]).to be_present + expect(parser.errors[:field_155]).to be_present + expect(parser.errors[:field_156]).to be_present + end + end + + context "and field_155 is blank" do + let(:attributes) { field_154_attributes.merge({ field_155: nil }) } + + it "adds errors to all referral fields" do + parser.valid? + expect(parser.errors[:field_116]).to be_present + expect(parser.errors[:field_154]).to be_present + expect(parser.errors[:field_155]).to be_present + expect(parser.errors[:field_156]).to be_present + end + end + + context "and field_155 is valid and expects an answer for field_156" do + let(:field_155_attributes) { field_154_attributes.merge({ field_155: 1 }) } + + context "and field_156 is valid" do + let(:attributes) { field_155_attributes.merge({ field_156: 1 }) } + + it "does not add an error" do + parser.valid? + expect(parser.errors[:field_116]).to be_blank + expect(parser.errors[:field_154]).to be_blank + expect(parser.errors[:field_155]).to be_blank + expect(parser.errors[:field_156]).to be_blank + end + end + + context "and field_156 is invalid" do + let(:attributes) { field_155_attributes.merge({ field_156: 11 }) } # needs field_155 to be 7 + + it "adds errors to all referral fields" do + parser.valid? + expect(parser.errors[:field_116]).to be_present + expect(parser.errors[:field_154]).to be_present + expect(parser.errors[:field_155]).to be_present + expect(parser.errors[:field_156]).to be_present + end + end + + context "and field_156 is blank" do + let(:attributes) { field_155_attributes.merge({ field_156: nil }) } + + it "adds errors to all referral fields" do + parser.valid? + expect(parser.errors[:field_116]).to be_present + expect(parser.errors[:field_154]).to be_present + expect(parser.errors[:field_155]).to be_present + expect(parser.errors[:field_156]).to be_present + end + end + end + end end - end - context "when 4 ie referred by LA and is not general needs" do - let(:bulk_upload) { create(:bulk_upload, :lettings, user:) } - let(:attributes) { { bulk_upload:, field_116: "4", field_4: "2" } } + context "and is renewal" do + let(:attributes) { org_attributes.merge({ field_7: 1, field_116: 1, field_154: 5, field_155: 1, field_156: 1 }) } - it "is permitted" do - parser.valid? - expect(parser.errors[:field_116]).to be_blank + it "does not add an error for referral fields" do + parser.valid? + expect(parser.errors[:field_116]).to be_blank + expect(parser.errors[:field_154]).to be_blank + expect(parser.errors[:field_155]).to be_blank + expect(parser.errors[:field_156]).to be_blank + end end end end diff --git a/spec/services/csv/lettings_log_csv_service_spec.rb b/spec/services/csv/lettings_log_csv_service_spec.rb index f8a6fc438..e20d6212b 100644 --- a/spec/services/csv/lettings_log_csv_service_spec.rb +++ b/spec/services/csv/lettings_log_csv_service_spec.rb @@ -308,7 +308,9 @@ RSpec.describe Csv::LettingsLogCsvService do chr: 1, cap: 0, accessible_register: 0, - referral: 2, + referral_register: 1, + referral_noms: 1, + referral_org: 1, net_income_known: 0, incref: 0, incfreq: 1, diff --git a/spec/services/merge/merge_organisations_service_spec.rb b/spec/services/merge/merge_organisations_service_spec.rb index b5e04bbe7..d669b11a5 100644 --- a/spec/services/merge/merge_organisations_service_spec.rb +++ b/spec/services/merge/merge_organisations_service_spec.rb @@ -56,6 +56,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(absorbing_organisation.id).and_return(absorbing_organisation) allow(absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -100,6 +101,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(absorbing_organisation.id).and_return(absorbing_organisation) allow(absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -137,6 +139,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(absorbing_organisation.id).and_return(absorbing_organisation) allow(absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -557,6 +560,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(absorbing_organisation.id).and_return(absorbing_organisation) allow(absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -590,6 +594,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(absorbing_organisation.id).and_return(absorbing_organisation) allow(absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -652,6 +657,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(absorbing_organisation.id).and_return(absorbing_organisation) allow(absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -688,6 +694,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(absorbing_organisation.id).and_return(absorbing_organisation) allow(absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -877,6 +884,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(absorbing_organisation.id).and_return(absorbing_organisation) allow(absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -996,6 +1004,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(absorbing_organisation.id).and_return(absorbing_organisation) allow(absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -1121,6 +1130,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(absorbing_organisation.id).and_return(absorbing_organisation) allow(absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -1191,6 +1201,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(new_absorbing_organisation.id).and_return(new_absorbing_organisation) allow(new_absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -1235,6 +1246,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(new_absorbing_organisation.id).and_return(new_absorbing_organisation) allow(new_absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -1272,6 +1284,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(new_absorbing_organisation.id).and_return(new_absorbing_organisation) allow(new_absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -1377,6 +1390,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(new_absorbing_organisation.id).and_return(new_absorbing_organisation) allow(new_absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -1409,6 +1423,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(new_absorbing_organisation.id).and_return(new_absorbing_organisation) allow(new_absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -1448,6 +1463,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(new_absorbing_organisation.id).and_return(new_absorbing_organisation) allow(new_absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -1484,6 +1500,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(new_absorbing_organisation.id).and_return(new_absorbing_organisation) allow(new_absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -1593,6 +1610,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(new_absorbing_organisation.id).and_return(new_absorbing_organisation) allow(new_absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -1683,6 +1701,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(new_absorbing_organisation.id).and_return(new_absorbing_organisation) allow(new_absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") @@ -1725,6 +1744,7 @@ RSpec.describe Merge::MergeOrganisationsService do it "rolls back if there's an error" do allow(Organisation).to receive(:find).with(merging_organisation_ids).and_return(Organisation.find(merging_organisation_ids)) + allow(Organisation).to receive(:find).with(merging_organisation.id).and_return(merging_organisation) allow(Organisation).to receive(:find).with(new_absorbing_organisation.id).and_return(new_absorbing_organisation) allow(new_absorbing_organisation).to receive(:save!).and_raise(ActiveRecord::RecordInvalid) expect(Rails.logger).to receive(:error).with("Organisation merge failed with: Record invalid") From c45514ecc9c00f88b2da2cf86d09ae72813b71e7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 09:35:59 +0000 Subject: [PATCH 02/11] Bump nokogiri from 1.18.9 to 1.19.1 in /docs (#3187) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.18.9 to 1.19.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.18.9...v1.19.1) --- updated-dependencies: - dependency-name: nokogiri dependency-version: 1.19.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 5412cb0be..5a10a9f23 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -216,11 +216,11 @@ GEM minitest (5.19.0) net-http (0.9.1) uri (>= 0.11.1) - nokogiri (1.18.9-arm64-darwin) + nokogiri (1.19.1-arm64-darwin) racc (~> 1.4) - nokogiri (1.18.9-x86_64-darwin) + nokogiri (1.19.1-x86_64-darwin) racc (~> 1.4) - nokogiri (1.18.9-x86_64-linux-gnu) + nokogiri (1.19.1-x86_64-linux-gnu) racc (~> 1.4) octokit (4.25.1) faraday (>= 1, < 3) From da865ce86d1e16613110b6a93c05e96ac61105a5 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Fri, 20 Feb 2026 14:47:53 +0000 Subject: [PATCH 03/11] CLDC-4143: Update gender-related validations (#3183) * CLDC-4143: Update gender retirement validations rename functions as the new wording is more related to those that identify as male and any other option * CLDC-4143: Add 2026 tests * CLDC-4143: Update legacy json files causes issues with some old tests * CLDC-4143: Add error mappings for gender fields * CLDC-4143: Add new gender age retirement soft validation replaces the many check pages from previous years with a single one shows if either of the previous ones would show has agreed wording on ticket * fixup! CLDC-4143: Update gender retirement validations improve gender comment wording * CLDC-4143: Update non males validation name reference to 'soft validation' we found confusing * fixup! CLDC-4143: Add new gender age retirement soft validation update subsection specs --- ...pregnant_household_lead_age_value_check.rb | 2 +- ...gnant_household_lead_hhmemb_value_check.rb | 2 +- ..._in_pregnant_household_lead_value_check.rb | 2 +- ...egnant_household_person_age_value_check.rb | 2 +- ...n_pregnant_household_person_value_check.rb | 2 +- ...range_in_pregnant_household_value_check.rb | 2 +- ...hold_member_likely_to_be_pregnant_check.rb | 24 ++ .../subsections/household_characteristics.rb | 25 +- .../lettings/subsections/household_needs.rb | 5 +- app/models/validations/soft_validations.rb | 91 +++-- .../lettings/year2026/row_parser.rb | 16 + config/forms/2021_2022.json | 36 +- config/forms/2022_2023.json | 36 +- .../2026/lettings/soft_validations.en.yml | 4 +- ...t_household_person_age_value_check_spec.rb | 4 +- ...gnant_household_person_value_check_spec.rb | 4 +- .../household_characteristics_spec.rb | 51 +-- .../subsections/household_needs_spec.rb | 3 +- .../validations/soft_validations_spec.rb | 330 ++++++++++++++---- .../lettings/year2026/row_parser_spec.rb | 14 +- 20 files changed, 454 insertions(+), 201 deletions(-) create mode 100644 app/models/form/lettings/pages/no_household_member_likely_to_be_pregnant_check.rb diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb index 5b06d6a28..24f836d04 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb @@ -3,7 +3,7 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadAgeValu super(id, hsh, subsection) @id = "females_in_soft_age_range_in_pregnant_household_lead_age_value_check" @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" - @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] + @depends_on = [{ "non_males_in_pregnant_household_not_in_pregnancy_range?" => true }] @title_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [], diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb index 3e961b283..c786afe56 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb @@ -3,7 +3,7 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadHhmembV super(id, hsh, subsection) @id = "females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check" @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" - @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] + @depends_on = [{ "non_males_in_pregnant_household_not_in_pregnancy_range?" => true }] @title_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [], diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb index af568b039..bb3670c74 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb @@ -3,7 +3,7 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadValueCh super @id = "females_in_soft_age_range_in_pregnant_household_lead_value_check" @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" - @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] + @depends_on = [{ "non_males_in_pregnant_household_not_in_pregnancy_range?" => true }] @title_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [], diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb index ddc8789f9..cfd035ac3 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb @@ -5,7 +5,7 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeVa @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" @depends_on = [ { - "female_in_pregnant_household_in_soft_validation_range?" => true, + "non_males_in_pregnant_household_not_in_pregnancy_range?" => true, "age#{person_index}_known" => 0, }, ] diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb index 099bea5d9..de1fb5fc9 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb @@ -6,7 +6,7 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValue @depends_on = [ { - "female_in_pregnant_household_in_soft_validation_range?" => true, + "non_males_in_pregnant_household_not_in_pregnancy_range?" => true, "details_known_#{person_index}" => 0, }, ] diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb index 3822ec940..66603753e 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb @@ -3,7 +3,7 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdValueCheck super @id = "females_in_soft_age_range_in_pregnant_household_value_check" @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" - @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] + @depends_on = [{ "non_males_in_pregnant_household_not_in_pregnancy_range?" => true }] @title_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [], diff --git a/app/models/form/lettings/pages/no_household_member_likely_to_be_pregnant_check.rb b/app/models/form/lettings/pages/no_household_member_likely_to_be_pregnant_check.rb new file mode 100644 index 000000000..cefb98ceb --- /dev/null +++ b/app/models/form/lettings/pages/no_household_member_likely_to_be_pregnant_check.rb @@ -0,0 +1,24 @@ +class Form::Lettings::Pages::NoHouseholdMemberLikelyToBePregnantCheck < ::Form::Page + def initialize(id, hsh, subsection, person_index: 0) + super(id, hsh, subsection) + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_household_member_likely_to_be_pregnant_check" + @depends_on = [{ "no_household_member_likely_to_be_pregnant?" => true }] + @title_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], + } + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } + @person_index = person_index + end + + def questions + @questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self, person_index: @person_index)] + end + + def interruption_screen_question_ids + %w[preg_occ age1 sexrab1 gender_same_as_sex1 age2 sexrab2 gender_same_as_sex2 age3 sexrab3 gender_same_as_sex3 age4 sexrab4 gender_same_as_sex4 age5 sexrab5 gender_same_as_sex5 age6 sexrab6 gender_same_as_sex6 age7 sexrab7 gender_same_as_sex7 age8 sexrab8 gender_same_as_sex8] + end +end diff --git a/app/models/form/lettings/subsections/household_characteristics.rb b/app/models/form/lettings/subsections/household_characteristics.rb index d528e3772..ab8e639bc 100644 --- a/app/models/form/lettings/subsections/household_characteristics.rb +++ b/app/models/form/lettings/subsections/household_characteristics.rb @@ -10,18 +10,21 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection @pages ||= [ (Form::Lettings::Pages::Declaration.new(nil, nil, self) unless form.start_year_2024_or_later?), Form::Lettings::Pages::HouseholdMembers.new(nil, nil, self), - Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadHhmembValueCheck.new(nil, nil, self), - Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadHhmembValueCheck.new(nil, nil, self), + (Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadHhmembValueCheck.new(nil, nil, self) unless form.start_year_2026_or_later?), + (Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadHhmembValueCheck.new(nil, nil, self) unless form.start_year_2026_or_later?), + (Form::Lettings::Pages::NoHouseholdMemberLikelyToBePregnantCheck.new("no_household_member_likely_to_be_pregnant_hhmemb_check", nil, self) if form.start_year_2026_or_later?), Form::Lettings::Pages::LeadTenantAge.new(nil, nil, self), - Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadAgeValueCheck.new(nil, nil, self), - Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadAgeValueCheck.new(nil, nil, self), + (Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadAgeValueCheck.new(nil, nil, self) unless form.start_year_2026_or_later?), + (Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadAgeValueCheck.new(nil, nil, self) unless form.start_year_2026_or_later?), + (Form::Lettings::Pages::NoHouseholdMemberLikelyToBePregnantCheck.new("no_household_member_likely_to_be_pregnant_lead_age_check", nil, self) if form.start_year_2026_or_later?), Form::Lettings::Pages::LeadTenantUnderRetirementValueCheck.new("age_lead_tenant_under_retirement_value_check", nil, self), Form::Lettings::Pages::LeadTenantOverRetirementValueCheck.new("age_lead_tenant_over_retirement_value_check", nil, self), (Form::Lettings::Pages::LeadTenantSexRegisteredAtBirth.new(nil, nil, self) if form.start_year_2026_or_later?), (Form::Lettings::Pages::LeadTenantGenderSameAsSex.new(nil, nil, self) if form.start_year_2026_or_later?), Form::Lettings::Pages::LeadTenantGenderIdentity.new(nil, nil, self), - Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadValueCheck.new(nil, nil, self), - Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadValueCheck.new(nil, nil, self), + (Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadValueCheck.new(nil, nil, self) unless form.start_year_2026_or_later?), + (Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadValueCheck.new(nil, nil, self) unless form.start_year_2026_or_later?), + (Form::Lettings::Pages::NoHouseholdMemberLikelyToBePregnantCheck.new("no_household_member_likely_to_be_pregnant_lead_check", nil, self, person_index: 1) if form.start_year_2026_or_later?), Form::Lettings::Pages::LeadTenantOverRetirementValueCheck.new("gender_lead_tenant_over_retirement_value_check", nil, self), Form::Lettings::Pages::LeadTenantEthnicGroup.new(nil, nil, self), Form::Lettings::Pages::LeadTenantEthnicBackgroundArab.new(nil, nil, self), @@ -52,16 +55,18 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_#{person_index}_partner_under_16_value_check", nil, self, person_index:) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_#{person_index}_multiple_partners_value_check", nil, self, person_index:) if form.start_year_2024_or_later?), (Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index:) unless form.start_year_2026_or_later?), - Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index:), - Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index:), + (Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index:) unless form.start_year_2026_or_later?), + (Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index:) unless form.start_year_2026_or_later?), + (Form::Lettings::Pages::NoHouseholdMemberLikelyToBePregnantCheck.new("no_household_member_likely_to_be_pregnant_person_age_#{person_index}_check", nil, self, person_index:) if form.start_year_2026_or_later?), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_#{person_index}_under_retirement_value_check", nil, self, person_index:), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_#{person_index}_over_retirement_value_check", nil, self, person_index:), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_#{person_index}_partner_under_16_value_check", nil, self, person_index:) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?), (Form::Lettings::Pages::PersonSexRegisteredAtBirth.new(nil, nil, self, person_index:) if form.start_year_2026_or_later?), (Form::Lettings::Pages::PersonGenderSameAsSex.new(nil, nil, self, person_index:) if form.start_year_2026_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index:), - Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index:), - Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index:), + (Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index:) unless form.start_year_2026_or_later?), + (Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index:) unless form.start_year_2026_or_later?), + (Form::Lettings::Pages::NoHouseholdMemberLikelyToBePregnantCheck.new("no_household_member_likely_to_be_pregnant_person_#{person_index}_check", nil, self, person_index:) if form.start_year_2026_or_later?), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("gender_#{person_index}_over_retirement_value_check", nil, self, person_index:), Form::Lettings::Pages::PersonWorkingSituation.new(nil, nil, self, person_index:), Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("working_situation_#{person_index}_under_retirement_value_check", nil, self, person_index:), diff --git a/app/models/form/lettings/subsections/household_needs.rb b/app/models/form/lettings/subsections/household_needs.rb index e0502386b..4f6414d18 100644 --- a/app/models/form/lettings/subsections/household_needs.rb +++ b/app/models/form/lettings/subsections/household_needs.rb @@ -12,8 +12,9 @@ class Form::Lettings::Subsections::HouseholdNeeds < ::Form::Subsection Form::Lettings::Pages::ArmedForcesServing.new(nil, nil, self), Form::Lettings::Pages::ArmedForcesInjured.new(nil, nil, self), Form::Lettings::Pages::Pregnant.new("pregnant", nil, self), - Form::Lettings::Pages::NoFemalesPregnantHouseholdValueCheck.new(nil, nil, self), - Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdValueCheck.new(nil, nil, self), + (Form::Lettings::Pages::NoFemalesPregnantHouseholdValueCheck.new(nil, nil, self) unless form.start_year_2026_or_later?), + (Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdValueCheck.new(nil, nil, self) unless form.start_year_2026_or_later?), + (Form::Lettings::Pages::NoHouseholdMemberLikelyToBePregnantCheck.new("no_household_member_likely_to_be_pregnant_check", nil, self) if form.start_year_2026_or_later?), Form::Lettings::Pages::AccessNeedsExist.new("access_needs_exist", nil, self), Form::Lettings::Pages::TypeOfAccessNeeds.new(nil, nil, self), Form::Lettings::Pages::HealthConditions.new("health_conditions", nil, self), diff --git a/app/models/validations/soft_validations.rb b/app/models/validations/soft_validations.rb index 35436dc32..662aa9af6 100644 --- a/app/models/validations/soft_validations.rb +++ b/app/models/validations/soft_validations.rb @@ -75,30 +75,16 @@ module Validations::SoftValidations end end - def all_male_tenants_in_a_pregnant_household? - all_male_tenants_in_the_household? && all_tenants_gender_information_completed? && preg_occ == 1 - end - - def female_in_pregnant_household_in_soft_validation_range? - all_tenants_age_and_gender_information_completed? && females_in_the_household? && !females_in_age_range(16, 50) && preg_occ == 1 + def no_household_member_likely_to_be_pregnant? + all_male_tenants_in_a_pregnant_household? || non_males_in_pregnant_household_not_in_pregnancy_range? end - def all_tenants_age_and_gender_information_completed? - return false if hhmemb.present? && hhmemb > 8 - - person_count = hhmemb || 8 - - (1..person_count).all? do |n| - public_send("sex#{n}").present? && public_send("age#{n}").present? && details_known_or_lead_tenant?(n) && public_send("age#{n}_known").present? && public_send("age#{n}_known").zero? - end + def all_male_tenants_in_a_pregnant_household? + all_tenants_gender_information_completed? && all_male_tenants_in_the_household? && preg_occ == 1 end - def all_tenants_gender_information_completed? - person_count = hhmemb || 8 - - (1..person_count).all? do |n| - public_send("sex#{n}").present? && details_known_or_lead_tenant?(n) - end + def non_males_in_pregnant_household_not_in_pregnancy_range? + all_tenants_age_and_gender_information_completed? && non_males_in_the_household? && !any_non_male_in_expected_pregnancy_age_range(16, 50) && preg_occ == 1 end TWO_YEARS_IN_DAYS = 730 @@ -221,25 +207,54 @@ module Validations::SoftValidations private + def all_tenants_age_and_gender_information_completed? + return false if hhmemb.present? && hhmemb > 8 + return false unless all_tenants_gender_information_completed? + + person_count = hhmemb || 8 + + (1..person_count).all? do |n| + public_send("age#{n}").present? && public_send("age#{n}_known").present? && public_send("age#{n}_known").zero? + end + end + + def all_tenants_gender_information_completed? + return false if hhmemb.present? && hhmemb > 8 + + person_count = hhmemb || 8 + + (1..person_count).all? do |n| + tenant_gender_information_completed?(n) + end + end + + def tenant_gender_information_completed?(tenant_number) + if form.start_year_2026_or_later? + public_send("sexrab#{tenant_number}").present? && public_send("gender_same_as_sex#{tenant_number}").present? && details_known_or_lead_tenant?(tenant_number) + else + public_send("sex#{tenant_number}").present? && details_known_or_lead_tenant?(tenant_number) + end + end + def details_known_or_lead_tenant?(tenant_number) return true if tenant_number == 1 public_send("details_known_#{tenant_number}").zero? end - def females_in_age_range(min, max) + def any_non_male_in_expected_pregnancy_age_range(min, max) person_count = hhmemb || 8 (1..person_count).any? do |n| - public_send("sex#{n}") == "F" && public_send("age#{n}").present? && public_send("age#{n}").between?(min, max) + person_in_expected_pregnancy_age_range(n, min, max) && person_is_non_male(n) end end - def females_in_the_household? + def non_males_in_the_household? person_count = hhmemb || 8 (1..person_count).any? do |n| - public_send("sex#{n}") == "F" || public_send("sex#{n}").nil? + person_is_non_male(n) end end @@ -249,10 +264,36 @@ private person_count = hhmemb || 8 (1..person_count).all? do |n| - public_send("sex#{n}") == "M" + person_is_male(n) + end + end + + def person_is_male(person_number) + if form.start_year_2026_or_later? + sexrab = public_send("sexrab#{person_number}") + gender_same_as_sex = public_send("gender_same_as_sex#{person_number}") + + sexrab == "M" && gender_same_as_sex == 1 + else + public_send("sex#{person_number}") == "M" end end + def person_is_non_male(person_number) + if form.start_year_2026_or_later? + !person_is_male(person_number) + else + # the "non-male" wording was introduced in the 26/27 collection year, before that this behavior was limited to female gender only + public_send("sex#{person_number}") == "F" + end + end + + def person_in_expected_pregnancy_age_range(person_number, min, max) + age = public_send("age#{person_number}") + + age.between?(min, max) + end + def tenant_is_retired?(economic_status) economic_status == 5 end diff --git a/app/services/bulk_upload/lettings/year2026/row_parser.rb b/app/services/bulk_upload/lettings/year2026/row_parser.rb index 80f31e0f7..5930f75fd 100644 --- a/app/services/bulk_upload/lettings/year2026/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2026/row_parser.rb @@ -1263,6 +1263,22 @@ private sexrab6: %i[field_135], sexrab7: %i[field_136], sexrab8: %i[field_137], + gender_same_as_sex1: %i[field_138], + gender_same_as_sex2: %i[field_140], + gender_same_as_sex3: %i[field_142], + gender_same_as_sex4: %i[field_144], + gender_same_as_sex5: %i[field_146], + gender_same_as_sex6: %i[field_148], + gender_same_as_sex7: %i[field_150], + gender_same_as_sex8: %i[field_152], + gender_description1: %i[field_139], + gender_description2: %i[field_141], + gender_description3: %i[field_143], + gender_description4: %i[field_145], + gender_description5: %i[field_147], + gender_description6: %i[field_149], + gender_description7: %i[field_151], + gender_description8: %i[field_153], }.compact end diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index ac615b0e2..9ed728cda 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -1213,7 +1213,7 @@ "females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true + "non_males_in_pregnant_household_not_in_pregnancy_range?": true } ], "title_text": { @@ -1355,7 +1355,7 @@ "females_in_soft_age_range_in_pregnant_household_lead_age_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true + "non_males_in_pregnant_household_not_in_pregnancy_range?": true } ], "title_text": { @@ -1476,7 +1476,7 @@ "females_in_soft_age_range_in_pregnant_household_lead_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true + "non_males_in_pregnant_household_not_in_pregnancy_range?": true } ], "title_text": { @@ -2135,7 +2135,7 @@ "females_in_soft_age_range_in_pregnant_household_person_2_age_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "age2_known": 0 } ], @@ -2258,7 +2258,7 @@ "females_in_soft_age_range_in_pregnant_household_person_2_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "details_known_2": 0 } ], @@ -2670,7 +2670,7 @@ "females_in_soft_age_range_in_pregnant_household_person_3_age_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "age3_known": 0 } ], @@ -2793,7 +2793,7 @@ "females_in_soft_age_range_in_pregnant_household_person_3_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "details_known_3": 0 } ], @@ -3202,7 +3202,7 @@ "females_in_soft_age_range_in_pregnant_household_person_4_age_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "age4_known": 0 } ], @@ -3325,7 +3325,7 @@ "females_in_soft_age_range_in_pregnant_household_person_4_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "details_known_4": 0 } ], @@ -3731,7 +3731,7 @@ "females_in_soft_age_range_in_pregnant_household_person_5_age_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "age5_known": 0 } ], @@ -3854,7 +3854,7 @@ "females_in_soft_age_range_in_pregnant_household_person_5_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "details_known_5": 0 } ], @@ -4257,7 +4257,7 @@ "females_in_soft_age_range_in_pregnant_household_person_6_age_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "age6_known": 0 } ], @@ -4380,7 +4380,7 @@ "females_in_soft_age_range_in_pregnant_household_person_6_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "details_known_6": 0 } ], @@ -4780,7 +4780,7 @@ "females_in_soft_age_range_in_pregnant_household_person_7_age_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "age7_known": 0 } ], @@ -4903,7 +4903,7 @@ "females_in_soft_age_range_in_pregnant_household_person_7_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "details_known_7": 0 } ], @@ -5300,7 +5300,7 @@ "females_in_soft_age_range_in_pregnant_household_person_8_age_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "age8_known": 0 } ], @@ -5423,7 +5423,7 @@ "females_in_soft_age_range_in_pregnant_household_person_8_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "details_known_8": 0 } ], @@ -5837,7 +5837,7 @@ "females_in_soft_age_range_in_pregnant_household_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true + "non_males_in_pregnant_household_not_in_pregnancy_range?": true } ], "title_text": { diff --git a/config/forms/2022_2023.json b/config/forms/2022_2023.json index 7d6f44b20..0fa982dd4 100644 --- a/config/forms/2022_2023.json +++ b/config/forms/2022_2023.json @@ -1254,7 +1254,7 @@ "females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true + "non_males_in_pregnant_household_not_in_pregnancy_range?": true } ], "title_text": { @@ -1426,7 +1426,7 @@ "females_in_soft_age_range_in_pregnant_household_lead_age_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true + "non_males_in_pregnant_household_not_in_pregnancy_range?": true } ], "title_text": { @@ -1577,7 +1577,7 @@ "females_in_soft_age_range_in_pregnant_household_lead_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true + "non_males_in_pregnant_household_not_in_pregnancy_range?": true } ], "title_text": { @@ -2218,7 +2218,7 @@ "females_in_soft_age_range_in_pregnant_household_person_2_age_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "age2_known": 0 } ], @@ -2371,7 +2371,7 @@ "females_in_soft_age_range_in_pregnant_household_person_2_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "details_known_2": 0 } ], @@ -2801,7 +2801,7 @@ "females_in_soft_age_range_in_pregnant_household_person_3_age_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "age3_known": 0 } ], @@ -2954,7 +2954,7 @@ "females_in_soft_age_range_in_pregnant_household_person_3_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "details_known_3": 0 } ], @@ -3381,7 +3381,7 @@ "females_in_soft_age_range_in_pregnant_household_person_4_age_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "age4_known": 0 } ], @@ -3534,7 +3534,7 @@ "females_in_soft_age_range_in_pregnant_household_person_4_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "details_known_4": 0 } ], @@ -3958,7 +3958,7 @@ "females_in_soft_age_range_in_pregnant_household_person_5_age_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "age5_known": 0 } ], @@ -4111,7 +4111,7 @@ "females_in_soft_age_range_in_pregnant_household_person_5_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "details_known_5": 0 } ], @@ -4532,7 +4532,7 @@ "females_in_soft_age_range_in_pregnant_household_person_6_age_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "age6_known": 0 } ], @@ -4685,7 +4685,7 @@ "females_in_soft_age_range_in_pregnant_household_person_6_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "details_known_6": 0 } ], @@ -5103,7 +5103,7 @@ "females_in_soft_age_range_in_pregnant_household_person_7_age_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "age7_known": 0 } ], @@ -5256,7 +5256,7 @@ "females_in_soft_age_range_in_pregnant_household_person_7_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "details_known_7": 0 } ], @@ -5671,7 +5671,7 @@ "females_in_soft_age_range_in_pregnant_household_person_8_age_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "age8_known": 0 } ], @@ -5824,7 +5824,7 @@ "females_in_soft_age_range_in_pregnant_household_person_8_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true, + "non_males_in_pregnant_household_not_in_pregnancy_range?": true, "details_known_8": 0 } ], @@ -6259,7 +6259,7 @@ "females_in_soft_age_range_in_pregnant_household_value_check": { "depends_on": [ { - "female_in_pregnant_household_in_soft_validation_range?": true + "non_males_in_pregnant_household_not_in_pregnancy_range?": true } ], "title_text": { diff --git a/config/locales/forms/2026/lettings/soft_validations.en.yml b/config/locales/forms/2026/lettings/soft_validations.en.yml index 5a1d7d1a3..74e7af46f 100644 --- a/config/locales/forms/2026/lettings/soft_validations.en.yml +++ b/config/locales/forms/2026/lettings/soft_validations.en.yml @@ -12,14 +12,14 @@ en: question_text: "Are you sure this is correct?" title_text: "You told us somebody in the household is pregnant." informative_text: "You also told us that all the tenants living at the property are male." - females_in_soft_age_range_in_pregnant_household_value_check: + no_household_member_likely_to_be_pregnant_check: page_header: "" check_answer_label: "Pregnancy confirmation" check_answer_prompt: "Confirm pregnancy status" hint_text: "" question_text: "Are you sure this is correct?" title_text: "You told us somebody in the household is pregnant." - informative_text: "You also told us that any female tenants living at the property are in the following age ranges:
  • under 16 years old
  • over 50 years old
" + informative_text: "Your answers for the age, sex and gender of each household member suggest there is no household member who is likely to be pregnant." no_retirement_value_check: page_header: "" diff --git a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb index 865fc6fd2..7432b0bda 100644 --- a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb +++ b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb @@ -29,7 +29,7 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe [ { "age2_known" => 0, - "female_in_pregnant_household_in_soft_validation_range?" => true, + "non_males_in_pregnant_household_not_in_pregnancy_range?" => true, }, ], ) @@ -62,7 +62,7 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe [ { "age3_known" => 0, - "female_in_pregnant_household_in_soft_validation_range?" => true, + "non_males_in_pregnant_household_not_in_pregnancy_range?" => true, }, ], ) diff --git a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb index 8ce2e5451..96570ee09 100644 --- a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb +++ b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb @@ -29,7 +29,7 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe [ { "details_known_2" => 0, - "female_in_pregnant_household_in_soft_validation_range?" => true, + "non_males_in_pregnant_household_not_in_pregnancy_range?" => true, }, ], ) @@ -62,7 +62,7 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe [ { "details_known_3" => 0, - "female_in_pregnant_household_in_soft_validation_range?" => true, + "non_males_in_pregnant_household_not_in_pregnancy_range?" => true, }, ], ) diff --git a/spec/models/form/lettings/subsections/household_characteristics_spec.rb b/spec/models/form/lettings/subsections/household_characteristics_spec.rb index 11df2b8d7..c33d271c5 100644 --- a/spec/models/form/lettings/subsections/household_characteristics_spec.rb +++ b/spec/models/form/lettings/subsections/household_characteristics_spec.rb @@ -339,18 +339,15 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod expect(household_characteristics.pages.map(&:id)).to eq( %w[ household_members - no_females_pregnant_household_lead_hhmemb_value_check - females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check + no_household_member_likely_to_be_pregnant_hhmemb_check lead_tenant_age - no_females_pregnant_household_lead_age_value_check - females_in_soft_age_range_in_pregnant_household_lead_age_value_check + no_household_member_likely_to_be_pregnant_lead_age_check age_lead_tenant_under_retirement_value_check age_lead_tenant_over_retirement_value_check lead_tenant_sex_registered_at_birth lead_tenant_gender_same_as_sex lead_tenant_gender_identity - no_females_pregnant_household_lead_value_check - females_in_soft_age_range_in_pregnant_household_lead_value_check + no_household_member_likely_to_be_pregnant_lead_check gender_lead_tenant_over_retirement_value_check lead_tenant_ethnic_group lead_tenant_ethnic_background_arab @@ -367,15 +364,13 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_2_age person_2_lead_partner relationship_2_multiple_partners_value_check - no_females_pregnant_household_person_2_age_value_check - females_in_soft_age_range_in_pregnant_household_person_2_age_value_check + no_household_member_likely_to_be_pregnant_person_age_2_check age_2_under_retirement_value_check age_2_over_retirement_value_check person_2_sex_registered_at_birth person_2_gender_same_as_sex person_2_gender_identity - no_females_pregnant_household_person_2_value_check - females_in_soft_age_range_in_pregnant_household_person_2_value_check + no_household_member_likely_to_be_pregnant_person_2_check gender_2_over_retirement_value_check person_2_working_situation working_situation_2_under_retirement_value_check @@ -385,15 +380,13 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_3_age person_3_lead_partner relationship_3_multiple_partners_value_check - no_females_pregnant_household_person_3_age_value_check - females_in_soft_age_range_in_pregnant_household_person_3_age_value_check + no_household_member_likely_to_be_pregnant_person_age_3_check age_3_under_retirement_value_check age_3_over_retirement_value_check person_3_sex_registered_at_birth person_3_gender_same_as_sex person_3_gender_identity - no_females_pregnant_household_person_3_value_check - females_in_soft_age_range_in_pregnant_household_person_3_value_check + no_household_member_likely_to_be_pregnant_person_3_check gender_3_over_retirement_value_check person_3_working_situation working_situation_3_under_retirement_value_check @@ -403,15 +396,13 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_4_age person_4_lead_partner relationship_4_multiple_partners_value_check - no_females_pregnant_household_person_4_age_value_check - females_in_soft_age_range_in_pregnant_household_person_4_age_value_check + no_household_member_likely_to_be_pregnant_person_age_4_check age_4_under_retirement_value_check age_4_over_retirement_value_check person_4_sex_registered_at_birth person_4_gender_same_as_sex person_4_gender_identity - no_females_pregnant_household_person_4_value_check - females_in_soft_age_range_in_pregnant_household_person_4_value_check + no_household_member_likely_to_be_pregnant_person_4_check gender_4_over_retirement_value_check person_4_working_situation working_situation_4_under_retirement_value_check @@ -421,15 +412,13 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_5_age person_5_lead_partner relationship_5_multiple_partners_value_check - no_females_pregnant_household_person_5_age_value_check - females_in_soft_age_range_in_pregnant_household_person_5_age_value_check + no_household_member_likely_to_be_pregnant_person_age_5_check age_5_under_retirement_value_check age_5_over_retirement_value_check person_5_sex_registered_at_birth person_5_gender_same_as_sex person_5_gender_identity - no_females_pregnant_household_person_5_value_check - females_in_soft_age_range_in_pregnant_household_person_5_value_check + no_household_member_likely_to_be_pregnant_person_5_check gender_5_over_retirement_value_check person_5_working_situation working_situation_5_under_retirement_value_check @@ -439,15 +428,13 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_6_age person_6_lead_partner relationship_6_multiple_partners_value_check - no_females_pregnant_household_person_6_age_value_check - females_in_soft_age_range_in_pregnant_household_person_6_age_value_check + no_household_member_likely_to_be_pregnant_person_age_6_check age_6_under_retirement_value_check age_6_over_retirement_value_check person_6_sex_registered_at_birth person_6_gender_same_as_sex person_6_gender_identity - no_females_pregnant_household_person_6_value_check - females_in_soft_age_range_in_pregnant_household_person_6_value_check + no_household_member_likely_to_be_pregnant_person_6_check gender_6_over_retirement_value_check person_6_working_situation working_situation_6_under_retirement_value_check @@ -457,15 +444,13 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_7_age person_7_lead_partner relationship_7_multiple_partners_value_check - no_females_pregnant_household_person_7_age_value_check - females_in_soft_age_range_in_pregnant_household_person_7_age_value_check + no_household_member_likely_to_be_pregnant_person_age_7_check age_7_under_retirement_value_check age_7_over_retirement_value_check person_7_sex_registered_at_birth person_7_gender_same_as_sex person_7_gender_identity - no_females_pregnant_household_person_7_value_check - females_in_soft_age_range_in_pregnant_household_person_7_value_check + no_household_member_likely_to_be_pregnant_person_7_check gender_7_over_retirement_value_check person_7_working_situation working_situation_7_under_retirement_value_check @@ -475,15 +460,13 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_8_age person_8_lead_partner relationship_8_multiple_partners_value_check - no_females_pregnant_household_person_8_age_value_check - females_in_soft_age_range_in_pregnant_household_person_8_age_value_check + no_household_member_likely_to_be_pregnant_person_age_8_check age_8_under_retirement_value_check age_8_over_retirement_value_check person_8_sex_registered_at_birth person_8_gender_same_as_sex person_8_gender_identity - no_females_pregnant_household_person_8_value_check - females_in_soft_age_range_in_pregnant_household_person_8_value_check + no_household_member_likely_to_be_pregnant_person_8_check gender_8_over_retirement_value_check person_8_working_situation working_situation_8_under_retirement_value_check diff --git a/spec/models/form/lettings/subsections/household_needs_spec.rb b/spec/models/form/lettings/subsections/household_needs_spec.rb index 7c3a2a505..01423f8dd 100644 --- a/spec/models/form/lettings/subsections/household_needs_spec.rb +++ b/spec/models/form/lettings/subsections/household_needs_spec.rb @@ -53,8 +53,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdNeeds, type: :model do armed_forces_serving armed_forces_injured pregnant - no_females_pregnant_household_value_check - females_in_soft_age_range_in_pregnant_household_value_check + no_household_member_likely_to_be_pregnant_check access_needs_exist type_of_access_needs health_conditions diff --git a/spec/models/validations/soft_validations_spec.rb b/spec/models/validations/soft_validations_spec.rb index 6c39824c5..02b383acf 100644 --- a/spec/models/validations/soft_validations_spec.rb +++ b/spec/models/validations/soft_validations_spec.rb @@ -1,8 +1,11 @@ require "rails_helper" RSpec.describe Validations::SoftValidations do - let(:organisation) { FactoryBot.build(:organisation, provider_type: "PRP", id: 123) } - let(:record) { FactoryBot.build(:lettings_log, owning_organisation: organisation) } + include CollectionTimeHelper + + let(:organisation) { build(:organisation, provider_type: "PRP", id: 123) } + let(:start_year) { current_collection_start_year } + let(:record) { build(:lettings_log, owning_organisation: organisation, startdate: collection_start_date_for_year(start_year)) } describe "rent min max validations" do before do @@ -153,98 +156,275 @@ RSpec.describe Validations::SoftValidations do end describe "pregnancy soft validations" do - context "when all tenants are male" do - it "shows the interruption screen" do - record.age1 = 43 - record.sex1 = "M" - record.preg_occ = 1 - record.hhmemb = 1 - record.age1_known = 0 - expect(record.all_male_tenants_in_a_pregnant_household?).to be true + context "when 2025" do + let(:start_year) { 2025 } + + context "when all tenants are male" do + it "shows the interruption screen" do + record.age1 = 43 + record.sex1 = "M" + record.preg_occ = 1 + record.hhmemb = 1 + record.age1_known = 0 + expect(record.all_male_tenants_in_a_pregnant_household?).to be true + end end - end - context "when there all tenants are male and age of tenants is unknown" do - it "shows the interruption screen" do - record.sex1 = "M" - record.preg_occ = 1 - record.hhmemb = 1 - record.age1_known = 1 - expect(record.all_male_tenants_in_a_pregnant_household?).to be true + context "when there all tenants are male and age of tenants is unknown" do + it "shows the interruption screen" do + record.sex1 = "M" + record.preg_occ = 1 + record.hhmemb = 1 + record.age1_known = 1 + expect(record.all_male_tenants_in_a_pregnant_household?).to be true + end end - end - context "when all tenants are male and household members are over 8" do - it "does not show the interruption screen" do - (1..8).each do |n| - record.send("sex#{n}=", "M") - record.send("age#{n}=", 30) - record.send("age#{n}_known=", 0) - record.send("details_known_#{n}=", 0) unless n == 1 + context "when all tenants are male and household members are over 8" do + it "does not show the interruption screen" do + (1..8).each do |n| + record.send("sex#{n}=", "M") + record.send("age#{n}=", 30) + record.send("age#{n}_known=", 0) + record.send("details_known_#{n}=", 0) unless n == 1 + end + record.preg_occ = 1 + record.hhmemb = 9 + expect(record.all_male_tenants_in_a_pregnant_household?).to be false end - record.preg_occ = 1 - record.hhmemb = 9 - expect(record.all_male_tenants_in_a_pregnant_household?).to be false end - end - context "when female tenants are under 16" do - it "shows the interruption screen" do - record.age2 = 14 - record.sex2 = "F" - record.preg_occ = 1 - record.hhmemb = 2 - record.details_known_2 = 0 - record.age2_known = 0 - record.age1 = 18 - record.sex1 = "M" - record.age1_known = 0 - expect(record.female_in_pregnant_household_in_soft_validation_range?).to be true + context "when female tenants are under 16" do + it "shows the interruption screen" do + record.age2 = 14 + record.sex2 = "F" + record.preg_occ = 1 + record.hhmemb = 2 + record.details_known_2 = 0 + record.age2_known = 0 + record.age1 = 18 + record.sex1 = "M" + record.age1_known = 0 + expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be true + end end - end - context "when female tenants are over 50" do - it "shows the interruption screen" do - record.age1 = 54 - record.sex1 = "F" - record.preg_occ = 1 - record.hhmemb = 1 - record.age1_known = 0 - expect(record.female_in_pregnant_household_in_soft_validation_range?).to be true + context "when female tenants are over 50" do + it "shows the interruption screen" do + record.age1 = 54 + record.sex1 = "F" + record.preg_occ = 1 + record.hhmemb = 1 + record.age1_known = 0 + expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be true + end + end + + context "when non-binary tenants are under 16" do + it "does not show the interruption screen" do + record.age2 = 14 + record.sex2 = "X" + record.preg_occ = 1 + record.hhmemb = 2 + record.details_known_2 = 0 + record.age2_known = 0 + record.age1 = 18 + record.sex1 = "M" + record.age1_known = 0 + expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be false + end + end + + context "when non-binary tenants are over 50" do + it "does not show the interruption screen" do + record.age1 = 54 + record.sex1 = "X" + record.preg_occ = 1 + record.hhmemb = 1 + record.age1_known = 0 + expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be false + end + end + + context "when female tenants are outside of soft validation ranges" do + it "does not show the interruption screen" do + record.age1 = 44 + record.sex1 = "F" + record.preg_occ = 1 + record.hhmemb = 1 + expect(record.all_male_tenants_in_a_pregnant_household?).to be false + expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be false + end + end + + context "when the information about the tenants is not given" do + it "does not show the interruption screen" do + record.preg_occ = 1 + record.hhmemb = 2 + expect(record.all_male_tenants_in_a_pregnant_household?).to be false + expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be false + end + end + + context "when number of household members is over 8" do + it "does not show the interruption screen" do + (1..8).each do |n| + record.send("sex#{n}=", "F") + record.send("age#{n}=", 50) + record.send("age#{n}_known=", 0) + record.send("details_known_#{n}=", 0) unless n == 1 + end + record.preg_occ = 1 + record.hhmemb = 9 + expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be false + end end end - context "when female tenants are outside of soft validation ranges" do - it "does not show the interruption screen" do - record.age1 = 44 - record.sex1 = "F" + context "when 2026" do + let(:start_year) { 2026 } + + before do + record.age1 = 43 + record.age1_known = 0 record.preg_occ = 1 record.hhmemb = 1 - expect(record.all_male_tenants_in_a_pregnant_household?).to be false - expect(record.female_in_pregnant_household_in_soft_validation_range?).to be false end - end - context "when the information about the tenants is not given" do - it "does not show the interruption screen" do - record.preg_occ = 1 - record.hhmemb = 2 - expect(record.all_male_tenants_in_a_pregnant_household?).to be false - expect(record.female_in_pregnant_household_in_soft_validation_range?).to be false + context "when all tenants are male" do + before do + record.sexrab1 = "M" + record.gender_same_as_sex1 = 1 + end + + it "shows the interruption screen" do + expect(record.all_male_tenants_in_a_pregnant_household?).to be true + end end - end - context "when number of household members is over 8" do - it "does not show the interruption screen" do - (1..8).each do |n| - record.send("sex#{n}=", "F") - record.send("age#{n}=", 50) - record.send("age#{n}_known=", 0) - record.send("details_known_#{n}=", 0) unless n == 1 + context "when there all tenants are male and age of tenants is unknown" do + before do + record.sexrab1 = "M" + record.gender_same_as_sex1 = 1 + record.age1_known = 1 + end + + it "shows the interruption screen" do + expect(record.all_male_tenants_in_a_pregnant_household?).to be true + end + end + + context "when all tenants are male and household members are over 8" do + before do + (1..8).each do |n| + record.send("sexrab#{n}=", "M") + record.send("gender_same_as_sex#{n}=", 1) + record.send("age#{n}=", 30) + record.send("age#{n}_known=", 0) + record.send("details_known_#{n}=", 0) unless n == 1 + end + record.preg_occ = 1 + record.hhmemb = 9 + end + + it "does not show the interruption screen" do + expect(record.all_male_tenants_in_a_pregnant_household?).to be false + end + end + + context "when female tenants are under 16" do + before do + record.age1 = 12 + record.sexrab1 = "F" + record.gender_same_as_sex1 = 1 + end + + it "shows the interruption screen" do + expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be true + end + end + + context "when female tenants are over 50" do + before do + record.age1 = 60 + record.sexrab1 = "F" + record.gender_same_as_sex1 = 1 + end + + it "shows the interruption screen" do + expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be true + end + end + + context "when non binary tenants are under 16" do + before do + record.age1 = 12 + record.sexrab1 = "M" + record.gender_same_as_sex1 = 2 + record.gender_description1 = "Non-binary" + end + + it "shows the interruption screen" do + expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be true + end + end + + context "when non binary tenants are over 50" do + before do + record.age1 = 60 + record.sexrab1 = "M" + record.gender_same_as_sex1 = 2 + record.gender_description1 = "Non-binary" + end + + it "shows the interruption screen" do + expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be true + end + end + + context "when female tenants are outside of soft validation ranges" do + before do + record.age1 = 30 + record.sexrab1 = "F" + record.gender_same_as_sex1 = 1 + end + + it "does not show the interruption screen" do + expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be false + end + end + + context "when the information about the tenants is not given" do + before do + record.age1 = nil + record.age1_known = nil + record.sexrab1 = nil + record.gender_same_as_sex1 = nil + record.preg_occ = 1 + record.hhmemb = 1 + end + + it "does not show the interruption screen" do + expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be false + end + end + + context "when number of household members is over 8" do + before do + (1..8).each do |n| + record.send("sexrab#{n}=", "F") + record.send("gender_same_as_sex#{n}=", 1) + record.send("age#{n}=", 30) + record.send("age#{n}_known=", 0) + record.send("details_known_#{n}=", 0) unless n == 1 + end + record.preg_occ = 1 + record.hhmemb = 9 + end + + it "does not show the interruption screen" do + expect(record.non_males_in_pregnant_household_not_in_pregnancy_range?).to be false end - record.preg_occ = 1 - record.hhmemb = 9 - expect(record.female_in_pregnant_household_in_soft_validation_range?).to be false end end end diff --git a/spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb index 68768d7d9..23c0d3c57 100644 --- a/spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb @@ -2084,18 +2084,22 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do end context "when a soft validation is triggered that relates both to fields that are and are not routed to" do - let(:attributes) { setup_section_params.merge({ field_78: "1", field_43: "M", field_49: "M", field_53: "M" }) } + let(:attributes) { setup_section_params.merge({ field_78: "1", field_130: "M", field_131: "M", field_132: "M", field_138: 1, field_140: 1, field_142: 1 }) } it "adds errors to fields that are routed to" do parser.valid? - expect(parser.errors.where(:field_49, category: :soft_validation)).to be_present - expect(parser.errors.where(:field_53, category: :soft_validation)).to be_present + expect(parser.errors.where(:field_130, category: :soft_validation)).to be_present + expect(parser.errors.where(:field_138, category: :soft_validation)).to be_present + expect(parser.errors.where(:field_131, category: :soft_validation)).to be_present + expect(parser.errors.where(:field_140, category: :soft_validation)).to be_present end it "does not add errors to fields that are not routed to" do parser.valid? - expect(parser.errors.where(:field_57, category: :soft_validation)).not_to be_present - expect(parser.errors.where(:field_61, category: :soft_validation)).not_to be_present + expect(parser.errors.where(:field_133, category: :soft_validation)).not_to be_present + expect(parser.errors.where(:field_144, category: :soft_validation)).not_to be_present + expect(parser.errors.where(:field_134, category: :soft_validation)).not_to be_present + expect(parser.errors.where(:field_146, category: :soft_validation)).not_to be_present end end From 47915e92f7ab88eb9eaedcbc3af06ad46ec8f5d6 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Mon, 23 Feb 2026 09:48:04 +0000 Subject: [PATCH 04/11] CLDC-1402: Update hint text for 'What is the tenancy start date?' question (#3158) * CLDC-1402: Add hint text for start date * CLDC-1402: Ensure that start date is valid * Revert "CLDC-1402: Ensure that start date is valid" This reverts commit 000fe4b3695518ed65fa0302f2da4ef2d6d60875. * CLDC-1402: Implement desired copy for start date q adds an override method for the date example * fixup! CLDC-1402: Implement desired copy for start date q implement final wording Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com> --------- Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com> --- app/helpers/collection_time_helper.rb | 9 ++++++--- app/helpers/form_page_helper.rb | 9 +++++++++ .../form/lettings/questions/tenancy_start_date.rb | 13 +++++++++++++ app/models/form/question.rb | 5 +++++ app/views/form/_date_question.html.erb | 2 +- config/locales/forms/2026/lettings/setup.en.yml | 3 ++- 6 files changed, 36 insertions(+), 5 deletions(-) diff --git a/app/helpers/collection_time_helper.rb b/app/helpers/collection_time_helper.rb index ad7dac6a9..1e8c0eef4 100644 --- a/app/helpers/collection_time_helper.rb +++ b/app/helpers/collection_time_helper.rb @@ -16,10 +16,13 @@ module CollectionTimeHelper Time.zone.local(collection_start_year_for_date(date), 4, 1) end - def date_mid_collection_year_formatted(date) + def date_mid_collection_year(date) relevant_year = date.nil? ? current_collection_start_year : collection_start_year_for_date(date) - example_date = Date.new(relevant_year, 9, 13) - example_date.to_formatted_s(:govuk_date_number_month) + Date.new(relevant_year, 9, 13) + end + + def date_mid_collection_year_formatted(date) + date_mid_collection_year(date).to_formatted_s(:govuk_date_number_month) end def current_collection_start_date diff --git a/app/helpers/form_page_helper.rb b/app/helpers/form_page_helper.rb index 74e75e572..98b9bb8d5 100644 --- a/app/helpers/form_page_helper.rb +++ b/app/helpers/form_page_helper.rb @@ -1,4 +1,6 @@ module FormPageHelper + include CollectionTimeHelper + def action_href(log, page_id, referrer = "check_answers") send("#{log.log_type}_#{page_id}_path", log, referrer:) end @@ -46,4 +48,11 @@ module FormPageHelper page.skip_href(log) || send(log.form.next_page_redirect_path(page, log, current_user, ignore_answered: true), log) end end + + def date_hint(question, log) + [ + question.hint_text.presence, + question.date_example_override(log) || "For example, #{date_mid_collection_year_formatted(log.startdate).tr(' ', '/')}", + ].compact.join("

").html_safe + end end diff --git a/app/models/form/lettings/questions/tenancy_start_date.rb b/app/models/form/lettings/questions/tenancy_start_date.rb index cf1b556e7..b7d82b399 100644 --- a/app/models/form/lettings/questions/tenancy_start_date.rb +++ b/app/models/form/lettings/questions/tenancy_start_date.rb @@ -1,4 +1,6 @@ class Form::Lettings::Questions::TenancyStartDate < ::Form::Question + include CollectionTimeHelper + def initialize(id, hsh, page) super @id = "startdate" @@ -7,5 +9,16 @@ class Form::Lettings::Questions::TenancyStartDate < ::Form::Question @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? end + def date_example_override(log) + return unless form.start_year_2026_or_later? + + example_date = + [date_mid_collection_year(log.startdate), Time.zone.today + 7] + .min + .to_formatted_s(:govuk_date_number_month) + .tr(" ", "/") + I18n.t("forms.#{form.start_date.year}.#{copy_key}.example", default: "", example_date:) + end + QUESTION_NUMBER_FROM_YEAR = { 2023 => 5, 2024 => 7 }.freeze end diff --git a/app/models/form/question.rb b/app/models/form/question.rb index 3a3cc6a34..81f690837 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -299,6 +299,11 @@ class Form::Question answer_options.keys.reject { |x| x.match(/divider/) } end + # used by date questions that need bespoke formatting for the example date + def date_example_override(_log) + nil + end + private def selected_answer_option_is_derived?(log) diff --git a/app/views/form/_date_question.html.erb b/app/views/form/_date_question.html.erb index a1df5f4d5..28437f3b9 100644 --- a/app/views/form/_date_question.html.erb +++ b/app/views/form/_date_question.html.erb @@ -6,7 +6,7 @@ question_id: question.id, legend: { text: legend[:text], size: legend[:size], caption: caption(caption_text, page_header, conditional) }, resource_type: @log.log_type, - hint: (question.hint_text.blank? ? "" : (question.hint_text.html_safe + "

".html_safe)) + "For example, #{date_mid_collection_year_formatted(@log.startdate).tr(' ', '/')}", + hint: date_hint(question, @log), f:, } %> diff --git a/config/locales/forms/2026/lettings/setup.en.yml b/config/locales/forms/2026/lettings/setup.en.yml index a68a489d2..bfd08e55d 100644 --- a/config/locales/forms/2026/lettings/setup.en.yml +++ b/config/locales/forms/2026/lettings/setup.en.yml @@ -63,7 +63,8 @@ en: page_header: "" check_answer_label: "Tenancy start date" check_answer_prompt: "" - hint_text: "" + hint_text: "The tenancy start date can be up to 14 days from today. If your tenancy starts more than 14 days into the future, please wait until you are within 14 days of the start date before submitting your log.

For example, if you’re answering this question on 1 April, you can enter a tenancy start date up to and including 15 April." + example: "Enter the date in the format DD/MM/YYYY, for example %{example_date}." question_text: "What is the tenancy start date?" rent_type: From cc13fc287c3d93ea728be73afd37a1b431c6aca3 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Mon, 23 Feb 2026 09:48:56 +0000 Subject: [PATCH 05/11] CLDC-4105: Ensure hhmemb is not >8 for validation (#3184) otherwise the send to ecstatn will fail this can happen whilst running validation checks --- app/models/validations/soft_validations.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/validations/soft_validations.rb b/app/models/validations/soft_validations.rb index 662aa9af6..9b6816dd1 100644 --- a/app/models/validations/soft_validations.rb +++ b/app/models/validations/soft_validations.rb @@ -329,6 +329,8 @@ private end def at_least_one_person_working_situation_is_illness? + return if hhmemb.present? && hhmemb > 8 + person_count = hhmemb || 8 (1..person_count).any? { |n| public_send("ecstat#{n}") == 8 } From b40a8b94ef4862f78727702935255741165cac41 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Mon, 23 Feb 2026 09:49:34 +0000 Subject: [PATCH 06/11] CLDC-4142: Add CYA override for gender_same_as_sex (#3185) it's clearer for 'No' here as the below question in CYA talks above gender identity description --- .../lettings/questions/gender_same_as_sex.rb | 1 + .../questions/gender_same_as_sex_spec.rb | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/models/form/lettings/questions/gender_same_as_sex.rb b/app/models/form/lettings/questions/gender_same_as_sex.rb index 1fdfddda5..0b0fd55b5 100644 --- a/app/models/form/lettings/questions/gender_same_as_sex.rb +++ b/app/models/form/lettings/questions/gender_same_as_sex.rb @@ -7,6 +7,7 @@ class Form::Lettings::Questions::GenderSameAsSex < ::Form::Question @conditional_for = { "gender_description#{person_index}" => [2] } @person_index = person_index @question_number = question_number + @inferred_check_answers_value = [{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }] end def answer_options diff --git a/spec/models/form/lettings/questions/gender_same_as_sex_spec.rb b/spec/models/form/lettings/questions/gender_same_as_sex_spec.rb index 65734d9ef..09a9ef19f 100644 --- a/spec/models/form/lettings/questions/gender_same_as_sex_spec.rb +++ b/spec/models/form/lettings/questions/gender_same_as_sex_spec.rb @@ -42,7 +42,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to be_nil + expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]) end it "has the correct question number" do @@ -72,7 +72,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to be_nil + expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]) end it "has the correct question number" do @@ -102,7 +102,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to be_nil + expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]) end it "has the correct question number" do @@ -132,7 +132,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to be_nil + expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]) end it "has the correct question number" do @@ -162,7 +162,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to be_nil + expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]) end it "has the correct question number" do @@ -192,7 +192,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to be_nil + expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]) end it "has the correct question number" do @@ -222,7 +222,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to be_nil + expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]) end it "has the correct question number" do @@ -252,7 +252,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to be_nil + expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]) end it "has the correct question number" do From c4f4298d01b4d971cae439d30c83c66829af031d Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis <94526761+natdeanlewissoftwire@users.noreply.github.com> Date: Mon, 23 Feb 2026 10:41:22 +0000 Subject: [PATCH 07/11] CLDC-4231: add create test log buttons for 26/27 logs (#3180) * CLDC-4231: add create test log buttons for current and next collection years * CLDC-4231: remove end date overrides * CLDC-4231: allow test logs on staging * CLDC-4231: feature flag next year test logs by allow_future_form_use? --- .../create_log_actions_component.html.erb | 20 +++++++++++-- .../create_log_actions_component.rb | 17 +++++++++++ app/controllers/test_data_controller.rb | 28 +++++++++++++++++++ app/services/feature_toggle.rb | 2 +- config/routes.rb | 4 +++ 5 files changed, 68 insertions(+), 3 deletions(-) diff --git a/app/components/create_log_actions_component.html.erb b/app/components/create_log_actions_component.html.erb index 3eab0f871..130072ec0 100644 --- a/app/components/create_log_actions_component.html.erb +++ b/app/components/create_log_actions_component.html.erb @@ -14,17 +14,33 @@ These tools can only be seen and used in testing environments.
<%= govuk_button_link_to create_test_log_href, class: "govuk-button" do %> - New test log + New <%= current_collection_year_label %> test log <% end %> + <% if FeatureToggle.allow_future_form_use? %> + <%= govuk_button_link_to create_next_year_test_log_href, class: "govuk-button" do %> + New <%= next_collection_year_label %> test log + + <% end %> + <% end %> <%= govuk_button_link_to create_setup_test_log_href, class: "govuk-button" do %> - New test log (setup only) + New <%= current_collection_year_label %> test log (setup only) <% end %> + <% if FeatureToggle.allow_future_form_use? %> + <%= govuk_button_link_to create_next_year_setup_test_log_href, class: "govuk-button" do %> + New <%= next_collection_year_label %> test log (setup only) + + <% end %> + <% end %> <%= govuk_button_link_to create_test_bulk_upload_href(2025), class: "govuk-button govuk-button--secondary" do %> 25/26 BU test file diff --git a/app/components/create_log_actions_component.rb b/app/components/create_log_actions_component.rb index ae240bc91..c618c01fc 100644 --- a/app/components/create_log_actions_component.rb +++ b/app/components/create_log_actions_component.rb @@ -1,5 +1,6 @@ class CreateLogActionsComponent < ViewComponent::Base include Rails.application.routes.url_helpers + include CollectionTimeHelper attr_reader :bulk_upload, :user, :log_type @@ -38,10 +39,26 @@ class CreateLogActionsComponent < ViewComponent::Base send("create_test_#{log_type}_log_path") end + def create_next_year_test_log_href + send("create_next_year_test_#{log_type}_log_path") + end + def create_setup_test_log_href send("create_setup_test_#{log_type}_log_path") end + def create_next_year_setup_test_log_href + send("create_next_year_setup_test_#{log_type}_log_path") + end + + def current_collection_year_label + "#{current_collection_start_year - 2000}/#{current_collection_end_year - 2000}" + end + + def next_collection_year_label + "#{next_collection_start_year - 2000}/#{next_collection_end_year - 2000}" + end + def create_test_bulk_upload_href(year) send("create_#{year}_test_#{log_type}_bulk_upload_path") end diff --git a/app/controllers/test_data_controller.rb b/app/controllers/test_data_controller.rb index d9315d68c..5298a4fc7 100644 --- a/app/controllers/test_data_controller.rb +++ b/app/controllers/test_data_controller.rb @@ -10,6 +10,13 @@ class TestDataController < ApplicationController redirect_to lettings_log_path(log) end + def create_next_year_test_lettings_log + return render_not_found unless FeatureToggle.create_test_logs_enabled? + + log = FactoryBot.create(:lettings_log, :completed, assigned_to: current_user, ppostcode_full: "SW1A 1AA", manual_address_entry_selected: false, startdate: generate_different_date_within_collection_year(Time.zone.local(next_collection_start_year, 4, 1))) + redirect_to lettings_log_path(log) + end + def create_setup_test_lettings_log return render_not_found unless FeatureToggle.create_test_logs_enabled? @@ -17,6 +24,13 @@ class TestDataController < ApplicationController redirect_to lettings_log_path(log) end + def create_next_year_setup_test_lettings_log + return render_not_found unless FeatureToggle.create_test_logs_enabled? + + log = FactoryBot.create(:lettings_log, :setup_completed, assigned_to: current_user, manual_address_entry_selected: false, startdate: generate_different_date_within_collection_year(Time.zone.local(next_collection_start_year, 4, 1))) + redirect_to lettings_log_path(log) + end + %w[2025 2026].each do |year| define_method("create_#{year}_test_lettings_bulk_upload") do return render_not_found unless FeatureToggle.create_test_logs_enabled? @@ -47,6 +61,13 @@ class TestDataController < ApplicationController redirect_to sales_log_path(log) end + def create_next_year_test_sales_log + return render_not_found unless FeatureToggle.create_test_logs_enabled? + + log = FactoryBot.create(:sales_log, :completed, assigned_to: current_user, manual_address_entry_selected: false, saledate: generate_different_date_within_collection_year(Time.zone.local(next_collection_start_year, 4, 1))) + redirect_to sales_log_path(log) + end + def create_setup_test_sales_log return render_not_found unless FeatureToggle.create_test_logs_enabled? @@ -54,6 +75,13 @@ class TestDataController < ApplicationController redirect_to sales_log_path(log) end + def create_next_year_setup_test_sales_log + return render_not_found unless FeatureToggle.create_test_logs_enabled? + + log = FactoryBot.create(:sales_log, :shared_ownership_setup_complete, assigned_to: current_user, manual_address_entry_selected: false, saledate: generate_different_date_within_collection_year(Time.zone.local(next_collection_start_year, 4, 1))) + redirect_to sales_log_path(log) + end + %w[2025 2026].each do |year| define_method("create_#{year}_test_sales_bulk_upload") do return render_not_found unless FeatureToggle.create_test_logs_enabled? diff --git a/app/services/feature_toggle.rb b/app/services/feature_toggle.rb index 4b2c440fc..e70528d3f 100644 --- a/app/services/feature_toggle.rb +++ b/app/services/feature_toggle.rb @@ -28,7 +28,7 @@ class FeatureToggle end def self.create_test_logs_enabled? - Rails.env.development? || Rails.env.review? + Rails.env.development? || Rails.env.review? || Rails.env.staging? end def self.sales_export_enabled? diff --git a/config/routes.rb b/config/routes.rb index e0abecef1..a9ea0da42 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -405,11 +405,15 @@ Rails.application.routes.draw do if FeatureToggle.create_test_logs_enabled? get "create-test-lettings-log", to: "test_data#create_test_lettings_log" + get "create-next-year-test-lettings-log", to: "test_data#create_next_year_test_lettings_log" get "create-setup-test-lettings-log", to: "test_data#create_setup_test_lettings_log" + get "create-next-year-setup-test-lettings-log", to: "test_data#create_next_year_setup_test_lettings_log" get "create-2025-test-lettings-bulk-upload", to: "test_data#create_2025_test_lettings_bulk_upload" get "create-2026-test-lettings-bulk-upload", to: "test_data#create_2026_test_lettings_bulk_upload" get "create-test-sales-log", to: "test_data#create_test_sales_log" + get "create-next-year-test-sales-log", to: "test_data#create_next_year_test_sales_log" get "create-setup-test-sales-log", to: "test_data#create_setup_test_sales_log" + get "create-next-year-setup-test-sales-log", to: "test_data#create_next_year_setup_test_sales_log" get "create-2025-test-sales-bulk-upload", to: "test_data#create_2025_test_sales_bulk_upload" get "create-2026-test-sales-bulk-upload", to: "test_data#create_2026_test_sales_bulk_upload" end From 02f319396b90a2b157cd2579532b92069d9a41ac Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis <94526761+natdeanlewissoftwire@users.noreply.github.com> Date: Mon, 23 Feb 2026 10:43:55 +0000 Subject: [PATCH 08/11] CLDC-4140: remove old gender question lettings (#3177) * CLDC-4141: copy person questions refactor from CLDC-4142 * CLDC-4141: remove gender same as sex and replace gender identity q * CLDC-4141: replace sex with sexrab where relevant for 2026 * CLDC-4141: update download order * CLDC-4140: remove sex from rowparser entirely * CLDC-4140: keep sex in factory for now * CLDC-4140: update household characteristics test * CLDC-4140: update log variable spec * CLDC-4140: update csv export tests * CLDC-4140: update validator tests * CLDC-4140: update row-parser spec * CLDC-4140: update csv-parser spec * CLDC-4140: update export spec * CLDC-4140: update log var defs spec * CLDC-4140: update export spec * CLDC-4140: update row parser spec * CLDC-4140: update validator spec * CLDC-4140: update csv parser spec * CLDC-4143: Update gender retirement validations rename functions as the new wording is more related to those that identify as male and any other option * CLDC-4143: Add 2026 tests * CLDC-4143: Update legacy json files causes issues with some old tests * CLDC-4143: Add error mappings for gender fields * CLDC-4143: Add new gender age retirement soft validation replaces the many check pages from previous years with a single one shows if either of the previous ones would show has agreed wording on ticket * fixup! CLDC-4143: Update gender retirement validations improve gender comment wording * CLDC-4143: Update non males validation name reference to 'soft validation' we found confusing * fixup! CLDC-4143: Add new gender age retirement soft validation update subsection specs * CLDC-4140: update parsers post merge * CLDC-4140: update tests after field renumbering * CLDC-4140: update tests after field renumbering * CLDC-4140: update spacing in to_2026_row * CLDC-4140: update row parser spec field numbers * CLDC-4140: update row parser field types --------- Co-authored-by: Samuel Young --- .../bulk_upload/lettings_log_to_csv.rb | 35 +-- .../lettings_log_variables.rb | 2 +- .../subsections/household_characteristics.rb | 4 +- app/models/form/question.rb | 8 + app/models/lettings_log.rb | 6 +- .../lettings/year2026/csv_parser.rb | 2 +- .../lettings/year2026/row_parser.rb | 251 ++++++++---------- .../exports/lettings_log_export_constants.rb | 17 +- .../exports/general_needs_log_26_27.xml | 8 - .../lettings_log_csv_export_codes_26.csv | 6 +- .../lettings_log_csv_export_labels_26.csv | 6 +- ...gs_log_csv_export_non_support_codes_26.csv | 6 +- ...s_log_csv_export_non_support_labels_26.csv | 6 +- .../household_characteristics_spec.rb | 8 - .../bulk_upload/lettings/validator_spec.rb | 4 +- .../lettings/year2026/csv_parser_spec.rb | 8 +- .../lettings/year2026/row_parser_spec.rb | 244 ++++++++--------- .../csv/lettings_log_csv_service_spec.rb | 3 - .../lettings_log_export_service_spec.rb | 18 +- 19 files changed, 299 insertions(+), 343 deletions(-) diff --git a/app/helpers/bulk_upload/lettings_log_to_csv.rb b/app/helpers/bulk_upload/lettings_log_to_csv.rb index ec36d1911..155fb9b12 100644 --- a/app/helpers/bulk_upload/lettings_log_to_csv.rb +++ b/app/helpers/bulk_upload/lettings_log_to_csv.rb @@ -144,40 +144,40 @@ class BulkUpload::LettingsLogToCsv log.tenancylength, log.age1 || overrides[:age1], - log.sex1, + log.sexrab1, log.ethnic, log.nationality_all_group, log.ecstat1, relat_number(log.relat2), log.age2 || overrides[:age2], - log.sex2, + log.sexrab2, log.ecstat2, # 50 relat_number(log.relat3), log.age3 || overrides[:age3], - log.sex3, + log.sexrab3, log.ecstat3, relat_number(log.relat4), log.age4 || overrides[:age4], - log.sex4, + log.sexrab4, log.ecstat4, relat_number(log.relat5), log.age5 || overrides[:age5], # 60 - log.sex5, + log.sexrab5, log.ecstat5, relat_number(log.relat6), log.age6 || overrides[:age6], - log.sex6, + log.sexrab6, log.ecstat6, relat_number(log.relat7), log.age7 || overrides[:age7], - log.sex7, + log.sexrab7, log.ecstat7, # 70 relat_number(log.relat8), log.age8 || overrides[:age8], - log.sex8, + log.sexrab8, log.ecstat8, log.armedforces, log.leftreg, @@ -239,18 +239,10 @@ class BulkUpload::LettingsLogToCsv log.supcharg, log.hbrentshortfall, log.tshortfall, + log.gender_same_as_sex1, # 130 - log.sexrab1, # 130 - log.sexrab2, - log.sexrab3, - log.sexrab4, - log.sexrab5, - log.sexrab6, - log.sexrab7, - log.sexrab8, - log.gender_same_as_sex1, log.gender_description1, - log.gender_same_as_sex2, # 140 + log.gender_same_as_sex2, log.gender_description2, log.gender_same_as_sex3, log.gender_description3, @@ -258,15 +250,16 @@ class BulkUpload::LettingsLogToCsv log.gender_description4, log.gender_same_as_sex5, log.gender_description5, - log.gender_same_as_sex6, + log.gender_same_as_sex6, # 140 + log.gender_description6, - log.gender_same_as_sex7, # 150 + log.gender_same_as_sex7, log.gender_description7, log.gender_same_as_sex8, log.gender_description8, log.owning_organisation.prp? ? log.referral_register : nil, log.referral_noms, - log.referral_org, # 156 + log.referral_org, # 148 ] end diff --git a/app/models/derived_variables/lettings_log_variables.rb b/app/models/derived_variables/lettings_log_variables.rb index 1533c6400..19a58d916 100644 --- a/app/models/derived_variables/lettings_log_variables.rb +++ b/app/models/derived_variables/lettings_log_variables.rb @@ -300,7 +300,7 @@ private end def get_refused - return 1 if details_unknown? || age_refused? || sex_refused? || relat_refused? || ecstat_refused? + return 1 if details_unknown? || age_refused? || sex_refused? || sexrab_refused? || relat_refused? || ecstat_refused? 0 end diff --git a/app/models/form/lettings/subsections/household_characteristics.rb b/app/models/form/lettings/subsections/household_characteristics.rb index ab8e639bc..e50a2c788 100644 --- a/app/models/form/lettings/subsections/household_characteristics.rb +++ b/app/models/form/lettings/subsections/household_characteristics.rb @@ -21,7 +21,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::LeadTenantOverRetirementValueCheck.new("age_lead_tenant_over_retirement_value_check", nil, self), (Form::Lettings::Pages::LeadTenantSexRegisteredAtBirth.new(nil, nil, self) if form.start_year_2026_or_later?), (Form::Lettings::Pages::LeadTenantGenderSameAsSex.new(nil, nil, self) if form.start_year_2026_or_later?), - Form::Lettings::Pages::LeadTenantGenderIdentity.new(nil, nil, self), + (Form::Lettings::Pages::LeadTenantGenderIdentity.new(nil, nil, self) unless form.start_year_2026_or_later?), (Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadValueCheck.new(nil, nil, self) unless form.start_year_2026_or_later?), (Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadValueCheck.new(nil, nil, self) unless form.start_year_2026_or_later?), (Form::Lettings::Pages::NoHouseholdMemberLikelyToBePregnantCheck.new("no_household_member_likely_to_be_pregnant_lead_check", nil, self, person_index: 1) if form.start_year_2026_or_later?), @@ -63,7 +63,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_#{person_index}_partner_under_16_value_check", nil, self, person_index:) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?), (Form::Lettings::Pages::PersonSexRegisteredAtBirth.new(nil, nil, self, person_index:) if form.start_year_2026_or_later?), (Form::Lettings::Pages::PersonGenderSameAsSex.new(nil, nil, self, person_index:) if form.start_year_2026_or_later?), - Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index:), + (Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index:) unless form.start_year_2026_or_later?), (Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index:) unless form.start_year_2026_or_later?), (Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index:) unless form.start_year_2026_or_later?), (Form::Lettings::Pages::NoHouseholdMemberLikelyToBePregnantCheck.new("no_household_member_likely_to_be_pregnant_person_#{person_index}_check", nil, self, person_index:) if form.start_year_2026_or_later?), diff --git a/app/models/form/question.rb b/app/models/form/question.rb index 81f690837..e5bc0c9a6 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -446,6 +446,14 @@ private sex6: %w[R], sex7: %w[R], sex8: %w[R], + sexrab1: %w[R], + sexrab2: %w[R], + sexrab3: %w[R], + sexrab4: %w[R], + sexrab5: %w[R], + sexrab6: %w[R], + sexrab7: %w[R], + sexrab8: %w[R], relat2: [3], relat3: [3], relat4: [3], diff --git a/app/models/lettings_log.rb b/app/models/lettings_log.rb index 7f1586f88..c3b72fbdd 100644 --- a/app/models/lettings_log.rb +++ b/app/models/lettings_log.rb @@ -687,7 +687,7 @@ class LettingsLog < Log end def has_any_person_details?(person_index) - ["sex#{person_index}", "relat#{person_index}", "ecstat#{person_index}"].any? { |field| public_send(field).present? } || public_send("age#{person_index}_known") == 1 + ["sex#{person_index}", "sexrab#{person_index}", "relat#{person_index}", "ecstat#{person_index}"].any? { |field| public_send(field).present? } || public_send("age#{person_index}_known") == 1 end def details_not_known_for_person?(person_index) @@ -911,6 +911,10 @@ private [sex1, sex2, sex3, sex4, sex5, sex6, sex7, sex8].any?("R") end + def sexrab_refused? + [sexrab1, sexrab2, sexrab3, sexrab4, sexrab5, sexrab6, sexrab7, sexrab8].any?("R") + end + def relat_refused? [relat2, relat3, relat4, relat5, relat6, relat7, relat8].any?("R") end diff --git a/app/services/bulk_upload/lettings/year2026/csv_parser.rb b/app/services/bulk_upload/lettings/year2026/csv_parser.rb index e8e91a6ca..643990c8b 100644 --- a/app/services/bulk_upload/lettings/year2026/csv_parser.rb +++ b/app/services/bulk_upload/lettings/year2026/csv_parser.rb @@ -4,7 +4,7 @@ class BulkUpload::Lettings::Year2026::CsvParser include CollectionTimeHelper # TODO: CLDC-4162: Update when 2026 format is known - FIELDS = 156 + FIELDS = 148 FORM_YEAR = 2026 attr_reader :path diff --git a/app/services/bulk_upload/lettings/year2026/row_parser.rb b/app/services/bulk_upload/lettings/year2026/row_parser.rb index 5930f75fd..b73bf792a 100644 --- a/app/services/bulk_upload/lettings/year2026/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2026/row_parser.rb @@ -47,37 +47,37 @@ class BulkUpload::Lettings::Year2026::RowParser field_40: "If 'Other', what is the type of tenancy?", field_41: "What is the length of the fixed-term tenancy to the nearest year?", field_42: "What is the lead tenant’s age?", - field_43: "Which of these best describes the lead tenant’s gender identity?", + field_43: "Lead tenant's sex, as registered at birth", field_44: "Which of these best describes the lead tenant’s ethnic background?", field_45: "What is the lead tenant’s nationality?", field_46: "Which of these best describes the lead tenant’s working situation?", field_47: "Is person 2 the partner of the lead tenant?", field_48: "What is person 2’s age?", - field_49: "Which of these best describes person 2’s gender identity?", + field_49: "Person 2's sex, as registered at birth", field_50: "Which of these best describes person 2’s working situation?", field_51: "Is person 3 the partner of the lead tenant?", field_52: "What is person 3’s age?", - field_53: "Which of these best describes person 3’s gender identity?", + field_53: "Person 3's sex, as registered at birth", field_54: "Which of these best describes person 3’s working situation?", field_55: "Is person 4 the partner of the lead tenant?", field_56: "What is person 4’s age?", - field_57: "Which of these best describes person 4’s gender identity?", + field_57: "Person 4's sex, as registered at birth", field_58: "Which of these best describes person 4’s working situation?", field_59: "Is person 5 the partner of the lead tenant?", field_60: "What is person 5’s age?", - field_61: "Which of these best describes person 5’s gender identity?", + field_61: "Person 5's sex, as registered at birth", field_62: "Which of these best describes person 5’s working situation?", field_63: "Is person 6 the partner of the lead tenant?", field_64: "What is person 6’s age?", - field_65: "Which of these best describes person 6’s gender identity?", + field_65: "Person 6's sex, as registered at birth", field_66: "Which of these best describes person 6’s working situation?", field_67: "Is person 7 the partner of the lead tenant?", field_68: "What is person 7’s age?", - field_69: "Which of these best describes person 7’s gender identity?", + field_69: "Person 7's sex, as registered at birth", field_70: "Which of these best describes person 7’s working situation?", field_71: "Is person 8 the partner of the lead tenant?", field_72: "What is person 8’s age?", - field_73: "Which of these best describes person 8’s gender identity?", + field_73: "Person 8's sex, as registered at birth", field_74: "Which of these best describes person 8’s working situation?", field_75: "Does anybody in the household have links to the UK armed forces?", field_76: "Is this person still serving in the UK armed forces?", @@ -135,34 +135,26 @@ class BulkUpload::Lettings::Year2026::RowParser field_128: "After the household has received any housing-related benefits, will they still need to pay for rent and charges?", field_129: "What do you expect the outstanding amount to be?", - field_130: "Lead tenant's sex, as registered at birth", - field_131: "Person 2's sex, as registered at birth", - field_132: "Person 3's sex, as registered at birth", - field_133: "Person 4's sex, as registered at birth", - field_134: "Person 5's sex, as registered at birth", - field_135: "Person 6's sex, as registered at birth", - field_136: "Person 7's sex, as registered at birth", - field_137: "Person 8's sex, as registered at birth", - field_138: "Is the gender the lead tenant identifies with the same as their sex registered at birth?", - field_139: "If 'No', enter the lead tenant's gender identity", - field_140: "Is the gender person 2 identifies with the same as their sex registered at birth?", - field_141: "If 'No', enter person 2's gender identity", - field_142: "Is the gender person 3 identifies with the same as their sex registered at birth?", - field_143: "If 'No', enter person 3's gender identity", - field_144: "Is the gender person 4 identifies with the same as their sex registered at birth?", - field_145: "If 'No', enter person 4's gender identity", - field_146: "Is the gender person 5 identifies with the same as their sex registered at birth?", - field_147: "If 'No', enter person 5's gender identity", - field_148: "Is the gender person 6 identifies with the same as their sex registered at birth?", - field_149: "If 'No', enter person 6's gender identity", - field_150: "Is the gender person 7 identifies with the same as their sex registered at birth?", - field_151: "If 'No', enter person 7's gender identity", - field_152: "Is the gender person 8 identifies with the same as their sex registered at birth?", - field_153: "If 'No', enter person 8's gender identity", - - field_154: "What was the source of referral for this letting? - PRP properties part 1", - field_155: "What was the source of referral for this letting? - PRP properties part 2", - field_156: "What was the source of referral for this letting? - PRP properties part 3", + field_130: "Is the gender the lead tenant identifies with the same as their sex registered at birth?", + field_131: "If 'No', enter the lead tenant's gender identity", + field_132: "Is the gender person 2 identifies with the same as their sex registered at birth?", + field_133: "If 'No', enter person 2's gender identity", + field_134: "Is the gender person 3 identifies with the same as their sex registered at birth?", + field_135: "If 'No', enter person 3's gender identity", + field_136: "Is the gender person 4 identifies with the same as their sex registered at birth?", + field_137: "If 'No', enter person 4's gender identity", + field_138: "Is the gender person 5 identifies with the same as their sex registered at birth?", + field_139: "If 'No', enter person 5's gender identity", + field_140: "Is the gender person 6 identifies with the same as their sex registered at birth?", + field_141: "If 'No', enter person 6's gender identity", + field_142: "Is the gender person 7 identifies with the same as their sex registered at birth?", + field_143: "If 'No', enter person 7's gender identity", + field_144: "Is the gender person 8 identifies with the same as their sex registered at birth?", + field_145: "If 'No', enter person 8's gender identity", + + field_146: "What was the source of referral for this letting? - PRP properties part 1", + field_147: "What was the source of referral for this letting? - PRP properties part 2", + field_148: "What was the source of referral for this letting? - PRP properties part 3", }.freeze RENT_TYPE_BU_MAPPING = { @@ -312,13 +304,13 @@ class BulkUpload::Lettings::Year2026::RowParser attribute :field_128, :integer attribute :field_129, :decimal - attribute :field_130, :string + attribute :field_130, :integer attribute :field_131, :string - attribute :field_132, :string + attribute :field_132, :integer attribute :field_133, :string - attribute :field_134, :string + attribute :field_134, :integer attribute :field_135, :string - attribute :field_136, :string + attribute :field_136, :integer attribute :field_137, :string attribute :field_138, :integer attribute :field_139, :string @@ -328,18 +320,10 @@ class BulkUpload::Lettings::Year2026::RowParser attribute :field_143, :string attribute :field_144, :integer attribute :field_145, :string + attribute :field_146, :integer - attribute :field_147, :string + attribute :field_147, :integer attribute :field_148, :integer - attribute :field_149, :string - attribute :field_150, :integer - attribute :field_151, :string - attribute :field_152, :integer - attribute :field_153, :string - - attribute :field_154, :integer - attribute :field_155, :integer - attribute :field_156, :integer validate :validate_valid_radio_option, on: :before_log @@ -597,8 +581,7 @@ class BulkUpload::Lettings::Year2026::RowParser !supported_housing? ? "field_23" : nil, # postcode # TODO: CLDC-4119: add postcode to hash for supported housing !supported_housing? ? "field_24" : nil, # postcode # TODO: CLDC-4119: add postcode to hash for supported housing "field_42", # age1 - "field_43", # sex1 - "field_130", # sexrab1 + "field_43", # sexrab1 "field_46", # ecstat1 ) if [field_124, field_125, field_126, field_127].all?(&:present?) @@ -748,7 +731,6 @@ private "startdate", "age1", "sexrab1", - "sex1", "ecstat1", "owning_organisation", "tcharge", @@ -1030,8 +1012,7 @@ private errors.add(:field_24, error_message) unless supported_housing? # postcode_full # TODO: CLDC-4119: add postcode to error fields for supported housing errors.add(:field_25, error_message) unless supported_housing? # la # TODO: CLDC-4119: add LA to error fields for supported housing errors.add(:field_42, error_message) # age1 - errors.add(:field_130, error_message) # sexrab1 - errors.add(:field_43, error_message) # sex1 + errors.add(:field_43, error_message) # sexrab1 errors.add(:field_46, error_message) # ecstat1 errors.add(:field_122, error_message) unless general_needs? # household_charge errors.add(:field_124, error_message) # brent @@ -1051,31 +1032,31 @@ private def field_referral_register_prp_valid? if owning_organisation&.prp? - [5, 6, 7, 8, 9].include?(field_154) + [5, 6, 7, 8, 9].include?(field_146) else - field_154.blank? + field_146.blank? end end def field_referral_noms_valid? - case field_154 + case field_146 when 6 - [1, 2, 3, 4].include?(field_155) + [1, 2, 3, 4].include?(field_147) when 7 - [5, 6, 7, 8].include?(field_155) + [5, 6, 7, 8].include?(field_147) else - field_155.blank? + field_147.blank? end end def field_referral_org_valid? - case field_155 + case field_147 when 1 - [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].include?(field_156) + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].include?(field_148) when 7 - [11, 12, 13, 14, 15, 16, 17, 18, 19, 20].include?(field_156) + [11, 12, 13, 14, 15, 16, 17, 18, 19, 20].include?(field_148) else - field_156.blank? + field_148.blank? end end @@ -1087,7 +1068,7 @@ private return if renewal? return if referral_fields_valid? - %i[field_116 field_154 field_155 field_156].each do |field| + %i[field_116 field_146 field_147 field_148].each do |field| errors.add(field, I18n.t("#{ERROR_BASE_KEY}.referral.invalid_option")) end end @@ -1140,14 +1121,14 @@ private age8_known: %i[field_72], age8: %i[field_72], - sex1: %i[field_43], - sex2: %i[field_49], - sex3: %i[field_53], - sex4: %i[field_57], - sex5: %i[field_61], - sex6: %i[field_65], - sex7: %i[field_69], - sex8: %i[field_73], + sexrab1: %i[field_43], + sexrab2: %i[field_49], + sexrab3: %i[field_53], + sexrab4: %i[field_57], + sexrab5: %i[field_61], + sexrab6: %i[field_65], + sexrab7: %i[field_69], + sexrab8: %i[field_73], ethnic_group: %i[field_44], ethnic: %i[field_44], @@ -1204,9 +1185,9 @@ private accessible_register: %i[field_115], letting_allocation: %i[field_112 field_113 field_114 field_115], - referral_register: %i[field_116 field_154], - referral_noms: %i[field_155], - referral_org: %i[field_156], + referral_register: %i[field_116 field_146], + referral_noms: %i[field_147], + referral_org: %i[field_148], net_income_known: %i[field_117], incfreq: %i[field_118], @@ -1255,30 +1236,22 @@ private county: [:field_22], uprn_selection: [:field_19], - sexrab1: %i[field_130], - sexrab2: %i[field_131], - sexrab3: %i[field_132], - sexrab4: %i[field_133], - sexrab5: %i[field_134], - sexrab6: %i[field_135], - sexrab7: %i[field_136], - sexrab8: %i[field_137], - gender_same_as_sex1: %i[field_138], - gender_same_as_sex2: %i[field_140], - gender_same_as_sex3: %i[field_142], - gender_same_as_sex4: %i[field_144], - gender_same_as_sex5: %i[field_146], - gender_same_as_sex6: %i[field_148], - gender_same_as_sex7: %i[field_150], - gender_same_as_sex8: %i[field_152], - gender_description1: %i[field_139], - gender_description2: %i[field_141], - gender_description3: %i[field_143], - gender_description4: %i[field_145], - gender_description5: %i[field_147], - gender_description6: %i[field_149], - gender_description7: %i[field_151], - gender_description8: %i[field_153], + gender_same_as_sex1: %i[field_130], + gender_same_as_sex2: %i[field_132], + gender_same_as_sex3: %i[field_134], + gender_same_as_sex4: %i[field_136], + gender_same_as_sex5: %i[field_138], + gender_same_as_sex6: %i[field_140], + gender_same_as_sex7: %i[field_142], + gender_same_as_sex8: %i[field_144], + gender_description1: %i[field_131], + gender_description2: %i[field_133], + gender_description3: %i[field_135], + gender_description4: %i[field_137], + gender_description5: %i[field_139], + gender_description6: %i[field_141], + gender_description7: %i[field_143], + gender_description8: %i[field_145], }.compact end @@ -1340,14 +1313,14 @@ private attributes["age8_known"] = age8_known? attributes["age8"] = field_72 if attributes["age8_known"]&.zero? && field_72&.match(/\A\d{1,3}\z|\AR\z/) - attributes["sex1"] = field_43 - attributes["sex2"] = field_49 - attributes["sex3"] = field_53 - attributes["sex4"] = field_57 - attributes["sex5"] = field_61 - attributes["sex6"] = field_65 - attributes["sex7"] = field_69 - attributes["sex8"] = field_73 + attributes["sexrab1"] = field_43 + attributes["sexrab2"] = field_49 + attributes["sexrab3"] = field_53 + attributes["sexrab4"] = field_57 + attributes["sexrab5"] = field_61 + attributes["sexrab6"] = field_65 + attributes["sexrab7"] = field_69 + attributes["sexrab8"] = field_73 attributes["ethnic_group"] = ethnic_group_from_ethnic attributes["ethnic"] = field_44 @@ -1486,30 +1459,22 @@ private attributes["postcode_full_input"] = postcode_full attributes["select_best_address_match"] = true if field_18.blank? - attributes["sexrab1"] = field_130 - attributes["sexrab2"] = field_131 - attributes["sexrab3"] = field_132 - attributes["sexrab4"] = field_133 - attributes["sexrab5"] = field_134 - attributes["sexrab6"] = field_135 - attributes["sexrab7"] = field_136 - attributes["sexrab8"] = field_137 - attributes["gender_same_as_sex1"] = field_138 - attributes["gender_description1"] = field_139 - attributes["gender_same_as_sex2"] = field_140 - attributes["gender_description2"] = field_141 - attributes["gender_same_as_sex3"] = field_142 - attributes["gender_description3"] = field_143 - attributes["gender_same_as_sex4"] = field_144 - attributes["gender_description4"] = field_145 - attributes["gender_same_as_sex5"] = field_146 - attributes["gender_description5"] = field_147 - attributes["gender_same_as_sex6"] = field_148 - attributes["gender_description6"] = field_149 - attributes["gender_same_as_sex7"] = field_150 - attributes["gender_description7"] = field_151 - attributes["gender_same_as_sex8"] = field_152 - attributes["gender_description8"] = field_153 + attributes["gender_same_as_sex1"] = field_130 + attributes["gender_description1"] = field_131 + attributes["gender_same_as_sex2"] = field_132 + attributes["gender_description2"] = field_133 + attributes["gender_same_as_sex3"] = field_134 + attributes["gender_description3"] = field_135 + attributes["gender_same_as_sex4"] = field_136 + attributes["gender_description4"] = field_137 + attributes["gender_same_as_sex5"] = field_138 + attributes["gender_description5"] = field_139 + attributes["gender_same_as_sex6"] = field_140 + attributes["gender_description6"] = field_141 + attributes["gender_same_as_sex7"] = field_142 + attributes["gender_description7"] = field_143 + attributes["gender_same_as_sex8"] = field_144 + attributes["gender_description8"] = field_145 attributes end @@ -1617,31 +1582,31 @@ private end def person_2_present? - field_47.present? || field_48.present? || field_49.present? || field_131.present? || field_140.present? || field_141.present? + field_47.present? || field_48.present? || field_49.present? || field_132.present? || field_133.present? end def person_3_present? - field_51.present? || field_52.present? || field_53.present? || field_132.present? || field_142.present? || field_143.present? + field_51.present? || field_52.present? || field_53.present? || field_134.present? || field_135.present? end def person_4_present? - field_55.present? || field_56.present? || field_57.present? || field_133.present? || field_144.present? || field_145.present? + field_55.present? || field_56.present? || field_57.present? || field_136.present? || field_137.present? end def person_5_present? - field_59.present? || field_60.present? || field_61.present? || field_134.present? || field_146.present? || field_147.present? + field_59.present? || field_60.present? || field_61.present? || field_138.present? || field_139.present? end def person_6_present? - field_63.present? || field_64.present? || field_65.present? || field_135.present? || field_148.present? || field_149.present? + field_63.present? || field_64.present? || field_65.present? || field_140.present? || field_141.present? end def person_7_present? - field_67.present? || field_68.present? || field_69.present? || field_136.present? || field_150.present? || field_151.present? + field_67.present? || field_68.present? || field_69.present? || field_142.present? || field_143.present? end def person_8_present? - field_71.present? || field_72.present? || field_73.present? || field_137.present? || field_152.present? || field_153.present? + field_71.present? || field_72.present? || field_73.present? || field_144.present? || field_145.present? end def leftreg @@ -1847,7 +1812,7 @@ private if owning_organisation.la? field_116 else - field_154 + field_146 end end @@ -1856,7 +1821,7 @@ private return unless referral_fields_valid? if owning_organisation.prp? - field_155 + field_147 end end @@ -1865,7 +1830,7 @@ private return unless referral_fields_valid? if owning_organisation.prp? - field_156 + field_148 end end end diff --git a/app/services/exports/lettings_log_export_constants.rb b/app/services/exports/lettings_log_export_constants.rb index 99f73d143..f4d426a35 100644 --- a/app/services/exports/lettings_log_export_constants.rb +++ b/app/services/exports/lettings_log_export_constants.rb @@ -140,7 +140,6 @@ module Exports::LettingsLogExportConstants (1..8).each do |index| ALL_YEAR_EXPORT_FIELDS << "age#{index}" ALL_YEAR_EXPORT_FIELDS << "ecstat#{index}" - ALL_YEAR_EXPORT_FIELDS << "sex#{index}" end (2..8).each do |index| ALL_YEAR_EXPORT_FIELDS << "relat#{index}" @@ -159,6 +158,9 @@ module Exports::LettingsLogExportConstants "offered", "referral", ] + (1..8).each do |index| + YEAR_2021_EXPORT_FIELDS << "sex#{index}" + end YEAR_2022_EXPORT_FIELDS = Set[ "builtype", @@ -167,6 +169,9 @@ module Exports::LettingsLogExportConstants "offered", "referral", ] + (1..8).each do |index| + YEAR_2022_EXPORT_FIELDS << "sex#{index}" + end YEAR_2023_EXPORT_FIELDS = Set[ "builtype", @@ -175,6 +180,9 @@ module Exports::LettingsLogExportConstants "offered", "referral", ] + (1..8).each do |index| + YEAR_2023_EXPORT_FIELDS << "sex#{index}" + end YEAR_2024_EXPORT_FIELDS = Set[ "builtype", @@ -196,6 +204,9 @@ module Exports::LettingsLogExportConstants "carehome_charges_value_check", "referral", ] + (1..8).each do |index| + YEAR_2024_EXPORT_FIELDS << "sex#{index}" + end YEAR_2025_EXPORT_FIELDS = Set[ "builtype", @@ -215,6 +226,9 @@ module Exports::LettingsLogExportConstants "supcharg_value_check", "referral", ] + (1..8).each do |index| + YEAR_2025_EXPORT_FIELDS << "sex#{index}" + end YEAR_2026_EXPORT_FIELDS = Set[ "accessible_register", @@ -235,7 +249,6 @@ module Exports::LettingsLogExportConstants "referral_noms", "referral_org", ] - (1..8).each do |index| YEAR_2026_EXPORT_FIELDS << "sexrab#{index}" YEAR_2026_EXPORT_FIELDS << "gender_same_as_sex#{index}" diff --git a/spec/fixtures/exports/general_needs_log_26_27.xml b/spec/fixtures/exports/general_needs_log_26_27.xml index d92f74f10..eecae061d 100644 --- a/spec/fixtures/exports/general_needs_log_26_27.xml +++ b/spec/fixtures/exports/general_needs_log_26_27.xml @@ -5,7 +5,6 @@ BZ737 35 F - F 1 2 @@ -14,43 +13,36 @@ 2 32 M - M 2 Non-binary 6 - - - - - - diff --git a/spec/fixtures/files/lettings_log_csv_export_codes_26.csv b/spec/fixtures/files/lettings_log_csv_export_codes_26.csv index 3634e6978..aacc8581d 100644 --- a/spec/fixtures/files/lettings_log_csv_export_codes_26.csv +++ b/spec/fixtures/files/lettings_log_csv_export_codes_26.csv @@ -1,3 +1,3 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is the UPRN known?,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter the lead tenant's gender identity",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?,The following soft validation was confirmed: You have said that at least one person's situation is 'Unable to work because of long-term sickness or disability'.,Are the details of tenant 2 known?,What is person 2's age?,What is person 2's relationship to the lead tenant?,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 was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",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 age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",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 age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",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 age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",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 age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter person 8's gender identity",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?,What was the source of referral for this letting?,What was the source of referral for this letting?,Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? -id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,uprn_known,uprn_selection,address_search_value_check,address_line1_input,postcode_full_input,address_line1_as_entered,address_line2_as_entered,town_or_city_as_entered,county_as_entered,postcode_full_as_entered,la_as_entered,unittype_gn,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sexrab1,gender_same_as_sex1,gender_description1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,working_situation_illness_check,details_known_2,age2,relat2,multiple_partners_value_check,sexrab2,gender_same_as_sex2,gender_description2,sex2,ecstat2,details_known_3,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,sex3,ecstat3,details_known_4,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,sex4,ecstat4,details_known_5,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,sex5,ecstat5,details_known_6,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,sex6,ecstat6,details_known_7,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,sex7,ecstat7,details_known_8,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,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_register,referral_noms,referral_org,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate -,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,1,2026,,MHCLG,MHCLG,1,7,0,2026-04-01,2,2,,,2,HIJKLMN,ABCDEFG,1,0,2,6,2,,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,7,1,3,2026-03-30,1,,1,2026-03-31,,,3,1,4,,2,4,,1,4,0,0,2,35,,F,1,,F,0,2,36,0,,0,32,P,,M,2,Non-binary,M,6,1,-9,R,R,3,,R,10,0,-9,R,R,3,,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,1,,,0,0,1,268,,6,1,1,,,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,,,,,,,,,,,,,,,,,,,, +Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is the UPRN known?,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter 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?,The following soft validation was confirmed: You have said that at least one person's situation is 'Unable to work because of long-term sickness or disability'.,Are the details of tenant 2 known?,What is person 2's age?,What is person 2's relationship to the lead tenant?,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 was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter 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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",Which of these best describes person 3's working situation?,Are the details of tenant 4 known?,What is person 4's age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",Which of these best describes person 4's working situation?,Are the details of tenant 5 known?,What is person 5's age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",Which of these best describes person 5's working situation?,Are the details of tenant 6 known?,What is person 6's age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",Which of these best describes person 6's working situation?,Are the details of tenant 7 known?,What is person 7's age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter 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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter 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?,What was the source of referral for this letting?,What was the source of referral for this letting?,Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? +id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,uprn_known,uprn_selection,address_search_value_check,address_line1_input,postcode_full_input,address_line1_as_entered,address_line2_as_entered,town_or_city_as_entered,county_as_entered,postcode_full_as_entered,la_as_entered,unittype_gn,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sexrab1,gender_same_as_sex1,gender_description1,ethnic_group,ethnic,nationality_all,ecstat1,working_situation_illness_check,details_known_2,age2,relat2,multiple_partners_value_check,sexrab2,gender_same_as_sex2,gender_description2,ecstat2,details_known_3,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,ecstat3,details_known_4,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,ecstat4,details_known_5,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,ecstat5,details_known_6,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,ecstat6,details_known_7,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,ecstat7,details_known_8,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,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_register,referral_noms,referral_org,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate +,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,1,2026,,MHCLG,MHCLG,1,7,0,2026-04-01,2,2,,,2,HIJKLMN,ABCDEFG,1,0,2,6,2,,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,7,1,3,2026-03-30,1,,1,2026-03-31,,,3,1,4,,2,4,,1,4,0,0,2,35,,F,1,,0,2,36,0,,0,32,P,,M,2,Non-binary,6,1,-9,R,R,3,,10,0,-9,R,R,3,,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,1,,,0,0,1,268,,6,1,1,,,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_26.csv b/spec/fixtures/files/lettings_log_csv_export_labels_26.csv index 7e8c7ec08..5a24e5c31 100644 --- a/spec/fixtures/files/lettings_log_csv_export_labels_26.csv +++ b/spec/fixtures/files/lettings_log_csv_export_labels_26.csv @@ -1,3 +1,3 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is the UPRN known?,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter the lead tenant's gender identity",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?,The following soft validation was confirmed: You have said that at least one person's situation is 'Unable to work because of long-term sickness or disability'.,Are the details of tenant 2 known?,What is person 2's age?,What is person 2's relationship to the lead tenant?,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 was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",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 age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",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 age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",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 age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",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 age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter person 8's gender identity",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?,What was the source of referral for this letting?,What was the source of referral for this letting?,Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? -id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,uprn_known,uprn_selection,address_search_value_check,address_line1_input,postcode_full_input,address_line1_as_entered,address_line2_as_entered,town_or_city_as_entered,county_as_entered,postcode_full_as_entered,la_as_entered,unittype_gn,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sexrab1,gender_same_as_sex1,gender_description1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,working_situation_illness_check,details_known_2,age2,relat2,multiple_partners_value_check,sexrab2,gender_same_as_sex2,gender_description2,sex2,ecstat2,details_known_3,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,sex3,ecstat3,details_known_4,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,sex4,ecstat4,details_known_5,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,sex5,ecstat5,details_known_6,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,sex6,ecstat6,details_known_7,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,sex7,ecstat7,details_known_8,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,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_register,referral_noms,referral_org,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate -,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,single log,2026,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2026-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,Affordable rent basis,Tenant abandoned property,No,,Address line 1,,London,,NW9 5LL,No,Barnet,E09000003,No,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,House,Yes,3,2026-03-30,1,,Yes,2026-03-31,,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,4,,Yes,4,0,0,2,35,,Female,Yes,,Female,White,Irish,Australia,Other,,Yes,32,Yes,,Male,"No, enter gender identity",Non-binary,Male,Not seeking work,No,Not known,Prefers not to say,Prefers not to say,Prefers not to say,,Prefers not to say,Prefers not to say,Yes,Not known,Tenant prefers not to say,Prefers not to say,Prefers not to say,,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,Renewal to the same tenant in the same property,,,Yes,No,Weekly,268,,Universal Credit housing element,Yes,All,,,Every 2 weeks,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,Yes,Yes,12.0,6.0,,,,,,,,,,,,,,,,,,,, +Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is the UPRN known?,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter 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?,The following soft validation was confirmed: You have said that at least one person's situation is 'Unable to work because of long-term sickness or disability'.,Are the details of tenant 2 known?,What is person 2's age?,What is person 2's relationship to the lead tenant?,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 was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter 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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",Which of these best describes person 3's working situation?,Are the details of tenant 4 known?,What is person 4's age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",Which of these best describes person 4's working situation?,Are the details of tenant 5 known?,What is person 5's age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",Which of these best describes person 5's working situation?,Are the details of tenant 6 known?,What is person 6's age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",Which of these best describes person 6's working situation?,Are the details of tenant 7 known?,What is person 7's age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter 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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter 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?,What was the source of referral for this letting?,What was the source of referral for this letting?,Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? +id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,uprn_known,uprn_selection,address_search_value_check,address_line1_input,postcode_full_input,address_line1_as_entered,address_line2_as_entered,town_or_city_as_entered,county_as_entered,postcode_full_as_entered,la_as_entered,unittype_gn,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sexrab1,gender_same_as_sex1,gender_description1,ethnic_group,ethnic,nationality_all,ecstat1,working_situation_illness_check,details_known_2,age2,relat2,multiple_partners_value_check,sexrab2,gender_same_as_sex2,gender_description2,ecstat2,details_known_3,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,ecstat3,details_known_4,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,ecstat4,details_known_5,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,ecstat5,details_known_6,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,ecstat6,details_known_7,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,ecstat7,details_known_8,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,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_register,referral_noms,referral_org,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate +,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,single log,2026,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2026-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,Affordable rent basis,Tenant abandoned property,No,,Address line 1,,London,,NW9 5LL,No,Barnet,E09000003,No,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,House,Yes,3,2026-03-30,1,,Yes,2026-03-31,,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,4,,Yes,4,0,0,2,35,,Female,Yes,,White,Irish,Australia,Other,,Yes,32,Yes,,Male,"No, enter gender identity",Non-binary,Not seeking work,No,Not known,Prefers not to say,Prefers not to say,Prefers not to say,,Prefers not to say,Yes,Not known,Tenant prefers not to say,Prefers not to say,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,Renewal to the same tenant in the same property,,,Yes,No,Weekly,268,,Universal Credit housing element,Yes,All,,,Every 2 weeks,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,Yes,Yes,12.0,6.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_non_support_codes_26.csv b/spec/fixtures/files/lettings_log_csv_export_non_support_codes_26.csv index 53263b201..558e6ac84 100644 --- a/spec/fixtures/files/lettings_log_csv_export_non_support_codes_26.csv +++ b/spec/fixtures/files/lettings_log_csv_export_non_support_codes_26.csv @@ -1,3 +1,3 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,Is the UPRN known?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,What is the property's local authority?,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8",What is the lead tenant's age?,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter the lead tenant's gender identity",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 age?,What is person 2's relationship to the lead tenant?,What was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",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 age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",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 age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",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 age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",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 age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter person 8's gender identity",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?,What was the source of referral for this letting?,What was the source of referral for this letting?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge to the tenant,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Estimated outstanding amount,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? -id,status,duplicate_set_id,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn_known,uprn,address_line1,address_line2,town_or_city,county,postcode_full,la_label,unittype_gn,wchair,beds,voiddate,vacdays,majorrepairs,mrcdate,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,refused,age1,sexrab1,gender_same_as_sex1,gender_description1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,age2,relat2,sexrab2,gender_same_as_sex2,gender_description2,sex2,ecstat2,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,sex3,ecstat3,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,sex4,ecstat4,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,sex5,ecstat5,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,sex6,ecstat6,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,sex7,ecstat7,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,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_register,referral_noms,referral_org,incref,incfreq,earnings,hb,has_benefits,benefits,household_charge,nocharge,period,brent,scharge,pscharge,supcharg,tcharge,hbrentshortfall,tshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate -,in_progress,,choreographer@owtluk.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,1,2026,,MHCLG,MHCLG,1,7,0,2026-04-01,2,2,,,2,HIJKLMN,ABCDEFG,1,0,2,6,2,0,,Address line 1,,London,,NW9 5LL,Barnet,7,1,3,2026-03-30,1,1,2026-03-31,,3,1,4,,2,4,1,35,F,1,,F,0,2,36,0,32,P,M,2,Non-binary,M,6,-9,R,R,3,,R,10,-9,R,R,3,,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,1,,,0,1,268,6,1,1,,,2,200.0,50.0,40.0,35.0,325.0,1,12.0,,,,,,,,,,,,,,,,,,,, +Log ID,Status of log,ID of a set of duplicate logs,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,Is the UPRN known?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,What is the property's local authority?,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8",What is the lead tenant's age?,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter 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 age?,What is person 2's relationship to the lead tenant?,What was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",Which of these best describes person 2's working situation?,What is person 3's age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",Which of these best describes person 3's working situation?,What is person 4's age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",Which of these best describes person 4's working situation?,What is person 5's age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",Which of these best describes person 5's working situation?,What is person 6's age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",Which of these best describes person 6's working situation?,What is person 7's age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",Which of these best describes person 7's working situation?,What is person 8's age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter 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?,What was the source of referral for this letting?,What was the source of referral for this letting?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge to the tenant,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Estimated outstanding amount,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? +id,status,duplicate_set_id,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn_known,uprn,address_line1,address_line2,town_or_city,county,postcode_full,la_label,unittype_gn,wchair,beds,voiddate,vacdays,majorrepairs,mrcdate,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,refused,age1,sexrab1,gender_same_as_sex1,gender_description1,ethnic_group,ethnic,nationality_all,ecstat1,age2,relat2,sexrab2,gender_same_as_sex2,gender_description2,ecstat2,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,ecstat3,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,ecstat4,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,ecstat5,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,ecstat6,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,ecstat7,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,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_register,referral_noms,referral_org,incref,incfreq,earnings,hb,has_benefits,benefits,household_charge,nocharge,period,brent,scharge,pscharge,supcharg,tcharge,hbrentshortfall,tshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate +,in_progress,,choreographer@owtluk.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,1,2026,,MHCLG,MHCLG,1,7,0,2026-04-01,2,2,,,2,HIJKLMN,ABCDEFG,1,0,2,6,2,0,,Address line 1,,London,,NW9 5LL,Barnet,7,1,3,2026-03-30,1,1,2026-03-31,,3,1,4,,2,4,1,35,F,1,,0,2,36,0,32,P,M,2,Non-binary,6,-9,R,R,3,,10,-9,R,R,3,,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,1,,,0,1,268,6,1,1,,,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_26.csv b/spec/fixtures/files/lettings_log_csv_export_non_support_labels_26.csv index b012865a3..6cf8b42f7 100644 --- a/spec/fixtures/files/lettings_log_csv_export_non_support_labels_26.csv +++ b/spec/fixtures/files/lettings_log_csv_export_non_support_labels_26.csv @@ -1,3 +1,3 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,Is the UPRN known?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,What is the property's local authority?,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8",What is the lead tenant's age?,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter the lead tenant's gender identity",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 age?,What is person 2's relationship to the lead tenant?,What was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",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 age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",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 age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",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 age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",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 age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter person 8's gender identity",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?,What was the source of referral for this letting?,What was the source of referral for this letting?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge to the tenant,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Estimated outstanding amount,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? -id,status,duplicate_set_id,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn_known,uprn,address_line1,address_line2,town_or_city,county,postcode_full,la_label,unittype_gn,wchair,beds,voiddate,vacdays,majorrepairs,mrcdate,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,refused,age1,sexrab1,gender_same_as_sex1,gender_description1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,age2,relat2,sexrab2,gender_same_as_sex2,gender_description2,sex2,ecstat2,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,sex3,ecstat3,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,sex4,ecstat4,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,sex5,ecstat5,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,sex6,ecstat6,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,sex7,ecstat7,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,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_register,referral_noms,referral_org,incref,incfreq,earnings,hb,has_benefits,benefits,household_charge,nocharge,period,brent,scharge,pscharge,supcharg,tcharge,hbrentshortfall,tshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate -,in_progress,,choreographer@owtluk.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,single log,2026,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2026-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,Affordable rent basis,Tenant abandoned property,No,No,,Address line 1,,London,,NW9 5LL,Barnet,House,Yes,3,2026-03-30,1,Yes,2026-03-31,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,4,Yes,35,Female,Yes,,Female,White,Irish,Australia,Other,32,Yes,Male,"No, enter gender identity",Non-binary,Male,Not seeking work,Not known,Prefers not to say,Prefers not to say,Prefers not to say,,Prefers not to say,Prefers not to say,Not known,Tenant prefers not to say,Prefers not to say,Prefers not to say,,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,Renewal to the same tenant in the same property,,,No,Weekly,268,Universal Credit housing element,Yes,All,,,Every 2 weeks,200.0,50.0,40.0,35.0,325.0,Yes,12.0,,,,,,,,,,,,,,,,,,,, +Log ID,Status of log,ID of a set of duplicate logs,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,Is the UPRN known?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,What is the property's local authority?,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8",What is the lead tenant's age?,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter 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 age?,What is person 2's relationship to the lead tenant?,What was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",Which of these best describes person 2's working situation?,What is person 3's age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",Which of these best describes person 3's working situation?,What is person 4's age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",Which of these best describes person 4's working situation?,What is person 5's age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",Which of these best describes person 5's working situation?,What is person 6's age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",Which of these best describes person 6's working situation?,What is person 7's age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",Which of these best describes person 7's working situation?,What is person 8's age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter 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?,What was the source of referral for this letting?,What was the source of referral for this letting?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge to the tenant,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Estimated outstanding amount,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? +id,status,duplicate_set_id,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn_known,uprn,address_line1,address_line2,town_or_city,county,postcode_full,la_label,unittype_gn,wchair,beds,voiddate,vacdays,majorrepairs,mrcdate,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,refused,age1,sexrab1,gender_same_as_sex1,gender_description1,ethnic_group,ethnic,nationality_all,ecstat1,age2,relat2,sexrab2,gender_same_as_sex2,gender_description2,ecstat2,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,ecstat3,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,ecstat4,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,ecstat5,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,ecstat6,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,ecstat7,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,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_register,referral_noms,referral_org,incref,incfreq,earnings,hb,has_benefits,benefits,household_charge,nocharge,period,brent,scharge,pscharge,supcharg,tcharge,hbrentshortfall,tshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate +,in_progress,,choreographer@owtluk.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,single log,2026,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2026-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,Affordable rent basis,Tenant abandoned property,No,No,,Address line 1,,London,,NW9 5LL,Barnet,House,Yes,3,2026-03-30,1,Yes,2026-03-31,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,4,Yes,35,Female,Yes,,White,Irish,Australia,Other,32,Yes,Male,"No, enter gender identity",Non-binary,Not seeking work,Not known,Prefers not to say,Prefers not to say,Prefers not to say,,Prefers not to say,Not known,Tenant prefers not to say,Prefers not to say,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,Renewal to the same tenant in the same property,,,No,Weekly,268,Universal Credit housing element,Yes,All,,,Every 2 weeks,200.0,50.0,40.0,35.0,325.0,Yes,12.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/models/form/lettings/subsections/household_characteristics_spec.rb b/spec/models/form/lettings/subsections/household_characteristics_spec.rb index c33d271c5..e403749ec 100644 --- a/spec/models/form/lettings/subsections/household_characteristics_spec.rb +++ b/spec/models/form/lettings/subsections/household_characteristics_spec.rb @@ -346,7 +346,6 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod age_lead_tenant_over_retirement_value_check lead_tenant_sex_registered_at_birth lead_tenant_gender_same_as_sex - lead_tenant_gender_identity no_household_member_likely_to_be_pregnant_lead_check gender_lead_tenant_over_retirement_value_check lead_tenant_ethnic_group @@ -369,7 +368,6 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod age_2_over_retirement_value_check person_2_sex_registered_at_birth person_2_gender_same_as_sex - person_2_gender_identity no_household_member_likely_to_be_pregnant_person_2_check gender_2_over_retirement_value_check person_2_working_situation @@ -385,7 +383,6 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod age_3_over_retirement_value_check person_3_sex_registered_at_birth person_3_gender_same_as_sex - person_3_gender_identity no_household_member_likely_to_be_pregnant_person_3_check gender_3_over_retirement_value_check person_3_working_situation @@ -401,7 +398,6 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod age_4_over_retirement_value_check person_4_sex_registered_at_birth person_4_gender_same_as_sex - person_4_gender_identity no_household_member_likely_to_be_pregnant_person_4_check gender_4_over_retirement_value_check person_4_working_situation @@ -417,7 +413,6 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod age_5_over_retirement_value_check person_5_sex_registered_at_birth person_5_gender_same_as_sex - person_5_gender_identity no_household_member_likely_to_be_pregnant_person_5_check gender_5_over_retirement_value_check person_5_working_situation @@ -433,7 +428,6 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod age_6_over_retirement_value_check person_6_sex_registered_at_birth person_6_gender_same_as_sex - person_6_gender_identity no_household_member_likely_to_be_pregnant_person_6_check gender_6_over_retirement_value_check person_6_working_situation @@ -449,7 +443,6 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod age_7_over_retirement_value_check person_7_sex_registered_at_birth person_7_gender_same_as_sex - person_7_gender_identity no_household_member_likely_to_be_pregnant_person_7_check gender_7_over_retirement_value_check person_7_working_situation @@ -465,7 +458,6 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod age_8_over_retirement_value_check person_8_sex_registered_at_birth person_8_gender_same_as_sex - person_8_gender_identity no_household_member_likely_to_be_pregnant_person_8_check gender_8_over_retirement_value_check person_8_working_situation diff --git a/spec/services/bulk_upload/lettings/validator_spec.rb b/spec/services/bulk_upload/lettings/validator_spec.rb index ce5b854fc..58f820440 100644 --- a/spec/services/bulk_upload/lettings/validator_spec.rb +++ b/spec/services/bulk_upload/lettings/validator_spec.rb @@ -190,8 +190,8 @@ RSpec.describe BulkUpload::Lettings::Validator do expect(error.tenant_code).to eql(log.tenancycode) expect(error.property_ref).to eql(log.propcode) expect(error.row).to eql("2") - expect(error.cell).to eql("EH2") # this may change when adding a new field as the cols are in a random order - expect(error.col).to eql("EH") # this may change when adding a new field as the cols are in a random order + expect(error.cell).to eql("EB2") # this may change when adding a new field as the cols are in a random order + expect(error.col).to eql("EB") # this may change when adding a new field as the cols are in a random order end end end diff --git a/spec/services/bulk_upload/lettings/year2026/csv_parser_spec.rb b/spec/services/bulk_upload/lettings/year2026/csv_parser_spec.rb index dc1b6e2d9..14d2ede4b 100644 --- a/spec/services/bulk_upload/lettings/year2026/csv_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2026/csv_parser_spec.rb @@ -244,10 +244,10 @@ RSpec.describe BulkUpload::Lettings::Year2026::CsvParser do end it "returns correct column" do - expect(service.column_for_field("field_5")).to eql("AI") - expect(service.column_for_field("field_22")).to eql("BR") - expect(service.column_for_field("field_26")).to eql("CG") - expect(service.column_for_field("field_25")).to eql("E") + expect(service.column_for_field("field_5")).to eql("AA") + expect(service.column_for_field("field_22")).to eql("BK") + expect(service.column_for_field("field_26")).to eql("BZ") + expect(service.column_for_field("field_25")).to eql("S") end end end diff --git a/spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb index 23c0d3c57..b58283729 100644 --- a/spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb @@ -249,30 +249,22 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do field_18: "12", - field_130: "F", - field_131: "M", - field_132: "R", - field_133: "F", - field_134: "M", - field_135: "R", - field_136: "F", - field_137: "M", - field_138: "1", - field_139: "", - field_140: "2", - field_141: "identity", - field_142: "3", + field_130: "1", + field_131: "", + field_132: "2", + field_133: "identity", + field_134: "3", + field_135: "", + field_136: "1", + field_137: "", + field_138: "2", + field_139: "identity", + field_140: "3", + field_141: "", + field_142: "1", field_143: "", - field_144: "1", - field_145: "", - field_146: "2", - field_147: "identity", - field_148: "3", - field_149: "", - field_150: "1", - field_151: "", - field_152: "2", - field_153: "identity", + field_144: "2", + field_145: "identity", } end @@ -323,7 +315,7 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do :field_24, # postcode_full :field_25, # LA :field_42, # age1 - :field_43, # sex1 + :field_43, # sexrab1 :field_46, # ecstat1 :field_124, # brent :field_125, # scharge @@ -377,7 +369,7 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do :field_13, # tenancycode :field_6, # location :field_42, # age1 - :field_43, # sex1 + :field_43, # sexrab1 :field_46, # ecstat1 :field_124, # brent :field_125, # scharge @@ -419,7 +411,7 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do :field_13, # tenancycode :field_6, # location :field_42, # age1 - :field_43, # sex1 + :field_43, # sexrab1 :field_46, # ecstat1 :field_124, # brent :field_125, # scharge @@ -462,7 +454,7 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do :field_13, # tenancycode :field_6, # location :field_42, # age1 - :field_43, # sex1 + :field_43, # sexrab1 :field_46, # ecstat1 ].each do |field| expect(parser.errors[field]).to include(error_message) @@ -508,7 +500,7 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do :field_13, # tenancycode :field_6, # location :field_42, # age1 - :field_43, # sex1 + :field_43, # sexrab1 :field_46, # ecstat1 :field_122, # household_charge ].each do |field| @@ -562,7 +554,7 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do :field_24, # postcode_full :field_25, # LA :field_42, # age1 - :field_43, # sex1 + :field_43, # sexrab1 :field_46, # ecstat1 ].each do |field| expect(parser.errors[field]).to be_blank @@ -634,7 +626,7 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do it "fetches the question's check_answer_label if it exists" do parser.valid? - expect(parser.errors[:field_43]).to eql([I18n.t("validations.lettings.2026.bulk_upload.not_answered", question: "lead tenant’s gender identity.")]) + expect(parser.errors[:field_43]).to eql([I18n.t("validations.lettings.2026.bulk_upload.not_answered", question: "lead tenant’s sex registered at birth.")]) end end @@ -1160,7 +1152,7 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do end end - describe "#field_116, field_154, field_155, field_156" do # referral + describe "#field_116, field_146, field_147, field_148" do # referral context "when org is LA" do let(:owning_org) { create(:organisation, :la, :with_old_visible_id) } @@ -1175,9 +1167,9 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do it "does not add an error" do parser.valid? expect(parser.errors[:field_116]).to be_blank - expect(parser.errors[:field_154]).to be_blank - expect(parser.errors[:field_155]).to be_blank - expect(parser.errors[:field_156]).to be_blank + expect(parser.errors[:field_146]).to be_blank + expect(parser.errors[:field_147]).to be_blank + expect(parser.errors[:field_148]).to be_blank end end @@ -1187,9 +1179,9 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do it "adds errors to all referral fields" do parser.valid? expect(parser.errors[:field_116]).to be_present - expect(parser.errors[:field_154]).to be_present - expect(parser.errors[:field_155]).to be_present - expect(parser.errors[:field_156]).to be_present + expect(parser.errors[:field_146]).to be_present + expect(parser.errors[:field_147]).to be_present + expect(parser.errors[:field_148]).to be_present end end @@ -1199,34 +1191,34 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do it "adds errors to all referral fields" do parser.valid? expect(parser.errors[:field_116]).to be_present - expect(parser.errors[:field_154]).to be_present - expect(parser.errors[:field_155]).to be_present - expect(parser.errors[:field_156]).to be_present + expect(parser.errors[:field_146]).to be_present + expect(parser.errors[:field_147]).to be_present + expect(parser.errors[:field_148]).to be_present end end context "and other fields are given" do - let(:attributes) { renewal_attributes.merge({ field_116: 1, field_154: 5, field_155: 1, field_152: 1 }) } + let(:attributes) { renewal_attributes.merge({ field_116: 1, field_146: 5, field_147: 1, field_144: 1 }) } it "adds errors to all referral fields" do parser.valid? expect(parser.errors[:field_116]).to be_present - expect(parser.errors[:field_154]).to be_present - expect(parser.errors[:field_155]).to be_present - expect(parser.errors[:field_156]).to be_present + expect(parser.errors[:field_146]).to be_present + expect(parser.errors[:field_147]).to be_present + expect(parser.errors[:field_148]).to be_present end end end context "and is renewal" do - let(:attributes) { org_attributes.merge({ field_7: 1, field_116: 1, field_154: 5, field_155: 1, field_156: 1 }) } + let(:attributes) { org_attributes.merge({ field_7: 1, field_116: 1, field_146: 5, field_147: 1, field_148: 1 }) } it "does not add an error for referral fields" do parser.valid? expect(parser.errors[:field_116]).to be_blank - expect(parser.errors[:field_154]).to be_blank - expect(parser.errors[:field_155]).to be_blank - expect(parser.errors[:field_156]).to be_blank + expect(parser.errors[:field_146]).to be_blank + expect(parser.errors[:field_147]).to be_blank + expect(parser.errors[:field_148]).to be_blank end end end @@ -1239,141 +1231,141 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do context "and not renewal" do let(:renewal_attributes) { org_attributes.merge({ field_7: nil }) } - context "and field_154 is valid and does not expect an answer for field_155" do - let(:attributes) { renewal_attributes.merge({ field_154: 5 }) } + context "and field_146 is valid and does not expect an answer for field_147" do + let(:attributes) { renewal_attributes.merge({ field_146: 5 }) } it "does not add an error" do parser.valid? expect(parser.errors[:field_116]).to be_blank - expect(parser.errors[:field_154]).to be_blank - expect(parser.errors[:field_155]).to be_blank - expect(parser.errors[:field_156]).to be_blank + expect(parser.errors[:field_146]).to be_blank + expect(parser.errors[:field_147]).to be_blank + expect(parser.errors[:field_148]).to be_blank end context "and later fields are given" do - let(:attributes) { renewal_attributes.merge({ field_154: 5, field_155: 1, field_156: 1 }) } + let(:attributes) { renewal_attributes.merge({ field_146: 5, field_147: 1, field_148: 1 }) } it "adds errors to all referral fields" do parser.valid? expect(parser.errors[:field_116]).to be_present - expect(parser.errors[:field_154]).to be_present - expect(parser.errors[:field_155]).to be_present - expect(parser.errors[:field_156]).to be_present + expect(parser.errors[:field_146]).to be_present + expect(parser.errors[:field_147]).to be_present + expect(parser.errors[:field_148]).to be_present end end end - context "and field_154 is invalid" do - let(:attributes) { renewal_attributes.merge({ field_154: 1 }) } # LA option + context "and field_146 is invalid" do + let(:attributes) { renewal_attributes.merge({ field_146: 1 }) } # LA option it "adds errors to all referral fields" do parser.valid? expect(parser.errors[:field_116]).to be_present - expect(parser.errors[:field_154]).to be_present - expect(parser.errors[:field_155]).to be_present - expect(parser.errors[:field_156]).to be_present + expect(parser.errors[:field_146]).to be_present + expect(parser.errors[:field_147]).to be_present + expect(parser.errors[:field_148]).to be_present end end - context "and field_154 is blank" do - let(:attributes) { renewal_attributes.merge({ field_154: nil }) } + context "and field_146 is blank" do + let(:attributes) { renewal_attributes.merge({ field_146: nil }) } it "adds errors to all referral fields" do parser.valid? expect(parser.errors[:field_116]).to be_present - expect(parser.errors[:field_154]).to be_present - expect(parser.errors[:field_155]).to be_present - expect(parser.errors[:field_156]).to be_present + expect(parser.errors[:field_146]).to be_present + expect(parser.errors[:field_147]).to be_present + expect(parser.errors[:field_148]).to be_present end end - context "and field_154 is valid and expects an answer for field_155" do - let(:field_154_attributes) { renewal_attributes.merge({ field_154: 6 }) } + context "and field_146 is valid and expects an answer for field_147" do + let(:field_146_attributes) { renewal_attributes.merge({ field_146: 6 }) } - context "and field_155 is valid and does not expect an answer for field_156" do - let(:attributes) { field_154_attributes.merge({ field_155: 2 }) } + context "and field_147 is valid and does not expect an answer for field_148" do + let(:attributes) { field_146_attributes.merge({ field_147: 2 }) } it "does not add an error" do parser.valid? expect(parser.errors[:field_116]).to be_blank - expect(parser.errors[:field_154]).to be_blank - expect(parser.errors[:field_155]).to be_blank - expect(parser.errors[:field_156]).to be_blank + expect(parser.errors[:field_146]).to be_blank + expect(parser.errors[:field_147]).to be_blank + expect(parser.errors[:field_148]).to be_blank end context "and later fields are given" do - let(:attributes) { field_154_attributes.merge({ field_155: 2, field_156: 1 }) } + let(:attributes) { field_146_attributes.merge({ field_147: 2, field_148: 1 }) } it "adds errors to all referral fields" do parser.valid? expect(parser.errors[:field_116]).to be_present - expect(parser.errors[:field_154]).to be_present - expect(parser.errors[:field_155]).to be_present - expect(parser.errors[:field_156]).to be_present + expect(parser.errors[:field_146]).to be_present + expect(parser.errors[:field_147]).to be_present + expect(parser.errors[:field_148]).to be_present end end end - context "and field_155 is invalid" do - let(:attributes) { field_154_attributes.merge({ field_155: 5 }) } # needs field_154 to be 7 + context "and field_147 is invalid" do + let(:attributes) { field_146_attributes.merge({ field_147: 5 }) } # needs field_146 to be 7 it "adds errors to all referral fields" do parser.valid? expect(parser.errors[:field_116]).to be_present - expect(parser.errors[:field_154]).to be_present - expect(parser.errors[:field_155]).to be_present - expect(parser.errors[:field_156]).to be_present + expect(parser.errors[:field_146]).to be_present + expect(parser.errors[:field_147]).to be_present + expect(parser.errors[:field_148]).to be_present end end - context "and field_155 is blank" do - let(:attributes) { field_154_attributes.merge({ field_155: nil }) } + context "and field_147 is blank" do + let(:attributes) { field_146_attributes.merge({ field_147: nil }) } it "adds errors to all referral fields" do parser.valid? expect(parser.errors[:field_116]).to be_present - expect(parser.errors[:field_154]).to be_present - expect(parser.errors[:field_155]).to be_present - expect(parser.errors[:field_156]).to be_present + expect(parser.errors[:field_146]).to be_present + expect(parser.errors[:field_147]).to be_present + expect(parser.errors[:field_148]).to be_present end end - context "and field_155 is valid and expects an answer for field_156" do - let(:field_155_attributes) { field_154_attributes.merge({ field_155: 1 }) } + context "and field_147 is valid and expects an answer for field_148" do + let(:field_147_attributes) { field_146_attributes.merge({ field_147: 1 }) } - context "and field_156 is valid" do - let(:attributes) { field_155_attributes.merge({ field_156: 1 }) } + context "and field_148 is valid" do + let(:attributes) { field_147_attributes.merge({ field_148: 1 }) } it "does not add an error" do parser.valid? expect(parser.errors[:field_116]).to be_blank - expect(parser.errors[:field_154]).to be_blank - expect(parser.errors[:field_155]).to be_blank - expect(parser.errors[:field_156]).to be_blank + expect(parser.errors[:field_146]).to be_blank + expect(parser.errors[:field_147]).to be_blank + expect(parser.errors[:field_148]).to be_blank end end - context "and field_156 is invalid" do - let(:attributes) { field_155_attributes.merge({ field_156: 11 }) } # needs field_155 to be 7 + context "and field_148 is invalid" do + let(:attributes) { field_147_attributes.merge({ field_148: 11 }) } # needs field_147 to be 7 it "adds errors to all referral fields" do parser.valid? expect(parser.errors[:field_116]).to be_present - expect(parser.errors[:field_154]).to be_present - expect(parser.errors[:field_155]).to be_present - expect(parser.errors[:field_156]).to be_present + expect(parser.errors[:field_146]).to be_present + expect(parser.errors[:field_147]).to be_present + expect(parser.errors[:field_148]).to be_present end end - context "and field_156 is blank" do - let(:attributes) { field_155_attributes.merge({ field_156: nil }) } + context "and field_148 is blank" do + let(:attributes) { field_147_attributes.merge({ field_148: nil }) } it "adds errors to all referral fields" do parser.valid? expect(parser.errors[:field_116]).to be_present - expect(parser.errors[:field_154]).to be_present - expect(parser.errors[:field_155]).to be_present - expect(parser.errors[:field_156]).to be_present + expect(parser.errors[:field_146]).to be_present + expect(parser.errors[:field_147]).to be_present + expect(parser.errors[:field_148]).to be_present end end end @@ -1381,14 +1373,14 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do end context "and is renewal" do - let(:attributes) { org_attributes.merge({ field_7: 1, field_116: 1, field_154: 5, field_155: 1, field_156: 1 }) } + let(:attributes) { org_attributes.merge({ field_7: 1, field_116: 1, field_146: 5, field_147: 1, field_148: 1 }) } it "does not add an error for referral fields" do parser.valid? expect(parser.errors[:field_116]).to be_blank - expect(parser.errors[:field_154]).to be_blank - expect(parser.errors[:field_155]).to be_blank - expect(parser.errors[:field_156]).to be_blank + expect(parser.errors[:field_146]).to be_blank + expect(parser.errors[:field_147]).to be_blank + expect(parser.errors[:field_148]).to be_blank end end end @@ -2084,22 +2076,22 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do end context "when a soft validation is triggered that relates both to fields that are and are not routed to" do - let(:attributes) { setup_section_params.merge({ field_78: "1", field_130: "M", field_131: "M", field_132: "M", field_138: 1, field_140: 1, field_142: 1 }) } + let(:attributes) { setup_section_params.merge({ field_78: "1", field_43: "M", field_49: "M", field_53: "M", field_130: 1, field_132: 1, field_134: 1 }) } it "adds errors to fields that are routed to" do parser.valid? + expect(parser.errors.where(:field_43, category: :soft_validation)).to be_present expect(parser.errors.where(:field_130, category: :soft_validation)).to be_present - expect(parser.errors.where(:field_138, category: :soft_validation)).to be_present - expect(parser.errors.where(:field_131, category: :soft_validation)).to be_present - expect(parser.errors.where(:field_140, category: :soft_validation)).to be_present + expect(parser.errors.where(:field_49, category: :soft_validation)).to be_present + expect(parser.errors.where(:field_132, category: :soft_validation)).to be_present end it "does not add errors to fields that are not routed to" do parser.valid? - expect(parser.errors.where(:field_133, category: :soft_validation)).not_to be_present - expect(parser.errors.where(:field_144, category: :soft_validation)).not_to be_present - expect(parser.errors.where(:field_134, category: :soft_validation)).not_to be_present - expect(parser.errors.where(:field_146, category: :soft_validation)).not_to be_present + expect(parser.errors.where(:field_57, category: :soft_validation)).not_to be_present + expect(parser.errors.where(:field_136, category: :soft_validation)).not_to be_present + expect(parser.errors.where(:field_61, category: :soft_validation)).not_to be_present + expect(parser.errors.where(:field_138, category: :soft_validation)).not_to be_present end end @@ -2501,7 +2493,7 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do end end - describe "#sexN fields" do + describe "#sexrabN fields" do let(:attributes) do { bulk_upload:, @@ -2517,14 +2509,14 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do end it "sets value from correct mapping" do - expect(parser.log.sex1).to eql("F") - expect(parser.log.sex2).to eql("M") - expect(parser.log.sex3).to eql("X") - expect(parser.log.sex4).to eql("R") - expect(parser.log.sex5).to eql("F") - expect(parser.log.sex6).to eql("M") - expect(parser.log.sex7).to eql("X") - expect(parser.log.sex8).to eql("R") + expect(parser.log.sexrab1).to eql("F") + expect(parser.log.sexrab2).to eql("M") + expect(parser.log.sexrab3).to eql("X") + expect(parser.log.sexrab4).to eql("R") + expect(parser.log.sexrab5).to eql("F") + expect(parser.log.sexrab6).to eql("M") + expect(parser.log.sexrab7).to eql("X") + expect(parser.log.sexrab8).to eql("R") end end diff --git a/spec/services/csv/lettings_log_csv_service_spec.rb b/spec/services/csv/lettings_log_csv_service_spec.rb index e20d6212b..02af1a1a1 100644 --- a/spec/services/csv/lettings_log_csv_service_spec.rb +++ b/spec/services/csv/lettings_log_csv_service_spec.rb @@ -241,7 +241,6 @@ RSpec.describe Csv::LettingsLogCsvService do hhmemb: 4, age1_known: 0, age1: 35, - sex1: "F", sexrab1: "F", gender_same_as_sex1: 1, ethnic_group: 0, @@ -252,7 +251,6 @@ RSpec.describe Csv::LettingsLogCsvService do relat2: "P", age2_known: 0, age2: 32, - sex2: "M", sexrab2: "M", gender_same_as_sex2: 2, gender_description2: "Non-binary", @@ -261,7 +259,6 @@ RSpec.describe Csv::LettingsLogCsvService do details_known_4: 0, relat4: "R", age4_known: 1, - sex4: "R", sexrab4: "R", gender_same_as_sex4: 3, ecstat4: 10, diff --git a/spec/services/exports/lettings_log_export_service_spec.rb b/spec/services/exports/lettings_log_export_service_spec.rb index 38cb2e130..1875e8725 100644 --- a/spec/services/exports/lettings_log_export_service_spec.rb +++ b/spec/services/exports/lettings_log_export_service_spec.rb @@ -83,7 +83,7 @@ RSpec.describe Exports::LettingsLogExportService do end context "and one lettings log is available for export" do - let!(:lettings_log) { FactoryBot.create(:lettings_log, :completed, assigned_to: user, age1: 35, sex1: "F", age2: 32, sex2: "M", propcode: "123", ppostcode_full: "SE2 6RT", postcode_full: "NW1 5TY", town_or_city: "London", tenancycode: "BZ737", startdate: Time.zone.local(2022, 2, 2, 10, 36, 49), voiddate: Time.zone.local(2019, 11, 3), mrcdate: Time.zone.local(2020, 5, 5, 10, 36, 49), tenancylength: 5, underoccupation_benefitcap: 4) } + let!(:lettings_log) { FactoryBot.create(:lettings_log, :completed, assigned_to: user, age1: 35, sex1: "F", sexrab1: nil, age2: 32, sex2: "M", sexrab2: nil, propcode: "123", ppostcode_full: "SE2 6RT", postcode_full: "NW1 5TY", town_or_city: "London", tenancycode: "BZ737", startdate: Time.zone.local(2022, 2, 2, 10, 36, 49), voiddate: Time.zone.local(2019, 11, 3), mrcdate: Time.zone.local(2020, 5, 5, 10, 36, 49), tenancylength: 5, underoccupation_benefitcap: 4) } it "generates a ZIP export file with the expected filename" do expect(storage_service).to receive(:write_file).with(expected_zip_filename, any_args) @@ -127,7 +127,7 @@ RSpec.describe Exports::LettingsLogExportService do end context "and one lettings log with unknown user details is available for export" do - let!(:lettings_log) { FactoryBot.create(:lettings_log, :completed, details_known_2: 1, assigned_to: user, age1: 35, sex1: "F", propcode: "123", ppostcode_full: "SE2 6RT", postcode_full: "NW1 5TY", town_or_city: "London", tenancycode: "BZ737", startdate: Time.zone.local(2022, 2, 2, 10, 36, 49), voiddate: Time.zone.local(2019, 11, 3), mrcdate: Time.zone.local(2020, 5, 5, 10, 36, 49), tenancylength: 5, underoccupation_benefitcap: 4) } + let!(:lettings_log) { FactoryBot.create(:lettings_log, :completed, details_known_2: 1, assigned_to: user, age1: 35, sex1: "F", sexrab1: nil, propcode: "123", ppostcode_full: "SE2 6RT", postcode_full: "NW1 5TY", town_or_city: "London", tenancycode: "BZ737", startdate: Time.zone.local(2022, 2, 2, 10, 36, 49), voiddate: Time.zone.local(2019, 11, 3), mrcdate: Time.zone.local(2020, 5, 5, 10, 36, 49), tenancylength: 5, underoccupation_benefitcap: 4) } def replace_person_details(export_file) export_file.sub!("32", "-9") @@ -180,7 +180,7 @@ RSpec.describe Exports::LettingsLogExportService do end context "and one lettings log is available for export" do - let!(:lettings_log) { FactoryBot.create(:lettings_log, :completed, assigned_to: user, age1: 35, sex1: "F", age2: 32, sex2: "M", uprn_known: 1, uprn: "100023336956", propcode: "123", postcode_full: "SE2 6RT", ppostcode_full: "SE2 6RT", tenancycode: "BZ737", startdate: Time.zone.local(2023, 4, 2, 10, 36, 49), voiddate: Time.zone.local(2021, 11, 3), mrcdate: Time.zone.local(2022, 5, 5, 10, 36, 49), tenancylength: 5, underoccupation_benefitcap: 4) } + let!(:lettings_log) { FactoryBot.create(:lettings_log, :completed, assigned_to: user, age1: 35, sex1: "F", sexrab1: nil, age2: 32, sex2: "M", sexrab2: nil, uprn_known: 1, uprn: "100023336956", propcode: "123", postcode_full: "SE2 6RT", ppostcode_full: "SE2 6RT", tenancycode: "BZ737", startdate: Time.zone.local(2023, 4, 2, 10, 36, 49), voiddate: Time.zone.local(2021, 11, 3), mrcdate: Time.zone.local(2022, 5, 5, 10, 36, 49), tenancylength: 5, underoccupation_benefitcap: 4) } let(:expected_zip_filename) { "core_2023_2024_apr_mar_f0001_inc0001.zip" } let(:expected_data_filename) { "core_2023_2024_apr_mar_f0001_inc0001_pt001.xml" } let(:xml_export_file) { File.open("spec/fixtures/exports/general_needs_log_23_24.xml", "r:UTF-8") } @@ -400,7 +400,7 @@ RSpec.describe Exports::LettingsLogExportService do end context "and one lettings log with duplicate reference is available for export" do - let!(:lettings_log) { FactoryBot.create(:lettings_log, :completed, assigned_to: user, age1: 35, sex1: "F", age2: 32, sex2: "M", propcode: "123", ppostcode_full: "SE2 6RT", postcode_full: "NW1 5TY", town_or_city: "London", tenancycode: "BZ737", startdate: Time.zone.local(2022, 2, 2, 10, 36, 49), voiddate: Time.zone.local(2019, 11, 3), mrcdate: Time.zone.local(2020, 5, 5, 10, 36, 49), tenancylength: 5, underoccupation_benefitcap: 4, duplicate_set_id: 123) } + let!(:lettings_log) { FactoryBot.create(:lettings_log, :completed, assigned_to: user, age1: 35, sex1: "F", sexrab1: nil, age2: 32, sex2: "M", sexrab2: nil, propcode: "123", ppostcode_full: "SE2 6RT", postcode_full: "NW1 5TY", town_or_city: "London", tenancycode: "BZ737", startdate: Time.zone.local(2022, 2, 2, 10, 36, 49), voiddate: Time.zone.local(2019, 11, 3), mrcdate: Time.zone.local(2020, 5, 5, 10, 36, 49), tenancylength: 5, underoccupation_benefitcap: 4, duplicate_set_id: 123) } def replace_duplicate_set_id(export_file) export_file.sub!("", "123") @@ -433,7 +433,7 @@ RSpec.describe Exports::LettingsLogExportService do end context "and one lettings log is available for export" do - let!(:lettings_log) { FactoryBot.create(:lettings_log, :completed, assigned_to: user, age1: 35, sex1: "F", age2: 32, sex2: "M", ppostcode_full: "A1 1AA", nationality_all_group: 13, propcode: "123", postcode_full: "SE2 6RT", tenancycode: "BZ737", startdate: Time.zone.local(2024, 4, 2, 10, 36, 49), voiddate: Time.zone.local(2021, 11, 3), mrcdate: Time.zone.local(2022, 5, 5, 10, 36, 49), tenancylength: 5, underoccupation_benefitcap: 4, creation_method: 2, bulk_upload_id: 1, address_line1_as_entered: "address line 1 as entered", address_line2_as_entered: "address line 2 as entered", town_or_city_as_entered: "town or city as entered", county_as_entered: "county as entered", postcode_full_as_entered: "AB1 2CD", la_as_entered: "la as entered", manual_address_entry_selected: false, uprn: "1", uprn_known: 1) } + let!(:lettings_log) { FactoryBot.create(:lettings_log, :completed, assigned_to: user, age1: 35, sex1: "F", sexrab1: nil, age2: 32, sex2: "M", sexrab2: nil, ppostcode_full: "A1 1AA", nationality_all_group: 13, propcode: "123", postcode_full: "SE2 6RT", tenancycode: "BZ737", startdate: Time.zone.local(2024, 4, 2, 10, 36, 49), voiddate: Time.zone.local(2021, 11, 3), mrcdate: Time.zone.local(2022, 5, 5, 10, 36, 49), tenancylength: 5, underoccupation_benefitcap: 4, creation_method: 2, bulk_upload_id: 1, address_line1_as_entered: "address line 1 as entered", address_line2_as_entered: "address line 2 as entered", town_or_city_as_entered: "town or city as entered", county_as_entered: "county as entered", postcode_full_as_entered: "AB1 2CD", la_as_entered: "la as entered", manual_address_entry_selected: false, uprn: "1", uprn_known: 1) } let(:expected_zip_filename) { "core_2024_2025_apr_mar_f0001_inc0001.zip" } let(:expected_data_filename) { "core_2024_2025_apr_mar_f0001_inc0001_pt001.xml" } let(:xml_export_file) { File.open("spec/fixtures/exports/general_needs_log_24_25.xml", "r:UTF-8") } @@ -465,7 +465,7 @@ RSpec.describe Exports::LettingsLogExportService do end context "and one lettings log is available for export" do - let!(:lettings_log) { FactoryBot.create(:lettings_log, :completed, startdate: Time.zone.local(2025, 4, 3), assigned_to: user, age1: 35, sex1: "F", age2: 32, sex2: "M", ppostcode_full: "A1 1AA", nationality_all_group: 13, propcode: "123", postcode_full: "SE2 6RT", tenancycode: "BZ737", voiddate: Time.zone.local(2021, 11, 3), mrcdate: Time.zone.local(2022, 5, 5, 10, 36, 49), tenancylength: 5, underoccupation_benefitcap: 4, creation_method: 2, bulk_upload_id: 1, address_line1_as_entered: "address line 1 as entered", address_line2_as_entered: "address line 2 as entered", town_or_city_as_entered: "town or city as entered", county_as_entered: "county as entered", postcode_full_as_entered: "AB1 2CD", la_as_entered: "la as entered", manual_address_entry_selected: false, uprn: "1", uprn_known: 1) } + let!(:lettings_log) { FactoryBot.create(:lettings_log, :completed, startdate: Time.zone.local(2025, 4, 3), assigned_to: user, age1: 35, sex1: "F", sexrab1: nil, age2: 32, sex2: "M", sexrab2: nil, ppostcode_full: "A1 1AA", nationality_all_group: 13, propcode: "123", postcode_full: "SE2 6RT", tenancycode: "BZ737", voiddate: Time.zone.local(2021, 11, 3), mrcdate: Time.zone.local(2022, 5, 5, 10, 36, 49), tenancylength: 5, underoccupation_benefitcap: 4, creation_method: 2, bulk_upload_id: 1, address_line1_as_entered: "address line 1 as entered", address_line2_as_entered: "address line 2 as entered", town_or_city_as_entered: "town or city as entered", county_as_entered: "county as entered", postcode_full_as_entered: "AB1 2CD", la_as_entered: "la as entered", manual_address_entry_selected: false, uprn: "1", uprn_known: 1) } let(:expected_zip_filename) { "core_2025_2026_apr_mar_f0001_inc0001.zip" } let(:expected_data_filename) { "core_2025_2026_apr_mar_f0001_inc0001_pt001.xml" } let(:xml_export_file) { File.open("spec/fixtures/exports/general_needs_log_25_26.xml", "r:UTF-8") } @@ -505,10 +505,10 @@ RSpec.describe Exports::LettingsLogExportService do assigned_to: user, age1: 35, sexrab1: "F", - sex1: "F", + sex1: nil, age2: 32, sexrab2: "M", - sex2: "M", + sex2: nil, ppostcode_full: "A1 1AA", nationality_all_group: 13, propcode: "123", @@ -643,7 +643,7 @@ RSpec.describe Exports::LettingsLogExportService do let(:scheme) { FactoryBot.create(:scheme, :export, owning_organisation: organisation) } let(:location) { FactoryBot.create(:location, :export, scheme:, startdate: Time.zone.local(2021, 4, 1), old_id: "1a") } - let(:lettings_log) { FactoryBot.create(:lettings_log, :completed, :export, :sh, scheme:, location:, assigned_to: user, updated_by: other_user, owning_organisation: organisation, age1: 35, sex1: "F", age2: 32, sex2: "M", startdate: Time.zone.local(2022, 2, 2, 10, 36, 49), voiddate: Time.zone.local(2019, 11, 3), mrcdate: Time.zone.local(2020, 5, 5, 10, 36, 49), underoccupation_benefitcap: 4, sheltered: 1) } + let(:lettings_log) { FactoryBot.create(:lettings_log, :completed, :export, :sh, scheme:, location:, assigned_to: user, updated_by: other_user, owning_organisation: organisation, age1: 35, sex1: "F", sexrab1: nil, age2: 32, sex2: "M", sexrab2: nil, startdate: Time.zone.local(2022, 2, 2, 10, 36, 49), voiddate: Time.zone.local(2019, 11, 3), mrcdate: Time.zone.local(2020, 5, 5, 10, 36, 49), underoccupation_benefitcap: 4, sheltered: 1) } before do lettings_log.postcode_full = nil From 5dcb84966cd475b462500de448794092df9c9ba5 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Mon, 23 Feb 2026 11:59:22 +0000 Subject: [PATCH 09/11] CLDC-4202: Update question numbers (#3169) * CLDC-4202: No longer assume question numbers for years the default logic is already a little confusing with the .max call, and we renumber most questions anyway between years to simply this logic and make it less surprising, specify each year all files should now specify 2023, 2024, 2025, 2026 * CLDC-4202: Account for removal of building type see CLDC-4136, Q20 has been removed. renumber every question above 20 to be one lower * CLDC-4202: Update household characteristics question nums done separate as these question numbers are calculated * CLDC-4202: Account for household characteristics renumbering increase all after Q72 (previously Q64) armedforces.rb by 8 * CLDC-4202: Account for new referral question * CLDC-4202: Update tests * fixup! CLDC-4202: No longer assume question numbers for years fix mistaken rent_type number * CLDC-4202: Extract person question count to the form definition * fixup! CLDC-4202: Extract person question count to the form definition syntax error * CLDC-4202: Extract hash logic to a common function * CLDC-4202: Add a rake to populate new question numbers we can run this rake to automatically add all the question numbers at the start of a new year, which should simplify the process a lot * fixup! CLDC-4202: Add a rake to populate new question numbers lint * fixup! CLDC-4202: Extract person question count to the form definition update tests * fixup! CLDC-4202: Extract person question count to the form definition lint * fixup! CLDC-4202: Extract person question count to the form definition also update age_known * CLDC-4141: copy person questions refactor from CLDC-4142 * CLDC-4141: remove gender same as sex and replace gender identity q * CLDC-4202: Use form person question count on sexrab * CLDC-4202: Remove new question numbers from questions we don't ask anymore * CLDC-4141: replace sex with sexrab where relevant for 2026 * fixup! CLDC-4202: Use form person question count on sexrab update test * fixup! CLDC-4202: Use form person question count on sexrab page test too * CLDC-4141: update download order * CLDC-4140: remove sex from rowparser entirely * CLDC-4140: keep sex in factory for now * CLDC-4140: update household characteristics test * CLDC-4140: update log variable spec * CLDC-4202: Use relevant person_question_count in tests * CLDC-4140: update csv export tests * CLDC-4140: update validator tests * CLDC-4140: update row-parser spec * CLDC-4140: update csv-parser spec * CLDC-4140: update export spec * CLDC-4140: update log var defs spec * CLDC-4140: update export spec * CLDC-4140: update row parser spec * CLDC-4140: update validator spec * CLDC-4140: update csv parser spec * CLDC-4143: Update gender retirement validations rename functions as the new wording is more related to those that identify as male and any other option * CLDC-4143: Add 2026 tests * CLDC-4143: Update legacy json files causes issues with some old tests * CLDC-4143: Add error mappings for gender fields * CLDC-4143: Add new gender age retirement soft validation replaces the many check pages from previous years with a single one shows if either of the previous ones would show has agreed wording on ticket * fixup! CLDC-4143: Update gender retirement validations improve gender comment wording * CLDC-4143: Update non males validation name reference to 'soft validation' we found confusing * fixup! CLDC-4143: Add new gender age retirement soft validation update subsection specs * CLDC-4140: update parsers post merge * CLDC-4140: update tests after field renumbering * CLDC-4140: update tests after field renumbering * CLDC-4140: update spacing in to_2026_row * CLDC-4140: update row parser spec field numbers * CLDC-4140: update row parser field types --------- Co-authored-by: Nat Dean-Lewis --- .../form/lettings/questions/address_line1.rb | 4 +- .../form/lettings/questions/address_search.rb | 4 +- app/models/form/lettings/questions/age.rb | 10 +++- app/models/form/lettings/questions/age1.rb | 4 +- .../form/lettings/questions/age1_known.rb | 4 +- .../form/lettings/questions/age_known.rb | 10 +++- .../form/lettings/questions/armedforces.rb | 4 +- app/models/form/lettings/questions/beds.rb | 4 +- .../form/lettings/questions/benefits.rb | 4 +- .../form/lettings/questions/brent_4_weekly.rb | 4 +- .../lettings/questions/brent_bi_weekly.rb | 4 +- .../form/lettings/questions/brent_monthly.rb | 4 +- .../form/lettings/questions/brent_weekly.rb | 4 +- .../form/lettings/questions/builtype.rb | 4 +- .../lettings/questions/chcharge_4_weekly.rb | 4 +- .../lettings/questions/chcharge_bi_weekly.rb | 4 +- .../lettings/questions/chcharge_monthly.rb | 4 +- .../lettings/questions/chcharge_weekly.rb | 4 +- .../lettings/questions/condition_effects.rb | 4 +- app/models/form/lettings/questions/county.rb | 4 +- .../form/lettings/questions/declaration.rb | 4 +- .../form/lettings/questions/earnings.rb | 4 +- .../form/lettings/questions/ethnic_arab.rb | 4 +- .../form/lettings/questions/ethnic_asian.rb | 4 +- .../form/lettings/questions/ethnic_black.rb | 4 +- .../form/lettings/questions/ethnic_group.rb | 4 +- .../form/lettings/questions/ethnic_mixed.rb | 4 +- .../form/lettings/questions/ethnic_white.rb | 4 +- ...rst_time_property_let_as_social_housing.rb | 4 +- .../lettings/questions/gender_identity1.rb | 4 +- app/models/form/lettings/questions/hb.rb | 4 +- .../lettings/questions/hbrentshortfall.rb | 4 +- app/models/form/lettings/questions/hhmemb.rb | 4 +- .../form/lettings/questions/homeless.rb | 4 +- .../lettings/questions/household_charge.rb | 4 +- .../form/lettings/questions/housingneeds.rb | 4 +- .../lettings/questions/housingneeds_other.rb | 4 +- .../lettings/questions/housingneeds_type.rb | 4 +- app/models/form/lettings/questions/illness.rb | 4 +- app/models/form/lettings/questions/incfreq.rb | 4 +- .../lettings/questions/irproduct_other.rb | 4 +- .../form/lettings/questions/is_carehome.rb | 4 +- app/models/form/lettings/questions/joint.rb | 4 +- app/models/form/lettings/questions/la.rb | 4 +- app/models/form/lettings/questions/layear.rb | 4 +- app/models/form/lettings/questions/leftreg.rb | 4 +- .../lettings/questions/letting_allocation.rb | 4 +- .../form/lettings/questions/location_id.rb | 4 +- .../lettings/questions/location_id_search.rb | 4 +- .../form/lettings/questions/majorrepairs.rb | 4 +- .../questions/managing_organisation.rb | 4 +- app/models/form/lettings/questions/mrcdate.rb | 4 +- .../form/lettings/questions/nationality.rb | 4 +- .../lettings/questions/nationality_all.rb | 4 +- .../questions/nationality_all_group.rb | 4 +- .../form/lettings/questions/needs_type.rb | 4 +- .../lettings/questions/net_income_known.rb | 4 +- app/models/form/lettings/questions/offered.rb | 4 +- app/models/form/lettings/questions/period.rb | 4 +- .../form/lettings/questions/person_partner.rb | 10 +++- .../person_sex_registered_at_birth.rb | 2 +- .../questions/person_working_situation.rb | 10 +++- .../questions/postcode_for_full_address.rb | 4 +- .../form/lettings/questions/ppcodenk.rb | 4 +- .../form/lettings/questions/ppostcode_full.rb | 4 +- .../form/lettings/questions/preg_occ.rb | 4 +- .../lettings/questions/previous_la_known.rb | 4 +- .../lettings/questions/previous_let_type.rb | 4 +- .../lettings/questions/previous_tenure.rb | 4 +- .../questions/previous_tenure_renewal.rb | 4 +- app/models/form/lettings/questions/prevloc.rb | 4 +- .../lettings/questions/property_reference.rb | 4 +- .../lettings/questions/pscharge_4_weekly.rb | 4 +- .../lettings/questions/pscharge_bi_weekly.rb | 4 +- .../lettings/questions/pscharge_monthly.rb | 4 +- .../lettings/questions/pscharge_weekly.rb | 4 +- app/models/form/lettings/questions/reason.rb | 4 +- .../form/lettings/questions/reason_renewal.rb | 4 +- .../questions/reasonable_preference_reason.rb | 4 +- .../form/lettings/questions/reasonother.rb | 4 +- .../form/lettings/questions/reasonpref.rb | 4 +- .../lettings/questions/referral_direct.rb | 2 +- .../questions/referral_general_needs.rb | 4 +- .../questions/referral_general_needs_prp.rb | 4 +- .../form/lettings/questions/referral_hsc.rb | 2 +- .../lettings/questions/referral_justice.rb | 2 +- .../form/lettings/questions/referral_la.rb | 2 +- .../form/lettings/questions/referral_prp.rb | 2 +- .../questions/referral_supported_housing.rb | 4 +- .../referral_supported_housing_prp.rb | 4 +- .../form/lettings/questions/referral_type.rb | 2 +- app/models/form/lettings/questions/renewal.rb | 4 +- .../form/lettings/questions/rent_type.rb | 4 +- .../form/lettings/questions/reservist.rb | 4 +- app/models/form/lettings/questions/rsnvac.rb | 4 +- .../lettings/questions/rsnvac_first_let.rb | 4 +- .../lettings/questions/scharge_4_weekly.rb | 4 +- .../lettings/questions/scharge_bi_weekly.rb | 4 +- .../lettings/questions/scharge_monthly.rb | 4 +- .../form/lettings/questions/scharge_weekly.rb | 4 +- .../form/lettings/questions/scheme_id.rb | 4 +- .../form/lettings/questions/sheltered.rb | 4 +- .../questions/starter_tenancy_type.rb | 4 +- .../form/lettings/questions/startertenancy.rb | 4 +- .../form/lettings/questions/stock_owner.rb | 4 +- .../lettings/questions/supcharg_4_weekly.rb | 4 +- .../lettings/questions/supcharg_bi_weekly.rb | 4 +- .../lettings/questions/supcharg_monthly.rb | 4 +- .../lettings/questions/supcharg_weekly.rb | 4 +- .../form/lettings/questions/tenancy_length.rb | 4 +- .../tenancy_length_affordable_rent.rb | 4 +- .../tenancy_length_intermediate_rent.rb | 4 +- .../questions/tenancy_length_periodic.rb | 4 +- .../form/lettings/questions/tenancy_other.rb | 4 +- .../lettings/questions/tenancy_start_date.rb | 4 +- .../form/lettings/questions/tenancy_type.rb | 4 +- .../form/lettings/questions/tenant_code.rb | 4 +- .../form/lettings/questions/town_or_city.rb | 4 +- .../form/lettings/questions/tshortfall.rb | 4 +- .../lettings/questions/tshortfall_known.rb | 4 +- .../form/lettings/questions/unittype_gn.rb | 4 +- app/models/form/lettings/questions/uprn.rb | 4 +- .../form/lettings/questions/uprn_known.rb | 4 +- .../form/lettings/questions/voiddate.rb | 4 +- .../form/lettings/questions/waityear.rb | 4 +- .../form/lettings/questions/wheelchair.rb | 4 +- .../lettings/questions/working_situation1.rb | 4 +- app/models/form/question.rb | 2 +- lib/tasks/add_new_year_to_questions.rake | 54 +++++++++++++++++++ .../form/lettings/pages/person_age_spec.rb | 2 +- .../pages/person_lead_partner_spec.rb | 22 ++++---- .../person_sex_registered_at_birth_spec.rb | 2 +- .../pages/person_working_situation_spec.rb | 2 +- .../form/lettings/questions/age_known_spec.rb | 2 +- .../form/lettings/questions/age_spec.rb | 45 +++++++++++++++- .../lettings/questions/person_partner_spec.rb | 2 + .../person_sex_registered_at_birth_spec.rb | 2 +- .../person_working_situation_spec.rb | 2 +- 138 files changed, 387 insertions(+), 268 deletions(-) create mode 100644 lib/tasks/add_new_year_to_questions.rake diff --git a/app/models/form/lettings/questions/address_line1.rb b/app/models/form/lettings/questions/address_line1.rb index 4b1f67931..2f88b210e 100644 --- a/app/models/form/lettings/questions/address_line1.rb +++ b/app/models/form/lettings/questions/address_line1.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::AddressLine1 < ::Form::Question @type = "text" @plain_label = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @hide_question_number_on_page = true end @@ -18,5 +18,5 @@ class Form::Lettings::Questions::AddressLine1 < ::Form::Question ].select(&:present?).join("\n") end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13, 2025 => 17 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13, 2025 => 17, 2026 => 17 }.freeze end diff --git a/app/models/form/lettings/questions/address_search.rb b/app/models/form/lettings/questions/address_search.rb index c6abe9a6c..eb970a5e5 100644 --- a/app/models/form/lettings/questions/address_search.rb +++ b/app/models/form/lettings/questions/address_search.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::AddressSearch < ::Form::Question @copy_key = "lettings.property_information.address_search" @plain_label = true @bottom_guidance_partial = "address_search" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @hide_question_number_on_page = true end @@ -38,5 +38,5 @@ class Form::Lettings::Questions::AddressSearch < ::Form::Question answer_options(log, user).transform_values { |value| value["value"] } || {} end - QUESTION_NUMBER_FROM_YEAR = { 2024 => 12, 2025 => 16 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2024 => 12, 2025 => 16, 2026 => 16 }.freeze end diff --git a/app/models/form/lettings/questions/age.rb b/app/models/form/lettings/questions/age.rb index f35abe61e..61e70fe05 100644 --- a/app/models/form/lettings/questions/age.rb +++ b/app/models/form/lettings/questions/age.rb @@ -19,11 +19,17 @@ class Form::Lettings::Questions::Age < ::Form::Question base_question_number = case form.start_date.year when 2023 31 - else + when 2024 + 30 + when 2025 30 + when 2026 + 27 + else + 27 end - base_question_number + (4 * @person_index) + base_question_number + (form.person_question_count * @person_index) end def hint_text diff --git a/app/models/form/lettings/questions/age1.rb b/app/models/form/lettings/questions/age1.rb index 72d89096c..428fabd42 100644 --- a/app/models/form/lettings/questions/age1.rb +++ b/app/models/form/lettings/questions/age1.rb @@ -10,8 +10,8 @@ class Form::Lettings::Questions::Age1 < ::Form::Question @max = 120 @min = 16 @step = 1 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 32, 2024 => 31 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 32, 2024 => 31, 2025 => 31, 2026 => 30 }.freeze end diff --git a/app/models/form/lettings/questions/age1_known.rb b/app/models/form/lettings/questions/age1_known.rb index e54d7993b..753fdd2cb 100644 --- a/app/models/form/lettings/questions/age1_known.rb +++ b/app/models/form/lettings/questions/age1_known.rb @@ -8,10 +8,10 @@ class Form::Lettings::Questions::Age1Known < ::Form::Question @answer_options = ANSWER_OPTIONS @conditional_for = { "age1" => [0] } @hidden_in_check_answers = { "depends_on" => [{ "age1_known" => 0 }, { "age1_known" => 1 }] } - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 32, 2024 => 31 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 32, 2024 => 31, 2025 => 31, 2026 => 30 }.freeze end diff --git a/app/models/form/lettings/questions/age_known.rb b/app/models/form/lettings/questions/age_known.rb index 2f5d7ce0b..c4bb65c2e 100644 --- a/app/models/form/lettings/questions/age_known.rb +++ b/app/models/form/lettings/questions/age_known.rb @@ -23,10 +23,16 @@ class Form::Lettings::Questions::AgeKnown < ::Form::Question base_question_number = case form.start_date.year when 2023 31 - else + when 2024 + 30 + when 2025 30 + when 2026 + 27 + else + 27 end - base_question_number + (4 * @person_index) + base_question_number + (form.person_question_count * @person_index) end end diff --git a/app/models/form/lettings/questions/armedforces.rb b/app/models/form/lettings/questions/armedforces.rb index 9bfe4b643..32aac69ca 100644 --- a/app/models/form/lettings/questions/armedforces.rb +++ b/app/models/form/lettings/questions/armedforces.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::Armedforces < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -18,5 +18,5 @@ class Form::Lettings::Questions::Armedforces < ::Form::Question "6" => { "value" => "Don’t know" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 66, 2024 => 65 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 66, 2024 => 65, 2025 => 65, 2026 => 72 }.freeze end diff --git a/app/models/form/lettings/questions/beds.rb b/app/models/form/lettings/questions/beds.rb index 1bafa3ddf..1e59c367c 100644 --- a/app/models/form/lettings/questions/beds.rb +++ b/app/models/form/lettings/questions/beds.rb @@ -7,12 +7,12 @@ class Form::Lettings::Questions::Beds < ::Form::Question @max = 12 @min = 1 @step = 1 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def derived?(log) log.is_bedsit? end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 22 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 22, 2024 => 22, 2025 => 22, 2026 => 21 }.freeze end diff --git a/app/models/form/lettings/questions/benefits.rb b/app/models/form/lettings/questions/benefits.rb index f5f2a3ee1..4ab922215 100644 --- a/app/models/form/lettings/questions/benefits.rb +++ b/app/models/form/lettings/questions/benefits.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::Benefits < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -16,5 +16,5 @@ class Form::Lettings::Questions::Benefits < ::Form::Question "4" => { "value" => "Don’t know" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 90, 2024 => 89 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 90, 2024 => 89, 2025 => 89, 2026 => 97 }.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 7087571fd..319b495a5 100644 --- a/app/models/form/lettings/questions/brent_4_weekly.rb +++ b/app/models/form/lettings/questions/brent_4_weekly.rb @@ -12,9 +12,9 @@ class Form::Lettings::Questions::Brent4Weekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every 4 weeks" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94, 2025 => 92 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94, 2025 => 92, 2026 => 100 }.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 1a20fd61c..d33863756 100644 --- a/app/models/form/lettings/questions/brent_bi_weekly.rb +++ b/app/models/form/lettings/questions/brent_bi_weekly.rb @@ -12,9 +12,9 @@ class Form::Lettings::Questions::BrentBiWeekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every 2 weeks" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94, 2025 => 92 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94, 2025 => 92, 2026 => 100 }.freeze end diff --git a/app/models/form/lettings/questions/brent_monthly.rb b/app/models/form/lettings/questions/brent_monthly.rb index 245bde158..8e71bb8ec 100644 --- a/app/models/form/lettings/questions/brent_monthly.rb +++ b/app/models/form/lettings/questions/brent_monthly.rb @@ -12,9 +12,9 @@ class Form::Lettings::Questions::BrentMonthly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every month" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94, 2025 => 92 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94, 2025 => 92, 2026 => 100 }.freeze end diff --git a/app/models/form/lettings/questions/brent_weekly.rb b/app/models/form/lettings/questions/brent_weekly.rb index c913816fc..706f94b3d 100644 --- a/app/models/form/lettings/questions/brent_weekly.rb +++ b/app/models/form/lettings/questions/brent_weekly.rb @@ -12,9 +12,9 @@ class Form::Lettings::Questions::BrentWeekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every week" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94, 2025 => 92 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 95, 2024 => 94, 2025 => 92, 2026 => 100 }.freeze end diff --git a/app/models/form/lettings/questions/builtype.rb b/app/models/form/lettings/questions/builtype.rb index 8c34beca1..55f76536c 100644 --- a/app/models/form/lettings/questions/builtype.rb +++ b/app/models/form/lettings/questions/builtype.rb @@ -4,7 +4,7 @@ class Form::Lettings::Questions::Builtype < ::Form::Question @id = "builtype" @type = "radio" @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -12,5 +12,5 @@ class Form::Lettings::Questions::Builtype < ::Form::Question "1" => { "value" => "Purpose built" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 20 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 20, 2024 => 20, 2025 => 20 }.freeze end diff --git a/app/models/form/lettings/questions/chcharge_4_weekly.rb b/app/models/form/lettings/questions/chcharge_4_weekly.rb index 341010eb0..403ab3e75 100644 --- a/app/models/form/lettings/questions/chcharge_4_weekly.rb +++ b/app/models/form/lettings/questions/chcharge_4_weekly.rb @@ -9,9 +9,9 @@ class Form::Lettings::Questions::Chcharge4Weekly < ::Form::Question @step = 0.01 @prefix = "£" @suffix = " every 4 weeks" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 94, 2024 => 93 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 94, 2024 => 93, 2025 => 93, 2026 => 101 }.freeze end diff --git a/app/models/form/lettings/questions/chcharge_bi_weekly.rb b/app/models/form/lettings/questions/chcharge_bi_weekly.rb index 0343839ca..274b26d0d 100644 --- a/app/models/form/lettings/questions/chcharge_bi_weekly.rb +++ b/app/models/form/lettings/questions/chcharge_bi_weekly.rb @@ -9,9 +9,9 @@ class Form::Lettings::Questions::ChchargeBiWeekly < ::Form::Question @step = 0.01 @prefix = "£" @suffix = " every 2 weeks" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 94, 2024 => 93 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 94, 2024 => 93, 2025 => 93, 2026 => 101 }.freeze end diff --git a/app/models/form/lettings/questions/chcharge_monthly.rb b/app/models/form/lettings/questions/chcharge_monthly.rb index 9e68eb18f..967295d45 100644 --- a/app/models/form/lettings/questions/chcharge_monthly.rb +++ b/app/models/form/lettings/questions/chcharge_monthly.rb @@ -9,9 +9,9 @@ class Form::Lettings::Questions::ChchargeMonthly < ::Form::Question @step = 0.01 @prefix = "£" @suffix = " every month" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 94, 2024 => 93 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 94, 2024 => 93, 2025 => 93, 2026 => 101 }.freeze end diff --git a/app/models/form/lettings/questions/chcharge_weekly.rb b/app/models/form/lettings/questions/chcharge_weekly.rb index 3c8b995eb..d27d586b4 100644 --- a/app/models/form/lettings/questions/chcharge_weekly.rb +++ b/app/models/form/lettings/questions/chcharge_weekly.rb @@ -9,9 +9,9 @@ class Form::Lettings::Questions::ChchargeWeekly < ::Form::Question @step = 0.01 @prefix = "£" @suffix = " every week" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 94, 2024 => 93 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 94, 2024 => 93, 2025 => 93, 2026 => 101 }.freeze end diff --git a/app/models/form/lettings/questions/condition_effects.rb b/app/models/form/lettings/questions/condition_effects.rb index 1821f6e98..af967d17e 100644 --- a/app/models/form/lettings/questions/condition_effects.rb +++ b/app/models/form/lettings/questions/condition_effects.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::ConditionEffects < ::Form::Question @type = "checkbox" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -27,5 +27,5 @@ class Form::Lettings::Questions::ConditionEffects < ::Form::Question "illness_type_10" => { "value" => "Other" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 74, 2024 => 73 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 74, 2024 => 73, 2025 => 73, 2026 => 80 }.freeze end diff --git a/app/models/form/lettings/questions/county.rb b/app/models/form/lettings/questions/county.rb index 12585fa8e..b634fd6dc 100644 --- a/app/models/form/lettings/questions/county.rb +++ b/app/models/form/lettings/questions/county.rb @@ -6,9 +6,9 @@ class Form::Lettings::Questions::County < ::Form::Question @type = "text" @plain_label = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @hide_question_number_on_page = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13, 2025 => 17 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13, 2025 => 17, 2026 => 17 }.freeze end diff --git a/app/models/form/lettings/questions/declaration.rb b/app/models/form/lettings/questions/declaration.rb index 3261452cd..6a2572487 100644 --- a/app/models/form/lettings/questions/declaration.rb +++ b/app/models/form/lettings/questions/declaration.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::Declaration < ::Form::Question @type = "checkbox" @check_answers_card_number = 0 unless form.start_year_2024_or_later? @top_guidance_partial = "privacy_notice_tenant" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -26,5 +26,5 @@ class Form::Lettings::Questions::Declaration < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 30, 2024 => 11 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 30, 2024 => 11, 2025 => 11, 2026 => 11 }.freeze end diff --git a/app/models/form/lettings/questions/earnings.rb b/app/models/form/lettings/questions/earnings.rb index 4d3437052..13482135e 100644 --- a/app/models/form/lettings/questions/earnings.rb +++ b/app/models/form/lettings/questions/earnings.rb @@ -15,9 +15,9 @@ class Form::Lettings::Questions::Earnings < ::Form::Question { "label" => " every month", "depends_on" => { "incfreq" => 2 } }, { "label" => " every year", "depends_on" => { "incfreq" => 3 } }, ] - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 88, 2024 => 87 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 88, 2024 => 87, 2025 => 87, 2026 => 95 }.freeze end diff --git a/app/models/form/lettings/questions/ethnic_arab.rb b/app/models/form/lettings/questions/ethnic_arab.rb index d642c1a1b..582d92704 100644 --- a/app/models/form/lettings/questions/ethnic_arab.rb +++ b/app/models/form/lettings/questions/ethnic_arab.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::EthnicArab < ::Form::Question @type = "radio" @check_answers_card_number = 1 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -18,5 +18,5 @@ class Form::Lettings::Questions::EthnicArab < ::Form::Question }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 34 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 34, 2025 => 34, 2026 => 34 }.freeze end diff --git a/app/models/form/lettings/questions/ethnic_asian.rb b/app/models/form/lettings/questions/ethnic_asian.rb index 7fb309bba..f488249a6 100644 --- a/app/models/form/lettings/questions/ethnic_asian.rb +++ b/app/models/form/lettings/questions/ethnic_asian.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::EthnicAsian < ::Form::Question @type = "radio" @check_answers_card_number = 1 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -27,5 +27,5 @@ class Form::Lettings::Questions::EthnicAsian < ::Form::Question }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 34 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 34, 2025 => 34, 2026 => 34 }.freeze end diff --git a/app/models/form/lettings/questions/ethnic_black.rb b/app/models/form/lettings/questions/ethnic_black.rb index e3a88259e..f6902eb35 100644 --- a/app/models/form/lettings/questions/ethnic_black.rb +++ b/app/models/form/lettings/questions/ethnic_black.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::EthnicBlack < ::Form::Question @type = "radio" @check_answers_card_number = 1 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -21,5 +21,5 @@ class Form::Lettings::Questions::EthnicBlack < ::Form::Question }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 34 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 34, 2025 => 34, 2026 => 34 }.freeze end diff --git a/app/models/form/lettings/questions/ethnic_group.rb b/app/models/form/lettings/questions/ethnic_group.rb index 16bdfc4ba..c1c0be096 100644 --- a/app/models/form/lettings/questions/ethnic_group.rb +++ b/app/models/form/lettings/questions/ethnic_group.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::EthnicGroup < ::Form::Question @type = "radio" @check_answers_card_number = 1 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -18,5 +18,5 @@ class Form::Lettings::Questions::EthnicGroup < ::Form::Question "17" => { "value" => "Tenant prefers not to say" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 34, 2024 => 33 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 34, 2024 => 33, 2025 => 33, 2026 => 33 }.freeze end diff --git a/app/models/form/lettings/questions/ethnic_mixed.rb b/app/models/form/lettings/questions/ethnic_mixed.rb index 14d1f213b..f12f997b6 100644 --- a/app/models/form/lettings/questions/ethnic_mixed.rb +++ b/app/models/form/lettings/questions/ethnic_mixed.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::EthnicMixed < ::Form::Question @type = "radio" @check_answers_card_number = 1 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -24,5 +24,5 @@ class Form::Lettings::Questions::EthnicMixed < ::Form::Question }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 34 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 34, 2025 => 34, 2026 => 34 }.freeze end diff --git a/app/models/form/lettings/questions/ethnic_white.rb b/app/models/form/lettings/questions/ethnic_white.rb index 74430d840..98ebe78f3 100644 --- a/app/models/form/lettings/questions/ethnic_white.rb +++ b/app/models/form/lettings/questions/ethnic_white.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::EthnicWhite < ::Form::Question @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_white" @type = "radio" @check_answers_card_number = 1 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -27,5 +27,5 @@ class Form::Lettings::Questions::EthnicWhite < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 34 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 35, 2024 => 34, 2025 => 34, 2026 => 34 }.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 09e6ece30..c9fb77abf 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 @@ -3,7 +3,7 @@ class Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing < ::Form::Q super @id = "first_time_property_let_as_social_housing" @type = "radio" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -21,5 +21,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, 2025 => 12 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 14, 2024 => 15, 2025 => 12, 2026 => 12 }.freeze end diff --git a/app/models/form/lettings/questions/gender_identity1.rb b/app/models/form/lettings/questions/gender_identity1.rb index 411bcd3d0..f3d86fde0 100644 --- a/app/models/form/lettings/questions/gender_identity1.rb +++ b/app/models/form/lettings/questions/gender_identity1.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::GenderIdentity1 < ::Form::Question @type = "radio" @check_answers_card_number = 1 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -16,5 +16,5 @@ class Form::Lettings::Questions::GenderIdentity1 < ::Form::Question "R" => { "value" => "Tenant prefers not to say" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 33, 2024 => 32 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 33, 2024 => 32, 2025 => 32 }.freeze end diff --git a/app/models/form/lettings/questions/hb.rb b/app/models/form/lettings/questions/hb.rb index 51da058b8..f9204e65a 100644 --- a/app/models/form/lettings/questions/hb.rb +++ b/app/models/form/lettings/questions/hb.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::Hb < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -17,5 +17,5 @@ class Form::Lettings::Questions::Hb < ::Form::Question "3" => { "value" => "Don’t know" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 89, 2024 => 88 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 89, 2024 => 88, 2025 => 88, 2026 => 96 }.freeze end diff --git a/app/models/form/lettings/questions/hbrentshortfall.rb b/app/models/form/lettings/questions/hbrentshortfall.rb index 294423815..dfc323c3a 100644 --- a/app/models/form/lettings/questions/hbrentshortfall.rb +++ b/app/models/form/lettings/questions/hbrentshortfall.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::Hbrentshortfall < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -15,5 +15,5 @@ class Form::Lettings::Questions::Hbrentshortfall < ::Form::Question "3" => { "value" => "Don’t know" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 99, 2024 => 98, 2025 => 96 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 99, 2024 => 98, 2025 => 96, 2026 => 104 }.freeze end diff --git a/app/models/form/lettings/questions/hhmemb.rb b/app/models/form/lettings/questions/hhmemb.rb index 88328a869..614b2b27e 100644 --- a/app/models/form/lettings/questions/hhmemb.rb +++ b/app/models/form/lettings/questions/hhmemb.rb @@ -8,9 +8,9 @@ class Form::Lettings::Questions::Hhmemb < ::Form::Question @max = 8 @min = 1 @step = 1 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @check_answers_card_title = "Household" if form.start_year_2026_or_later? end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 31, 2024 => 30 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 31, 2024 => 30, 2025 => 30, 2026 => 29 }.freeze end diff --git a/app/models/form/lettings/questions/homeless.rb b/app/models/form/lettings/questions/homeless.rb index 1194fa929..44e03f937 100644 --- a/app/models/form/lettings/questions/homeless.rb +++ b/app/models/form/lettings/questions/homeless.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::Homeless < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -13,5 +13,5 @@ class Form::Lettings::Questions::Homeless < ::Form::Question "1" => { "value" => "No" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 79, 2024 => 78 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 79, 2024 => 78, 2025 => 78, 2026 => 85 }.freeze end diff --git a/app/models/form/lettings/questions/household_charge.rb b/app/models/form/lettings/questions/household_charge.rb index 60fee977d..32bdee4a6 100644 --- a/app/models/form/lettings/questions/household_charge.rb +++ b/app/models/form/lettings/questions/household_charge.rb @@ -5,10 +5,10 @@ class Form::Lettings::Questions::HouseholdCharge < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 91, 2024 => 90 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 91, 2024 => 90, 2025 => 90, 2026 => 98 }.freeze end diff --git a/app/models/form/lettings/questions/housingneeds.rb b/app/models/form/lettings/questions/housingneeds.rb index 03c80d5cb..29f0b5882 100644 --- a/app/models/form/lettings/questions/housingneeds.rb +++ b/app/models/form/lettings/questions/housingneeds.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::Housingneeds < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -15,5 +15,5 @@ class Form::Lettings::Questions::Housingneeds < ::Form::Question "3" => { "value" => "Don’t know" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 70, 2024 => 69 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 70, 2024 => 69, 2025 => 69, 2026 => 76 }.freeze end diff --git a/app/models/form/lettings/questions/housingneeds_other.rb b/app/models/form/lettings/questions/housingneeds_other.rb index d99812535..d8915e936 100644 --- a/app/models/form/lettings/questions/housingneeds_other.rb +++ b/app/models/form/lettings/questions/housingneeds_other.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::HousingneedsOther < ::Form::Question @copy_key = "lettings.household_needs.housingneeds_type.housingneeds_other" @type = "radio" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -24,5 +24,5 @@ class Form::Lettings::Questions::HousingneedsOther < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 72, 2024 => 71 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 72, 2024 => 71, 2025 => 71, 2026 => 78 }.freeze end diff --git a/app/models/form/lettings/questions/housingneeds_type.rb b/app/models/form/lettings/questions/housingneeds_type.rb index 50b9c3742..15b5782d5 100644 --- a/app/models/form/lettings/questions/housingneeds_type.rb +++ b/app/models/form/lettings/questions/housingneeds_type.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::HousingneedsType < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -17,5 +17,5 @@ class Form::Lettings::Questions::HousingneedsType < ::Form::Question "3" => { "value" => "None of the listed options" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 71, 2024 => 70 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 71, 2024 => 70, 2025 => 70, 2026 => 77 }.freeze end diff --git a/app/models/form/lettings/questions/illness.rb b/app/models/form/lettings/questions/illness.rb index f92a7a04a..4bc3667fb 100644 --- a/app/models/form/lettings/questions/illness.rb +++ b/app/models/form/lettings/questions/illness.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::Illness < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -15,5 +15,5 @@ class Form::Lettings::Questions::Illness < ::Form::Question "3" => { "value" => "Tenant prefers not to say" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 73, 2024 => 72 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 73, 2024 => 72, 2025 => 72, 2026 => 79 }.freeze end diff --git a/app/models/form/lettings/questions/incfreq.rb b/app/models/form/lettings/questions/incfreq.rb index d4384218e..74e24f439 100644 --- a/app/models/form/lettings/questions/incfreq.rb +++ b/app/models/form/lettings/questions/incfreq.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::Incfreq < ::Form::Question @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = true - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -16,5 +16,5 @@ class Form::Lettings::Questions::Incfreq < ::Form::Question "3" => { "value" => "Yearly" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 87, 2024 => 86 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 87, 2024 => 86, 2025 => 86, 2026 => 94 }.freeze end diff --git a/app/models/form/lettings/questions/irproduct_other.rb b/app/models/form/lettings/questions/irproduct_other.rb index b004d5dc2..993fcbf54 100644 --- a/app/models/form/lettings/questions/irproduct_other.rb +++ b/app/models/form/lettings/questions/irproduct_other.rb @@ -4,8 +4,8 @@ class Form::Lettings::Questions::IrproductOther < ::Form::Question @id = "irproduct_other" @copy_key = "lettings.setup.rent_type.irproduct_other" @type = "text" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) if form.start_date.present? end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 6, 2024 => 8 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 6, 2024 => 8, 2025 => 8, 2026 => 8 }.freeze end diff --git a/app/models/form/lettings/questions/is_carehome.rb b/app/models/form/lettings/questions/is_carehome.rb index 25dae3fc6..ea2df6eac 100644 --- a/app/models/form/lettings/questions/is_carehome.rb +++ b/app/models/form/lettings/questions/is_carehome.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::IsCarehome < ::Form::Question @type = "radio" @check_answers_card_number = 0 @conditional_for = { "chcharge" => [1] } - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -23,5 +23,5 @@ class Form::Lettings::Questions::IsCarehome < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 93, 2024 => 92 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 93, 2024 => 92, 2025 => 92, 2026 => 100 }.freeze end diff --git a/app/models/form/lettings/questions/joint.rb b/app/models/form/lettings/questions/joint.rb index 2542cd1c7..11f6749a6 100644 --- a/app/models/form/lettings/questions/joint.rb +++ b/app/models/form/lettings/questions/joint.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::Joint < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -15,5 +15,5 @@ class Form::Lettings::Questions::Joint < ::Form::Question "3" => { "value" => "Don’t know" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 25, 2024 => 25, 2025 => 26 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 25, 2024 => 25, 2025 => 26, 2026 => 25 }.freeze end diff --git a/app/models/form/lettings/questions/la.rb b/app/models/form/lettings/questions/la.rb index c6d6f8240..d4d6954d2 100644 --- a/app/models/form/lettings/questions/la.rb +++ b/app/models/form/lettings/questions/la.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::La < ::Form::Question @type = "select" @check_answers_card_number = nil @hint_text = "" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @disable_clearing_if_not_routed_or_dynamic_answer_options = true end @@ -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, 2025 => 18 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 13, 2024 => 14, 2025 => 18, 2026 => 18 }.freeze end diff --git a/app/models/form/lettings/questions/layear.rb b/app/models/form/lettings/questions/layear.rb index fdaad6c22..d8fa0a3a8 100644 --- a/app/models/form/lettings/questions/layear.rb +++ b/app/models/form/lettings/questions/layear.rb @@ -4,7 +4,7 @@ class Form::Lettings::Questions::Layear < ::Form::Question @id = "layear" @type = "radio" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -36,5 +36,5 @@ class Form::Lettings::Questions::Layear < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 75, 2024 => 74 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 75, 2024 => 74, 2025 => 74, 2026 => 81 }.freeze end diff --git a/app/models/form/lettings/questions/leftreg.rb b/app/models/form/lettings/questions/leftreg.rb index 9b90566cf..3e81b52c0 100644 --- a/app/models/form/lettings/questions/leftreg.rb +++ b/app/models/form/lettings/questions/leftreg.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::Leftreg < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -16,5 +16,5 @@ class Form::Lettings::Questions::Leftreg < ::Form::Question "3" => { "value" => "Person prefers not to say" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 67, 2024 => 66 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 67, 2024 => 66, 2025 => 66, 2026 => 73 }.freeze end diff --git a/app/models/form/lettings/questions/letting_allocation.rb b/app/models/form/lettings/questions/letting_allocation.rb index 08310da13..2029335c4 100644 --- a/app/models/form/lettings/questions/letting_allocation.rb +++ b/app/models/form/lettings/questions/letting_allocation.rb @@ -4,7 +4,7 @@ class Form::Lettings::Questions::LettingAllocation < ::Form::Question @id = "letting_allocation" @type = "checkbox" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -28,5 +28,5 @@ class Form::Lettings::Questions::LettingAllocation < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 84, 2024 => 83 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 84, 2024 => 83, 2025 => 83, 2026 => 90 }.freeze end diff --git a/app/models/form/lettings/questions/location_id.rb b/app/models/form/lettings/questions/location_id.rb index 5bc316476..80e34aac0 100644 --- a/app/models/form/lettings/questions/location_id.rb +++ b/app/models/form/lettings/questions/location_id.rb @@ -10,7 +10,7 @@ class Form::Lettings::Questions::LocationId < ::Form::Question "needstype": 2, }, } - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) if form.start_date.present? @disable_clearing_if_not_routed_or_dynamic_answer_options = true @top_guidance_partial = "finding_location" end @@ -55,5 +55,5 @@ private false end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 5 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 5, 2025 => 5, 2026 => 5 }.freeze end diff --git a/app/models/form/lettings/questions/location_id_search.rb b/app/models/form/lettings/questions/location_id_search.rb index 5e1734b51..e64125fda 100644 --- a/app/models/form/lettings/questions/location_id_search.rb +++ b/app/models/form/lettings/questions/location_id_search.rb @@ -10,7 +10,7 @@ class Form::Lettings::Questions::LocationIdSearch < ::Form::Question "needstype": 2, }, } - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) if form.start_date.present? @disable_clearing_if_not_routed_or_dynamic_answer_options = true @top_guidance_partial = "finding_location" end @@ -50,5 +50,5 @@ private false end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 5 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 5, 2025 => 5, 2026 => 5 }.freeze end diff --git a/app/models/form/lettings/questions/majorrepairs.rb b/app/models/form/lettings/questions/majorrepairs.rb index a0c8a3a5c..b9b740cb1 100644 --- a/app/models/form/lettings/questions/majorrepairs.rb +++ b/app/models/form/lettings/questions/majorrepairs.rb @@ -6,10 +6,10 @@ class Form::Lettings::Questions::Majorrepairs < ::Form::Question @type = "radio" @answer_options = ANSWER_OPTIONS @conditional_for = { "mrcdate" => [1] } - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "0" => { "value" => "No" } }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 24 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 24, 2024 => 24, 2025 => 24, 2026 => 23 }.freeze end diff --git a/app/models/form/lettings/questions/managing_organisation.rb b/app/models/form/lettings/questions/managing_organisation.rb index 9c766ebe0..bf1b23c54 100644 --- a/app/models/form/lettings/questions/managing_organisation.rb +++ b/app/models/form/lettings/questions/managing_organisation.rb @@ -4,7 +4,7 @@ class Form::Lettings::Questions::ManagingOrganisation < ::Form::Question @id = "managing_organisation_id" @derived = true @type = "select" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) if form.start_date.present? end def answer_options(log = nil, user = nil) @@ -83,5 +83,5 @@ private true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 2 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 2, 2024 => 2, 2025 => 2, 2026 => 2 }.freeze end diff --git a/app/models/form/lettings/questions/mrcdate.rb b/app/models/form/lettings/questions/mrcdate.rb index 0c311d186..33c511887 100644 --- a/app/models/form/lettings/questions/mrcdate.rb +++ b/app/models/form/lettings/questions/mrcdate.rb @@ -4,8 +4,8 @@ class Form::Lettings::Questions::Mrcdate < ::Form::Question @id = "mrcdate" @copy_key = "lettings.property_information.property_major_repairs.mrcdate" @type = "date" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 24 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 24, 2024 => 24, 2025 => 24, 2026 => 23 }.freeze end diff --git a/app/models/form/lettings/questions/nationality.rb b/app/models/form/lettings/questions/nationality.rb index 8c4a700c1..a966f68f7 100644 --- a/app/models/form/lettings/questions/nationality.rb +++ b/app/models/form/lettings/questions/nationality.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::Nationality < ::Form::Question @type = "radio" @check_answers_card_number = 1 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -19,5 +19,5 @@ class Form::Lettings::Questions::Nationality < ::Form::Question "13" => { "value" => "Tenant prefers not to say" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 36, 2024 => 35 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 36, 2024 => 35, 2025 => 35, 2026 => 34 }.freeze end diff --git a/app/models/form/lettings/questions/nationality_all.rb b/app/models/form/lettings/questions/nationality_all.rb index a4bb750a1..368c0ffb5 100644 --- a/app/models/form/lettings/questions/nationality_all.rb +++ b/app/models/form/lettings/questions/nationality_all.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::NationalityAll < ::Form::Question @type = "select" @check_answers_card_number = 1 @answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_label(log, _current_user = nil) @@ -17,7 +17,7 @@ class Form::Lettings::Questions::NationalityAll < ::Form::Question @answer_options.reject { |key, _| key == "826" } end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 36, 2024 => 35 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 36, 2024 => 35, 2025 => 35, 2026 => 35 }.freeze def label_from_value(value) return unless value diff --git a/app/models/form/lettings/questions/nationality_all_group.rb b/app/models/form/lettings/questions/nationality_all_group.rb index 559b1c9a0..0c4ed5d90 100644 --- a/app/models/form/lettings/questions/nationality_all_group.rb +++ b/app/models/form/lettings/questions/nationality_all_group.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::NationalityAllGroup < ::Form::Question @type = "radio" @check_answers_card_number = 1 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @conditional_for = { "nationality_all" => [12] } @hidden_in_check_answers = { "depends_on" => [{ "nationality_all_group" => 12 }] } end @@ -17,5 +17,5 @@ class Form::Lettings::Questions::NationalityAllGroup < ::Form::Question "0" => { "value" => "Tenant prefers not to say" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 36, 2024 => 35 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 36, 2024 => 35, 2025 => 35, 2026 => 35 }.freeze end diff --git a/app/models/form/lettings/questions/needs_type.rb b/app/models/form/lettings/questions/needs_type.rb index 9c32e30f9..87f331c07 100644 --- a/app/models/form/lettings/questions/needs_type.rb +++ b/app/models/form/lettings/questions/needs_type.rb @@ -4,7 +4,7 @@ class Form::Lettings::Questions::NeedsType < ::Form::Question @id = "needstype" @type = "radio" @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) if form.start_date.present? @top_guidance_partial = "needs_type" if form.start_year_2026_or_later? end @@ -13,5 +13,5 @@ class Form::Lettings::Questions::NeedsType < ::Form::Question "2" => { "value" => "Supported housing" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 3 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 3, 2024 => 3, 2025 => 3, 2026 => 3 }.freeze end diff --git a/app/models/form/lettings/questions/net_income_known.rb b/app/models/form/lettings/questions/net_income_known.rb index 01c3bcaa3..4bcbe7fd1 100644 --- a/app/models/form/lettings/questions/net_income_known.rb +++ b/app/models/form/lettings/questions/net_income_known.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::NetIncomeKnown < ::Form::Question @check_answers_card_number = 0 @top_guidance_partial = "what_counts_as_income" @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -16,5 +16,5 @@ class Form::Lettings::Questions::NetIncomeKnown < ::Form::Question "2" => { "value" => "Tenant prefers not to say" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 86, 2024 => 85 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 86, 2024 => 85, 2025 => 85, 2026 => 93 }.freeze end diff --git a/app/models/form/lettings/questions/offered.rb b/app/models/form/lettings/questions/offered.rb index c1aae8d32..38eccb40d 100644 --- a/app/models/form/lettings/questions/offered.rb +++ b/app/models/form/lettings/questions/offered.rb @@ -8,8 +8,8 @@ class Form::Lettings::Questions::Offered < ::Form::Question @max = 150 @min = 0 @step = 1 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 18 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 18, 2024 => 18, 2025 => 18, 2026 => 18 }.freeze end diff --git a/app/models/form/lettings/questions/period.rb b/app/models/form/lettings/questions/period.rb index 6f98bd2a8..a0fb51d9f 100644 --- a/app/models/form/lettings/questions/period.rb +++ b/app/models/form/lettings/questions/period.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::Period < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -22,7 +22,7 @@ class Form::Lettings::Questions::Period < ::Form::Question "10" => { "value" => "Weekly for 53 weeks" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 92, 2024 => 91 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 92, 2024 => 91, 2025 => 91, 2026 => 99 }.freeze def displayed_answer_options(log, _user) return ANSWER_OPTIONS if log.managing_organisation.nil? diff --git a/app/models/form/lettings/questions/person_partner.rb b/app/models/form/lettings/questions/person_partner.rb index 98a22a448..c7b673131 100644 --- a/app/models/form/lettings/questions/person_partner.rb +++ b/app/models/form/lettings/questions/person_partner.rb @@ -21,11 +21,17 @@ class Form::Lettings::Questions::PersonPartner < ::Form::Question base_question_number = case form.start_date.year when 2023 30 - else + when 2024 + 29 + when 2025 29 + when 2026 + 28 + else + 28 end - base_question_number + (4 * @person_index) + base_question_number + (form.person_question_count * @person_index) end def derived?(log) diff --git a/app/models/form/lettings/questions/person_sex_registered_at_birth.rb b/app/models/form/lettings/questions/person_sex_registered_at_birth.rb index e5c54058f..819cc2df1 100644 --- a/app/models/form/lettings/questions/person_sex_registered_at_birth.rb +++ b/app/models/form/lettings/questions/person_sex_registered_at_birth.rb @@ -18,7 +18,7 @@ class Form::Lettings::Questions::PersonSexRegisteredAtBirth < ::Form::Question def question_number base_question_number = 29 - base_question_number + (5 * @person_index) + base_question_number + (form.person_question_count * @person_index) end def label_from_value(value, _log = nil, _user = nil) diff --git a/app/models/form/lettings/questions/person_working_situation.rb b/app/models/form/lettings/questions/person_working_situation.rb index 74e11d030..0089416fb 100644 --- a/app/models/form/lettings/questions/person_working_situation.rb +++ b/app/models/form/lettings/questions/person_working_situation.rb @@ -57,10 +57,16 @@ class Form::Lettings::Questions::PersonWorkingSituation < ::Form::Question base_question_number = case form.start_date.year when 2023 33 - else + when 2024 + 32 + when 2025 32 + when 2026 + 31 + else + 31 end - base_question_number + (4 * @person_index) + base_question_number + (form.person_question_count * @person_index) end 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 114cf0db5..84c93f7d7 100644 --- a/app/models/form/lettings/questions/postcode_for_full_address.rb +++ b/app/models/form/lettings/questions/postcode_for_full_address.rb @@ -18,10 +18,10 @@ class Form::Lettings::Questions::PostcodeForFullAddress < ::Form::Question } @plain_label = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @hide_question_number_on_page = true @bottom_guidance_partial = "address_fallback" end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13, 2025 => 17 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13, 2025 => 17, 2026 => 17 }.freeze end diff --git a/app/models/form/lettings/questions/ppcodenk.rb b/app/models/form/lettings/questions/ppcodenk.rb index 5eec607eb..7cf7c63c2 100644 --- a/app/models/form/lettings/questions/ppcodenk.rb +++ b/app/models/form/lettings/questions/ppcodenk.rb @@ -8,7 +8,7 @@ class Form::Lettings::Questions::Ppcodenk < ::Form::Question @answer_options = ANSWER_OPTIONS @conditional_for = { "ppostcode_full" => [0] } @hidden_in_check_answers = { "depends_on" => [{ "ppcodenk" => 0 }, { "ppcodenk" => 1 }] } - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @disable_clearing_if_not_routed_or_dynamic_answer_options = true end @@ -17,5 +17,5 @@ class Form::Lettings::Questions::Ppcodenk < ::Form::Question "1" => { "value" => "No" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 80, 2024 => 79 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 80, 2024 => 79, 2025 => 79, 2026 => 86 }.freeze end diff --git a/app/models/form/lettings/questions/ppostcode_full.rb b/app/models/form/lettings/questions/ppostcode_full.rb index 804576ca1..41feded8f 100644 --- a/app/models/form/lettings/questions/ppostcode_full.rb +++ b/app/models/form/lettings/questions/ppostcode_full.rb @@ -13,9 +13,9 @@ class Form::Lettings::Questions::PpostcodeFull < ::Form::Question }] @check_answers_card_number = 0 @inferred_answers = { "prevloc" => { "is_previous_la_inferred" => true } } - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @disable_clearing_if_not_routed_or_dynamic_answer_options = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 80, 2024 => 79 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 80, 2024 => 79, 2025 => 79, 2026 => 86 }.freeze end diff --git a/app/models/form/lettings/questions/preg_occ.rb b/app/models/form/lettings/questions/preg_occ.rb index 1ad1bd1f5..03bae1c04 100644 --- a/app/models/form/lettings/questions/preg_occ.rb +++ b/app/models/form/lettings/questions/preg_occ.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::PregOcc < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -15,5 +15,5 @@ class Form::Lettings::Questions::PregOcc < ::Form::Question "3" => { "value" => "Tenant prefers not to say" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 69, 2024 => 68 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 69, 2024 => 68, 2025 => 68, 2026 => 75 }.freeze end diff --git a/app/models/form/lettings/questions/previous_la_known.rb b/app/models/form/lettings/questions/previous_la_known.rb index 2145e9d1f..b8721ff46 100644 --- a/app/models/form/lettings/questions/previous_la_known.rb +++ b/app/models/form/lettings/questions/previous_la_known.rb @@ -8,11 +8,11 @@ class Form::Lettings::Questions::PreviousLaKnown < ::Form::Question @answer_options = ANSWER_OPTIONS @conditional_for = { "prevloc" => [1] } @hidden_in_check_answers = { "depends_on" => [{ "previous_la_known" => 0 }, { "previous_la_known" => 1 }] } - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @disable_clearing_if_not_routed_or_dynamic_answer_options = true end ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "0" => { "value" => "No" } }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 81, 2024 => 80 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 81, 2024 => 80, 2025 => 80, 2026 => 87 }.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 8c35df84c..660e42869 100644 --- a/app/models/form/lettings/questions/previous_let_type.rb +++ b/app/models/form/lettings/questions/previous_let_type.rb @@ -4,7 +4,7 @@ class Form::Lettings::Questions::PreviousLetType < ::Form::Question @id = "unitletas" @type = "radio" @answer_options = answer_options - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -41,7 +41,7 @@ class Form::Lettings::Questions::PreviousLetType < ::Form::Question "3" => { "value" => "Don’t know" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 16, 2024 => 17, 2025 => 14 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 16, 2024 => 17, 2025 => 14, 2026 => 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/previous_tenure.rb b/app/models/form/lettings/questions/previous_tenure.rb index 47647b03c..65a3911b2 100644 --- a/app/models/form/lettings/questions/previous_tenure.rb +++ b/app/models/form/lettings/questions/previous_tenure.rb @@ -12,7 +12,7 @@ class Form::Lettings::Questions::PreviousTenure < ::Form::Question else ANSWER_OPTIONS end - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -103,5 +103,5 @@ class Form::Lettings::Questions::PreviousTenure < ::Form::Question "25" => { "value" => "Any other accommodation" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 78, 2024 => 77 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 78, 2024 => 77, 2025 => 77, 2026 => 84 }.freeze end diff --git a/app/models/form/lettings/questions/previous_tenure_renewal.rb b/app/models/form/lettings/questions/previous_tenure_renewal.rb index e932fd218..20f0900bb 100644 --- a/app/models/form/lettings/questions/previous_tenure_renewal.rb +++ b/app/models/form/lettings/questions/previous_tenure_renewal.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::PreviousTenureRenewal < ::Form::Question @type = "radio" @check_answers_card_number = 0 @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] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -22,5 +22,5 @@ class Form::Lettings::Questions::PreviousTenureRenewal < ::Form::Question "6" => { "value" => "Other supported housing" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 78, 2024 => 77 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 78, 2024 => 77, 2025 => 77, 2026 => 84 }.freeze end diff --git a/app/models/form/lettings/questions/prevloc.rb b/app/models/form/lettings/questions/prevloc.rb index 4ad7dbf11..0bf445956 100644 --- a/app/models/form/lettings/questions/prevloc.rb +++ b/app/models/form/lettings/questions/prevloc.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::Prevloc < ::Form::Question @type = "select" @inferred_check_answers_value = [{ "condition" => { "previous_la_known" => 0 }, "value" => "Not known" }] @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @disable_clearing_if_not_routed_or_dynamic_answer_options = true end @@ -14,5 +14,5 @@ class Form::Lettings::Questions::Prevloc < ::Form::Question { "" => "Select an option" }.merge(LocalAuthority.active(form.start_date).map { |la| [la.code, la.name] }.to_h) end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 81, 2024 => 80 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 81, 2024 => 80, 2025 => 80, 2026 => 87 }.freeze end diff --git a/app/models/form/lettings/questions/property_reference.rb b/app/models/form/lettings/questions/property_reference.rb index d4587ffe8..e81d4b6a2 100644 --- a/app/models/form/lettings/questions/property_reference.rb +++ b/app/models/form/lettings/questions/property_reference.rb @@ -4,8 +4,8 @@ class Form::Lettings::Questions::PropertyReference < ::Form::Question @id = "propcode" @type = "text" @width = 10 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) if form.start_date.present? end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 8, 2024 => 10 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 8, 2024 => 10, 2025 => 10, 2026 => 10 }.freeze end diff --git a/app/models/form/lettings/questions/pscharge_4_weekly.rb b/app/models/form/lettings/questions/pscharge_4_weekly.rb index 565be72c9..233e87854 100644 --- a/app/models/form/lettings/questions/pscharge_4_weekly.rb +++ b/app/models/form/lettings/questions/pscharge_4_weekly.rb @@ -12,9 +12,9 @@ class Form::Lettings::Questions::Pscharge4Weekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every 4 weeks" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96, 2025 => 94 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96, 2025 => 94, 2026 => 102 }.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 b8bb94f40..dcd1df89f 100644 --- a/app/models/form/lettings/questions/pscharge_bi_weekly.rb +++ b/app/models/form/lettings/questions/pscharge_bi_weekly.rb @@ -12,9 +12,9 @@ class Form::Lettings::Questions::PschargeBiWeekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every 2 weeks" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96, 2025 => 94 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96, 2025 => 94, 2026 => 102 }.freeze end diff --git a/app/models/form/lettings/questions/pscharge_monthly.rb b/app/models/form/lettings/questions/pscharge_monthly.rb index ccbd2655b..b5c175ceb 100644 --- a/app/models/form/lettings/questions/pscharge_monthly.rb +++ b/app/models/form/lettings/questions/pscharge_monthly.rb @@ -12,9 +12,9 @@ class Form::Lettings::Questions::PschargeMonthly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every month" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96, 2025 => 94 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96, 2025 => 94, 2026 => 102 }.freeze end diff --git a/app/models/form/lettings/questions/pscharge_weekly.rb b/app/models/form/lettings/questions/pscharge_weekly.rb index 9b0a0e320..4bf327c08 100644 --- a/app/models/form/lettings/questions/pscharge_weekly.rb +++ b/app/models/form/lettings/questions/pscharge_weekly.rb @@ -12,9 +12,9 @@ class Form::Lettings::Questions::PschargeWeekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every week" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96, 2025 => 94 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 97, 2024 => 96, 2025 => 94, 2026 => 102 }.freeze end diff --git a/app/models/form/lettings/questions/reason.rb b/app/models/form/lettings/questions/reason.rb index 7f0cd86a0..a40d9d134 100644 --- a/app/models/form/lettings/questions/reason.rb +++ b/app/models/form/lettings/questions/reason.rb @@ -10,7 +10,7 @@ class Form::Lettings::Questions::Reason < ::Form::Question 20, ], } - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -132,5 +132,5 @@ class Form::Lettings::Questions::Reason < ::Form::Question }.freeze, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2024 => 76 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2024 => 76, 2025 => 76, 2026 => 83 }.freeze end diff --git a/app/models/form/lettings/questions/reason_renewal.rb b/app/models/form/lettings/questions/reason_renewal.rb index c00bd2581..d5fccca67 100644 --- a/app/models/form/lettings/questions/reason_renewal.rb +++ b/app/models/form/lettings/questions/reason_renewal.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::ReasonRenewal < ::Form::Question @type = "radio" @copy_key = "lettings.household_situation.reason.#{page.id}.reason" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @conditional_for = { "reasonother" => [ 20, @@ -37,5 +37,5 @@ class Form::Lettings::Questions::ReasonRenewal < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 77, 2024 => 76 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 77, 2024 => 76, 2025 => 76, 2026 => 83 }.freeze end diff --git a/app/models/form/lettings/questions/reasonable_preference_reason.rb b/app/models/form/lettings/questions/reasonable_preference_reason.rb index 75b450b91..485ad830f 100644 --- a/app/models/form/lettings/questions/reasonable_preference_reason.rb +++ b/app/models/form/lettings/questions/reasonable_preference_reason.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::ReasonablePreferenceReason < ::Form::Question @type = "checkbox" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -17,5 +17,5 @@ class Form::Lettings::Questions::ReasonablePreferenceReason < ::Form::Question "rp_dontknow" => { "value" => "Don’t know" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 83, 2024 => 82 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 83, 2024 => 82, 2025 => 82, 2026 => 89 }.freeze end diff --git a/app/models/form/lettings/questions/reasonother.rb b/app/models/form/lettings/questions/reasonother.rb index 7e600916b..b92a7b8f4 100644 --- a/app/models/form/lettings/questions/reasonother.rb +++ b/app/models/form/lettings/questions/reasonother.rb @@ -5,8 +5,8 @@ class Form::Lettings::Questions::Reasonother < ::Form::Question @copy_key = "lettings.household_situation.reason.#{@page.id}.reasonother" @type = "text" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 77, 2024 => 76 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 77, 2024 => 76, 2025 => 76, 2026 => 83 }.freeze end diff --git a/app/models/form/lettings/questions/reasonpref.rb b/app/models/form/lettings/questions/reasonpref.rb index e63f65584..f54e98c15 100644 --- a/app/models/form/lettings/questions/reasonpref.rb +++ b/app/models/form/lettings/questions/reasonpref.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::Reasonpref < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -15,5 +15,5 @@ class Form::Lettings::Questions::Reasonpref < ::Form::Question "3" => { "value" => "Don’t know" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 82, 2024 => 81 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 82, 2024 => 81, 2025 => 81, 2026 => 88 }.freeze end diff --git a/app/models/form/lettings/questions/referral_direct.rb b/app/models/form/lettings/questions/referral_direct.rb index d79065df7..5373f3f3f 100644 --- a/app/models/form/lettings/questions/referral_direct.rb +++ b/app/models/form/lettings/questions/referral_direct.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::ReferralDirect < ::Form::Question @copy_key = "lettings.household_situation.referral.direct" @type = "radio" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options diff --git a/app/models/form/lettings/questions/referral_general_needs.rb b/app/models/form/lettings/questions/referral_general_needs.rb index 6c9f159e4..f2b2167a3 100644 --- a/app/models/form/lettings/questions/referral_general_needs.rb +++ b/app/models/form/lettings/questions/referral_general_needs.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::ReferralGeneralNeeds < ::Form::Question @copy_key = "lettings.household_situation.referral.general_needs.la" @type = "radio" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -93,5 +93,5 @@ class Form::Lettings::Questions::ReferralGeneralNeeds < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 85, 2024 => 84 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 85, 2024 => 84, 2025 => 84 }.freeze end diff --git a/app/models/form/lettings/questions/referral_general_needs_prp.rb b/app/models/form/lettings/questions/referral_general_needs_prp.rb index 492f32c8f..37d222961 100644 --- a/app/models/form/lettings/questions/referral_general_needs_prp.rb +++ b/app/models/form/lettings/questions/referral_general_needs_prp.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::ReferralGeneralNeedsPrp < ::Form::Question @copy_key = "lettings.household_situation.referral.general_needs.prp" @type = "radio" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -102,5 +102,5 @@ class Form::Lettings::Questions::ReferralGeneralNeedsPrp < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 85, 2024 => 84 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 85, 2024 => 84, 2025 => 84 }.freeze end diff --git a/app/models/form/lettings/questions/referral_hsc.rb b/app/models/form/lettings/questions/referral_hsc.rb index f049b6359..d589768a5 100644 --- a/app/models/form/lettings/questions/referral_hsc.rb +++ b/app/models/form/lettings/questions/referral_hsc.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::ReferralHsc < ::Form::Question @copy_key = "lettings.household_situation.referral.hsc" @type = "radio" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options diff --git a/app/models/form/lettings/questions/referral_justice.rb b/app/models/form/lettings/questions/referral_justice.rb index f222f5fe8..ccd836a2f 100644 --- a/app/models/form/lettings/questions/referral_justice.rb +++ b/app/models/form/lettings/questions/referral_justice.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::ReferralJustice < ::Form::Question @copy_key = "lettings.household_situation.referral.justice" @type = "radio" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options diff --git a/app/models/form/lettings/questions/referral_la.rb b/app/models/form/lettings/questions/referral_la.rb index 352457964..ede72194c 100644 --- a/app/models/form/lettings/questions/referral_la.rb +++ b/app/models/form/lettings/questions/referral_la.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::ReferralLa < ::Form::Question @copy_key = "lettings.household_situation.referral.la" @type = "radio" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options diff --git a/app/models/form/lettings/questions/referral_prp.rb b/app/models/form/lettings/questions/referral_prp.rb index 825967a3f..b0aed7b98 100644 --- a/app/models/form/lettings/questions/referral_prp.rb +++ b/app/models/form/lettings/questions/referral_prp.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::ReferralPrp < ::Form::Question @copy_key = "lettings.household_situation.referral.prp" @type = "radio" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options diff --git a/app/models/form/lettings/questions/referral_supported_housing.rb b/app/models/form/lettings/questions/referral_supported_housing.rb index 3a7ba04ac..2caddc8e2 100644 --- a/app/models/form/lettings/questions/referral_supported_housing.rb +++ b/app/models/form/lettings/questions/referral_supported_housing.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::ReferralSupportedHousing < ::Form::Question @copy_key = "lettings.household_situation.referral.supported_housing.la" @type = "radio" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -93,5 +93,5 @@ class Form::Lettings::Questions::ReferralSupportedHousing < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 85, 2024 => 84 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 85, 2024 => 84, 2025 => 84 }.freeze end diff --git a/app/models/form/lettings/questions/referral_supported_housing_prp.rb b/app/models/form/lettings/questions/referral_supported_housing_prp.rb index d0236f4af..89f02a723 100644 --- a/app/models/form/lettings/questions/referral_supported_housing_prp.rb +++ b/app/models/form/lettings/questions/referral_supported_housing_prp.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::ReferralSupportedHousingPrp < ::Form::Question @copy_key = "lettings.household_situation.referral.supported_housing.prp" @type = "radio" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -105,5 +105,5 @@ class Form::Lettings::Questions::ReferralSupportedHousingPrp < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 85, 2024 => 84 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 85, 2024 => 84, 2025 => 84 }.freeze end diff --git a/app/models/form/lettings/questions/referral_type.rb b/app/models/form/lettings/questions/referral_type.rb index b4bb87515..b84e85155 100644 --- a/app/models/form/lettings/questions/referral_type.rb +++ b/app/models/form/lettings/questions/referral_type.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::ReferralType < ::Form::Question @copy_key = "lettings.household_situation.referral.type" @type = "radio" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options diff --git a/app/models/form/lettings/questions/renewal.rb b/app/models/form/lettings/questions/renewal.rb index e78d98247..71007166b 100644 --- a/app/models/form/lettings/questions/renewal.rb +++ b/app/models/form/lettings/questions/renewal.rb @@ -4,7 +4,7 @@ class Form::Lettings::Questions::Renewal < ::Form::Question @id = "renewal" @type = "radio" @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) if form.start_date.present? end ANSWER_OPTIONS = { @@ -13,5 +13,5 @@ class Form::Lettings::Questions::Renewal < ::Form::Question } .freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 4, 2024 => 6 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 4, 2024 => 6, 2025 => 6, 2026 => 6 }.freeze end diff --git a/app/models/form/lettings/questions/rent_type.rb b/app/models/form/lettings/questions/rent_type.rb index 7700c5284..5940c18dc 100644 --- a/app/models/form/lettings/questions/rent_type.rb +++ b/app/models/form/lettings/questions/rent_type.rb @@ -7,7 +7,7 @@ class Form::Lettings::Questions::RentType < ::Form::Question @top_guidance_partial = "rent_type_definitions" @answer_options = answer_options @conditional_for = { "irproduct_other" => [5] } - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) if form.start_date.present? end ANSWER_OPTIONS = { @@ -29,7 +29,7 @@ class Form::Lettings::Questions::RentType < ::Form::Question "6" => { "value" => "Specified accommodation - exempt accommodation, managed properties, refuges and local authority hostels" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 6, 2024 => 8 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 6, 2024 => 8, 2025 => 8, 2026 => 8 }.freeze def answer_options form.start_year_2025_or_later? ? ANSWER_OPTIONS_2025 : ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/reservist.rb b/app/models/form/lettings/questions/reservist.rb index 023f1655d..f6e97c3d8 100644 --- a/app/models/form/lettings/questions/reservist.rb +++ b/app/models/form/lettings/questions/reservist.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::Reservist < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -15,5 +15,5 @@ class Form::Lettings::Questions::Reservist < ::Form::Question "3" => { "value" => "Person prefers not to say" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 68, 2024 => 67 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 68, 2024 => 67, 2025 => 67, 2026 => 74 }.freeze end diff --git a/app/models/form/lettings/questions/rsnvac.rb b/app/models/form/lettings/questions/rsnvac.rb index 42c8d9f92..48523b284 100644 --- a/app/models/form/lettings/questions/rsnvac.rb +++ b/app/models/form/lettings/questions/rsnvac.rb @@ -3,7 +3,7 @@ class Form::Lettings::Questions::Rsnvac < ::Form::Question super @id = "rsnvac" @type = "radio" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -98,5 +98,5 @@ class Form::Lettings::Questions::Rsnvac < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 17, 2024 => 18, 2025 => 15 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 17, 2024 => 18, 2025 => 15, 2026 => 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 01389871c..16d6219b6 100644 --- a/app/models/form/lettings/questions/rsnvac_first_let.rb +++ b/app/models/form/lettings/questions/rsnvac_first_let.rb @@ -4,7 +4,7 @@ class Form::Lettings::Questions::RsnvacFirstLet < ::Form::Question @id = "rsnvac" @type = "radio" @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -13,5 +13,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, 2025 => 13 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 15, 2024 => 16, 2025 => 13, 2026 => 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 8c4156774..e95f5b1d2 100644 --- a/app/models/form/lettings/questions/scharge_4_weekly.rb +++ b/app/models/form/lettings/questions/scharge_4_weekly.rb @@ -12,9 +12,9 @@ class Form::Lettings::Questions::Scharge4Weekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every 4 weeks" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95, 2025 => 93 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95, 2025 => 93, 2026 => 101 }.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 7803f8b37..24904797e 100644 --- a/app/models/form/lettings/questions/scharge_bi_weekly.rb +++ b/app/models/form/lettings/questions/scharge_bi_weekly.rb @@ -12,9 +12,9 @@ class Form::Lettings::Questions::SchargeBiWeekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every 2 weeks" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95, 2025 => 93 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95, 2025 => 93, 2026 => 101 }.freeze end diff --git a/app/models/form/lettings/questions/scharge_monthly.rb b/app/models/form/lettings/questions/scharge_monthly.rb index 073d4a772..631192bd4 100644 --- a/app/models/form/lettings/questions/scharge_monthly.rb +++ b/app/models/form/lettings/questions/scharge_monthly.rb @@ -12,9 +12,9 @@ class Form::Lettings::Questions::SchargeMonthly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every month" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95, 2025 => 93 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95, 2025 => 93, 2026 => 101 }.freeze end diff --git a/app/models/form/lettings/questions/scharge_weekly.rb b/app/models/form/lettings/questions/scharge_weekly.rb index b6befbad3..5f8aa9843 100644 --- a/app/models/form/lettings/questions/scharge_weekly.rb +++ b/app/models/form/lettings/questions/scharge_weekly.rb @@ -12,9 +12,9 @@ class Form::Lettings::Questions::SchargeWeekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every week" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95, 2025 => 93 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 96, 2024 => 95, 2025 => 93, 2026 => 101 }.freeze end diff --git a/app/models/form/lettings/questions/scheme_id.rb b/app/models/form/lettings/questions/scheme_id.rb index 862ef3130..c9b371f40 100644 --- a/app/models/form/lettings/questions/scheme_id.rb +++ b/app/models/form/lettings/questions/scheme_id.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::SchemeId < ::Form::Question @answer_options = answer_options @top_guidance_partial = "finding_scheme" @bottom_guidance_partial = "scheme_selection" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) if form.start_date.present? @inferred_answers = { "location.name": { "scheme_has_multiple_locations?": false, @@ -56,5 +56,5 @@ private false end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 9, 2024 => 4 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 9, 2024 => 4, 2025 => 4, 2026 => 4 }.freeze end diff --git a/app/models/form/lettings/questions/sheltered.rb b/app/models/form/lettings/questions/sheltered.rb index 35a16ae05..ca684c7af 100644 --- a/app/models/form/lettings/questions/sheltered.rb +++ b/app/models/form/lettings/questions/sheltered.rb @@ -3,7 +3,7 @@ class Form::Lettings::Questions::Sheltered < ::Form::Question super @id = "sheltered" @type = "radio" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -27,5 +27,5 @@ class Form::Lettings::Questions::Sheltered < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 29, 2024 => 29, 2025 => 25 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 29, 2024 => 29, 2025 => 25, 2026 => 24 }.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 dfda74bc0..4224781bd 100644 --- a/app/models/form/lettings/questions/starter_tenancy_type.rb +++ b/app/models/form/lettings/questions/starter_tenancy_type.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::StarterTenancyType < ::Form::Question @type = "radio" @check_answers_card_number = 0 @conditional_for = { "tenancyother" => [3] } - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -65,5 +65,5 @@ class Form::Lettings::Questions::StarterTenancyType < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 27, 2024 => 27, 2025 => 28 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 27, 2024 => 27, 2025 => 28, 2026 => 27 }.freeze end diff --git a/app/models/form/lettings/questions/startertenancy.rb b/app/models/form/lettings/questions/startertenancy.rb index 6bec6a360..464e5d3a6 100644 --- a/app/models/form/lettings/questions/startertenancy.rb +++ b/app/models/form/lettings/questions/startertenancy.rb @@ -5,10 +5,10 @@ class Form::Lettings::Questions::Startertenancy < ::Form::Question @type = "radio" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { "1" => { "value" => "Yes" }, "2" => { "value" => "No" } }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 26, 2024 => 26, 2025 => 27 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 26, 2024 => 26, 2025 => 27, 2026 => 26 }.freeze end diff --git a/app/models/form/lettings/questions/stock_owner.rb b/app/models/form/lettings/questions/stock_owner.rb index 466b08e3f..6d2ee1d64 100644 --- a/app/models/form/lettings/questions/stock_owner.rb +++ b/app/models/form/lettings/questions/stock_owner.rb @@ -4,7 +4,7 @@ class Form::Lettings::Questions::StockOwner < ::Form::Question @id = "owning_organisation_id" @derived = true @type = "select" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) if form.start_date.present? end def answer_options(log = nil, user = nil) @@ -86,5 +86,5 @@ private "#{name} (inactive as of #{merge_date.to_fs(:govuk_date)})" end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 1 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 1, 2024 => 1, 2025 => 1, 2026 => 1 }.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 227aead7a..1e3c502b2 100644 --- a/app/models/form/lettings/questions/supcharg_4_weekly.rb +++ b/app/models/form/lettings/questions/supcharg_4_weekly.rb @@ -12,9 +12,9 @@ class Form::Lettings::Questions::Supcharg4Weekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every 4 weeks" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97, 2025 => 95 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97, 2025 => 95, 2026 => 103 }.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 e01783122..4ad8048b8 100644 --- a/app/models/form/lettings/questions/supcharg_bi_weekly.rb +++ b/app/models/form/lettings/questions/supcharg_bi_weekly.rb @@ -12,9 +12,9 @@ class Form::Lettings::Questions::SupchargBiWeekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every 2 weeks" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97, 2025 => 95 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97, 2025 => 95, 2026 => 103 }.freeze end diff --git a/app/models/form/lettings/questions/supcharg_monthly.rb b/app/models/form/lettings/questions/supcharg_monthly.rb index 25da179d2..85060eda9 100644 --- a/app/models/form/lettings/questions/supcharg_monthly.rb +++ b/app/models/form/lettings/questions/supcharg_monthly.rb @@ -12,9 +12,9 @@ class Form::Lettings::Questions::SupchargMonthly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every month" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97, 2025 => 95 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97, 2025 => 95, 2026 => 103 }.freeze end diff --git a/app/models/form/lettings/questions/supcharg_weekly.rb b/app/models/form/lettings/questions/supcharg_weekly.rb index c6f7a666d..e34473e17 100644 --- a/app/models/form/lettings/questions/supcharg_weekly.rb +++ b/app/models/form/lettings/questions/supcharg_weekly.rb @@ -12,9 +12,9 @@ class Form::Lettings::Questions::SupchargWeekly < ::Form::Question @result_field = "tcharge" @prefix = "£" @suffix = " every week" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97, 2025 => 95 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 98, 2024 => 97, 2025 => 95, 2026 => 103 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length.rb b/app/models/form/lettings/questions/tenancy_length.rb index a3155f8c0..27ac9dbdc 100644 --- a/app/models/form/lettings/questions/tenancy_length.rb +++ b/app/models/form/lettings/questions/tenancy_length.rb @@ -9,8 +9,8 @@ class Form::Lettings::Questions::TenancyLength < ::Form::Question @max = 150 @min = 0 @step = 1 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 28, 2025 => 29 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 28, 2025 => 29, 2026 => 28 }.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 58b83fe90..f26adbe6f 100644 --- a/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb +++ b/app/models/form/lettings/questions/tenancy_length_affordable_rent.rb @@ -9,8 +9,8 @@ class Form::Lettings::Questions::TenancyLengthAffordableRent < ::Form::Question @max = 150 @min = 0 @step = 1 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 28, 2025 => 29 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 28, 2025 => 29, 2026 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb b/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb index c85583d95..ed3a13b0c 100644 --- a/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb +++ b/app/models/form/lettings/questions/tenancy_length_intermediate_rent.rb @@ -9,8 +9,8 @@ class Form::Lettings::Questions::TenancyLengthIntermediateRent < ::Form::Questio @max = 150 @min = 0 @step = 1 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 28, 2025 => 29 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 28, 2025 => 29, 2026 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_length_periodic.rb b/app/models/form/lettings/questions/tenancy_length_periodic.rb index e7f9336ec..85041680e 100644 --- a/app/models/form/lettings/questions/tenancy_length_periodic.rb +++ b/app/models/form/lettings/questions/tenancy_length_periodic.rb @@ -9,8 +9,8 @@ class Form::Lettings::Questions::TenancyLengthPeriodic < ::Form::Question @max = 150 @min = 0 @step = 1 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 28, 2025 => 29 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 28, 2024 => 28, 2025 => 29, 2026 => 28 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_other.rb b/app/models/form/lettings/questions/tenancy_other.rb index 8a8a94108..6f455fead 100644 --- a/app/models/form/lettings/questions/tenancy_other.rb +++ b/app/models/form/lettings/questions/tenancy_other.rb @@ -5,8 +5,8 @@ class Form::Lettings::Questions::TenancyOther < ::Form::Question @copy_key = "lettings.tenancy_information.tenancy.#{page.id}.tenancyother" @type = "text" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 27, 2024 => 27, 2025 => 28 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 27, 2024 => 27, 2025 => 28, 2026 => 27 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_start_date.rb b/app/models/form/lettings/questions/tenancy_start_date.rb index b7d82b399..fc5137626 100644 --- a/app/models/form/lettings/questions/tenancy_start_date.rb +++ b/app/models/form/lettings/questions/tenancy_start_date.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::TenancyStartDate < ::Form::Question @id = "startdate" @type = "date" @unresolved_hint_text = "Some scheme details have changed, and now this log needs updating. Check that the tenancy start date is correct." - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) if form.start_date.present? end def date_example_override(log) @@ -20,5 +20,5 @@ class Form::Lettings::Questions::TenancyStartDate < ::Form::Question I18n.t("forms.#{form.start_date.year}.#{copy_key}.example", default: "", example_date:) end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 5, 2024 => 7 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 5, 2024 => 7, 2025 => 7, 2026 => 7 }.freeze end diff --git a/app/models/form/lettings/questions/tenancy_type.rb b/app/models/form/lettings/questions/tenancy_type.rb index 96fda2687..d2b9a5925 100644 --- a/app/models/form/lettings/questions/tenancy_type.rb +++ b/app/models/form/lettings/questions/tenancy_type.rb @@ -6,7 +6,7 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question @type = "radio" @check_answers_card_number = 0 @conditional_for = { "tenancyother" => [3] } - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -65,5 +65,5 @@ class Form::Lettings::Questions::TenancyType < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 27, 2024 => 27, 2025 => 28 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 27, 2024 => 27, 2025 => 28, 2026 => 27 }.freeze end diff --git a/app/models/form/lettings/questions/tenant_code.rb b/app/models/form/lettings/questions/tenant_code.rb index 7b7be3cac..36b3d0aee 100644 --- a/app/models/form/lettings/questions/tenant_code.rb +++ b/app/models/form/lettings/questions/tenant_code.rb @@ -4,8 +4,8 @@ class Form::Lettings::Questions::TenantCode < ::Form::Question @id = "tenancycode" @type = "text" @width = 10 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] if form.start_date.present? + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) if form.start_date.present? end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 7, 2024 => 9 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 7, 2024 => 9, 2025 => 9, 2026 => 9 }.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 5673b7f01..6db52c92d 100644 --- a/app/models/form/lettings/questions/town_or_city.rb +++ b/app/models/form/lettings/questions/town_or_city.rb @@ -6,9 +6,9 @@ class Form::Lettings::Questions::TownOrCity < ::Form::Question @type = "text" @plain_label = true @disable_clearing_if_not_routed_or_dynamic_answer_options = true - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @hide_question_number_on_page = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13, 2025 => 17 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 12, 2024 => 13, 2025 => 17, 2026 => 17 }.freeze end diff --git a/app/models/form/lettings/questions/tshortfall.rb b/app/models/form/lettings/questions/tshortfall.rb index ced2a426a..a271f9e06 100644 --- a/app/models/form/lettings/questions/tshortfall.rb +++ b/app/models/form/lettings/questions/tshortfall.rb @@ -21,9 +21,9 @@ class Form::Lettings::Questions::Tshortfall < ::Form::Question { "label" => " every week for 52 weeks", "depends_on" => { "period" => 1 } }, { "label" => " every week for 53 weeks", "depends_on" => { "period" => 10 } }, ] - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @strip_commas = true end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 100, 2024 => 99, 2025 => 97 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 100, 2024 => 99, 2025 => 97, 2026 => 105 }.freeze end diff --git a/app/models/form/lettings/questions/tshortfall_known.rb b/app/models/form/lettings/questions/tshortfall_known.rb index 8ba0b038c..97b41a09b 100644 --- a/app/models/form/lettings/questions/tshortfall_known.rb +++ b/app/models/form/lettings/questions/tshortfall_known.rb @@ -7,10 +7,10 @@ class Form::Lettings::Questions::TshortfallKnown < ::Form::Question @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS @conditional_for = { "tshortfall" => [0] } - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 100, 2024 => 99, 2025 => 97 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 100, 2024 => 99, 2025 => 97, 2026 => 105 }.freeze end diff --git a/app/models/form/lettings/questions/unittype_gn.rb b/app/models/form/lettings/questions/unittype_gn.rb index ad8298929..34391bf83 100644 --- a/app/models/form/lettings/questions/unittype_gn.rb +++ b/app/models/form/lettings/questions/unittype_gn.rb @@ -4,7 +4,7 @@ class Form::Lettings::Questions::UnittypeGn < ::Form::Question @id = "unittype_gn" @type = "radio" @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -18,5 +18,5 @@ class Form::Lettings::Questions::UnittypeGn < ::Form::Question "6" => { "value" => "Other" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 19 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 19, 2024 => 19, 2025 => 19, 2026 => 19 }.freeze end diff --git a/app/models/form/lettings/questions/uprn.rb b/app/models/form/lettings/questions/uprn.rb index 7f1f240f9..98ffb75c2 100644 --- a/app/models/form/lettings/questions/uprn.rb +++ b/app/models/form/lettings/questions/uprn.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::Uprn < ::Form::Question @copy_key = "lettings.property_information.uprn.uprn" @type = "text" @width = 10 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @inferred_check_answers_value = [ { "condition" => { "uprn_known" => 0 }, @@ -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, 2025 => 16 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 11, 2024 => 12, 2025 => 16, 2026 => 16 }.freeze end diff --git a/app/models/form/lettings/questions/uprn_known.rb b/app/models/form/lettings/questions/uprn_known.rb index 6ac70e415..5dab0f35a 100644 --- a/app/models/form/lettings/questions/uprn_known.rb +++ b/app/models/form/lettings/questions/uprn_known.rb @@ -18,7 +18,7 @@ class Form::Lettings::Questions::UprnKnown < ::Form::Question { "uprn_known" => 1 }, ], } - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -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, 2025 => 16 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 11, 2024 => 12, 2025 => 16, 2026 => 16 }.freeze end diff --git a/app/models/form/lettings/questions/voiddate.rb b/app/models/form/lettings/questions/voiddate.rb index 3bce8a7b8..afdbb01ae 100644 --- a/app/models/form/lettings/questions/voiddate.rb +++ b/app/models/form/lettings/questions/voiddate.rb @@ -3,9 +3,9 @@ class Form::Lettings::Questions::Voiddate < ::Form::Question super @id = "voiddate" @type = "date" - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) @top_guidance_partial = "void_date" end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 23 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 23, 2024 => 23, 2025 => 23, 2026 => 22 }.freeze end diff --git a/app/models/form/lettings/questions/waityear.rb b/app/models/form/lettings/questions/waityear.rb index 5c81fdedc..7e0f2b77e 100644 --- a/app/models/form/lettings/questions/waityear.rb +++ b/app/models/form/lettings/questions/waityear.rb @@ -4,7 +4,7 @@ class Form::Lettings::Questions::Waityear < ::Form::Question @id = "waityear" @type = "radio" @check_answers_card_number = 0 - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -49,5 +49,5 @@ class Form::Lettings::Questions::Waityear < ::Form::Question }.freeze end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 76, 2024 => 75 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 76, 2024 => 75, 2025 => 75, 2026 => 82 }.freeze end diff --git a/app/models/form/lettings/questions/wheelchair.rb b/app/models/form/lettings/questions/wheelchair.rb index 9da5399e6..289e298f5 100644 --- a/app/models/form/lettings/questions/wheelchair.rb +++ b/app/models/form/lettings/questions/wheelchair.rb @@ -4,7 +4,7 @@ class Form::Lettings::Questions::Wheelchair < ::Form::Question @id = "wchair" @type = "radio" @answer_options = ANSWER_OPTIONS - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end ANSWER_OPTIONS = { @@ -12,5 +12,5 @@ class Form::Lettings::Questions::Wheelchair < ::Form::Question "2" => { "value" => "No" }, }.freeze - QUESTION_NUMBER_FROM_YEAR = { 2023 => 21 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 21, 2024 => 21, 2025 => 21, 2026 => 20 }.freeze end diff --git a/app/models/form/lettings/questions/working_situation1.rb b/app/models/form/lettings/questions/working_situation1.rb index 6098eb136..0a0221579 100644 --- a/app/models/form/lettings/questions/working_situation1.rb +++ b/app/models/form/lettings/questions/working_situation1.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::WorkingSituation1 < ::Form::Question @type = "radio" @check_answers_card_number = 1 @answer_options = answer_options - @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] + @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end def answer_options @@ -40,5 +40,5 @@ class Form::Lettings::Questions::WorkingSituation1 < ::Form::Question end end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 37, 2024 => 36 }.freeze + QUESTION_NUMBER_FROM_YEAR = { 2023 => 37, 2024 => 36, 2025 => 36, 2026 => 36 }.freeze end diff --git a/app/models/form/question.rb b/app/models/form/question.rb index e5bc0c9a6..be90899f9 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -367,7 +367,7 @@ private inferred_answer["value"] if inferred_answer.present? end - # every year currently visible should be specified. + # every year currently visible should have an explicit question number specified. # however, form_handler.rb will still initialise the next form even if its not visible. # so we have a fallback to the latest year for these future years so all question have a question number. def get_question_number_from_hash(hash) diff --git a/lib/tasks/add_new_year_to_questions.rake b/lib/tasks/add_new_year_to_questions.rake new file mode 100644 index 000000000..bd5a75cd3 --- /dev/null +++ b/lib/tasks/add_new_year_to_questions.rake @@ -0,0 +1,54 @@ +require "pathname" + +desc "Add a new year to all lettings question number hashes and saves the new code. +Usage: bundle exec rake add_new_year_to_questions[new_year,log_type]. +Example: bundle exec rake add_new_year_to_questions[2027,lettings]. +This rake should only be run as part of local development at the start of new collection year creation. +Make sure your working tree is clean before running this, it will update each question file in place. +Note that this will only update questions with a QUESTION_NUMBER_FROM_YEAR hash set. +Some questions (such as any of the per person questions) which define custom question logic will need manual review. +Params: +- new_year: the year to add, e.g. 2025 +- log_type: the type of log to update. can be lettings or sales" +task :add_new_year_to_questions, %i[new_year log_type] => :environment do |_task, args| + new_year = args[:new_year].to_i + previous_year = new_year - 1 + + root = Pathname.new("app/models/form/#{args[:log_type]}/questions") + files = root.glob("*.rb") + + hash_re = /QUESTION_NUMBER_FROM_YEAR\s*=\s*\{([^}]*)}\.freeze/m + + changed = [] + + files.each do |path| + text = path.read + next unless text.include?("QUESTION_NUMBER_FROM_YEAR") + + match = hash_re.match(text) + next unless match + + body = match[1] + pairs = body.scan(/(\d+)\s*=>\s*(\d+)/) + next if pairs.empty? + + year_to_num = pairs.to_h { |y, n| [y.to_i, n.to_i] } + next if year_to_num.key?(new_year) + next unless year_to_num.key?(previous_year) + + year_to_num[new_year] = year_to_num[previous_year] + + items = year_to_num.keys.sort.map { |y| "#{y} => #{year_to_num[y]}" }.join(", ") + replacement = "QUESTION_NUMBER_FROM_YEAR = { #{items} }.freeze" + + new_text = text.sub(hash_re, replacement) + + next if new_text == text + + path.write(new_text) + changed << path + end + + puts "changed #{changed.length}" + changed.each { |p| puts p } +end diff --git a/spec/models/form/lettings/pages/person_age_spec.rb b/spec/models/form/lettings/pages/person_age_spec.rb index 2043052fd..d782b01fa 100644 --- a/spec/models/form/lettings/pages/person_age_spec.rb +++ b/spec/models/form/lettings/pages/person_age_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Form::Lettings::Pages::PersonAge, type: :model do subject(:page) { described_class.new(nil, page_definition, subsection, person_index:) } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: false)) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2024_or_later?: false, start_year_2026_or_later?: false, person_question_count: 4)) } let(:person_index) { 2 } it "has correct subsection" do diff --git a/spec/models/form/lettings/pages/person_lead_partner_spec.rb b/spec/models/form/lettings/pages/person_lead_partner_spec.rb index 55ee97e1d..ce5e258f0 100644 --- a/spec/models/form/lettings/pages/person_lead_partner_spec.rb +++ b/spec/models/form/lettings/pages/person_lead_partner_spec.rb @@ -4,7 +4,9 @@ RSpec.describe Form::Lettings::Pages::PersonLeadPartner, type: :model do subject(:page) { described_class.new(nil, page_definition, subsection, person_index:) } let(:page_definition) { nil } - let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:start_year_2026_or_later?) { false } + let(:person_question_count) { 4 } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2026_or_later?: start_year_2026_or_later?, person_question_count:) } let(:subsection) { instance_double(Form::Subsection, form:) } let(:person_index) { 2 } @@ -26,9 +28,7 @@ RSpec.describe Form::Lettings::Pages::PersonLeadPartner, type: :model do end context "with start year < 2026", metadata: { year: 25 } do - before do - allow(form).to receive(:start_year_2026_or_later?).and_return(false) - end + let(:person_question_count) { 4 } it "has correct depends_on" do expect(page.depends_on).to eq( @@ -38,9 +38,8 @@ RSpec.describe Form::Lettings::Pages::PersonLeadPartner, type: :model do end context "with start year >= 2026", metadata: { year: 26 } do - before do - allow(form).to receive(:start_year_2026_or_later?).and_return(true) - end + let(:start_year_2026_or_later?) { true } + let(:person_question_count) { 5 } it "has correct depends_on" do expect(page.depends_on).to eq( @@ -71,9 +70,7 @@ RSpec.describe Form::Lettings::Pages::PersonLeadPartner, type: :model do end context "with start year < 2026", metadata: { year: 25 } do - before do - allow(form).to receive(:start_year_2026_or_later?).and_return(false) - end + let(:person_question_count) { 4 } it "has correct depends_on" do expect(page.depends_on).to eq( @@ -83,9 +80,8 @@ RSpec.describe Form::Lettings::Pages::PersonLeadPartner, type: :model do end context "with start year >= 2026", metadata: { year: 26 } do - before do - allow(form).to receive(:start_year_2026_or_later?).and_return(true) - end + let(:start_year_2026_or_later?) { true } + let(:person_question_count) { 5 } it "has correct depends_on" do expect(page.depends_on).to eq( diff --git a/spec/models/form/lettings/pages/person_sex_registered_at_birth_spec.rb b/spec/models/form/lettings/pages/person_sex_registered_at_birth_spec.rb index 628fe5f30..30feef7b4 100644 --- a/spec/models/form/lettings/pages/person_sex_registered_at_birth_spec.rb +++ b/spec/models/form/lettings/pages/person_sex_registered_at_birth_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Form::Lettings::Pages::PersonSexRegisteredAtBirth, type: :model d subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2026, 4, 1))) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2026, 4, 1), person_question_count: 5)) } let(:person_index) { 1 } let(:page_id) { "person_2_sex_registered_at_birth" } diff --git a/spec/models/form/lettings/pages/person_working_situation_spec.rb b/spec/models/form/lettings/pages/person_working_situation_spec.rb index a88cdcde0..2c0e6e50a 100644 --- a/spec/models/form/lettings/pages/person_working_situation_spec.rb +++ b/spec/models/form/lettings/pages/person_working_situation_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Form::Lettings::Pages::PersonWorkingSituation, type: :model do subject(:page) { described_class.new(nil, page_definition, subsection, person_index:) } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1))) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2026_or_later?: false, person_question_count: 4)) } let(:person_index) { 2 } before do diff --git a/spec/models/form/lettings/questions/age_known_spec.rb b/spec/models/form/lettings/questions/age_known_spec.rb index 5f7946a16..7a1835628 100644 --- a/spec/models/form/lettings/questions/age_known_spec.rb +++ b/spec/models/form/lettings/questions/age_known_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Form::Lettings::Questions::AgeKnown, type: :model do subject(:question) { described_class.new(nil, question_definition, page, person_index:) } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4)))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), person_question_count: 4))) } let(:person_index) { 2 } it "has correct page" do diff --git a/spec/models/form/lettings/questions/age_spec.rb b/spec/models/form/lettings/questions/age_spec.rb index 639f695fd..8d3003b82 100644 --- a/spec/models/form/lettings/questions/age_spec.rb +++ b/spec/models/form/lettings/questions/age_spec.rb @@ -1,10 +1,15 @@ require "rails_helper" RSpec.describe Form::Lettings::Questions::Age, type: :model do + include CollectionTimeHelper + subject(:question) { described_class.new(nil, question_definition, page, person_index:) } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), start_year_2024_or_later?: false))) } + let(:start_year_2026_or_later?) { false } + let(:person_question_count) { 5 } + let(:start_year) { current_collection_start_year } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: collection_start_date_for_year(start_year), start_year_2024_or_later?: true, start_year_2026_or_later?: start_year_2026_or_later?, person_question_count:))) } let(:person_index) { 2 } it "has correct page" do @@ -48,6 +53,25 @@ RSpec.describe Form::Lettings::Questions::Age, type: :model do it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end + + context "with year 2025", metadata: { year: 25 } do + let(:start_year) { 2025 } + let(:person_question_count) { 4 } + + it "has the correct question number" do + expect(question.question_number).to eq(38) + end + end + + context "with year 2026", metadata: { year: 26 } do + let(:start_year_2026_or_later?) { true } + let(:start_year) { 2026 } + let(:person_question_count) { 5 } + + it "has the correct question number" do + expect(question.question_number).to eq(37) + end + end end context "with person 3" do @@ -69,5 +93,24 @@ RSpec.describe Form::Lettings::Questions::Age, type: :model do it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(3) end + + context "with year 2025", metadata: { year: 25 } do + let(:start_year) { 2025 } + let(:person_question_count) { 4 } + + it "has the correct question number" do + expect(question.question_number).to eq(42) + end + end + + context "with year 2026", metadata: { year: 26 } do + let(:start_year_2026_or_later?) { true } + let(:start_year) { 2026 } + let(:person_question_count) { 5 } + + it "has the correct question number" do + expect(question.question_number).to eq(42) + end + end end end diff --git a/spec/models/form/lettings/questions/person_partner_spec.rb b/spec/models/form/lettings/questions/person_partner_spec.rb index 2106bc36f..cfe12fae2 100644 --- a/spec/models/form/lettings/questions/person_partner_spec.rb +++ b/spec/models/form/lettings/questions/person_partner_spec.rb @@ -7,6 +7,7 @@ RSpec.describe Form::Lettings::Questions::PersonPartner, type: :model do let(:question_definition) { nil } let(:year) { nil } + let(:person_question_count) { 5 } let(:page) do instance_double( Form::Page, @@ -17,6 +18,7 @@ RSpec.describe Form::Lettings::Questions::PersonPartner, type: :model do start_date: year ? collection_start_date_for_year(year) : current_collection_start_date, start_year_2025_or_later?: year.nil? || year >= 2025, start_year_2026_or_later?: year.nil? || year >= 2026, + person_question_count:, ), ), ) diff --git a/spec/models/form/lettings/questions/person_sex_registered_at_birth_spec.rb b/spec/models/form/lettings/questions/person_sex_registered_at_birth_spec.rb index 90f48cfda..afa6e59a7 100644 --- a/spec/models/form/lettings/questions/person_sex_registered_at_birth_spec.rb +++ b/spec/models/form/lettings/questions/person_sex_registered_at_birth_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Form::Lettings::Questions::PersonSexRegisteredAtBirth, type: :mod let(:page) { instance_double(Form::Page) } let(:person_index) { 2 } let(:subsection) { instance_double(Form::Subsection) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2026, 4, 1)) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2026, 4, 1), person_question_count: 5) } before do allow(page).to receive(:subsection).and_return(subsection) diff --git a/spec/models/form/lettings/questions/person_working_situation_spec.rb b/spec/models/form/lettings/questions/person_working_situation_spec.rb index 503c699b2..b56c543a8 100644 --- a/spec/models/form/lettings/questions/person_working_situation_spec.rb +++ b/spec/models/form/lettings/questions/person_working_situation_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Form::Lettings::Questions::PersonWorkingSituation, type: :model d subject(:question) { described_class.new(nil, question_definition, page, person_index:) } let(:question_definition) { nil } - let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2025, 4, 4)))) } + let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2025, 4, 4), start_year_2026_or_later?: false, person_question_count: 4))) } let(:person_index) { 2 } before do From e5eae1c19b8fc5ec30a9954dbe61039fa8941214 Mon Sep 17 00:00:00 2001 From: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com> Date: Mon, 23 Feb 2026 17:49:51 +0000 Subject: [PATCH 10/11] CLDC-4139: Tenancy type other free text validation (#3174) * Add functionality * Fix/add tests * Update config/locales/forms/2026/lettings/soft_validations.en.yml Co-authored-by: Samuel Young * Update after PO feedback * Fix tests after rebase --------- Co-authored-by: Samuel Young --- .../pages/tenancyother_value_check.rb | 24 ++++++++++++ .../questions/tenancyother_value_check.rb | 13 +++++++ .../subsections/tenancy_information.rb | 1 + app/models/validations/soft_validations.rb | 10 +++++ .../2026/lettings/soft_validations.en.yml | 17 +++++++++ ...nancyother_value_check_to_lettings_logs.rb | 5 +++ db/schema.rb | 3 +- .../lettings_log_csv_export_codes_26.csv | 6 +-- .../lettings_log_csv_export_labels_26.csv | 6 +-- .../subsections/tenancy_information_spec.rb | 20 ++++++++++ .../validations/soft_validations_spec.rb | 38 +++++++++++++++++++ 11 files changed, 136 insertions(+), 7 deletions(-) create mode 100644 app/models/form/lettings/pages/tenancyother_value_check.rb create mode 100644 app/models/form/lettings/questions/tenancyother_value_check.rb create mode 100644 db/migrate/20260212091506_add_tenancyother_value_check_to_lettings_logs.rb diff --git a/app/models/form/lettings/pages/tenancyother_value_check.rb b/app/models/form/lettings/pages/tenancyother_value_check.rb new file mode 100644 index 000000000..391b06eab --- /dev/null +++ b/app/models/form/lettings/pages/tenancyother_value_check.rb @@ -0,0 +1,24 @@ +class Form::Lettings::Pages::TenancyotherValueCheck < ::Form::Page + def initialize(id, hsh, subsection) + super + @id = "tenancyother_value_check" + @copy_key = "lettings.soft_validations.tenancyother_value_check" + @depends_on = [{ "tenancyother_might_be_introductory_or_starter_period?" => true }] + @title_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [{ "key" => "tenancyother", "i18n_template" => "tenancyother" }], + } + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } + end + + def questions + @questions ||= [Form::Lettings::Questions::TenancyotherValueCheck.new(nil, nil, self)] + end + + def interruption_screen_question_ids + %w[startertenancy tenancy tenancyother] + end +end diff --git a/app/models/form/lettings/questions/tenancyother_value_check.rb b/app/models/form/lettings/questions/tenancyother_value_check.rb new file mode 100644 index 000000000..309de7169 --- /dev/null +++ b/app/models/form/lettings/questions/tenancyother_value_check.rb @@ -0,0 +1,13 @@ +class Form::Lettings::Questions::TenancyotherValueCheck < ::Form::Question + def initialize(id, hsh, page) + super + @id = "tenancyother_value_check" + @copy_key = "lettings.soft_validations.tenancyother_value_check" + @type = "interruption_screen" + @check_answers_card_number = 0 + @answer_options = ANSWER_OPTIONS + @hidden_in_check_answers = { "depends_on" => [{ "tenancyother_value_check" => 0 }, { "tenancyother_value_check" => 1 }] } + end + + ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze +end diff --git a/app/models/form/lettings/subsections/tenancy_information.rb b/app/models/form/lettings/subsections/tenancy_information.rb index b65039b8d..e6ff48457 100644 --- a/app/models/form/lettings/subsections/tenancy_information.rb +++ b/app/models/form/lettings/subsections/tenancy_information.rb @@ -12,6 +12,7 @@ class Form::Lettings::Subsections::TenancyInformation < ::Form::Subsection Form::Lettings::Pages::StarterTenancy.new("starter_tenancy", nil, self), Form::Lettings::Pages::TenancyType.new(nil, nil, self), Form::Lettings::Pages::StarterTenancyType.new(nil, nil, self), + (Form::Lettings::Pages::TenancyotherValueCheck.new(nil, nil, self) if form.start_year_2026_or_later?), Form::Lettings::Pages::TenancyLength.new(nil, nil, self), Form::Lettings::Pages::TenancyLengthAffordableRent.new(nil, nil, self), Form::Lettings::Pages::TenancyLengthIntermediateRent.new(nil, nil, self), diff --git a/app/models/validations/soft_validations.rb b/app/models/validations/soft_validations.rb index 9b6816dd1..ea17d0601 100644 --- a/app/models/validations/soft_validations.rb +++ b/app/models/validations/soft_validations.rb @@ -194,6 +194,16 @@ module Validations::SoftValidations PHRASES_LIKELY_TO_INDICATE_EXISTING_REASON_CATEGORY_REGEX.match?(reasonother) end + PHRASES_LIKELY_TO_INDICATE_INTRODUCTORY_OR_STARTER_PERIOD = %w[introductory intro starter].freeze + + PHRASES_LIKELY_TO_INDICATE_INTRODUCTORY_OR_STARTER_PERIOD_REGEX = Regexp.union( + PHRASES_LIKELY_TO_INDICATE_INTRODUCTORY_OR_STARTER_PERIOD.map { |phrase| Regexp.new("\\b[^[:alpha]]*#{phrase}[^[:alpha:]]*\\b", Regexp::IGNORECASE) }, + ) + + def tenancyother_might_be_introductory_or_starter_period? + PHRASES_LIKELY_TO_INDICATE_INTRODUCTORY_OR_STARTER_PERIOD_REGEX.match?(tenancyother) + end + def multiple_partners? return unless hhmemb diff --git a/config/locales/forms/2026/lettings/soft_validations.en.yml b/config/locales/forms/2026/lettings/soft_validations.en.yml index 74e7af46f..88bcaf1ea 100644 --- a/config/locales/forms/2026/lettings/soft_validations.en.yml +++ b/config/locales/forms/2026/lettings/soft_validations.en.yml @@ -57,6 +57,23 @@ en: title_text: "You told us that the tenant’s main reason for leaving their last settled home was %{reasonother}." informative_text: "The reason you have entered looks very similar to one of the existing response categories. Please check the categories and select the appropriate one. If the existing categories are not suitable, please confirm here to move onto the next question." + tenancyother_value_check: + page_header: "" + check_answer_label: "Tenancy other confirmation" + check_answer_prompt: "Confirm tenancy type" + hint_text: "" + question_text: "" + title_text: "You told us that the type of tenancy was %{tenancyother}." + informative_text: "We already know whether the tenancy is introductory or has a starter period from your previous answer. Your answer to the type of main tenancy question should be the type of tenancy that the tenant will roll onto after any introductory or starter period. Choose from the categories or write a description if no category is suitable." + referral_value_check: + page_header: "" + check_answer_label: "Referral confirmation" + check_answer_prompt: "Confirm referral type" + hint_text: "" + question_text: "Are you sure?" + title_text: "Are you sure?" + informative_text: "This is a general needs log, and this referral type is for supported housing." + net_income_value_check: page_header: "" check_answer_label: "Net income confirmation" diff --git a/db/migrate/20260212091506_add_tenancyother_value_check_to_lettings_logs.rb b/db/migrate/20260212091506_add_tenancyother_value_check_to_lettings_logs.rb new file mode 100644 index 000000000..339dc7a07 --- /dev/null +++ b/db/migrate/20260212091506_add_tenancyother_value_check_to_lettings_logs.rb @@ -0,0 +1,5 @@ +class AddTenancyotherValueCheckToLettingsLogs < ActiveRecord::Migration[7.0] + def change + add_column :lettings_logs, :tenancyother_value_check, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 19faeed2a..62d32713f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.2].define(version: 2026_02_04_100051) do +ActiveRecord::Schema[7.2].define(version: 2026_02_12_091506) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -403,6 +403,7 @@ ActiveRecord::Schema[7.2].define(version: 2026_02_04_100051) do t.integer "referral_register" t.integer "referral_noms" t.integer "referral_org" + t.integer "tenancyother_value_check" t.index ["assigned_to_id"], name: "index_lettings_logs_on_assigned_to_id" t.index ["bulk_upload_id"], name: "index_lettings_logs_on_bulk_upload_id" t.index ["created_by_id"], name: "index_lettings_logs_on_created_by_id" diff --git a/spec/fixtures/files/lettings_log_csv_export_codes_26.csv b/spec/fixtures/files/lettings_log_csv_export_codes_26.csv index aacc8581d..b99c44ce8 100644 --- a/spec/fixtures/files/lettings_log_csv_export_codes_26.csv +++ b/spec/fixtures/files/lettings_log_csv_export_codes_26.csv @@ -1,3 +1,3 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is the UPRN known?,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter 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?,The following soft validation was confirmed: You have said that at least one person's situation is 'Unable to work because of long-term sickness or disability'.,Are the details of tenant 2 known?,What is person 2's age?,What is person 2's relationship to the lead tenant?,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 was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter 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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",Which of these best describes person 3's working situation?,Are the details of tenant 4 known?,What is person 4's age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",Which of these best describes person 4's working situation?,Are the details of tenant 5 known?,What is person 5's age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",Which of these best describes person 5's working situation?,Are the details of tenant 6 known?,What is person 6's age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",Which of these best describes person 6's working situation?,Are the details of tenant 7 known?,What is person 7's age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter 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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter 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?,What was the source of referral for this letting?,What was the source of referral for this letting?,Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? -id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,uprn_known,uprn_selection,address_search_value_check,address_line1_input,postcode_full_input,address_line1_as_entered,address_line2_as_entered,town_or_city_as_entered,county_as_entered,postcode_full_as_entered,la_as_entered,unittype_gn,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sexrab1,gender_same_as_sex1,gender_description1,ethnic_group,ethnic,nationality_all,ecstat1,working_situation_illness_check,details_known_2,age2,relat2,multiple_partners_value_check,sexrab2,gender_same_as_sex2,gender_description2,ecstat2,details_known_3,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,ecstat3,details_known_4,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,ecstat4,details_known_5,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,ecstat5,details_known_6,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,ecstat6,details_known_7,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,ecstat7,details_known_8,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,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_register,referral_noms,referral_org,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate -,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,1,2026,,MHCLG,MHCLG,1,7,0,2026-04-01,2,2,,,2,HIJKLMN,ABCDEFG,1,0,2,6,2,,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,7,1,3,2026-03-30,1,,1,2026-03-31,,,3,1,4,,2,4,,1,4,0,0,2,35,,F,1,,0,2,36,0,,0,32,P,,M,2,Non-binary,6,1,-9,R,R,3,,10,0,-9,R,R,3,,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,1,,,0,0,1,268,,6,1,1,,,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,,,,,,,,,,,,,,,,,,,, +Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is the UPRN known?,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",,What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter 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?,The following soft validation was confirmed: You have said that at least one person's situation is 'Unable to work because of long-term sickness or disability'.,Are the details of tenant 2 known?,What is person 2's age?,What is person 2's relationship to the lead tenant?,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 was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter 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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",Which of these best describes person 3's working situation?,Are the details of tenant 4 known?,What is person 4's age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",Which of these best describes person 4's working situation?,Are the details of tenant 5 known?,What is person 5's age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",Which of these best describes person 5's working situation?,Are the details of tenant 6 known?,What is person 6's age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",Which of these best describes person 6's working situation?,Are the details of tenant 7 known?,What is person 7's age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter 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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter 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?,What was the source of referral for this letting?,What was the source of referral for this letting?,Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? +id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,uprn_known,uprn_selection,address_search_value_check,address_line1_input,postcode_full_input,address_line1_as_entered,address_line2_as_entered,town_or_city_as_entered,county_as_entered,postcode_full_as_entered,la_as_entered,unittype_gn,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,sheltered,joint,startertenancy,tenancy,tenancyother,tenancyother_value_check,tenancylength,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sexrab1,gender_same_as_sex1,gender_description1,ethnic_group,ethnic,nationality_all,ecstat1,working_situation_illness_check,details_known_2,age2,relat2,multiple_partners_value_check,sexrab2,gender_same_as_sex2,gender_description2,ecstat2,details_known_3,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,ecstat3,details_known_4,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,ecstat4,details_known_5,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,ecstat5,details_known_6,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,ecstat6,details_known_7,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,ecstat7,details_known_8,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,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_register,referral_noms,referral_org,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate +,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,1,2026,,MHCLG,MHCLG,1,7,0,2026-04-01,2,2,,,2,HIJKLMN,ABCDEFG,1,0,2,6,2,,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,7,1,3,2026-03-30,1,,1,2026-03-31,,,3,1,4,,,2,4,,1,4,0,0,2,35,,F,1,,0,2,36,0,,0,32,P,,M,2,Non-binary,6,1,-9,R,R,3,,10,0,-9,R,R,3,,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,1,,,0,0,1,268,,6,1,1,,,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_26.csv b/spec/fixtures/files/lettings_log_csv_export_labels_26.csv index 5a24e5c31..eb7cfd35c 100644 --- a/spec/fixtures/files/lettings_log_csv_export_labels_26.csv +++ b/spec/fixtures/files/lettings_log_csv_export_labels_26.csv @@ -1,3 +1,3 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is the UPRN known?,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter 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?,The following soft validation was confirmed: You have said that at least one person's situation is 'Unable to work because of long-term sickness or disability'.,Are the details of tenant 2 known?,What is person 2's age?,What is person 2's relationship to the lead tenant?,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 was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter 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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",Which of these best describes person 3's working situation?,Are the details of tenant 4 known?,What is person 4's age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",Which of these best describes person 4's working situation?,Are the details of tenant 5 known?,What is person 5's age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",Which of these best describes person 5's working situation?,Are the details of tenant 6 known?,What is person 6's age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",Which of these best describes person 6's working situation?,Are the details of tenant 7 known?,What is person 7's age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter 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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter 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?,What was the source of referral for this letting?,What was the source of referral for this letting?,Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? -id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,uprn_known,uprn_selection,address_search_value_check,address_line1_input,postcode_full_input,address_line1_as_entered,address_line2_as_entered,town_or_city_as_entered,county_as_entered,postcode_full_as_entered,la_as_entered,unittype_gn,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,sheltered,joint,startertenancy,tenancy,tenancyother,tenancylength,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sexrab1,gender_same_as_sex1,gender_description1,ethnic_group,ethnic,nationality_all,ecstat1,working_situation_illness_check,details_known_2,age2,relat2,multiple_partners_value_check,sexrab2,gender_same_as_sex2,gender_description2,ecstat2,details_known_3,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,ecstat3,details_known_4,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,ecstat4,details_known_5,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,ecstat5,details_known_6,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,ecstat6,details_known_7,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,ecstat7,details_known_8,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,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_register,referral_noms,referral_org,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate -,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,single log,2026,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2026-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,Affordable rent basis,Tenant abandoned property,No,,Address line 1,,London,,NW9 5LL,No,Barnet,E09000003,No,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,House,Yes,3,2026-03-30,1,,Yes,2026-03-31,,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,4,,Yes,4,0,0,2,35,,Female,Yes,,White,Irish,Australia,Other,,Yes,32,Yes,,Male,"No, enter gender identity",Non-binary,Not seeking work,No,Not known,Prefers not to say,Prefers not to say,Prefers not to say,,Prefers not to say,Yes,Not known,Tenant prefers not to say,Prefers not to say,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,Renewal to the same tenant in the same property,,,Yes,No,Weekly,268,,Universal Credit housing element,Yes,All,,,Every 2 weeks,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,Yes,Yes,12.0,6.0,,,,,,,,,,,,,,,,,,,, +Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is the UPRN known?,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,What type of unit is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this letting in sheltered accommodation?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",,What is the length of the fixed-term tenancy to the nearest year?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,What was the lead tenant's sex at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter 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?,The following soft validation was confirmed: You have said that at least one person's situation is 'Unable to work because of long-term sickness or disability'.,Are the details of tenant 2 known?,What is person 2's age?,What is person 2's relationship to the lead tenant?,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 was person 2's sex at birth?,Is the gender person 2 identifies with the same as their sex registered at birth?,"If 'No', enter 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 age?,What is person 3's relationship to the lead tenant?,What was person 3's sex at birth?,Is the gender person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",Which of these best describes person 3's working situation?,Are the details of tenant 4 known?,What is person 4's age?,What is person 4's relationship to the lead tenant?,What was person 4's sex at birth?,Is the gender person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",Which of these best describes person 4's working situation?,Are the details of tenant 5 known?,What is person 5's age?,What is person 5's relationship to the lead tenant?,What was person 5's sex at birth?,Is the gender person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",Which of these best describes person 5's working situation?,Are the details of tenant 6 known?,What is person 6's age?,What is person 6's relationship to the lead tenant?,What was person 6's sex at birth?,Is the gender person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",Which of these best describes person 6's working situation?,Are the details of tenant 7 known?,What is person 7's age?,What is person 7's relationship to the lead tenant?,What was person 7's sex at birth?,Is the gender person 7 identifies with the same as their sex registered at birth?,"If 'No', enter 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 age?,What is person 8's relationship to the lead tenant?,What was person 8's sex at birth?,Is the gender person 8 identifies with the same as their sex registered at birth?,"If 'No', enter 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?,What was the source of referral for this letting?,What was the source of referral for this letting?,Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? +id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,uprn,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,uprn_known,uprn_selection,address_search_value_check,address_line1_input,postcode_full_input,address_line1_as_entered,address_line2_as_entered,town_or_city_as_entered,county_as_entered,postcode_full_as_entered,la_as_entered,unittype_gn,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,sheltered,joint,startertenancy,tenancy,tenancyother,tenancyother_value_check,tenancylength,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sexrab1,gender_same_as_sex1,gender_description1,ethnic_group,ethnic,nationality_all,ecstat1,working_situation_illness_check,details_known_2,age2,relat2,multiple_partners_value_check,sexrab2,gender_same_as_sex2,gender_description2,ecstat2,details_known_3,age3,relat3,sexrab3,gender_same_as_sex3,gender_description3,ecstat3,details_known_4,age4,relat4,sexrab4,gender_same_as_sex4,gender_description4,ecstat4,details_known_5,age5,relat5,sexrab5,gender_same_as_sex5,gender_description5,ecstat5,details_known_6,age6,relat6,sexrab6,gender_same_as_sex6,gender_description6,ecstat6,details_known_7,age7,relat7,sexrab7,gender_same_as_sex7,gender_description7,ecstat7,details_known_8,age8,relat8,sexrab8,gender_same_as_sex8,gender_description8,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_register,referral_noms,referral_org,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate +,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2026-04-01T00:00:00+01:00,,2026-04-01T00:00:00+01:00,single log,2026,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2026-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,Affordable rent basis,Tenant abandoned property,No,,Address line 1,,London,,NW9 5LL,No,Barnet,E09000003,No,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,House,Yes,3,2026-03-30,1,,Yes,2026-03-31,,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,,2,4,,Yes,4,0,0,2,35,,Female,Yes,,White,Irish,Australia,Other,,Yes,32,Yes,,Male,"No, enter gender identity",Non-binary,Not seeking work,No,Not known,Prefers not to say,Prefers not to say,Prefers not to say,,Prefers not to say,Yes,Not known,Tenant prefers not to say,Prefers not to say,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,Renewal to the same tenant in the same property,,,Yes,No,Weekly,268,,Universal Credit housing element,Yes,All,,,Every 2 weeks,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,Yes,Yes,12.0,6.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/models/form/lettings/subsections/tenancy_information_spec.rb b/spec/models/form/lettings/subsections/tenancy_information_spec.rb index 70663629c..290850cf6 100644 --- a/spec/models/form/lettings/subsections/tenancy_information_spec.rb +++ b/spec/models/form/lettings/subsections/tenancy_information_spec.rb @@ -18,6 +18,7 @@ RSpec.describe Form::Lettings::Subsections::TenancyInformation, type: :model do 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) + allow(form).to receive(:start_year_2026_or_later?).and_return(false) end context "when 2023" do @@ -26,6 +27,7 @@ RSpec.describe Form::Lettings::Subsections::TenancyInformation, type: :model do before do allow(form).to receive(:start_year_2024_or_later?).and_return(false) allow(form).to receive(:start_year_2025_or_later?).and_return(false) + allow(form).to receive(:start_year_2026_or_later?).and_return(false) end it "has correct pages" do @@ -41,6 +43,7 @@ RSpec.describe Form::Lettings::Subsections::TenancyInformation, type: :model do 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) + allow(form).to receive(:start_year_2026_or_later?).and_return(false) end it "has correct pages" do @@ -56,6 +59,7 @@ RSpec.describe Form::Lettings::Subsections::TenancyInformation, type: :model do 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) + allow(form).to receive(:start_year_2026_or_later?).and_return(false) end it "has correct pages" do @@ -64,6 +68,22 @@ RSpec.describe Form::Lettings::Subsections::TenancyInformation, type: :model do ) end end + + context "when 2026" do + let(:start_date) { Time.utc(2026, 2, 8) } + + 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) + allow(form).to receive(:start_year_2026_or_later?).and_return(true) + end + + it "has correct pages" do + expect(tenancy_information.pages.map(&:id)).to eq( + %w[joint starter_tenancy tenancy_type starter_tenancy_type tenancyother_value_check tenancy_length tenancy_length_affordable_rent tenancy_length_intermediate_rent tenancy_length_periodic], + ) + end + end end it "has the correct id" do diff --git a/spec/models/validations/soft_validations_spec.rb b/spec/models/validations/soft_validations_spec.rb index 02b383acf..9026b03dc 100644 --- a/spec/models/validations/soft_validations_spec.rb +++ b/spec/models/validations/soft_validations_spec.rb @@ -1535,6 +1535,44 @@ RSpec.describe Validations::SoftValidations do end end + describe "tenancyother_might_be_introductory_or_starter_period?" do + it "returns true if tenancyother is exactly in the 'likely introductory/starter period' list" do + record.tenancyother = "introductory" + + expect(record).to be_tenancyother_might_be_introductory_or_starter_period + end + + it "returns true if any word of tenancyother is exactly in the 'likely introductory/starter period' list" do + record.tenancyother = "a starter tenancy" + + expect(record).to be_tenancyother_might_be_introductory_or_starter_period + end + + it "is not case sensitive when matching" do + record.tenancyother = "Intro" + + expect(record).to be_tenancyother_might_be_introductory_or_starter_period + end + + it "returns false if no part of tenancyother is in the 'likely introductory/starter period' list" do + record.tenancyother = "other" + + expect(record).not_to be_tenancyother_might_be_introductory_or_starter_period + end + + it "returns false if match to the 'likely introductory/starter period' list is only part of a word" do + record.tenancyother = "wasintroductory" + + expect(record).not_to be_tenancyother_might_be_introductory_or_starter_period + end + + it "ignores neighbouring non-alphabet for matching" do + record.tenancyother = "1starter." + + expect(record).to be_tenancyother_might_be_introductory_or_starter_period + end + end + describe "at_least_one_working_situation_is_sickness_and_household_sickness_is_no" do it "returns true if one person has working situation as illness and household sickness is no" do record.illness = 2 From d79cfcd4151f42ebc7916e595e0ea5e4979a43d1 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Wed, 25 Feb 2026 09:25:19 +0000 Subject: [PATCH 11/11] CLDC-4237: Upgrade ruby version (#3190) * CLDC-4237: Upgrade ruby to 3.4.4 * CLDC-4237: Add additional build dependencies to Dockerfile * CLDC-4237: Update rubocop * CLDC-4237: Fix new rubocop rules most auto applies RSpec/IndexedLet had 200 hits needing manual correction so left these for now * CLDC-4237: Resolve vulnerable dependencies * CLDC-4237: Fix erb files * CLDC-4237: Downgrade connection_pool --- .erb-lint.yml => .erb_lint.yml | 0 .rubocop.yml | 5 + .ruby-version | 2 +- Dockerfile | 4 +- Gemfile | 11 +- Gemfile.lock | 111 ++++++++------ app/controllers/csv_downloads_controller.rb | 2 +- app/controllers/lettings_logs_controller.rb | 2 +- .../lettings_logs_filters_controller.rb | 2 - app/controllers/merge_requests_controller.rb | 2 +- .../sales_logs_filters_controller.rb | 2 - .../bulk_upload/lettings_log_to_csv.rb | 2 - app/helpers/bulk_upload/sales_log_to_csv.rb | 2 - app/helpers/data_sharing_agreement_helper.rb | 2 +- app/helpers/form_page_error_helper.rb | 2 +- app/helpers/locations_helper.rb | 3 +- app/helpers/merge_requests_helper.rb | 4 +- app/helpers/notifications_helper.rb | 4 +- app/helpers/question_view_helper.rb | 3 +- app/helpers/schemes_helper.rb | 3 +- app/mailers/devise_notify_mailer.rb | 3 +- .../lettings_log_variables.rb | 10 +- app/models/derived_variables/shared_logic.rb | 2 +- app/models/form/sales/pages/deposit.rb | 3 +- .../form/sales/questions/deposit_amount.rb | 6 +- .../form/sales/questions/mortgage_amount.rb | 3 +- .../form/sales/questions/mortgageused.rb | 3 +- .../form/sales/questions/purchase_price.rb | 3 +- app/models/form/subsection.rb | 2 +- app/models/lettings_log.rb | 6 +- app/models/sales_log.rb | 2 +- .../sales/sale_information_validations.rb | 2 +- .../validations/sales/soft_validations.rb | 2 +- app/models/validations/shared_validations.rb | 10 +- app/policies/location_policy.rb | 2 +- app/policies/organisation_policy.rb | 2 +- app/policies/scheme_policy.rb | 2 +- .../lettings/year2023/row_parser.rb | 22 ++- .../lettings/year2024/row_parser.rb | 10 +- .../lettings/year2025/row_parser.rb | 10 +- .../lettings/year2026/row_parser.rb | 10 +- .../bulk_upload/sales/year2023/row_parser.rb | 43 ++++-- .../bulk_upload/sales/year2024/row_parser.rb | 40 +++-- .../bulk_upload/sales/year2025/row_parser.rb | 39 +++-- .../bulk_upload/sales/year2026/row_parser.rb | 39 +++-- app/services/csv/lettings_log_csv_service.rb | 6 +- app/services/csv/sales_log_csv_service.rb | 3 +- app/services/documentation_generator.rb | 2 +- .../exports/organisation_export_constants.rb | 2 +- app/services/filter_manager.rb | 2 +- app/views/form/_checkbox_question.html.erb | 2 +- .../_interruption_screen_question.html.erb | 4 +- app/views/form/_radio_question.html.erb | 4 +- .../rails_admin/main/_submit_buttons.html.erb | 2 +- app/views/rails_admin/main/dashboard.html.erb | 2 +- app/views/rails_admin/main/delete.html.erb | 2 +- config/initializers/multi_logger.rb | 8 +- config/initializers/sidekiq.rb | 2 +- config/routes.rb | 4 +- ..._storage_variant_records.active_storage.rb | 2 +- docs/setup.md | 4 +- .../generate_lettings_documentation.rake | 2 +- lib/tasks/generate_sales_documentation.rake | 2 +- lib/tasks/handle_unpended_logs.rake | 4 +- lib/tasks/lint.rake | 2 +- .../set_log_validation_collection_year.rake | 2 +- .../bulk_upload_error_row_component_spec.rb | 2 +- ...nswers_summary_list_card_component_spec.rb | 4 +- .../create_log_actions_component_spec.rb | 16 +- ...tion_confirmation_banner_component_spec.rb | 28 ++-- spec/db/seeds_spec.rb | 3 +- .../factories/data_protection_confirmation.rb | 2 +- spec/features/accessibility_spec.rb | 2 +- .../bulk_upload_lettings_logs_spec.rb | 4 +- spec/features/bulk_upload_sales_logs_spec.rb | 4 +- .../form/accessible_autocomplete_spec.rb | 20 +-- spec/features/form/address_search_spec.rb | 6 +- spec/features/form/checkboxes_spec.rb | 2 +- .../form/conditional_questions_spec.rb | 6 +- spec/features/form/page_routing_spec.rb | 28 ++-- .../form/progressive_total_field_spec.rb | 4 +- spec/features/form/saving_data_spec.rb | 2 +- spec/features/form/validations_spec.rb | 2 +- spec/features/lettings_log_spec.rb | 6 +- spec/features/sales_log_spec.rb | 4 +- spec/features/schemes_spec.rb | 4 +- spec/features/user_spec.rb | 10 +- .../collection_resources_helper_spec.rb | 2 +- .../helpers/question_attribute_helper_spec.rb | 4 +- spec/helpers/tag_helper_spec.rb | 2 +- spec/helpers/tasklist_helper_spec.rb | 8 +- spec/jobs/process_merge_request_job_spec.rb | 4 +- .../tasks/clear_unconfirmed_emails_spec.rb | 4 +- .../local_authority_links_import_spec.rb | 2 +- .../tasks/set_export_collection_years_spec.rb | 4 +- .../set_sales_managing_organisation_spec.rb | 8 +- ...ate_schemes_and_locations_from_csv_spec.rb | 22 +-- spec/mailers/devise_notify_mailer_spec.rb | 5 +- spec/models/bulk_upload_spec.rb | 4 +- .../care_home_charges_value_check_spec.rb | 2 +- .../form/lettings/pages/created_by_spec.rb | 10 +- ...t_household_person_age_value_check_spec.rb | 2 +- ...gnant_household_person_value_check_spec.rb | 2 +- .../pages/managing_organisation_spec.rb | 24 +-- .../multiple_partners_value_check_spec.rb | 2 +- .../lettings/pages/no_address_found_spec.rb | 2 +- ...t_household_person_age_value_check_spec.rb | 2 +- ...gnant_household_person_value_check_spec.rb | 2 +- .../pages/partner_under16_value_check_spec.rb | 2 +- .../form/lettings/pages/person_age_spec.rb | 2 +- .../pages/person_gender_identity_spec.rb | 2 +- .../form/lettings/pages/person_known_spec.rb | 2 +- .../pages/person_lead_partner_spec.rb | 2 +- ...person_over_retirement_value_check_spec.rb | 2 +- .../pages/person_relationship_to_lead_spec.rb | 2 +- ...erson_under_retirement_value_check_spec.rb | 2 +- .../pages/person_working_situation_spec.rb | 2 +- .../lettings/pages/property_reference_spec.rb | 2 +- .../lettings/pages/referral_noms_hr_spec.rb | 2 +- .../pages/referral_noms_la_hr_spec.rb | 2 +- .../referral_org_directly_referred_spec.rb | 2 +- .../pages/referral_org_nominated_spec.rb | 2 +- .../pages/referral_register_la_spec.rb | 2 +- .../pages/referral_register_prp_spec.rb | 2 +- .../form/lettings/pages/renewal_spec.rb | 2 +- .../form/lettings/pages/rent_type_spec.rb | 3 +- .../form/lettings/pages/stock_owner_spec.rb | 16 +- .../lettings/pages/tenancy_start_date_spec.rb | 2 +- .../form/lettings/pages/tenant_code_spec.rb | 2 +- .../lettings/pages/uprn_selection_spec.rb | 2 +- .../address_line1_for_address_matcher_spec.rb | 4 +- .../lettings/questions/address_line2_spec.rb | 2 +- .../lettings/questions/location_id_spec.rb | 4 +- .../questions/net_income_known_spec.rb | 4 +- .../questions/no_address_found_spec.rb | 2 +- .../lettings/questions/person_partner_spec.rb | 4 +- .../questions/person_relationship_spec.rb | 4 +- .../person_working_situation_spec.rb | 4 +- .../postcode_for_address_matcher_spec.rb | 4 +- .../questions/previous_let_type_spec.rb | 3 +- .../form/lettings/questions/reason_spec.rb | 4 +- .../form/lettings/questions/scheme_id_spec.rb | 11 +- .../form/lettings/questions/sheltered_spec.rb | 6 +- .../questions/uprn_confirmation_spec.rb | 6 +- .../lettings/questions/uprn_selection_spec.rb | 6 +- .../form/lettings/questions/waityear_spec.rb | 3 +- .../form/lettings/sections/household_spec.rb | 2 +- .../sections/rent_and_charges_spec.rb | 2 +- .../sections/tenancy_and_property_spec.rb | 2 +- .../household_characteristics_spec.rb | 11 +- .../subsections/household_needs_spec.rb | 6 +- .../subsections/household_situation_spec.rb | 11 +- .../subsections/property_information_spec.rb | 20 +-- .../subsections/tenancy_information_spec.rb | 20 +-- spec/models/form/page_spec.rb | 3 +- .../pages/about_price_value_check_spec.rb | 2 +- .../sales/pages/buyer1_ethnic_group_spec.rb | 8 +- ..._income_discounted_max_value_check_spec.rb | 2 +- .../buyer1_income_ecstat_value_check_spec.rb | 2 +- .../pages/buyer1_live_in_property_spec.rb | 10 +- .../sales/pages/buyer1_nationality_spec.rb | 8 +- .../pages/buyer1_working_situation_spec.rb | 8 +- .../sales/pages/buyer2_ethnic_group_spec.rb | 8 +- ..._income_discounted_max_value_check_spec.rb | 2 +- .../buyer2_income_ecstat_value_check_spec.rb | 2 +- .../pages/buyer2_live_in_property_spec.rb | 10 +- .../sales/pages/buyer2_nationality_spec.rb | 8 +- .../pages/buyer2_working_situation_spec.rb | 8 +- .../pages/buyer_live_in_value_check_spec.rb | 2 +- .../form/sales/pages/buyer_live_spec.rb | 6 +- .../form/sales/pages/buyer_previous_spec.rb | 10 +- .../sales/pages/buyers_organisations_spec.rb | 2 +- .../combined_income_max_value_check_spec.rb | 2 +- .../form/sales/pages/created_by_spec.rb | 2 +- spec/models/form/sales/pages/deposit_spec.rb | 2 +- .../sales/pages/deposit_value_check_spec.rb | 2 +- .../pages/discounted_sale_value_check_spec.rb | 2 +- .../form/sales/pages/extra_borrowing_spec.rb | 2 +- .../sales/pages/handover_date_check_spec.rb | 2 +- .../pages/household_wheelchair_check_spec.rb | 2 +- .../form/sales/pages/joint_purchase_spec.rb | 6 +- .../form/sales/pages/la_nominations_spec.rb | 10 +- .../sales/pages/leasehold_charges_spec.rb | 2 +- .../pages/living_before_purchase_spec.rb | 18 +-- .../sales/pages/managing_organisation_spec.rb | 38 ++--- .../pages/monthly_charges_value_check_spec.rb | 2 +- .../form/sales/pages/mortgage_amount_spec.rb | 2 +- .../form/sales/pages/mortgage_length_spec.rb | 2 +- .../sales/pages/mortgage_value_check_spec.rb | 2 +- .../multiple_partners_value_check_spec.rb | 2 +- .../form/sales/pages/no_address_found_spec.rb | 2 +- .../number_of_others_in_property_spec.rb | 8 +- .../sales/pages/owning_organisation_spec.rb | 18 +-- .../pages/partner_under16_value_check_spec.rb | 2 +- .../percentage_discount_value_check_spec.rb | 2 +- .../pages/person_gender_identity_spec.rb | 2 +- ...rson_student_not_child_value_check_spec.rb | 2 +- .../pages/retirement_value_check_spec.rb | 2 +- .../form/sales/pages/sale_date_check_spec.rb | 2 +- .../sales/pages/savings_value_check_spec.rb | 2 +- .../form/sales/pages/service_charge_spec.rb | 2 +- .../pages/staircase_owned_value_check_spec.rb | 2 +- .../sales/pages/uprn_confirmation_spec.rb | 8 +- .../form/sales/pages/uprn_selection_spec.rb | 2 +- .../address_line1_for_address_matcher_spec.rb | 4 +- .../sales/questions/address_line2_spec.rb | 2 +- .../sales/questions/buyer_previous_spec.rb | 2 +- .../combined_income_value_check_spec.rb | 2 +- .../sales/questions/deposit_amount_spec.rb | 6 +- .../discounted_ownership_type_spec.rb | 6 +- .../sales/questions/extra_borrowing_spec.rb | 2 +- .../sales/questions/housing_benefits_spec.rb | 3 +- .../sales/questions/la_nominations_spec.rb | 2 +- .../form/sales/questions/mortgageused_spec.rb | 8 +- .../sales/questions/no_address_found_spec.rb | 2 +- .../questions/outright_ownership_type_spec.rb | 8 +- .../sales/questions/ownership_scheme_spec.rb | 6 +- .../questions/owning_organisation_id_spec.rb | 8 +- .../postcode_for_address_matcher_spec.rb | 4 +- .../form/sales/questions/prevown_spec.rb | 2 +- .../form/sales/questions/prevshared_spec.rb | 2 +- .../property_local_authority_spec.rb | 6 +- .../form/sales/questions/resale_spec.rb | 2 +- .../sales/questions/staircase_bought_spec.rb | 2 +- .../sales/questions/staircase_count_spec.rb | 2 +- .../questions/staircase_first_time_spec.rb | 2 +- .../questions/staircase_initial_date_spec.rb | 2 +- .../questions/staircase_last_date_spec.rb | 2 +- .../sales/questions/staircase_owned_spec.rb | 2 +- .../staircase_owned_value_check_spec.rb | 2 +- .../sales/questions/staircase_sale_spec.rb | 2 +- .../form/sales/questions/staircase_spec.rb | 2 +- .../sales/questions/uprn_confirmation_spec.rb | 6 +- .../sales/questions/uprn_selection_spec.rb | 6 +- .../discounted_ownership_scheme_spec.rb | 4 +- .../household_characteristics_spec.rb | 24 +-- .../sales/subsections/outright_sale_spec.rb | 14 +- .../subsections/property_information_spec.rb | 9 +- .../form/sales/subsections/setup_spec.rb | 9 +- .../shared_ownership_initial_purchase_spec.rb | 6 +- .../shared_ownership_scheme_spec.rb | 4 +- spec/models/form_spec.rb | 32 ++-- .../bulk_upload_form/upload_your_file_spec.rb | 2 +- .../forms/bulk_upload_form/year_spec.rb | 8 +- spec/models/forms/delete_logs_form_spec.rb | 4 +- .../lettings_log_derived_fields_spec.rb | 16 +- spec/models/lettings_log_spec.rb | 134 ++++++++--------- .../location_deactivation_period_spec.rb | 3 +- spec/models/location_spec.rb | 8 +- spec/models/organisation_spec.rb | 6 +- spec/models/sales_log_spec.rb | 46 +++--- .../models/scheme_deactivation_period_spec.rb | 3 +- spec/models/user_spec.rb | 15 +- .../validations/household_validations_spec.rb | 2 +- .../sale_information_validations_spec.rb | 4 +- spec/presenters/homepage_presenter_spec.rb | 6 +- spec/rails_helper.rb | 2 +- spec/request_helper.rb | 4 +- ...anisations_controller_rent_periods_spec.rb | 2 +- .../address_search_controller_spec.rb | 138 +++++++++--------- spec/requests/check_errors_controller_spec.rb | 24 +-- spec/requests/content_controller_spec.rb | 3 +- spec/requests/cookies_controller_spec.rb | 3 +- spec/requests/delete_logs_controller_spec.rb | 72 ++++----- .../duplicate_logs_controller_spec.rb | 15 +- spec/requests/form_controller_spec.rb | 13 +- .../requests/lettings_logs_controller_spec.rb | 14 +- spec/requests/locations_controller_spec.rb | 42 +++--- spec/requests/maintenance_controller_spec.rb | 3 +- .../merge_requests_controller_spec.rb | 6 +- .../requests/organisations_controller_spec.rb | 24 +-- spec/requests/sales_logs_controller_spec.rb | 8 +- spec/requests/schemes_controller_spec.rb | 116 +++++++-------- spec/requests/users_controller_spec.rb | 8 +- .../bulk_upload/lettings/log_creator_spec.rb | 7 +- .../bulk_upload/lettings/validator_spec.rb | 2 +- .../lettings/year2023/csv_parser_spec.rb | 2 +- .../lettings/year2023/row_parser_spec.rb | 10 +- .../lettings/year2024/csv_parser_spec.rb | 2 +- .../lettings/year2024/row_parser_spec.rb | 16 +- .../lettings/year2025/csv_parser_spec.rb | 2 +- .../lettings/year2025/row_parser_spec.rb | 14 +- .../lettings/year2026/csv_parser_spec.rb | 2 +- .../lettings/year2026/row_parser_spec.rb | 14 +- spec/services/bulk_upload/processor_spec.rb | 25 ++-- .../bulk_upload/sales/log_creator_spec.rb | 7 +- .../bulk_upload/sales/validator_spec.rb | 2 +- .../sales/year2023/csv_parser_spec.rb | 2 +- .../sales/year2023/row_parser_spec.rb | 4 +- .../sales/year2024/csv_parser_spec.rb | 2 +- .../sales/year2024/row_parser_spec.rb | 12 +- .../sales/year2025/csv_parser_spec.rb | 2 +- .../sales/year2025/row_parser_spec.rb | 12 +- .../sales/year2026/csv_parser_spec.rb | 2 +- .../sales/year2026/row_parser_spec.rb | 12 +- .../csv/lettings_log_csv_service_spec.rb | 4 +- .../csv/sales_log_csv_service_spec.rb | 3 +- spec/services/exports/export_service_spec.rb | 90 ++++++------ .../lettings_log_export_service_spec.rb | 4 +- .../merge/merge_organisations_service_spec.rb | 45 +++--- spec/services/storage/s3_service_spec.rb | 3 +- spec/views/form/page_view_spec.rb | 2 +- .../_create_for_org_actions.html.erb_spec.rb | 3 +- 303 files changed, 1250 insertions(+), 1264 deletions(-) rename .erb-lint.yml => .erb_lint.yml (100%) diff --git a/.erb-lint.yml b/.erb_lint.yml similarity index 100% rename from .erb-lint.yml rename to .erb_lint.yml diff --git a/.rubocop.yml b/.rubocop.yml index 7bc65bbd8..4a54015a2 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,7 @@ require: - rubocop-performance + +plugins: - rubocop-rails - rubocop-rspec @@ -28,3 +30,6 @@ Rails/UnknownEnv: - development - test - review + +RSpec/IndexedLet: + Enabled: false diff --git a/.ruby-version b/.ruby-version index 9cec7165a..f9892605c 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.6 +3.4.4 diff --git a/Dockerfile b/Dockerfile index 281fd6ca2..88a7e6a79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.1.6-alpine3.20 as base +FROM ruby:3.4.4-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-r29 nodejs=20.15.1-r0 yarn=1.22.22-r0 bash=5.2.26-r0 libpq-dev +RUN apk add --no-cache build-base=0.5-r3 busybox=1.36.1-r29 nodejs=20.15.1-r0 yarn=1.22.22-r0 bash=5.2.26-r0 libpq-dev yaml-dev linux-headers # 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 f6e7fdac5..91ed6c8a8 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.6" +ruby "3.4.4" # Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main' gem "rails", "~> 7.2.2" @@ -51,7 +51,7 @@ gem "paper_trail-globalid" gem "pundit" # Request rate limiting -gem "rack", ">= 2.2.6.3" +gem "rack", "~> 3.1.20" gem "rack-attack" gem "redis", "~> 4.8" # Receive exceptions and configure alerts @@ -72,9 +72,12 @@ gem "sidekiq-cron" gem "unread" # Pinning versions to address vulnerabilities -gem "nokogiri", "~> 1.18.9" +gem "nokogiri", "~> 1.19.1" gem "thor", "~> 1.4.0" +# Pinning until activesupport is updated to v8.1.2 +gem "connection_pool", "~> 2.5" + group :development, :test do # Check gems for known vulnerabilities gem "bundler-audit" @@ -95,7 +98,7 @@ group :development do # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md gem "erb_lint", require: false gem "rack-mini-profiler", "~> 3.3.0" - gem "rubocop-govuk", "4.3.0", require: false + gem "rubocop-govuk", "5.2.0", require: false gem "rubocop-performance", require: false gem "rubocop-rails", require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 34bfd3067..4277b9499 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -78,7 +78,7 @@ GEM tzinfo (~> 2.0, >= 2.0.5) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) - ast (2.4.2) + ast (2.4.3) auto_strip_attributes (2.6.0) activerecord (>= 4.0) aws-eventstream (1.4.0) @@ -113,15 +113,15 @@ GEM thread_safe (~> 0.3, >= 0.3.1) base64 (0.3.0) bcrypt (3.1.20) - benchmark (0.4.1) - better_html (2.0.2) - actionview (>= 6.0) - activesupport (>= 6.0) + benchmark (0.5.0) + better_html (2.2.0) + actionview (>= 7.0) + activesupport (>= 7.0) ast (~> 2.0) erubi (~> 1.4) parser (>= 2.4) smart_properties - bigdecimal (3.2.2) + bigdecimal (4.0.1) bindex (0.8.1) bootsnap (1.18.3) msgpack (~> 1.2) @@ -151,7 +151,7 @@ GEM coderay (1.1.3) coercible (1.0.0) descendants_tracker (~> 0.0.1) - concurrent-ruby (1.3.5) + concurrent-ruby (1.3.6) connection_pool (2.5.3) crack (1.0.0) bigdecimal @@ -184,12 +184,12 @@ GEM drb (2.2.3) dumb_delegator (1.0.0) encryptor (3.0.0) - erb_lint (0.5.0) + erb_lint (0.9.0) activesupport better_html (>= 2.0.1) parser (>= 2.7.1.4) rainbow - rubocop + rubocop (>= 1) smart_properties erubi (1.13.1) et-orbi (1.2.11) @@ -232,7 +232,7 @@ GEM hashdiff (1.1.0) html-attributes-utils (1.0.2) activesupport (>= 6.1.4.4) - i18n (1.14.7) + i18n (1.14.8) concurrent-ruby (~> 1.0) ice_nine (0.11.2) iniparse (1.5.0) @@ -261,13 +261,15 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) + language_server-protocol (3.17.0.5) launchy (2.5.2) addressable (~> 2.8) + lint_roller (1.1.0) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) - loofah (2.24.0) + loofah (2.25.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -279,7 +281,9 @@ GEM matrix (0.4.2) method_source (1.1.0) mini_mime (1.1.5) - minitest (5.25.5) + minitest (6.0.2) + drb (~> 2.0) + prism (~> 1.5) msgpack (1.7.2) multipart-post (2.4.1) nested_form (0.3.2) @@ -295,13 +299,13 @@ GEM net-smtp (0.5.1) net-protocol nio4r (2.7.4) - nokogiri (1.18.9-arm64-darwin) + nokogiri (1.19.1-arm64-darwin) racc (~> 1.4) - nokogiri (1.18.9-x86_64-darwin) + nokogiri (1.19.1-x86_64-darwin) racc (~> 1.4) - nokogiri (1.18.9-x86_64-linux-gnu) + nokogiri (1.19.1-x86_64-linux-gnu) racc (~> 1.4) - nokogiri (1.18.9-x86_64-linux-musl) + nokogiri (1.19.1-x86_64-linux-musl) racc (~> 1.4) notifications-ruby-client (6.0.0) jwt (>= 1.5, < 3) @@ -317,10 +321,10 @@ GEM paper_trail-globalid (0.2.0) globalid paper_trail (>= 3.0.0) - parallel (1.24.0) + parallel (1.27.0) parallel_tests (4.5.1) parallel - parser (3.3.0.5) + parser (3.3.10.2) ast (~> 2.4.1) racc pg (1.5.5) @@ -328,6 +332,7 @@ GEM pp (0.6.2) prettyprint prettyprint (0.2.0) + prism (1.9.0) propshaft (0.8.0) actionpack (>= 7.0.0) activesupport (>= 7.0.0) @@ -349,7 +354,7 @@ GEM activesupport (>= 3.0.0) raabro (1.4.0) racc (1.8.1) - rack (3.1.18) + rack (3.1.20) rack-attack (6.7.0) rack (>= 1.0, < 4) rack-mini-profiler (3.3.1) @@ -375,7 +380,7 @@ GEM activesupport (= 7.2.2.2) bundler (>= 1.15.0) railties (= 7.2.2.2) - rails-dom-testing (2.2.0) + rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) @@ -409,7 +414,7 @@ GEM redis (4.8.1) redis-client (0.22.1) connection_pool - regexp_parser (2.9.0) + regexp_parser (2.11.3) reline (0.6.0) io-console (~> 0.5) request_store (1.7.0) @@ -439,34 +444,45 @@ GEM rspec-mocks (~> 3.12) rspec-support (~> 3.12) rspec-support (3.13.1) - rubocop (1.25.0) + rubocop (1.82.1) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.15.1, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.48.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.15.1) - parser (>= 3.0.1.1) - rubocop-govuk (4.3.0) - rubocop (= 1.25.0) - rubocop-ast (= 1.15.1) - rubocop-rails (= 2.13.2) - rubocop-rake (= 0.6.0) - rubocop-rspec (= 2.7.0) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.49.0) + parser (>= 3.3.7.2) + prism (~> 1.7) + rubocop-capybara (2.22.1) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) + rubocop-govuk (5.2.0) + rubocop (= 1.82.1) + rubocop-ast (= 1.49.0) + rubocop-capybara (= 2.22.1) + rubocop-rails (= 2.34.3) + rubocop-rake (= 0.7.1) + rubocop-rspec (= 3.9.0) rubocop-performance (1.19.1) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rails (2.13.2) + rubocop-rails (2.34.3) activesupport (>= 4.2.0) + lint_roller (~> 1.1) rack (>= 1.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-rake (0.6.0) - rubocop (~> 1.0) - rubocop-rspec (2.7.0) - rubocop (~> 1.19) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.44.0, < 2.0) + rubocop-rake (0.7.1) + lint_roller (~> 1.1) + rubocop (>= 1.72.1) + rubocop-rspec (3.9.0) + lint_roller (~> 1.1) + rubocop (~> 1.81) ruby-openai (7.0.1) event_stream_parser (>= 0.3.0, < 2.0.0) faraday (>= 1) @@ -514,7 +530,9 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) uk_postcode (2.1.8) - unicode-display_width (2.5.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) unread (0.14.0) activerecord (>= 6.1) uri (1.0.4) @@ -563,6 +581,7 @@ DEPENDENCIES capybara capybara-lockstep capybara-screenshot + connection_pool (~> 2.5) cssbundling-rails devise devise_two_factor_authentication @@ -579,7 +598,7 @@ DEPENDENCIES json-schema listen (~> 3.3) method_source (~> 1.1) - nokogiri (~> 1.18.9) + nokogiri (~> 1.19.1) notifications-ruby-client overcommit (>= 0.37.0) paper_trail (~> 15.2) @@ -591,7 +610,7 @@ DEPENDENCIES pry-byebug puma (~> 6.4) pundit - rack (>= 2.2.6.3) + rack (~> 3.1.20) rack-attack rack-mini-profiler (~> 3.3.0) rails (~> 7.2.2) @@ -600,7 +619,7 @@ DEPENDENCIES redis (~> 4.8) roo rspec-rails - rubocop-govuk (= 4.3.0) + rubocop-govuk (= 5.2.0) rubocop-performance rubocop-rails ruby-openai @@ -621,7 +640,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 3.1.6p260 + ruby 3.4.4p0 BUNDLED WITH 2.6.4 diff --git a/app/controllers/csv_downloads_controller.rb b/app/controllers/csv_downloads_controller.rb index 25f70026f..e2a7fb4f1 100644 --- a/app/controllers/csv_downloads_controller.rb +++ b/app/controllers/csv_downloads_controller.rb @@ -5,7 +5,7 @@ class CsvDownloadsController < ApplicationController @csv_download = CsvDownload.find(params[:id]) authorize @csv_download - return render "errors/download_link_expired" if @csv_download.expired? + render "errors/download_link_expired" if @csv_download.expired? end def download diff --git a/app/controllers/lettings_logs_controller.rb b/app/controllers/lettings_logs_controller.rb index 38a89b682..cd2a6ca5a 100644 --- a/app/controllers/lettings_logs_controller.rb +++ b/app/controllers/lettings_logs_controller.rb @@ -190,7 +190,7 @@ private end def resolve_logs! - if @log&.unresolved && @log.location.present? && @log.scheme.present? && @log&.resolve! + if @log&.unresolved && @log.location.present? && @log.scheme.present? && @log.resolve! unresolved_logs_count_for_user = current_user.lettings_logs.unresolved.assigned_to(current_user).count flash.now[:notice] = helpers.flash_notice_for_resolved_logs(unresolved_logs_count_for_user) end diff --git a/app/controllers/lettings_logs_filters_controller.rb b/app/controllers/lettings_logs_filters_controller.rb index 9180737d3..c6ea0ba70 100644 --- a/app/controllers/lettings_logs_filters_controller.rb +++ b/app/controllers/lettings_logs_filters_controller.rb @@ -52,8 +52,6 @@ class LettingsLogsFiltersController < ApplicationController end end -private - def lettings_session_filters params["years"] = [params["years"]] if params["years"].present? lettings_filter_manager.session_filters diff --git a/app/controllers/merge_requests_controller.rb b/app/controllers/merge_requests_controller.rb index 32f7b2d0c..f1878e9ab 100644 --- a/app/controllers/merge_requests_controller.rb +++ b/app/controllers/merge_requests_controller.rb @@ -105,7 +105,7 @@ private answer_options = { "" => "Select an option" } if current_user.support? - Organisation.all.each do |organisation| + Organisation.all.find_each do |organisation| date = @merge_request.merge_date || Time.zone.today answer_options[organisation.id] = organisation.name(date:) end diff --git a/app/controllers/sales_logs_filters_controller.rb b/app/controllers/sales_logs_filters_controller.rb index ffa4f4bc4..70a4c2b49 100644 --- a/app/controllers/sales_logs_filters_controller.rb +++ b/app/controllers/sales_logs_filters_controller.rb @@ -53,8 +53,6 @@ class SalesLogsFiltersController < ApplicationController end end -private - def sales_session_filters params["years"] = [params["years"]] if params["years"].present? sales_filter_manager.session_filters diff --git a/app/helpers/bulk_upload/lettings_log_to_csv.rb b/app/helpers/bulk_upload/lettings_log_to_csv.rb index 155fb9b12..18a524b0d 100644 --- a/app/helpers/bulk_upload/lettings_log_to_csv.rb +++ b/app/helpers/bulk_upload/lettings_log_to_csv.rb @@ -2,12 +2,10 @@ class BulkUpload::LettingsLogToCsv attr_reader :log, :line_ending, :col_offset, :overrides def initialize(log:, line_ending: "\n", col_offset: 1, overrides: {}) - # rubocop:disable Rails/HelperInstanceVariable @log = log @line_ending = line_ending @col_offset = col_offset @overrides = overrides - # rubocop:enable Rails/HelperInstanceVariable end def row_prefix diff --git a/app/helpers/bulk_upload/sales_log_to_csv.rb b/app/helpers/bulk_upload/sales_log_to_csv.rb index 1171f481f..30833c1c7 100644 --- a/app/helpers/bulk_upload/sales_log_to_csv.rb +++ b/app/helpers/bulk_upload/sales_log_to_csv.rb @@ -2,12 +2,10 @@ class BulkUpload::SalesLogToCsv attr_reader :log, :line_ending, :col_offset, :overrides def initialize(log:, line_ending: "\n", col_offset: 1, overrides: {}) - # rubocop:disable Rails/HelperInstanceVariable @log = log @line_ending = line_ending @col_offset = col_offset @overrides = overrides - # rubocop:enable Rails/HelperInstanceVariable end def row_prefix diff --git a/app/helpers/data_sharing_agreement_helper.rb b/app/helpers/data_sharing_agreement_helper.rb index 79296e6dc..5ab5e3272 100644 --- a/app/helpers/data_sharing_agreement_helper.rb +++ b/app/helpers/data_sharing_agreement_helper.rb @@ -67,7 +67,7 @@ module DataSharingAgreementHelper "12.2. For #{@org_name}: Name: #{@dpo_name}, Postal Address: #{@org_address}, E-mail address: #{@dpo_email}, Telephone number: #{@org_phone}" end end -# rubocop:enable Rails/HelperInstanceVariable + # rubocop:enable Rails/HelperInstanceVariable private diff --git a/app/helpers/form_page_error_helper.rb b/app/helpers/form_page_error_helper.rb index ded09d54c..c2ce87310 100644 --- a/app/helpers/form_page_error_helper.rb +++ b/app/helpers/form_page_error_helper.rb @@ -5,7 +5,7 @@ module FormPageErrorHelper end def remove_duplicate_page_errors(lettings_log) - lettings_log.errors.group_by(&:message).each do |_, errors| + lettings_log.errors.group_by(&:message).each_value do |errors| next if errors.size == 1 errors.shift diff --git a/app/helpers/locations_helper.rb b/app/helpers/locations_helper.rb index 9ef74ca51..b8a111b0c 100644 --- a/app/helpers/locations_helper.rb +++ b/app/helpers/locations_helper.rb @@ -91,7 +91,8 @@ module LocationsHelper def toggle_location_link(location) return govuk_button_link_to "Deactivate this location", scheme_location_new_deactivation_path(location.scheme, location), warning: true if location.active? || location.deactivates_in_a_long_time? - return govuk_button_link_to "Reactivate this location", scheme_location_new_reactivation_path(location.scheme, location) if location.deactivated? && !location.deactivated_by_scheme? + + govuk_button_link_to "Reactivate this location", scheme_location_new_reactivation_path(location.scheme, location) if location.deactivated? && !location.deactivated_by_scheme? end def delete_location_link(location) diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb index 3d9577ce9..6755b4646 100644 --- a/app/helpers/merge_requests_helper.rb +++ b/app/helpers/merge_requests_helper.rb @@ -101,13 +101,13 @@ module MergeRequestsHelper attribute = page if attribute.nil? return nil unless value_exists?(merge_request, attribute) - unless merge_request.status == "request_merged" || merge_request.status == "processing" + unless %w[request_merged processing].include?(merge_request.status) { text: merge_request_action_text(merge_request, attribute), href: send("#{page}_merge_request_path", merge_request, referrer: "check_answers"), visually_hidden_text: page.humanize } end end def merge_outcome_action(merge_request, page) - unless merge_request.status == "request_merged" || merge_request.status == "processing" + unless %w[request_merged processing].include?(merge_request.status) { text: "View", href: send("#{page}_merge_request_path", merge_request), visually_hidden_text: page.humanize } end end diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 318918134..d3a369b45 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -57,7 +57,7 @@ class NotificationRenderer < Redcarpet::Render::HTML def initialize(options = {}) link_class = "govuk-link" link_class += " govuk-link--inverse" if options[:invert_link_colour] - @bold = options[:bold_all_text] # rubocop:disable Rails/HelperInstanceVariable + @bold = options[:bold_all_text] base_options = { escape_html: true, safe_links_only: true, link_attributes: { class: link_class } } super base_options end @@ -78,7 +78,7 @@ class NotificationRenderer < Redcarpet::Render::HTML end def paragraph(text) - return %(

#{text}

) if @bold # rubocop:disable Rails/HelperInstanceVariable + return %(

#{text}

) if @bold %(

#{text}

) end diff --git a/app/helpers/question_view_helper.rb b/app/helpers/question_view_helper.rb index acb4fa959..0c4b6337f 100644 --- a/app/helpers/question_view_helper.rb +++ b/app/helpers/question_view_helper.rb @@ -44,7 +44,8 @@ module QuestionViewHelper def select_option_name(value) return value.service_name if value.respond_to?(:service_name) return value["name"] if value.is_a?(Hash) && value["name"].present? - return value["postcode"] if value.is_a?(Location) + + value["postcode"] if value.is_a?(Location) end private diff --git a/app/helpers/schemes_helper.rb b/app/helpers/schemes_helper.rb index 753f33917..e72250c6e 100644 --- a/app/helpers/schemes_helper.rb +++ b/app/helpers/schemes_helper.rb @@ -12,7 +12,8 @@ module SchemesHelper def toggle_scheme_link(scheme) return govuk_button_link_to "Deactivate this scheme", scheme_new_deactivation_path(scheme), warning: true if scheme.active? || scheme.deactivates_in_a_long_time? - return govuk_button_link_to "Reactivate this scheme", scheme_new_reactivation_path(scheme) if scheme.deactivated? || scheme.deactivating_soon? + + govuk_button_link_to "Reactivate this scheme", scheme_new_reactivation_path(scheme) if scheme.deactivated? || scheme.deactivating_soon? end def delete_scheme_link(scheme) diff --git a/app/mailers/devise_notify_mailer.rb b/app/mailers/devise_notify_mailer.rb index 5ee3fd898..4065e3aa9 100644 --- a/app/mailers/devise_notify_mailer.rb +++ b/app/mailers/devise_notify_mailer.rb @@ -92,8 +92,7 @@ class DeviseNotifyMailer < Devise::Mailer def email_changed?(record) ( - record.confirmable_template == User::CONFIRMABLE_TEMPLATE_ID && ( - record.unconfirmed_email.present? && record.unconfirmed_email != record.email) + record.confirmable_template == User::CONFIRMABLE_TEMPLATE_ID && record.unconfirmed_email.present? && record.unconfirmed_email != record.email ) || ( record.versions.last.changeset.key?("unconfirmed_email") && record.confirmed? diff --git a/app/models/derived_variables/lettings_log_variables.rb b/app/models/derived_variables/lettings_log_variables.rb index 19a58d916..6c88c3221 100644 --- a/app/models/derived_variables/lettings_log_variables.rb +++ b/app/models/derived_variables/lettings_log_variables.rb @@ -254,7 +254,7 @@ private def clear_inapplicable_derived_values! reset_invalidated_derived_values!(dependencies) - if (startdate_changed? || renewal_changed?) && (renewal_was == 1 && startdate_was&.between?(Time.zone.local(2021, 4, 1), Time.zone.local(2022, 3, 31))) + if (startdate_changed? || renewal_changed?) && renewal_was == 1 && startdate_was&.between?(Time.zone.local(2021, 4, 1), Time.zone.local(2022, 3, 31)) self.underoccupation_benefitcap = nil end if renewal_changed? && renewal_was == 1 @@ -270,7 +270,7 @@ private self.wchair = nil self.location_id = nil end - if form.start_year_2024_or_later? && (unittype_gn_changed? && unittype_gn_was == 2) + if form.start_year_2024_or_later? && unittype_gn_changed? && unittype_gn_was == 2 self.beds = nil end end @@ -439,13 +439,15 @@ private def get_lar return 1 if rent_type == 2 - return 2 if rent_type == 1 + + 2 if rent_type == 1 end def get_irproduct return 1 if rent_type == 3 return 2 if rent_type == 4 - return 3 if rent_type == 5 + + 3 if rent_type == 5 end def clear_gender_description_unless_gender_not_same_as_sex! diff --git a/app/models/derived_variables/shared_logic.rb b/app/models/derived_variables/shared_logic.rb index c326cb8c9..4b76d83d8 100644 --- a/app/models/derived_variables/shared_logic.rb +++ b/app/models/derived_variables/shared_logic.rb @@ -9,7 +9,7 @@ private previously_in_derived_state = dependency[:conditions].all? { |attribute, value| send("#{attribute}_was") == value } next unless previously_in_derived_state - dependency[:derived_values].each do |derived_attribute, _derived_value| + dependency[:derived_values].each_key do |derived_attribute| Rails.logger.debug("Cleared derived #{derived_attribute} value") send("#{derived_attribute}=", nil) end diff --git a/app/models/form/sales/pages/deposit.rb b/app/models/form/sales/pages/deposit.rb index 4fc5e1b83..411cfb270 100644 --- a/app/models/form/sales/pages/deposit.rb +++ b/app/models/form/sales/pages/deposit.rb @@ -23,6 +23,7 @@ class Form::Sales::Pages::Deposit < ::Form::Page def copy_key return "sales.sale_information.deposit.shared_ownership" if @ownershipsch == 1 return "sales.sale_information.deposit.discounted_ownership" if @ownershipsch == 2 - return "sales.sale_information.deposit.outright_sale" if @ownershipsch == 3 + + "sales.sale_information.deposit.outright_sale" if @ownershipsch == 3 end end diff --git a/app/models/form/sales/questions/deposit_amount.rb b/app/models/form/sales/questions/deposit_amount.rb index 9fe7a7ce1..ede6335e1 100644 --- a/app/models/form/sales/questions/deposit_amount.rb +++ b/app/models/form/sales/questions/deposit_amount.rb @@ -29,12 +29,14 @@ class Form::Sales::Questions::DepositAmount < ::Form::Question def top_guidance_partial return "financial_calculations_shared_ownership" if @ownershipsch == 1 return "financial_calculations_discounted_ownership" if @ownershipsch == 2 - return "financial_calculations_outright_sale" if @ownershipsch == 3 + + "financial_calculations_outright_sale" if @ownershipsch == 3 end def copy_key return "sales.sale_information.deposit.shared_ownership" if @ownershipsch == 1 return "sales.sale_information.deposit.discounted_ownership" if @ownershipsch == 2 - return "sales.sale_information.deposit.outright_sale" if @ownershipsch == 3 + + "sales.sale_information.deposit.outright_sale" if @ownershipsch == 3 end end diff --git a/app/models/form/sales/questions/mortgage_amount.rb b/app/models/form/sales/questions/mortgage_amount.rb index 0d2bda4fd..a61dce8f3 100644 --- a/app/models/form/sales/questions/mortgage_amount.rb +++ b/app/models/form/sales/questions/mortgage_amount.rb @@ -26,6 +26,7 @@ class Form::Sales::Questions::MortgageAmount < ::Form::Question def top_guidance_partial return "financial_calculations_shared_ownership" if @ownershipsch == 1 return "financial_calculations_discounted_ownership" if @ownershipsch == 2 - return "financial_calculations_outright_sale" if @ownershipsch == 3 + + "financial_calculations_outright_sale" if @ownershipsch == 3 end end diff --git a/app/models/form/sales/questions/mortgageused.rb b/app/models/form/sales/questions/mortgageused.rb index a0079b1b4..fc5818886 100644 --- a/app/models/form/sales/questions/mortgageused.rb +++ b/app/models/form/sales/questions/mortgageused.rb @@ -41,6 +41,7 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question def top_guidance_partial return "financial_calculations_shared_ownership" if @ownershipsch == 1 return "financial_calculations_discounted_ownership" if @ownershipsch == 2 - return "financial_calculations_outright_sale" if @ownershipsch == 3 + + "financial_calculations_outright_sale" if @ownershipsch == 3 end end diff --git a/app/models/form/sales/questions/purchase_price.rb b/app/models/form/sales/questions/purchase_price.rb index 56810eae4..d37d549ce 100644 --- a/app/models/form/sales/questions/purchase_price.rb +++ b/app/models/form/sales/questions/purchase_price.rb @@ -30,6 +30,7 @@ class Form::Sales::Questions::PurchasePrice < ::Form::Question def top_guidance_partial return "financial_calculations_discounted_ownership" if @ownership_sch == 2 - return "financial_calculations_outright_sale" if @ownership_sch == 3 + + "financial_calculations_outright_sale" if @ownership_sch == 3 end end diff --git a/app/models/form/subsection.rb b/app/models/form/subsection.rb index 3b74e29a5..41431b06f 100644 --- a/app/models/form/subsection.rb +++ b/app/models/form/subsection.rb @@ -1,5 +1,5 @@ class Form::Subsection - attr_accessor :id, :label, :section, :pages, :depends_on, :form + attr_accessor :id, :label, :section, :pages, :depends_on def initialize(id, hsh, section) @id = id diff --git a/app/models/lettings_log.rb b/app/models/lettings_log.rb index c3b72fbdd..d70d0e012 100644 --- a/app/models/lettings_log.rb +++ b/app/models/lettings_log.rb @@ -482,7 +482,7 @@ class LettingsLog < Log def is_london_rent? # 2: London Affordable Rent # 4: London Living Rent - rent_type == 2 || rent_type == 4 + [2, 4].include?(rent_type) end def previous_tenancy_was_foster_care? @@ -714,7 +714,7 @@ class LettingsLog < Log end def affordable_or_social_rent? - renttype == 1 || renttype == 2 + [1, 2].include?(renttype) end def no_or_unknown_other_housing_needs? @@ -931,7 +931,7 @@ private num_of_weeks = NUM_OF_WEEKS_FROM_PERIOD[period] return "" unless value && num_of_weeks - format_as_currency((value * 52 / num_of_weeks)) + format_as_currency(value * 52 / num_of_weeks) end def fully_wheelchair_accessible? diff --git a/app/models/sales_log.rb b/app/models/sales_log.rb index d4d23f44d..cf9e0dd44 100644 --- a/app/models/sales_log.rb +++ b/app/models/sales_log.rb @@ -533,7 +533,7 @@ class SalesLog < Log end def is_not_staircasing? - staircase == 2 || staircase == 3 + [2, 3].include?(staircase) end def stairowned_100? diff --git a/app/models/validations/sales/sale_information_validations.rb b/app/models/validations/sales/sale_information_validations.rb index f34eec790..063c16599 100644 --- a/app/models/validations/sales/sale_information_validations.rb +++ b/app/models/validations/sales/sale_information_validations.rb @@ -136,7 +136,7 @@ module Validations::Sales::SaleInformationValidations def validate_grant_amount(record) return unless record.saledate && record.form.start_year_2024_or_later? - return unless record.grant && (record.type == 8 || record.type == 21) + return unless record.grant && [8, 21].include?(record.type) unless record.grant.between?(9_000, 16_000) record.errors.add :grant, I18n.t("validations.sales.sale_information.grant.out_of_range") diff --git a/app/models/validations/sales/soft_validations.rb b/app/models/validations/sales/soft_validations.rb index 2bc574774..3569c379f 100644 --- a/app/models/validations/sales/soft_validations.rb +++ b/app/models/validations/sales/soft_validations.rb @@ -144,7 +144,7 @@ module Validations::Sales::SoftValidations def grant_outside_common_range? return unless grant && type && saledate - return if form.start_year_2024_or_later? && (type == 21 || type == 8) + return if form.start_year_2024_or_later? && [21, 8].include?(type) !grant.between?(9_000, 16_000) end diff --git a/app/models/validations/shared_validations.rb b/app/models/validations/shared_validations.rb index 530735213..4558a5a36 100644 --- a/app/models/validations/shared_validations.rb +++ b/app/models/validations/shared_validations.rb @@ -56,11 +56,11 @@ module Validations::SharedValidations next unless incorrect_accuracy - case question.step - when 0.01 then record.errors.add question.id.to_sym, I18n.t("validations.shared.numeric.nearest_hundredth", field:) - when 0.1 then record.errors.add question.id.to_sym, I18n.t("validations.shared.numeric.nearest_tenth", field:) - when 1 then record.errors.add question.id.to_sym, :not_integer, message: I18n.t("validations.shared.numeric.whole_number", field:) - when 10 then record.errors.add question.id.to_sym, I18n.t("validations.shared.numeric.nearest_ten", field:) + case question.step.to_d + when BigDecimal("0.01") then record.errors.add question.id.to_sym, I18n.t("validations.shared.numeric.nearest_hundredth", field:) + when BigDecimal("0.1") then record.errors.add question.id.to_sym, I18n.t("validations.shared.numeric.nearest_tenth", field:) + when BigDecimal("1") then record.errors.add question.id.to_sym, :not_integer, message: I18n.t("validations.shared.numeric.whole_number", field:) + when BigDecimal("10") then record.errors.add question.id.to_sym, I18n.t("validations.shared.numeric.nearest_ten", field:) else record.errors.add question.id.to_sym, I18n.t("validations.shared.numeric.nearest_step", field:, step: question.step) end diff --git a/app/policies/location_policy.rb b/app/policies/location_policy.rb index 3b4a22131..966cfe35c 100644 --- a/app/policies/location_policy.rb +++ b/app/policies/location_policy.rb @@ -32,7 +32,7 @@ class LocationPolicy def delete? return false unless user.support? - return false unless location.status == :incomplete || location.status == :deactivated + return false unless %i[incomplete deactivated].include?(location.status) !has_any_logs_in_editable_collection_period end diff --git a/app/policies/organisation_policy.rb b/app/policies/organisation_policy.rb index 9c5fc4449..4db37b5ea 100644 --- a/app/policies/organisation_policy.rb +++ b/app/policies/organisation_policy.rb @@ -20,7 +20,7 @@ class OrganisationPolicy def delete? return false unless user.support? - return false unless organisation.status == :deactivated || organisation.status == :merged + return false unless %i[deactivated merged].include?(organisation.status) !has_any_logs_in_editable_collection_period end diff --git a/app/policies/scheme_policy.rb b/app/policies/scheme_policy.rb index 54a2b9e89..6fa9ac95a 100644 --- a/app/policies/scheme_policy.rb +++ b/app/policies/scheme_policy.rb @@ -71,7 +71,7 @@ class SchemePolicy def delete? return false unless user.support? - return false unless scheme.status == :incomplete || scheme.status == :deactivated + return false unless %i[incomplete deactivated].include?(scheme.status) !has_any_logs_in_editable_collection_period end diff --git a/app/services/bulk_upload/lettings/year2023/row_parser.rb b/app/services/bulk_upload/lettings/year2023/row_parser.rb index 70aa4951e..1e8b9db56 100644 --- a/app/services/bulk_upload/lettings/year2023/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2023/row_parser.rb @@ -536,7 +536,7 @@ private end def validate_valid_radio_option - log.attributes.each do |question_id, _v| + log.attributes.each_key do |question_id| question = log.form.get_question(question_id, log) next unless question&.type == "radio" @@ -1321,22 +1321,26 @@ private def scheme_field return :field_16 if log_uses_new_scheme_id? - return :field_15 if log_uses_old_scheme_id? + + :field_15 if log_uses_old_scheme_id? end def scheme_id return field_16.strip if log_uses_new_scheme_id? - return field_15 if log_uses_old_scheme_id? + + field_15 if log_uses_old_scheme_id? end def location_field return :field_17 if log_uses_new_scheme_id? - return :field_16 if log_uses_old_scheme_id? + + :field_16 if log_uses_old_scheme_id? end def location_id return field_17 if log_uses_new_scheme_id? - return field_16 if log_uses_old_scheme_id? + + field_16 if log_uses_old_scheme_id? end def scheme_or_management_group @@ -1424,7 +1428,8 @@ private ].each do |hash| define_method("age#{hash[:person]}_known?") do return 1 if public_send(hash[:field]) == "R" - return 0 if send("person_#{hash[:person]}_present?") + + 0 if send("person_#{hash[:person]}_present?") end end @@ -1488,7 +1493,8 @@ private def housingneeds_other return 1 if field_86 == 1 - return 0 if [field_83, field_84, field_85].include?(1) + + 0 if [field_83, field_84, field_85].include?(1) end def prevloc @@ -1555,7 +1561,7 @@ private end def earnings - field_122.round if field_122.present? + field_122.presence&.round end def tshortfall_known diff --git a/app/services/bulk_upload/lettings/year2024/row_parser.rb b/app/services/bulk_upload/lettings/year2024/row_parser.rb index 66d46ead5..1ba683f66 100644 --- a/app/services/bulk_upload/lettings/year2024/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2024/row_parser.rb @@ -562,7 +562,7 @@ class BulkUpload::Lettings::Year2024::RowParser private def validate_valid_radio_option - log.attributes.each do |question_id, _v| + log.attributes.each_key do |question_id| question = log.form.get_question(question_id, log) next unless question&.type == "radio" @@ -1455,7 +1455,8 @@ private ].each do |hash| define_method("age#{hash[:person]}_known?") do return 1 if public_send(hash[:field]) == "R" - return 0 if send("person_#{hash[:person]}_present?") + + 0 if send("person_#{hash[:person]}_present?") end end @@ -1519,7 +1520,8 @@ private def housingneeds_other return 1 if field_82 == 1 - return 0 if [field_79, field_80, field_81].include?(1) + + 0 if [field_79, field_80, field_81].include?(1) end def prevloc @@ -1595,7 +1597,7 @@ private end def earnings - field_119.round if field_119.present? + field_119.presence&.round end def tshortfall_known diff --git a/app/services/bulk_upload/lettings/year2025/row_parser.rb b/app/services/bulk_upload/lettings/year2025/row_parser.rb index 0745056d2..9887c42be 100644 --- a/app/services/bulk_upload/lettings/year2025/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2025/row_parser.rb @@ -561,7 +561,7 @@ class BulkUpload::Lettings::Year2025::RowParser private def validate_valid_radio_option - log.attributes.each do |question_id, _v| + log.attributes.each_key do |question_id| question = log.form.get_question(question_id, log) next unless question&.type == "radio" @@ -1452,7 +1452,8 @@ private ].each do |hash| define_method("age#{hash[:person]}_known?") do return 1 if public_send(hash[:field]) == "R" - return 0 if send("person_#{hash[:person]}_present?") + + 0 if send("person_#{hash[:person]}_present?") end end @@ -1516,7 +1517,8 @@ private def housingneeds_other return 1 if field_82 == 1 - return 0 if [field_79, field_80, field_81].include?(1) + + 0 if [field_79, field_80, field_81].include?(1) end def prevloc @@ -1592,7 +1594,7 @@ private end def earnings - field_119.round if field_119.present? + field_119.presence&.round end def tshortfall_known diff --git a/app/services/bulk_upload/lettings/year2026/row_parser.rb b/app/services/bulk_upload/lettings/year2026/row_parser.rb index b73bf792a..c8fc4c891 100644 --- a/app/services/bulk_upload/lettings/year2026/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2026/row_parser.rb @@ -606,7 +606,7 @@ class BulkUpload::Lettings::Year2026::RowParser private def validate_valid_radio_option - log.attributes.each do |question_id, _v| + log.attributes.each_key do |question_id| question = log.form.get_question(question_id, log) next unless question&.type == "radio" @@ -1573,7 +1573,8 @@ private ].each do |hash| define_method("age#{hash[:person]}_known?") do return 1 if public_send(hash[:field]) == "R" - return 0 if send("person_#{hash[:person]}_present?") + + 0 if send("person_#{hash[:person]}_present?") end end @@ -1637,7 +1638,8 @@ private def housingneeds_other return 1 if field_82 == 1 - return 0 if [field_79, field_80, field_81].include?(1) + + 0 if [field_79, field_80, field_81].include?(1) end def prevloc @@ -1713,7 +1715,7 @@ private end def earnings - field_119.round if field_119.present? + field_119.presence&.round end def tshortfall_known diff --git a/app/services/bulk_upload/sales/year2023/row_parser.rb b/app/services/bulk_upload/sales/year2023/row_parser.rb index ddcf18b6a..75f964e7c 100644 --- a/app/services/bulk_upload/sales/year2023/row_parser.rb +++ b/app/services/bulk_upload/sales/year2023/row_parser.rb @@ -915,7 +915,7 @@ private attributes["mortlen"] = mortlen attributes["proplen"] = proplen if proplen&.positive? - attributes["proplen_asked"] = attributes["proplen"]&.present? ? 0 : 1 + attributes["proplen_asked"] = attributes["proplen"].present? ? 0 : 1 attributes["jointmore"] = field_15 attributes["staircase"] = field_87 attributes["privacynotice"] = field_29 @@ -992,7 +992,8 @@ private ].each do |hash| define_method("age#{hash[:person]}_known?") do return 1 if public_send(hash[:field]) == "R" - return 0 if send("person_#{hash[:person]}_present?") + + 0 if send("person_#{hash[:person]}_present?") end end @@ -1050,72 +1051,84 @@ private def sale_type return field_8 if shared_ownership? return field_9 if discounted_ownership? - return field_10 if outright_sale? + + field_10 if outright_sale? end def value return field_103 if shared_ownership? return field_116 if discounted_ownership? - return field_127 if outright_sale? + + field_127 if outright_sale? end def mortgage return field_106 if shared_ownership? return field_120 if discounted_ownership? - return field_129 if outright_sale? + + field_129 if outright_sale? end def extrabor return field_110 if shared_ownership? return field_124 if discounted_ownership? - return field_133 if outright_sale? + + field_133 if outright_sale? end def deposit return field_111 if shared_ownership? return field_125 if discounted_ownership? - return field_134 if outright_sale? + + field_134 if outright_sale? end def mscharge return field_114 if shared_ownership? return field_126 if discounted_ownership? - return field_135 if outright_sale? + + field_135 if outright_sale? end def mortgagelender return field_107 if shared_ownership? return field_121 if discounted_ownership? - return field_130 if outright_sale? + + field_130 if outright_sale? end def mortgagelenderother return field_108 if shared_ownership? return field_122 if discounted_ownership? - return field_131 if outright_sale? + + field_131 if outright_sale? end def mortlen return field_109 if shared_ownership? return field_123 if discounted_ownership? - return field_132 if outright_sale? + + field_132 if outright_sale? end def proplen return field_86 if shared_ownership? - return field_115 if discounted_ownership? + + field_115 if discounted_ownership? end def mortgageused return field_105 if shared_ownership? return field_119 if discounted_ownership? - return field_128 if outright_sale? + + field_128 if outright_sale? end def mortgageused_field return :field_105 if shared_ownership? return :field_119 if discounted_ownership? - return :field_128 if outright_sale? + + :field_128 if outright_sale? end def owning_organisation @@ -1263,7 +1276,7 @@ private end def validate_valid_radio_option - log.attributes.each do |question_id, _v| + log.attributes.each_key do |question_id| question = log.form.get_question(question_id, log) next if question_id == "type" diff --git a/app/services/bulk_upload/sales/year2024/row_parser.rb b/app/services/bulk_upload/sales/year2024/row_parser.rb index a1b214182..879bdbb3f 100644 --- a/app/services/bulk_upload/sales/year2024/row_parser.rb +++ b/app/services/bulk_upload/sales/year2024/row_parser.rb @@ -938,7 +938,7 @@ private attributes["mortlen"] = mortlen attributes["proplen"] = proplen if proplen&.positive? - attributes["proplen_asked"] = attributes["proplen"]&.present? ? 0 : 1 + attributes["proplen_asked"] = attributes["proplen"].present? ? 0 : 1 attributes["jointmore"] = field_16 attributes["staircase"] = field_86 attributes["privacynotice"] = field_18 @@ -1026,7 +1026,8 @@ private ].each do |hash| define_method("age#{hash[:person]}_known?") do return 1 if public_send(hash[:field]) == "R" - return 0 if send("person_#{hash[:person]}_present?") + + 0 if send("person_#{hash[:person]}_present?") end end @@ -1084,64 +1085,75 @@ private def sale_type return field_9 if shared_ownership? return field_10 if discounted_ownership? - return field_11 if outright_sale? + + field_11 if outright_sale? end def value return field_101 if shared_ownership? return field_114 if discounted_ownership? - return field_125 if outright_sale? + + field_125 if outright_sale? end def mortgage return field_104 if shared_ownership? return field_118 if discounted_ownership? - return field_127 if outright_sale? + + field_127 if outright_sale? end def extrabor return field_108 if shared_ownership? return field_122 if discounted_ownership? - return field_129 if outright_sale? + + field_129 if outright_sale? end def deposit return field_109 if shared_ownership? return field_123 if discounted_ownership? - return field_130 if outright_sale? + + field_130 if outright_sale? end def mscharge return field_112 if shared_ownership? return field_124 if discounted_ownership? - return field_131 if outright_sale? + + field_131 if outright_sale? end def mortgagelender return field_105 if shared_ownership? - return field_119 if discounted_ownership? + + field_119 if discounted_ownership? end def mortgagelenderother return field_106 if shared_ownership? - return field_120 if discounted_ownership? + + field_120 if discounted_ownership? end def mortlen return field_107 if shared_ownership? return field_121 if discounted_ownership? - return field_128 if outright_sale? + + field_128 if outright_sale? end def proplen return field_85 if shared_ownership? - return field_113 if discounted_ownership? + + field_113 if discounted_ownership? end def mortgageused return field_103 if shared_ownership? return field_117 if discounted_ownership? - return field_126 if outright_sale? + + field_126 if outright_sale? end def value_fields @@ -1393,7 +1405,7 @@ private end def validate_valid_radio_option - log.attributes.each do |question_id, _v| + log.attributes.each_key do |question_id| question = log.form.get_question(question_id, log) next if question_id == "type" diff --git a/app/services/bulk_upload/sales/year2025/row_parser.rb b/app/services/bulk_upload/sales/year2025/row_parser.rb index a78b9fe5d..19094f6c6 100644 --- a/app/services/bulk_upload/sales/year2025/row_parser.rb +++ b/app/services/bulk_upload/sales/year2025/row_parser.rb @@ -906,7 +906,7 @@ private attributes["mortlen"] = mortlen attributes["proplen"] = proplen if proplen&.positive? - attributes["proplen_asked"] = attributes["proplen"]&.present? ? 0 : 1 + attributes["proplen_asked"] = attributes["proplen"].present? ? 0 : 1 attributes["jointmore"] = field_13 attributes["staircase"] = field_10 attributes["privacynotice"] = field_15 @@ -1008,7 +1008,8 @@ private ].each do |hash| define_method("age#{hash[:person]}_known?") do return 1 if public_send(hash[:field]) == "R" - return 0 if send("person_#{hash[:person]}_present?") + + 0 if send("person_#{hash[:person]}_present?") end end @@ -1076,58 +1077,68 @@ private def sale_type return field_9 if shared_ownership? - return field_11 if discounted_ownership? + + field_11 if discounted_ownership? end def value return field_86 if shared_ownership_initial_purchase? return field_113 if discounted_ownership? - return field_107 if staircasing? + + field_107 if staircasing? end def equity return field_87 if shared_ownership_initial_purchase? - return field_108 if staircasing? + + field_108 if staircasing? end def mortgage return field_89 if shared_ownership? - return field_117 if discounted_ownership? + + field_117 if discounted_ownership? end def extrabor - return field_119 if discounted_ownership? + field_119 if discounted_ownership? end def deposit return field_91 if shared_ownership? - return field_120 if discounted_ownership? + + field_120 if discounted_ownership? end def mrent return field_93 if shared_ownership_initial_purchase? - return field_111 if staircasing? + + field_111 if staircasing? end def mscharge return field_94 if shared_ownership? - return field_121 if discounted_ownership? + + field_121 if discounted_ownership? end def mortlen return field_90 if shared_ownership? - return field_118 if discounted_ownership? + + field_118 if discounted_ownership? end def proplen return field_79 if shared_ownership? - return field_112 if discounted_ownership? + + field_112 if discounted_ownership? end def mortgageused return field_88 if shared_ownership_initial_purchase? return field_116 if discounted_ownership? - return field_109 if staircasing? + + field_109 if staircasing? end def value_fields @@ -1369,7 +1380,7 @@ private end def validate_valid_radio_option - log.attributes.each do |question_id, _v| + log.attributes.each_key do |question_id| question = log.form.get_question(question_id, log) next if question_id == "type" diff --git a/app/services/bulk_upload/sales/year2026/row_parser.rb b/app/services/bulk_upload/sales/year2026/row_parser.rb index adb7cc6a2..08d56fe37 100644 --- a/app/services/bulk_upload/sales/year2026/row_parser.rb +++ b/app/services/bulk_upload/sales/year2026/row_parser.rb @@ -934,7 +934,7 @@ private attributes["mortlen"] = mortlen attributes["proplen"] = proplen if proplen&.positive? - attributes["proplen_asked"] = attributes["proplen"]&.present? ? 0 : 1 + attributes["proplen_asked"] = attributes["proplen"].present? ? 0 : 1 attributes["jointmore"] = field_13 attributes["staircase"] = field_10 attributes["privacynotice"] = field_15 @@ -1036,7 +1036,8 @@ private ].each do |hash| define_method("age#{hash[:person]}_known?") do return 1 if public_send(hash[:field]) == "R" - return 0 if send("person_#{hash[:person]}_present?") + + 0 if send("person_#{hash[:person]}_present?") end end @@ -1104,58 +1105,68 @@ private def sale_type return field_9 if shared_ownership? - return field_11 if discounted_ownership? + + field_11 if discounted_ownership? end def value return field_86 if shared_ownership_initial_purchase? return field_113 if discounted_ownership? - return field_107 if staircasing? + + field_107 if staircasing? end def equity return field_87 if shared_ownership_initial_purchase? - return field_108 if staircasing? + + field_108 if staircasing? end def mortgage return field_89 if shared_ownership? - return field_117 if discounted_ownership? + + field_117 if discounted_ownership? end def extrabor - return field_119 if discounted_ownership? + field_119 if discounted_ownership? end def deposit return field_91 if shared_ownership? - return field_120 if discounted_ownership? + + field_120 if discounted_ownership? end def mrent return field_93 if shared_ownership_initial_purchase? - return field_111 if staircasing? + + field_111 if staircasing? end def mscharge return field_94 if shared_ownership? - return field_121 if discounted_ownership? + + field_121 if discounted_ownership? end def mortlen return field_90 if shared_ownership? - return field_118 if discounted_ownership? + + field_118 if discounted_ownership? end def proplen return field_79 if shared_ownership? - return field_112 if discounted_ownership? + + field_112 if discounted_ownership? end def mortgageused return field_88 if shared_ownership_initial_purchase? return field_116 if discounted_ownership? - return field_109 if staircasing? + + field_109 if staircasing? end def value_fields @@ -1398,7 +1409,7 @@ private end def validate_valid_radio_option - log.attributes.each do |question_id, _v| + log.attributes.each_key do |question_id| question = log.form.get_question(question_id, log) next if question_id == "type" diff --git a/app/services/csv/lettings_log_csv_service.rb b/app/services/csv/lettings_log_csv_service.rb index 003515ac9..dd3be8595 100644 --- a/app/services/csv/lettings_log_csv_service.rb +++ b/app/services/csv/lettings_log_csv_service.rb @@ -398,12 +398,14 @@ module Csv def label_if_boolean_value(value) return "Yes" if value == true - return "No" if value == false + + "No" if value == false end def conventional_yes_no_label(value) return "Yes" if value == 1 - return "No" if value&.zero? + + "No" if value&.zero? end end end diff --git a/app/services/csv/sales_log_csv_service.rb b/app/services/csv/sales_log_csv_service.rb index ed16653f1..07ccad82c 100644 --- a/app/services/csv/sales_log_csv_service.rb +++ b/app/services/csv/sales_log_csv_service.rb @@ -408,7 +408,8 @@ module Csv def label_if_boolean_value(value) return "Yes" if value == true - return "No" if value == false + + "No" if value == false end end end diff --git a/app/services/documentation_generator.rb b/app/services/documentation_generator.rb index c2005f320..58c2031f7 100644 --- a/app/services/documentation_generator.rb +++ b/app/services/documentation_generator.rb @@ -93,7 +93,7 @@ class DocumentationGenerator interruption_screen_pages = form.pages.select { |page| page.questions.first.type == "interruption_screen" } interruption_screen_pages_grouped_by_question = interruption_screen_pages.group_by { |page| page.questions.first.id } - interruption_screen_pages_grouped_by_question.each do |_question_id, pages| + interruption_screen_pages_grouped_by_question.each_value do |pages| pages.map do |page| save_soft_validation(form, page, validation_descriptions, log_type) end diff --git a/app/services/exports/organisation_export_constants.rb b/app/services/exports/organisation_export_constants.rb index 6c78a55db..7ffbfd223 100644 --- a/app/services/exports/organisation_export_constants.rb +++ b/app/services/exports/organisation_export_constants.rb @@ -23,6 +23,6 @@ module Exports::OrganisationExportConstants "dpo_email", "profit_status", "group", - "status" + "status", ] end diff --git a/app/services/filter_manager.rb b/app/services/filter_manager.rb index 7757ad39e..69e895809 100644 --- a/app/services/filter_manager.rb +++ b/app/services/filter_manager.rb @@ -121,7 +121,7 @@ class FilterManager new_filters = new_filters.except("user") if params["assigned_to"] == "all" new_filters["user"] = current_user.id.to_s if params["assigned_to"] == "you" - new_filters = new_filters.except("user_text_search") if params["assigned_to"] == "all" || params["assigned_to"] == "you" + new_filters = new_filters.except("user_text_search") if %w[all you].include?(params["assigned_to"]) new_filters = new_filters.except("owning_organisation_text_search") if params["owning_organisation_select"] == "all" new_filters = new_filters.except("managing_organisation_text_search") if params["managing_organisation_select"] == "all" end diff --git a/app/views/form/_checkbox_question.html.erb b/app/views/form/_checkbox_question.html.erb index b4feb12bd..d3c52c270 100644 --- a/app/views/form/_checkbox_question.html.erb +++ b/app/views/form/_checkbox_question.html.erb @@ -16,7 +16,7 @@ hint: { text: option["hint"] }, checked: @log[key] == 1, exclusive: after_divider, - link_errors: index.zero? ? true : nil, + link_errors: index.zero? || nil, **stimulus_html_attributes(question) %> <% end %> <% end %> diff --git a/app/views/form/_interruption_screen_question.html.erb b/app/views/form/_interruption_screen_question.html.erb index c0063e477..9aa38ca5d 100644 --- a/app/views/form/_interruption_screen_question.html.erb +++ b/app/views/form/_interruption_screen_question.html.erb @@ -18,7 +18,7 @@
<%= f.govuk_submit "Confirm and continue" %> <%= govuk_link_to( - (@page.skip_text || "Skip for now"), - (@page.skip_href(@log) || send(@log.form.next_page_redirect_path(@page, @log, current_user, ignore_answered: true), @log)), + @page.skip_text || "Skip for now", + @page.skip_href(@log) || send(@log.form.next_page_redirect_path(@page, @log, current_user, ignore_answered: true), @log), ) %>
diff --git a/app/views/form/_radio_question.html.erb b/app/views/form/_radio_question.html.erb index bf6abb0d0..e810d7b7a 100644 --- a/app/views/form/_radio_question.html.erb +++ b/app/views/form/_radio_question.html.erb @@ -28,14 +28,14 @@ key, label: { text: options["value"] }, hint: { text: options["hint"] }, - link_errors: index.zero? ? true : nil, + link_errors: index.zero? || nil, **stimulus_html_attributes(question) %> <% else %> <%= f.govuk_radio_button question.id.to_sym, key, label: { text: options["value"] }, hint: { text: options["hint"] }, - link_errors: index.zero? ? true : nil, + link_errors: index.zero? || nil, **stimulus_html_attributes(question) do %> <%= render partial: "#{conditional_question.type}_question", locals: { question: conditional_question, diff --git a/app/views/rails_admin/main/_submit_buttons.html.erb b/app/views/rails_admin/main/_submit_buttons.html.erb index 241624c4e..1768ce2b3 100644 --- a/app/views/rails_admin/main/_submit_buttons.html.erb +++ b/app/views/rails_admin/main/_submit_buttons.html.erb @@ -1,6 +1,6 @@
- +