diff --git a/app/services/imports/lettings_logs_import_service.rb b/app/services/imports/lettings_logs_import_service.rb index 702140454..b5f2d02b9 100644 --- a/app/services/imports/lettings_logs_import_service.rb +++ b/app/services/imports/lettings_logs_import_service.rb @@ -202,15 +202,13 @@ module Imports attributes["first_time_property_let_as_social_housing"] = first_time_let(attributes["rsnvac"]) attributes["declaration"] = declaration(xml_doc) - if attributes["startdate"] >= Time.zone.local(2023, 4, 1) - attributes["uprn"] = string_or_nil(xml_doc, "UPRN") - attributes["uprn_known"] = attributes["uprn"].present? ? 1 : 0 - attributes["uprn_confirmed"] = attributes["uprn"].present? ? 1 : 0 - attributes["address_line1"] = string_or_nil(xml_doc, "AddressLine1") - attributes["address_line2"] = string_or_nil(xml_doc, "AddressLine2") - attributes["town_or_city"] = string_or_nil(xml_doc, "TownCity") - attributes["county"] = string_or_nil(xml_doc, "County") - end + attributes["uprn"] = string_or_nil(xml_doc, "UPRN") + attributes["uprn_known"] = attributes["uprn"].present? ? 1 : 0 + attributes["uprn_confirmed"] = attributes["uprn"].present? ? 1 : 0 + attributes["address_line1"] = string_or_nil(xml_doc, "AddressLine1") + attributes["address_line2"] = string_or_nil(xml_doc, "AddressLine2") + attributes["town_or_city"] = string_or_nil(xml_doc, "TownCity") + attributes["county"] = string_or_nil(xml_doc, "County") set_partial_charges_to_zero(attributes) @@ -377,7 +375,7 @@ module Imports end def fields_not_present_in_softwire_data - %w[majorrepairs illness_type_0 tshortfall_known pregnancy_value_check retirement_value_check rent_value_check net_income_value_check major_repairs_date_value_check void_date_value_check carehome_charges_value_check housingneeds_type housingneeds_other created_by] + %w[majorrepairs illness_type_0 tshortfall_known pregnancy_value_check retirement_value_check rent_value_check net_income_value_check major_repairs_date_value_check void_date_value_check carehome_charges_value_check housingneeds_type housingneeds_other created_by uprn_known uprn_confirmed] end def check_status_completed(lettings_log, previous_status) diff --git a/app/services/imports/sales_logs_import_service.rb b/app/services/imports/sales_logs_import_service.rb index 80ce31f30..0f97df89a 100644 --- a/app/services/imports/sales_logs_import_service.rb +++ b/app/services/imports/sales_logs_import_service.rb @@ -154,27 +154,26 @@ module Imports attributes["buyer_livein_value_check"] = 0 attributes["percentage_discount_value_check"] = 0 - if attributes["saledate"] >= Time.zone.local(2023, 4, 1) - attributes["uprn"] = string_or_nil(xml_doc, "UPRN") - attributes["uprn_known"] = attributes["uprn"].present? ? 1 : 0 - attributes["uprn_confirmed"] = attributes["uprn"].present? ? 1 : 0 - attributes["address_line1"] = string_or_nil(xml_doc, "AddressLine1") - attributes["address_line2"] = string_or_nil(xml_doc, "AddressLine2") - attributes["town_or_city"] = string_or_nil(xml_doc, "TownCity") - attributes["county"] = string_or_nil(xml_doc, "County") - - attributes["proplen_asked"] = 0 if attributes["proplen"]&.positive? - attributes["proplen_asked"] = 1 if attributes["proplen"]&.zero? - - attributes["prevshared"] = unsafe_string_as_integer(xml_doc, "PREVSHARED") - attributes["ethnicbuy2"] = unsafe_string_as_integer(xml_doc, "P2Eth") - attributes["ethnic_group2"] = ethnic_group(attributes["ethnicbuy2"]) - attributes["nationalbuy2"] = unsafe_string_as_integer(xml_doc, "P2Nat") - attributes["buy2living"] = unsafe_string_as_integer(xml_doc, "buy2livein") - - attributes["staircasesale"] = unsafe_string_as_integer(xml_doc, "STAIRCASESALE") - attributes["prevtenbuy2"] = unsafe_string_as_integer(xml_doc, "PREVTENBUY2") - end + # 2023/34 attributes + attributes["uprn"] = string_or_nil(xml_doc, "UPRN") + attributes["uprn_known"] = attributes["uprn"].present? ? 1 : 0 + attributes["uprn_confirmed"] = attributes["uprn"].present? ? 1 : 0 + attributes["address_line1"] = string_or_nil(xml_doc, "AddressLine1") + attributes["address_line2"] = string_or_nil(xml_doc, "AddressLine2") + attributes["town_or_city"] = string_or_nil(xml_doc, "TownCity") + attributes["county"] = string_or_nil(xml_doc, "County") + + attributes["proplen_asked"] = 0 if attributes["proplen"]&.positive? + attributes["proplen_asked"] = 1 if attributes["proplen"]&.zero? + + attributes["prevshared"] = unsafe_string_as_integer(xml_doc, "PREVSHARED") + attributes["ethnicbuy2"] = unsafe_string_as_integer(xml_doc, "P2Eth") + attributes["ethnic_group2"] = ethnic_group(attributes["ethnicbuy2"]) + attributes["nationalbuy2"] = unsafe_string_as_integer(xml_doc, "P2Nat") + attributes["buy2living"] = unsafe_string_as_integer(xml_doc, "buy2livein") + + attributes["staircasesale"] = unsafe_string_as_integer(xml_doc, "STAIRCASESALE") + attributes["prevtenbuy2"] = unsafe_string_as_integer(xml_doc, "PREVTENBUY2") # Sets the log creator owner_id = meta_field_value(xml_doc, "owner-user-id").strip @@ -589,11 +588,9 @@ module Imports attributes["relat2"] ||= "R" attributes["inc2mort"] ||= 3 attributes["buy2livein"] ||= 1 unless attributes["ownershipsch"] == 3 - if attributes["saledate"] >= Time.zone.local(2023, 4, 1) - attributes["ethnic_group2"] ||= 17 - attributes["ethnicbuy2"] ||= 17 - attributes["nationalbuy2"] ||= 13 - end + attributes["ethnic_group2"] ||= 17 + attributes["ethnicbuy2"] ||= 17 + attributes["nationalbuy2"] ||= 13 end # other household members characteristics