# `Jidoka.Turn.Transition`
[🔗](https://github.com/agentjido/jidoka/blob/v0.9.0/lib/jidoka/turn/transition.ex#L1)

Pure transition result for turn state changes.

Domain functions can produce state plus neutral events/diagnostics.
`commit/1` appends those events to the state in sequence order.

# `state`

```elixir
@type state() :: map()
```

# `t`

```elixir
@type t() :: %Jidoka.Turn.Transition{
  diagnostics: [any()],
  events: [term()],
  state: any()
}
```

# `commit`

```elixir
@spec commit(t()) :: state()
```

Commits transition events and diagnostics to the state map.

# `diagnostic`

```elixir
@spec diagnostic(t(), term()) :: t()
```

Adds one diagnostic value to a transition.

# `event`

```elixir
@spec event(t(), atom(), keyword() | map()) :: t()
```

Adds one neutral event to a transition.

# `new`

```elixir
@spec new(state(), keyword() | map()) :: {:ok, t()} | {:error, term()}
```

Starts a pure transition for a state map.

# `new!`

```elixir
@spec new!(state(), keyword() | map()) :: t()
```

Starts a pure transition and raises if its attributes are invalid.

# `schema`

```elixir
@spec schema() :: Zoi.schema()
```

Returns the Zoi schema for a pure turn transition.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
