Browse Source

Update hholdcount and confirmed fields

pull/1331/head
Kat 3 years ago
parent
commit
0e9b7abe29
  1. 10
      app/services/imports/sales_logs_import_service.rb
  2. 1
      spec/fixtures/imports/sales_logs/00d2343e-d5fa-4c89-8400-ec3854b0f2b4.xml
  3. 3
      spec/fixtures/imports/sales_logs/0b4a68df-30cc-474a-93c0-a56ce8fdad3b.xml
  4. 1
      spec/fixtures/imports/sales_logs/0ead17cb-1668-442d-898c-0d52879ff592.xml
  5. 1
      spec/fixtures/imports/sales_logs/166fc004-392e-47a8-acb8-1c018734882b.xml
  6. 1
      spec/fixtures/imports/sales_logs/5ybz29dj-l33t-k1l0-hj86-n4k4ma77xkcd.xml
  7. 1
      spec/fixtures/imports/sales_logs/893ufj2s-lq77-42m4-rty6-ej09gh585uy1.xml

10
app/services/imports/sales_logs_import_service.rb

@ -52,15 +52,15 @@ module Imports
attributes["othernational"] = nil
attributes["ethnic"] = unsafe_string_as_integer(xml_doc, "P1ETH")
attributes["ethnic_group"] = ethnic_group(attributes["ethnic"]) # check numbers
attributes["buy1livein"] = unsafe_string_as_integer(xml_doc, "LIVEINBUYER1") # liveinbuyer1?
attributes["buylivein"] = unsafe_string_as_integer(xml_doc, "LIVEINBUYER") # liveinbuyer? liveinbuyerother?
attributes["buy1livein"] = unsafe_string_as_integer(xml_doc, "LIVEINBUYER1")
attributes["buylivein"] = unsafe_string_as_integer(xml_doc, "LIVEINBUYER")
attributes["builtype"] = unsafe_string_as_integer(xml_doc, "Q13BUILDINGTYPE")
attributes["proptype"] = unsafe_string_as_integer(xml_doc, "Q12PROPERTYTYPE")
attributes["noint"] = safe_string_as_integer(xml_doc, "NOINT")
attributes["buy2livein"] = unsafe_string_as_integer(xml_doc, "LIVEINBUYER2") # liveinbuyer2?
attributes["privacynotice"] = 1 if string_or_nil(xml_doc, "QDP") == "Yes" # always yes?
attributes["buy2livein"] = unsafe_string_as_integer(xml_doc, "LIVEINBUYER2")
attributes["privacynotice"] = 1 if string_or_nil(xml_doc, "QDP") == "Yes"
attributes["wheel"] = unsafe_string_as_integer(xml_doc, "Q10WHEELCHAIR")
attributes["hholdcount"] = attributes["hhmemb"] - (attributes["jointpur"] == 1 ? 2 : 1)
attributes["hholdcount"] = safe_string_as_integer(xml_doc, "LIVEINOTHER")
attributes["la"] = string_or_nil(xml_doc, "Q14ONSLACODE")
attributes["income1"] = safe_string_as_integer(xml_doc, "Q2PERSON1INCOME") # should this be decimal?
attributes["income1nk"] = 0 if attributes["income1"].present? # known if given? there's P1IncKnown in the form should use that instead?

1
spec/fixtures/imports/sales_logs/00d2343e-d5fa-4c89-8400-ec3854b0f2b4.xml vendored

@ -83,6 +83,7 @@
<PREGHBA>Yes</PREGHBA>
<ARMEDF>1 Yes</ARMEDF>
<HHMEMB>6</HHMEMB>
<LIVEINOTHER>4</LIVEINOTHER>
<!-- <PCODE1>LS16</PCODE1>
<PCODE2>6FT</PCODE2> -->
<HHTYPE>9 = other</HHTYPE>

3
spec/fixtures/imports/sales_logs/0b4a68df-30cc-474a-93c0-a56ce8fdad3b.xml vendored

@ -28,7 +28,7 @@
<Q11BEDROOMS>2</Q11BEDROOMS>
<JOINTMORE>1 Yes</JOINTMORE>
<NOINT>1</NOINT>
<!-- <privacynotice>1<privacynotice> /-->
<QDP></QDP>
<P1AGE>30</P1AGE>
<P1SEX>Non-binary</P1SEX>
<P1NAT>17 Republic of Ireland</P1NAT>
@ -77,6 +77,7 @@
<PREGHBA>Yes</PREGHBA>
<ARMEDF>1 Yes</ARMEDF>
<HHMEMB>6</HHMEMB>
<LIVEINOTHER>4</LIVEINOTHER>
<!-- <PCODE1>LS16</PCODE1>
<PCODE2>6FT</PCODE2> -->
<HHTYPE>9 = other</HHTYPE>

1
spec/fixtures/imports/sales_logs/0ead17cb-1668-442d-898c-0d52879ff592.xml vendored

@ -99,6 +99,7 @@
<PREGHBA>Yes</PREGHBA>
<ARMEDF>1 Yes</ARMEDF>
<HHMEMB>6</HHMEMB>
<LIVEINOTHER>4</LIVEINOTHER>
<!-- <PCODE1>LS16</PCODE1>
<PCODE2>6FT</PCODE2> -->
<HHTYPE>9 = other</HHTYPE>

1
spec/fixtures/imports/sales_logs/166fc004-392e-47a8-acb8-1c018734882b.xml vendored

@ -77,6 +77,7 @@
<PREGHBA>Yes</PREGHBA>
<ARMEDF>1 Yes</ARMEDF>
<HHMEMB>6</HHMEMB>
<LIVEINOTHER>4</LIVEINOTHER>
<!-- <PCODE1>LS16</PCODE1>
<PCODE2>6FT</PCODE2> -->
<HHTYPE>9 = other</HHTYPE>

1
spec/fixtures/imports/sales_logs/5ybz29dj-l33t-k1l0-hj86-n4k4ma77xkcd.xml vendored

@ -77,6 +77,7 @@
<PREGHBA>Yes</PREGHBA>
<ARMEDF>1 Yes</ARMEDF>
<HHMEMB>6</HHMEMB>
<LIVEINOTHER>4</LIVEINOTHER>
<!-- <PCODE1>LS16</PCODE1>
<PCODE2>6FT</PCODE2> -->
<HHTYPE>9 = other</HHTYPE>

1
spec/fixtures/imports/sales_logs/893ufj2s-lq77-42m4-rty6-ej09gh585uy1.xml vendored

@ -77,6 +77,7 @@
<PREGHBA>Yes</PREGHBA>
<ARMEDF>1 Yes</ARMEDF>
<HHMEMB>6</HHMEMB>
<LIVEINOTHER>4</LIVEINOTHER>
<!-- <PCODE1>LS16</PCODE1>
<PCODE2>6FT</PCODE2> -->
<HHTYPE>9 = other</HHTYPE>

Loading…
Cancel
Save