Class: SpreeCmCommissioner::QueueDraftOrders::ProcessJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/spree_cm_commissioner/queue_draft_orders/process_job.rb

Overview

Thin trigger for QueueDraftOrders::Process — owns only the locale wrapping (so any user-facing message the create call surfaces renders in the request's original locale, not the job worker's default), not the order-creation/Firestore-publishing logic itself.

Instance Method Summary collapse

Methods included from ApplicationJobDecorator

handle_deserialization_error, prepended

Instance Method Details

#perform(document_path, create_type, creation_params, locale = nil) ⇒ Object



14
15
16
17
18
19
20
# File 'app/jobs/spree_cm_commissioner/queue_draft_orders/process_job.rb', line 14

def perform(document_path, create_type, creation_params, locale = nil)
  I18n.with_locale(locale.presence || I18n.default_locale) do
    SpreeCmCommissioner::QueueDraftOrders::Process.call(
      document_path: document_path, create_type: create_type, creation_params: creation_params
    )
  end
end