Browse Source

fix bulk upload mapping for homeless field

remotes/origin/bulk-upload-errors-integration
Phil Lee 3 years ago
parent
commit
d409a142b2
  1. 11
      app/services/bulk_upload/lettings/row_parser.rb
  2. 4
      spec/services/bulk_upload/lettings/row_parser_spec.rb

11
app/services/bulk_upload/lettings/row_parser.rb

@ -407,7 +407,7 @@ private
attributes["waityear"] = field_67 attributes["waityear"] = field_67
attributes["reason"] = field_52 attributes["reason"] = field_52
attributes["prevten"] = field_61 attributes["prevten"] = field_61
attributes["homeless"] = field_68 attributes["homeless"] = homeless
attributes["ppcodenk"] = field_65 attributes["ppcodenk"] = field_65
attributes["ppostcode_full"] = ppostcode_full attributes["ppostcode_full"] = ppostcode_full
@ -441,6 +441,15 @@ private
attributes attributes
end end
def homeless
case field_68
when 1
1
when 12
11
end
end
def renewal def renewal
case field_134 case field_134
when 1 when 1

4
spec/services/bulk_upload/lettings/row_parser_spec.rb

@ -65,7 +65,7 @@ RSpec.describe BulkUpload::Lettings::RowParser do
field_103: "1", field_103: "1",
field_104: "1", field_104: "1",
field_101: "1", field_101: "1",
field_133: "1", field_133: "2",
field_8: "1", field_8: "1",
field_9: "2", field_9: "2",
field_132: "1", field_132: "1",
@ -96,7 +96,7 @@ RSpec.describe BulkUpload::Lettings::RowParser do
field_66: "5", field_66: "5",
field_67: "2", field_67: "2",
field_52: "1", field_52: "31",
field_61: "3", field_61: "3",
field_68: "12", field_68: "12",

Loading…
Cancel
Save