Browse Source

Update import to set value_chech to yes

pull/1410/head
Kat 3 years ago
parent
commit
eb16bcab9e
  1. 3
      app/services/imports/lettings_logs_import_service.rb
  2. 2
      spec/services/csv/lettings_log_csv_service_spec.rb
  3. 21
      spec/services/imports/lettings_logs_import_service_spec.rb

3
app/services/imports/lettings_logs_import_service.rb

@ -235,6 +235,7 @@ module Imports
attributes["retirement_value_check"] = 0 attributes["retirement_value_check"] = 0
attributes["rent_value_check"] = 0 attributes["rent_value_check"] = 0
attributes["net_income_value_check"] = 0 attributes["net_income_value_check"] = 0
attributes["carehome_charges_value_check"] = 0
# Sets the log creator # Sets the log creator
owner_id = meta_field_value(xml_doc, "owner-user-id").strip owner_id = meta_field_value(xml_doc, "owner-user-id").strip
@ -339,7 +340,7 @@ module Imports
end end
def fields_not_present_in_softwire_data def fields_not_present_in_softwire_data
%w[majorrepairs illness_type_0 tshortfall_known pregnancy_value_check retirement_value_check rent_value_check net_income_value_check major_repairs_date_value_check void_date_value_check housingneeds_type housingneeds_other created_by] %w[majorrepairs illness_type_0 tshortfall_known pregnancy_value_check retirement_value_check rent_value_check net_income_value_check major_repairs_date_value_check void_date_value_check carehome_charges_value_check housingneeds_type housingneeds_other created_by]
end end
def check_status_completed(lettings_log, previous_status) def check_status_completed(lettings_log, previous_status)

2
spec/services/csv/lettings_log_csv_service_spec.rb

@ -155,6 +155,7 @@ RSpec.describe Csv::LettingsLogCsvService do
period period
is_carehome is_carehome
chcharge chcharge
carehome_charges_value_check
brent brent
scharge scharge
pscharge pscharge
@ -208,7 +209,6 @@ RSpec.describe Csv::LettingsLogCsvService do
address_line2 address_line2
town_or_city town_or_city
county county
carehome_charges_value_check
unittype_sh unittype_sh
scheme_code scheme_code
scheme_service_name scheme_service_name

21
spec/services/imports/lettings_logs_import_service_spec.rb

@ -416,6 +416,27 @@ RSpec.describe Imports::LettingsLogsImportService do
end end
end end
context "and the carehome charge soft validation is triggered (carehome_charge_value_check)" do
let(:lettings_log_id) { "0b4a68df-30cc-474a-93c0-a56ce8fdad3b" }
before do
scheme2.update!(registered_under_care_act: 2)
lettings_log_xml.at_xpath("//xmlns:_1cmangroupcode").content = scheme2.old_visible_id
lettings_log_xml.at_xpath("//xmlns:Q18b").content = ""
lettings_log_xml.at_xpath("//xmlns:Q18ai").content = ""
lettings_log_xml.at_xpath("//xmlns:Q18aii").content = ""
lettings_log_xml.at_xpath("//xmlns:Q18aiii").content = ""
lettings_log_xml.at_xpath("//xmlns:Q18aiv").content = ""
lettings_log_xml.at_xpath("//xmlns:Q18av").content = ""
end
it "completes the log" do
lettings_log_service.send(:create_log, lettings_log_xml)
lettings_log = LettingsLog.find_by(old_id: lettings_log_id)
expect(lettings_log.status).to eq("completed")
end
end
context "and this is a supported housing log with multiple locations under a scheme" do context "and this is a supported housing log with multiple locations under a scheme" do
let(:lettings_log_id) { "0b4a68df-30cc-474a-93c0-a56ce8fdad3b" } let(:lettings_log_id) { "0b4a68df-30cc-474a-93c0-a56ce8fdad3b" }

Loading…
Cancel
Save