Write-side persistence helpers for workflow runs.
These helpers keep record construction and serialization close to the
database-facing code while SquidMesh.RunStore continues to expose the
public lifecycle API.
Summary
Types
Functions
@spec build_run_attrs(module(), atom(), SquidMesh.Workflow.Definition.t(), map()) :: map()
@spec cancellation_target_status(SquidMesh.Run.status()) :: {:ok, SquidMesh.Run.status()} | {:error, {:invalid_transition, SquidMesh.Run.status(), SquidMesh.Run.status()}}
@spec insert_run_record(module(), map()) :: {:ok, SquidMesh.Run.t()} | {:error, {:invalid_run, Ecto.Changeset.t()}}
@spec insert_run_with_dispatch(module(), map(), (SquidMesh.Run.t() -> {:ok, term()} | {:error, term()})) :: {:ok, SquidMesh.Run.t()} | {:error, {:invalid_run, Ecto.Changeset.t()} | term()}
@spec noop_dispatch(SquidMesh.Run.t()) :: {:ok, :noop}
@spec replay_run_attrs( SquidMesh.Persistence.Run.t(), SquidMesh.Workflow.Definition.t() ) :: map()
@spec transition_changeset_attrs(SquidMesh.Run.status(), transition_attrs()) :: map()
@spec update_run_record(module(), SquidMesh.Persistence.Run.t(), map()) :: {:ok, SquidMesh.Run.t()} | {:error, {:invalid_run, Ecto.Changeset.t()}}