Accrue.Entitlements.Source behaviour (accrue v1.5.1)

Copy Markdown View Source

Closed, inspection-only entitlement-source contract.

This boundary describes which rail owns an entitlement operation. It never delegates to Accrue.Processor and it does not perform billing mutations.

Summary

Types

capability()

@type capability() ::
  :observation | :control | :restore | :reconciliation | :management | :offline

source()

@type source() :: :stripe | :apple | :host_fake

state()

@type state() ::
  :supported
  | :externally_managed
  | :host_owned
  | :deferred
  | :unavailable
  | :feasibility_blocked

Callbacks

outcome(capability)

@callback outcome(capability()) ::
  {:ok, Accrue.Entitlements.Source.Outcome.t()} | {:error, Exception.t()}

Functions

capabilities()

@spec capabilities() :: [capability()]

states()

@spec states() :: [state()]