Browse Source

CLDC-3034 Ignore household charge in general needs bulk uploads (#2123)

* feat: ignore household_charge for general needs logs

* feat: add tests

* feat: add tests

* refactor: lint
pull/2128/head
natdeanlewissoftwire 12 months ago committed by GitHub
parent
commit
763094eb0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/services/bulk_upload/lettings/year2023/row_parser.rb
  2. 12
      spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb

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

@ -1193,7 +1193,7 @@ private
attributes["tcharge"] = field_132
attributes["chcharge"] = field_127
attributes["is_carehome"] = field_127.present? ? 1 : 0
attributes["household_charge"] = field_125
attributes["household_charge"] = supported_housing? ? field_125 : nil
attributes["hbrentshortfall"] = field_133
attributes["tshortfall_known"] = tshortfall_known
attributes["tshortfall"] = field_134

12
spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb

@ -2258,12 +2258,22 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
end
describe "#household_charge" do
let(:attributes) { { bulk_upload:, field_125: "1" } }
context "when log is general needs" do
let(:attributes) { { bulk_upload:, field_4: 1, field_125: "1" } }
it "sets correct value from mapping" do
expect(parser.log.household_charge).to eq(nil)
end
end
context "when log is supported housing" do
let(:attributes) { { bulk_upload:, field_4: 2, field_125: "1" } }
it "sets correct value from mapping" do
expect(parser.log.household_charge).to eq(1)
end
end
end
describe "#chcharge" do
let(:attributes) { { bulk_upload:, field_127: "123.45" } }

Loading…
Cancel
Save