From 8c79d152b2cefb4304259aca353de7d81f365e48 Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis <94526761+natdeanlewissoftwire@users.noreply.github.com> Date: Tue, 10 Feb 2026 16:54:51 +0000 Subject: [PATCH 1/2] CLDC-4141: New sex registered at birth question for lettings logs (#3171) * CLDC-4177: Create new sex-at-birth question * CLDC-4177: Update database * CLDC-4177: Adds SAB form for the primary buyer. * CLDC-4177: Adds sex-at-birth question for other household members * CLCD-4177: Unit tests * CLDC-4177: Misc inclusions where sex is also used * CLDC-4177: Lint fixes * CLDC-4177: Do not include sexRAB in pre-2026 exports * CLDC-4177: Fixes bug with copy key in new page * CLDC-4177: Changes logic used to decide which fields to export * CLDC-4177: Linting fixes * CLDC-4177: Converts new field to lowercase * CLDC-4177: Satisfy bulk upload tests (not tested manually) * CLDC-4177: Rename new fields to lowercase * CLDC-4177: Rename field in bulk upload. * CLDC-4141: Update database * CLDC-4141: New question and page models * CLDC-4141: Adds the new sab questions to the form * CLDC-4141: Update locales * CLDC-4141: Export sab questions * CLDC-4141: change buyer -> lead tenant for lettings log sexrab1 * CLDC-4141: enable sexrab questions for lettings log persons 2-8 * CLDC-4141: update row parser * CLDC-4141: update csv service * Fix db casing * CLDC-4141: update schema (nonfunctional change) * CLDC-4141: update row parser expected fields * CLDC-4141: use correct lettings q * CLDC-4141: update page and question tests * CLDC-4141: update subsection test * CLDC-4141: update row parser test * CLDC-4141: linting * CLDC-4141: remove frozen string literals * CLDC-4177: remove frozen string literals * CLDC-4141: fix person casing typo * Delete redundant migration * CLDC-4141: revert fields count change * CLDC-4141: update row parser spec * CLDC-4141: revert export service change * Revert "CLDC-4141: revert export service change" This reverts commit c43ff40006cbe55a4cdf75bd8ab687d845782c33. * CLDC-4177: Create new sex-at-birth question * CLDC-4177: Update database * CLDC-4177: Adds SAB form for the primary buyer. * CLDC-4177: Adds sex-at-birth question for other household members * CLCD-4177: Unit tests * CLDC-4177: Misc inclusions where sex is also used * CLDC-4177: Lint fixes * CLDC-4177: Do not include sexRAB in pre-2026 exports * CLDC-4177: Fixes bug with copy key in new page * CLDC-4177: Changes logic used to decide which fields to export * CLDC-4177: Linting fixes * CLDC-4177: Converts new field to lowercase * CLDC-4177: Satisfy bulk upload tests (not tested manually) * CLDC-4177: Rename new fields to lowercase * CLDC-4177: Rename field in bulk upload. * Fix db casing * CLDC-4177: remove frozen string literals * Delete redundant migration * Remove extraneous lines from schema.rb * Add new sexrab fields to the :completed trait in the Sales Log factory * CLDC-4141: partial csv download test update * CLDC-4141: update csv conversion rake task * CLDC-4141: untrack temp csv export files * CLDC-4141: update remaining csv tests * CLDC-4141: fix schema since latest changes * CLDC-4141: update schema * CLDC-4141: revert breaking export service changes * CLDC-4141: update var def spec * CLDC-4141: update var def spec * CLDC-4141: update var def spec * CLDC-4141: update BU test file * CLDC-4141: update validator specs * CLDC-4141: update csv_parser columns * CLDC-4141: linting * CLDC-4141: linting * CLDC-4141: linting * CLDC-4141: update person_n_present methods * CLDC-4141: remove redundant MAX_COLUMNS check * CLDC-4141: avoid sales changes in this PR, will leave to CLDC-4177 * CLDC-4141: use FIELDS const where can be shared * CLDC-4141: revert FIELDS sharing * CLDC-4141: update export services tests * CLDC-4141: include fields rather than omitting in lettings_log_export_service.rb * CLDC-4141: share default 2026 field count * CLDC-4141: cleanup export field filtering * CLDC-4141: simplify export year filtering * CLDC-4141: use FIELDS to check max_columns * CLDC-4141: update 2026_27 manual test fixture * CLDC-4177: remove redundant inferred CYA vals * CLDC-4141: remove redundant inferred CYA vals * CLDC-4177: update bu files * CLDC-4177: update sales log export service * CLDC-4141: remove redundant field filtering * CLDC-4141: reinstate old comment * CLDC-4141: reinstate old comment * CLDC-4141: rename var def file * CLDC-4141: update variable definitions tests * CLDC-4141: update schema * CLDC-4177: update schema * CLDC-4177: linting * CLDC-4177: linting * CLDC-4141: update csv fixtures * CLDC-4177: update sales log export constants * CLDC-4177: update factories * CLDC-4177: lint * CLDC-4177: csv parser updates * CLDC-4177: bu field updates * CLDC-4177: update var def spec * CLDC-4141: Add final question numbers (CLDC-4202) * CLDC-4141: make to_2026_row explicit * CLDC-4177: make to_2026_row explicit * CLDC-4177: use shared field count * CLDC-4177: refactor to remove max cols going forwards * CLDC-4141: update schema * CLDC-4141: update schema * CLDC-4141: update schema * CLDC-4141: update schema * CLDC-4141: remove X from factory options * CLDC-4177: update log var defs * CLDC-4177: use correct shared field count * CLDC-4177: remove trailing commas * CLDC-4177: update log var defs * CLDC-4177: update bulk upload csv example * CLDC-4141: update bulk upload csv example * CLDC-4177: update bulk upload csv example * CLDC-4177: remove sexrab from expected sales export for now * CLDC-4141: correct csv service expectations * CLDC-4141: don't sample X for sexrab --------- Co-authored-by: Katherine Langford Co-authored-by: oscar-richardson-softwire Co-authored-by: Samuel Young --- .../bulk_upload/lettings_log_to_csv.rb | 155 +++++++++++- .../lead_tenant_sex_registered_at_birth.rb | 13 + .../pages/person_sex_registered_at_birth.rb | 16 ++ .../lead_tenant_sex_registered_at_birth.rb | 19 ++ .../person_sex_registered_at_birth.rb | 23 ++ .../subsections/household_characteristics.rb | 8 + .../lettings/year2026/csv_parser.rb | 5 +- .../lettings/year2026/row_parser.rb | 53 +++- app/services/csv/lettings_log_csv_service.rb | 1 + .../exports/lettings_log_export_constants.rb | 99 +++++--- .../exports/lettings_log_export_service.rb | 46 +++- .../lettings/household_characteristics.en.yml | 56 +++++ ...ex_registered_at_birth_to_lettings_logs.rb | 14 ++ db/schema.rb | 8 + spec/factories/lettings_log.rb | 3 + .../exports/general_needs_log_26_27.xml | 8 + .../files/2026_27_lettings_bulk_upload.csv | 42 ++-- .../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 | 227 ++++++++++++++++++ .../tasks/log_variable_definitions_spec.rb | 2 +- ...ead_tenant_sex_registered_at_birth_spec.rb | 29 +++ .../person_sex_registered_at_birth_spec.rb | 138 +++++++++++ ...ead_tenant_sex_registered_at_birth_spec.rb | 53 ++++ .../person_sex_registered_at_birth_spec.rb | 185 ++++++++++++++ .../household_characteristics_spec.rb | 8 + .../bulk_upload/lettings/validator_spec.rb | 6 +- .../lettings/year2026/csv_parser_spec.rb | 8 +- .../lettings/year2026/row_parser_spec.rb | 11 +- .../csv/lettings_log_csv_service_spec.rb | 3 + .../lettings_log_export_service_spec.rb | 4 +- .../variable_definitions_service_spec.rb | 4 +- 34 files changed, 1164 insertions(+), 107 deletions(-) create mode 100644 app/models/form/lettings/pages/lead_tenant_sex_registered_at_birth.rb create mode 100644 app/models/form/lettings/pages/person_sex_registered_at_birth.rb create mode 100644 app/models/form/lettings/questions/lead_tenant_sex_registered_at_birth.rb create mode 100644 app/models/form/lettings/questions/person_sex_registered_at_birth.rb create mode 100644 db/migrate/20260128121417_add_sex_registered_at_birth_to_lettings_logs.rb create mode 100644 spec/models/form/lettings/pages/lead_tenant_sex_registered_at_birth_spec.rb create mode 100644 spec/models/form/lettings/pages/person_sex_registered_at_birth_spec.rb create mode 100644 spec/models/form/lettings/questions/lead_tenant_sex_registered_at_birth_spec.rb create mode 100644 spec/models/form/lettings/questions/person_sex_registered_at_birth_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 891331e40..515d44487 100644 --- a/app/helpers/bulk_upload/lettings_log_to_csv.rb +++ b/app/helpers/bulk_upload/lettings_log_to_csv.rb @@ -92,13 +92,162 @@ class BulkUpload::LettingsLogToCsv end def default_2026_field_numbers - # TODO: CLDC-4162 Replace with actual field numbers when 2026 format is known - (1..129).to_a + (1..BulkUpload::Lettings::Year2026::CsvParser::FIELDS).to_a end def to_2026_row # TODO: CLDC-4162: Implement when 2026 format is known - to_2025_row + [ + overrides[:organisation_id] || log.owning_organisation&.old_visible_id, # 1 + overrides[:managing_organisation_id] || log.managing_organisation&.old_visible_id, + log.assigned_to&.email, + log.needstype, + log.scheme&.id ? "S#{log.scheme&.id}" : "", + log.location&.id, + renewal, + log.startdate&.day, + log.startdate&.month, + log.startdate&.strftime("%y"), # 10 + + rent_type, + log.irproduct_other, + log.tenancycode, + log.propcode, + log.declaration, + log.rsnvac, + log.unitletas, + log.uprn, + log.address_line1&.tr(",", " "), + log.address_line2&.tr(",", " "), # 20 + + log.town_or_city&.tr(",", " "), + log.county&.tr(",", " "), + ((log.postcode_full || "").split(" ") || [""]).first, + ((log.postcode_full || "").split(" ") || [""]).last, + log.la, + log.unittype_gn, + log.builtype, + log.wchair, + log.beds, + log.voiddate&.day, # 30 + + log.voiddate&.month, + log.voiddate&.strftime("%y"), + log.mrcdate&.day, + log.mrcdate&.month, + log.mrcdate&.strftime("%y"), + log.sheltered, + log.joint, + log.startertenancy, + log.tenancy, + log.tenancyother, # 40 + + log.tenancylength, + log.age1 || overrides[:age1], + log.sex1, + log.ethnic, + log.nationality_all_group, + log.ecstat1, + relat_number(log.relat2), + log.age2 || overrides[:age2], + log.sex2, + log.ecstat2, # 50 + + relat_number(log.relat3), + log.age3 || overrides[:age3], + log.sex3, + log.ecstat3, + relat_number(log.relat4), + log.age4 || overrides[:age4], + log.sex4, + log.ecstat4, + relat_number(log.relat5), + log.age5 || overrides[:age5], # 60 + + log.sex5, + log.ecstat5, + relat_number(log.relat6), + log.age6 || overrides[:age6], + log.sex6, + log.ecstat6, + relat_number(log.relat7), + log.age7 || overrides[:age7], + log.sex7, + log.ecstat7, # 70 + + relat_number(log.relat8), + log.age8 || overrides[:age8], + log.sex8, + log.ecstat8, + log.armedforces, + log.leftreg, + log.reservist, + log.preg_occ, + log.housingneeds_a, + log.housingneeds_b, # 80 + + log.housingneeds_c, + log.housingneeds_f, + log.housingneeds_g, + log.housingneeds_h, + overrides[:illness] || log.illness, + log.illness_type_1, + log.illness_type_2, + log.illness_type_3, + log.illness_type_4, + log.illness_type_5, # 90 + + log.illness_type_6, + log.illness_type_7, + log.illness_type_8, + log.illness_type_9, + log.illness_type_10, + log.layear, + log.waityear, + log.reason, + log.reasonother, + log.prevten, # 100 + + homeless, + previous_postcode_known, + ((log.ppostcode_full || "").split(" ") || [""]).first, + ((log.ppostcode_full || "").split(" ") || [""]).last, + log.prevloc, + log.reasonpref, + log.rp_homeless, + log.rp_insan_unsat, + log.rp_medwel, + log.rp_hardship, # 110 + + log.rp_dontknow, + cbl, + chr, + cap, + accessible_register, + log.referral, + net_income_known, + log.incfreq, + log.earnings, + log.hb, # 120 + + log.benefits, + log.household_charge, + log.period, + log.brent, + log.scharge, + log.pscharge, + log.supcharg, + log.hbrentshortfall, + log.tshortfall, + log.sexrab1, # 130 + log.sexrab2, + log.sexrab3, + log.sexrab4, + log.sexrab5, + log.sexrab6, + log.sexrab7, + log.sexrab8, # 137 + ] end def to_2025_row diff --git a/app/models/form/lettings/pages/lead_tenant_sex_registered_at_birth.rb b/app/models/form/lettings/pages/lead_tenant_sex_registered_at_birth.rb new file mode 100644 index 000000000..8bb7cb2e3 --- /dev/null +++ b/app/models/form/lettings/pages/lead_tenant_sex_registered_at_birth.rb @@ -0,0 +1,13 @@ +class Form::Lettings::Pages::LeadTenantSexRegisteredAtBirth < ::Form::Page + def initialize(id, hsh, subsection) + super + @id = "lead_tenant_sex_registered_at_birth" + @depends_on = [{ "declaration" => 1 }] + end + + def questions + @questions ||= [ + Form::Lettings::Questions::LeadTenantSexRegisteredAtBirth.new(nil, nil, self), + ] + end +end diff --git a/app/models/form/lettings/pages/person_sex_registered_at_birth.rb b/app/models/form/lettings/pages/person_sex_registered_at_birth.rb new file mode 100644 index 000000000..d9405a048 --- /dev/null +++ b/app/models/form/lettings/pages/person_sex_registered_at_birth.rb @@ -0,0 +1,16 @@ +class Form::Lettings::Pages::PersonSexRegisteredAtBirth < ::Form::Page + def initialize(id, hsh, subsection, person_index:) + super(id, hsh, subsection) + @id = "person_#{person_index}_sex_registered_at_birth" + @person_index = person_index + @depends_on = [ + { "details_known_#{person_index}" => 0 }, + ] + end + + def questions + @questions ||= [ + Form::Lettings::Questions::PersonSexRegisteredAtBirth.new("sexrab#{@person_index}", nil, self, person_index: @person_index), + ] + end +end diff --git a/app/models/form/lettings/questions/lead_tenant_sex_registered_at_birth.rb b/app/models/form/lettings/questions/lead_tenant_sex_registered_at_birth.rb new file mode 100644 index 000000000..2e8523f51 --- /dev/null +++ b/app/models/form/lettings/questions/lead_tenant_sex_registered_at_birth.rb @@ -0,0 +1,19 @@ +class Form::Lettings::Questions::LeadTenantSexRegisteredAtBirth < ::Form::Question + def initialize(id, hsh, page) + super + @id = "sexrab1" + @type = "radio" + @check_answers_card_number = 1 + @answer_options = ANSWER_OPTIONS + @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] + end + + ANSWER_OPTIONS = { + "F" => { "value" => "Female" }, + "M" => { "value" => "Male" }, + "divider" => { "value" => true }, + "R" => { "value" => "Lead tenant prefers not to say" }, + }.freeze + + QUESTION_NUMBER_FROM_YEAR = { 2026 => 31 }.freeze +end 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 new file mode 100644 index 000000000..b549885b1 --- /dev/null +++ b/app/models/form/lettings/questions/person_sex_registered_at_birth.rb @@ -0,0 +1,23 @@ +class Form::Lettings::Questions::PersonSexRegisteredAtBirth < ::Form::Question + def initialize(id, hsh, page, person_index:) + super(id, hsh, page) + @type = "radio" + @check_answers_card_number = person_index + @answer_options = ANSWER_OPTIONS + @person_index = person_index + @question_number = question_number + end + + ANSWER_OPTIONS = { + "F" => { "value" => "Female" }, + "M" => { "value" => "Male" }, + "divider" => { "value" => true }, + "R" => { "value" => "Person prefers not to say" }, + }.freeze + + def question_number + base_question_number = 29 + + base_question_number + (5 * @person_index) + end +end diff --git a/app/models/form/lettings/subsections/household_characteristics.rb b/app/models/form/lettings/subsections/household_characteristics.rb index 074709f8d..cfc53603e 100644 --- a/app/models/form/lettings/subsections/household_characteristics.rb +++ b/app/models/form/lettings/subsections/household_characteristics.rb @@ -17,6 +17,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadAgeValueCheck.new(nil, nil, self), 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::LeadTenantGenderIdentity.new(nil, nil, self), Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadValueCheck.new(nil, nil, self), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadValueCheck.new(nil, nil, self), @@ -45,6 +46,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_2_under_retirement_value_check", nil, self, person_index: 2), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_2_over_retirement_value_check", nil, self, person_index: 2), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?), + (Form::Lettings::Pages::PersonSexRegisteredAtBirth.new(nil, nil, self, person_index: 2) if form.start_year_2026_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -67,6 +69,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_3_under_retirement_value_check", nil, self, person_index: 3), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_3_over_retirement_value_check", nil, self, person_index: 3), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?), + (Form::Lettings::Pages::PersonSexRegisteredAtBirth.new(nil, nil, self, person_index: 3) if form.start_year_2026_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -89,6 +92,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_4_under_retirement_value_check", nil, self, person_index: 4), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_4_over_retirement_value_check", nil, self, person_index: 4), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?), + (Form::Lettings::Pages::PersonSexRegisteredAtBirth.new(nil, nil, self, person_index: 4) if form.start_year_2026_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -111,6 +115,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_5_under_retirement_value_check", nil, self, person_index: 5), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_5_over_retirement_value_check", nil, self, person_index: 5), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?), + (Form::Lettings::Pages::PersonSexRegisteredAtBirth.new(nil, nil, self, person_index: 5) if form.start_year_2026_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -133,6 +138,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_6_under_retirement_value_check", nil, self, person_index: 6), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_6_over_retirement_value_check", nil, self, person_index: 6), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?), + (Form::Lettings::Pages::PersonSexRegisteredAtBirth.new(nil, nil, self, person_index: 6) if form.start_year_2026_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -155,6 +161,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_7_under_retirement_value_check", nil, self, person_index: 7), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_7_over_retirement_value_check", nil, self, person_index: 7), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?), + (Form::Lettings::Pages::PersonSexRegisteredAtBirth.new(nil, nil, self, person_index: 7) if form.start_year_2026_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, @@ -177,6 +184,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_8_under_retirement_value_check", nil, self, person_index: 8), Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_8_over_retirement_value_check", nil, self, person_index: 8), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?), + (Form::Lettings::Pages::PersonSexRegisteredAtBirth.new(nil, nil, self, person_index: 8) if form.start_year_2026_or_later?), Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, diff --git a/app/services/bulk_upload/lettings/year2026/csv_parser.rb b/app/services/bulk_upload/lettings/year2026/csv_parser.rb index 2484cbc4b..68a0b72ce 100644 --- a/app/services/bulk_upload/lettings/year2026/csv_parser.rb +++ b/app/services/bulk_upload/lettings/year2026/csv_parser.rb @@ -4,8 +4,7 @@ class BulkUpload::Lettings::Year2026::CsvParser include CollectionTimeHelper # TODO: CLDC-4162: Update when 2026 format is known - FIELDS = 129 - MAX_COLUMNS = 130 + FIELDS = 137 FORM_YEAR = 2026 attr_reader :path @@ -66,7 +65,7 @@ class BulkUpload::Lettings::Year2026::CsvParser max_columns_count = body_rows.map(&:size).max - col_offset - max_columns_count > MAX_COLUMNS + max_columns_count > FIELDS end def wrong_template_for_year? diff --git a/app/services/bulk_upload/lettings/year2026/row_parser.rb b/app/services/bulk_upload/lettings/year2026/row_parser.rb index 700084724..34e252920 100644 --- a/app/services/bulk_upload/lettings/year2026/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2026/row_parser.rb @@ -134,6 +134,15 @@ class BulkUpload::Lettings::Year2026::RowParser field_127: "What is the support charge?", 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", }.freeze RENT_TYPE_BU_MAPPING = { @@ -283,6 +292,15 @@ class BulkUpload::Lettings::Year2026::RowParser attribute :field_128, :integer attribute :field_129, :decimal + attribute :field_130, :string + attribute :field_131, :string + attribute :field_132, :string + attribute :field_133, :string + attribute :field_134, :string + attribute :field_135, :string + attribute :field_136, :string + attribute :field_137, :string + validate :validate_valid_radio_option, on: :before_log validates :field_11, @@ -541,6 +559,7 @@ class BulkUpload::Lettings::Year2026::RowParser !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_46", # ecstat1 ) if [field_124, field_125, field_126, field_127].all?(&:present?) @@ -689,6 +708,7 @@ private [ "startdate", "age1", + "sexrab1", "sex1", "ecstat1", "owning_organisation", @@ -979,6 +999,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_46, error_message) # ecstat1 errors.add(:field_122, error_message) unless general_needs? # household_charge @@ -1150,6 +1171,15 @@ private town_or_city: [:field_21], 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], }.compact end @@ -1356,6 +1386,15 @@ 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 end @@ -1462,31 +1501,31 @@ private end def person_2_present? - field_47.present? || field_48.present? || field_49.present? + field_47.present? || field_48.present? || field_49.present? || field_131.present? end def person_3_present? - field_51.present? || field_52.present? || field_53.present? + field_51.present? || field_52.present? || field_53.present? || field_132.present? end def person_4_present? - field_55.present? || field_56.present? || field_57.present? + field_55.present? || field_56.present? || field_57.present? || field_133.present? end def person_5_present? - field_59.present? || field_60.present? || field_61.present? + field_59.present? || field_60.present? || field_61.present? || field_134.present? end def person_6_present? - field_63.present? || field_64.present? || field_65.present? + field_63.present? || field_64.present? || field_65.present? || field_135.present? end def person_7_present? - field_67.present? || field_68.present? || field_69.present? + field_67.present? || field_68.present? || field_69.present? || field_136.present? end def person_8_present? - field_71.present? || field_72.present? || field_73.present? + field_71.present? || field_72.present? || field_73.present? || field_137.present? end def leftreg diff --git a/app/services/csv/lettings_log_csv_service.rb b/app/services/csv/lettings_log_csv_service.rb index 2da392fb0..601d27365 100644 --- a/app/services/csv/lettings_log_csv_service.rb +++ b/app/services/csv/lettings_log_csv_service.rb @@ -137,6 +137,7 @@ module Csv hash["age1"] = { "refused_code" => "-9", "refused_label" => "Not known", "age_known_field" => "age1_known" } (2..8).each do |i| hash["age#{i}"] = { "refused_code" => "-9", "refused_label" => "Not known", "details_known_field" => "details_known_#{i}", "age_known_field" => "age#{i}_known" } + hash["sexrab#{i}"] = { "refused_code" => "R", "refused_label" => "Prefers not to say", "details_known_field" => "details_known_#{i}" } hash["sex#{i}"] = { "refused_code" => "R", "refused_label" => "Prefers not to say", "details_known_field" => "details_known_#{i}" } hash["relat#{i}"] = { "refused_code" => "R", "refused_label" => "Prefers not to say", "details_known_field" => "details_known_#{i}" } hash["ecstat#{i}"] = { "refused_code" => "10", "refused_label" => "Prefers not to say", "details_known_field" => "details_known_#{i}" } diff --git a/app/services/exports/lettings_log_export_constants.rb b/app/services/exports/lettings_log_export_constants.rb index 1698fb0a1..ddef610d5 100644 --- a/app/services/exports/lettings_log_export_constants.rb +++ b/app/services/exports/lettings_log_export_constants.rb @@ -7,15 +7,13 @@ module Exports::LettingsLogExportConstants csv: 2, }.freeze - EXPORT_FIELDS = Set[ + ALL_YEAR_EXPORT_FIELDS = Set[ "armedforces", "beds", "benefits", "brent", - "builtype", "cap", "cbl", - "chcharge", "chr", "cligrp1", "cligrp2", @@ -53,12 +51,10 @@ module Exports::LettingsLogExportConstants "mantype", "mobstand", "mrcdate", - "national", "needstype", "new_old", "newprop", "nocharge", - "offered", "owningorgid", "owningorgname", "period", @@ -138,6 +134,49 @@ module Exports::LettingsLogExportConstants "location_status", "amended_by", "duplicate_set_id", + "assigned_to", + "created_by", + ] + + (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}" + end + (1..10).each do |index| + ALL_YEAR_EXPORT_FIELDS << "illness_type_#{index}" + end + %w[a b c d e f g h].each do |letter| + ALL_YEAR_EXPORT_FIELDS << "housingneeds_#{letter}" + end + + YEAR_2021_EXPORT_FIELDS = Set[ + "builtype", + "chcharge", + "national", + "offered", + ] + + YEAR_2022_EXPORT_FIELDS = Set[ + "builtype", + "chcharge", + "national", + "offered", + ] + + YEAR_2023_EXPORT_FIELDS = Set[ + "builtype", + "chcharge", + "national", + "offered", + ] + + YEAR_2024_EXPORT_FIELDS = Set[ + "builtype", + "chcharge", "accessible_register", "nationality_all", "bulk_upload_id", @@ -153,26 +192,10 @@ module Exports::LettingsLogExportConstants "pscharge_value_check", "supcharg_value_check", "carehome_charges_value_check", - "assigned_to", - "created_by", ] - (1..8).each do |index| - EXPORT_FIELDS << "age#{index}" - EXPORT_FIELDS << "ecstat#{index}" - EXPORT_FIELDS << "sex#{index}" - end - (2..8).each do |index| - EXPORT_FIELDS << "relat#{index}" - end - (1..10).each do |index| - EXPORT_FIELDS << "illness_type_#{index}" - end - %w[a b c d e f g h].each do |letter| - EXPORT_FIELDS << "housingneeds_#{letter}" - end - - POST_2024_EXPORT_FIELDS = Set[ + YEAR_2025_EXPORT_FIELDS = Set[ + "builtype", "accessible_register", "nationality_all", "bulk_upload_id", @@ -187,20 +210,26 @@ module Exports::LettingsLogExportConstants "scharge_value_check", "pscharge_value_check", "supcharg_value_check", - "carehome_charges_value_check", ] - PRE_2024_EXPORT_FIELDS = Set[ - "national", - "offered" -] - - PRE_2025_EXPORT_FIELDS = Set[ - "carehome_charges_value_check", - "chcharge" + YEAR_2026_EXPORT_FIELDS = Set[ + "accessible_register", + "nationality_all", + "bulk_upload_id", + "address_line1_as_entered", + "address_line2_as_entered", + "town_or_city_as_entered", + "county_as_entered", + "postcode_full_as_entered", + "la_as_entered", + "net_income_value_check", + "rent_value_check", + "scharge_value_check", + "pscharge_value_check", + "supcharg_value_check", ] - PRE_2026_EXPORT_FIELDS = Set[ - "builtype" - ] + (1..8).each do |index| + YEAR_2026_EXPORT_FIELDS << "sexrab#{index}" + end end diff --git a/app/services/exports/lettings_log_export_service.rb b/app/services/exports/lettings_log_export_service.rb index 5e67b4854..3b7d8d6c1 100644 --- a/app/services/exports/lettings_log_export_service.rb +++ b/app/services/exports/lettings_log_export_service.rb @@ -131,6 +131,7 @@ module Exports attribute_hash["age#{index}"] = -9 attribute_hash["sex#{index}"] = "R" + attribute_hash["sexrab#{index}"] = "R" attribute_hash["relat#{index}"] = "R" attribute_hash["ecstat#{index}"] = 10 end @@ -162,16 +163,34 @@ module Exports attribute_hash["location_status"] = location.status_at(attribute_hash["startdate"]) end - def is_omitted_field?(field_name, lettings_log) - pattern_age = /age\d_known/ - details_known_prefix = "details_known_" - field_name.starts_with?(details_known_prefix) || - pattern_age.match(field_name) || - !EXPORT_FIELDS.include?(field_name) || - (lettings_log.form.start_year_2024_or_later? && PRE_2024_EXPORT_FIELDS.include?(field_name)) || - (!lettings_log.form.start_year_2024_or_later? && POST_2024_EXPORT_FIELDS.include?(field_name)) || - (lettings_log.form.start_year_2025_or_later? && PRE_2025_EXPORT_FIELDS.include?(field_name)) || - (lettings_log.form.start_year_2026_or_later? && PRE_2026_EXPORT_FIELDS.include?(field_name)) + def is_included_field?(field_name, included_fields) + included_fields.include?(field_name) + end + + def get_included_fields(lettings_log) + included_fields = Set[] + included_fields.merge(ALL_YEAR_EXPORT_FIELDS) + + year_fields = case lettings_log.collection_start_year + when 2021 + YEAR_2021_EXPORT_FIELDS + when 2022 + YEAR_2022_EXPORT_FIELDS + when 2023 + YEAR_2023_EXPORT_FIELDS + when 2024 + YEAR_2024_EXPORT_FIELDS + when 2025 + YEAR_2025_EXPORT_FIELDS + when 2026 + YEAR_2026_EXPORT_FIELDS + else + Set[] + end + + included_fields.merge(year_fields) + + included_fields end def build_export_xml(lettings_logs) @@ -181,11 +200,12 @@ module Exports attribute_hash = apply_cds_transformation(lettings_log, EXPORT_MODE[:xml]) form = doc.create_element("form") doc.at("forms") << form + included_fields = get_included_fields(lettings_log) attribute_hash.each do |key, value| - if is_omitted_field?(key, lettings_log) - next - else + if is_included_field?(key, included_fields) form << doc.create_element(key, value) + else + next end end form << doc.create_element("providertype", lettings_log.owning_organisation&.read_attribute_before_type_cast(:provider_type)) diff --git a/config/locales/forms/2026/lettings/household_characteristics.en.yml b/config/locales/forms/2026/lettings/household_characteristics.en.yml index ceecb6499..780e18600 100644 --- a/config/locales/forms/2026/lettings/household_characteristics.en.yml +++ b/config/locales/forms/2026/lettings/household_characteristics.en.yml @@ -23,6 +23,13 @@ en: hint_text: "" question_text: "Age" + sexrab1: + page_header: "" + check_answer_label: "Lead tenant’s sex registered at birth" + check_answer_prompt: "" + hint_text: "This is the sex that was registered at birth. The next question will ask about the lead tenant's gender identity." + question_text: "What was the lead tenant's sex at birth?" + sex1: page_header: "" check_answer_label: "Lead tenant’s gender identity" @@ -116,6 +123,13 @@ en: hint_text: "Answer 1 for children aged under 1 year old" question_text: "Age" + sexrab2: + page_header: "" + check_answer_label: "Person 2’s sex registered at birth" + check_answer_prompt: "" + hint_text: "This is the sex that was registered at birth. The next question will ask about their gender identity." + question_text: "What was person 2's sex at birth?" + sex2: page_header: "" check_answer_label: "Person 2’s gender identity" @@ -157,6 +171,13 @@ en: hint_text: "Answer 1 for children aged under 1 year old" question_text: "Age" + sexrab3: + page_header: "" + check_answer_label: "Person 3’s sex registered at birth" + check_answer_prompt: "" + hint_text: "This is the sex that was registered at birth. The next question will ask about their gender identity." + question_text: "What was person 3's sex at birth?" + sex3: page_header: "" check_answer_label: "Person 3’s gender identity" @@ -198,6 +219,13 @@ en: hint_text: "Answer 1 for children aged under 1 year old" question_text: "Age" + sexrab4: + page_header: "" + check_answer_label: "Person 4’s sex registered at birth" + check_answer_prompt: "" + hint_text: "This is the sex that was registered at birth. The next question will ask about their gender identity." + question_text: "What was person 4's sex at birth?" + sex4: page_header: "" check_answer_label: "Person 4’s gender identity" @@ -239,6 +267,13 @@ en: hint_text: "Answer 1 for children aged under 1 year old" question_text: "Age" + sexrab5: + page_header: "" + check_answer_label: "Person 5’s sex registered at birth" + check_answer_prompt: "" + hint_text: "This is the sex that was registered at birth. The next question will ask about their gender identity." + question_text: "What was person 5's sex at birth?" + sex5: page_header: "" check_answer_label: "Person 5’s gender identity" @@ -280,6 +315,13 @@ en: hint_text: "Answer 1 for children aged under 1 year old" question_text: "Age" + sexrab6: + page_header: "" + check_answer_label: "Person 6’s sex registered at birth" + check_answer_prompt: "" + hint_text: "This is the sex that was registered at birth. The next question will ask about their gender identity." + question_text: "What was person 6's sex at birth?" + sex6: page_header: "" check_answer_label: "Person 6’s gender identity" @@ -321,6 +363,13 @@ en: hint_text: "Answer 1 for children aged under 1 year old" question_text: "Age" + sexrab7: + page_header: "" + check_answer_label: "Person 7’s sex registered at birth" + check_answer_prompt: "" + hint_text: "This is the sex that was registered at birth. The next question will ask about their gender identity." + question_text: "What was person 7's sex at birth?" + sex7: page_header: "" check_answer_label: "Person 7’s gender identity" @@ -362,6 +411,13 @@ en: hint_text: "Answer 1 for children aged under 1 year old" question_text: "Age" + sexrab8: + page_header: "" + check_answer_label: "Person 8’s sex registered at birth" + check_answer_prompt: "" + hint_text: "This is the sex that was registered at birth. The next question will ask about their gender identity." + question_text: "What was person 8's sex at birth?" + sex8: page_header: "" check_answer_label: "Person 8’s gender identity" diff --git a/db/migrate/20260128121417_add_sex_registered_at_birth_to_lettings_logs.rb b/db/migrate/20260128121417_add_sex_registered_at_birth_to_lettings_logs.rb new file mode 100644 index 000000000..470cbdc70 --- /dev/null +++ b/db/migrate/20260128121417_add_sex_registered_at_birth_to_lettings_logs.rb @@ -0,0 +1,14 @@ +class AddSexRegisteredAtBirthToLettingsLogs < ActiveRecord::Migration[7.2] + def change + change_table :lettings_logs, bulk: true do |t| + t.column :sexrab1, :string + t.column :sexrab2, :string + t.column :sexrab3, :string + t.column :sexrab4, :string + t.column :sexrab5, :string + t.column :sexrab6, :string + t.column :sexrab7, :string + t.column :sexrab8, :string + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 727e809c7..6fd081249 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -376,6 +376,14 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_28_121417) do t.boolean "manual_address_entry_selected", default: false t.integer "referral_type" t.integer "working_situation_illness_check" + t.string "sexrab1" + t.string "sexrab2" + t.string "sexrab3" + t.string "sexrab4" + t.string "sexrab5" + t.string "sexrab6" + t.string "sexrab7" + t.string "sexrab8" 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 62cc94a14..536511805 100644 --- a/spec/factories/lettings_log.rb +++ b/spec/factories/lettings_log.rb @@ -40,6 +40,7 @@ FactoryBot.define do declaration { 1 } age1_known { 0 } age1 { 18 } + sexrab1 { "M" } sex1 { "M" } hhmemb { 1 } ecstat1 { 0 } @@ -58,6 +59,7 @@ FactoryBot.define do tenancycode { Faker::Name.initials(number: 10) } age1_known { 0 } age1 { Faker::Number.within(range: 25..45) } + sexrab1 { %w[F M R].sample } sex1 { %w[F M X R].sample } ethnic_group { 0 } ethnic { 2 } @@ -69,6 +71,7 @@ FactoryBot.define do age2_known { 0 } details_known_2 { 0 } age2 { Faker::Number.within(range: 25..45) } + sexrab2 { %w[F M R].sample } sex2 { %w[F M X R].sample } ecstat2 { 6 } homeless { 1 } diff --git a/spec/fixtures/exports/general_needs_log_26_27.xml b/spec/fixtures/exports/general_needs_log_26_27.xml index cc42c8f9b..71b334a4b 100644 --- a/spec/fixtures/exports/general_needs_log_26_27.xml +++ b/spec/fixtures/exports/general_needs_log_26_27.xml @@ -4,30 +4,38 @@ 2 BZ737 35 + F F 2 6 0 2 32 + M M 6 + + + + + + 1 diff --git a/spec/fixtures/files/2026_27_lettings_bulk_upload.csv b/spec/fixtures/files/2026_27_lettings_bulk_upload.csv index a3ee5cfc1..7acef99ae 100644 --- a/spec/fixtures/files/2026_27_lettings_bulk_upload.csv +++ b/spec/fixtures/files/2026_27_lettings_bulk_upload.csv @@ -1,26 +1,26 @@ -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 - + 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",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 housing register (or waiting list) for the area of 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?,Do you know the postcode of the household's last settled home?,Part 1 of postcode of last settled home,Part 2 of postcode of last settled home,What is the local authority of the household's last settled home?,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 unsanitary, overcrowded or unsatisfactory housing","Reasonable preference reason - + They needed to move due to 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","How was this letting allocated? Choice based Lettings (CBL)","How was this letting allocated? @@ -29,14 +29,14 @@ 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? +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? 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. You can find the location code on the CORE service under 'Schemes', either by searching for the specific location or downloading a csv.","If the property was previously being used as temporary accommodation, then answer 'no'.",,,,See specification for definitions,,This is how you usually refer to this tenancy on your own systems.,This is how you usually refer to this property on your own systems.,"Make sure the lead tenant has seen or been given access to the Ministry of Housing, Communities and Local Government (MHCLG) privacy notice before completing this log. This is a legal requirement under data protection legislation.","Internal transfer - Where a tenant moved from one social housing property to another property. Their landlord may be the same or may have changed. -Renewal of a fixed term tenancy - to the same tenant in the same property, except if was previously used as temporary accommodation.",This is the rent type of the previous tenancy in this property.,"The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355. +Renewal of a fixed term tenancy - to the same tenant in the same property, except if was previously used as temporary accommodation.",This is the rent type of the previous tenancy in this property.,"The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355. The UPRN may not be the same as the property reference assigned by your organisation.",,,,,Combined with field 22 it should be a postcode which lies within the local authority given in field 25.,Combined with field 21 it should be a postcode which lies within the local authority given in field 25.,,,,"This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property.","If shared accommodation, enter the number of bedrooms occupied by this household. A bedsit has 1 bedroom.","Date the property was (legally/contractually) available to let, or for: - re-lets: the day after previous tenant’s contract end - new-builds: the day the landlord legally owned the property ('completion date’) @@ -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. +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 +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" 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 -,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, +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 +,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,,,,,,, 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 6ad6a7aef..2c2bb616a 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}.,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?,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?,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?,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?,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?,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?,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?,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,sex1,ethnic_group,ethnic,nationality_all,ecstat1,working_situation_illness_check,details_known_2,age2,relat2,multiple_partners_value_check,sex2,ecstat2,details_known_3,age3,relat3,sex3,ecstat3,details_known_4,age4,relat4,sex4,ecstat4,details_known_5,age5,relat5,sex5,ecstat5,details_known_6,age6,relat6,sex6,ecstat6,details_known_7,age7,relat7,sex7,ecstat7,details_known_8,age8,relat8,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,0,2,36,0,,0,32,P,,M,6,1,-9,R,R,10,0,-9,R,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?,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?,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?,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?,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?,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?,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?,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?,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,sex1,ethnic_group,ethnic,nationality_all,ecstat1,working_situation_illness_check,details_known_2,age2,relat2,multiple_partners_value_check,sexrab2,sex2,ecstat2,details_known_3,age3,relat3,sexrab3,sex3,ecstat3,details_known_4,age4,relat4,sexrab4,sex4,ecstat4,details_known_5,age5,relat5,sexrab5,sex5,ecstat5,details_known_6,age6,relat6,sexrab6,sex6,ecstat6,details_known_7,age7,relat7,sexrab7,sex7,ecstat7,details_known_8,age8,relat8,sexrab8,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,F,0,2,36,0,,0,32,P,,M,M,6,1,-9,R,R,R,10,0,-9,R,R,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,,,,,,,,,,,,,,,,,,,, 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 909a1a02e..f771b4d60 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}.,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?,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?,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?,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?,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?,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?,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?,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,sex1,ethnic_group,ethnic,nationality_all,ecstat1,working_situation_illness_check,details_known_2,age2,relat2,multiple_partners_value_check,sex2,ecstat2,details_known_3,age3,relat3,sex3,ecstat3,details_known_4,age4,relat4,sex4,ecstat4,details_known_5,age5,relat5,sex5,ecstat5,details_known_6,age6,relat6,sex6,ecstat6,details_known_7,age7,relat7,sex7,ecstat7,details_known_8,age8,relat8,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,White,Irish,Australia,Other,,Yes,32,Yes,,Male,Not seeking work,No,Not known,Prefers not to say,Prefers not to say,Prefers not to say,Yes,Not known,Tenant 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?,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?,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?,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?,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?,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?,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?,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?,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,sex1,ethnic_group,ethnic,nationality_all,ecstat1,working_situation_illness_check,details_known_2,age2,relat2,multiple_partners_value_check,sexrab2,sex2,ecstat2,details_known_3,age3,relat3,sexrab3,sex3,ecstat3,details_known_4,age4,relat4,sexrab4,sex4,ecstat4,details_known_5,age5,relat5,sexrab5,sex5,ecstat5,details_known_6,age6,relat6,sexrab6,sex6,ecstat6,details_known_7,age7,relat7,sexrab7,sex7,ecstat7,details_known_8,age8,relat8,sexrab8,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,Female,White,Irish,Australia,Other,,Yes,32,Yes,,Male,Male,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,Person 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,,,,,,,,,,,,,,,,,,,, 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 49f2cc928..a5d1fb996 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?,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?,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?,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?,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?,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?,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?,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?,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,sex1,ethnic_group,ethnic,nationality_all,ecstat1,age2,relat2,sex2,ecstat2,age3,relat3,sex3,ecstat3,age4,relat4,sex4,ecstat4,age5,relat5,sex5,ecstat5,age6,relat6,sex6,ecstat6,age7,relat7,sex7,ecstat7,age8,relat8,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,0,2,36,0,32,P,M,6,-9,R,R,10,-9,R,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?,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?,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?,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?,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?,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?,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?,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?,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,sex1,ethnic_group,ethnic,nationality_all,ecstat1,age2,relat2,sexrab2,sex2,ecstat2,age3,relat3,sexrab3,sex3,ecstat3,age4,relat4,sexrab4,sex4,ecstat4,age5,relat5,sexrab5,sex5,ecstat5,age6,relat6,sexrab6,sex6,ecstat6,age7,relat7,sexrab7,sex7,ecstat7,age8,relat8,sexrab8,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,F,0,2,36,0,32,P,M,M,6,-9,R,R,R,10,-9,R,R,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,,,,,,,,,,,,,,,,,,,, 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 90135b804..cc8c02139 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?,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?,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?,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?,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?,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?,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?,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?,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,sex1,ethnic_group,ethnic,nationality_all,ecstat1,age2,relat2,sex2,ecstat2,age3,relat3,sex3,ecstat3,age4,relat4,sex4,ecstat4,age5,relat5,sex5,ecstat5,age6,relat6,sex6,ecstat6,age7,relat7,sex7,ecstat7,age8,relat8,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,White,Irish,Australia,Other,32,Yes,Male,Not seeking work,Not known,Prefers not to say,Prefers not to say,Prefers not to say,Not known,Tenant 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?,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?,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?,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?,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?,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?,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?,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?,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,sex1,ethnic_group,ethnic,nationality_all,ecstat1,age2,relat2,sexrab2,sex2,ecstat2,age3,relat3,sexrab3,sex3,ecstat3,age4,relat4,sexrab4,sex4,ecstat4,age5,relat5,sexrab5,sex5,ecstat5,age6,relat6,sexrab6,sex6,ecstat6,age7,relat7,sexrab7,sex7,ecstat7,age8,relat8,sexrab8,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,Female,White,Irish,Australia,Other,32,Yes,Male,Male,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,Person 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,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/variable_definitions/lettings_download_26_27.csv b/spec/fixtures/variable_definitions/lettings_download_26_27.csv index 2cc95f184..94ac24c49 100644 --- a/spec/fixtures/variable_definitions/lettings_download_26_27.csv +++ b/spec/fixtures/variable_definitions/lettings_download_26_27.csv @@ -1 +1,228 @@ +id,Log ID +status,Status of log +duplicate_set_id,ID of a set of duplicate logs +created_by,User the log is created by +is_dpo,Is the user in the assigned_to column the data protection officer? +created_at,Time and date the log was created +updated_by,User who last updated the log +updated_at,Time and date the log was last updated +creation_method,Was the log submitted in-service or via bulk upload? +collection_start_year,Year collection period opened +address_line1_as_entered,Address line 1 entered in bulk upload file +address_line2_as_entered,Address line 2 entered in bulk upload file +town_or_city_as_entered,Town or city entered in bulk upload file +county_as_entered,County entered in bulk upload file +postcode_full_as_entered,Postcode entered in bulk upload file +la_as_entered,Local authority entered in bulk upload file +bulk_upload_id,ID of a set of bulk uploaded logs +assigned_to,User the log is assigned to +owning_organisation_name,Which organisation owns this property? +managing_organisation_name,Which organisation manages this letting? +needstype,What is the needs type? +lettype,What is the letting type? +renewal,Is this letting a renewal? +startdate,What is the tenancy start date? +renttype,What is the rent type? (grouped into SR, IR or AR) +renttype_detail,What is the rent type? +irproduct,Which type of Intermediate Rent is this letting? +irproduct_other,Which 'Other' type of Intermediate Rent is this letting? +lar,Is this a London Affordable Rent letting? +tenancycode,What is the tenant code? +propcode,What is the property reference? +uprn_known,Is the UPRN known? +uprn,If known, property's UPRN +address_line1_input,Address line 1 input from address matching feature +postcode_full_input,Postcode input from address matching feature +address_search_value_check,Was the 'No address found' page seen? +uprn_selection,UPRN of the address selected +address_line1,Address line 1 +address_line2,Address line 2 +town_or_city,Town or City +county,County +postcode_full,Postcode +is_la_inferred,The internal value to indicate if the LA was inferred from the postcode +la_label,What is the property's local authority? +la,Local authority code +first_time_property_let_as_social_housing,Is this the first time the property has been let as social housing? +unitletas,What rent product was the property most recently let as? +rsnvac,What is the reason for the property being vacant? +newprop,Is this property new to the social rented sector? +unittype_gn,What type of unit is the property? +wchair,Is the property built or adapted to wheelchair-user standards? +beds,How many bedrooms does the property have? +voiddate,What is the void date? +vacdays,Number of days the property was vacant +void_date_value_check,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. +majorrepairs,Were any major repairs carried out during the void period? +mrcdate,What date were any major repairs completed on? +major_repairs_date_value_check,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect. +joint,Is this a joint tenancy? +startertenancy,Is this a starter tenancy? +tenancy,What is the type of tenancy? +tenancyother,If 'Other', what is the type of tenancy? +tenancylength,What is the length of the fixed-term tenancy to the nearest year? +sheltered,Is this letting in sheltered accommodation? +declaration,Has the tenant seen the MHCLG privacy notice? +hhmemb,How many people live in the household at this letting? +pregnancy_value_check,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. +refused,Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8 +hhtype,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 +totchild,Total number of dependent children in the household (Sum of when RELAT2-8 = C) +totelder,Total number of elders in household (Sum of when AGE1-8 >= 60) +totadult,Total number of adults in household +age1,What is the lead tenant's age? +retirement_value_check,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}. +sex1,Which of these best describes the lead tenant's gender identity? +ethnic_group,What is the lead tenant's ethnic group? +ethnic,Which of these best describes the lead tenant's ethnic background? +nationality_all,What is the lead tenant's nationality? +ecstat1,Which of these best describes the lead tenant's working situation? +details_known_2,Are the details of tenant 2 known? +relat2,What is person 2's relationship to the lead tenant? +partner_under_16_value_check,The following soft validation was confirmed: You said that [person X]'s relationship to lead tenant is partner, and that their age is [AGEX]. Are you sure this is correct? +multiple_partners_value_check,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? +age2,What is person 2's age? +sex2,Which of these best describes person 2's gender identity? +ecstat2,Which of these best describes person 2's working situation? +details_known_3,Are the details of tenant 3 known? +relat3,What is person 3's relationship to the lead tenant? +age3,What is person 3's age? +sex3,Which of these best describes person 3's gender identity? +ecstat3,Which of these best describes person 3's working situation? +details_known_4,Are the details of tenant 4 known? +relat4,What is person 4's relationship to the lead tenant? +age4,What is person 4's age? +sex4,Which of these best describes person 4's gender identity? +ecstat4,Which of these best describes person 4's working situation? +details_known_5,Are the details of tenant 5 known? +relat5,What is person 5's relationship to the lead tenant? +age5,What is person 5's age? +sex5,Which of these best describes person 5's gender identity? +ecstat5,Which of these best describes person 5's working situation? +details_known_6,Are the details of tenant 6 known? +relat6,What is person 6's relationship to the lead tenant? +age6,What is person 6's age? +sex6,Which of these best describes person 6's gender identity? +ecstat6,Which of these best describes person 6's working situation? +details_known_7,Are the details of tenant 7 known? +relat7,What is person 7's relationship to the lead tenant? +age7,What is person 7's age? +sex7,Which of these best describes person 7's gender identity? +ecstat7,Which of these best describes person 7's working situation? +details_known_8,Are the details of tenant 8 known? +relat8,What is person 8's relationship to the lead tenant? +age8,What is person 8's age? +sex8,Which of these best describes person 8's gender identity? +ecstat8,Which of these best describes person 8's working situation? +armedforces,Does anybody in the household have links to the UK armed forces? +leftreg,Is this person still serving in the UK armed forces? +reservist,Was this person seriously injured or ill as a result of serving in the UK armed forces? +preg_occ,Is anybody in the household pregnant? +housingneeds,Does anybody in the household have any disabled access needs? +housingneeds_type,What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms) +housingneeds_a,Disabled access needs a) Fully wheelchair-accessible housing +housingneeds_b,Disabled access needs b) Wheelchair access to essential rooms +housingneeds_c,Disabled access needs c) Level access housing +housingneeds_f,Disabled access needs f) Other disabled access needs +housingneeds_g,Disabled access needs g) No disabled access needs +housingneeds_h,Disabled access needs h) Don't know +housingneeds_other,Do they have any other disabled access needs? +illness,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more? +illness_type_4,Does this person's condition affect their dexterity? +illness_type_5,Does this person's condition affect their learning or understanding or concentrating? +illness_type_2,Does this person's condition affect their hearing? +illness_type_6,Does this person's condition affect their memory? +illness_type_7,Does this person's condition affect their mental health? +illness_type_3,Does this person's condition affect their mobility? +illness_type_9,Does this person's condition affect them socially or behaviourally? +illness_type_8,Does this person's condition affect their stamina or breathing or fatigue? +illness_type_1,Does this person's condition affect their vision? +illness_type_10,Does this person's condition affect them in another way? +layear,How long has the household continuously lived in the local authority area of the new letting? +waityear,How long has the household been on the local authority waiting list for the new letting? +reason,What is the tenant's main reason for the household leaving their last settled home? +reasonother,If 'Other', what was the main reason for leaving their last settled home? +reasonother_value_check,The soft validation was confirmed +prevten,Where was the household immediately before this letting? +homeless,Did the household experience homelessness immediately before this letting? +ppcodenk,Previous postcode unknown or previous accommodation was temporary +ppostcode_full,What is the postcode of the household's last settled home? +previous_la_known,Was the local authority of the household's last settled home known? +is_previous_la_inferred,The internal value to indicate if the previous LA was inferred from the postcode +prevloc_label,Previous location LA name +prevloc,Previous location's ONS LA Code +reasonpref,Was the household given reasonable preference by the local authority? +rp_homeless,Reasonable preference reason - They were homeless or about to lose their home (within 56 days) +rp_insan_unsat,Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing +rp_medwel,Reasonable preference reason - They needed to move on medical and welfare reasons (including disability) +rp_hardship,Reasonable preference reason - They needed to move to avoid hardship to themselves or others +rp_dontknow,Reasonable preference reason - Don't Know +cbl,Was the letting made under Choice-Based Lettings (CBL)? +cap,Was the letting made under the Common Allocation Policy (CAP)? +chr,Was the letting made under the Common Housing Register (CHR)? +accessible_register,Was the letting made under the Accessible Register? +letting_allocation_none,The letting was not allocated under CBL, CAP, CHR or Accessible Register. +referral,What was the source of referral for this letting? +referral_value_check,The following soft validation was confirmed: Are you sure? This is a general needs log, and this referral type is for supported housing. +net_income_known,Do you know the household's combined income after tax? +incref,Was the household income refused? +earnings,How much income does the household have in total? +incfreq,How often does the household receive income? +net_income_value_check,Populated when someone hits the soft validation and confirmed in the service +hb,Is the tenant likely to be receiving any of these housing-related benefits? +has_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 +benefits,How much of the household's income is from Universal Credit, state pensions or benefits? +household_charge,Does the household pay rent or other charges for the accommodation? +nocharge,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no +period,How often does the household pay rent and other charges? +is_carehome,Is this accommodation a care home? +chcharge,If this is a care home, how much does the household pay every [time period]? +wchchrg,Weekly care home charge +carehome_charges_value_check,Populated when the soft validation and confirmed in the service +brent,What is the basic rent? +wrent,Weekly rent +rent_value_check,Populated when the soft validation and confirmed in the service +scharge,What is the service charge? +wscharge,Weekly service charge +pscharge,What is the personal service charge? +wpschrge,Weekly personal service charge +supcharg,What is the support charge? +wsupchrg,Weekly support charge +tcharge,Total charge to the tenant +wtcharge,Weekly total charge to the tenant +scharge_value_check,Populated when the soft validation and confirmed in the service +pscharge_value_check,Populated when the soft validation and confirmed in the service +supcharg_value_check,Populated when the soft validation and confirmed in the service +hbrentshortfall,After the household has received any housing-related benefits, will they still need to pay for rent and charges? +tshortfall_known,Can you estimate the outstanding amount? +tshortfall,Estimated outstanding amount +wtshortfall,Weekly total rent shortfall charge for tenant receiving housing benefit +scheme_code,What scheme does this letting belong to? +scheme_service_name,From scheme code, we map to the scheme name +scheme_confidential,Does the scheme contain confidential information? +SCHTYPE,What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing +scheme_registered_under_care_act,Is this scheme registered under the Care Standards Act 2000? +scheme_owning_organisation_name,Which organisation owns the housing stock for this scheme? +scheme_primary_client_group,What client group is this scheme intended for? +scheme_has_other_client_group,Does this scheme provide for another client group? +scheme_secondary_client_group,What is the other client group? +scheme_support_type,What support does this scheme provide? +scheme_intended_stay,Intended length of stay +scheme_created_at,Date scheme was created +location_code,Which location is this letting for? +location_postcode,What is the postcode for this location? +location_name,What is the name of this location? +location_units,How many units are at this location? +location_type_of_unit,What is the most common type of unit at this location? +location_mobility_type,What are the mobility standards for the majority of the units in this location? +location_local_authority,What is the local authority of this postcode? +location_startdate,When did the first property in this location become available under this scheme? working_situation_illness_check,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'. +sexrab1,What was the lead tenant's sex at birth? +sexrab2,What was person 2's sex at birth? +sexrab3,What was person 3's sex at birth? +sexrab4,What was person 4's sex at birth? +sexrab5,What was person 5's sex at birth? +sexrab6,What was person 6's sex at birth? +sexrab7,What was person 7's sex at birth? +sexrab8,What was person 8's sex at birth? diff --git a/spec/lib/tasks/log_variable_definitions_spec.rb b/spec/lib/tasks/log_variable_definitions_spec.rb index d0ae5b151..386810d83 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) { 423 } + let(:total_variable_definitions_count) { 431 } before do Rake.application.rake_require("tasks/log_variable_definitions") diff --git a/spec/models/form/lettings/pages/lead_tenant_sex_registered_at_birth_spec.rb b/spec/models/form/lettings/pages/lead_tenant_sex_registered_at_birth_spec.rb new file mode 100644 index 000000000..fcc655849 --- /dev/null +++ b/spec/models/form/lettings/pages/lead_tenant_sex_registered_at_birth_spec.rb @@ -0,0 +1,29 @@ +require "rails_helper" + +RSpec.describe Form::Lettings::Pages::LeadTenantSexRegisteredAtBirth, 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: instance_double(Form, start_date: Time.zone.local(2026, 4, 1))) } + + 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[sexrab1]) + end + + it "has the correct id" do + expect(page.id).to eq("lead_tenant_sex_registered_at_birth") + end + + it "has the correct description" do + expect(page.description).to be_nil + end + + it "has correct depends_on" do + expect(page.depends_on).to eq([{ "declaration" => 1 }]) + end +end 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 new file mode 100644 index 000000000..628fe5f30 --- /dev/null +++ b/spec/models/form/lettings/pages/person_sex_registered_at_birth_spec.rb @@ -0,0 +1,138 @@ +require "rails_helper" + +RSpec.describe Form::Lettings::Pages::PersonSexRegisteredAtBirth, type: :model do + subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } + + let(:page_definition) { nil } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2026, 4, 1))) } + let(:person_index) { 1 } + + let(:page_id) { "person_2_sex_registered_at_birth" } + + it "has correct subsection" do + expect(page.subsection).to eq(subsection) + end + + it "has the correct description" do + expect(page.description).to be_nil + end + + context "with person 2" do + let(:person_index) { 2 } + let(:page_id) { "person_2_sex_registered_at_birth" } + + it "has correct questions" do + expect(page.questions.map(&:id)).to eq(%w[sexrab2]) + end + + it "has the correct id" do + expect(page.id).to eq("person_2_sex_registered_at_birth") + end + + it "has correct depends_on" do + expect(page.depends_on).to eq([{ "details_known_2" => 0 }]) + end + end + + context "with person 3" do + let(:person_index) { 3 } + let(:page_id) { "person_3_sex_registered_at_birth" } + + it "has correct questions" do + expect(page.questions.map(&:id)).to eq(%w[sexrab3]) + end + + it "has the correct id" do + expect(page.id).to eq("person_3_sex_registered_at_birth") + end + + it "has correct depends_on" do + expect(page.depends_on).to eq([{ "details_known_3" => 0 }]) + end + end + + context "with person 4" do + let(:person_index) { 4 } + let(:page_id) { "person_4_sex_registered_at_birth" } + + it "has correct questions" do + expect(page.questions.map(&:id)).to eq(%w[sexrab4]) + end + + it "has the correct id" do + expect(page.id).to eq("person_4_sex_registered_at_birth") + end + + it "has correct depends_on" do + expect(page.depends_on).to eq([{ "details_known_4" => 0 }]) + end + end + + context "with person 5" do + let(:person_index) { 5 } + let(:page_id) { "person_5_sex_registered_at_birth" } + + it "has correct questions" do + expect(page.questions.map(&:id)).to eq(%w[sexrab5]) + end + + it "has the correct id" do + expect(page.id).to eq("person_5_sex_registered_at_birth") + end + + it "has correct depends_on" do + expect(page.depends_on).to eq([{ "details_known_5" => 0 }]) + end + end + + context "with person 6" do + let(:person_index) { 6 } + let(:page_id) { "person_6_sex_registered_at_birth" } + + it "has correct questions" do + expect(page.questions.map(&:id)).to eq(%w[sexrab6]) + end + + it "has the correct id" do + expect(page.id).to eq("person_6_sex_registered_at_birth") + end + + it "has correct depends_on" do + expect(page.depends_on).to eq([{ "details_known_6" => 0 }]) + end + end + + context "with person 7" do + let(:person_index) { 7 } + let(:page_id) { "person_7_sex_registered_at_birth" } + + it "has correct questions" do + expect(page.questions.map(&:id)).to eq(%w[sexrab7]) + end + + it "has the correct id" do + expect(page.id).to eq("person_7_sex_registered_at_birth") + end + + it "has correct depends_on" do + expect(page.depends_on).to eq([{ "details_known_7" => 0 }]) + end + end + + context "with person 8" do + let(:person_index) { 8 } + let(:page_id) { "person_8_sex_registered_at_birth" } + + it "has correct questions" do + expect(page.questions.map(&:id)).to eq(%w[sexrab8]) + end + + it "has the correct id" do + expect(page.id).to eq("person_8_sex_registered_at_birth") + end + + it "has correct depends_on" do + expect(page.depends_on).to eq([{ "details_known_8" => 0 }]) + end + end +end diff --git a/spec/models/form/lettings/questions/lead_tenant_sex_registered_at_birth_spec.rb b/spec/models/form/lettings/questions/lead_tenant_sex_registered_at_birth_spec.rb new file mode 100644 index 000000000..bdac0ddf9 --- /dev/null +++ b/spec/models/form/lettings/questions/lead_tenant_sex_registered_at_birth_spec.rb @@ -0,0 +1,53 @@ +require "rails_helper" + +RSpec.describe Form::Lettings::Questions::LeadTenantSexRegisteredAtBirth, type: :model do + subject(:question) { described_class.new(question_id, question_definition, page) } + + let(:question_id) { nil } + let(:question_definition) { nil } + let(:page) { instance_double(Form::Page) } + let(:subsection) { instance_double(Form::Subsection) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2026, 4, 1)) } + + 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("sexrab1") + 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 + + it "has the correct answer_options" do + expect(question.answer_options).to eq({ + "F" => { "value" => "Female" }, + "M" => { "value" => "Male" }, + "divider" => { "value" => true }, + "R" => { "value" => "Lead tenant prefers not to say" }, + }) + end + + it "has the correct check_answers_card_number" do + expect(question.check_answers_card_number).to eq(1) + end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to be_nil + end + + it "has the correct question number" do + expect(question.question_number).to eq(31) + end +end 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 new file mode 100644 index 000000000..90f48cfda --- /dev/null +++ b/spec/models/form/lettings/questions/person_sex_registered_at_birth_spec.rb @@ -0,0 +1,185 @@ +require "rails_helper" + +RSpec.describe Form::Lettings::Questions::PersonSexRegisteredAtBirth, type: :model do + subject(:question) { described_class.new(question_id, question_definition, page, person_index:) } + + let(:question_id) { "sexrab2" } + let(:question_definition) { nil } + 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)) } + + 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 type" do + expect(question.type).to eq("radio") + end + + it "is not marked as derived" do + expect(question.derived?(nil)).to be false + end + + it "has the correct answer_options" do + expect(question.answer_options).to eq({ + "F" => { "value" => "Female" }, + "M" => { "value" => "Male" }, + "divider" => { "value" => true }, + "R" => { "value" => "Person prefers not to say" }, + }) + end + + context "when person 2" do + let(:question_id) { "sexrab2" } + let(:person_index) { 2 } + + it "has the correct id" do + expect(question.id).to eq("sexrab2") + end + + it "has expected check answers card number" do + expect(question.check_answers_card_number).to eq(2) + end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to be_nil + end + + it "has the correct question number" do + expect(question.question_number).to eq(39) + end + end + + context "when person 3" do + let(:question_id) { "sexrab3" } + let(:person_index) { 3 } + + it "has the correct id" do + expect(question.id).to eq("sexrab3") + end + + it "has expected check answers card number" do + expect(question.check_answers_card_number).to eq(3) + end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to be_nil + end + + it "has the correct question number" do + expect(question.question_number).to eq(44) + end + end + + context "when person 4" do + let(:question_id) { "sexrab4" } + let(:person_index) { 4 } + + it "has the correct id" do + expect(question.id).to eq("sexrab4") + end + + it "has expected check answers card number" do + expect(question.check_answers_card_number).to eq(4) + end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to be_nil + end + + it "has the correct question number" do + expect(question.question_number).to eq(49) + end + end + + context "when person 5" do + let(:question_id) { "sexrab5" } + let(:person_index) { 5 } + + it "has the correct id" do + expect(question.id).to eq("sexrab5") + end + + it "has expected check answers card number" do + expect(question.check_answers_card_number).to eq(5) + end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to be_nil + end + + it "has the correct question number" do + expect(question.question_number).to eq(54) + end + end + + context "when person 6" do + let(:question_id) { "sexrab6" } + let(:person_index) { 6 } + + it "has the correct id" do + expect(question.id).to eq("sexrab6") + end + + it "has expected check answers card number" do + expect(question.check_answers_card_number).to eq(6) + end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to be_nil + end + + it "has the correct question number" do + expect(question.question_number).to eq(59) + end + end + + context "when person 7" do + let(:question_id) { "sexrab7" } + let(:person_index) { 7 } + + it "has the correct id" do + expect(question.id).to eq("sexrab7") + end + + it "has expected check answers card number" do + expect(question.check_answers_card_number).to eq(7) + end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to be_nil + end + + it "has the correct question number" do + expect(question.question_number).to eq(64) + end + end + + context "when person 8" do + let(:question_id) { "sexrab8" } + let(:person_index) { 8 } + + it "has the correct id" do + expect(question.id).to eq("sexrab8") + end + + it "has expected check answers card number" do + expect(question.check_answers_card_number).to eq(8) + end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to be_nil + end + + it "has the correct question number" do + expect(question.question_number).to eq(69) + end + end +end diff --git a/spec/models/form/lettings/subsections/household_characteristics_spec.rb b/spec/models/form/lettings/subsections/household_characteristics_spec.rb index 3269514d2..8a8618f3a 100644 --- a/spec/models/form/lettings/subsections/household_characteristics_spec.rb +++ b/spec/models/form/lettings/subsections/household_characteristics_spec.rb @@ -346,6 +346,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod females_in_soft_age_range_in_pregnant_household_lead_age_value_check age_lead_tenant_under_retirement_value_check age_lead_tenant_over_retirement_value_check + lead_tenant_sex_registered_at_birth lead_tenant_gender_identity no_females_pregnant_household_lead_value_check females_in_soft_age_range_in_pregnant_household_lead_value_check @@ -369,6 +370,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod females_in_soft_age_range_in_pregnant_household_person_2_age_value_check age_2_under_retirement_value_check age_2_over_retirement_value_check + person_2_sex_registered_at_birth person_2_gender_identity no_females_pregnant_household_person_2_value_check females_in_soft_age_range_in_pregnant_household_person_2_value_check @@ -385,6 +387,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod females_in_soft_age_range_in_pregnant_household_person_3_age_value_check age_3_under_retirement_value_check age_3_over_retirement_value_check + person_3_sex_registered_at_birth person_3_gender_identity no_females_pregnant_household_person_3_value_check females_in_soft_age_range_in_pregnant_household_person_3_value_check @@ -401,6 +404,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod females_in_soft_age_range_in_pregnant_household_person_4_age_value_check age_4_under_retirement_value_check age_4_over_retirement_value_check + person_4_sex_registered_at_birth person_4_gender_identity no_females_pregnant_household_person_4_value_check females_in_soft_age_range_in_pregnant_household_person_4_value_check @@ -417,6 +421,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod females_in_soft_age_range_in_pregnant_household_person_5_age_value_check age_5_under_retirement_value_check age_5_over_retirement_value_check + person_5_sex_registered_at_birth person_5_gender_identity no_females_pregnant_household_person_5_value_check females_in_soft_age_range_in_pregnant_household_person_5_value_check @@ -433,6 +438,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod females_in_soft_age_range_in_pregnant_household_person_6_age_value_check age_6_under_retirement_value_check age_6_over_retirement_value_check + person_6_sex_registered_at_birth person_6_gender_identity no_females_pregnant_household_person_6_value_check females_in_soft_age_range_in_pregnant_household_person_6_value_check @@ -449,6 +455,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod females_in_soft_age_range_in_pregnant_household_person_7_age_value_check age_7_under_retirement_value_check age_7_over_retirement_value_check + person_7_sex_registered_at_birth person_7_gender_identity no_females_pregnant_household_person_7_value_check females_in_soft_age_range_in_pregnant_household_person_7_value_check @@ -465,6 +472,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod females_in_soft_age_range_in_pregnant_household_person_8_age_value_check age_8_under_retirement_value_check age_8_over_retirement_value_check + person_8_sex_registered_at_birth person_8_gender_identity no_females_pregnant_household_person_8_value_check females_in_soft_age_range_in_pregnant_household_person_8_value_check diff --git a/spec/services/bulk_upload/lettings/validator_spec.rb b/spec/services/bulk_upload/lettings/validator_spec.rb index 0658d95f0..c053bb33d 100644 --- a/spec/services/bulk_upload/lettings/validator_spec.rb +++ b/spec/services/bulk_upload/lettings/validator_spec.rb @@ -11,7 +11,7 @@ RSpec.describe BulkUpload::Lettings::Validator do let(:user) { create(:user, organisation:) } let(:log) { build(:lettings_log, :completed, period: 2, assigned_to: user) } let(:log_to_csv) { BulkUpload::LettingsLogToCsv.new(log:) } - let(:bulk_upload) { create(:bulk_upload, user:, year: log.collection_start_year) } + let(:bulk_upload) { create(:bulk_upload, :lettings, user:, year:) } let(:path) { file.path } let(:file) { Tempfile.new } @@ -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("CX2") - expect(error.col).to eql("CX") + expect(error.cell).to eql("DL2") + expect(error.col).to eql("DL") 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 91648d729..fa452fb8f 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("B") - expect(service.column_for_field("field_22")).to eql("AS") - expect(service.column_for_field("field_26")).to eql("DG") - expect(service.column_for_field("field_25")).to eql("I") + expect(service.column_for_field("field_5")).to eql("F") + expect(service.column_for_field("field_22")).to eql("AW") + expect(service.column_for_field("field_26")).to eql("DO") + expect(service.column_for_field("field_25")).to eql("R") 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 e0c9897e5..bbfee1bd5 100644 --- a/spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb @@ -248,6 +248,15 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do field_4: "1", 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", } end @@ -1910,7 +1919,7 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do let(:attributes) { { bulk_upload: } } before do - build(:lettings_log, owning_organisation: nil, startdate: nil, tenancycode: nil, location: nil, age1: nil, sex1: nil, ecstat1: nil, brent: nil, scharge: nil, pscharge: nil, supcharg: nil).save(validate: false) + build(:lettings_log, owning_organisation: nil, startdate: nil, tenancycode: nil, location: nil, age1: nil, sexrab1: nil, sex1: nil, ecstat1: nil, brent: nil, scharge: nil, pscharge: nil, supcharg: nil).save(validate: false) end it "does not add duplicate logs validation to the blank row" do diff --git a/spec/services/csv/lettings_log_csv_service_spec.rb b/spec/services/csv/lettings_log_csv_service_spec.rb index 1579fb499..0ee00823a 100644 --- a/spec/services/csv/lettings_log_csv_service_spec.rb +++ b/spec/services/csv/lettings_log_csv_service_spec.rb @@ -242,6 +242,7 @@ RSpec.describe Csv::LettingsLogCsvService do age1_known: 0, age1: 35, sex1: "F", + sexrab1: "F", ethnic_group: 0, ethnic: 2, nationality_all: 36, @@ -251,12 +252,14 @@ RSpec.describe Csv::LettingsLogCsvService do age2_known: 0, age2: 32, sex2: "M", + sexrab2: "M", ecstat2: 6, details_known_3: 1, details_known_4: 0, relat4: "R", age4_known: 1, sex4: "R", + sexrab4: "R", ecstat4: 10, armedforces: 1, leftreg: 4, diff --git a/spec/services/exports/lettings_log_export_service_spec.rb b/spec/services/exports/lettings_log_export_service_spec.rb index 613d64dd0..5e1dff30c 100644 --- a/spec/services/exports/lettings_log_export_service_spec.rb +++ b/spec/services/exports/lettings_log_export_service_spec.rb @@ -497,7 +497,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(2026, 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(2026, 4, 3), assigned_to: user, age1: 35, sexrab1: "F", sex1: "F", age2: 32, sexrab2: "M", 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(:expected_zip_filename) { "core_2026_2027_apr_mar_f0001_inc0001.zip" } let(:expected_data_filename) { "core_2026_2027_apr_mar_f0001_inc0001_pt001.xml" } let(:xml_export_file) { File.open("spec/fixtures/exports/general_needs_log_26_27.xml", "r:UTF-8") } @@ -510,7 +510,7 @@ RSpec.describe Exports::LettingsLogExportService do expect(entry.get_input_stream.read).to have_same_xml_contents_as(expected_content) end - export_service.export_xml_lettings_logs + export_service.export_xml_lettings_logs(collection_year: 2026) end end end diff --git a/spec/services/imports/variable_definitions_service_spec.rb b/spec/services/imports/variable_definitions_service_spec.rb index 8e0ef297c..65d3aaeb2 100644 --- a/spec/services/imports/variable_definitions_service_spec.rb +++ b/spec/services/imports/variable_definitions_service_spec.rb @@ -13,13 +13,13 @@ RSpec.describe Imports::VariableDefinitionsService, type: :service do describe "#call" do before do - allow(Dir).to receive(:glob).and_return(%w[lettings_download_23_24.csv lettings_download_24_25.csv sales_download_23_24.csv sales_download_24_25.csv sales_download_26_27.csv]) + allow(Dir).to receive(:glob).and_return(%w[lettings_download_23_24.csv lettings_download_24_25.csv lettings_download_26_27.csv sales_download_23_24.csv sales_download_24_25.csv sales_download_26_27.csv]) allow(service).to receive(:process_file) end it "processes each file in the directory" do service.call - %w[lettings_download_23_24.csv lettings_download_24_25.csv sales_download_23_24.csv sales_download_24_25.csv sales_download_26_27.csv].each do |file| + %w[lettings_download_23_24.csv lettings_download_24_25.csv lettings_download_26_27.csv sales_download_23_24.csv sales_download_24_25.csv sales_download_26_27.csv].each do |file| expect(service).to have_received(:process_file).with(file) end end From c359ab23f9480a9e35c11b1c8a5152be277e0040 Mon Sep 17 00:00:00 2001 From: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:55:12 +0000 Subject: [PATCH 2/2] Bump faraday version (#3175) * Bump faraday version * CLDC-NONE: add an initializer include for openstruct seems some environments were having trouble loading it --------- Co-authored-by: Samuel Young --- Gemfile | 3 +++ Gemfile.lock | 8 ++++++-- config/initializers/ostruct.rb | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 config/initializers/ostruct.rb diff --git a/Gemfile b/Gemfile index 0a3827cef..f6e7fdac5 100644 --- a/Gemfile +++ b/Gemfile @@ -117,3 +117,6 @@ gem "cssbundling-rails" gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby] gem "excon", "~> 0.111.0" + +# faraday is a transitive dependency, but we need to force the version to 2.14.1 to avoid a vulnerability. +gem "faraday", ">= 2.14.1" diff --git a/Gemfile.lock b/Gemfile.lock index 24d548464..34bfd3067 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -203,8 +203,10 @@ GEM railties (>= 5.0.0) faker (3.2.3) i18n (>= 1.8.11, < 2) - faraday (2.9.0) - faraday-net_http (>= 2.0, < 3.2) + faraday (2.14.1) + faraday-net_http (>= 2.0, < 3.5) + json + logger faraday-multipart (1.0.4) multipart-post (~> 2) faraday-net_http (3.1.0) @@ -242,6 +244,7 @@ GEM jmespath (1.6.2) jsbundling-rails (1.3.0) railties (>= 6.0.0) + json (2.18.1) json-schema (4.1.1) addressable (>= 2.8) jwt (2.8.0) @@ -568,6 +571,7 @@ DEPENDENCIES excon (~> 0.111.0) factory_bot_rails faker + faraday (>= 2.14.1) govuk-components (~> 5.7) govuk_design_system_formbuilder (~> 5.7) govuk_markdown diff --git a/config/initializers/ostruct.rb b/config/initializers/ostruct.rb new file mode 100644 index 000000000..d99ee977a --- /dev/null +++ b/config/initializers/ostruct.rb @@ -0,0 +1,2 @@ +# make OpenStruct available globally +require "ostruct"