diff --git a/lib/tasks/application_forms.rake b/lib/tasks/application_forms.rake index 174950f355..1f48058ad1 100644 --- a/lib/tasks/application_forms.rake +++ b/lib/tasks/application_forms.rake @@ -47,4 +47,15 @@ namespace :application_forms do puts "#{application_form.reference}: #{application_form.status}" end end + + desc "Turn on preliminary checks for draft or submitted applications." + task :update_statuses, %i[staff_email] => :environment do |_task, args| + user = Staff.find_by!(email: args[:staff_email]) + ApplicationForm + .order(:id) + .find_each do |application_form| + ApplicationFormStatusUpdater.call(application_form:, user:) + puts "#{application_form.reference}: #{application_form.status} - #{application_form.actionable_by}" + end + end end