class Reporting::Admissions::StatisticJob < Reporting::Job
  include Sidekiq::Worker

  def process
    @tmp_file = Pdf::Admissions.const_get(service_name).call(school_year)
    @filename = "#{@params['report'].underscore}_#{timestamp}.pdf"
    save_to_user
    send_report
  end

  private
    def school_year
      @school.school_years.find(@params['school_year_id'])
    end

    def service_name
      "#{@params['report']}Service"
    end
end
