A deterministic, privacy-bounded view of an account's effective grants.
The snapshot is derived from current grant rows; it is never persisted and never contains provider evidence or lineage identifiers.
Summary
Functions
The material authorization fields used for monotonic revision decisions.
Fetches and folds an account's current grants without mutating state.
Types
@type source() :: %{ :rail => atom(), :environment => atom(), :logical_plan => atom(), :effective_at => DateTime.t(), optional(:expires_at) => DateTime.t() | nil, optional(:revoked_at) => DateTime.t() | nil }
@type t() :: %Accrue.Entitlements.Snapshot{ account_id: Ecto.UUID.t() | String.t(), authorization_bounds: term(), features: [atom()], plans: [atom()], quantities: %{optional(atom()) => pos_integer()}, revision: non_neg_integer(), sources: [source()] }
Functions
The material authorization fields used for monotonic revision decisions.
@spec fetch(Ecto.Repo.t(), map() | Ecto.UUID.t(), keyword()) :: t() | nil
Fetches and folds an account's current grants without mutating state.
@spec from_grants( [Accrue.Entitlements.Grant.t() | map()], keyword() ) :: t()