Browse Source

Export la and postcode for logs with locations (#1985)

pull/1959/head v0.3.68
kosiakkatrina 1 year ago committed by GitHub
parent
commit
52be9734ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      app/services/exports/lettings_log_export_service.rb
  2. 2
      spec/fixtures/exports/supported_housing_logs.xml
  3. 3
      spec/services/exports/lettings_log_export_service_spec.rb

3
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["created_by"] = lettings_log.created_by&.email
attribute_hash["amended_by"] = lettings_log.updated_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 # Supported housing fields
if lettings_log.is_supported_housing? if lettings_log.is_supported_housing?
attribute_hash["unittype_sh"] = lettings_log.unittype_sh attribute_hash["unittype_sh"] = lettings_log.unittype_sh

2
spec/fixtures/exports/supported_housing_logs.xml vendored

@ -82,7 +82,7 @@
<irproduct_other/> <irproduct_other/>
<reason>4</reason> <reason>4</reason>
<propcode>MYPROP</propcode> <propcode>MYPROP</propcode>
<la>E09000003</la> <la>E09000033</la>
<prevloc>E07000105</prevloc> <prevloc>E07000105</prevloc>
<hb>6</hb> <hb>6</hb>
<hbrentshortfall>1</hbrentshortfall> <hbrentshortfall>1</hbrentshortfall>

3
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) } 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 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) FactoryBot.create(:location, scheme:, startdate: Time.zone.local(2021, 4, 1), units: nil)
end end

Loading…
Cancel
Save