Browse Source

add #la to bulk upload

pull/1148/head
Phil Lee 3 years ago
parent
commit
12b7fcbb60
  1. 2
      app/services/bulk_upload/lettings/row_parser.rb
  2. 8
      spec/services/bulk_upload/lettings/row_parser_spec.rb

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

@ -214,6 +214,7 @@ private
tenancycode: [:field_7], tenancycode: [:field_7],
postcode_known: %i[field_107 field_108 field_109], postcode_known: %i[field_107 field_108 field_109],
postcode_full: %i[field_107 field_108 field_109], postcode_full: %i[field_107 field_108 field_109],
la: %i[field_107],
owning_organisation_id: [:field_111], owning_organisation_id: [:field_111],
managing_organisation_id: [:field_113], managing_organisation_id: [:field_113],
renewal: [:field_134], renewal: [:field_134],
@ -408,6 +409,7 @@ private
attributes["lettype"] = field_1 attributes["lettype"] = field_1
attributes["tenancycode"] = field_7 attributes["tenancycode"] = field_7
attributes["la"] = field_107
attributes["postcode_known"] = postcode_known attributes["postcode_known"] = postcode_known
attributes["postcode_full"] = postcode_full attributes["postcode_full"] = postcode_full
attributes["owning_organisation_id"] = owning_organisation_id attributes["owning_organisation_id"] = owning_organisation_id

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

@ -689,5 +689,13 @@ RSpec.describe BulkUpload::Lettings::RowParser do
expect(parser.log.postcode_full).to eql("EC1N 2TD") expect(parser.log.postcode_full).to eql("EC1N 2TD")
end end
end end
describe "#la" do
let(:attributes) { { bulk_upload:, field_107: "E07000223" } }
it "sets to given value" do
expect(parser.log.la).to eql("E07000223")
end
end
end end
end end

Loading…
Cancel
Save