Class: NotificationWorkers::Partner::TicketsReport
- Inherits:
-
ApplicationWorker
- Object
- ApplicationWorker
- NotificationWorkers::Partner::TicketsReport
- Includes:
- MoneyRails::ActionViewExtension, RollbarSynTokenSetterWorker
- Defined in:
- app/workers/notification_workers/partner/tickets_report.rb
Overview
typed: true frozen_string_literal: true
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#date_filter_type ⇒ Object
Returns the value of attribute date_filter_type.
-
#date_from ⇒ Object
Returns the value of attribute date_from.
-
#date_to ⇒ Object
Returns the value of attribute date_to.
-
#emails ⇒ Object
Returns the value of attribute emails.
-
#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
#date ⇒ Object
Returns the value of attribute date.
9 10 11 |
# File 'app/workers/notification_workers/partner/tickets_report.rb', line 9 def date @date end |
#date_filter_type ⇒ Object
Returns the value of attribute date_filter_type.
9 10 11 |
# File 'app/workers/notification_workers/partner/tickets_report.rb', line 9 def date_filter_type @date_filter_type end |
#date_from ⇒ Object
Returns the value of attribute date_from.
9 10 11 |
# File 'app/workers/notification_workers/partner/tickets_report.rb', line 9 def date_from @date_from end |
#date_to ⇒ Object
Returns the value of attribute date_to.
9 10 11 |
# File 'app/workers/notification_workers/partner/tickets_report.rb', line 9 def date_to @date_to end |
#emails ⇒ Object
Returns the value of attribute emails.
9 10 11 |
# File 'app/workers/notification_workers/partner/tickets_report.rb', line 9 def emails @emails end |
#pdf_url ⇒ Object
Returns the value of attribute pdf_url.
9 10 11 |
# File 'app/workers/notification_workers/partner/tickets_report.rb', line 9 def pdf_url @pdf_url end |
#restaurant_id ⇒ Object
Returns the value of attribute restaurant_id.
9 10 11 |
# File 'app/workers/notification_workers/partner/tickets_report.rb', line 9 def restaurant_id @restaurant_id end |
#type ⇒ Object
Returns the value of attribute type.
9 10 11 |
# File 'app/workers/notification_workers/partner/tickets_report.rb', line 9 def type @type end |
Instance Method Details
#perform(args) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/workers/notification_workers/partner/tickets_report.rb', line 14 def perform(args) begin args.to_h.with_indifferent_access.each do |k, v| next if k.to_s == :use_long_process.to_s send("#{k}=".to_sym, v) end I18n.locale = :en tickets = collect_tickets if pdf? report = VouchersHistoryReportPdf.new(tickets) report.generate_pdf(tickets, args) self.pdf_url = report.pdf_url else generate_vouchers_history_report_to_restaurant self. = end OwnerMailer.vouchers_list_report(email_body, email_subject, emails).deliver_later! rescue StandardError => e APMErrorHandler.report e raise e end end |