From 6596351937454278866973ba67856dd2ee915b94 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 27 Aug 2024 14:49:13 +0100 Subject: [PATCH] Revert "CLDC-3241: Part 2 - Explanation of variables on CSVs" (#2609) * Revert "CLDC-3241: Part 2 - Explanation of variables on CSVs (#2586)" This reverts commit e045588775d0067c0dbaba9dc1ece56a819a064b. * Update Gemfile.lock --- app/models/csv_variable_definition.rb | 10 - app/services/csv/lettings_log_csv_service.rb | 17 -- app/services/csv/sales_log_csv_service.rb | 20 +- .../imports/variable_definitions_service.rb | 53 ---- .../definitions/lettings_download_23_24.csv | 209 ------------- .../definitions/lettings_download_24_25.csv | 220 -------------- .../csv/definitions/sales_download_23_24.csv | 269 ----------------- .../csv/definitions/sales_download_24_25.csv | 281 ------------------ config/initializers/rails_admin.rb | 21 +- ...6152326_create_csv_variable_definitions.rb | 15 - db/schema.rb | 12 - lib/tasks/log_variable_definitions.rake | 9 - spec/factories/csv_variable_definitions.rb | 8 - .../lettings_log_csv_export_codes_23.csv | 1 - .../lettings_log_csv_export_codes_24.csv | 1 - .../lettings_log_csv_export_labels_23.csv | 1 - .../lettings_log_csv_export_labels_24.csv | 1 - ...gs_log_csv_export_non_support_codes_23.csv | 1 - ...gs_log_csv_export_non_support_codes_24.csv | 1 - ...s_log_csv_export_non_support_labels_23.csv | 1 - ...s_log_csv_export_non_support_labels_24.csv | 1 - .../files/sales_logs_csv_export_codes_23.csv | 1 - .../files/sales_logs_csv_export_codes_24.csv | 1 - .../files/sales_logs_csv_export_labels_23.csv | 1 - .../files/sales_logs_csv_export_labels_24.csv | 1 - ..._logs_csv_export_non_support_labels_24.csv | 1 - .../lettings_download_23_24.csv | 209 ------------- .../lettings_download_24_25.csv | 220 -------------- .../sales_download_23_24.csv | 269 ----------------- .../sales_download_24_25.csv | 281 ------------------ spec/helpers/filters_helper_spec.rb | 4 +- .../tasks/log_variable_definitions_spec.rb | 41 --- .../csv/lettings_log_csv_service_spec.rb | 120 ++++---- .../csv/sales_log_csv_service_spec.rb | 131 ++++---- spec/services/csv/scheme_csv_service_spec.rb | 2 - .../variable_definitions_service_spec.rb | 44 --- 36 files changed, 117 insertions(+), 2361 deletions(-) delete mode 100644 app/models/csv_variable_definition.rb delete mode 100644 app/services/imports/variable_definitions_service.rb delete mode 100644 config/csv/definitions/lettings_download_23_24.csv delete mode 100644 config/csv/definitions/lettings_download_24_25.csv delete mode 100644 config/csv/definitions/sales_download_23_24.csv delete mode 100644 config/csv/definitions/sales_download_24_25.csv delete mode 100644 db/migrate/20240726152326_create_csv_variable_definitions.rb delete mode 100644 lib/tasks/log_variable_definitions.rake delete mode 100644 spec/factories/csv_variable_definitions.rb delete mode 100644 spec/fixtures/variable_definitions/lettings_download_23_24.csv delete mode 100644 spec/fixtures/variable_definitions/lettings_download_24_25.csv delete mode 100644 spec/fixtures/variable_definitions/sales_download_23_24.csv delete mode 100644 spec/fixtures/variable_definitions/sales_download_24_25.csv delete mode 100644 spec/lib/tasks/log_variable_definitions_spec.rb delete mode 100644 spec/services/imports/variable_definitions_service_spec.rb diff --git a/app/models/csv_variable_definition.rb b/app/models/csv_variable_definition.rb deleted file mode 100644 index 566a7a9a7..000000000 --- a/app/models/csv_variable_definition.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CsvVariableDefinition < ApplicationRecord - validates :variable, presence: true - validates :definition, presence: true - validates :log_type, presence: true, inclusion: { in: %w[lettings sales] } - validates :year, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 2000, less_than_or_equal_to: 2099 } - attribute :last_accessed, :datetime - - scope :lettings, -> { where(log_type: "lettings") } - scope :sales, -> { where(log_type: "sales") } -end diff --git a/app/services/csv/lettings_log_csv_service.rb b/app/services/csv/lettings_log_csv_service.rb index 3c4324d14..0243c3841 100644 --- a/app/services/csv/lettings_log_csv_service.rb +++ b/app/services/csv/lettings_log_csv_service.rb @@ -5,17 +5,10 @@ module Csv @export_type = export_type @year = year @attributes = lettings_log_attributes - @definitions = lettings_log_definitions end def prepare_csv(logs) CSV.generate(headers: true) do |csv| - if @year >= 2023 - csv << @attributes.map do |attribute| - record = @definitions.find { |r| r.variable == attribute.downcase } - record&.tap { |r| r.update!(last_accessed: Time.zone.now) }&.definition - end - end csv << @attributes logs.find_each do |log| @@ -265,16 +258,6 @@ module Csv @user.support? ? final_attributes : final_attributes - SUPPORT_ONLY_ATTRIBUTES - soft_validations_attributes end - def lettings_log_definitions - CsvVariableDefinition.lettings.group_by { |record| [record.variable, record.definition] } - .map do |_, options| - exact_match = options.find { |definition| definition.year == @year } - next exact_match if exact_match - - options.max_by(&:year) - end - end - def insert_derived_and_related_attributes(ordered_questions) ordered_questions.flat_map do |question| if question.type == "checkbox" diff --git a/app/services/csv/sales_log_csv_service.rb b/app/services/csv/sales_log_csv_service.rb index f74684868..844491fee 100644 --- a/app/services/csv/sales_log_csv_service.rb +++ b/app/services/csv/sales_log_csv_service.rb @@ -5,19 +5,11 @@ module Csv @export_type = export_type @year = year @attributes = sales_log_attributes - @definitions = sales_log_definitions end def prepare_csv(logs) CSV.generate(headers: true) do |csv| - formatted_attributes = formatted_attribute_headers - if @year >= 2023 - csv << formatted_attributes.map do |attribute| - record = @definitions.find { |r| r.variable == attribute.downcase } - record&.tap { |r| r.update!(last_accessed: Time.zone.now) }&.definition - end - end - csv << formatted_attributes + csv << formatted_attribute_headers logs.find_each do |log| csv << @attributes.map { |attribute| value(attribute, log) } @@ -169,16 +161,6 @@ module Csv @user.support? ? final_attributes : final_attributes - SUPPORT_ONLY_ATTRIBUTES end - def sales_log_definitions - CsvVariableDefinition.sales.group_by { |record| [record.variable, record.definition] } - .map do |_, options| - exact_match = options.find { |definition| definition.year == @year } - next exact_match if exact_match - - options.max_by(&:year) - end - end - def insert_derived_and_related_attributes(ordered_questions) ordered_questions.flat_map do |question| if question.type == "checkbox" diff --git a/app/services/imports/variable_definitions_service.rb b/app/services/imports/variable_definitions_service.rb deleted file mode 100644 index ba2e0d518..000000000 --- a/app/services/imports/variable_definitions_service.rb +++ /dev/null @@ -1,53 +0,0 @@ -require "csv" - -module Imports - class VariableDefinitionsService - attr_reader :path, :count - - def initialize(path:) - @path = path - @count = 0 - end - - def call - files = Dir.glob(File.join(@path, "*.csv")) - files.each do |file| - process_file(file) - end - end - - private - - def process_file(file) - file_name = File.basename(file, ".csv") - parsed_file_name = file_name.split("_") - log_type = parsed_file_name[0] - year = "20#{parsed_file_name[2]}".to_i - - records_added = 0 - - CSV.foreach(file) do |row| - next if row.empty? - - variable = row[0].downcase - definition = row[1..].join(",") - next if variable.nil? || definition.nil? - - existing_record = CsvVariableDefinition.find_by(variable: variable.strip, definition: definition.strip, log_type:) - - if existing_record.nil? - CsvVariableDefinition.create!( - variable: variable.strip, - definition: definition.strip, - log_type:, - year:, - ) - records_added += 1 - end - end - - Rails.logger.debug "Added #{records_added} variable/definition records for file: #{file_name}. Duplicates excluded." - @count += records_added - end - end -end diff --git a/config/csv/definitions/lettings_download_23_24.csv b/config/csv/definitions/lettings_download_23_24.csv deleted file mode 100644 index 73857e77d..000000000 --- a/config/csv/definitions/lettings_download_23_24.csv +++ /dev/null @@ -1,209 +0,0 @@ -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? -old_id,The (internal) ID on the old service -old_form_id,The ID the users saw on the old service -collection_start_year,Year collection period opened -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 -uprn_confirmed,We found an address that might be this property. Is this the property address? -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? -offered,How many times was the property offered between becoming vacant and this letting? -unittype_gn,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? -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? -national,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? -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? -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)? -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? diff --git a/config/csv/definitions/lettings_download_24_25.csv b/config/csv/definitions/lettings_download_24_25.csv deleted file mode 100644 index 0cc12dbd2..000000000 --- a/config/csv/definitions/lettings_download_24_25.csv +++ /dev/null @@ -1,220 +0,0 @@ -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? -builtype,Which type of building 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? diff --git a/config/csv/definitions/sales_download_23_24.csv b/config/csv/definitions/sales_download_23_24.csv deleted file mode 100644 index ad596de6c..000000000 --- a/config/csv/definitions/sales_download_23_24.csv +++ /dev/null @@ -1,269 +0,0 @@ -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 -FORM,The ID on the old service -COLLECTIONYEAR,Year collection period opened -CREATIONMETHOD,Was the log submitted in-service or via bulk upload? -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? -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? -UPRNCONFIRMED,We found an address that might be this property. Is this the property address? -ADDRESS1,Address line 1 -ADDRESS2,Address line 2 -TOWNCITY,Town/City -COUNTY,County -PCODE1,Part 1 of the property's postcode -PCODE2,Part 2 of the property's postcode -LA,LA code -LANAME,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? -ETHNICGROUP1,What is buyer 1's ethnic group? -ETHNIC,Which of the following best describes buyer 1's ethnic background? -NATIONAL,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? -NATIONAL2,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,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? -national,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? -nationalbuy2,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? diff --git a/config/csv/definitions/sales_download_24_25.csv b/config/csv/definitions/sales_download_24_25.csv deleted file mode 100644 index cf5641921..000000000 --- a/config/csv/definitions/sales_download_24_25.csv +++ /dev/null @@ -1,281 +0,0 @@ -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? diff --git a/config/initializers/rails_admin.rb b/config/initializers/rails_admin.rb index accc01f73..87e44ebe9 100644 --- a/config/initializers/rails_admin.rb +++ b/config/initializers/rails_admin.rb @@ -25,25 +25,8 @@ RailsAdmin.config do |config| ## == Gravatar integration == ## To disable Gravatar integration in Navigation Bar set to false - config.show_gravatar = false - config.included_models = %w[LogValidation CsvVariableDefinition] - - config.model "LogValidation" do - label "Log Validation" - end - - config.model "CsvVariableDefinition" do - label "CSV Variable Definition" - edit do - exclude_fields :last_accessed - field :log_type do - help "Required. Specify the type of log associated with this variable: 'lettings' or 'sales'." - end - field :year do - help "Required. Specify the year this definition should be available from. This definition will be used in subsequent years unless superseded by a newer definition." - end - end - end + # config.show_gravatar = true + config.included_models = %w[LogValidation] config.actions do dashboard # mandatory diff --git a/db/migrate/20240726152326_create_csv_variable_definitions.rb b/db/migrate/20240726152326_create_csv_variable_definitions.rb deleted file mode 100644 index 31dfba66a..000000000 --- a/db/migrate/20240726152326_create_csv_variable_definitions.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateCsvVariableDefinitions < ActiveRecord::Migration[7.0] - def change - create_table :csv_variable_definitions do |t| - t.string :variable, null: false - t.string :definition, null: false - t.string :log_type, null: false - t.integer :year, null: false - t.datetime :last_accessed - t.timestamps - end - - add_check_constraint :csv_variable_definitions, "log_type IN ('lettings', 'sales')", name: "log_type_check" - add_check_constraint :csv_variable_definitions, "year BETWEEN 2000 AND 2099", name: "year_check" - end -end diff --git a/db/schema.rb b/db/schema.rb index 00159931b..a76cf9eea 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -46,18 +46,6 @@ ActiveRecord::Schema[7.0].define(version: 2024_08_19_143150) do t.index ["user_id"], name: "index_bulk_uploads_on_user_id" end - create_table "csv_variable_definitions", force: :cascade do |t| - t.string "variable", null: false - t.string "definition", null: false - t.string "log_type", null: false - t.integer "year", null: false - t.datetime "last_accessed" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.check_constraint "log_type::text = ANY (ARRAY['lettings'::character varying::text, 'sales'::character varying::text])", name: "log_type_check" - t.check_constraint "year >= 2000 AND year <= 2099", name: "year_check" - end - create_table "data_protection_confirmations", force: :cascade do |t| t.bigint "organisation_id" t.bigint "data_protection_officer_id" diff --git a/lib/tasks/log_variable_definitions.rake b/lib/tasks/log_variable_definitions.rake deleted file mode 100644 index bd1ba9708..000000000 --- a/lib/tasks/log_variable_definitions.rake +++ /dev/null @@ -1,9 +0,0 @@ -namespace :data_import do - desc "Add CsvVariableDefinition records for each file in the specified directory" - task :add_variable_definitions, [:path] => :environment do |_task, args| - path = Rails.root.join(args[:path]) - service = Imports::VariableDefinitionsService.new(path:) - service.call - Rails.logger.info "CSV Variable Definitions: #{service.count} total records added" - end -end diff --git a/spec/factories/csv_variable_definitions.rb b/spec/factories/csv_variable_definitions.rb deleted file mode 100644 index c7cf1eadc..000000000 --- a/spec/factories/csv_variable_definitions.rb +++ /dev/null @@ -1,8 +0,0 @@ -FactoryBot.define do - factory :csv_variable_definition do - variable { "variable" } - definition { "definition" } - log_type { "lettings" } - year { 2024 } - end -end diff --git a/spec/fixtures/files/lettings_log_csv_export_codes_23.csv b/spec/fixtures/files/lettings_log_csv_export_codes_23.csv index ea69e9176..326984a3b 100644 --- a/spec/fixtures/files/lettings_log_csv_export_codes_23.csv +++ b/spec/fixtures/files/lettings_log_csv_export_codes_23.csv @@ -1,3 +1,2 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,The (internal) ID on the old service,The ID the users saw on the old service,Year collection period opened,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Is the UPRN known?,"If known, property's UPRN",We found an address that might be this property. Is this the property address?,Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,How many times was the property offered between becoming vacant and this letting?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,Is this letting in sheltered accommodation?,Has the tenant seen the MHCLG privacy notice?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,Which of these best describes the lead tenant's gender identity?,What is the lead tenant's ethnic group?,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant's nationality?,Which of these best describes the lead tenant's working situation?,Are the details of tenant 2 known?,What is person 2's relationship to the lead tenant?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,Are the details of tenant 3 known?,What is person 3's relationship to the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,Are the details of tenant 4 known?,What is person 4's relationship to the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,Are the details of tenant 5 known?,What is person 5's relationship to the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,Are the details of tenant 6 known?,What is person 6's relationship to the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,Are the details of tenant 7 known?,What is person 7's relationship to the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,Are the details of tenant 8 known?,What is person 8's relationship to the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Was the local authority of the household's last settled home known?,The internal value to indicate if the previous LA was inferred from the postcode,Previous location LA name,Previous location's ONS LA Code,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",What was the source of referral for this letting?,"The following soft validation was confirmed: Are you sure? This is a general needs log, and this referral type is for supported housing.",Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,Is this accommodation a care home?,"If this is a care home, how much does the household pay every [time period]?",Weekly care home charge,Populated when the soft validation and confirmed in the service,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,old_id,old_form_id,collection_start_year,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,uprn_known,uprn,uprn_confirmed,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,offered,unittype_gn,builtype,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,joint,startertenancy,tenancy,tenancyother,tenancylength,sheltered,declaration,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sex1,ethnic_group,ethnic,national,ecstat1,details_known_2,relat2,age2,sex2,ecstat2,details_known_3,relat3,age3,sex3,ecstat3,details_known_4,relat4,age4,sex4,ecstat4,details_known_5,relat5,age5,sex5,ecstat5,details_known_6,relat6,age6,sex6,ecstat6,details_known_7,relat7,age7,sex7,ecstat7,details_known_8,relat8,age8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,prevten,homeless,ppcodenk,ppostcode_full,previous_la_known,is_previous_la_inferred,prevloc_label,prevloc,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,letting_allocation_none,referral,referral_value_check,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,is_carehome,chcharge,wchchrg,carehome_charges_value_check,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate ,completed,,s.port@jeemayle.com,s.port@jeemayle.com,false,2023-11-26T00:00:00+00:00,,2023-11-26T00:00:00+00:00,1,,,2023,MHCLG,MHCLG,1,7,0,2023-11-26,2,2,,,2,HIJKLMN,ABCDEFG,0,,,Address line 1,,London,,NW9 5LL,false,Barnet,E09000003,0,2,6,2,2,7,1,1,3,2023-11-24,1,,1,2023-11-25,,3,1,4,,2,,1,4,,1,4,0,0,2,35,,F,0,2,13,0,0,P,32,M,6,1,R,-9,R,10,0,R,-9,R,10,,,,,,,,,,,,,,,,,,,,,1,4,1,2,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,2,7,4,,6,1,0,TN23 6LZ,1,false,Ashford,E07000105,1,0,1,0,0,0,0,0,1,,2,,0,0,1,268,,6,1,1,,0,2,,,,,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,1,0,12.0,6.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_codes_24.csv b/spec/fixtures/files/lettings_log_csv_export_codes_24.csv index b7a0efd85..de7bb5876 100644 --- a/spec/fixtures/files/lettings_log_csv_export_codes_24.csv +++ b/spec/fixtures/files/lettings_log_csv_export_codes_24.csv @@ -1,3 +1,2 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is the UPRN known?,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,Is this letting in sheltered accommodation?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,Which of these best describes the lead tenant's gender identity?,What is the lead tenant's ethnic group?,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant's nationality?,Which of these best describes the lead tenant's working situation?,Are the details of tenant 2 known?,What is person 2's relationship to the lead tenant?,"The following soft validation was confirmed: You said that [person X]'s relationship to lead tenant is partner, and that their age is [AGEX]. Are you sure this is correct?",The following soft validation was confirmed: You said that more than one person in the household is the partner of the lead tenant. Are you sure this is correct?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,Are the details of tenant 3 known?,What is person 3's relationship to the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,Are the details of tenant 4 known?,What is person 4's relationship to the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,Are the details of tenant 5 known?,What is person 5's relationship to the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,Are the details of tenant 6 known?,What is person 6's relationship to the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,Are the details of tenant 7 known?,What is person 7's relationship to the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,Are the details of tenant 8 known?,What is person 8's relationship to the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",The soft validation was confirmed,Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Was the local authority of the household's last settled home known?,The internal value to indicate if the previous LA was inferred from the postcode,Previous location LA name,Previous location's ONS LA Code,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,Was the letting made under the Accessible Register?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",What was the source of referral for this letting?,"The following soft validation was confirmed: Are you sure? This is a general needs log, and this referral type is for supported housing.",Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,Is this accommodation a care home?,"If this is a care home, how much does the household pay every [time period]?",Weekly care home charge,Populated when the soft validation and confirmed in the service,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,uprn,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,uprn_known,uprn_selection,address_search_value_check,address_line1_input,postcode_full_input,address_line1_as_entered,address_line2_as_entered,town_or_city_as_entered,county_as_entered,postcode_full_as_entered,la_as_entered,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,unittype_gn,builtype,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,joint,startertenancy,tenancy,tenancyother,tenancylength,sheltered,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sex1,ethnic_group,ethnic,nationality_all,ecstat1,details_known_2,relat2,partner_under_16_value_check,multiple_partners_value_check,age2,sex2,ecstat2,details_known_3,relat3,age3,sex3,ecstat3,details_known_4,relat4,age4,sex4,ecstat4,details_known_5,relat5,age5,sex5,ecstat5,details_known_6,relat6,age6,sex6,ecstat6,details_known_7,relat7,age7,sex7,ecstat7,details_known_8,relat8,age8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,reasonother_value_check,prevten,homeless,ppcodenk,ppostcode_full,previous_la_known,is_previous_la_inferred,prevloc_label,prevloc,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,accessible_register,letting_allocation_none,referral,referral_value_check,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,is_carehome,chcharge,wchchrg,carehome_charges_value_check,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate ,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2024-04-01T00:00:00+01:00,,2024-04-01T00:00:00+01:00,1,2024,,MHCLG,MHCLG,1,7,0,2024-04-01,2,2,,,2,HIJKLMN,ABCDEFG,1,,Address line 1,,London,,NW9 5LL,false,Barnet,E09000003,0,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,0,2,6,2,7,1,1,3,2024-03-30,1,,1,2024-03-31,,3,1,4,,2,,4,,1,4,0,0,2,35,,F,0,2,36,0,0,P,,,32,M,6,1,R,-9,R,10,0,R,-9,R,10,,,,,,,,,,,,,,,,,,,,,1,4,1,2,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,2,7,4,,,6,1,0,TN23 6LZ,1,false,Ashford,E07000105,1,0,1,0,0,0,0,0,1,0,,2,,0,0,1,268,,6,1,1,,0,2,,,,,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,1,0,12.0,6.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_labels_23.csv b/spec/fixtures/files/lettings_log_csv_export_labels_23.csv index 44fd9d897..f14ca59c5 100644 --- a/spec/fixtures/files/lettings_log_csv_export_labels_23.csv +++ b/spec/fixtures/files/lettings_log_csv_export_labels_23.csv @@ -1,3 +1,2 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,The (internal) ID on the old service,The ID the users saw on the old service,Year collection period opened,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Is the UPRN known?,"If known, property's UPRN",We found an address that might be this property. Is this the property address?,Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,How many times was the property offered between becoming vacant and this letting?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,Is this letting in sheltered accommodation?,Has the tenant seen the MHCLG privacy notice?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,Which of these best describes the lead tenant's gender identity?,What is the lead tenant's ethnic group?,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant's nationality?,Which of these best describes the lead tenant's working situation?,Are the details of tenant 2 known?,What is person 2's relationship to the lead tenant?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,Are the details of tenant 3 known?,What is person 3's relationship to the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,Are the details of tenant 4 known?,What is person 4's relationship to the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,Are the details of tenant 5 known?,What is person 5's relationship to the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,Are the details of tenant 6 known?,What is person 6's relationship to the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,Are the details of tenant 7 known?,What is person 7's relationship to the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,Are the details of tenant 8 known?,What is person 8's relationship to the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Was the local authority of the household's last settled home known?,The internal value to indicate if the previous LA was inferred from the postcode,Previous location LA name,Previous location's ONS LA Code,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",What was the source of referral for this letting?,"The following soft validation was confirmed: Are you sure? This is a general needs log, and this referral type is for supported housing.",Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,Is this accommodation a care home?,"If this is a care home, how much does the household pay every [time period]?",Weekly care home charge,Populated when the soft validation and confirmed in the service,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,old_id,old_form_id,collection_start_year,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,uprn_known,uprn,uprn_confirmed,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,offered,unittype_gn,builtype,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,joint,startertenancy,tenancy,tenancyother,tenancylength,sheltered,declaration,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sex1,ethnic_group,ethnic,national,ecstat1,details_known_2,relat2,age2,sex2,ecstat2,details_known_3,relat3,age3,sex3,ecstat3,details_known_4,relat4,age4,sex4,ecstat4,details_known_5,relat5,age5,sex5,ecstat5,details_known_6,relat6,age6,sex6,ecstat6,details_known_7,relat7,age7,sex7,ecstat7,details_known_8,relat8,age8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,prevten,homeless,ppcodenk,ppostcode_full,previous_la_known,is_previous_la_inferred,prevloc_label,prevloc,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,letting_allocation_none,referral,referral_value_check,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,is_carehome,chcharge,wchchrg,carehome_charges_value_check,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate ,completed,,s.port@jeemayle.com,s.port@jeemayle.com,false,2023-11-26T00:00:00+00:00,,2023-11-26T00:00:00+00:00,single log,,,2023,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2023-11-26,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,No,,,Address line 1,,London,,NW9 5LL,No,Barnet,E09000003,No,Affordable rent basis,Tenant abandoned property,No,2,House,Purpose built,Yes,3,2023-11-24,1,,Yes,2023-11-25,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,,Yes,4,,Yes,4,0,0,2,35,,Female,White,Irish,Tenant prefers not to say,Other,Yes,Partner,32,Male,Not seeking work,No,Prefers not to say,Not known,Prefers not to say,Prefers not to say,Yes,Person prefers not to say,Not known,Person prefers not to say,Person prefers not to say,,,,,,,,,,,,,,,,,,,,,Yes – the person is a current or former regular,No – they left up to and including 5 years ago,Yes,No,Yes,Fully wheelchair accessible housing,Yes,No,No,No,No,No,No,Yes,No,No,Yes,No,No,No,No,No,No,No,Less than 1 year,1 year but under 2 years,Loss of tied accommodation,,Other supported housing,No,Yes,TN23 6LZ,Yes,No,Ashford,E07000105,Yes,,Yes,,,,No,No,Yes,,Tenant applied directly (no referral or nomination),,Yes,No,Weekly,268,,Universal Credit housing element,Yes,All,,No,Every 2 weeks,,,,,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,Yes,Yes,12.0,6.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_labels_24.csv b/spec/fixtures/files/lettings_log_csv_export_labels_24.csv index 53043b320..aeb09311c 100644 --- a/spec/fixtures/files/lettings_log_csv_export_labels_24.csv +++ b/spec/fixtures/files/lettings_log_csv_export_labels_24.csv @@ -1,3 +1,2 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is created by,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,What is the property's local authority?,Local authority code,Is the UPRN known?,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,The following soft validation was confirmed: You told us that the property has been vacant for more than 2 years. This is higher than we would expect.,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,The following soft validation was confirmed: You told us the property has been vacant for 2 years. This is higher than we would expect.,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,Is this letting in sheltered accommodation?,How many people live in the household at this letting?,The following soft validation was confirmed: You told us somebody in the household is pregnant. You also told us there are no female tenants living at the property.,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8","Type of household 1 = 1 elder; 2 = 2 adults, including elder(s); 3 = 1 adult; 4 = 2 adults; 5 = 1 adult & 1+ children; 6 = 2+ adults & 1+ children; 9 = Other",Total number of dependent children in the household (Sum of when RELAT2-8 = C),Total number of elders in household (Sum of when AGE1-8 >= 60),Total number of adults in household,What is the lead tenant's age?,The following soft validation was confirmed: You told us this person is aged %{age} years and retired. The minimum expected retirement age for %{gender} in England is %{age}.,Which of these best describes the lead tenant's gender identity?,What is the lead tenant's ethnic group?,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant's nationality?,Which of these best describes the lead tenant's working situation?,Are the details of tenant 2 known?,What is person 2's relationship to the lead tenant?,"The following soft validation was confirmed: You said that [person X]'s relationship to lead tenant is partner, and that their age is [AGEX]. Are you sure this is correct?",The following soft validation was confirmed: You said that more than one person in the household is the partner of the lead tenant. Are you sure this is correct?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,Are the details of tenant 3 known?,What is person 3's relationship to the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,Are the details of tenant 4 known?,What is person 4's relationship to the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,Are the details of tenant 5 known?,What is person 5's relationship to the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,Are the details of tenant 6 known?,What is person 6's relationship to the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,Are the details of tenant 7 known?,What is person 7's relationship to the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,Are the details of tenant 8 known?,What is person 8's relationship to the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",The soft validation was confirmed,Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Was the local authority of the household's last settled home known?,The internal value to indicate if the previous LA was inferred from the postcode,Previous location LA name,Previous location's ONS LA Code,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,Was the letting made under the Accessible Register?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",What was the source of referral for this letting?,"The following soft validation was confirmed: Are you sure? This is a general needs log, and this referral type is for supported housing.",Do you know the household's combined income after tax?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Populated when someone hits the soft validation and confirmed in the service,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,Is this accommodation a care home?,"If this is a care home, how much does the household pay every [time period]?",Weekly care home charge,Populated when the soft validation and confirmed in the service,What is the basic rent?,Weekly rent,Populated when the soft validation and confirmed in the service,What is the service charge?,Weekly service charge,What is the personal service charge?,Weekly personal service charge,What is the support charge?,Weekly support charge,Total charge to the tenant,Weekly total charge to the tenant,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,Populated when the soft validation and confirmed in the service,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Can you estimate the outstanding amount?,Estimated outstanding amount,Weekly total rent shortfall charge for tenant receiving housing benefit,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? id,status,duplicate_set_id,created_by,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,uprn,address_line1,address_line2,town_or_city,county,postcode_full,is_la_inferred,la_label,la,uprn_known,uprn_selection,address_search_value_check,address_line1_input,postcode_full_input,address_line1_as_entered,address_line2_as_entered,town_or_city_as_entered,county_as_entered,postcode_full_as_entered,la_as_entered,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,unittype_gn,builtype,wchair,beds,voiddate,vacdays,void_date_value_check,majorrepairs,mrcdate,major_repairs_date_value_check,joint,startertenancy,tenancy,tenancyother,tenancylength,sheltered,hhmemb,pregnancy_value_check,refused,hhtype,totchild,totelder,totadult,age1,retirement_value_check,sex1,ethnic_group,ethnic,nationality_all,ecstat1,details_known_2,relat2,partner_under_16_value_check,multiple_partners_value_check,age2,sex2,ecstat2,details_known_3,relat3,age3,sex3,ecstat3,details_known_4,relat4,age4,sex4,ecstat4,details_known_5,relat5,age5,sex5,ecstat5,details_known_6,relat6,age6,sex6,ecstat6,details_known_7,relat7,age7,sex7,ecstat7,details_known_8,relat8,age8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,reasonother_value_check,prevten,homeless,ppcodenk,ppostcode_full,previous_la_known,is_previous_la_inferred,prevloc_label,prevloc,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,accessible_register,letting_allocation_none,referral,referral_value_check,net_income_known,incref,incfreq,earnings,net_income_value_check,hb,has_benefits,benefits,household_charge,nocharge,period,is_carehome,chcharge,wchchrg,carehome_charges_value_check,brent,wrent,rent_value_check,scharge,wscharge,pscharge,wpschrge,supcharg,wsupchrg,tcharge,wtcharge,scharge_value_check,pscharge_value_check,supcharg_value_check,hbrentshortfall,tshortfall_known,tshortfall,wtshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate ,in_progress,,s.port@jeemayle.com,s.port@jeemayle.com,false,2024-04-01T00:00:00+01:00,,2024-04-01T00:00:00+01:00,single log,2024,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2024-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,,Address line 1,,London,,NW9 5LL,No,Barnet,E09000003,No,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,No,Affordable rent basis,Tenant abandoned property,No,House,Purpose built,Yes,3,2024-03-30,1,,Yes,2024-03-31,,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,,4,,Yes,4,0,0,2,35,,Female,White,Irish,Australia,Other,Yes,Partner,,,32,Male,Not seeking work,No,Prefers not to say,Not known,Prefers not to say,Prefers not to say,Yes,Person prefers not to say,Not known,Person prefers not to say,Person prefers not to say,,,,,,,,,,,,,,,,,,,,,Yes – the person is a current or former regular,No – they left up to and including 5 years ago,Yes,No,Yes,Fully wheelchair accessible housing,Yes,No,No,No,No,No,No,Yes,No,No,Yes,No,No,No,No,No,No,No,Less than 1 year,1 year but under 2 years,Loss of tied accommodation,,,Other supported housing,No,Yes,TN23 6LZ,Yes,No,Ashford,E07000105,Yes,,Yes,,,,No,No,Yes,No,,Tenant applied directly (no referral or nomination),,Yes,No,Weekly,268,,Universal Credit housing element,Yes,All,,No,Every 2 weeks,,,,,200.0,100.0,,50.0,25.0,40.0,20.0,35.0,17.5,325.0,162.5,,,,Yes,Yes,12.0,6.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_non_support_codes_23.csv b/spec/fixtures/files/lettings_log_csv_export_non_support_codes_23.csv index 3c8f4ea7c..e3e6a3ca6 100644 --- a/spec/fixtures/files/lettings_log_csv_export_non_support_codes_23.csv +++ b/spec/fixtures/files/lettings_log_csv_export_non_support_codes_23.csv @@ -1,3 +1,2 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Is the UPRN known?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,What is the property's local authority?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,How many times was the property offered between becoming vacant and this letting?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,Is this letting in sheltered accommodation?,Has the tenant seen the MHCLG privacy notice?,How many people live in the household at this letting?,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8",What is the lead tenant's age?,Which of these best describes the lead tenant's gender identity?,What is the lead tenant's ethnic group?,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant's nationality?,Which of these best describes the lead tenant's working situation?,What is person 2's relationship to the lead tenant?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,What is person 3's relationship to the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,What is person 4's relationship to the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,What is person 5's relationship to the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,What is person 6's relationship to the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,What is person 7's relationship to the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,What is person 8's relationship to the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Previous location LA name,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",What was the source of referral for this letting?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,Is this accommodation a care home?,"If this is a care home, how much does the household pay every [time period]?",Weekly care home charge,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge to the tenant,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Estimated outstanding amount,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? id,status,duplicate_set_id,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,uprn_known,uprn,address_line1,address_line2,town_or_city,county,postcode_full,la_label,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,offered,unittype_gn,builtype,wchair,beds,voiddate,vacdays,majorrepairs,mrcdate,joint,startertenancy,tenancy,tenancyother,tenancylength,sheltered,declaration,hhmemb,refused,age1,sex1,ethnic_group,ethnic,national,ecstat1,relat2,age2,sex2,ecstat2,relat3,age3,sex3,ecstat3,relat4,age4,sex4,ecstat4,relat5,age5,sex5,ecstat5,relat6,age6,sex6,ecstat6,relat7,age7,sex7,ecstat7,relat8,age8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,prevten,homeless,ppcodenk,ppostcode_full,prevloc_label,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,letting_allocation_none,referral,incref,incfreq,earnings,hb,has_benefits,benefits,household_charge,nocharge,period,is_carehome,chcharge,wchchrg,brent,scharge,pscharge,supcharg,tcharge,hbrentshortfall,tshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate ,completed,,choreographer@owtluk.com,false,2023-11-26T00:00:00+00:00,,2023-11-26T00:00:00+00:00,1,2023,MHCLG,MHCLG,1,7,0,2023-11-26,2,2,,,2,HIJKLMN,ABCDEFG,0,,Address line 1,,London,,NW9 5LL,Barnet,0,2,6,2,2,7,1,1,3,2023-11-24,1,1,2023-11-25,3,1,4,,2,,1,4,1,35,F,0,2,13,0,P,32,M,6,R,-9,R,10,R,-9,R,10,,,,,,,,,,,,,,,,,1,4,1,2,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,2,7,4,,6,1,0,TN23 6LZ,Ashford,1,0,1,0,0,0,0,0,1,,2,0,1,268,6,1,1,,0,2,,,,200.0,50.0,40.0,35.0,325.0,1,12.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_non_support_codes_24.csv b/spec/fixtures/files/lettings_log_csv_export_non_support_codes_24.csv index 04dfd87da..33793d5f6 100644 --- a/spec/fixtures/files/lettings_log_csv_export_non_support_codes_24.csv +++ b/spec/fixtures/files/lettings_log_csv_export_non_support_codes_24.csv @@ -1,3 +1,2 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is the UPRN known?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,What is the property's local authority?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,Is this letting in sheltered accommodation?,How many people live in the household at this letting?,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8",What is the lead tenant's age?,Which of these best describes the lead tenant's gender identity?,What is the lead tenant's ethnic group?,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant's nationality?,Which of these best describes the lead tenant's working situation?,What is person 2's relationship to the lead tenant?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,What is person 3's relationship to the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,What is person 4's relationship to the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,What is person 5's relationship to the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,What is person 6's relationship to the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,What is person 7's relationship to the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,What is person 8's relationship to the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Previous location LA name,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,Was the letting made under the Accessible Register?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",What was the source of referral for this letting?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,Is this accommodation a care home?,"If this is a care home, how much does the household pay every [time period]?",Weekly care home charge,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge to the tenant,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Estimated outstanding amount,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? id,status,duplicate_set_id,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,uprn_known,uprn,address_line1,address_line2,town_or_city,county,postcode_full,la_label,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,unittype_gn,builtype,wchair,beds,voiddate,vacdays,majorrepairs,mrcdate,joint,startertenancy,tenancy,tenancyother,tenancylength,sheltered,hhmemb,refused,age1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,relat2,age2,sex2,ecstat2,relat3,age3,sex3,ecstat3,relat4,age4,sex4,ecstat4,relat5,age5,sex5,ecstat5,relat6,age6,sex6,ecstat6,relat7,age7,sex7,ecstat7,relat8,age8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,prevten,homeless,ppcodenk,ppostcode_full,prevloc_label,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,accessible_register,letting_allocation_none,referral,incref,incfreq,earnings,hb,has_benefits,benefits,household_charge,nocharge,period,is_carehome,chcharge,wchchrg,brent,scharge,pscharge,supcharg,tcharge,hbrentshortfall,tshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate ,in_progress,,choreographer@owtluk.com,false,2024-04-01T00:00:00+01:00,,2024-04-01T00:00:00+01:00,1,2024,,MHCLG,MHCLG,1,7,0,2024-04-01,2,2,,,2,HIJKLMN,ABCDEFG,1,0,,Address line 1,,London,,NW9 5LL,Barnet,0,2,6,2,7,1,1,3,2024-03-30,1,1,2024-03-31,3,1,4,,2,,4,1,35,F,0,2,36,0,P,32,M,6,R,-9,R,10,R,-9,R,10,,,,,,,,,,,,,,,,,1,4,1,2,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,2,7,4,,6,1,0,TN23 6LZ,Ashford,1,0,1,0,0,0,0,0,1,0,,2,0,1,268,6,1,1,,0,2,,,,200.0,50.0,40.0,35.0,325.0,1,12.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_non_support_labels_23.csv b/spec/fixtures/files/lettings_log_csv_export_non_support_labels_23.csv index 095625fc9..6c26d648f 100644 --- a/spec/fixtures/files/lettings_log_csv_export_non_support_labels_23.csv +++ b/spec/fixtures/files/lettings_log_csv_export_non_support_labels_23.csv @@ -1,3 +1,2 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Is the UPRN known?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,What is the property's local authority?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,How many times was the property offered between becoming vacant and this letting?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,Is this letting in sheltered accommodation?,Has the tenant seen the MHCLG privacy notice?,How many people live in the household at this letting?,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8",What is the lead tenant's age?,Which of these best describes the lead tenant's gender identity?,What is the lead tenant's ethnic group?,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant's nationality?,Which of these best describes the lead tenant's working situation?,What is person 2's relationship to the lead tenant?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,What is person 3's relationship to the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,What is person 4's relationship to the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,What is person 5's relationship to the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,What is person 6's relationship to the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,What is person 7's relationship to the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,What is person 8's relationship to the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Previous location LA name,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",What was the source of referral for this letting?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,Is this accommodation a care home?,"If this is a care home, how much does the household pay every [time period]?",Weekly care home charge,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge to the tenant,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Estimated outstanding amount,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? id,status,duplicate_set_id,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,uprn_known,uprn,address_line1,address_line2,town_or_city,county,postcode_full,la_label,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,offered,unittype_gn,builtype,wchair,beds,voiddate,vacdays,majorrepairs,mrcdate,joint,startertenancy,tenancy,tenancyother,tenancylength,sheltered,declaration,hhmemb,refused,age1,sex1,ethnic_group,ethnic,national,ecstat1,relat2,age2,sex2,ecstat2,relat3,age3,sex3,ecstat3,relat4,age4,sex4,ecstat4,relat5,age5,sex5,ecstat5,relat6,age6,sex6,ecstat6,relat7,age7,sex7,ecstat7,relat8,age8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,prevten,homeless,ppcodenk,ppostcode_full,prevloc_label,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,letting_allocation_none,referral,incref,incfreq,earnings,hb,has_benefits,benefits,household_charge,nocharge,period,is_carehome,chcharge,wchchrg,brent,scharge,pscharge,supcharg,tcharge,hbrentshortfall,tshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate ,completed,,choreographer@owtluk.com,false,2023-11-26T00:00:00+00:00,,2023-11-26T00:00:00+00:00,single log,2023,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2023-11-26,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,No,,Address line 1,,London,,NW9 5LL,Barnet,No,Affordable rent basis,Tenant abandoned property,No,2,House,Purpose built,Yes,3,2023-11-24,1,Yes,2023-11-25,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,,Yes,4,Yes,35,Female,White,Irish,Tenant prefers not to say,Other,Partner,32,Male,Not seeking work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,Person prefers not to say,Not known,Person prefers not to say,Person prefers not to say,,,,,,,,,,,,,,,,,Yes – the person is a current or former regular,No – they left up to and including 5 years ago,Yes,No,Yes,Fully wheelchair accessible housing,Yes,No,No,No,No,No,No,Yes,No,No,Yes,No,No,No,No,No,No,No,Less than 1 year,1 year but under 2 years,Loss of tied accommodation,,Other supported housing,No,Yes,TN23 6LZ,Ashford,Yes,,Yes,,,,No,No,Yes,,Tenant applied directly (no referral or nomination),No,Weekly,268,Universal Credit housing element,Yes,All,,No,Every 2 weeks,,,,200.0,50.0,40.0,35.0,325.0,Yes,12.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/lettings_log_csv_export_non_support_labels_24.csv b/spec/fixtures/files/lettings_log_csv_export_non_support_labels_24.csv index a63104c8f..785e55577 100644 --- a/spec/fixtures/files/lettings_log_csv_export_non_support_labels_24.csv +++ b/spec/fixtures/files/lettings_log_csv_export_non_support_labels_24.csv @@ -1,3 +1,2 @@ -Log ID,Status of log,ID of a set of duplicate logs,User the log is assigned to,Is the user in the assigned_to column the data protection officer?,Time and date the log was created,User who last updated the log,Time and date the log was last updated,Was the log submitted in-service or via bulk upload?,Year collection period opened,ID of a set of bulk uploaded logs,Which organisation owns this property?,Which organisation manages this letting?,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date?,"What is the rent type? (grouped into SR, IR or AR)",What is the rent type?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,Is this a London Affordable Rent letting?,What is the tenant code?,What is the property reference?,Has the tenant seen the MHCLG privacy notice?,Is the UPRN known?,"If known, property's UPRN",Address line 1,Address line 2,Town or City,County,Postcode,What is the property's local authority?,Is this the first time the property has been let as social housing?,What rent product was the property most recently let as?,What is the reason for the property being vacant?,Is this property new to the social rented sector?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date?,Number of days the property was vacant,Were any major repairs carried out during the void period?,What date were any major repairs completed on?,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,Is this letting in sheltered accommodation?,How many people live in the household at this letting?,"Where household characteristics have a 'Refused' option for some or all of: AGE1-AGE8, SEX1-SEX8, RELAT2-RELAT8, ECSTAT1-ECSTAT8",What is the lead tenant's age?,Which of these best describes the lead tenant's gender identity?,What is the lead tenant's ethnic group?,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant's nationality?,Which of these best describes the lead tenant's working situation?,What is person 2's relationship to the lead tenant?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,What is person 3's relationship to the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,What is person 4's relationship to the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,What is person 5's relationship to the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,What is person 6's relationship to the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,What is person 7's relationship to the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,What is person 8's relationship to the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,Does anybody in the household have any disabled access needs?,"What access needs do they have? (Fully wheelchair-accessible housing, Level access housing or Wheelchair access to essential rooms)",Disabled access needs a) Fully wheelchair-accessible housing,Disabled access needs b) Wheelchair access to essential rooms,Disabled access needs c) Level access housing,Disabled access needs f) Other disabled access needs,Disabled access needs g) No disabled access needs,Disabled access needs h) Don't know,Do they have any other disabled access needs?,Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant's main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Previous postcode unknown or previous accommodation was temporary,What is the postcode of the household's last settled home?,Previous location LA name,Was the household given reasonable preference by the local authority?,Reasonable preference reason - They were homeless or about to lose their home (within 56 days),"Reasonable preference reason - They were living in insanitary, overcrowded or unisatisfactory housing",Reasonable preference reason - They needed to move on medical and welfare reasons (including disability),Reasonable preference reason - They needed to move to avoid hardship to themselves or others,Reasonable preference reason - Don't Know,Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)?,Was the letting made under the Common Housing Register (CHR)?,Was the letting made under the Accessible Register?,"The letting was not allocated under CBL, CAP, CHR or Accessible Register.",What was the source of referral for this letting?,Was the household income refused?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"Does the tenant receive housing-related benefits? Yes if hb = Universal Credit housing element or Housing benefit, No if hb = Don't Know, Neither, Tenant prefers not to say or blank","How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,Does the household pay rent or other charges for the accommodation? - flag for when household_charge is answered no,How often does the household pay rent and other charges?,Is this accommodation a care home?,"If this is a care home, how much does the household pay every [time period]?",Weekly care home charge,What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge to the tenant,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",Estimated outstanding amount,What scheme does this letting belong to?,"From scheme code, we map to the scheme name",Does the scheme contain confidential information?,"What is this type of scheme? (Direct access hostel), Foyer, Housing for older people or Other supported housing",Is this scheme registered under the Care Standards Act 2000?,Which organisation owns the housing stock for this scheme?,What client group is this scheme intended for?,Does this scheme provide for another client group?,What is the other client group?,What support does this scheme provide?,Intended length of stay,Date scheme was created,Which location is this letting for?,What is the postcode for this location?,What is the name of this location?,How many units are at this location?,What is the most common type of unit at this location?,What are the mobility standards for the majority of the units in this location?,What is the local authority of this postcode?,When did the first property in this location become available under this scheme? id,status,duplicate_set_id,assigned_to,is_dpo,created_at,updated_by,updated_at,creation_method,collection_start_year,bulk_upload_id,owning_organisation_name,managing_organisation_name,needstype,lettype,renewal,startdate,renttype,renttype_detail,irproduct,irproduct_other,lar,tenancycode,propcode,declaration,uprn_known,uprn,address_line1,address_line2,town_or_city,county,postcode_full,la_label,first_time_property_let_as_social_housing,unitletas,rsnvac,newprop,unittype_gn,builtype,wchair,beds,voiddate,vacdays,majorrepairs,mrcdate,joint,startertenancy,tenancy,tenancyother,tenancylength,sheltered,hhmemb,refused,age1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,relat2,age2,sex2,ecstat2,relat3,age3,sex3,ecstat3,relat4,age4,sex4,ecstat4,relat5,age5,sex5,ecstat5,relat6,age6,sex6,ecstat6,relat7,age7,sex7,ecstat7,relat8,age8,sex8,ecstat8,armedforces,leftreg,reservist,preg_occ,housingneeds,housingneeds_type,housingneeds_a,housingneeds_b,housingneeds_c,housingneeds_f,housingneeds_g,housingneeds_h,housingneeds_other,illness,illness_type_4,illness_type_5,illness_type_2,illness_type_6,illness_type_7,illness_type_3,illness_type_9,illness_type_8,illness_type_1,illness_type_10,layear,waityear,reason,reasonother,prevten,homeless,ppcodenk,ppostcode_full,prevloc_label,reasonpref,rp_homeless,rp_insan_unsat,rp_medwel,rp_hardship,rp_dontknow,cbl,cap,chr,accessible_register,letting_allocation_none,referral,incref,incfreq,earnings,hb,has_benefits,benefits,household_charge,nocharge,period,is_carehome,chcharge,wchchrg,brent,scharge,pscharge,supcharg,tcharge,hbrentshortfall,tshortfall,scheme_code,scheme_service_name,scheme_confidential,SCHTYPE,scheme_registered_under_care_act,scheme_owning_organisation_name,scheme_primary_client_group,scheme_has_other_client_group,scheme_secondary_client_group,scheme_support_type,scheme_intended_stay,scheme_created_at,location_code,location_postcode,location_name,location_units,location_type_of_unit,location_mobility_type,location_local_authority,location_startdate ,in_progress,,choreographer@owtluk.com,false,2024-04-01T00:00:00+01:00,,2024-04-01T00:00:00+01:00,single log,2024,,MHCLG,MHCLG,General needs,Affordable rent general needs local authority,No,2024-04-01,Affordable Rent,Affordable Rent,,,No,HIJKLMN,ABCDEFG,Yes,No,,Address line 1,,London,,NW9 5LL,Barnet,No,Affordable rent basis,Tenant abandoned property,No,House,Purpose built,Yes,3,2024-03-30,1,Yes,2024-03-31,Don’t know,Yes,Assured Shorthold Tenancy (AST) – Fixed term,,2,,4,Yes,35,Female,White,Irish,Australia,Other,Partner,32,Male,Not seeking work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,Person prefers not to say,Not known,Person prefers not to say,Person prefers not to say,,,,,,,,,,,,,,,,,Yes – the person is a current or former regular,No – they left up to and including 5 years ago,Yes,No,Yes,Fully wheelchair accessible housing,Yes,No,No,No,No,No,No,Yes,No,No,Yes,No,No,No,No,No,No,No,Less than 1 year,1 year but under 2 years,Loss of tied accommodation,,Other supported housing,No,Yes,TN23 6LZ,Ashford,Yes,,Yes,,,,No,No,Yes,No,,Tenant applied directly (no referral or nomination),No,Weekly,268,Universal Credit housing element,Yes,All,,No,Every 2 weeks,,,,200.0,50.0,40.0,35.0,325.0,Yes,12.0,,,,,,,,,,,,,,,,,,,, diff --git a/spec/fixtures/files/sales_logs_csv_export_codes_23.csv b/spec/fixtures/files/sales_logs_csv_export_codes_23.csv index 198f89e20..162debef9 100644 --- a/spec/fixtures/files/sales_logs_csv_export_codes_23.csv +++ b/spec/fixtures/files/sales_logs_csv_export_codes_23.csv @@ -1,3 +1,2 @@ -Log ID,Status of log,ID of a set of duplicate logs,Time and date the log was created,Time and date the log was last updated,The ID on the old service,Year collection period opened,Was the log submitted in-service or via bulk upload?,Is the user in the created_by column the data protection officer?,Which organisation owned this property before the sale?,Which organisation reported the sale?,User that created the log,User the log is assigned to,Day of sale completion date,Month of sale completion date,Year of sale completion date,What is the purchaser code?,Was this purchase made through an ownership scheme?,What is the type of shared ownership/discounted ownership/outright sale?,"If type = 'Other', what is the type of outright sale?",Is the buyer a company?,Will the buyer(s) live in the property?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,How many bedrooms does the property have?,What type of unit is the property?,Which type of building is the property?,What is the UPRN of the property?,We found an address that might be this property. Is this the property address?,Address line 1,Address line 2,Town/City,County,Part 1 of the property's postcode,Part 2 of the property's postcode,LA code,LA name,Is the property built or adapted to wheelchair-user standards?,Did you interview the buyer to answer these questions?,Has the buyer seen the MHCLG privacy notice?,What is buyer 1's age?,Which of these best describes buyer 1's gender identity?,What is buyer 1's ethnic group?,Which of the following best describes buyer 1's ethnic background?,What is buyer 1's nationality?,Which of these best describes buyer 1's working situation?,Will buyer 1 live in the property?,What is buyer 2 or person 2's relationship to buyer 1?,What is buyer 2 or person 2's age?,Which of these best describes buyer 2 or person 2's gender identity?,What is buyer 2's ethnic group?,Which of the following best describes buyer 2's ethnic background?,What is buyer 2's nationality?,What is buyer 2 or person 2's working situation?,Will buyer 2 live in the property?,"Besides the buyer(s), how many other people live or will live in the property?",What is person 3's relationship to buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,What is person 4's relationship to buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,What is person 5's relationship to buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,What is person 6's relationship to buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,What was buyer 1's previous tenure?,Do you know the postcode of buyer 1's last settled accommodation?,Part 1 of postcode of buyer 1's last settled accommodation,Part 2 of postcode of buyer 1's last settled accommodation,Do you know the local authority of buyer 1's last settled accommodation?,The local authority code of buyer 1's last settled accommodation,The local authority name of buyer 1's last settled accommodation,Was the buyer registered with their PRP (HA)?,Was the buyer registered with another PRP (HA)?,Was the buyer registered with the local authority?,Was the buyer registered with a Help to Buy agent?,"Populated if pregyrha, pregother, pregla and pregghb are blank","At the time of purchase, was buyer 2 living at the same address as buyer 1?",What was buyer 2's previous tenure?,Have any of the buyers ever served as a regular in the UK armed forces?,Is the buyer still serving in the UK armed forces?,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?,Does anyone in the household consider themselves to have a disability?,Does anyone in the household use a wheelchair?,Is buyer 1's annual income known?,What is buyer 1's annual income?,Was buyer 1's income used for a mortgage application?,Is buyer 1's annual income known?,What is buyer 2's annual income?,Was buyer 2's income used for a mortgage application?,Were the buyers receiving any of these housing-related benefits immediately before buying this property?,Is the the total amount the buyers had in savings known?,What is the total amount the buyers had in savings before they paid any deposit for the property?,Have any of the buyers previously owned a property?,Was the previous property under shared ownership?,How long did the buyer(s) live in the property before purchasing it?,Is this a staircasing transaction?,What percentage of the property has been bought in this staircasing transaction?,What percentage of the property do the buyers now own in total?,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?,Is this a resale?,Day of the exchange of contracts,Month of the exchange of contracts,Year of the exchange of contracts,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,Was the household rehoused under a local authority nominations agreement?,"Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?",How many bedrooms did the buyer's previous property have?,What was the previous property type?,What was the rent type of buyer's previous tenure?,What is the full purchase price?,Populated if a soft validation is confirmed.,What was the initial percentage equity stake purchased?,Was a mortgage used to buy this property?,What is the mortgage amount?,What is the name of the mortgage lender?,"If mortgagelender = 'Other', what is the name of the mortgage lender?",What is the length of the mortgage in years?,Does this include any extra borrowing?,How much was the cash deposit paid on the property?,How much cash discount was given through Social Homebuy?,What is the basic monthly rent?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property?,Populated if a soft validation is confirmed.,What was the percentage discount?,"What was the amount of any loan, grant, discount or subsidy given?" ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,FORM,COLLECTIONYEAR,CREATIONMETHOD,DATAPROTECT,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,BEDS,PROPTYPE,BUILTYPE,UPRN,UPRNCONFIRMED,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,PCODE1,PCODE2,LA,LANAME,WCHAIR,NOINT,PRIVACYNOTICE,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONAL,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONAL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT ,completed,,2023-12-08T00:00:00+00:00,2024-01-01T00:00:00+00:00,,2023,1,false,MHCLG,MHCLG,billyboy@eyeklaud.com,billyboy@eyeklaud.com,8,12,2023,,2,8,,,,1,1,2,1,1,,,Address line 1,,Town or city,,SW1A,1AA,E09000033,Westminster,1,2,1,30,X,17,17,18,1,1,P,35,X,17,,13,1,1,3,C,14,X,,X,-9,X,3,R,-9,R,10,,,,,1,1,,,0,,,1,1,1,1,,3,,1,4,5,1,1,0,10000,1,0,10000,1,4,1,,1,2,10,,,,,,,,,,,,,,,,,110000.0,,,1,20000.0,5,,10,1,80000.0,,,1,100.0,,,10000.0 diff --git a/spec/fixtures/files/sales_logs_csv_export_codes_24.csv b/spec/fixtures/files/sales_logs_csv_export_codes_24.csv index 6cacd2ef2..397b44b17 100644 --- a/spec/fixtures/files/sales_logs_csv_export_codes_24.csv +++ b/spec/fixtures/files/sales_logs_csv_export_codes_24.csv @@ -1,3 +1,2 @@ -Log ID,Status of log,ID of a set of duplicate logs,Time and date the log was created,Time and date the log was last updated,Year collection period opened,Was the log submitted in-service or via bulk upload?,ID of a set of bulk uploaded logs,Is the user in the created_by column the data protection officer?,Which organisation owned this property before the sale?,Which organisation reported the sale?,User that created the log,User the log is assigned to,Day of sale completion date,Month of sale completion date,Year of sale completion date,What is the purchaser code?,Was this purchase made through an ownership scheme?,What is the type of shared ownership/discounted ownership/outright sale?,"If type = 'Other', what is the type of outright sale?",Is the buyer a company?,Will the buyer(s) live in the property?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,Did you interview the buyer to answer these questions?,Has the buyer seen the MHCLG privacy notice?,What is the UPRN of the property?,Address line 1,Address line 2,Town/City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,LA name,LA code,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,How many bedrooms does the property have?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,What is buyer 1's age?,Which of these best describes buyer 1's gender identity?,What is buyer 1's ethnic group?,Which of the following best describes buyer 1's ethnic background?,What is buyer 1's nationality?,Which of these best describes buyer 1's working situation?,Will buyer 1 live in the property?,What is buyer 2 or person 2's relationship to buyer 1?,What is buyer 2 or person 2's age?,Which of these best describes buyer 2 or person 2's gender identity?,What is buyer 2's ethnic group?,Which of the following best describes buyer 2's ethnic background?,What is buyer 2's nationality?,What is buyer 2 or person 2's working situation?,Will buyer 2 live in the property?,"Besides the buyer(s), how many other people live or will live in the property?",What is person 3's relationship to buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,What is person 4's relationship to buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,What is person 5's relationship to buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,What is person 6's relationship to buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,What was buyer 1's previous tenure?,Do you know the postcode of buyer 1's last settled accommodation?,Part 1 of postcode of buyer 1's last settled accommodation,Part 2 of postcode of buyer 1's last settled accommodation,Do you know the local authority of buyer 1's last settled accommodation?,The local authority code of buyer 1's last settled accommodation,The local authority name of buyer 1's last settled accommodation,Was the buyer registered with their PRP (HA)?,Was the buyer registered with another PRP (HA)?,Was the buyer registered with the local authority?,Was the buyer registered with a Help to Buy agent?,"Populated if pregyrha, pregother, pregla and pregghb are blank","At the time of purchase, was buyer 2 living at the same address as buyer 1?",What was buyer 2's previous tenure?,Have any of the buyers ever served as a regular in the UK armed forces?,Is the buyer still serving in the UK armed forces?,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?,Does anyone in the household consider themselves to have a disability?,Does anyone in the household use a wheelchair?,Is buyer 1's annual income known?,What is buyer 1's annual income?,Was buyer 1's income used for a mortgage application?,Is buyer 1's annual income known?,What is buyer 2's annual income?,Was buyer 2's income used for a mortgage application?,Were the buyers receiving any of these housing-related benefits immediately before buying this property?,Is the the total amount the buyers had in savings known?,What is the total amount the buyers had in savings before they paid any deposit for the property?,Have any of the buyers previously owned a property?,Was the previous property under shared ownership?,How long did the buyer(s) live in the property before purchasing it?,Is this a staircasing transaction?,What percentage of the property has been bought in this staircasing transaction?,What percentage of the property do the buyers now own in total?,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?,Is this a resale?,Day of the exchange of contracts,Month of the exchange of contracts,Year of the exchange of contracts,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,Was the household rehoused under a local authority nominations agreement?,"Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?",How many bedrooms did the buyer's previous property have?,What was the previous property type?,What was the rent type of buyer's previous tenure?,What is the full purchase price?,Populated if a soft validation is confirmed.,What was the initial percentage equity stake purchased?,Was a mortgage used to buy this property?,What is the mortgage amount?,What is the name of the mortgage lender?,"If mortgagelender = 'Other', what is the name of the mortgage lender?",What is the length of the mortgage in years?,Does this include any extra borrowing?,How much was the cash deposit paid on the property?,How much cash discount was given through Social Homebuy?,What is the basic monthly rent?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property?,Populated if a soft validation is confirmed.,What was the percentage discount?,"What was the amount of any loan, grant, discount or subsidy given?" ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,COLLECTIONYEAR,CREATIONMETHOD,BULKUPLOADID,DATAPROTECT,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,NOINT,PRIVACYNOTICE,UPRN,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,POSTCODE,ISLAINFERRED,LANAME,LA,UPRNSELECTED,ADDRESS_SEARCH_VALUE_CHECK,ADDRESS1INPUT,POSTCODEINPUT,BULKADDRESS1,BULKADDRESS2,BULKTOWNCITY,BULKCOUNTY,BULKPOSTCODE,BULKLA,BEDS,PROPTYPE,BUILTYPE,WCHAIR,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONALITYALL1,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONALITYALL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT ,completed,,2024-05-01T00:00:00+01:00,2024-05-01T00:00:00+01:00,2024,1,,false,MHCLG,MHCLG,billyboy@eyeklaud.com,billyboy@eyeklaud.com,1,5,2024,,2,8,,,,1,1,2,1,1,"1, Test Street",,Test Town,,AA1 1AA,true,Westminster,E09000033,,,Address line 1,SW1A 1AA,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,2,1,1,1,30,X,17,17,826,1,1,P,35,X,17,,826,1,1,3,C,14,X,9,X,-9,X,3,R,-9,R,10,,,,,1,0,SW1A,1AA,1,E09000033,Westminster,1,1,1,1,,3,,1,4,5,1,1,0,10000,1,0,10000,1,4,1,,1,2,10,,,,,,,,,,,,,,,,,110000.0,,,1,20000.0,5,,10,1,80000.0,,,1,100.0,,,10000.0 diff --git a/spec/fixtures/files/sales_logs_csv_export_labels_23.csv b/spec/fixtures/files/sales_logs_csv_export_labels_23.csv index 10850a9db..0f62016dc 100644 --- a/spec/fixtures/files/sales_logs_csv_export_labels_23.csv +++ b/spec/fixtures/files/sales_logs_csv_export_labels_23.csv @@ -1,3 +1,2 @@ -Log ID,Status of log,ID of a set of duplicate logs,Time and date the log was created,Time and date the log was last updated,The ID on the old service,Year collection period opened,Was the log submitted in-service or via bulk upload?,Is the user in the created_by column the data protection officer?,Which organisation owned this property before the sale?,Which organisation reported the sale?,User that created the log,User the log is assigned to,Day of sale completion date,Month of sale completion date,Year of sale completion date,What is the purchaser code?,Was this purchase made through an ownership scheme?,What is the type of shared ownership/discounted ownership/outright sale?,"If type = 'Other', what is the type of outright sale?",Is the buyer a company?,Will the buyer(s) live in the property?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,How many bedrooms does the property have?,What type of unit is the property?,Which type of building is the property?,What is the UPRN of the property?,We found an address that might be this property. Is this the property address?,Address line 1,Address line 2,Town/City,County,Part 1 of the property's postcode,Part 2 of the property's postcode,LA code,LA name,Is the property built or adapted to wheelchair-user standards?,Did you interview the buyer to answer these questions?,Has the buyer seen the MHCLG privacy notice?,What is buyer 1's age?,Which of these best describes buyer 1's gender identity?,What is buyer 1's ethnic group?,Which of the following best describes buyer 1's ethnic background?,What is buyer 1's nationality?,Which of these best describes buyer 1's working situation?,Will buyer 1 live in the property?,What is buyer 2 or person 2's relationship to buyer 1?,What is buyer 2 or person 2's age?,Which of these best describes buyer 2 or person 2's gender identity?,What is buyer 2's ethnic group?,Which of the following best describes buyer 2's ethnic background?,What is buyer 2's nationality?,What is buyer 2 or person 2's working situation?,Will buyer 2 live in the property?,"Besides the buyer(s), how many other people live or will live in the property?",What is person 3's relationship to buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,What is person 4's relationship to buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,What is person 5's relationship to buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,What is person 6's relationship to buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,What was buyer 1's previous tenure?,Do you know the postcode of buyer 1's last settled accommodation?,Part 1 of postcode of buyer 1's last settled accommodation,Part 2 of postcode of buyer 1's last settled accommodation,Do you know the local authority of buyer 1's last settled accommodation?,The local authority code of buyer 1's last settled accommodation,The local authority name of buyer 1's last settled accommodation,Was the buyer registered with their PRP (HA)?,Was the buyer registered with another PRP (HA)?,Was the buyer registered with the local authority?,Was the buyer registered with a Help to Buy agent?,"Populated if pregyrha, pregother, pregla and pregghb are blank","At the time of purchase, was buyer 2 living at the same address as buyer 1?",What was buyer 2's previous tenure?,Have any of the buyers ever served as a regular in the UK armed forces?,Is the buyer still serving in the UK armed forces?,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?,Does anyone in the household consider themselves to have a disability?,Does anyone in the household use a wheelchair?,Is buyer 1's annual income known?,What is buyer 1's annual income?,Was buyer 1's income used for a mortgage application?,Is buyer 1's annual income known?,What is buyer 2's annual income?,Was buyer 2's income used for a mortgage application?,Were the buyers receiving any of these housing-related benefits immediately before buying this property?,Is the the total amount the buyers had in savings known?,What is the total amount the buyers had in savings before they paid any deposit for the property?,Have any of the buyers previously owned a property?,Was the previous property under shared ownership?,How long did the buyer(s) live in the property before purchasing it?,Is this a staircasing transaction?,What percentage of the property has been bought in this staircasing transaction?,What percentage of the property do the buyers now own in total?,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?,Is this a resale?,Day of the exchange of contracts,Month of the exchange of contracts,Year of the exchange of contracts,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,Was the household rehoused under a local authority nominations agreement?,"Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?",How many bedrooms did the buyer's previous property have?,What was the previous property type?,What was the rent type of buyer's previous tenure?,What is the full purchase price?,Populated if a soft validation is confirmed.,What was the initial percentage equity stake purchased?,Was a mortgage used to buy this property?,What is the mortgage amount?,What is the name of the mortgage lender?,"If mortgagelender = 'Other', what is the name of the mortgage lender?",What is the length of the mortgage in years?,Does this include any extra borrowing?,How much was the cash deposit paid on the property?,How much cash discount was given through Social Homebuy?,What is the basic monthly rent?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property?,Populated if a soft validation is confirmed.,What was the percentage discount?,"What was the amount of any loan, grant, discount or subsidy given?" ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,FORM,COLLECTIONYEAR,CREATIONMETHOD,DATAPROTECT,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,BEDS,PROPTYPE,BUILTYPE,UPRN,UPRNCONFIRMED,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,PCODE1,PCODE2,LA,LANAME,WCHAIR,NOINT,PRIVACYNOTICE,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONAL,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONAL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT ,completed,,2023-12-08T00:00:00+00:00,2024-01-01T00:00:00+00:00,,2023,single log,false,MHCLG,MHCLG,billyboy@eyeklaud.com,billyboy@eyeklaud.com,8,12,2023,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,2,Flat or maisonette,Purpose built,,,Address line 1,,Town or city,,SW1A,1AA,E09000033,Westminster,Yes,Yes,1,30,Non-binary,Buyer prefers not to say,17,United Kingdom,Full-time - 30 hours or more,Yes,Partner,35,Non-binary,Buyer prefers not to say,,Buyer prefers not to say,Full-time - 30 hours or more,Yes,3,Child,14,Non-binary,,Other,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,Local authority tenant,No,,,No,,,1,1,1,1,,Don't know,,Yes,Yes,No,Yes,Yes,Yes,10000,Yes,Yes,10000,Yes,Don’t know ,No,,Yes,No,10,,,,,,,,,,,,,,,,,110000.0,,,Yes,20000.0,Cambridge Building Society,,10,Yes,80000.0,,,Yes,100.0,,,10000.0 diff --git a/spec/fixtures/files/sales_logs_csv_export_labels_24.csv b/spec/fixtures/files/sales_logs_csv_export_labels_24.csv index 3fc32f421..9c4daf5a6 100644 --- a/spec/fixtures/files/sales_logs_csv_export_labels_24.csv +++ b/spec/fixtures/files/sales_logs_csv_export_labels_24.csv @@ -1,3 +1,2 @@ -Log ID,Status of log,ID of a set of duplicate logs,Time and date the log was created,Time and date the log was last updated,Year collection period opened,Was the log submitted in-service or via bulk upload?,ID of a set of bulk uploaded logs,Is the user in the created_by column the data protection officer?,Which organisation owned this property before the sale?,Which organisation reported the sale?,User that created the log,User the log is assigned to,Day of sale completion date,Month of sale completion date,Year of sale completion date,What is the purchaser code?,Was this purchase made through an ownership scheme?,What is the type of shared ownership/discounted ownership/outright sale?,"If type = 'Other', what is the type of outright sale?",Is the buyer a company?,Will the buyer(s) live in the property?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,Did you interview the buyer to answer these questions?,Has the buyer seen the MHCLG privacy notice?,"What is the UPRN of the property?",Address line 1,Address line 2,Town/City,County,Postcode,The internal value to indicate if the LA was inferred from the postcode,LA name,LA code,UPRN of the address selected,Was the 'No address found' page seen?,Address line 1 input from address matching feature,Postcode input from address matching feature,Address line 1 entered in bulk upload file,Address line 2 entered in bulk upload file,Town or city entered in bulk upload file,County entered in bulk upload file,Postcode entered in bulk upload file,Local authority entered in bulk upload file,How many bedrooms does the property have?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,What is buyer 1's age?,Which of these best describes buyer 1's gender identity?,What is buyer 1's ethnic group?,Which of the following best describes buyer 1's ethnic background?,What is buyer 1's nationality?,Which of these best describes buyer 1's working situation?,Will buyer 1 live in the property?,What is buyer 2 or person 2's relationship to buyer 1?,What is buyer 2 or person 2's age?,Which of these best describes buyer 2 or person 2's gender identity?,What is buyer 2's ethnic group?,Which of the following best describes buyer 2's ethnic background?,What is buyer 2's nationality?,What is buyer 2 or person 2's working situation?,Will buyer 2 live in the property?,"Besides the buyer(s), how many other people live or will live in the property?",What is person 3's relationship to buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,What is person 4's relationship to buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,What is person 5's relationship to buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,What is person 6's relationship to buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,What was buyer 1's previous tenure?,Do you know the postcode of buyer 1's last settled accommodation?,Part 1 of postcode of buyer 1's last settled accommodation,Part 2 of postcode of buyer 1's last settled accommodation,Do you know the local authority of buyer 1's last settled accommodation?,The local authority code of buyer 1's last settled accommodation,The local authority name of buyer 1's last settled accommodation,Was the buyer registered with their PRP (HA)?,Was the buyer registered with another PRP (HA)?,Was the buyer registered with the local authority?,Was the buyer registered with a Help to Buy agent?,"Populated if pregyrha, pregother, pregla and pregghb are blank","At the time of purchase, was buyer 2 living at the same address as buyer 1?",What was buyer 2's previous tenure?,Have any of the buyers ever served as a regular in the UK armed forces?,Is the buyer still serving in the UK armed forces?,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?,Does anyone in the household consider themselves to have a disability?,Does anyone in the household use a wheelchair?,Is buyer 1's annual income known?,What is buyer 1's annual income?,Was buyer 1's income used for a mortgage application?,Is buyer 1's annual income known?,What is buyer 2's annual income?,Was buyer 2's income used for a mortgage application?,Were the buyers receiving any of these housing-related benefits immediately before buying this property?,Is the the total amount the buyers had in savings known?,What is the total amount the buyers had in savings before they paid any deposit for the property?,Have any of the buyers previously owned a property?,Was the previous property under shared ownership?,How long did the buyer(s) live in the property before purchasing it?,Is this a staircasing transaction?,What percentage of the property has been bought in this staircasing transaction?,What percentage of the property do the buyers now own in total?,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?,Is this a resale?,Day of the exchange of contracts,Month of the exchange of contracts,Year of the exchange of contracts,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,Was the household rehoused under a local authority nominations agreement?,"Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?",How many bedrooms did the buyer's previous property have?,What was the previous property type?,What was the rent type of buyer's previous tenure?,What is the full purchase price?,Populated if a soft validation is confirmed.,What was the initial percentage equity stake purchased?,Was a mortgage used to buy this property?,What is the mortgage amount?,What is the name of the mortgage lender?,"If mortgagelender = 'Other', what is the name of the mortgage lender?",What is the length of the mortgage in years?,Does this include any extra borrowing?,How much was the cash deposit paid on the property?,How much cash discount was given through Social Homebuy?,What is the basic monthly rent?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property?,Populated if a soft validation is confirmed.,What was the percentage discount?,"What was the amount of any loan, grant, discount or subsidy given?" ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,COLLECTIONYEAR,CREATIONMETHOD,BULKUPLOADID,DATAPROTECT,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,NOINT,PRIVACYNOTICE,UPRN,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,POSTCODE,ISLAINFERRED,LANAME,LA,UPRNSELECTED,ADDRESS_SEARCH_VALUE_CHECK,ADDRESS1INPUT,POSTCODEINPUT,BULKADDRESS1,BULKADDRESS2,BULKTOWNCITY,BULKCOUNTY,BULKPOSTCODE,BULKLA,BEDS,PROPTYPE,BUILTYPE,WCHAIR,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONALITYALL1,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONALITYALL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT ,completed,,2024-05-01T00:00:00+01:00,2024-05-01T00:00:00+01:00,2024,single log,,false,MHCLG,MHCLG,billyboy@eyeklaud.com,billyboy@eyeklaud.com,1,5,2024,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,Yes,1,1,"1, Test Street",,Test Town,,AA1 1AA,Yes,Westminster,E09000033,,,Address line 1,SW1A 1AA,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,2,Flat or maisonette,Purpose built,Yes,30,Non-binary,Buyer prefers not to say,17,United Kingdom,Full-time - 30 hours or more,Yes,Partner,35,Non-binary,Buyer prefers not to say,,United Kingdom,Full-time - 30 hours or more,Yes,3,Child,14,Non-binary,Child under 16,Other,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,Local authority tenant,Yes,AA1,1AA,Yes,E09000033,Westminster,1,1,1,1,,Don't know,,Yes,Yes,No,Yes,Yes,Yes,10000,Yes,Yes,10000,Yes,Don’t know ,No,,Yes,No,10,,,,,,,,,,,,,,,,,110000.0,,,Yes,20000.0,Cambridge Building Society,,10,Yes,80000.0,,,Yes,100.0,,,10000.0 diff --git a/spec/fixtures/files/sales_logs_csv_export_non_support_labels_24.csv b/spec/fixtures/files/sales_logs_csv_export_non_support_labels_24.csv index 8c5943c21..02f2b664c 100644 --- a/spec/fixtures/files/sales_logs_csv_export_non_support_labels_24.csv +++ b/spec/fixtures/files/sales_logs_csv_export_non_support_labels_24.csv @@ -1,3 +1,2 @@ -Log ID,Status of log,ID of a set of duplicate logs,Time and date the log was created,Time and date the log was last updated,Year collection period opened,Was the log submitted in-service or via bulk upload?,,Is the user in the assigned_to column the data protection officer?,Which organisation owned this property before the sale?,Which organisation reported the sale?,User the log is assigned to,Day of sale completion date,Month of sale completion date,Year of sale completion date,What is the purchaser code?,Was this purchase made through an ownership scheme?,What is the type of shared ownership/discounted ownership/outright sale?,"If type = 'Other', what is the type of outright sale?",Is the buyer a company?,Will the buyer(s) live in the property?,Is this a joint purchase?,Are there more than 2 joint buyers of this property?,Did you interview the buyer to answer these questions?,Has the buyer seen the MHCLG privacy notice?,What is the UPRN of the property?,We found an address that might be this property. Is this the property address?,Address line 1 input from address matching feature,Postcode input from address matching feature,UPRN of the address selected,Address line 1,Address line 2,Town/City,County,Part 1 of the property's postcode,Part 2 of the property's postcode,LA code,LA name,How many bedrooms does the property have?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,What is buyer 1's age?,Which of these best describes buyer 1's gender identity?,What is buyer 1's ethnic group?,Which of the following best describes buyer 1's ethnic background?,What is buyer 1's nationality?,Which of these best describes buyer 1's working situation?,Will buyer 1 live in the property?,What is buyer 2 or person 2's relationship to buyer 1?,What is buyer 2 or person 2's age?,Which of these best describes buyer 2 or person 2's gender identity?,What is buyer 2's ethnic group?,Which of the following best describes buyer 2's ethnic background?,What is buyer 2's nationality?,What is buyer 2 or person 2's working situation?,Will buyer 2 live in the property?,"Besides the buyer(s), how many other people live or will live in the property?",What is person 3's relationship to buyer 1?,What is person 3's age?,What is person 3's gender identity?,What is person 3's working situation?,What is person 4's relationship to buyer 1?,What is person 4's age?,What is person 4's gender identity?,What is person 4's working situation?,What is person 5's relationship to buyer 1?,What is person 5's age?,What is person 5's gender identity?,What is person 5's working situation?,What is person 6's relationship to buyer 1?,What is person 6's age?,What is person 6's gender identity?,What is person 6's working situation?,What was buyer 1's previous tenure?,Do you know the postcode of buyer 1's last settled accommodation?,Part 1 of postcode of buyer 1's last settled accommodation,Part 2 of postcode of buyer 1's last settled accommodation,Do you know the local authority of buyer 1's last settled accommodation?,The local authority code of buyer 1's last settled accommodation,The local authority name of buyer 1's last settled accommodation,Was the buyer registered with their PRP (HA)?,Was the buyer registered with another PRP (HA)?,Was the buyer registered with the local authority?,Was the buyer registered with a Help to Buy agent?,"Populated if pregyrha, pregother, pregla and pregghb are blank","At the time of purchase, was buyer 2 living at the same address as buyer 1?",What was buyer 2's previous tenure?,Have any of the buyers ever served as a regular in the UK armed forces?,Is the buyer still serving in the UK armed forces?,Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?,Does anyone in the household consider themselves to have a disability?,Does anyone in the household use a wheelchair?,Is buyer 1's annual income known?,What is buyer 1's annual income?,Was buyer 1's income used for a mortgage application?,Is buyer 2's annual income known?,What is buyer 2's annual income?,Was buyer 2's income used for a mortgage application?,Were the buyers receiving any of these housing-related benefits immediately before buying this property?,Is the the total amount the buyers had in savings known?,What is the total amount the buyers had in savings before they paid any deposit for the property?,Have any of the buyers previously owned a property?,Was the previous property under shared ownership?,How long did the buyer(s) live in the property before purchasing it?,Is this a staircasing transaction?,What percentage of the property has been bought in this staircasing transaction?,What percentage of the property do the buyers now own in total?,Was this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?,Is this a resale?,Day of the exchange of contracts,Month of the exchange of contracts,Year of the exchange of contracts,Day of the practical completion or handover date,Month of the practical completion or handover date,Year of the practical completion or handover date,Was the household rehoused under a local authority nominations agreement?,"Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?",How many bedrooms did the buyer's previous property have?,What was the previous property type?,What was the rent type of buyer's previous tenure?,What is the full purchase price?,What was the initial percentage equity stake purchased?,Was a mortgage used to buy this property?,What is the mortgage amount?,What is the name of the mortgage lender?,"If mortgagelender = 'Other', what is the name of the mortgage lender?",What is the length of the mortgage in years?,Does this include any extra borrowing?,How much was the cash deposit paid on the property?,How much cash discount was given through Social Homebuy?,What is the basic monthly rent?,Does the property have any monthly leasehold charges?,What are the total monthly leasehold charges for the property?,What was the percentage discount?,"What was the amount of any loan, grant, discount or subsidy given?" id,status,duplicate_set_id,created_at,updated_at,collection_start_year,creation_method,bulk_upload_id,is_dpo,owning_organisation_name,managing_organisation_name,assigned_to,day,month,year,purchid,ownershipsch,type,othtype,companybuy,buylivein,jointpur,jointmore,noint,privacynotice,uprn,uprn_confirmed,address_line1_input,postcode_full_input,uprn_selection,address_line1,address_line2,town_or_city,county,pcode1,pcode2,la,la_label,beds,proptype,builtype,wchair,age1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,buy1livein,relat2,age2,sex2,ethnic_group2,ethnicbuy2,nationality_all_buyer2,ecstat2,buy2livein,hholdcount,relat3,age3,sex3,ecstat3,relat4,age4,sex4,ecstat4,relat5,age5,sex5,ecstat5,relat6,age6,sex6,ecstat6,prevten,ppcodenk,ppostc1,ppostc2,previous_la_known,prevloc,prevloc_label,pregyrha,pregother,pregla,pregghb,pregblank,buy2living,prevtenbuy2,hhregres,hhregresstill,armedforcesspouse,disabled,wheel,income1nk,income1,inc1mort,income2nk,income2,inc2mort,hb,savingsnk,savings,prevown,prevshared,proplen,staircase,stairbought,stairowned,staircasesale,resale,exday,exmonth,exyear,hoday,homonth,hoyear,lanomagr,soctenant,frombeds,fromprop,socprevten,value,equity,mortgageused,mortgage,mortgagelender,mortgagelenderother,mortlen,extrabor,deposit,cashdis,mrent,has_mscharge,mscharge,discount,grant ,completed,,2024-05-01T00:00:00+01:00,2024-05-01T00:00:00+01:00,2024,single log,,false,MHCLG,MHCLG,billyboy@eyeklaud.com,1,5,2024,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,Yes,1,1,Yes,Address line 1,SW1A 1AA,,"1, Test Street",,Test Town,,AA1,1AA,E09000033,Westminster,2,Flat or maisonette,Purpose built,Yes,30,Non-binary,Buyer prefers not to say,17,United Kingdom,Full-time - 30 hours or more,Yes,Partner,35,Non-binary,Buyer prefers not to say,,United Kingdom,Full-time - 30 hours or more,Yes,3,Child,14,Non-binary,Child under 16,Other,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,Local authority tenant,Yes,AA1,1AA,Yes,E09000033,Westminster,1,1,1,1,,Don't know,,Yes,Yes,No,Yes,Yes,Yes,10000,Yes,Yes,10000,Yes,Don’t know ,No,,Yes,No,10,,,,,,,,,,,,,,,,,110000.0,,Yes,20000.0,Cambridge Building Society,,10,Yes,80000.0,,,Yes,100.0,,10000.0 diff --git a/spec/fixtures/variable_definitions/lettings_download_23_24.csv b/spec/fixtures/variable_definitions/lettings_download_23_24.csv deleted file mode 100644 index 73857e77d..000000000 --- a/spec/fixtures/variable_definitions/lettings_download_23_24.csv +++ /dev/null @@ -1,209 +0,0 @@ -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? -old_id,The (internal) ID on the old service -old_form_id,The ID the users saw on the old service -collection_start_year,Year collection period opened -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 -uprn_confirmed,We found an address that might be this property. Is this the property address? -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? -offered,How many times was the property offered between becoming vacant and this letting? -unittype_gn,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? -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? -national,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? -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? -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)? -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? diff --git a/spec/fixtures/variable_definitions/lettings_download_24_25.csv b/spec/fixtures/variable_definitions/lettings_download_24_25.csv deleted file mode 100644 index 0cc12dbd2..000000000 --- a/spec/fixtures/variable_definitions/lettings_download_24_25.csv +++ /dev/null @@ -1,220 +0,0 @@ -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? -builtype,Which type of building 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? diff --git a/spec/fixtures/variable_definitions/sales_download_23_24.csv b/spec/fixtures/variable_definitions/sales_download_23_24.csv deleted file mode 100644 index ad596de6c..000000000 --- a/spec/fixtures/variable_definitions/sales_download_23_24.csv +++ /dev/null @@ -1,269 +0,0 @@ -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 -FORM,The ID on the old service -COLLECTIONYEAR,Year collection period opened -CREATIONMETHOD,Was the log submitted in-service or via bulk upload? -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? -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? -UPRNCONFIRMED,We found an address that might be this property. Is this the property address? -ADDRESS1,Address line 1 -ADDRESS2,Address line 2 -TOWNCITY,Town/City -COUNTY,County -PCODE1,Part 1 of the property's postcode -PCODE2,Part 2 of the property's postcode -LA,LA code -LANAME,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? -ETHNICGROUP1,What is buyer 1's ethnic group? -ETHNIC,Which of the following best describes buyer 1's ethnic background? -NATIONAL,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? -NATIONAL2,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,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? -national,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? -nationalbuy2,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? diff --git a/spec/fixtures/variable_definitions/sales_download_24_25.csv b/spec/fixtures/variable_definitions/sales_download_24_25.csv deleted file mode 100644 index cf5641921..000000000 --- a/spec/fixtures/variable_definitions/sales_download_24_25.csv +++ /dev/null @@ -1,281 +0,0 @@ -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? diff --git a/spec/helpers/filters_helper_spec.rb b/spec/helpers/filters_helper_spec.rb index a2b658cdf..c57f92311 100644 --- a/spec/helpers/filters_helper_spec.rb +++ b/spec/helpers/filters_helper_spec.rb @@ -168,7 +168,7 @@ RSpec.describe FiltersHelper do before do FactoryBot.create(:organisation_relationship, parent_organisation:, child_organisation:) - FactoryBot.create(:organisation, name: "Other organisation", id: 9_999_999) + FactoryBot.create(:organisation, name: "Other organisation", id: 99) user.organisation.reload end @@ -326,7 +326,7 @@ RSpec.describe FiltersHelper do before do FactoryBot.create(:organisation_relationship, parent_organisation:, child_organisation:) - FactoryBot.create(:organisation, name: "Other organisation", id: 9_999_999) + FactoryBot.create(:organisation, name: "Other organisation", id: 99) user.organisation.reload end diff --git a/spec/lib/tasks/log_variable_definitions_spec.rb b/spec/lib/tasks/log_variable_definitions_spec.rb deleted file mode 100644 index 7fdeb66e4..000000000 --- a/spec/lib/tasks/log_variable_definitions_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -require "rails_helper" -require "rake" - -RSpec.describe "log_variable_definitions" do - describe ":add_variable_definitions", type: :task do - subject(:task) { Rake::Task["data_import:add_variable_definitions"] } - - let(:path) { "spec/fixtures/variable_definitions" } - - before do - Rake.application.rake_require("tasks/log_variable_definitions") - Rake::Task.define_task(:environment) - task.reenable - end - - it "adds CsvVariableDefinition records from each file in the specified directory" do - expect { task.invoke(path) }.to change(CsvVariableDefinition, :count).by(416) - end - - it "handles an empty directory without errors" do - empty_path = "spec/fixtures/empty_directory" - FileUtils.mkdir_p(empty_path) - expect { task.invoke(empty_path) }.not_to raise_error - expect(CsvVariableDefinition.count).to eq(0) - end - - it "does not create duplicate records if run multiple times" do - CsvVariableDefinition.delete_all - initial_count = CsvVariableDefinition.count - - task.invoke(path) - first_run_count = CsvVariableDefinition.count - - task.invoke(path) - second_run_count = CsvVariableDefinition.count - - expect(first_run_count).to eq(initial_count + 416) - expect(second_run_count).to eq(first_run_count) - end - end -end diff --git a/spec/services/csv/lettings_log_csv_service_spec.rb b/spec/services/csv/lettings_log_csv_service_spec.rb index 3134fa451..d59aa4406 100644 --- a/spec/services/csv/lettings_log_csv_service_spec.rb +++ b/spec/services/csv/lettings_log_csv_service_spec.rb @@ -1,16 +1,6 @@ require "rails_helper" -require "rake" RSpec.describe Csv::LettingsLogCsvService do - subject(:task) { Rake::Task["data_import:add_variable_definitions"] } - - before do - Rake.application.rake_require("tasks/log_variable_definitions") - Rake::Task.define_task(:environment) - task.reenable - task.invoke("spec/fixtures/variable_definitions") - end - context "when downloading a csv" do let(:log) { create(:lettings_log) } let(:user) { create(:user, :support, email: "s.port@jeemayle.com") } @@ -19,29 +9,23 @@ RSpec.describe Csv::LettingsLogCsvService do let(:year) { 2024 } let(:csv) { CSV.parse(service.prepare_csv(LettingsLog.where(id: logs.map(&:id)))) } let(:logs) { [log] } - let(:definition_line) { csv.first } - let(:attribute_line) { csv.second } - let(:content_line) { csv.third } + let(:headers) { csv.first } it "returns a string" do result = service.prepare_csv(LettingsLog.all) expect(result).to be_a String end - it "returns a csv with definition headers on the first line" do - expect(definition_line.first).to eq "Log ID" - end - - it "returns a csv with attribute headers on the second line" do - expect(attribute_line.first).to eq "id" + it "returns a csv with headers" do + expect(csv.first.first).to eq "id" end context "when stubbing :ordered_questions_for_year" do let(:form_handler_mock) { instance_double(FormHandler) } let(:lettings_form) do FormFactory.new(year: 2050, type: "lettings") - .with_sections([build(:section, :with_questions, question_ids:, questions:)]) - .build + .with_sections([build(:section, :with_questions, question_ids:, questions:)]) + .build end let(:question_ids) { [] } let(:questions) { nil } @@ -66,13 +50,13 @@ RSpec.describe Csv::LettingsLogCsvService do let(:question_ids) { %w[prevten startdate brent rent_type] } it "includes log attributes related to questions to the headers" do - expect(attribute_line).to include(*question_ids.first(3)) + expect(headers).to include(*question_ids.first(3)) end it "removes some log attributes related to questions from the headers and replaces them with their derived values in the correct order" do - expect(attribute_line).not_to include "rent_type" - expect(attribute_line).to include(*%w[wrent renttype renttype_detail]) - expect(attribute_line).not_to include("rent_type_detail") + expect(headers).not_to include "rent_type" + expect(headers).to include(*%w[wrent renttype renttype_detail]) + expect(headers).not_to include("rent_type_detail") end end @@ -86,23 +70,23 @@ RSpec.describe Csv::LettingsLogCsvService do it "does not add the id of the checkbox question to the headers" do question_ids = questions.map(&:id) - expect(attribute_line).not_to include(*question_ids) + expect(headers).not_to include(*question_ids) end it "adds the related log attributes from the answer options to the headers" do log_attributes = questions.flat_map { |q| q.answer_options.keys } - expect(attribute_line).to include(*log_attributes) + expect(headers).to include(*log_attributes) end end end it "adds log attributes not related to questions to the headers" do - expect(attribute_line.first(5)).to eq %w[id status duplicate_set_id created_by assigned_to] + expect(headers.first(5)).to eq %w[id status duplicate_set_id created_by assigned_to] end it "adds attributes related to associated schemes and locations to the headers" do - expect(attribute_line).to include(*%w[scheme_service_name scheme_confidential SCHTYPE scheme_registered_under_care_act]) - expect(attribute_line.last(5)).to eq %w[location_units location_type_of_unit location_mobility_type location_local_authority location_startdate] + expect(headers).to include(*%w[scheme_service_name scheme_confidential SCHTYPE scheme_registered_under_care_act]) + expect(headers.last(5)).to eq %w[location_units location_type_of_unit location_mobility_type location_local_authority location_startdate] end context "when there are many logs" do @@ -110,7 +94,7 @@ RSpec.describe Csv::LettingsLogCsvService do let(:log_count) { 30 } it "creates a CSV with the correct number of logs" do - expected_row_count_with_headers = log_count + 2 + expected_row_count_with_headers = log_count + 1 expect(csv.size).to be expected_row_count_with_headers end end @@ -120,32 +104,32 @@ RSpec.describe Csv::LettingsLogCsvService do let(:log) { create(:lettings_log, :setup_completed, hhmemb: 2, details_known_2: 0, relat2: "P", age1: 35, la: "E09000003", duplicate_set_id: 12_312) } it "gives answer to radio questions as labels" do - relat2_column_index = attribute_line.index("relat2") - relat2_value = content_line[relat2_column_index] + relat2_column_index = csv.first.index("relat2") + relat2_value = csv.second[relat2_column_index] expect(relat2_value).to eq "Partner" end it "gives answers to free input questions as the user input" do - age1_column_index = attribute_line.index("age1") - age1_value = content_line[age1_column_index] + age1_column_index = csv.first.index("age1") + age1_value = csv.second[age1_column_index] expect(age1_value).to eq 35.to_s end it "exports the code for the local authority under the heading 'la'" do - la_column_index = attribute_line.index("la") - la_value = content_line[la_column_index] + la_column_index = csv.first.index("la") + la_value = csv.second[la_column_index] expect(la_value).to eq "E09000003" end it "exports the label for the local authority under the heading 'la_label'" do - la_label_column_index = attribute_line.index("la_label") - la_label_value = content_line[la_label_column_index] + la_label_column_index = csv.first.index("la_label") + la_label_value = csv.second[la_label_column_index] expect(la_label_value).to eq "Barnet" end it "exports the id for under the heading 'duplicate_set_id'" do - duplicate_set_id_column_index = attribute_line.index("duplicate_set_id") - duplicate_set_id_value = content_line[duplicate_set_id_column_index] + duplicate_set_id_column_index = csv.first.index("duplicate_set_id") + duplicate_set_id_value = csv.second[duplicate_set_id_column_index] expect(duplicate_set_id_value).to eq "12312" end end @@ -155,32 +139,32 @@ RSpec.describe Csv::LettingsLogCsvService do let(:log) { create(:lettings_log, :setup_completed, hhmemb: 2, details_known_2: 0, relat2: "P", age1: 35, la: "E09000003", duplicate_set_id: 12_312) } it "gives answer to radio questions as labels" do - relat2_column_index = attribute_line.index("relat2") - relat2_value = content_line[relat2_column_index] + relat2_column_index = csv.first.index("relat2") + relat2_value = csv.second[relat2_column_index] expect(relat2_value).to eq "P" end it "gives answers to free input questions as the user input" do - age1_column_index = attribute_line.index("age1") - age1_value = content_line[age1_column_index] + age1_column_index = csv.first.index("age1") + age1_value = csv.second[age1_column_index] expect(age1_value).to eq 35.to_s end it "exports the code for the local authority under the heading 'la'" do - la_column_index = attribute_line.index("la") - la_value = content_line[la_column_index] + la_column_index = csv.first.index("la") + la_value = csv.second[la_column_index] expect(la_value).to eq "E09000003" end it "exports the label for the local authority under the heading 'la_label'" do - la_label_column_index = attribute_line.index("la_label") - la_label_value = content_line[la_label_column_index] + la_label_column_index = csv.first.index("la_label") + la_label_value = csv.second[la_label_column_index] expect(la_label_value).to eq "Barnet" end it "exports the duplicate log reference under the heading 'duplicate_set_id'" do - duplicate_set_id_column_index = attribute_line.index("duplicate_set_id") - duplicate_set_id_value = content_line[duplicate_set_id_column_index] + duplicate_set_id_column_index = csv.first.index("duplicate_set_id") + duplicate_set_id_value = csv.second[duplicate_set_id_column_index] expect(duplicate_set_id_value).to eq "12312" end end @@ -189,7 +173,7 @@ RSpec.describe Csv::LettingsLogCsvService do let(:user) { create(:user, :data_coordinator, email: "choreographer@owtluk.com") } it "does not include certain attributes in the headers" do - expect(attribute_line).not_to include(*%w[wrent wscharge wpschrge wsupchrg wtcharge]) + expect(headers).not_to include(*%w[wrent wscharge wpschrge wsupchrg wtcharge]) end end @@ -332,8 +316,8 @@ RSpec.describe Csv::LettingsLogCsvService do expected_content = CSV.read("spec/fixtures/files/lettings_log_csv_export_labels_24.csv") values_to_delete = %w[id] values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil + index = csv.first.index(attribute) + csv.second[index] = nil end expect(csv).to eq expected_content end @@ -346,8 +330,8 @@ RSpec.describe Csv::LettingsLogCsvService do expected_content = CSV.read("spec/fixtures/files/lettings_log_csv_export_non_support_labels_24.csv") values_to_delete = %w[id] values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil + index = csv.first.index(attribute) + csv.second[index] = nil end expect(csv).to eq expected_content end @@ -364,8 +348,8 @@ RSpec.describe Csv::LettingsLogCsvService do expected_content = CSV.read("spec/fixtures/files/lettings_log_csv_export_codes_24.csv") values_to_delete = %w[id] values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil + index = csv.first.index(attribute) + csv.second[index] = nil end expect(csv).to eq expected_content end @@ -378,8 +362,8 @@ RSpec.describe Csv::LettingsLogCsvService do expected_content = CSV.read("spec/fixtures/files/lettings_log_csv_export_non_support_codes_24.csv") values_to_delete = %w[id] values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil + index = csv.first.index(attribute) + csv.second[index] = nil end expect(csv).to eq expected_content end @@ -520,8 +504,8 @@ RSpec.describe Csv::LettingsLogCsvService do expected_content = CSV.read("spec/fixtures/files/lettings_log_csv_export_labels_23.csv") values_to_delete = %w[id] values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil + index = csv.first.index(attribute) + csv.second[index] = nil end expect(csv).to eq expected_content end @@ -534,8 +518,8 @@ RSpec.describe Csv::LettingsLogCsvService do expected_content = CSV.read("spec/fixtures/files/lettings_log_csv_export_non_support_labels_23.csv") values_to_delete = %w[id] values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil + index = csv.first.index(attribute) + csv.second[index] = nil end expect(csv).to eq expected_content end @@ -552,8 +536,8 @@ RSpec.describe Csv::LettingsLogCsvService do expected_content = CSV.read("spec/fixtures/files/lettings_log_csv_export_codes_23.csv") values_to_delete = %w[id] values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil + index = csv.first.index(attribute) + csv.second[index] = nil end expect(csv).to eq expected_content end @@ -566,8 +550,8 @@ RSpec.describe Csv::LettingsLogCsvService do expected_content = CSV.read("spec/fixtures/files/lettings_log_csv_export_non_support_codes_23.csv") values_to_delete = %w[id] values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil + index = csv.first.index(attribute) + csv.second[index] = nil end expect(csv).to eq expected_content end diff --git a/spec/services/csv/sales_log_csv_service_spec.rb b/spec/services/csv/sales_log_csv_service_spec.rb index 4bbbaf645..f238db53c 100644 --- a/spec/services/csv/sales_log_csv_service_spec.rb +++ b/spec/services/csv/sales_log_csv_service_spec.rb @@ -1,8 +1,6 @@ require "rails_helper" RSpec.describe Csv::SalesLogCsvService do - subject(:task) { Rake::Task["data_import:add_variable_definitions"] } - let(:form_handler_mock) { instance_double(FormHandler) } let(:organisation) { create(:organisation) } let(:fixed_time) { now } @@ -39,18 +37,11 @@ RSpec.describe Csv::SalesLogCsvService do let(:service) { described_class.new(user:, export_type: "labels", year:) } let(:csv) { CSV.parse(service.prepare_csv(SalesLog.all)) } let(:year) { 2024 } - let(:definition_line) { csv.first } - let(:attribute_line) { csv.second } - let(:content_line) { csv.third } before do Timecop.freeze(now) Singleton.__init__(FormHandler) log - Rake.application.rake_require("tasks/log_variable_definitions") - Rake::Task.define_task(:environment) - task.reenable - task.invoke("spec/fixtures/variable_definitions") end after do @@ -62,12 +53,8 @@ RSpec.describe Csv::SalesLogCsvService do expect(result).to be_a String end - it "returns a csv with definition headers on first line" do - expect(definition_line.first).to eq "Log ID" - end - - it "returns a csv with attribute headers on second line" do - expect(attribute_line.first).to eq "ID" + it "returns a csv with headers" do + expect(csv.first.first).to eq "ID" end context "when stubbing :ordered_questions_for_year" do @@ -98,14 +85,14 @@ RSpec.describe Csv::SalesLogCsvService do let(:question_ids) { %w[type age1 buy1livein exdate] } it "includes log attributes related to questions to the headers" do - attribute_line_before_2023 = csv.first - expect(attribute_line_before_2023).to include(*%w[TYPE AGE1 LIVEINBUYER1]) + headers = csv.first + expect(headers).to include(*%w[TYPE AGE1 LIVEINBUYER1]) end it "removes some log attributes related to questions from the headers and replaces them with their derived values in the correct order" do - attribute_line_before_2023 = csv.first - expect(attribute_line_before_2023).not_to include "EXDATE" - expect(attribute_line_before_2023.last(4)).to eq %w[LIVEINBUYER1 EXDAY EXMONTH EXYEAR] + headers = csv.first + expect(headers).not_to include "EXDATE" + expect(headers.last(4)).to eq %w[LIVEINBUYER1 EXDAY EXMONTH EXYEAR] end end @@ -122,27 +109,28 @@ RSpec.describe Csv::SalesLogCsvService do end it "does not add questions for checks, whether some other attribute is known or whether something else was asked" do - attribute_line_before_2023 = csv.first - expect(attribute_line_before_2023).not_to include "attribute_value_check" - expect(attribute_line_before_2023).not_to include "something_or_other_known" - expect(attribute_line_before_2023).not_to include "whatchamacallit_asked" + headers = csv.first + expect(headers).not_to include "attribute_value_check" + expect(headers).not_to include "something_or_other_known" + expect(headers).not_to include "whatchamacallit_asked" end it "does not add the id of checkbox questions, but adds the related attributes of the log in the correct order" do - attribute_line_before_2023 = csv.first - expect(attribute_line_before_2023.last(4)).to eq %w[OWNERSHIP PREGYRHA PREGOTHER TYPE] + headers = csv.first + expect(headers.last(4)).to eq %w[OWNERSHIP PREGYRHA PREGOTHER TYPE] end end end it "includes attributes not related to questions to the headers" do - expect(attribute_line).to include(*%w[ID STATUS CREATEDDATE UPLOADDATE]) + headers = csv.first + expect(headers).to include(*%w[ID STATUS CREATEDDATE UPLOADDATE]) end it "returns a csv with the correct number of logs" do create_list(:sales_log, 15) log_count = SalesLog.count - expected_row_count_with_headers = log_count + 2 + expected_row_count_with_headers = log_count + 1 expect(csv.size).to be expected_row_count_with_headers end @@ -152,36 +140,36 @@ RSpec.describe Csv::SalesLogCsvService do let(:now) { fixed_time } it "gives answers to radio questions as their labels" do - national_column_index = attribute_line.index("NATIONAL") - national_value = content_line[national_column_index] + national_column_index = csv.first.index("NATIONAL") + national_value = csv.second[national_column_index] expect(national_value).to eq "United Kingdom" - relat2_column_index = attribute_line.index("RELAT2") - relat2_value = content_line[relat2_column_index] + relat2_column_index = csv.first.index("RELAT2") + relat2_value = csv.second[relat2_column_index] expect(relat2_value).to eq "Partner" end it "gives answers to free input questions as the user input" do - age1_column_index = attribute_line.index("AGE1") - age1_value = content_line[age1_column_index] + age1_column_index = csv.first.index("AGE1") + age1_value = csv.second[age1_column_index] expect(age1_value).to eq 30.to_s postcode_part1, postcode_part2 = log.postcode_full.split - postcode_part1_column_index = attribute_line.index("PCODE1") - postcode_part1_value = content_line[postcode_part1_column_index] + postcode_part1_column_index = csv.first.index("PCODE1") + postcode_part1_value = csv.second[postcode_part1_column_index] expect(postcode_part1_value).to eq postcode_part1 - postcode_part2_column_index = attribute_line.index("PCODE2") - postcode_part2_value = content_line[postcode_part2_column_index] + postcode_part2_column_index = csv.first.index("PCODE2") + postcode_part2_value = csv.second[postcode_part2_column_index] expect(postcode_part2_value).to eq postcode_part2 end it "exports the code for the local authority under the heading 'la'" do - la_column_index = attribute_line.index("LA") - la_value = content_line[la_column_index] + la_column_index = csv.first.index("LA") + la_value = csv.second[la_column_index] expect(la_value).to eq "E09000033" end it "exports the label for the local authority under the heading 'la_label'" do - la_label_column_index = attribute_line.index("LANAME") - la_label_value = content_line[la_label_column_index] + la_label_column_index = csv.first.index("LANAME") + la_label_value = csv.second[la_label_column_index] expect(la_label_value).to eq "Westminster" end @@ -198,8 +186,8 @@ RSpec.describe Csv::SalesLogCsvService do expected_content = CSV.read("spec/fixtures/files/sales_logs_csv_export_labels_24.csv") values_to_delete = %w[ID] values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil + index = csv.first.index(attribute) + csv.second[index] = nil end expect(csv).to eq expected_content end @@ -213,8 +201,8 @@ RSpec.describe Csv::SalesLogCsvService do expected_content = CSV.read("spec/fixtures/files/sales_logs_csv_export_labels_23.csv") values_to_delete = %w[ID] values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil + index = csv.first.index(attribute) + csv.second[index] = nil end expect(csv).to eq expected_content end @@ -226,8 +214,8 @@ RSpec.describe Csv::SalesLogCsvService do end it "exports the id for under the heading 'duplicate_set_id'" do - duplicate_set_id_column_index = attribute_line.index("DUPLICATESET") - duplicate_set_id_value = content_line[duplicate_set_id_column_index] + duplicate_set_id_column_index = csv.first.index("DUPLICATESET") + duplicate_set_id_value = csv.second[duplicate_set_id_column_index] expect(duplicate_set_id_value).to eq "12312" end end @@ -240,36 +228,36 @@ RSpec.describe Csv::SalesLogCsvService do let(:now) { fixed_time } it "gives answers to radio questions as their codes" do - national_column_index = attribute_line.index("NATIONAL") - national_value = content_line[national_column_index] + national_column_index = csv.first.index("NATIONAL") + national_value = csv.second[national_column_index] expect(national_value).to eq 18.to_s - relat2_column_index = attribute_line.index("RELAT2") - relat2_value = content_line[relat2_column_index] + relat2_column_index = csv.first.index("RELAT2") + relat2_value = csv.second[relat2_column_index] expect(relat2_value).to eq "P" end it "gives answers to free input questions as the user input" do - age1_column_index = attribute_line.index("AGE1") - age1_value = content_line[age1_column_index] + age1_column_index = csv.first.index("AGE1") + age1_value = csv.second[age1_column_index] expect(age1_value).to eq 30.to_s postcode_part1, postcode_part2 = log.postcode_full.split - postcode_part1_column_index = attribute_line.index("PCODE1") - postcode_part1_value = content_line[postcode_part1_column_index] + postcode_part1_column_index = csv.first.index("PCODE1") + postcode_part1_value = csv.second[postcode_part1_column_index] expect(postcode_part1_value).to eq postcode_part1 - postcode_part2_column_index = attribute_line.index("PCODE2") - postcode_part2_value = content_line[postcode_part2_column_index] + postcode_part2_column_index = csv.first.index("PCODE2") + postcode_part2_value = csv.second[postcode_part2_column_index] expect(postcode_part2_value).to eq postcode_part2 end it "exports the code for the local authority under the heading 'la'" do - la_column_index = attribute_line.index("LA") - la_value = content_line[la_column_index] + la_column_index = csv.first.index("LA") + la_value = csv.second[la_column_index] expect(la_value).to eq "E09000033" end it "exports the label for the local authority under the heading 'la_label'" do - la_label_column_index = attribute_line.index("LANAME") - la_label_value = content_line[la_label_column_index] + la_label_column_index = csv.first.index("LANAME") + la_label_value = csv.second[la_label_column_index] expect(la_label_value).to eq "Westminster" end @@ -282,8 +270,8 @@ RSpec.describe Csv::SalesLogCsvService do expected_content = CSV.read("spec/fixtures/files/sales_logs_csv_export_codes_24.csv") values_to_delete = %w[ID] values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil + index = csv.first.index(attribute) + csv.second[index] = nil end expect(csv).to eq expected_content end @@ -297,8 +285,8 @@ RSpec.describe Csv::SalesLogCsvService do expected_content = CSV.read("spec/fixtures/files/sales_logs_csv_export_codes_23.csv") values_to_delete = %w[ID] values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil + index = csv.first.index(attribute) + csv.second[index] = nil end expect(csv).to eq expected_content end @@ -310,8 +298,8 @@ RSpec.describe Csv::SalesLogCsvService do end it "exports the id for under the heading 'duplicate_set_id'" do - duplicate_set_id_column_index = attribute_line.index("DUPLICATESET") - duplicate_set_id_value = content_line[duplicate_set_id_column_index] + duplicate_set_id_column_index = csv.first.index("DUPLICATESET") + duplicate_set_id_value = csv.second[duplicate_set_id_column_index] expect(duplicate_set_id_value).to eq "12312" end end @@ -319,9 +307,10 @@ RSpec.describe Csv::SalesLogCsvService do context "when the user is not a support user" do let(:user) { create(:user, email: "billyboy@eyeklaud.com") } + let(:headers) { csv.first } it "does not include certain attributes in the headers" do - expect(attribute_line).not_to include(*%w[address_line1_as_entered address_line2_as_entered town_or_city_as_entered county_as_entered postcode_full_as_entered la_as_entered created_by value_value_check monthly_charges_value_check]) + expect(headers).not_to include(*%w[address_line1_as_entered address_line2_as_entered town_or_city_as_entered county_as_entered postcode_full_as_entered la_as_entered created_by value_value_check monthly_charges_value_check]) end context "and the requested form is 2024" do @@ -340,8 +329,8 @@ RSpec.describe Csv::SalesLogCsvService do expected_content = CSV.read("spec/fixtures/files/sales_logs_csv_export_non_support_labels_24.csv") values_to_delete = %w[id] values_to_delete.each do |attribute| - index = attribute_line.index(attribute) - content_line[index] = nil + index = csv.first.index(attribute) + csv.second[index] = nil end expect(csv).to eq expected_content end diff --git a/spec/services/csv/scheme_csv_service_spec.rb b/spec/services/csv/scheme_csv_service_spec.rb index 57f009c65..6dceb31c5 100644 --- a/spec/services/csv/scheme_csv_service_spec.rb +++ b/spec/services/csv/scheme_csv_service_spec.rb @@ -13,14 +13,12 @@ RSpec.describe Csv::SchemeCsvService do before do Timecop.freeze(fixed_time) - Singleton.__init__(FormHandler) create(:scheme_deactivation_period, scheme:, deactivation_date: scheme.created_at + 1.year, reactivation_date: scheme.created_at + 2.years) create(:location_deactivation_period, location:, deactivation_date: location.created_at + 6.months) end after do Timecop.return - Singleton.__init__(FormHandler) end it "returns a string" do diff --git a/spec/services/imports/variable_definitions_service_spec.rb b/spec/services/imports/variable_definitions_service_spec.rb deleted file mode 100644 index 3c7a3b526..000000000 --- a/spec/services/imports/variable_definitions_service_spec.rb +++ /dev/null @@ -1,44 +0,0 @@ -require "rails_helper" - -RSpec.describe Imports::VariableDefinitionsService, type: :service do - let(:path) { "spec/fixtures/variable_definitions" } - let(:service) { described_class.new(path:) } - - describe "#initialize" do - it "initializes with the correct path and count" do - expect(service.path).to eq(path) - expect(service.count).to eq(0) - end - end - - describe "#call" do - before do - allow(Dir).to receive(:glob).and_return(%w[lettings_download_23_24.csv lettings_download_24_25.csv sales_download_23_24.csv sales_download_24_25.csv]) - allow(service).to receive(:process_file) - end - - it "processes each file in the directory" do - service.call - %w[lettings_download_23_24.csv lettings_download_24_25.csv sales_download_23_24.csv sales_download_24_25.csv].each do |file| - expect(service).to have_received(:process_file).with(file) - end - end - end - - describe "#process_file" do - let(:file) { "spec/fixtures/variable_definitions/lettings_download_23_24.csv" } - let(:csv_content) { [["id", "Log ID"], ["status", "Status of log"], ["duplicate_set_id", "ID of a set of duplicate logs"]] } - - before do - allow(CSV).to receive(:foreach).and_yield(csv_content[0]).and_yield(csv_content[1]).and_yield(csv_content[2]) - end - - context "when no existing record" do - it "creates new records" do - expect { - service.send(:process_file, file) - }.to change(CsvVariableDefinition, :count).by(3) - end - end - end -end