ExGAM.GovernedAct.Transition.Foundation (ExGAM v0.1.0)

Copy Markdown View Source

Transitions for the governed foundation of a Domain.

Genesis fixes the initial identities. Principal registration, HostProfile, Surface and Definition revisions are then accepted only as consequences of matching ledger-internal Acts. The module receives canonical events from the fold and stores restored structs in disposable GovernedAct.State.

Summary

Functions

Replays Genesis-named records and governed revisions; later configuration cannot silently replace the foundation.

Checks that Genesis names a foundation record before it is materialized.

Functions

apply(projection, event, revision)

@spec apply(
  ExGAM.GovernedAct.State.t(),
  ExGAM.Domain.Event.t(),
  non_neg_integer() | nil
) ::
  {:ok, ExGAM.GovernedAct.State.t()} | {:error, term()}

Replays Genesis-named records and governed revisions; later configuration cannot silently replace the foundation.

named_by_genesis(state, field_name, ref)

@spec named_by_genesis(ExGAM.GovernedAct.State.t(), atom(), String.t()) ::
  :ok | {:error, term()}

Checks that Genesis names a foundation record before it is materialized.