Browse Source

fix mapping of #ppcodenk for bulk upload

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

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

@ -486,7 +486,7 @@ private
attributes["prevten"] = field_61
attributes["homeless"] = homeless
attributes["ppcodenk"] = field_65
attributes["ppcodenk"] = ppcodenk
attributes["ppostcode_full"] = ppostcode_full
attributes["reasonpref"] = field_69
@ -537,6 +537,15 @@ private
attributes
end
def ppcodenk
case field_65
when 1
1
when 2
0
end
end
def earnings
field_50.round if field_50.present?
end

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

@ -565,5 +565,13 @@ RSpec.describe BulkUpload::Lettings::RowParser do
expect(parser.log.reasonother).to eql("some other reason")
end
end
describe "#ppcodenk" do
let(:attributes) { { bulk_upload:, field_65: "2" } }
it "sets correct value from mapping" do
expect(parser.log.ppcodenk).to eq(0)
end
end
end
end

Loading…
Cancel
Save