Browse Source

Remove illness_type_0 from lettings log (#1170)

pull/1172/head
Jack 2 years ago committed by GitHub
parent
commit
23e311721f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      app/services/imports/lettings_logs_import_service.rb
  2. 3
      config/forms/2021_2022.json
  3. 3
      config/forms/2022_2023.json
  4. 343
      spec/fixtures/complete_lettings_log.json
  5. 2
      spec/services/csv/lettings_log_csv_service_spec.rb

1
app/services/imports/lettings_logs_import_service.rb

@ -126,7 +126,6 @@ module Imports
(1..10).each do |index|
attributes["illness_type_#{index}"] = illness_type(xml_doc, index, attributes["illness"])
end
attributes["illness_type_0"] = 1 if (1..10).all? { |idx| attributes["illness_type_#{idx}"].nil? || attributes["illness_type_#{idx}"].zero? }
attributes["prevten"] = unsafe_string_as_integer(xml_doc, "Q11")
attributes["prevloc"] = string_or_nil(xml_doc, "Q12aONS")

3
config/forms/2021_2022.json

@ -6047,9 +6047,6 @@
},
"illness_type_10": {
"value": "Other"
},
"illness_type_0": {
"value": "Tenant prefers not to say"
}
}
}

3
config/forms/2022_2023.json

@ -6049,9 +6049,6 @@
},
"illness_type_10": {
"value": "Other"
},
"illness_type_0": {
"value": "Tenant prefers not to say"
}
}
}

343
spec/fixtures/complete_lettings_log.json vendored

@ -1,180 +1,179 @@
{
"lettings_log": {
"tenancycode":"T1245",
"age1":34,
"sex1":"M",
"ethnic":1,
"national":1,
"prevten":3,
"ecstat1":1,
"hhmemb":3,
"age2":29,
"sex2":"F",
"ecstat2":2,
"age3":11,
"sex3":"R",
"ecstat3":9,
"age4":null,
"sex4":null,
"ecstat4":null,
"age5":null,
"sex5":null,
"ecstat5":null,
"age6":null,
"sex6":null,
"ecstat6":null,
"age7":null,
"sex7":null,
"ecstat7":null,
"age8":null,
"sex8":null,
"ecstat8":null,
"homeless":1,
"underoccupation_benefitcap":2,
"leftreg":null,
"reservist":null,
"illness":2,
"preg_occ":2,
"startertenancy":2,
"tenancylength":null,
"tenancy":2,
"ppostcode_full":"NW18TR",
"rsnvac":5,
"unittype_gn":7,
"beds":2,
"offered":0,
"wchair":1,
"earnings":190,
"incfreq":1,
"benefits":3,
"period":3,
"layear":7,
"waityear":2,
"postcode_full":"NW18EE",
"reasonpref":2,
"cbl":1,
"chr":0,
"cap":0,
"reasonother":"",
"tenancycode": "T1245",
"age1": 34,
"sex1": "M",
"ethnic": 1,
"national": 1,
"prevten": 3,
"ecstat1": 1,
"hhmemb": 3,
"age2": 29,
"sex2": "F",
"ecstat2": 2,
"age3": 11,
"sex3": "R",
"ecstat3": 9,
"age4": null,
"sex4": null,
"ecstat4": null,
"age5": null,
"sex5": null,
"ecstat5": null,
"age6": null,
"sex6": null,
"ecstat6": null,
"age7": null,
"sex7": null,
"ecstat7": null,
"age8": null,
"sex8": null,
"ecstat8": null,
"homeless": 1,
"underoccupation_benefitcap": 2,
"leftreg": null,
"reservist": null,
"illness": 2,
"preg_occ": 2,
"startertenancy": 2,
"tenancylength": null,
"tenancy": 2,
"ppostcode_full": "NW18TR",
"rsnvac": 5,
"unittype_gn": 7,
"beds": 2,
"offered": 0,
"wchair": 1,
"earnings": 190,
"incfreq": 1,
"benefits": 3,
"period": 3,
"layear": 7,
"waityear": 2,
"postcode_full": "NW18EE",
"reasonpref": 2,
"cbl": 1,
"chr": 0,
"cap": 0,
"reasonother": "",
"housingneeds": 1,
"housingneeds_type": 2,
"housingneeds_other": 0,
"housingneeds_c": 1,
"illness_type_1":null,
"illness_type_2":null,
"illness_type_3":null,
"illness_type_4":null,
"illness_type_8":null,
"illness_type_5":null,
"illness_type_6":null,
"illness_type_7":null,
"illness_type_9":null,
"illness_type_10":null,
"rp_homeless":null,
"rp_insan_unsat":null,
"rp_medwel":null,
"rp_hardship":null,
"rp_dontknow":null,
"tenancyother":"",
"net_income_value_check":null,
"property_owner_organisation":null,
"property_manager_organisation":null,
"irproduct_other":"",
"purchaser_code":null,
"reason":42,
"propcode":"PT562",
"majorrepairs":1,
"la":"E09000007",
"prevloc":"E09000007",
"hb":9,
"hbrentshortfall":null,
"property_relet":null,
"mrcdate":"2021-05-07T00:00:00.000+01:00",
"incref":null,
"startdate":"2021-06-06T00:00:00.000+01:00",
"armedforces":2,
"first_time_property_let_as_social_housing":0,
"unitletas":1,
"builtype":1,
"voiddate":"2021-05-05T00:00:00.000+01:00",
"owning_organisation_id":1,
"managing_organisation_id":1,
"renttype":2,
"needstype":1,
"lettype":7,
"postcode_known":1,
"is_la_inferred":true,
"totchild":1,
"totelder":0,
"totadult":2,
"net_income_known":0,
"nocharge":0,
"is_carehome":null,
"household_charge":null,
"referral":2,
"brent":"350.0",
"scharge":"11.0",
"pscharge":"11.0",
"supcharg":"0.0",
"tcharge":"372.0",
"tshortfall":null,
"chcharge":null,
"declaration":1,
"ppcodenk":1,
"previous_la_known":null,
"is_previous_la_inferred":true,
"age1_known":0,
"age2_known":0,
"age3_known":0,
"age4_known":null,
"age5_known":null,
"age6_known":null,
"age7_known":null,
"age8_known":null,
"ethnic_group":0,
"letting_allocation_unknown":0,
"details_known_2":0,
"details_known_3":0,
"details_known_4":null,
"details_known_5":null,
"details_known_6":null,
"details_known_7":null,
"details_known_8":null,
"rent_type":1,
"has_benefits":0,
"renewal":0,
"wrent":"87.5",
"wscharge":"2.75",
"wpschrge":"2.75",
"wsupchrg":"0.0",
"wtcharge":"93.0",
"wtshortfall":null,
"refused":1,
"wchchrg":null,
"newprop":2,
"relat2":"P",
"relat3":"C",
"relat4":null,
"relat5":null,
"relat6":null,
"relat7":null,
"relat8":null,
"rent_value_check":null,
"old_form_id":null,
"lar":null,
"irproduct":null,
"old_id":null,
"joint":null,
"created_by_id":2,
"illness_type_0":null,
"retirement_value_check":null,
"tshortfall_known":null,
"sheltered":null,
"pregnancy_value_check":null,
"hhtype":6,
"new_old":1,
"vacdays":30,
"scheme_id":null,
"location_id":null
"illness_type_1": null,
"illness_type_2": null,
"illness_type_3": null,
"illness_type_4": null,
"illness_type_8": null,
"illness_type_5": null,
"illness_type_6": null,
"illness_type_7": null,
"illness_type_9": null,
"illness_type_10": null,
"rp_homeless": null,
"rp_insan_unsat": null,
"rp_medwel": null,
"rp_hardship": null,
"rp_dontknow": null,
"tenancyother": "",
"net_income_value_check": null,
"property_owner_organisation": null,
"property_manager_organisation": null,
"irproduct_other": "",
"purchaser_code": null,
"reason": 42,
"propcode": "PT562",
"majorrepairs": 1,
"la": "E09000007",
"prevloc": "E09000007",
"hb": 9,
"hbrentshortfall": null,
"property_relet": null,
"mrcdate": "2021-05-07T00:00:00.000+01:00",
"incref": null,
"startdate": "2021-06-06T00:00:00.000+01:00",
"armedforces": 2,
"first_time_property_let_as_social_housing": 0,
"unitletas": 1,
"builtype": 1,
"voiddate": "2021-05-05T00:00:00.000+01:00",
"owning_organisation_id": 1,
"managing_organisation_id": 1,
"renttype": 2,
"needstype": 1,
"lettype": 7,
"postcode_known": 1,
"is_la_inferred": true,
"totchild": 1,
"totelder": 0,
"totadult": 2,
"net_income_known": 0,
"nocharge": 0,
"is_carehome": null,
"household_charge": null,
"referral": 2,
"brent": "350.0",
"scharge": "11.0",
"pscharge": "11.0",
"supcharg": "0.0",
"tcharge": "372.0",
"tshortfall": null,
"chcharge": null,
"declaration": 1,
"ppcodenk": 1,
"previous_la_known": null,
"is_previous_la_inferred": true,
"age1_known": 0,
"age2_known": 0,
"age3_known": 0,
"age4_known": null,
"age5_known": null,
"age6_known": null,
"age7_known": null,
"age8_known": null,
"ethnic_group": 0,
"letting_allocation_unknown": 0,
"details_known_2": 0,
"details_known_3": 0,
"details_known_4": null,
"details_known_5": null,
"details_known_6": null,
"details_known_7": null,
"details_known_8": null,
"rent_type": 1,
"has_benefits": 0,
"renewal": 0,
"wrent": "87.5",
"wscharge": "2.75",
"wpschrge": "2.75",
"wsupchrg": "0.0",
"wtcharge": "93.0",
"wtshortfall": null,
"refused": 1,
"wchchrg": null,
"newprop": 2,
"relat2": "P",
"relat3": "C",
"relat4": null,
"relat5": null,
"relat6": null,
"relat7": null,
"relat8": null,
"rent_value_check": null,
"old_form_id": null,
"lar": null,
"irproduct": null,
"old_id": null,
"joint": null,
"created_by_id": 2,
"retirement_value_check": null,
"tshortfall_known": null,
"sheltered": null,
"pregnancy_value_check": null,
"hhtype": 6,
"new_old": 1,
"vacdays": 30,
"scheme_id": null,
"location_id": null
}
}

2
spec/services/csv/lettings_log_csv_service_spec.rb

@ -121,7 +121,6 @@ RSpec.describe Csv::LettingsLogCsvService do
illness_type_8
illness_type_1
illness_type_10
illness_type_0
layear
waityear
reason
@ -197,6 +196,7 @@ RSpec.describe Csv::LettingsLogCsvService do
irproduct
old_id
joint
illness_type_0
hhtype
new_old
vacdays

Loading…
Cancel
Save