Class: NotificationWorkers::Partner::PackagesReport
- Inherits:
-
ApplicationWorker
- Object
- ApplicationWorker
- NotificationWorkers::Partner::PackagesReport
- Includes:
- MoneyRails::ActionViewExtension, RollbarSynTokenSetterWorker, Sidekiq::Status::Worker
- Defined in:
- app/workers/notification_workers/partner/packages_report.rb
Overview
typed: true frozen_string_literal: true
Instance Attribute Summary collapse
-
#attachment ⇒ Object
Returns the value of attribute attachment.
-
#emails ⇒ Object
Returns the value of attribute emails.
-
#package_type ⇒ Object
Returns the value of attribute package_type.
-
#pdf_url ⇒ Object
Returns the value of attribute pdf_url.
-
#restaurant_id ⇒ Object
Returns the value of attribute restaurant_id.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Methods inherited from ApplicationWorker
Instance Attribute Details
#attachment ⇒ Object
Returns the value of attribute attachment.
10 11 12 |
# File 'app/workers/notification_workers/partner/packages_report.rb', line 10 def @attachment end |
#emails ⇒ Object
Returns the value of attribute emails.
10 11 12 |
# File 'app/workers/notification_workers/partner/packages_report.rb', line 10 def emails @emails end |
#package_type ⇒ Object
Returns the value of attribute package_type.
10 11 12 |
# File 'app/workers/notification_workers/partner/packages_report.rb', line 10 def package_type @package_type end |
#pdf_url ⇒ Object
Returns the value of attribute pdf_url.
10 11 12 |
# File 'app/workers/notification_workers/partner/packages_report.rb', line 10 def pdf_url @pdf_url end |
#restaurant_id ⇒ Object
Returns the value of attribute restaurant_id.
10 11 12 |
# File 'app/workers/notification_workers/partner/packages_report.rb', line 10 def restaurant_id @restaurant_id end |
#type ⇒ Object
Returns the value of attribute type.
10 11 12 |
# File 'app/workers/notification_workers/partner/packages_report.rb', line 10 def type @type end |
Instance Method Details
#perform(args, attachment_id = nil) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/workers/notification_workers/partner/packages_report.rb', line 12 def perform(args, = nil) assign_attributes(args) initialize_status () begin I18n.locale = :en packages = collect_packages_list if pdf? generate_pdf_report(packages, args) else generate_excel_report end send_report_email rescue Aws::SES::Errors::Throttling => e handle_email_throttling(e) rescue StandardError => e handle_standard_error(e) end end |