Browse Source

Merge branch 'main' into CLDC-4141-use-prefers-not-to-say-text

pull/3176/head
Nat Dean-Lewis 2 days ago
parent
commit
7c6cbffc45
  1. 19
      app/helpers/bulk_upload/lettings_log_to_csv.rb
  2. 14
      app/models/derived_variables/lettings_log_variables.rb
  3. 8
      app/models/form.rb
  4. 14
      app/models/form/lettings/pages/lead_tenant_gender_same_as_sex.rb
  5. 17
      app/models/form/lettings/pages/person_gender_same_as_sex.rb
  6. 22
      app/models/form/lettings/questions/gender_description.rb
  7. 36
      app/models/form/lettings/questions/gender_same_as_sex.rb
  8. 195
      app/models/form/lettings/subsections/household_characteristics.rb
  9. 2
      app/models/form/sales/questions/deposit_value_check.rb
  10. 1
      app/models/form/sales/questions/housing_benefits.rb
  11. 2
      app/models/form/sales/questions/savings_value_check.rb
  12. 4
      app/services/bulk_upload/lettings/year2026/csv_parser.rb
  13. 62
      app/services/bulk_upload/lettings/year2026/row_parser.rb
  14. 1
      app/services/csv/lettings_log_csv_service.rb
  15. 2
      app/services/exports/lettings_log_export_constants.rb
  16. 112
      config/locales/forms/2026/lettings/household_characteristics.en.yml
  17. 23
      db/migrate/20260204100051_add_gender_same_as_sex_fields_to_lettings_logs.rb
  18. 18
      db/schema.rb
  19. 3
      spec/factories/lettings_log.rb
  20. 16
      spec/fixtures/exports/general_needs_log_26_27.xml
  21. 18
      spec/fixtures/files/2026_27_lettings_bulk_upload.csv
  22. 6
      spec/fixtures/files/lettings_log_csv_export_codes_26.csv
  23. 6
      spec/fixtures/files/lettings_log_csv_export_labels_26.csv
  24. 6
      spec/fixtures/files/lettings_log_csv_export_non_support_codes_26.csv
  25. 6
      spec/fixtures/files/lettings_log_csv_export_non_support_labels_26.csv
  26. 235
      spec/fixtures/variable_definitions/lettings_download_26_27.csv
  27. 281
      spec/fixtures/variable_definitions/sales_download_26_27.csv
  28. 2
      spec/lib/tasks/log_variable_definitions_spec.rb
  29. 212
      spec/models/form/lettings/questions/gender_description_spec.rb
  30. 271
      spec/models/form/lettings/questions/gender_same_as_sex_spec.rb
  31. 8
      spec/models/form/lettings/subsections/household_characteristics_spec.rb
  32. 2
      spec/models/form/sales/pages/deposit_value_check_spec.rb
  33. 2
      spec/models/form/sales/pages/housing_benefits_spec.rb
  34. 2
      spec/models/form/sales/pages/savings_value_check_spec.rb
  35. 28
      spec/models/form/sales/questions/deposit_value_check_spec.rb
  36. 31
      spec/models/form/sales/questions/housing_benefits_spec.rb
  37. 28
      spec/models/form/sales/questions/savings_value_check_spec.rb
  38. 4
      spec/services/bulk_upload/lettings/validator_spec.rb
  39. 8
      spec/services/bulk_upload/lettings/year2026/csv_parser_spec.rb
  40. 16
      spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb
  41. 4
      spec/services/csv/lettings_log_csv_service_spec.rb
  42. 36
      spec/services/exports/lettings_log_export_service_spec.rb
  43. 4
      spec/spec_helper.rb

19
app/helpers/bulk_upload/lettings_log_to_csv.rb

@ -239,6 +239,7 @@ class BulkUpload::LettingsLogToCsv
log.supcharg,
log.hbrentshortfall,
log.tshortfall,
log.sexrab1, # 130
log.sexrab2,
log.sexrab3,
@ -246,7 +247,23 @@ class BulkUpload::LettingsLogToCsv
log.sexrab5,
log.sexrab6,
log.sexrab7,
log.sexrab8, # 137
log.sexrab8,
log.gender_same_as_sex1,
log.gender_description1,
log.gender_same_as_sex2, # 140
log.gender_description2,
log.gender_same_as_sex3,
log.gender_description3,
log.gender_same_as_sex4,
log.gender_description4,
log.gender_same_as_sex5,
log.gender_description5,
log.gender_same_as_sex6,
log.gender_description6,
log.gender_same_as_sex7, # 150
log.gender_description7,
log.gender_same_as_sex8,
log.gender_description8, # 153
]
end

14
app/models/derived_variables/lettings_log_variables.rb

@ -177,6 +177,8 @@ module DerivedVariables::LettingsLogVariables
self.la = nil
end
clear_gender_description_unless_gender_not_same_as_sex! if form.start_year_2026_or_later?
set_checkbox_values!
end
@ -418,6 +420,18 @@ private
return 3 if rent_type == 5
end
def clear_gender_description_unless_gender_not_same_as_sex!
# we do this as the gender same as sex page always contains the gender description box that's hidden
# default submit will send a "" for gender description. this ensure it's nil in this case
# as well as blanking it if the user writes it in mistakenly in bulk upload
(1..8).each do |person_index|
gender_same_as_sex = public_send("gender_same_as_sex#{person_index}")
if gender_same_as_sex.present? && gender_same_as_sex != 2
self["gender_description#{person_index}"] = nil
end
end
end
def set_checkbox_values!
form.questions.select { |q| q.type == "checkbox" }.each do |question|
options = question.answer_keys_without_dividers

8
app/models/form.rb

@ -357,4 +357,12 @@ class Form
def start_year_2026_or_later?
start_date && start_date.year >= 2026
end
def person_question_count
if start_year_2026_or_later?
5
else
4
end
end
end

14
app/models/form/lettings/pages/lead_tenant_gender_same_as_sex.rb

@ -0,0 +1,14 @@
class Form::Lettings::Pages::LeadTenantGenderSameAsSex < ::Form::Page
def initialize(id, hsh, subsection)
super(id, hsh, subsection)
@id = "lead_tenant_gender_same_as_sex"
@depends_on = [{ "declaration" => 1 }]
end
def questions
@questions ||= [
Form::Lettings::Questions::GenderSameAsSex.new(nil, nil, self, person_index: 1),
Form::Lettings::Questions::GenderDescription.new(nil, nil, self, person_index: 1),
]
end
end

17
app/models/form/lettings/pages/person_gender_same_as_sex.rb

@ -0,0 +1,17 @@
class Form::Lettings::Pages::PersonGenderSameAsSex < ::Form::Page
def initialize(id, hsh, subsection, person_index:)
super(id, hsh, subsection)
@id = "person_#{person_index}_gender_same_as_sex"
@person_index = person_index
@depends_on = [
{ "details_known_#{person_index}" => 0 },
]
end
def questions
@questions ||= [
Form::Lettings::Questions::GenderSameAsSex.new(nil, nil, self, person_index: @person_index),
Form::Lettings::Questions::GenderDescription.new(nil, nil, self, person_index: @person_index),
]
end
end

22
app/models/form/lettings/questions/gender_description.rb

@ -0,0 +1,22 @@
class Form::Lettings::Questions::GenderDescription < ::Form::Question
def initialize(id, hsh, page, person_index:)
super(id, hsh, page)
@id = "gender_description#{person_index}"
@type = "text"
@check_answers_card_number = person_index
@person_index = person_index
@question_number = question_number
end
def derived?(log)
log.public_send("gender_same_as_sex#{@person_index}") != 2
end
def question_number
return 32 if @person_index == 1
base_question_number = 30
base_question_number + (form.person_question_count * @person_index)
end
end

36
app/models/form/lettings/questions/gender_same_as_sex.rb

@ -0,0 +1,36 @@
class Form::Lettings::Questions::GenderSameAsSex < ::Form::Question
def initialize(id, hsh, page, person_index:)
super(id, hsh, page)
@id = "gender_same_as_sex#{person_index}"
@type = "radio"
@check_answers_card_number = person_index
@conditional_for = { "gender_description#{person_index}" => [2] }
@person_index = person_index
@question_number = question_number
end
def answer_options
{
"1" => { "value" => "Yes" },
"2" => { "value" => "No, enter gender identity" },
"divider" => { "value" => true },
"3" => { "value" => "#{@person_index == 1 ? 'Lead tenant' : 'Person'} prefers not to say" },
}.freeze
end
def question_number
return 32 if @person_index == 1
base_question_number = 30
base_question_number + (form.person_question_count * @person_index)
end
def label_from_value(value, _log = nil, _user = nil)
return unless value
return "Prefers not to say" if value == 3
super
end
end

195
app/models/form/lettings/subsections/household_characteristics.rb

@ -18,6 +18,7 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::LeadTenantUnderRetirementValueCheck.new("age_lead_tenant_under_retirement_value_check", nil, self),
Form::Lettings::Pages::LeadTenantOverRetirementValueCheck.new("age_lead_tenant_over_retirement_value_check", nil, self),
(Form::Lettings::Pages::LeadTenantSexRegisteredAtBirth.new(nil, nil, self) if form.start_year_2026_or_later?),
(Form::Lettings::Pages::LeadTenantGenderSameAsSex.new(nil, nil, self) if form.start_year_2026_or_later?),
Form::Lettings::Pages::LeadTenantGenderIdentity.new(nil, nil, self),
Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadValueCheck.new(nil, nil, self),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadValueCheck.new(nil, nil, self),
@ -33,170 +34,42 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection
Form::Lettings::Pages::LeadTenantUnderRetirementValueCheck.new("working_situation_lead_tenant_under_retirement_value_check", nil, self),
Form::Lettings::Pages::LeadTenantOverRetirementValueCheck.new("working_situation_lead_tenant_over_retirement_value_check", nil, self),
(Form::Lettings::Pages::WorkingSituationIllnessCheckLead.new("working_situation_lead_tenant_long_term_illness_check", nil, self) if form.start_year_2026_or_later?),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 2),
(Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 2) if form.start_year_2026_or_later?),
relationship_question(person_index: 2),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_value_check", nil, self, person_index: 2) if form.start_year_2024_or_later?),
(Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 2) unless form.start_year_2026_or_later?),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 2),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 2),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_2_under_retirement_value_check", nil, self, person_index: 2),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_2_over_retirement_value_check", nil, self, person_index: 2),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_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,
person_index: 2),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("gender_2_over_retirement_value_check", nil, self, person_index: 2),
Form::Lettings::Pages::PersonWorkingSituation.new(nil, nil, self, person_index: 2),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("working_situation_2_under_retirement_value_check", nil, self, person_index: 2),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_2_over_retirement_value_check", nil, self, person_index: 2),
(Form::Lettings::Pages::WorkingSituationIllnessCheckPerson.new("working_situation_2_long_term_illness_check", nil, self, person_index: 2) if form.start_year_2026_or_later?),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 3),
(Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 3) if form.start_year_2026_or_later?),
relationship_question(person_index: 3),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_value_check", nil, self, person_index: 3) if form.start_year_2024_or_later?),
(Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 3) unless form.start_year_2026_or_later?),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 3),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 3),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_3_under_retirement_value_check", nil, self, person_index: 3),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_3_over_retirement_value_check", nil, self, person_index: 3),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_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,
person_index: 3),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("gender_3_over_retirement_value_check", nil, self, person_index: 3),
Form::Lettings::Pages::PersonWorkingSituation.new(nil, nil, self, person_index: 3),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("working_situation_3_under_retirement_value_check", nil, self, person_index: 3),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_3_over_retirement_value_check", nil, self, person_index: 3),
(Form::Lettings::Pages::WorkingSituationIllnessCheckPerson.new("working_situation_3_long_term_illness_check", nil, self, person_index: 3) if form.start_year_2026_or_later?),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 4),
(Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 4) if form.start_year_2026_or_later?),
relationship_question(person_index: 4),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_value_check", nil, self, person_index: 4) if form.start_year_2024_or_later?),
(Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 4) unless form.start_year_2026_or_later?),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 4),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 4),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_4_under_retirement_value_check", nil, self, person_index: 4),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_4_over_retirement_value_check", nil, self, person_index: 4),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_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,
person_index: 4),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("gender_4_over_retirement_value_check", nil, self, person_index: 4),
Form::Lettings::Pages::PersonWorkingSituation.new(nil, nil, self, person_index: 4),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("working_situation_4_under_retirement_value_check", nil, self, person_index: 4),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_4_over_retirement_value_check", nil, self, person_index: 4),
(Form::Lettings::Pages::WorkingSituationIllnessCheckPerson.new("working_situation_4_long_term_illness_check", nil, self, person_index: 4) if form.start_year_2026_or_later?),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 5),
(Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 5) if form.start_year_2026_or_later?),
relationship_question(person_index: 5),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_value_check", nil, self, person_index: 5) if form.start_year_2024_or_later?),
(Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 5) unless form.start_year_2026_or_later?),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 5),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 5),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_5_under_retirement_value_check", nil, self, person_index: 5),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_5_over_retirement_value_check", nil, self, person_index: 5),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_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,
person_index: 5),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("gender_5_over_retirement_value_check", nil, self, person_index: 5),
Form::Lettings::Pages::PersonWorkingSituation.new(nil, nil, self, person_index: 5),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("working_situation_5_under_retirement_value_check", nil, self, person_index: 5),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_5_over_retirement_value_check", nil, self, person_index: 5),
(Form::Lettings::Pages::WorkingSituationIllnessCheckPerson.new("working_situation_5_long_term_illness_check", nil, self, person_index: 5) if form.start_year_2026_or_later?),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 6),
(Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 6) if form.start_year_2026_or_later?),
relationship_question(person_index: 6),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_value_check", nil, self, person_index: 6) if form.start_year_2024_or_later?),
(Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 6) unless form.start_year_2026_or_later?),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 6),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 6),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_6_under_retirement_value_check", nil, self, person_index: 6),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_6_over_retirement_value_check", nil, self, person_index: 6),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_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,
person_index: 6),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("gender_6_over_retirement_value_check", nil, self, person_index: 6),
Form::Lettings::Pages::PersonWorkingSituation.new(nil, nil, self, person_index: 6),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("working_situation_6_under_retirement_value_check", nil, self, person_index: 6),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_6_over_retirement_value_check", nil, self, person_index: 6),
(Form::Lettings::Pages::WorkingSituationIllnessCheckPerson.new("working_situation_6_long_term_illness_check", nil, self, person_index: 6) if form.start_year_2026_or_later?),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 7),
(Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 7) if form.start_year_2026_or_later?),
relationship_question(person_index: 7),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_7_multiple_partners_value_check", nil, self, person_index: 7) if form.start_year_2024_or_later?),
(Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 7) unless form.start_year_2026_or_later?),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 7),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 7),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_7_under_retirement_value_check", nil, self, person_index: 7),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_7_over_retirement_value_check", nil, self, person_index: 7),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_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,
person_index: 7),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("gender_7_over_retirement_value_check", nil, self, person_index: 7),
Form::Lettings::Pages::PersonWorkingSituation.new(nil, nil, self, person_index: 7),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("working_situation_7_under_retirement_value_check", nil, self, person_index: 7),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_7_over_retirement_value_check", nil, self, person_index: 7),
(Form::Lettings::Pages::WorkingSituationIllnessCheckPerson.new("working_situation_7_long_term_illness_check", nil, self, person_index: 7) if form.start_year_2026_or_later?),
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index: 8),
(Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 8) if form.start_year_2026_or_later?),
relationship_question(person_index: 8),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_8_multiple_partners_value_check", nil, self, person_index: 8) if form.start_year_2024_or_later?),
(Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 8) unless form.start_year_2026_or_later?),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 8),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self,
person_index: 8),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_8_under_retirement_value_check", nil, self, person_index: 8),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_8_over_retirement_value_check", nil, self, person_index: 8),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_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,
person_index: 8),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("gender_8_over_retirement_value_check", nil, self, person_index: 8),
Form::Lettings::Pages::PersonWorkingSituation.new(nil, nil, self, person_index: 8),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("working_situation_8_under_retirement_value_check", nil, self, person_index: 8),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_8_over_retirement_value_check", nil, self, person_index: 8),
(Form::Lettings::Pages::WorkingSituationIllnessCheckPerson.new("working_situation_8_long_term_illness_check", nil, self, person_index: 8) if form.start_year_2026_or_later?),
*person_questions(person_index: 2),
*person_questions(person_index: 3),
*person_questions(person_index: 4),
*person_questions(person_index: 5),
*person_questions(person_index: 6),
*person_questions(person_index: 7),
*person_questions(person_index: 8),
].compact
end
def person_questions(person_index:)
[
Form::Lettings::Pages::PersonKnown.new(nil, nil, self, person_index:),
(Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index:) if form.start_year_2026_or_later?),
relationship_question(person_index:),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_#{person_index}_partner_under_16_value_check", nil, self, person_index:) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?),
(Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_#{person_index}_multiple_partners_value_check", nil, self, person_index:) if form.start_year_2024_or_later?),
(Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index:) unless form.start_year_2026_or_later?),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index:),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index:),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("age_#{person_index}_under_retirement_value_check", nil, self, person_index:),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("age_#{person_index}_over_retirement_value_check", nil, self, person_index:),
(Form::Lettings::Pages::PartnerUnder16ValueCheck.new("age_#{person_index}_partner_under_16_value_check", nil, self, person_index:) if form.start_year_2024_or_later? && !form.start_year_2026_or_later?),
(Form::Lettings::Pages::PersonSexRegisteredAtBirth.new(nil, nil, self, person_index:) if form.start_year_2026_or_later?),
(Form::Lettings::Pages::PersonGenderSameAsSex.new(nil, nil, self, person_index:) if form.start_year_2026_or_later?),
Form::Lettings::Pages::PersonGenderIdentity.new(nil, nil, self, person_index:),
Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index:),
Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck.new(nil, nil, self, person_index:),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("gender_#{person_index}_over_retirement_value_check", nil, self, person_index:),
Form::Lettings::Pages::PersonWorkingSituation.new(nil, nil, self, person_index:),
Form::Lettings::Pages::PersonUnderRetirementValueCheck.new("working_situation_#{person_index}_under_retirement_value_check", nil, self, person_index:),
Form::Lettings::Pages::PersonOverRetirementValueCheck.new("working_situation_#{person_index}_over_retirement_value_check", nil, self, person_index:),
(Form::Lettings::Pages::WorkingSituationIllnessCheckPerson.new("working_situation_#{person_index}_long_term_illness_check", nil, self, person_index:) if form.start_year_2026_or_later?),
]
end
def relationship_question(person_index:)
if form.start_year_2025_or_later?
Form::Lettings::Pages::PersonLeadPartner.new(nil, nil, self, person_index:)

2
app/models/form/sales/questions/deposit_value_check.rb

@ -18,6 +18,6 @@ class Form::Sales::Questions::DepositValueCheck < ::Form::Question
},
],
}
@check_answers_card_number = 0
@check_answers_card_number = 0 unless form.start_year_2026_or_later?
end
end

1
app/models/form/sales/questions/housing_benefits.rb

@ -5,6 +5,7 @@ class Form::Sales::Questions::HousingBenefits < ::Form::Question
@copy_key = "sales.income_benefits_and_savings.housing_benefits.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@check_answers_card_title = "All buyers" if form.start_year_2026_or_later?
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

2
app/models/form/sales/questions/savings_value_check.rb

@ -18,6 +18,6 @@ class Form::Sales::Questions::SavingsValueCheck < ::Form::Question
},
],
}
@check_answers_card_number = 0
@check_answers_card_number = 0 unless form.start_year_2026_or_later?
end
end

4
app/services/bulk_upload/lettings/year2026/csv_parser.rb

@ -4,7 +4,7 @@ class BulkUpload::Lettings::Year2026::CsvParser
include CollectionTimeHelper
# TODO: CLDC-4162: Update when 2026 format is known
FIELDS = 137
FIELDS = 153
FORM_YEAR = 2026
attr_reader :path
@ -27,7 +27,7 @@ class BulkUpload::Lettings::Year2026::CsvParser
def cols
# TODO: CLDC-4162: Update when 2026 format is known
@cols ||= ("A".."DZ").to_a
@cols ||= ("A".."EX").to_a
end
def row_parsers

62
app/services/bulk_upload/lettings/year2026/row_parser.rb

@ -143,6 +143,22 @@ class BulkUpload::Lettings::Year2026::RowParser
field_135: "Person 6's sex, as registered at birth",
field_136: "Person 7's sex, as registered at birth",
field_137: "Person 8's sex, as registered at birth",
field_138: "Is the gender the lead tenant identifies with the same as their sex registered at birth?",
field_139: "If 'No', enter the lead tenant's gender identity",
field_140: "Is the gender person 2 identifies with the same as their sex registered at birth?",
field_141: "If 'No', enter person 2's gender identity",
field_142: "Is the gender person 3 identifies with the same as their sex registered at birth?",
field_143: "If 'No', enter person 3's gender identity",
field_144: "Is the gender person 4 identifies with the same as their sex registered at birth?",
field_145: "If 'No', enter person 4's gender identity",
field_146: "Is the gender person 5 identifies with the same as their sex registered at birth?",
field_147: "If 'No', enter person 5's gender identity",
field_148: "Is the gender person 6 identifies with the same as their sex registered at birth?",
field_149: "If 'No', enter person 6's gender identity",
field_150: "Is the gender person 7 identifies with the same as their sex registered at birth?",
field_151: "If 'No', enter person 7's gender identity",
field_152: "Is the gender person 8 identifies with the same as their sex registered at birth?",
field_153: "If 'No', enter person 8's gender identity",
}.freeze
RENT_TYPE_BU_MAPPING = {
@ -300,6 +316,22 @@ class BulkUpload::Lettings::Year2026::RowParser
attribute :field_135, :string
attribute :field_136, :string
attribute :field_137, :string
attribute :field_138, :integer
attribute :field_139, :string
attribute :field_140, :integer
attribute :field_141, :string
attribute :field_142, :integer
attribute :field_143, :string
attribute :field_144, :integer
attribute :field_145, :string
attribute :field_146, :integer
attribute :field_147, :string
attribute :field_148, :integer
attribute :field_149, :string
attribute :field_150, :integer
attribute :field_151, :string
attribute :field_152, :integer
attribute :field_153, :string
validate :validate_valid_radio_option, on: :before_log
@ -1394,6 +1426,22 @@ private
attributes["sexrab6"] = field_135
attributes["sexrab7"] = field_136
attributes["sexrab8"] = field_137
attributes["gender_same_as_sex1"] = field_138
attributes["gender_description1"] = field_139
attributes["gender_same_as_sex2"] = field_140
attributes["gender_description2"] = field_141
attributes["gender_same_as_sex3"] = field_142
attributes["gender_description3"] = field_143
attributes["gender_same_as_sex4"] = field_144
attributes["gender_description4"] = field_145
attributes["gender_same_as_sex5"] = field_146
attributes["gender_description5"] = field_147
attributes["gender_same_as_sex6"] = field_148
attributes["gender_description6"] = field_149
attributes["gender_same_as_sex7"] = field_150
attributes["gender_description7"] = field_151
attributes["gender_same_as_sex8"] = field_152
attributes["gender_description8"] = field_153
attributes
end
@ -1501,31 +1549,31 @@ private
end
def person_2_present?
field_47.present? || field_48.present? || field_49.present? || field_131.present?
field_47.present? || field_48.present? || field_49.present? || field_131.present? || field_140.present? || field_141.present?
end
def person_3_present?
field_51.present? || field_52.present? || field_53.present? || field_132.present?
field_51.present? || field_52.present? || field_53.present? || field_132.present? || field_142.present? || field_143.present?
end
def person_4_present?
field_55.present? || field_56.present? || field_57.present? || field_133.present?
field_55.present? || field_56.present? || field_57.present? || field_133.present? || field_144.present? || field_145.present?
end
def person_5_present?
field_59.present? || field_60.present? || field_61.present? || field_134.present?
field_59.present? || field_60.present? || field_61.present? || field_134.present? || field_146.present? || field_147.present?
end
def person_6_present?
field_63.present? || field_64.present? || field_65.present? || field_135.present?
field_63.present? || field_64.present? || field_65.present? || field_135.present? || field_148.present? || field_149.present?
end
def person_7_present?
field_67.present? || field_68.present? || field_69.present? || field_136.present?
field_67.present? || field_68.present? || field_69.present? || field_136.present? || field_150.present? || field_151.present?
end
def person_8_present?
field_71.present? || field_72.present? || field_73.present? || field_137.present?
field_71.present? || field_72.present? || field_73.present? || field_137.present? || field_152.present? || field_153.present?
end
def leftreg

1
app/services/csv/lettings_log_csv_service.rb

@ -138,6 +138,7 @@ module Csv
(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["gender_same_as_sex#{i}"] = { "refused_code" => "3", "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}" }

2
app/services/exports/lettings_log_export_constants.rb

@ -231,5 +231,7 @@ module Exports::LettingsLogExportConstants
(1..8).each do |index|
YEAR_2026_EXPORT_FIELDS << "sexrab#{index}"
YEAR_2026_EXPORT_FIELDS << "gender_same_as_sex#{index}"
YEAR_2026_EXPORT_FIELDS << "gender_description#{index}"
end
end

112
config/locales/forms/2026/lettings/household_characteristics.en.yml

@ -30,6 +30,20 @@ en:
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?"
gender_same_as_sex1:
page_header: ""
check_answer_label: "Lead tenant’s gender identity same as registered at birth"
check_answer_prompt: ""
hint_text: ""
question_text: "Is the gender the lead tenant identifies with the same as their sex registered at birth?"
gender_description1:
page_header: ""
check_answer_label: "Gender identity description"
check_answer_prompt: ""
hint_text: ""
question_text: "Enter gender identity"
sex1:
page_header: ""
check_answer_label: "Lead tenant’s gender identity"
@ -130,6 +144,20 @@ en:
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?"
gender_same_as_sex2:
page_header: ""
check_answer_label: "Person 2’s gender identity same as registered at birth"
check_answer_prompt: ""
hint_text: ""
question_text: "Is the gender person 2 identifies with the same as their sex registered at birth?"
gender_description2:
page_header: ""
check_answer_label: "Gender identity description"
check_answer_prompt: ""
hint_text: ""
question_text: "Enter gender identity"
sex2:
page_header: ""
check_answer_label: "Person 2’s gender identity"
@ -178,6 +206,20 @@ en:
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?"
gender_same_as_sex3:
page_header: ""
check_answer_label: "Person 3’s gender identity same as registered at birth"
check_answer_prompt: ""
hint_text: ""
question_text: "Is the gender person 3 identifies with the same as their sex registered at birth?"
gender_description3:
page_header: ""
check_answer_label: "Gender identity description"
check_answer_prompt: ""
hint_text: ""
question_text: "Enter gender identity"
sex3:
page_header: ""
check_answer_label: "Person 3’s gender identity"
@ -226,6 +268,20 @@ en:
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?"
gender_same_as_sex4:
page_header: ""
check_answer_label: "Person 4’s gender identity same as registered at birth"
check_answer_prompt: ""
hint_text: ""
question_text: "Is the gender person 4 identifies with the same as their sex registered at birth?"
gender_description4:
page_header: ""
check_answer_label: "Gender identity description"
check_answer_prompt: ""
hint_text: ""
question_text: "Enter gender identity"
sex4:
page_header: ""
check_answer_label: "Person 4’s gender identity"
@ -274,6 +330,20 @@ en:
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?"
gender_same_as_sex5:
page_header: ""
check_answer_label: "Person 5’s gender identity same as registered at birth"
check_answer_prompt: ""
hint_text: ""
question_text: "Is the gender person 5 identifies with the same as their sex registered at birth?"
gender_description5:
page_header: ""
check_answer_label: "Gender identity description"
check_answer_prompt: ""
hint_text: ""
question_text: "Enter gender identity"
sex5:
page_header: ""
check_answer_label: "Person 5’s gender identity"
@ -322,6 +392,20 @@ en:
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?"
gender_same_as_sex6:
page_header: ""
check_answer_label: "Person 6’s gender identity same as registered at birth"
check_answer_prompt: ""
hint_text: ""
question_text: "Is the gender person 6 identifies with the same as their sex registered at birth?"
gender_description6:
page_header: ""
check_answer_label: "Gender identity description"
check_answer_prompt: ""
hint_text: ""
question_text: "Enter gender identity"
sex6:
page_header: ""
check_answer_label: "Person 6’s gender identity"
@ -370,6 +454,20 @@ en:
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?"
gender_same_as_sex7:
page_header: ""
check_answer_label: "Person 7’s gender identity same as registered at birth"
check_answer_prompt: ""
hint_text: ""
question_text: "Is the gender person 7 identifies with the same as their sex registered at birth?"
gender_description7:
page_header: ""
check_answer_label: "Gender identity description"
check_answer_prompt: ""
hint_text: ""
question_text: "Enter gender identity"
sex7:
page_header: ""
check_answer_label: "Person 7’s gender identity"
@ -418,6 +516,20 @@ en:
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?"
gender_same_as_sex8:
page_header: ""
check_answer_label: "Person 8’s gender identity same as registered at birth"
check_answer_prompt: ""
hint_text: ""
question_text: "Is the gender person 8 identifies with the same as their sex registered at birth?"
gender_description8:
page_header: ""
check_answer_label: "Gender identity description"
check_answer_prompt: ""
hint_text: ""
question_text: "Enter gender identity"
sex8:
page_header: ""
check_answer_label: "Person 8’s gender identity"

23
db/migrate/20260204100051_add_gender_same_as_sex_fields_to_lettings_logs.rb

@ -0,0 +1,23 @@
class AddGenderSameAsSexFieldsToLettingsLogs < ActiveRecord::Migration[7.2]
def change
change_table :lettings_logs, bulk: true do |t|
t.column :gender_same_as_sex1, :integer
t.column :gender_same_as_sex2, :integer
t.column :gender_same_as_sex3, :integer
t.column :gender_same_as_sex4, :integer
t.column :gender_same_as_sex5, :integer
t.column :gender_same_as_sex6, :integer
t.column :gender_same_as_sex7, :integer
t.column :gender_same_as_sex8, :integer
t.column :gender_description1, :string
t.column :gender_description2, :string
t.column :gender_description3, :string
t.column :gender_description4, :string
t.column :gender_description5, :string
t.column :gender_description6, :string
t.column :gender_description7, :string
t.column :gender_description8, :string
end
end
end

18
db/schema.rb

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.2].define(version: 2026_01_28_121417) do
ActiveRecord::Schema[7.2].define(version: 2026_02_04_100051) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -384,6 +384,22 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_28_121417) do
t.string "sexrab6"
t.string "sexrab7"
t.string "sexrab8"
t.integer "gender_same_as_sex1"
t.integer "gender_same_as_sex2"
t.integer "gender_same_as_sex3"
t.integer "gender_same_as_sex4"
t.integer "gender_same_as_sex5"
t.integer "gender_same_as_sex6"
t.integer "gender_same_as_sex7"
t.integer "gender_same_as_sex8"
t.string "gender_description1"
t.string "gender_description2"
t.string "gender_description3"
t.string "gender_description4"
t.string "gender_description5"
t.string "gender_description6"
t.string "gender_description7"
t.string "gender_description8"
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"

3
spec/factories/lettings_log.rb

@ -61,6 +61,7 @@ FactoryBot.define do
age1 { Faker::Number.within(range: 25..45) }
sexrab1 { %w[F M R].sample }
sex1 { %w[F M X R].sample }
gender_same_as_sex1 { 1 }
ethnic_group { 0 }
ethnic { 2 }
national { 13 }
@ -73,6 +74,8 @@ FactoryBot.define do
age2 { Faker::Number.within(range: 25..45) }
sexrab2 { %w[F M R].sample }
sex2 { %w[F M X R].sample }
gender_same_as_sex2 { 2 }
gender_description2 { Faker::Gender.type }
ecstat2 { 6 }
homeless { 1 }
underoccupation_benefitcap { 0 }

16
spec/fixtures/exports/general_needs_log_26_27.xml vendored

@ -6,6 +6,8 @@
<age1>35</age1>
<sexrab1>F</sexrab1>
<sex1>F</sex1>
<gender_same_as_sex1>1</gender_same_as_sex1>
<gender_description1/>
<ethnic>2</ethnic>
<prevten>6</prevten>
<ecstat1>0</ecstat1>
@ -13,30 +15,44 @@
<age2>32</age2>
<sexrab2>M</sexrab2>
<sex2>M</sex2>
<gender_same_as_sex2>2</gender_same_as_sex2>
<gender_description2>Non-binary</gender_description2>
<ecstat2>6</ecstat2>
<age3/>
<sexrab3/>
<sex3/>
<gender_same_as_sex3/>
<gender_description3/>
<ecstat3/>
<age4/>
<sexrab4/>
<sex4/>
<gender_same_as_sex4/>
<gender_description4/>
<ecstat4/>
<age5/>
<sexrab5/>
<sex5/>
<gender_same_as_sex5/>
<gender_description5/>
<ecstat5/>
<age6/>
<sexrab6/>
<sex6/>
<gender_same_as_sex6/>
<gender_description6/>
<ecstat6/>
<age7/>
<sexrab7/>
<sex7/>
<gender_same_as_sex7/>
<gender_description7/>
<ecstat7/>
<age8/>
<sexrab8/>
<sex8/>
<gender_same_as_sex8/>
<gender_description8/>
<ecstat8/>
<homeless>1</homeless>
<underoccupation_benefitcap>4</underoccupation_benefitcap>

18
spec/fixtures/files/2026_27_lettings_bulk_upload.csv vendored

@ -1,4 +1,4 @@
Section,Setting up this lettings log,,,,,,,,,,,,,,,Property information,,,,,,,,,,,,,,,,,,,,,Tenancy information,,,,,Household characteristics,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Household needs,,,,,,,,,,,,,,,,,,,,,Household situation,,,,,,,,,,,,,,,,,,,,,"Income, benefits and outgoings",,,,,,,,,,,,,,,,,,,,
Section,Setting up this lettings log,,,,,,,,,,,,,,,Property information,,,,,,,,,,,,,,,,,,,,,Tenancy information,,,,,Household characteristics,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Household needs,,,,,,,,,,,,,,,,,,,,,Household situation,,,,,,,,,,,,,,,,,,,,,"Income, benefits and outgoings",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Question,Which organisation owns this property?,Which organisation manages this letting?,What is the CORE username of the account this letting log should be assigned to? ,What is the needs type?,What scheme does this letting belong to?,Which location is this letting for?,Is this letting a renewal of social housing to the same tenant in the same property?,What is the tenancy start date? - day DD,What is the tenancy start date? - month MM,What is the tenancy start date? - year YY,What is the rent type?,Which 'Other' type of Intermediate Rent is this letting?,What is the tenant code?,What is the property reference?,Has the tenant seen or been given access to the MHCLG privacy notice?,What is the reason for the property being vacant?,What type was the property most recently let as?,"If known, provide this property’s UPRN",Address Line 1,Address Line 2,Town or city,County,Part 1 of the property's postcode,Part 2 of the property's postcode,What is the property's local authority?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date? - day DD,What is the void date? - month MM,What is the void date? - year YY,What date were any major repairs completed on? - day DD,What date were any major repairs completed on? - month MM,What date were any major repairs completed on? - year YY,Is this property older people's housing?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,What is the lead tenant’s age?,Which of these best describes the lead tenant’s gender identity? ,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant’s nationality?,Which of these best describes the lead tenant’s working situation?,Is person 2 the partner of the lead tenant?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,Is person 3 the partner of the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,Is person 4 the partner of the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,Is person 5 the partner of the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,Is person 6 the partner of the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,Is person 7 the partner of the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,Is person 8 the partner of the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,"Disabled access needs
a) Fully wheelchair-accessible housing","Disabled access needs
@ -29,7 +29,7 @@ Common Allocations Policy (CAP)","How was this letting allocated?
Common Housing Register (CHR)","How was this letting allocated?
Accessible Housing Register",What was the source of referral for this letting?,Do you know the household's combined total income after tax?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,How often does the household pay rent and other charges?,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",What do you expect the outstanding amount to be?,What was the lead tenant's sex at birth?,What was person 2's sex registered at birth?,What was person 3's sex registered at birth?,What was person 4's sex registered at birth?,What was person 5's sex registered at birth?,What was person 6's sex registered at birth?,What was person 7's sex registered at birth?,What was person 8's sex registered at birth?
Accessible Housing Register",What was the source of referral for this letting?,Do you know the household's combined total income after tax?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,How often does the household pay rent and other charges?,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",What do you expect the outstanding amount to be?,What was the lead tenant's sex at birth?,What was person 2's sex registered at birth?,What was person 3's sex registered at birth?,What was person 4's sex registered at birth?,What was person 5's sex registered at birth?,What was person 6's sex registered at birth?,What was person 7's sex registered at birth?,What was person 8's sex registered at birth?,Is the gender the lead tenant identifies with the same as their sex registered at birth?,"If 'No', enter lead tenant's gender identity",Is the gender the person 2 identifies with the same as their sex registered at birth?,"If 'No', enter person 2's gender identity",Is the gender the person 3 identifies with the same as their sex registered at birth?,"If 'No', enter person 3's gender identity",Is the gender the person 4 identifies with the same as their sex registered at birth?,"If 'No', enter person 4's gender identity",Is the gender the person 5 identifies with the same as their sex registered at birth?,"If 'No', enter person 5's gender identity",Is the gender the person 6 identifies with the same as their sex registered at birth?,"If 'No', enter person 6's gender identity",Is the gender the person 7 identifies with the same as their sex registered at birth?,"If 'No', enter person 7's gender identity",Is the gender the person 8 identifies with the same as their sex registered at birth?,"If 'No', enter person 8's gender identity"
Additional info,"You can find the org ID on the CORE service under 'Stock owners' or, if your organisation is the stock owner, under 'About your organisation'","You can find the org ID on the CORE service under 'Managing agents' or, if your organisation is the managing agent, under 'About your organisation'","If left empty, the letting log will be assigned to the account used to upload the log.","General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing includes direct access hostels, group homes, residential care and nursing homes.","Scheme code. Include the 'S' at the beginning if it has one.
You can find the scheme code on the CORE service under 'Schemes', either by searching for the specific scheme or downloading a csv.","Location code.
@ -45,7 +45,7 @@ The UPRN may not be the same as the property reference assigned by your organisa
Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission.",This is where two or more people are named on the tenancy agreement.,"If the tenancy has an ‘introductory period’ answer ‘yes’.
You should submit a CORE log at the beginning of the starter tenancy or introductory period, with the best information you have at the time. You do not need to submit a log when a tenant later rolls onto the main tenancy.",This is about the main tenancy after any starter or introductory period. See specification for definitions.,,Do not include the starter or introductory period. The minimum period is 2 years for social or affordable rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 2 years.,"This is the household member who does the most paid work. If several people do the same amount of paid work, it's the oldest household member.",This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.,,"If the lead tenant is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the tenant should decide which country to enter.","This is the household member who does the most paid work. If several people do the same amount of paid work, it's the oldest household member.",,Answer 1 for children aged under 1 year old,This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.,,,Answer 1 for children aged under 1 year old,This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.,,,Answer 1 for children aged under 1 year old,This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.,,,Answer 1 for children aged under 1 year old,This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.,,,Answer 1 for children aged under 1 year old,This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.,,,Answer 1 for children aged under 1 year old,This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.,,,Answer 1 for children aged under 1 year old,This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.,,"This excludes national service.
If several household members have these links, answer for regular first. If no regular, answer for reserve. If no reserve, answer for spouses or civil partners.",,,,,,,,,,,"For example, lifting and carrying objects, or using a keyboard",,"For example, deafness or partial hearing",,"For example, depression or anxiety","For example, walking short distances or climbing stairs","For example, anything associated with autism spectrum disorder (ASD), including Asperger’s or attention deficit hyperactivity disorder (ADHD)",,"For example, blindness or partial sight",,,,"The tenant's ‘last settled home' is their last long-standing home. For tenants who had temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living previously.",,,,"This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless.","Combined with field 104, it should be a postcode which lies within the local authority given in field 105.","Combined with field 103, it should be a postcode which lies within the local authority given in field 105.","This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless.",Households may be given ‘reasonable preference’ for social housing under one or more specific category by the local authority. This is also known as ‘priority need’.,,,,,,Where available vacant properties are advertised and applicants are able to bid for specific properties.,Where a common system agreed between a group of housing providers is used to determine applicants' priority for housing.,Where a single waiting list is used by a group of housing providers to receive and process housing applications. Providers may use different approaches to determine priority.,Where the 'access category' or another descriptor of whether an available vacant property meets a range of access needs is displayed to applicants during the allocations process.,,,,"Include any income after tax from employment, pensions, and Universal Credit. Don't include National Insurance (NI) contributions and tax, housing benefit, child benefit, or council tax support.","This is about when the tenant is in their new let. If they are unsure about the situation for their new let and their financial and working situation hasn’t changed significantly, answer based on what housing-related benefits they currently receive.",,"If rent is charged on the property then answer Yes, even if tenants do not pay it themselves.",,"This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent.","For example, cleaning. Households may get household benefits towards the service charge.",For example heating or hot water. This doesn’t include housing benefit or Universal Credit.,Any charges made to fund support services included in the tenancy agreement.,Also known as the 'outstanding amount',You only need to give an approximate figure.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.
If several household members have these links, answer for regular first. If no regular, answer for reserve. If no reserve, answer for spouses or civil partners.",,,,,,,,,,,"For example, lifting and carrying objects, or using a keyboard",,"For example, deafness or partial hearing",,"For example, depression or anxiety","For example, walking short distances or climbing stairs","For example, anything associated with autism spectrum disorder (ASD), including Asperger’s or attention deficit hyperactivity disorder (ADHD)",,"For example, blindness or partial sight",,,,"The tenant's ‘last settled home' is their last long-standing home. For tenants who had temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living previously.",,,,"This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless.","Combined with field 104, it should be a postcode which lies within the local authority given in field 105.","Combined with field 103, it should be a postcode which lies within the local authority given in field 105.","This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless.",Households may be given ‘reasonable preference’ for social housing under one or more specific category by the local authority. This is also known as ‘priority need’.,,,,,,Where available vacant properties are advertised and applicants are able to bid for specific properties.,Where a common system agreed between a group of housing providers is used to determine applicants' priority for housing.,Where a single waiting list is used by a group of housing providers to receive and process housing applications. Providers may use different approaches to determine priority.,Where the 'access category' or another descriptor of whether an available vacant property meets a range of access needs is displayed to applicants during the allocations process.,,,,"Include any income after tax from employment, pensions, and Universal Credit. Don't include National Insurance (NI) contributions and tax, housing benefit, child benefit, or council tax support.","This is about when the tenant is in their new let. If they are unsure about the situation for their new let and their financial and working situation hasn’t changed significantly, answer based on what housing-related benefits they currently receive.",,"If rent is charged on the property then answer Yes, even if tenants do not pay it themselves.",,"This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent.","For example, cleaning. Households may get household benefits towards the service charge.",For example heating or hot water. This doesn’t include housing benefit or Universal Credit.,Any charges made to fund support services included in the tenancy agreement.,Also known as the 'outstanding amount',You only need to give an approximate figure.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,This is the sex that was registered at birth.,,,,,,,,,,,,,,,,
Values,Alphanumeric,,Email format,01-Feb,Alphanumeric,Numeric,01-Feb,Jan-31,01-Dec,25 - 26,01-Jul,Text,"Alphanumeric, max 13 characters","Alphanumeric, max 12 characters",1,"5 - 6, or 8 - 22",1 - 3 or 5 - 9,Numeric,Alphanumeric,,Text,,"Alphanumeric,
2 - 4 characters","Alphanumeric,
3 characters","9 character ONS code, beginning with 'E' (https://www.get-information-schools.service.gov.uk/Guidance/LaNameCodes) ","1 - 2, 4 or 6 - 10",01-Feb,01-Feb,01-Jul,Jan-31,01-Dec,Jun-26,Jan-31,01-Dec,Jun-26,"2 - 4, 7 - 8",01-Mar,01-Feb,02-Aug,Text,"1 - 99, see specification for more detail",16 - 120 or R,"F, M, X or R",Jan-20,"3 digit ISO country code, see specification",0 - 10,01-Mar,"Numeric, range 1 - 120 or text (upper case 'R')
@ -77,11 +77,11 @@ Must be >= 16 if working situation = 1 - 8 or 0
Must be <16 if working situation = 9","F, M, X or R","0 - 10
Must be 9 if age <16",01-Jun,03-Jun,01-Mar,,1 or empty,,,,,,01-Mar,1 or empty,,,,,,,,,,1 - 2 or 6 - 12,2 or 6 - 13,"1 - 2, 4, 8 - 14, 16 - 20, 28 - 31, 34 or 44 - 55",Text,"3 - 4, 6 - 7, 9 - 10, 13 - 14, 18 - 19, 21, 23 - 33, 35, 37 - 39 ",1 or 11,01-Feb,"Alphanumeric, 2 - 4 characters","Alphanumeric,
3 characters","9 character ONS code, beginning with 'E' (https://www.get-information-schools.service.gov.uk/Guidance/LaNameCodes) ",01-Mar,1 or empty,,,,,01-Feb,,,,"1 - 4, 7 - 10, 14 - 24",01-Mar,01-Mar,0 - 99999,"1, 3, 6, 9 or 10",01-Apr,0 - 1,01-Oct,xxxx.xx,,,,01-Mar,xxxx.xx,"F, M or R","F, M or R","F, M or R","F, M or R","F, M or R","F, M or R","F, M or R","F, M or R"
3 characters","9 character ONS code, beginning with 'E' (https://www.get-information-schools.service.gov.uk/Guidance/LaNameCodes) ",01-Mar,1 or empty,,,,,01-Feb,,,,"1 - 4, 7 - 10, 14 - 24",01-Mar,01-Mar,0 - 99999,"1, 3, 6, 9 or 10",01-Apr,0 - 1,01-Oct,xxxx.xx,,,,01-Mar,xxxx.xx,"F, M or R","F, M or R","F, M or R","F, M or R","F, M or R","F, M or R","F, M or R","F, M or R",1 - 3,Text,1 - 3,Text,1 - 3,Text,1 - 3,Text,1 - 3,Text,1 - 3,Text,1 - 3,Text,1 - 3,Text
Can be empty?,No,,Yes,No,"Yes, if letting is general needs (if field 4 = 1)","Yes, if letting is general needs (if field 4 = 1)",No,,,,,"Yes, if letting is not 'Other intermediate rent product' (if field 11 is not 6)",Yes,,No,"Yes, if letting is a renewal (if field 7 = 1)","Yes, if letting is a renewal (if field 7 = 1) or a first-time let (if field 16 = 15 - 17)","Yes, if letting is supported housing (if field 4 = 2) or if the property's postcode is not empty (if fields 23 and 24 contain full and valid entries)","Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty)",Yes,"Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty)",Yes,"Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty)",,"Yes, if letting is supported housing (if field 4 = 2)",,,,,"Yes, if letting is a renewal (if field 7 = 1)",,,Yes,,,"Yes, if letting is general needs (if field 4 = 1)",No,,,"Yes, if 'Other' is not selected for tenancy type (if field 39 is not 3)","Yes, if letting is not a fixed-term tenancy (if field 39 is not 4 or 6)",No,,,,,"Yes, if all fields about person 2 are empty (fields 47 - 50)",,,,"Yes, if all fields about person 3 are empty (fields 51 - 54)",,,,"Yes, if all fields about person 4 are empty (fields 55 - 58)",,,,"Yes, if all fields about person 5 are empty (fields 59 - 62)",,,,"Yes, if all fields about person 6 are empty (fields 63 - 66)",,,,"Yes, if all fields about person 7 are empty (fields 67 - 70)",,,,"Yes, if all fields about person 8 are empty (fields 71 - 74)",,,,No,"Yes, if no one in the household is a current or former regular (if field 75 is not 1)","Yes, if no one in the household is a current or former regular or reserve (if field 75 is not 1 or 4)",No,"Yes, if no household members have access needs or if it is unknown (if field 83 or 84 = 1)",,,,"Yes, if a household member has an access need (if at least one of fields 79 to 82 = 1)",,No,"Yes, if a household member has an access need (if at least one of fields 79 to 82 = 1)
If someone in the household does have such a condition (if field 89 = 1), then at least 1 of these fields must be 1.",,,,,,,,,,No,"Yes, if letting is a renewal (if field 7 = 1)",No,"Yes, if 'Other' is not selected for reason for leaving last settled home (if field 98 is not 20)",No,No,,"Yes, if postcode of household's last settled home is not known (if 102 = 2)",,Yes,No,"If household was given 'reasonable preference' (if field 107 = 1), at least one of these fields must be 1
If household was not given 'reasonable preference' (if field 106 = 2 or 3), these fields will be ignored.",,,,,No,,,,"Yes, if letting is a renewal (if field 7 = 1)",No,"Yes, if household's income is unknown (if field 117 = 2 or 3)",,No,,"Yes, if letting is supported housing (if field 4 = 2)",No,"Yes, if the household does not pay rent (if field 122 = 1)",,,,"Yes, if the household doesn't receive housing benefits, or if it is unknown (if field 120 = 3, 9 or 10)","Yes, if the household does not need to pay rent or charges after receiving housing benefits (if field 128 is not 1)",,,,,,,,
Type of letting the question applies to,,,,,Supported housing only,,,,,,,Other Intermediate Rent only,,,,,,General needs only,,,,,,,,,,,,,,,,,,Supported housing only,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Supported housing only,,,,,,,,,,,,,,,
Duplicate check field?,Yes,,,,Yes,,,Yes,,,,,Yes,,,,,,,,,,Yes,,,,,,,,,,,,,,,,,,,Yes,,,,Yes,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Field number,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137
,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,,,,,,,
If household was not given 'reasonable preference' (if field 106 = 2 or 3), these fields will be ignored.",,,,,No,,,,"Yes, if letting is a renewal (if field 7 = 1)",No,"Yes, if household's income is unknown (if field 117 = 2 or 3)",,No,,"Yes, if letting is supported housing (if field 4 = 2)",No,"Yes, if the household does not pay rent (if field 122 = 1)",,,,"Yes, if the household doesn't receive housing benefits, or if it is unknown (if field 120 = 3, 9 or 10)","Yes, if the household does not need to pay rent or charges after receiving housing benefits (if field 128 is not 1)",,,,,,,,,,,,,,,,,,,,,,,,
Type of letting the question applies to,,,,,Supported housing only,,,,,,,Other Intermediate Rent only,,,,,,General needs only,,,,,,,,,,,,,,,,,,Supported housing only,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Supported housing only,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Duplicate check field?,Yes,,,,Yes,,,Yes,,,,,Yes,,,,,,,,,,Yes,,,,,,,,,,,,,,,,,,,Yes,,,,Yes,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Field number,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153
,ORG1,ORG1,support@example.com,1,,,2,1,4,26,1,,1,1,1,5,1,,a,a,a,a,a1,1aa,E09000001,1,1,1,1,1,4,25,,,,,3,1,2,,,20,F,1,GBR,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,6,3,1,1,,,,,,1,1,,,,,,,,,,1,2,50,,30,1,2,,,,1,1,,,,,1,1,1,1,7,2,,,1,2,1,1,50,0,0,0,3,,F,,,,,,,,1,,,,,,,,,,,,,,,

1 Section Setting up this lettings log Property information Tenancy information Household characteristics Household needs Household situation Income, benefits and outgoings
2 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? Common Allocations Policy (CAP) How was this letting allocated? Common Housing Register (CHR) How was this letting allocated? Accessible Housing Register What was the source of referral for this letting? Do you know the household's combined total income after tax? How often does the household receive income? How much income does the household have in total? Is the tenant likely to be receiving any of these housing-related benefits? How much of the household's income is from Universal Credit, state pensions or benefits? Does the household pay rent or other charges for the accommodation? How often does the household pay rent and other charges? What is the basic rent? What is the service charge? What is the personal service charge? What is the support charge? After the household has received any housing-related benefits, will they still need to pay for rent and charges? What do you expect the outstanding amount to be? What was the lead tenant's sex at birth? What was person 2's sex registered at birth? What was person 3's sex registered at birth? What was person 4's sex registered at birth? What was person 5's sex registered at birth? What was person 6's sex registered at birth? What was person 7's sex registered at birth? What was person 8's sex registered at birth? Is the gender the lead tenant identifies with the same as their sex registered at birth? If 'No', enter lead tenant's gender identity Is the gender the person 2 identifies with the same as their sex registered at birth? If 'No', enter person 2's gender identity Is the gender the person 3 identifies with the same as their sex registered at birth? If 'No', enter person 3's gender identity Is the gender the person 4 identifies with the same as their sex registered at birth? If 'No', enter person 4's gender identity Is the gender the person 5 identifies with the same as their sex registered at birth? If 'No', enter person 5's gender identity Is the gender the person 6 identifies with the same as their sex registered at birth? If 'No', enter person 6's gender identity Is the gender the person 7 identifies with the same as their sex registered at birth? If 'No', enter person 7's gender identity Is the gender the person 8 identifies with the same as their sex registered at birth? If 'No', enter person 8's gender identity
3 Additional info You can find the org ID on the CORE service under 'Stock owners' or, if your organisation is the stock owner, under 'About your organisation' You can find the org ID on the CORE service under 'Managing agents' or, if your organisation is the managing agent, under 'About your organisation' If left empty, the letting log will be assigned to the account used to upload the log. General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing includes direct access hostels, group homes, residential care and nursing homes. Scheme code. Include the 'S' at the beginning if it has one. You can find the scheme code on the CORE service under 'Schemes', either by searching for the specific scheme or downloading a csv. Location code. 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. 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’) - new conversions or acquisitions: the completion date, or the day after any rehabilitation work ended - new leases: the day the landlord got contractual property rights, and could let it out to tenants. Major repairs are works that could not be reasonably carried out with a tenant living at the property. For example, structural repairs. This includes retirement living, sheltered housing and extra care housing. There is no national set limit for “older people”, please answer based on your own policies. Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission. This is where two or more people are named on the tenancy agreement. If the tenancy has an ‘introductory period’ answer ‘yes’. You should submit a CORE log at the beginning of the starter tenancy or introductory period, with the best information you have at the time. You do not need to submit a log when a tenant later rolls onto the main tenancy. This is about the main tenancy after any starter or introductory period. See specification for definitions. Do not include the starter or introductory period. The minimum period is 2 years for social or affordable rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 2 years. This is the household member who does the most paid work. If several people do the same amount of paid work, it's the oldest household member. This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth. If the lead tenant is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the tenant should decide which country to enter. This is the household member who does the most paid work. If several people do the same amount of paid work, it's the oldest household member. Answer 1 for children aged under 1 year old This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth. Answer 1 for children aged under 1 year old This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth. Answer 1 for children aged under 1 year old This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth. Answer 1 for children aged under 1 year old This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth. Answer 1 for children aged under 1 year old This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth. Answer 1 for children aged under 1 year old This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth. Answer 1 for children aged under 1 year old This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth. This excludes national service. If several household members have these links, answer for regular first. If no regular, answer for reserve. If no reserve, answer for spouses or civil partners. For example, lifting and carrying objects, or using a keyboard For example, deafness or partial hearing For example, depression or anxiety For example, walking short distances or climbing stairs For example, anything associated with autism spectrum disorder (ASD), including Asperger’s or attention deficit hyperactivity disorder (ADHD) For example, blindness or partial sight The tenant's ‘last settled home' is their last long-standing home. For tenants who had temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living previously. This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless. Combined with field 104, it should be a postcode which lies within the local authority given in field 105. Combined with field 103, it should be a postcode which lies within the local authority given in field 105. This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless. Households may be given ‘reasonable preference’ for social housing under one or more specific category by the local authority. This is also known as ‘priority need’. Where available vacant properties are advertised and applicants are able to bid for specific properties. Where a common system agreed between a group of housing providers is used to determine applicants' priority for housing. Where a single waiting list is used by a group of housing providers to receive and process housing applications. Providers may use different approaches to determine priority. Where the 'access category' or another descriptor of whether an available vacant property meets a range of access needs is displayed to applicants during the allocations process. Include any income after tax from employment, pensions, and Universal Credit. Don't include National Insurance (NI) contributions and tax, housing benefit, child benefit, or council tax support. This is about when the tenant is in their new let. If they are unsure about the situation for their new let and their financial and working situation hasn’t changed significantly, answer based on what housing-related benefits they currently receive. If rent is charged on the property then answer Yes, even if tenants do not pay it themselves. This is the amount paid before any charges are added for services (for example, hot water or cleaning). Households may receive housing benefit or Universal Credit towards basic rent. For example, cleaning. Households may get household benefits towards the service charge. For example heating or hot water. This doesn’t include housing benefit or Universal Credit. Any charges made to fund support services included in the tenancy agreement. Also known as the 'outstanding amount' You only need to give an approximate figure. This is the sex that was registered at birth. This is the sex that was registered at birth. This is the sex that was registered at birth. This is the sex that was registered at birth. This is the sex that was registered at birth. This is the sex that was registered at birth. This is the sex that was registered at birth. This is the sex that was registered at birth.
4 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') 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-Mar Numeric, range 1 - 120 or text (upper case 'R') 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-Mar Numeric, range 1 - 120 or text (upper case 'R') 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-Mar Numeric, range 1 - 120 or text (upper case 'R') 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-Mar Numeric, range 1 - 120 or text (upper case 'R') 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-Mar Numeric, range 1 - 120 or text (upper case 'R') 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-Mar Numeric, range 1 - 120 or text (upper case 'R') Must be >= 16 if working situation = 1 - 8 or 0 Must be <16 if working situation = 9 F, M, X or R 0 - 10 Must be 9 if age <16 01-Jun 03-Jun 01-Mar 1 or empty 01-Mar 1 or empty 1 - 2 or 6 - 12 2 or 6 - 13 1 - 2, 4, 8 - 14, 16 - 20, 28 - 31, 34 or 44 - 55 Text 3 - 4, 6 - 7, 9 - 10, 13 - 14, 18 - 19, 21, 23 - 33, 35, 37 - 39 1 or 11 01-Feb Alphanumeric, 2 - 4 characters Alphanumeric, 3 characters 9 character ONS code, beginning with 'E' (https://www.get-information-schools.service.gov.uk/Guidance/LaNameCodes) 01-Mar 1 or empty 01-Feb 1 - 4, 7 - 10, 14 - 24 01-Mar 01-Mar 0 - 99999 1, 3, 6, 9 or 10 01-Apr 0 - 1 01-Oct xxxx.xx 01-Mar xxxx.xx F, M or R F, M or R F, M or R F, M or R F, M or R F, M or R F, M or R F, M or R 1 - 3 Text 1 - 3 Text 1 - 3 Text 1 - 3 Text 1 - 3 Text 1 - 3 Text 1 - 3 Text 1 - 3 Text
29
30
31
32
33
34
35
45
46
47
48
49
50
51
77
78
79
80
81
82
83
84
85
86
87

6
spec/fixtures/files/lettings_log_csv_export_codes_26.csv vendored

File diff suppressed because one or more lines are too long

6
spec/fixtures/files/lettings_log_csv_export_labels_26.csv vendored

File diff suppressed because one or more lines are too long

6
spec/fixtures/files/lettings_log_csv_export_non_support_codes_26.csv vendored

File diff suppressed because one or more lines are too long

6
spec/fixtures/files/lettings_log_csv_export_non_support_labels_26.csv vendored

File diff suppressed because one or more lines are too long

235
spec/fixtures/variable_definitions/lettings_download_26_27.csv vendored

@ -1,222 +1,3 @@
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?
@ -226,3 +7,19 @@ 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?
gender_same_as_sex1,Is the gender the lead tenant identifies with the same as their sex registered at birth?
gender_same_as_sex2,Is the gender person 2 identifies with the same as their sex registered at birth?
gender_same_as_sex3,Is the gender person 3 identifies with the same as their sex registered at birth?
gender_same_as_sex4,Is the gender person 4 identifies with the same as their sex registered at birth?
gender_same_as_sex5,Is the gender person 5 identifies with the same as their sex registered at birth?
gender_same_as_sex6,Is the gender person 6 identifies with the same as their sex registered at birth?
gender_same_as_sex7,Is the gender person 7 identifies with the same as their sex registered at birth?
gender_same_as_sex8,Is the gender person 8 identifies with the same as their sex registered at birth?
gender_description1,If 'No', enter the lead tenant's gender identity
gender_description2,If 'No', enter person 2's gender identity
gender_description3,If 'No', enter person 3's gender identity
gender_description4,If 'No', enter person 4's gender identity
gender_description5,If 'No', enter person 5's gender identity
gender_description6,If 'No', enter person 6's gender identity
gender_description7,If 'No', enter person 7's gender identity
gender_description8,If 'No', enter person 8's gender identity

Can't render this file because it has a wrong number of fields in line 25.

281
spec/fixtures/variable_definitions/sales_download_26_27.csv vendored

@ -1,284 +1,3 @@
ID,Log ID
STATUS,Status of log
DUPLICATESET,ID of a set of duplicate logs
CREATEDDATE,Time and date the log was created
UPLOADDATE,Time and date the log was last updated
COLLECTIONYEAR,Year collection period opened
CREATIONMETHOD,Was the log submitted in-service or via bulk upload?
BULKUPLOADID,ID of a set of bulk uploaded logs
DATAPROTECT,Is the user in the created_by column the data protection officer?
OWNINGORGNAME,Which organisation owned this property before the sale?
MANINGORGNAME,Which organisation reported the sale?
CREATEDBY,User that created the log
USERNAME,User the log is assigned to
DAY,Day of sale completion date
MONTH,Month of sale completion date
YEAR,Year of sale completion date
PURCHID,What is the purchaser code?
OWNERSHIP,Was this purchase made through an ownership scheme?
TYPE,What is the type of shared ownership/discounted ownership/outright sale?
OTHTYPE,If type = 'Other', what is the type of outright sale?
COMPANY,Is the buyer a company?
LIVEINBUYER,Will the buyer(s) live in the property?
JOINT,Is this a joint purchase?
JOINTMORE,Are there more than 2 joint buyers of this property?
NOINT,Did you interview the buyer to answer these questions?
PRIVACYNOTICE,Has the buyer seen the MHCLG privacy notice?
UPRN,What is the UPRN of the property?
ADDRESS1,Address line 1
ADDRESS2,Address line 2
TOWNCITY,Town/City
COUNTY,County
POSTCODE,Postcode
ISLAINFERRED,The internal value to indicate if the LA was inferred from the postcode
LANAME,LA name
LA,LA code
UPRNSELECTED,UPRN of the address selected
ADDRESS_SEARCH_VALUE_CHECK,Was the 'No address found' page seen?
ADDRESS1INPUT,Address line 1 input from address matching feature
POSTCODEINPUT,Postcode input from address matching feature
BULKADDRESS1,Address line 1 entered in bulk upload file
BULKADDRESS2,Address line 2 entered in bulk upload file
BULKTOWNCITY,Town or city entered in bulk upload file
BULKCOUNTY,County entered in bulk upload file
BULKPOSTCODE,Postcode entered in bulk upload file
BULKLA,Local authority entered in bulk upload file
BEDS,How many bedrooms does the property have?
PROPTYPE,What type of unit is the property?
BUILTYPE,Which type of building is the property?
WCHAIR,Is the property built or adapted to wheelchair-user standards?
AGE1,What is buyer 1's age?
SEX1,Which of these best describes buyer 1's gender identity?
ETHNICGROUP1,What is buyer 1's ethnic group?
ETHNIC,Which of the following best describes buyer 1's ethnic background?
NATIONALITYALL1,What is buyer 1's nationality?
ECSTAT1,Which of these best describes buyer 1's working situation?
LIVEINBUYER1,Will buyer 1 live in the property?
RELAT2,What is buyer 2 or person 2's relationship to buyer 1?
AGE2,What is buyer 2 or person 2's age?
SEX2,Which of these best describes buyer 2 or person 2's gender identity?
ETHNICGROUP2,What is buyer 2's ethnic group?
ETHNIC2,Which of the following best describes buyer 2's ethnic background?
NATIONALITYALL2,What is buyer 2's nationality?
ECSTAT2,What is buyer 2 or person 2's working situation?
LIVEINBUYER2,Will buyer 2 live in the property?
HHTYPE,Besides the buyer(s), how many other people live or will live in the property?
RELAT3,What is person 3's relationship to buyer 1?
AGE3,What is person 3's age?
SEX3,What is person 3's gender identity?
ECSTAT3,What is person 3's working situation?
RELAT4,What is person 4's relationship to buyer 1?
AGE4,What is person 4's age?
SEX4,What is person 4's gender identity?
ECSTAT4,What is person 4's working situation?
RELAT5,What is person 5's relationship to buyer 1?
AGE5,What is person 5's age?
SEX5,What is person 5's gender identity?
ECSTAT5,What is person 5's working situation?
RELAT6,What is person 6's relationship to buyer 1?
AGE6,What is person 6's age?
SEX6,What is person 6's gender identity?
ECSTAT6,What is person 6's working situation?
PREVTEN,What was buyer 1's previous tenure?
PPCODENK,Do you know the postcode of buyer 1's last settled accommodation?
PPOSTC1,Part 1 of postcode of buyer 1's last settled accommodation
PPOSTC2,Part 2 of postcode of buyer 1's last settled accommodation
PREVIOUSLAKNOWN,Do you know the local authority of buyer 1's last settled accommodation?
PREVLOC,The local authority code of buyer 1's last settled accommodation
PREVLOCNAME,The local authority name of buyer 1's last settled accommodation
PREGYRHA,Was the buyer registered with their PRP (HA)?
PREGOTHER,Was the buyer registered with another PRP (HA)?
PREGLA,Was the buyer registered with the local authority?
PREGGHB,Was the buyer registered with a Help to Buy agent?
PREGBLANK,Populated if pregyrha, pregother, pregla and pregghb are blank
BUY2LIVING,At the time of purchase, was buyer 2 living at the same address as buyer 1?
PREVTEN2,What was buyer 2's previous tenure?
HHREGRES,Have any of the buyers ever served as a regular in the UK armed forces?
HHREGRESSTILL,Is the buyer still serving in the UK armed forces?
ARMEDFORCESSPOUSE,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?
DISABLED,Does anyone in the household consider themselves to have a disability?
WHEEL,Does anyone in the household use a wheelchair?
INC1NK,Is buyer 1's annual income known?
INCOME1,What is buyer 1's annual income?
INC1MORT,Was buyer 1's income used for a mortgage application?
INC2NK,Is buyer 1's annual income known?
INCOME2,What is buyer 2's annual income?
INC2MORT,Was buyer 2's income used for a mortgage application?
HB,Were the buyers receiving any of these housing-related benefits immediately before buying this property?
SAVINGSNK,Is the the total amount the buyers had in savings known?
SAVINGS,What is the total amount the buyers had in savings before they paid any deposit for the property?
PREVOWN,Have any of the buyers previously owned a property?
PREVSHARED,Was the previous property under shared ownership?
PROPLEN,How long did the buyer(s) live in the property before purchasing it?
STAIRCASE,Is this a staircasing transaction?
STAIRBOUGHT,What percentage of the property has been bought in this staircasing transaction?
STAIROWNED,What percentage of the property do the buyers now own in total?
STAIRCASETOSALE,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?
RESALE,Is this a resale?
EXDAY,Day of the exchange of contracts
EXMONTH,Month of the exchange of contracts
EXYEAR,Year of the exchange of contracts
HODAY,Day of the practical completion or handover date
HOMONTH,Month of the practical completion or handover date
HOYEAR,Year of the practical completion or handover date
LANOMAGR,Was the household rehoused under a local authority nominations agreement?
SOCTEN,Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?
FROMBEDS,How many bedrooms did the buyer's previous property have?
FROMPROP,What was the previous property type?
SOCPREVTEN,What was the rent type of buyer's previous tenure?
VALUE,What is the full purchase price?
VALUE_VALUE_CHECK,Populated if a soft validation is confirmed.
EQUITY,What was the initial percentage equity stake purchased?
MORTGAGEUSED,Was a mortgage used to buy this property?
MORTGAGE,What is the mortgage amount?
MORTGAGELENDER,What is the name of the mortgage lender?
MORTGAGELENDEROTHER,If mortgagelender = 'Other', what is the name of the mortgage lender?
MORTLEN1,What is the length of the mortgage in years?
EXTRABOR,Does this include any extra borrowing?
DEPOSIT,How much was the cash deposit paid on the property?
CASHDIS,How much cash discount was given through Social Homebuy?
MRENT,What is the basic monthly rent?
HASMSCHARGE,Does the property have any monthly leasehold charges?
MSCHARGE,What are the total monthly leasehold charges for the property?
MSCHARGE_VALUE_CHECK,Populated if a soft validation is confirmed.
DISCOUNT,What was the percentage discount?
GRANT,What was the amount of any loan, grant, discount or subsidy given?
id,Log ID
status,Status of log
duplicate_set_id,ID of a set of duplicate logs
created_at,Time and date the log was created
updated_at,Time and date the log was last updated
old_form_id,The ID on the old service
collection_start_year,Year collection period opened
creation_method,Was the log submitted in-service or via bulk upload?
is_dpo,Is the user in the assigned_to column the data protection officer?
owning_organisation_name,Which organisation owned this property before the sale?
managing_organisation_name,Which organisation reported the sale?
assigned_to,User the log is assigned to
day,Day of sale completion date
month,Month of sale completion date
year,Year of sale completion date
purchid,What is the purchaser code?
ownershipsch,Was this purchase made through an ownership scheme?
type,What is the type of shared ownership/discounted ownership/outright sale?
othtype,If type = 'Other', what is the type of outright sale?
companybuy,Is the buyer a company?
buylivein,Will the buyer(s) live in the property?
jointpur,Is this a joint purchase?
jointmore,Are there more than 2 joint buyers of this property?
beds,How many bedrooms does the property have?
proptype,What type of unit is the property?
builtype,Which type of building is the property?
uprn,What is the UPRN of the property?
uprn_confirmed,We found an address that might be this property. Is this the property address?
address_line1_input,Address line 1 input from address matching feature
postcode_full_input,Postcode input from address matching feature
uprn_selection,UPRN of the address selected
address_line1,Address line 1
address_line2,Address line 2
town_or_city,Town/City
county,County
pcode1,Part 1 of the property's postcode
pcode2,Part 2 of the property's postcode
la,LA code
la_label,LA name
wchair,Is the property built or adapted to wheelchair-user standards?
noint,Did you interview the buyer to answer these questions?
privacynotice,Has the buyer seen the MHCLG privacy notice?
age1,What is buyer 1's age?
sex1,Which of these best describes buyer 1's gender identity?
ethnic_group,What is buyer 1's ethnic group?
ethnic,Which of the following best describes buyer 1's ethnic background?
nationality_all,What is buyer 1's nationality?
ecstat1,Which of these best describes buyer 1's working situation?
buy1livein,Will buyer 1 live in the property?
relat2,What is buyer 2 or person 2's relationship to buyer 1?
age2,What is buyer 2 or person 2's age?
sex2,Which of these best describes buyer 2 or person 2's gender identity?
ethnic_group2,What is buyer 2's ethnic group?
ethnicbuy2,Which of the following best describes buyer 2's ethnic background?
nationality_all_buyer2,What is buyer 2's nationality?
ecstat2,What is buyer 2 or person 2's working situation?
buy2livein,Will buyer 2 live in the property?
hholdcount,Besides the buyer(s), how many other people live or will live in the property?
relat3,What is person 3's relationship to buyer 1?
age3,What is person 3's age?
sex3,What is person 3's gender identity?
ecstat3,What is person 3's working situation?
relat4,What is person 4's relationship to buyer 1?
age4,What is person 4's age?
sex4,What is person 4's gender identity?
ecstat4,What is person 4's working situation?
relat5,What is person 5's relationship to buyer 1?
age5,What is person 5's age?
sex5,What is person 5's gender identity?
ecstat5,What is person 5's working situation?
relat6,What is person 6's relationship to buyer 1?
age6,What is person 6's age?
sex6,What is person 6's gender identity?
ecstat6,What is person 6's working situation?
prevten,What was buyer 1's previous tenure?
ppcodenk,Do you know the postcode of buyer 1's last settled accommodation?
ppostc1,Part 1 of postcode of buyer 1's last settled accommodation
ppostc2,Part 2 of postcode of buyer 1's last settled accommodation
previous_la_known,Do you know the local authority of buyer 1's last settled accommodation?
prevloc,The local authority code of buyer 1's last settled accommodation
prevloc_label,The local authority name of buyer 1's last settled accommodation
pregyrha,Was the buyer registered with their PRP (HA)?
pregother,Was the buyer registered with another PRP (HA)?
pregla,Was the buyer registered with the local authority?
pregghb,Was the buyer registered with a Help to Buy agent?
pregblank,Populated if pregyrha, pregother, pregla and pregghb are blank
buy2living,At the time of purchase, was buyer 2 living at the same address as buyer 1?
prevtenbuy2,What was buyer 2's previous tenure?
hhregres,Have any of the buyers ever served as a regular in the UK armed forces?
hhregresstill,Is the buyer still serving in the UK armed forces?
armedforcesspouse,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?
disabled,Does anyone in the household consider themselves to have a disability?
wheel,Does anyone in the household use a wheelchair?
income1nk,Is buyer 1's annual income known?
income1,What is buyer 1's annual income?
inc1mort,Was buyer 1's income used for a mortgage application?
income2nk,Is buyer 2's annual income known?
income2,What is buyer 2's annual income?
inc2mort,Was buyer 2's income used for a mortgage application?
hb,Were the buyers receiving any of these housing-related benefits immediately before buying this property?
savingsnk,Is the the total amount the buyers had in savings known?
savings,What is the total amount the buyers had in savings before they paid any deposit for the property?
prevown,Have any of the buyers previously owned a property?
prevshared,Was the previous property under shared ownership?
proplen,How long did the buyer(s) live in the property before purchasing it?
staircase,Is this a staircasing transaction?
stairbought,What percentage of the property has been bought in this staircasing transaction?
stairowned,What percentage of the property do the buyers now own in total?
staircasesale,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?
resale,Is this a resale?
exday,Day of the exchange of contracts
exmonth,Month of the exchange of contracts
exyear,Year of the exchange of contracts
hoday,Day of the practical completion or handover date
homonth,Month of the practical completion or handover date
hoyear,Year of the practical completion or handover date
lanomagr,Was the household rehoused under a local authority nominations agreement?
soctenant,Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?
frombeds,How many bedrooms did the buyer's previous property have?
fromprop,What was the previous property type?
socprevten,What was the rent type of buyer's previous tenure?
value,What is the full purchase price?
equity,What was the initial percentage equity stake purchased?
mortgageused,Was a mortgage used to buy this property?
mortgage,What is the mortgage amount?
mortgagelender,What is the name of the mortgage lender?
mortgagelenderother,If mortgagelender = 'Other', what is the name of the mortgage lender?
mortlen,What is the length of the mortgage in years?
extrabor,Does this include any extra borrowing?
deposit,How much was the cash deposit paid on the property?
cashdis,How much cash discount was given through Social Homebuy?
mrent,What is the basic monthly rent?
has_mscharge,Does the property have any monthly leasehold charges?
mscharge,What are the total monthly leasehold charges for the property?
discount,What was the percentage discount?
grant,What was the amount of any loan, grant, discount or subsidy given?
sexrab1,What was buyer 1's sex at birth?
sexrab2,What was buyer/person 2's sex at birth?
sexrab3,What was person 3's sex at birth?

Can't render this file because it has a wrong number of fields in line 20.

2
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) { 431 }
let(:total_variable_definitions_count) { 447 }
before do
Rake.application.rake_require("tasks/log_variable_definitions")

212
spec/models/form/lettings/questions/gender_description_spec.rb

@ -0,0 +1,212 @@
require "rails_helper"
RSpec.describe Form::Lettings::Questions::GenderDescription, type: :model do
include CollectionTimeHelper
subject(:question) { described_class.new(question_id, question_definition, page, person_index:) }
let(:question_id) { "gender_description1" }
let(:question_definition) { nil }
let(:page) { instance_double(Form::Page) }
let(:person_index) { 1 }
let(:subsection) { instance_double(Form::Subsection) }
let(:form) { instance_double(Form, start_date: current_collection_start_date, person_question_count: 5) }
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("text")
end
context "when person 1" do
let(:question_id) { "gender_description1" }
let(:person_index) { 1 }
let(:log) { build(:lettings_log, gender_same_as_sex1:) }
it "has the correct id" do
expect(question.id).to eq("gender_description1")
end
it "has expected 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(32)
end
context "and gender_same_as_sex for person 1 is 'Yes" do
let(:gender_same_as_sex1) { 1 }
it "is marked as derived" do
expect(question.derived?(log)).to be true
end
end
context "and gender_same_as_sex for person 1 is 'No" do
let(:gender_same_as_sex1) { 2 }
it "is not marked as derived" do
expect(question.derived?(log)).to be false
end
end
end
context "when person 2" do
let(:question_id) { "gender_description2" }
let(:person_index) { 2 }
it "has the correct id" do
expect(question.id).to eq("gender_description2")
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(40)
end
end
context "when person 3" do
let(:question_id) { "gender_description3" }
let(:person_index) { 3 }
it "has the correct id" do
expect(question.id).to eq("gender_description3")
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(45)
end
end
context "when person 4" do
let(:question_id) { "gender_description4" }
let(:person_index) { 4 }
it "has the correct id" do
expect(question.id).to eq("gender_description4")
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(50)
end
end
context "when person 5" do
let(:question_id) { "gender_description5" }
let(:person_index) { 5 }
it "has the correct id" do
expect(question.id).to eq("gender_description5")
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(55)
end
end
context "when person 6" do
let(:question_id) { "gender_description6" }
let(:person_index) { 6 }
it "has the correct id" do
expect(question.id).to eq("gender_description6")
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(60)
end
end
context "when person 7" do
let(:question_id) { "gender_description7" }
let(:person_index) { 7 }
it "has the correct id" do
expect(question.id).to eq("gender_description7")
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(65)
end
end
context "when person 8" do
let(:question_id) { "gender_description8" }
let(:person_index) { 8 }
it "has the correct id" do
expect(question.id).to eq("gender_description8")
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(70)
end
end
end

271
spec/models/form/lettings/questions/gender_same_as_sex_spec.rb

@ -0,0 +1,271 @@
require "rails_helper"
RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do
include CollectionTimeHelper
subject(:question) { described_class.new(question_id, question_definition, page, person_index:) }
let(:question_id) { "gender_same_as_sex1" }
let(:question_definition) { nil }
let(:page) { instance_double(Form::Page) }
let(:person_index) { 1 }
let(:subsection) { instance_double(Form::Subsection) }
let(:form) { instance_double(Form, start_date: current_collection_start_date, person_question_count: 5) }
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
context "when person 1" do
let(:question_id) { "gender_same_as_sex1" }
let(:person_index) { 1 }
it "has the correct id" do
expect(question.id).to eq("gender_same_as_sex1")
end
it "has expected 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(32)
end
it "has the correct answer_options" do
expect(question.answer_options).to eq({
"1" => { "value" => "Yes" },
"2" => { "value" => "No, enter gender identity" },
"divider" => { "value" => true },
"3" => { "value" => "Lead tenant prefers not to say" },
})
end
end
context "when person 2" do
let(:question_id) { "gender_same_as_sex2" }
let(:person_index) { 2 }
it "has the correct id" do
expect(question.id).to eq("gender_same_as_sex2")
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(40)
end
it "has the correct answer_options" do
expect(question.answer_options).to eq({
"1" => { "value" => "Yes" },
"2" => { "value" => "No, enter gender identity" },
"divider" => { "value" => true },
"3" => { "value" => "Person prefers not to say" },
})
end
end
context "when person 3" do
let(:question_id) { "gender_same_as_sex3" }
let(:person_index) { 3 }
it "has the correct id" do
expect(question.id).to eq("gender_same_as_sex3")
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(45)
end
it "has the correct answer_options" do
expect(question.answer_options).to eq({
"1" => { "value" => "Yes" },
"2" => { "value" => "No, enter gender identity" },
"divider" => { "value" => true },
"3" => { "value" => "Person prefers not to say" },
})
end
end
context "when person 4" do
let(:question_id) { "gender_same_as_sex4" }
let(:person_index) { 4 }
it "has the correct id" do
expect(question.id).to eq("gender_same_as_sex4")
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(50)
end
it "has the correct answer_options" do
expect(question.answer_options).to eq({
"1" => { "value" => "Yes" },
"2" => { "value" => "No, enter gender identity" },
"divider" => { "value" => true },
"3" => { "value" => "Person prefers not to say" },
})
end
end
context "when person 5" do
let(:question_id) { "gender_same_as_sex5" }
let(:person_index) { 5 }
it "has the correct id" do
expect(question.id).to eq("gender_same_as_sex5")
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(55)
end
it "has the correct answer_options" do
expect(question.answer_options).to eq({
"1" => { "value" => "Yes" },
"2" => { "value" => "No, enter gender identity" },
"divider" => { "value" => true },
"3" => { "value" => "Person prefers not to say" },
})
end
end
context "when person 6" do
let(:question_id) { "gender_same_as_sex6" }
let(:person_index) { 6 }
it "has the correct id" do
expect(question.id).to eq("gender_same_as_sex6")
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(60)
end
it "has the correct answer_options" do
expect(question.answer_options).to eq({
"1" => { "value" => "Yes" },
"2" => { "value" => "No, enter gender identity" },
"divider" => { "value" => true },
"3" => { "value" => "Person prefers not to say" },
})
end
end
context "when person 7" do
let(:question_id) { "gender_same_as_sex7" }
let(:person_index) { 7 }
it "has the correct id" do
expect(question.id).to eq("gender_same_as_sex7")
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(65)
end
it "has the correct answer_options" do
expect(question.answer_options).to eq({
"1" => { "value" => "Yes" },
"2" => { "value" => "No, enter gender identity" },
"divider" => { "value" => true },
"3" => { "value" => "Person prefers not to say" },
})
end
end
context "when person 8" do
let(:question_id) { "gender_same_as_sex8" }
let(:person_index) { 8 }
it "has the correct id" do
expect(question.id).to eq("gender_same_as_sex8")
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(70)
end
it "has the correct answer_options" do
expect(question.answer_options).to eq({
"1" => { "value" => "Yes" },
"2" => { "value" => "No, enter gender identity" },
"divider" => { "value" => true },
"3" => { "value" => "Person prefers not to say" },
})
end
end
end

8
spec/models/form/lettings/subsections/household_characteristics_spec.rb

@ -347,6 +347,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
age_lead_tenant_under_retirement_value_check
age_lead_tenant_over_retirement_value_check
lead_tenant_sex_registered_at_birth
lead_tenant_gender_same_as_sex
lead_tenant_gender_identity
no_females_pregnant_household_lead_value_check
females_in_soft_age_range_in_pregnant_household_lead_value_check
@ -371,6 +372,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
age_2_under_retirement_value_check
age_2_over_retirement_value_check
person_2_sex_registered_at_birth
person_2_gender_same_as_sex
person_2_gender_identity
no_females_pregnant_household_person_2_value_check
females_in_soft_age_range_in_pregnant_household_person_2_value_check
@ -388,6 +390,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
age_3_under_retirement_value_check
age_3_over_retirement_value_check
person_3_sex_registered_at_birth
person_3_gender_same_as_sex
person_3_gender_identity
no_females_pregnant_household_person_3_value_check
females_in_soft_age_range_in_pregnant_household_person_3_value_check
@ -405,6 +408,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
age_4_under_retirement_value_check
age_4_over_retirement_value_check
person_4_sex_registered_at_birth
person_4_gender_same_as_sex
person_4_gender_identity
no_females_pregnant_household_person_4_value_check
females_in_soft_age_range_in_pregnant_household_person_4_value_check
@ -422,6 +426,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
age_5_under_retirement_value_check
age_5_over_retirement_value_check
person_5_sex_registered_at_birth
person_5_gender_same_as_sex
person_5_gender_identity
no_females_pregnant_household_person_5_value_check
females_in_soft_age_range_in_pregnant_household_person_5_value_check
@ -439,6 +444,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
age_6_under_retirement_value_check
age_6_over_retirement_value_check
person_6_sex_registered_at_birth
person_6_gender_same_as_sex
person_6_gender_identity
no_females_pregnant_household_person_6_value_check
females_in_soft_age_range_in_pregnant_household_person_6_value_check
@ -456,6 +462,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
age_7_under_retirement_value_check
age_7_over_retirement_value_check
person_7_sex_registered_at_birth
person_7_gender_same_as_sex
person_7_gender_identity
no_females_pregnant_household_person_7_value_check
females_in_soft_age_range_in_pregnant_household_person_7_value_check
@ -473,6 +480,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod
age_8_under_retirement_value_check
age_8_over_retirement_value_check
person_8_sex_registered_at_birth
person_8_gender_same_as_sex
person_8_gender_identity
no_females_pregnant_household_person_8_value_check
females_in_soft_age_range_in_pregnant_household_person_8_value_check

2
spec/models/form/sales/pages/deposit_value_check_spec.rb

@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::DepositValueCheck, type: :model do
let(:page_id) { "deposit_value_check" }
let(:page_definition) { nil }
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2026_or_later?: false) }
let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do

2
spec/models/form/sales/pages/housing_benefits_spec.rb

@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::HousingBenefits, type: :model do
let(:page_id) { "provided_id" }
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))) }
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2026_or_later?: false)) }
let(:joint_purchase) { false }
it "has correct subsection" do

2
spec/models/form/sales/pages/savings_value_check_spec.rb

@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::SavingsValueCheck, type: :model do
let(:page_id) { "savings_value_check" }
let(:page_definition) { nil }
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_2026_or_later?: false) }
let(:subsection) { instance_double(Form::Subsection, form:) }
it "has correct subsection" do

28
spec/models/form/sales/questions/deposit_value_check_spec.rb

@ -6,6 +6,14 @@ RSpec.describe Form::Sales::Questions::DepositValueCheck, type: :model do
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) }
before do
allow(form).to receive(:start_year_2026_or_later?).and_return(true)
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)
@ -23,8 +31,24 @@ RSpec.describe Form::Sales::Questions::DepositValueCheck, type: :model do
expect(question.derived?(nil)).to be false
end
it "has a correct check_answers_card_number" do
expect(question.check_answers_card_number).to eq(0)
context "when in 2025", { year: 25 } do
before do
allow(form).to receive(:start_year_2026_or_later?).and_return(false)
end
it "has check_answers_card_number set to 0" do
expect(question.check_answers_card_number).to eq(0)
end
end
context "when in 2026", { year: 26 } do
before do
allow(form).to receive(:start_year_2026_or_later?).and_return(true)
end
it "does not have a check_answers_card_number" do
expect(question.check_answers_card_number).to be_nil
end
end
it "has the correct answer_options" do

31
spec/models/form/sales/questions/housing_benefits_spec.rb

@ -5,9 +5,18 @@ RSpec.describe Form::Sales::Questions::HousingBenefits, type: :model do
let(:question_id) { nil }
let(:question_definition) { nil }
let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)))) }
let(:page) { instance_double(Form::Page) }
let(:subsection) { instance_double(Form::Subsection) }
let(:form) { instance_double(Form) }
let(:joint_purchase) { false }
before do
allow(form).to receive(:start_year_2026_or_later?).and_return(true)
allow(form).to receive(:start_date).and_return(Time.zone.local(2023, 4, 1))
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
@ -24,6 +33,26 @@ RSpec.describe Form::Sales::Questions::HousingBenefits, type: :model do
expect(question.derived?(nil)).to be false
end
context "when in 2025", { year: 25 } do
before do
allow(form).to receive(:start_year_2026_or_later?).and_return(false)
end
it "does not have a check_answers_card_title" do
expect(question.check_answers_card_title).to be_nil
end
end
context "when in 2026", { year: 26 } do
before do
allow(form).to receive(:start_year_2026_or_later?).and_return(true)
end
it "has check_answers_card_title set to 'All buyers'" do
expect(question.check_answers_card_title).to eq("All buyers")
end
end
it "has the correct answer_options" do
expect(question.answer_options).to eq({
"2" => { "value" => "Housing benefit" },

28
spec/models/form/sales/questions/savings_value_check_spec.rb

@ -6,6 +6,14 @@ RSpec.describe Form::Sales::Questions::SavingsValueCheck, type: :model do
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) }
before do
allow(form).to receive(:start_year_2026_or_later?).and_return(true)
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)
@ -23,8 +31,24 @@ RSpec.describe Form::Sales::Questions::SavingsValueCheck, type: :model do
expect(question.derived?(nil)).to be false
end
it "has a correct check_answers_card_number" do
expect(question.check_answers_card_number).to eq(0)
context "when in 2025", { year: 25 } do
before do
allow(form).to receive(:start_year_2026_or_later?).and_return(false)
end
it "has check_answers_card_number set to 0" do
expect(question.check_answers_card_number).to eq(0)
end
end
context "when in 2026", { year: 26 } do
before do
allow(form).to receive(:start_year_2026_or_later?).and_return(true)
end
it "does not have a check_answers_card_number" do
expect(question.check_answers_card_number).to be_nil
end
end
it "has the correct answer_options" do

4
spec/services/bulk_upload/lettings/validator_spec.rb

@ -190,8 +190,8 @@ RSpec.describe BulkUpload::Lettings::Validator do
expect(error.tenant_code).to eql(log.tenancycode)
expect(error.property_ref).to eql(log.propcode)
expect(error.row).to eql("2")
expect(error.cell).to eql("DL2")
expect(error.col).to eql("DL")
expect(error.cell).to eql("EF2")
expect(error.col).to eql("EF")
end
end
end

8
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("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")
expect(service.column_for_field("field_5")).to eql("AG")
expect(service.column_for_field("field_22")).to eql("BO")
expect(service.column_for_field("field_26")).to eql("CD")
expect(service.column_for_field("field_25")).to eql("E")
end
end
end

16
spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb

@ -257,6 +257,22 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do
field_135: "R",
field_136: "F",
field_137: "M",
field_138: "1",
field_139: "",
field_140: "2",
field_141: "identity",
field_142: "3",
field_143: "",
field_144: "1",
field_145: "",
field_146: "2",
field_147: "identity",
field_148: "3",
field_149: "",
field_150: "1",
field_151: "",
field_152: "2",
field_153: "identity",
}
end

4
spec/services/csv/lettings_log_csv_service_spec.rb

@ -243,6 +243,7 @@ RSpec.describe Csv::LettingsLogCsvService do
age1: 35,
sex1: "F",
sexrab1: "F",
gender_same_as_sex1: 1,
ethnic_group: 0,
ethnic: 2,
nationality_all: 36,
@ -253,6 +254,8 @@ RSpec.describe Csv::LettingsLogCsvService do
age2: 32,
sex2: "M",
sexrab2: "M",
gender_same_as_sex2: 2,
gender_description2: "Non-binary",
ecstat2: 6,
details_known_3: 1,
details_known_4: 0,
@ -260,6 +263,7 @@ RSpec.describe Csv::LettingsLogCsvService do
age4_known: 1,
sex4: "R",
sexrab4: "R",
gender_same_as_sex4: 3,
ecstat4: 10,
armedforces: 1,
leftreg: 4,

36
spec/services/exports/lettings_log_export_service_spec.rb

@ -497,7 +497,41 @@ 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, 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!(:lettings_log) do
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,
gender_description2: "Non-binary",
)
end
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") }

4
spec/spec_helper.rb

@ -141,7 +141,9 @@ RSpec::Matchers.define :have_same_xml_contents_as do |expected|
end
failure_message do |actual|
"expected that unordered #{fix_xml_content_order(actual)} would be equal to unordered #{fix_xml_content_order(expected)}"
actual_unique_lines = fix_xml_content_order(actual).split("\n") - fix_xml_content_order(expected).split("\n")
expected_unique_lines = fix_xml_content_order(expected).split("\n") - fix_xml_content_order(actual).split("\n")
"expected that unordered #{fix_xml_content_order(actual)} would be equal to unordered #{fix_xml_content_order(expected)}. Unique lines in actual: #{actual_unique_lines.join("\n")}. Unique lines in expected: #{expected_unique_lines.join("\n")}"
end
failure_message_when_negated do |actual|

Loading…
Cancel
Save