Browse Source

CLDC-2352 Infer uprn_known in 23/24 sales bulk upload (#1625)

* feat: infer uprn_known

* feat: add test

* refactor: lint

* feat: process postcode changes to clear la etc when uprn errors clear values

* feat: revert previous (moved to CLDC-2357 instead)

* feat: revert previous (moved to CLDC-2357 instead)
pull/1624/head
natdeanlewissoftwire 2 years ago committed by GitHub
parent
commit
f662536c14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      app/services/bulk_upload/sales/year2023/row_parser.rb
  2. 18
      spec/services/bulk_upload/sales/year2023/row_parser_spec.rb

1
app/services/bulk_upload/sales/year2023/row_parser.rb

@ -823,6 +823,7 @@ private
attributes["mortgageused"] = mortgageused
attributes["uprn"] = field_19
attributes["uprn_known"] = field_19.present? ? 1 : 0
attributes["address_line1"] = field_20
attributes["address_line2"] = field_21
attributes["town_or_city"] = field_22

18
spec/services/bulk_upload/sales/year2023/row_parser_spec.rb

@ -662,6 +662,24 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do
end
end
describe "#uprn_known" do
context "when uprn known" do
let(:attributes) { setup_section_params.merge({ field_19: "100023336956" }) }
it "is correctly set" do
expect(parser.log.uprn_known).to be(1)
end
end
context "when uprn not known" do
let(:attributes) { setup_section_params.merge({ field_19: nil }) }
it "is correctly set" do
expect(parser.log.uprn_known).to be(0)
end
end
end
describe "#address_line1" do
let(:attributes) { setup_section_params.merge({ field_20: "some street" }) }

Loading…
Cancel
Save