diff --git a/app/services/exports/lettings_log_export_service.rb b/app/services/exports/lettings_log_export_service.rb index 8fafe28e9..5cc7cac00 100644 --- a/app/services/exports/lettings_log_export_service.rb +++ b/app/services/exports/lettings_log_export_service.rb @@ -203,6 +203,9 @@ module Exports attribute_hash["created_by"] = lettings_log.created_by&.email attribute_hash["amended_by"] = lettings_log.updated_by&.email + attribute_hash["la"] = lettings_log.la + attribute_hash["postcode_full"] = lettings_log.postcode_full + # Supported housing fields if lettings_log.is_supported_housing? attribute_hash["unittype_sh"] = lettings_log.unittype_sh diff --git a/spec/fixtures/exports/supported_housing_logs.xml b/spec/fixtures/exports/supported_housing_logs.xml index 73595e76f..0f7065b62 100644 --- a/spec/fixtures/exports/supported_housing_logs.xml +++ b/spec/fixtures/exports/supported_housing_logs.xml @@ -82,7 +82,7 @@ 4 MYPROP - E09000003 + E09000033 E07000105 6 1 diff --git a/spec/services/exports/lettings_log_export_service_spec.rb b/spec/services/exports/lettings_log_export_service_spec.rb index 3913547e8..a5e41dfd3 100644 --- a/spec/services/exports/lettings_log_export_service_spec.rb +++ b/spec/services/exports/lettings_log_export_service_spec.rb @@ -425,6 +425,9 @@ RSpec.describe Exports::LettingsLogExportService do let(:lettings_log) { FactoryBot.create(:lettings_log, :completed, :export, :sh, scheme:, location:, created_by: user, updated_by: other_user, owning_organisation: organisation, startdate: Time.zone.local(2022, 2, 2, 10, 36, 49), voiddate: Time.zone.local(2019, 11, 3), mrcdate: Time.zone.local(2020, 5, 5, 10, 36, 49), underoccupation_benefitcap: 4, sheltered: 1) } before do + lettings_log.postcode_full = nil + lettings_log.la = nil + lettings_log.save!(validate: false) FactoryBot.create(:location, scheme:, startdate: Time.zone.local(2021, 4, 1), units: nil) end