diff --git a/app/services/bulk_upload/lettings/year2023/row_parser.rb b/app/services/bulk_upload/lettings/year2023/row_parser.rb index 094c63d45..c1a19ef93 100644 --- a/app/services/bulk_upload/lettings/year2023/row_parser.rb +++ b/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 diff --git a/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb index d172321df..63531deb5 100644 --- a/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb @@ -2258,10 +2258,20 @@ 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(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