PhoenixKit.Modules.Shop.ImportLog (phoenix_kit v1.7.42)

Copy Markdown View Source

ImportLog schema for tracking CSV import history.

Fields

  • filename - Original filename (required)
  • file_path - Server path to uploaded file
  • status - pending | processing | completed | failed

  • total_rows - Total rows in CSV
  • processed_rows - Rows processed so far
  • imported_count - New products created
  • updated_count - Existing products updated
  • skipped_count - Products skipped (filtered)
  • error_count - Products with errors
  • options - Import options (JSONB)
  • error_details - List of error objects
  • started_at - Processing start time
  • completed_at - Processing end time
  • user_id - User who initiated import

Summary

Functions

Mark import as completed.

Changeset for creating a new import log.

Mark import as failed.

Check if import is finished (completed or failed).

Check if import is in progress.

Update progress during import.

Returns the percentage of completion.

Mark import as started.

Changeset for updating import log status and stats.

Functions

complete_changeset(import_log, stats)

Mark import as completed.

create_changeset(import_log \\ %__MODULE__{}, attrs)

Changeset for creating a new import log.

fail_changeset(import_log, error)

Mark import as failed.

finished?(arg1)

Check if import is finished (completed or failed).

in_progress?(arg1)

Check if import is in progress.

progress_changeset(import_log, attrs)

Update progress during import.

progress_percent(import_log)

Returns the percentage of completion.

start_changeset(import_log, total_rows)

Mark import as started.

update_changeset(import_log, attrs)

Changeset for updating import log status and stats.