PhoenixKitCatalogue.Import.Executor (PhoenixKitCatalogue v0.1.8)

Copy Markdown View Source

Executes an import plan by creating categories and items.

Categories are created first (get-or-create pattern), then items are inserted with progress reporting back to the calling process.

Summary

Types

import_result()

@type import_result() :: %{
  created: non_neg_integer(),
  errors: [{non_neg_integer(), String.t()}],
  categories_created: non_neg_integer()
}

Functions

execute(import_plan, catalogue_uuid, notify_pid, opts \\ [])

@spec execute(map(), String.t(), pid(), keyword()) :: import_result()

Executes an import plan.

Creates categories first, then items. Sends {:import_progress, current, total} messages to notify_pid after each item.

Options

  • :language — language code for multilang import (e.g. "et")
  • :category_uuid — fixed category UUID to assign all items to