Sha256: 28de8b42a0fc7d039027142d5b6021bc7e61f1f3b6388172aceaf9c6706495fa

Contents?: true

Size: 528 Bytes

Versions: 3

Compression:

Stored size: 528 Bytes

Contents

module Workarea
  module Forter
    class UpdateStatus
      include Sidekiq::Worker

      def perform(id, status_hash)
        decision = Workarea::Forter::Decision.find(id) rescue nil

        if decision.blank?
          Rails.logger.warn "No decision record found for #{id} during update status"
          return false
        end

        Workarea::Forter.gateway.update_order_status(id, status_hash)

        decision.external_order_status = status_hash[:updatedStatus]
        decision.save!
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
workarea-forter-1.2.4 app/workers/forter/update_status.rb
workarea-forter-1.2.3 app/workers/forter/update_status.rb
workarea-forter-1.2.2 app/workers/forter/update_status.rb