SquidMesh.Runtime.ManualAction (squid_mesh v0.1.0-alpha.7)

Copy Markdown View Source

Validation and serialization helpers for durable manual workflow actions.

Pause resume, approval, and rejection flows all persist a small audit payload so the read model can reconstruct who acted and when.

Summary

Types

attrs()

@type attrs() :: %{
  optional(:actor) => String.t() | map(),
  optional(:comment) => String.t(),
  optional(:metadata) => map()
}

persisted()

@type persisted() :: map()

type()

@type type() :: :resumed | :approved | :rejected

Functions

build(type, attrs)

@spec build(type(), attrs()) :: persisted()

validate(attrs, opts \\ [])

@spec validate(
  attrs(),
  keyword()
) :: :ok | {:error, {:invalid_manual_action, map()}}