PhoenixKit.Modules.Shop.Workers.CSVImportWorker (phoenix_kit v1.7.41)

Copy Markdown View Source

Oban worker for background CSV import.

Processes CSV files with automatic format detection via the ImportFormat behaviour. Supports Shopify, Prom.ua, and other formats transparently.

Job Arguments

  • import_log_id - ID of the ImportLog record
  • path - Path to the uploaded CSV file
  • config_id - Optional ImportConfig ID for filtering rules

Usage

The Imports LiveView enqueues jobs after file upload:

CSVImportWorker.new(%{
  import_log_id: log.id,
  path: "/tmp/uploads/products.csv",
  config_id: config.id  # optional
})
|> Oban.insert()

Queue Configuration

Add the shop_imports queue to your Oban config:

config :my_app, Oban,
  queues: [default: 10, shop_imports: 2]