Jido.Composer.HITL.ApprovalResponse (Jido Composer v0.6.0)

Copy Markdown View Source

The human's response to an ApprovalRequest.

Constructed by external code and delivered to the suspended flow. The strategy validates the response against the original request before accepting it.

Summary

Types

t()

@type t() :: %Jido.Composer.HITL.ApprovalResponse{
  comment: String.t() | nil,
  data: map() | nil,
  decision: atom(),
  request_id: String.t(),
  responded_at: DateTime.t(),
  respondent: term()
}

Functions

new(attrs)

@spec new(keyword()) :: {:ok, t()} | {:error, String.t()}

validate(response, request)

@spec validate(t(), Jido.Composer.HITL.ApprovalRequest.t()) ::
  :ok | {:error, String.t()}