From 73adb9347ac81773fa22fc07fcf6cb596d0f2497 Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 22 Feb 2023 08:33:06 +0000 Subject: [PATCH] Update log fixtures --- .../imports/sales_logs_import_service.rb | 154 +++--- .../00d2343e-d5fa-4c89-8400-ec3854b0f2b4.xml | 417 +++++++++++++---- .../0b4a68df-30cc-474a-93c0-a56ce8fdad3b.xml | 409 ++++++++++++---- .../0ead17cb-1668-442d-898c-0d52879ff592.xml | 439 +++++++++++++----- .../166fc004-392e-47a8-acb8-1c018734882b.xml | 411 ++++++++++++---- .../5ybz29dj-l33t-k1l0-hj86-n4k4ma77xkcd.xml | 410 ++++++++++++---- .../893ufj2s-lq77-42m4-rty6-ej09gh585uy1.xml | 407 ++++++++++++---- 7 files changed, 1972 insertions(+), 675 deletions(-) diff --git a/app/services/imports/sales_logs_import_service.rb b/app/services/imports/sales_logs_import_service.rb index d5e31fab9..e4281d1c1 100644 --- a/app/services/imports/sales_logs_import_service.rb +++ b/app/services/imports/sales_logs_import_service.rb @@ -25,72 +25,71 @@ module Imports attributes["saledate"] = compose_date(xml_doc, "DAY", "MONTH", "YEAR") attributes["owning_organisation_id"] = find_organisation_id(xml_doc, "OWNINGORGID") - attributes["type"] = unsafe_string_as_integer(xml_doc, "DERSALETYPE") + attributes["type"] = unsafe_string_as_integer(xml_doc, "DerSaleType") attributes["old_id"] = meta_field_value(xml_doc, "document-id") attributes["created_at"] = Time.zone.parse(meta_field_value(xml_doc, "created-date")) attributes["updated_at"] = Time.zone.parse(meta_field_value(xml_doc, "modified-date")) - attributes["purchid"] = string_or_nil(xml_doc, "PURCHASERCODE") - attributes["ownershipsch"] = unsafe_string_as_integer(xml_doc, "OWNERSHIP") - attributes["othtype"] = string_or_nil(xml_doc, "Q38OTHERSALE") - attributes["jointmore"] = unsafe_string_as_integer(xml_doc, "JOINTMORE") - attributes["jointpur"] = unsafe_string_as_integer(xml_doc, "JOINT") - attributes["beds"] = safe_string_as_integer(xml_doc, "Q11BEDROOMS") - attributes["companybuy"] = unsafe_string_as_integer(xml_doc, "COMPANY") + attributes["purchid"] = string_or_nil(xml_doc, "PurchaserCode") + attributes["ownershipsch"] = unsafe_string_as_integer(xml_doc, "Ownership") + attributes["othtype"] = string_or_nil(xml_doc, "Q38OtherSale") + attributes["jointmore"] = unsafe_string_as_integer(xml_doc, "JointMore") + attributes["jointpur"] = unsafe_string_as_integer(xml_doc, "joint") + attributes["beds"] = safe_string_as_integer(xml_doc, "Q11Bedrooms") + attributes["companybuy"] = unsafe_string_as_integer(xml_doc, "company") if attributes["ownershipsch"] == 3 attributes["hhmemb"] = safe_string_as_integer(xml_doc, "HHMEMB") (1..6).each do |index| - attributes["age#{index}"] = safe_string_as_integer(xml_doc, "P#{index}AGE") + attributes["age#{index}"] = safe_string_as_integer(xml_doc, "P#{index}Age") attributes["sex#{index}"] = sex(xml_doc, index) - attributes["ecstat#{index}"] = unsafe_string_as_integer(xml_doc, "P#{index}ECO") + attributes["ecstat#{index}"] = unsafe_string_as_integer(xml_doc, "P#{index}Eco") attributes["age#{index}_known"] = age_known(xml_doc, index, attributes["hhmemb"], attributes["age#{index}"]) end (2..6).each do |index| attributes["relat#{index}"] = relat(xml_doc, index) attributes["details_known_#{index}"] = details_known(index, attributes) end - - attributes["national"] = unsafe_string_as_integer(xml_doc, "P1NAT") + attributes["national"] = unsafe_string_as_integer(xml_doc, "P1Nat") 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") - 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") - attributes["privacynotice"] = 1 if string_or_nil(xml_doc, "QDP") == "Yes" - attributes["wheel"] = unsafe_string_as_integer(xml_doc, "Q10WHEELCHAIR") - 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? - attributes["inc1mort"] = unsafe_string_as_integer(xml_doc, "Q2PERSON1MORTGAGE") - attributes["income2"] = safe_string_as_integer(xml_doc, "Q2PERSON2INCOME") # should this be decimal? - attributes["income2nk"] = 0 if attributes["income2"].present? # known if given? - attributes["savings"] = safe_string_as_integer(xml_doc, "Q3SAVINGS") - attributes["savingsnk"] = savings_known(xml_doc) # 0 -> known, 1 - not known from the sales xml form, does this actually exist? - attributes["prevown"] = unsafe_string_as_integer(xml_doc, "Q4PREVOWNEDPROPERTY") + attributes["ethnic"] = unsafe_string_as_integer(xml_doc, "P1Eth") + attributes["ethnic_group"] = ethnic_group(attributes["ethnic"]) + attributes["buy1livein"] = unsafe_string_as_integer(xml_doc, "LiveInBuyer1") + attributes["buylivein"] = unsafe_string_as_integer(xml_doc, "LiveInBuyer") if attributes["ownershipsch"] == 3 + attributes["builtype"] = unsafe_string_as_integer(xml_doc, "Q13BuildingType") + attributes["proptype"] = unsafe_string_as_integer(xml_doc, "Q12PropertyType") + attributes["privacynotice"] = 1 if string_or_nil(xml_doc, "Qdp") == "Yes" + attributes["noint"] = safe_string_as_integer(xml_doc, "NOINT") || 2 if attributes["privacynotice"] == 1 + attributes["buy2livein"] = unsafe_string_as_integer(xml_doc, "LiveInBuyer2") + attributes["wheel"] = unsafe_string_as_integer(xml_doc, "Q10Wheelchair") + attributes["hholdcount"] = safe_string_as_integer(xml_doc, "LiveInOther") || 0 + attributes["la"] = string_or_nil(xml_doc, "Q14ONSLACode") + attributes["income1"] = safe_string_as_integer(xml_doc, "Q2Person1Income") + attributes["income1nk"] = income_known(unsafe_string_as_integer(xml_doc, "P1IncKnown")) + attributes["inc1mort"] = unsafe_string_as_integer(xml_doc, "Q2Person1Mortgage") + attributes["income2"] = safe_string_as_integer(xml_doc, "Q2Person2Income") + attributes["income2nk"] = income_known(unsafe_string_as_integer(xml_doc, "P2IncKnown")) + attributes["savings"] = safe_string_as_integer(xml_doc, "Q3Savings") + attributes["savingsnk"] = savings_known(xml_doc) + attributes["prevown"] = unsafe_string_as_integer(xml_doc, "Q4PrevOwnedProperty") attributes["mortgage"] = safe_string_as_decimal(xml_doc, "CALCMORT") - attributes["inc2mort"] = unsafe_string_as_integer(xml_doc, "Q2PERSON2MORTAPPLICATION") - attributes["hb"] = unsafe_string_as_integer(xml_doc, "Q2A") - attributes["frombeds"] = safe_string_as_integer(xml_doc, "Q20BEDROOMS") - attributes["staircase"] = unsafe_string_as_integer(xml_doc, "Q17ASTAIRCASE") - attributes["stairbought"] = safe_string_as_integer(xml_doc, "PERCENTBOUGHT") - attributes["stairowned"] = safe_string_as_integer(xml_doc, "PERCENTOWNS") - attributes["mrent"] = safe_string_as_decimal(xml_doc, "Q28MONTHLYRENT") + attributes["inc2mort"] = unsafe_string_as_integer(xml_doc, "Q2Person2MortApplication") + attributes["hb"] = unsafe_string_as_integer(xml_doc, "Q2a") + attributes["frombeds"] = safe_string_as_integer(xml_doc, "Q20Bedrooms") + attributes["staircase"] = unsafe_string_as_integer(xml_doc, "Q17aStaircase") + attributes["stairbought"] = safe_string_as_integer(xml_doc, "PercentBought") + attributes["stairowned"] = safe_string_as_integer(xml_doc, "PercentOwns") if attributes["staircase"] == 1 + attributes["mrent"] = safe_string_as_decimal(xml_doc, "Q28MonthlyRent") attributes["exdate"] = compose_date(xml_doc, "EXDAY", "EXMONTH", "EXYEAR") attributes["exday"] = safe_string_as_integer(xml_doc, "EXDAY") attributes["exmonth"] = safe_string_as_integer(xml_doc, "EXMONTH") attributes["exyear"] = safe_string_as_integer(xml_doc, "EXYEAR") - attributes["resale"] = unsafe_string_as_integer(xml_doc, "Q17RESALE") - attributes["deposit"] = safe_string_as_decimal(xml_doc, "Q26CASHDEPOSIT") - attributes["cashdis"] = safe_string_as_decimal(xml_doc, "Q27SOCIALHOMEBUY") - attributes["disabled"] = unsafe_string_as_integer(xml_doc, "DISABILITY") - attributes["lanomagr"] = unsafe_string_as_integer(xml_doc, "Q19REHOUSED") - attributes["value"] = safe_string_as_decimal(xml_doc, "Q22PURCHASEPRICE") - attributes["equity"] = safe_string_as_decimal(xml_doc, "Q23EQUITY") - attributes["discount"] = safe_string_as_decimal(xml_doc, "Q33DISCOUNT") - attributes["grant"] = safe_string_as_decimal(xml_doc, "Q32REDUCTIONS") + attributes["resale"] = unsafe_string_as_integer(xml_doc, "Q17Resale") + attributes["deposit"] = safe_string_as_decimal(xml_doc, "Q26CashDeposit") + attributes["cashdis"] = safe_string_as_decimal(xml_doc, "Q27SocialHomeBuy") + attributes["disabled"] = unsafe_string_as_integer(xml_doc, "Disability") + attributes["lanomagr"] = unsafe_string_as_integer(xml_doc, "Q19Rehoused") + attributes["value"] = safe_string_as_decimal(xml_doc, "Q22PurchasePrice") + attributes["equity"] = safe_string_as_decimal(xml_doc, "Q23Equity") + attributes["discount"] = safe_string_as_decimal(xml_doc, "Q33Discount") + attributes["grant"] = safe_string_as_decimal(xml_doc, "Q32Reductions") attributes["pregyrha"] = 1 if string_or_nil(xml_doc, "PREGYRHA") == "Yes" attributes["pregla"] = 1 if string_or_nil(xml_doc, "PREGLA") == "Yes" attributes["pregghb"] = 1 if string_or_nil(xml_doc, "PREGHBA") == "Yes" @@ -102,33 +101,32 @@ module Imports attributes["ppostc1"] = string_or_nil(xml_doc, "PPOSTC1") attributes["ppostc2"] = string_or_nil(xml_doc, "PPOSTC2") attributes["previous_la_known"] = nil - attributes["hhregres"] = unsafe_string_as_integer(xml_doc, "ARMEDF") + attributes["hhregres"] = unsafe_string_as_integer(xml_doc, "ArmedF") attributes["hhregresstill"] = still_serving(xml_doc) - attributes["proplen"] = safe_string_as_integer(xml_doc, "Q30A") - attributes["mscharge"] = safe_string_as_decimal(xml_doc, "Q29MONTHLYCHARGES") + attributes["proplen"] = safe_string_as_integer(xml_doc, "Q16aProplen2") + attributes["mscharge"] = safe_string_as_decimal(xml_doc, "Q29MonthlyCharges") attributes["mscharge_known"] = 1 if attributes["mscharge"].present? - attributes["prevten"] = unsafe_string_as_integer(xml_doc, "Q6PREVTENURE") + attributes["prevten"] = unsafe_string_as_integer(xml_doc, "Q6PrevTenure") attributes["mortgageused"] = unsafe_string_as_integer(xml_doc, "MORTGAGEUSED") - attributes["wchair"] = unsafe_string_as_integer(xml_doc, "Q15WHEELCHAIR") + attributes["wchair"] = unsafe_string_as_integer(xml_doc, "Q15Wheelchair") attributes["armedforcesspouse"] = unsafe_string_as_integer(xml_doc, "ARMEDFORCESSPOUSE") attributes["hodate"] = compose_date(xml_doc, "HODAY", "HOMONTH", "HOYEAR") attributes["hoday"] = safe_string_as_integer(xml_doc, "HODAY") attributes["homonth"] = safe_string_as_integer(xml_doc, "HOMONTH") attributes["hoyear"] = safe_string_as_integer(xml_doc, "HOYEAR") - attributes["fromprop"] = unsafe_string_as_integer(xml_doc, "Q21PROPERTYTYPE") - attributes["socprevten"] = nil # ? + attributes["fromprop"] = unsafe_string_as_integer(xml_doc, "Q21PropertyType") + attributes["socprevten"] = unsafe_string_as_integer(xml_doc, "PrevRentType") attributes["mortgagelender"] = mortgage_lender(xml_doc, attributes) attributes["mortgagelenderother"] = nil # Q24AMORTGAGELENDEROTHER Q34AMORTGAGELENDEROTHER Q41AMORTGAGELENDEROTHER attributes["mortlen"] = mortgage_length(xml_doc, attributes) - attributes["extrabor"] = unsafe_string_as_integer(xml_doc, "Q25BORROWING") + attributes["extrabor"] = unsafe_string_as_integer(xml_doc, "Q25Borrowing") attributes["totadult"] = safe_string_as_integer(xml_doc, "TOTADULT") # would get overridden attributes["totchild"] = safe_string_as_integer(xml_doc, "TOTCHILD") # would get overridden attributes["hhtype"] = unsafe_string_as_integer(xml_doc, "HHTYPE") attributes["pcode1"] = string_or_nil(xml_doc, "PCODE1") attributes["pcode2"] = string_or_nil(xml_doc, "PCODE2") attributes["postcode_full"] = compose_postcode(xml_doc, "PCODE1", "PCODE2") - attributes["pcodenk"] = postcode_known(attributes) - # attributes["is_la_inferred"] = nil + attributes["pcodenk"] = 0 if attributes["postcode_full"].present? # known if given attributes["bulk_upload_id"] = nil attributes["saledate_check"] = nil attributes["ethnic_group2"] = nil @@ -138,9 +136,9 @@ module Imports attributes["soctenant"] = soctenant(attributes) # Required for our form invalidated questions (not present in import) - attributes["previous_la_known"] = attributes["prevloc"].nil? ? 0 : 1 - attributes["is_la_inferred"] = attributes["postcode_full"].present? - attributes["la_known"] = attributes["la"].nil? ? 0 : 1 + attributes["previous_la_known"] = 1 if attributes["prevloc"].present? && !attributes["ppostcode_full"].present? + # attributes["is_la_inferred"] = attributes["postcode_full"].present? + attributes["la_known"] = 1 if attributes["la"].present? && !attributes["postcode_full"].present? # Sets the log creator owner_id = meta_field_value(xml_doc, "owner-user-id").strip @@ -300,7 +298,7 @@ module Imports end def previous_postcode_known(xml_doc, previous_postcode, prevloc) - previous_postcode_known = string_or_nil(xml_doc, "Q7UNKNOWNPOSTCODE") + previous_postcode_known = string_or_nil(xml_doc, "Q7UnknownPostcode") if previous_postcode_known == "If postcode not known tick" || (previous_postcode.nil? && prevloc.present?) 1 elsif previous_postcode.nil? @@ -310,13 +308,8 @@ module Imports end end - def postcode_known(attributes) - return 0 if attributes["postcode_full"].present? # known if given - return 1 if attributes["la"].present? # unknown if la is given - end - def sex(xml_doc, index) - sex = string_or_nil(xml_doc, "P#{index}SEX") + sex = string_or_nil(xml_doc, "P#{index}Sex") case sex when "Male" "M" @@ -330,7 +323,7 @@ module Imports end def relat(xml_doc, index) - relat = string_or_nil(xml_doc, "P#{index}REL") + relat = string_or_nil(xml_doc, "P#{index}Rel") case relat when "Child" "C" @@ -366,22 +359,22 @@ module Imports def mortgage_lender(xml_doc, attributes) case attributes["ownershipsch"] when 1 - unsafe_string_as_integer(xml_doc, "Q24AMORTGAGELENDER") + unsafe_string_as_integer(xml_doc, "Q24aMortgageLender") when 2 - unsafe_string_as_integer(xml_doc, "Q34AMORTGAGELENDER") + unsafe_string_as_integer(xml_doc, "Q34aMortgageLender") when 3 - unsafe_string_as_integer(xml_doc, "Q41AMORTGAGELENDER") + unsafe_string_as_integer(xml_doc, "Q41aMortgageLender") end end def mortgage_length(xml_doc, attributes) case attributes["ownershipsch"] when 1 - unsafe_string_as_integer(xml_doc, "Q24B") + unsafe_string_as_integer(xml_doc, "Q24b") when 2 - unsafe_string_as_integer(xml_doc, "Q34B") + unsafe_string_as_integer(xml_doc, "Q34b") when 3 - unsafe_string_as_integer(xml_doc, "Q41B") + unsafe_string_as_integer(xml_doc, "Q41b") end end @@ -406,12 +399,21 @@ module Imports end def still_serving(xml_doc) - case unsafe_string_as_integer(xml_doc, "LEFTARMEDF") + case unsafe_string_as_integer(xml_doc, "LeftArmedF") when 4 4 when 5, 6 5 end end + + def income_known(value) + case value + when 1 #known + 0 + when 2 #unknown + 1 + end + end end end diff --git a/spec/fixtures/imports/sales_logs/00d2343e-d5fa-4c89-8400-ec3854b0f2b4.xml b/spec/fixtures/imports/sales_logs/00d2343e-d5fa-4c89-8400-ec3854b0f2b4.xml index 24c8b7b01..c48e01234 100644 --- a/spec/fixtures/imports/sales_logs/00d2343e-d5fa-4c89-8400-ec3854b0f2b4.xml +++ b/spec/fixtures/imports/sales_logs/00d2343e-d5fa-4c89-8400-ec3854b0f2b4.xml @@ -1,116 +1,331 @@ - + - - 2022-COREN + 2022-CORE-Sales 00d2343e-d5fa-4c89-8400-ec3854b0f2b4 c3061a2e6ea0b702e6f6210d5c52d2a92612d2aa 7c5bd5fb549c09a2c55d7cb90d7ba84927e64618 7c5bd5fb549c09a2c55d7cb90d7ba84927e64618 - 2022-04-14T16:01:30.369241Z - 2022-04-14T16:01:30.369241Z + 2023-02-21T12:09:45.809134Z + 2023-02-21T12:09:45.809134Z submitted-valid 2022 Manual Entry - - 1 + + Yes + 2023-01-16 + Outright ownership example + 3 No - this is an outright or other sale + + + 10 Outright + + 2 No + 1 Yes + 2 No + + 2 Yes + + + 1 + 1 Flat or maisonette + 1 Purpose built + SW1A 1AA + Westminster + E09000033 + 2 No + + + 75 + Female + 5 Retired + 1 White: English/Scottish/Welsh/Northern Irish/British + 18 United Kingdom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 Yes + + + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 +
300201
+
+ + + + + + B + + + + B + + + + + + + + + + + + + + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 16 + 1 + 2023 + + + + + + + B95 + 5HZ + SW1A + 1AA + + + + + B95 5HZ + + Stratford-on-Avon + E07000221 + + + + + + + + + + + + + + + + + + + + + + + + - 5 - 11 - 2022 - - 1 Yes - a shared ownership scheme - 18 Social Homebuy (shared ownership purchase) - - 1 Yes - 2 - 1 Yes - 2 - Yes - 30 - Non-binary - 17 Republic of Ireland - 1 Yes - Partner - 1 Flat or maisonette - 35 - 1 Purpose built - 3 White: Other - Non-binary - 1 Yes - 1 Full Time - 30 hours or more a week - 1 Full Time - 30 hours or more a week - 1 Yes - 14 - 18 - 70 - 40 - 75_000 - 1 Yes - 10_000 - 1 Yes - E08000035 - 1 Yes - 100_000 - 1 Yes - Non-binary - Non-binary - Non-binary - Non-binary - 150_000 - 9 Child under 16 - 3 In government training into work such as New Deal - 5 Retired - 1 Full Time - 30 hours or more a week - 1 Yes - 300 - 70_000 - 230_000 - 0 - 1 Yes - 10 - 10 - 1 Yes - - 10_000 - 100 - Yes - Yes - Yes - Yes - 1 Yes - 6 - 5 - 1 - 4 - - 9 = other - 1 Local authority tenant - Child - Other - Buyer prefers not to say - Buyer prefers not to say - 4 Don’t know - - 1 Yes - 1 Yes - 5 No - 6 No they left more than 2 years ago - 100 - 10 - - - If postcode not known tick - 5 - - - - - - 1 Yes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 300000 + 2 No + + + + + 300000 + + + 1 + 1 + 0 + + + 1 = 1 elder + + + 10 Outright + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + E12000007 + 1 + 1 Test + 655
diff --git a/spec/fixtures/imports/sales_logs/0b4a68df-30cc-474a-93c0-a56ce8fdad3b.xml b/spec/fixtures/imports/sales_logs/0b4a68df-30cc-474a-93c0-a56ce8fdad3b.xml index e42a0f3b5..602a4dd42 100644 --- a/spec/fixtures/imports/sales_logs/0b4a68df-30cc-474a-93c0-a56ce8fdad3b.xml +++ b/spec/fixtures/imports/sales_logs/0b4a68df-30cc-474a-93c0-a56ce8fdad3b.xml @@ -1,13 +1,12 @@ - - + - 2022-CORE + 2022-CORE-Sales 0b4a68df-30cc-474a-93c0-a56ce8fdad3b c3061a2e6ea0b702e6f6210d5c52d2a92612d2aa 7c5bd5fb549c09z2c55d9cb90d7ba84927e64618 7c5bd5fb549c09z2c55d9cb90d7ba84927e64618 - 2022-01-05T12:50:20.39153Z - 2022-01-05T12:50:20.39153Z + 2023-02-21T11:54:51.786722Z + 2023-02-21T11:54:51.786722Z submitted-valid 2022 Manual Entry @@ -15,96 +14,318 @@ - 1 + Yes + 2023-02-01 + Discount ownership example + 2 Yes - a discount ownership scheme + + 14 Preserved Right to Buy (PRTB) + + + + + 2 No + + 1 No + + + 3 + 3 House + 1 Purpose built + SW1A 1AA + Westminster + E09000033 + 3 Don’t know + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 Yes + + + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 134750 + 1 + 0 + 0 + 0 + 1 +
300200
+
+ + + + + + + + + + + + + + + + + + + + + + + + 0 + 1 + 0 + 1 + 0 + 0 + 0 + 1 + 2 + 2023 + + + + + + + GL51 + 9EX + SW1A + 1AA + + + + + GL51 9EX + + Cheltenham + E07000078 + + + + + + + + + + + + + + + + + + + + + + + + - 5 - 11 - 2022 - 2 Yes - a discount ownership scheme - 8 Right to Acquire (RTA) - - 1 Yes - 2 - 1 Yes - 1 - - 30 - Non-binary - 17 Republic of Ireland - 1 Yes - Partner - 1 Flat or maisonette - 35 - 1 Purpose built - 3 White: Other - Non-binary - 1 Yes - 1 Full Time - 30 hours or more a week - 1 Full Time - 30 hours or more a week - 1 Yes - 14 - 18 - 70 - 40 - 75_000 - 1 Yes - 10_000 - 1 Yes - E08000035 - 1 Yes - 100_000 - 1 Yes - Non-binary - Non-binary - Non-binary - Non-binary - 150_000 - 9 Child under 16 - 3 In government training into work such as New Deal - 5 Retired - 1 Full Time - 30 hours or more a week - 1 Yes - 90_000 - - 250_000 - 10_000 - - 10 - Yes - Yes - Yes - Yes - 1 Yes - 6 - 5 - 1 - 4 - - 9 = other - 1 Local authority tenant - Child - Other - Buyer prefers not to say - Buyer prefers not to say - 4 Don’t know - - 1 Yes - 1 Yes - 5 No - 6 No they left more than 2 years ago - 100 - - 10 - - If postcode not known tick - - 5 - - - - - 1 Yes + + + + + + + + + + + + + + + + + + + + + + + + + + 275000 + + 51 + 1 Yes + 134750 + Halifax + + 2 No + 0 + 0.00 + + + + + + + + + + + + 1 + 1 + 0 + + + 3 = 1 adult + + + 14 Preserved Right to Buy (PRTB) + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + E12000007 + 1 + 1 Test + 655
diff --git a/spec/fixtures/imports/sales_logs/0ead17cb-1668-442d-898c-0d52879ff592.xml b/spec/fixtures/imports/sales_logs/0ead17cb-1668-442d-898c-0d52879ff592.xml index 4612ae236..46bb69b9a 100644 --- a/spec/fixtures/imports/sales_logs/0ead17cb-1668-442d-898c-0d52879ff592.xml +++ b/spec/fixtures/imports/sales_logs/0ead17cb-1668-442d-898c-0d52879ff592.xml @@ -1,132 +1,331 @@ - - - - - 2022-CORE + + + 2022-CORE-Sales 0ead17cb-1668-442d-898c-0d52879ff592 - c3061a2e6ea0b702e6f6210d5c52d2a92612d2aa - - 7c5bd5fb549c09a2c55d7cb90d7ba84927e64618 - - 7c5bd5fb549c09a2c55d7cb90d7ba84927e64618 - - 2021-10-08T14:48:17.096123Z - 2021-10-08T14:48:17.096123Z + c3061a2e6ea0b702e6f6210d5c52d2a92612d2aa + 7c5bd5fb549c09a2c55d7cb90d7ba84927e64618 + 7c5bd5fb549c09a2c55d7cb90d7ba84927e64618 + 2023-02-21T11:48:28.255968Z + 2023-02-21T11:49:27.630543Z submitted-valid - 2021 + 2022 Manual Entry - 1 + Yes + 2023-01-17 + Shared ownership example + 1 Yes - a shared ownership scheme + 2 Shared Ownership + + + + 2 No + 1 Yes + 2 No + + 2 Yes -5 - 11 - 2022 - - 1 Yes - a shared ownership scheme - 2 Shared Ownership - - 1 Yes - 2 - 1 Yes - 2 - Yes - 30 - Non-binary - 17 Republic of Ireland - 1 Yes - Partner - 1 Flat or maisonette - 35 - 1 Purpose built - 3 White: Other - Non-binary - 1 Yes - 1 Full Time - 30 hours or more a week - 1 Full Time - 30 hours or more a week - 1 Yes - 14 - 18 - 70 - 40 - 75_000 - 1 Yes - 10_000 - 1 Yes - E08000035 - 1 Yes - 100_000 - 1 Yes - Non-binary - Non-binary - Non-binary - Non-binary - 150_000 - 9 Child under 16 - 3 In government training into work such as New Deal - 5 Retired - 1 Full Time - 30 hours or more a week - 1 Yes - 300 - 70_000 - 220_000 - 0 - 1 Yes - 10 - 10 - 1 Yes - - - 100 + 2 + 1 Flat or maisonette + 1 Purpose built + SW1A 1AA + Westminster + E09000033 + 3 Don’t know + + + 30 + Male + 1 Full Time - 30 hours or more a week + 2 White: Irish + 18 United Kingdom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 Yes + + + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 76000 + 1 + 47000 + 0 + 235000 + 0 +
300199
+
+ + + + + + + + + + + + + + + + + + + + + + + + 1 + 0 + 0 + 1 + 1 + 2 + 3 + 17 + 1 + 2023 + 6 + 9 + 2022 + 8 + 1 + 2023 + SW14 + 7QP + SW1A + 1AA + + + + 2 Private registered provider (PRP) or housing association tenant + SW14 7QP + + Richmond-upon-Thames + E09000027 Yes - Yes - Yes - Yes - 1 Yes - 6 - 5 - 1 - 4 - - 9 = other - 1 Local authority tenant - Child - Other - Buyer prefers not to say - Buyer prefers not to say - 4 Don’t know - - 1 Yes - 1 Yes - 5 No - 4 Yes - 100 - 10 - - - If postcode not known tick - 5 - - - - - - 1 Yes + + + + + + + 8 Don’t know + + + 2 No + 2 No + + + 1 Yes + 47000 + 1 Yes + + + + 4 Don’t know + 1 Yes + 89000 + + + + + 2 No + + 30 + 2 No + 2023-01-08 + 2022-09-06 + 2 No + + + + 550000 + 30 + 1 Yes + 76000 + Nationwide + 33 + 2 No + 89000 + + 912.00 + 134.24 + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 1 + 0 + + + 3 = 1 adult + + + 2 Shared Ownership + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + + + + + E12000007 + 1 + 1 Test + 655
diff --git a/spec/fixtures/imports/sales_logs/166fc004-392e-47a8-acb8-1c018734882b.xml b/spec/fixtures/imports/sales_logs/166fc004-392e-47a8-acb8-1c018734882b.xml index 42bfab90d..83c3f9a4c 100644 --- a/spec/fixtures/imports/sales_logs/166fc004-392e-47a8-acb8-1c018734882b.xml +++ b/spec/fixtures/imports/sales_logs/166fc004-392e-47a8-acb8-1c018734882b.xml @@ -1,112 +1,331 @@ - - + - 2022-CORE + 2022-CORE-Sales 166fc004-392e-47a8-acb8-1c018734882b c3061a2e6ea0b702e6f6210d5c52d2a92612d2aa 7c5bd5fb549c09a2c55d7cb90d7ba84927e64618 7c5bd5fb549c09a2c55d7cb90d7ba84927e64618 - 2022-04-12T14:10:59.953121Z - 2022-04-12T14:10:59.953121Z + 2023-02-21T11:48:28.255968Z + 2023-02-21T11:49:27.630543Z submitted-valid - 2021 + 2022 Manual Entry - 1 + Yes + 2023-01-17 + Shared ownership example + 1 Yes - a shared ownership scheme + 2 Shared Ownership + + + + 2 No + 1 Yes + 2 No + + 2 Yes - 5 - 11 - 2022 - 3 No - this is an outright or other sale - 12 Other - other - 2 No - 1 Yes - 2 - 1 Yes - 2 - Yes - 30 - Non-binary - 17 Republic of Ireland - 1 Yes - 1 Yes - Partner - 1 Flat or maisonette - 35 - 1 Purpose built - 3 White: Other - Non-binary - 1 Yes - 1 Full Time - 30 hours or more a week - 1 Full Time - 30 hours or more a week - 1 Yes - 14 - 18 - 70 - 40 - 75_000 - 1 Yes - 10_000 - 1 Yes - E08000035 - 1 Yes - 100_000 - 1 Yes - Non-binary - Non-binary - Non-binary - Non-binary - 150_000 - 9 Child under 16 - 3 In government training into work such as New Deal - 5 Retired - 1 Full Time - 30 hours or more a week - 1 Yes - 90_000 - - 250_000 - - - + 2 + 1 Flat or maisonette + 1 Purpose built + SW1A 1AA + Westminster + E09000033 + 3 Don’t know + + + 30 + Male + 1 Full Time - 30 hours or more a week + 2 White: Irish + 18 United Kingdom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 Yes + + + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 76000 + 1 + 47000 + 0 + 235000 + 0 +
300199
+
+ + + + + + + + + + + + + + + + + + + + + + + + 1 + 0 + 0 + 1 + 1 + 2 + 3 + 17 + 1 + 2023 + 6 + 9 + 2022 + 8 + 1 + 2023 + SW14 + 7QP + SW1A + 1AA + + + + 2 Private registered provider (PRP) or housing association tenant + SW14 7QP + + Richmond-upon-Thames + E09000027 Yes - Yes - Yes - Yes - 1 Yes - 6 - 5 - 1 - 4 - - 9 = other - 1 Local authority tenant - Child - Other - Buyer prefers not to say - Buyer prefers not to say - 4 Don’t know - - 1 Yes - 1 Yes - 5 No - 6 No they left more than 2 years ago - 100 - - - 10 - If postcode not known tick - - - 5 - - - - 1 Yes + + + + + + + 8 Don’t know + + + 2 No + 2 No + + + 1 Yes + 47000 + 1 Yes + + + + 4 Don’t know + 1 Yes + 89000 + + + + + 2 No + + 30 + 2 No + 2023-01-08 + 2022-09-06 + 2 No + + + + 550000 + 30 + 1 Yes + 76000 + Nationwide + 33 + 2 No + 89000 + + 912.00 + 134.24 + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 1 + 0 + + + 3 = 1 adult + + + 2 Shared Ownership + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + + + + + E12000007 + 1 + 1 Test + 655
diff --git a/spec/fixtures/imports/sales_logs/5ybz29dj-l33t-k1l0-hj86-n4k4ma77xkcd.xml b/spec/fixtures/imports/sales_logs/5ybz29dj-l33t-k1l0-hj86-n4k4ma77xkcd.xml index 57ade3297..47249accc 100644 --- a/spec/fixtures/imports/sales_logs/5ybz29dj-l33t-k1l0-hj86-n4k4ma77xkcd.xml +++ b/spec/fixtures/imports/sales_logs/5ybz29dj-l33t-k1l0-hj86-n4k4ma77xkcd.xml @@ -1,111 +1,331 @@ - - + - 2022-CORE + 2022-CORE-Sales 5ybz29dj-l33t-k1l0-hj86-n4k4ma77xkcd e29c492473446dca4d50224f2bb7cf965a261d6f 7c5bd5fb549c09a2c55d7cb90d7ba84927e64618 7c5bd5fb549c09a2c55d7cb90d7ba84927e64618 - 2022-04-11T13:46:23.953121Z - 2022-04-11T13:46:23.953121Z + 2023-02-21T11:48:28.255968Z + 2023-02-21T11:49:27.630543Z submitted-valid - 2021 + 2022 Manual Entry - 1 + Yes + 2023-01-17 + Shared ownership example + 1 Yes - a shared ownership scheme + 2 Shared Ownership + + + + 2 No + 1 Yes + 2 No + + 2 Yes -5 - 11 - 2022 - 3 No - this is an outright or other sale - 10 Outright - 2 No - 1 Yes - 2 - 1 Yes - 2 - Yes - 30 - Non-binary - 17 Republic of Ireland - 1 Yes - 1 Yes - Partner - 1 Flat or maisonette - 35 - 1 Purpose built - - - 1 Yes - 1 Full Time - 30 hours or more a week - 1 Full Time - 30 hours or more a week - 1 Yes - 14 - 18 - 70 - 40 - 75_000 - 1 Yes - 10_000 - 1 Yes - E08000035 - 1 Yes - 100_000 - 1 Yes - Non-binary - Non-binary - Non-binary - Non-binary - 150_000 - 9 Child under 16 - 3 In government training into work such as New Deal - 5 Retired - 1 Full Time - 30 hours or more a week - 1 Yes - 90_000 - - 250_000 - - - + 2 + 1 Flat or maisonette + 1 Purpose built + SW1A 1AA + Westminster + E09000033 + 3 Don’t know + + + 30 + Male + 1 Full Time - 30 hours or more a week + 2 White: Irish + 18 United Kingdom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 Yes + + + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 76000 + 1 + 47000 + 0 + 235000 + 0 +
300199
+
+ + + + + + + + + + + + + + + + + + + + + + + + 1 + 0 + 0 + 1 + 1 + 2 + 3 + 17 + 1 + 2023 + 6 + 9 + 2022 + 8 + 1 + 2023 + SW14 + 7QP + SW1A + 1AA + + + + 2 Private registered provider (PRP) or housing association tenant + SW14 7QP + + Richmond-upon-Thames + E09000027 Yes - Yes - Yes - Yes - 1 Yes - 6 - 5 - 1 - 4 - - 9 = other - 1 Local authority tenant - Child - Other - Buyer prefers not to say - Buyer prefers not to say - 4 Don’t know - - 1 Yes - 1 Yes - 5 No - 5 No they left up to and including 2 years ago - 100 - - - 10 - If postcode not known tick - - - 5 - - - - 1 Yes + + + + + + + 8 Don’t know + + + 2 No + 2 No + + + 1 Yes + 47000 + 1 Yes + + + + 4 Don’t know + 1 Yes + 89000 + + + + + 2 No + + 30 + 2 No + 2023-01-08 + 2022-09-06 + 2 No + + + + 550000 + 30 + 1 Yes + 76000 + Nationwide + 33 + 2 No + 89000 + + 912.00 + 134.24 + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 1 + 0 + + + 3 = 1 adult + + + 2 Shared Ownership + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + + + + + E12000007 + 1 + 1 Test + 655
diff --git a/spec/fixtures/imports/sales_logs/893ufj2s-lq77-42m4-rty6-ej09gh585uy1.xml b/spec/fixtures/imports/sales_logs/893ufj2s-lq77-42m4-rty6-ej09gh585uy1.xml index 4a2f9218d..61063c217 100644 --- a/spec/fixtures/imports/sales_logs/893ufj2s-lq77-42m4-rty6-ej09gh585uy1.xml +++ b/spec/fixtures/imports/sales_logs/893ufj2s-lq77-42m4-rty6-ej09gh585uy1.xml @@ -1,13 +1,12 @@ - - + - 2022-CORE= + 2022-CORE-Sales 893ufj2s-lq77-42m4-rty6-ej09gh585uy1 c3061a2e6ea0b702e6f6210d5c52d2a92612d2aa 7c5bd5fb549c09a2c55d7cb90d7ba84927e64618 7c5bd5fb549c09a2c55d7cb90d7ba84927e64618 - 2022-04-11T13:46:23.953121Z - 2022-04-11T13:46:23.953121Z + 2023-02-21T11:48:28.255968Z + 2023-02-21T11:49:27.630543Z submitted-valid 2022 Manual Entry @@ -15,96 +14,318 @@ - 1 + Yes + 2023-01-17 + Shared ownership example + 1 Yes - a shared ownership scheme + 2 Shared Ownership + + + + 2 No + 1 Yes + 2 No + + 2 Yes -5 - 11 - 2022 - 2 Yes - a discount ownership scheme - 8 Right to Acquire (RTA) - - 1 Yes - 2 - 1 Yes - 2 - Yes - 30 - Non-binary - 17 Republic of Ireland - 1 Yes - Partner - 1 Flat or maisonette - 35 - 1 Purpose built - 3 White: Other - Non-binary - 1 Yes - 1 Full Time - 30 hours or more a week - 1 Full Time - 30 hours or more a week - 1 Yes - 14 - 18 - 70 - 40 - 75_000 - 1 Yes - - 1 Yes - E08000035 - 1 Yes - 100_000 - 1 Yes - Non-binary - Non-binary - Non-binary - Non-binary - - 9 Child under 16 - 3 In government training into work such as New Deal - 5 Retired - 1 Full Time - 30 hours or more a week - 1 Yes - 90_000 - - 250_000 - 10_000 - - 10 + 2 + 1 Flat or maisonette + 1 Purpose built + SW1A 1AA + Westminster + E09000033 + 3 Don’t know + + + 30 + Male + 1 Full Time - 30 hours or more a week + 2 White: Irish + 18 United Kingdom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 Yes + + + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 76000 + 1 + 47000 + 0 + 235000 + 0 +
300199
+
+ + + + + + + + + + + + + + + + + + + + + + + + 1 + 0 + 0 + 1 + 1 + 2 + 3 + 17 + 1 + 2023 + 6 + 9 + 2022 + 8 + 1 + 2023 + SW14 + 7QP + SW1A + 1AA + + + + 2 Private registered provider (PRP) or housing association tenant + SW14 7QP + + Richmond-upon-Thames + E09000027 Yes - Yes - Yes - Yes - 1 Yes - 6 - 5 - 1 - 4 - - 9 = other - 1 Local authority tenant - Child - Other - Buyer prefers not to say - Buyer prefers not to say - 4 Don’t know - - 1 Yes - 1 Yes - 5 No - 6 No they left more than 2 years ago - 100 - - 10 - - If postcode not known tick - - 5 - - - - - 1 Yes + + + + + + + 8 Don’t know + + + 2 No + 2 No + + + 1 Yes + 47000 + 1 Yes + + + + 4 Don’t know + 1 Yes + 89000 + + + + + 2 No + + 30 + 2 No + 2023-01-08 + 2022-09-06 + 2 No + + + + 550000 + 30 + 1 Yes + 76000 + Nationwide + 33 + 2 No + 89000 + + 912.00 + 134.24 + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 1 + 0 + + + 3 = 1 adult + + + 2 Shared Ownership + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + + + + + E12000007 + 1 + 1 Test + 655