Class: AmazonOrderStatusVerificationWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Job
Defined in:
app/workers/amazon_order_status_verification_worker.rb

Overview

Scheduled daily at 6 PM Central to verify that recently-invoiced Amazon
orders have reached the expected "Shipped" status on Amazon Seller Central.

Iterates all Amazon Seller Central partners that have
order_status_verification_enabled: true in their orchestrator config
(currently US and CA).

See Also:

Instance Method Summary collapse

Instance Method Details

#performObject

Runs the job.

Returns:

  • (Object)

    the result



20
21
22
23
24
25
26
27
28
29
30
# File 'app/workers/amazon_order_status_verification_worker.rb', line 20

def perform
  Edi::Amazon::Orchestrator.orchestrators.each do |orchestrator|
    next unless orchestrator.active && orchestrator.order_status_verification_enabled?

    Rails.logger.tagged("OrderStatusVerification", orchestrator.partner) do
      orchestrator.execute_order_status_verification
    end
  rescue StandardError => e
    ErrorReporting.error(e, "OrderStatusVerification failed for #{orchestrator.partner}")
  end
end