Submit social housing lettings and sales data (CORE)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

15 lines
651 B

namespace :correct_illness do
desc "Export data CSVs for import into Central Data System (CDS)"
task :create_illness_csv, %i[organisation_id] => :environment do |_task, args|
organisation_id = args[:organisation_id]
raise "Usage: rake correct_illness:create_illness_csv['organisation_id']" if organisation_id.blank?
organisation = Organisation.find_by(id: organisation_id)
if organisation.present?
CreateIllnessCsvJob.perform_later(organisation)
Rails.logger.info("Creating illness CSV for #{organisation.name}")
else
Rails.logger.error("Organisation with ID #{organisation_id} not found")
end
end
end