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| (1..10).each do |index|
attributes["illness_type_#{index}"] = illness_type(xml_doc, index, attributes["illness"]) attributes["illness_type_#{index}"] = illness_type(xml_doc, index, attributes["illness"])
end 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["prevten"] = unsafe_string_as_integer(xml_doc, "Q11")
attributes["prevloc"] = string_or_nil(xml_doc, "Q12aONS") attributes["prevloc"] = string_or_nil(xml_doc, "Q12aONS")

3
config/forms/2021_2022.json

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

3
config/forms/2022_2023.json

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

Loading…
Cancel
Save