Lockspire.Storage.ConsentStore behaviour
(lockspire v1.0.0)
Copy Markdown
Domain-level persistence contract for consent grants.
Summary
Types
@type store_error() :: term()
Callbacks
@callback fetch_consent_grant(integer()) :: {:ok, Lockspire.Domain.ConsentGrant.t() | nil} | {:error, store_error()}
@callback grant_consent(Lockspire.Domain.ConsentGrant.t()) :: {:ok, Lockspire.Domain.ConsentGrant.t()} | {:error, store_error()}
@callback list_consents(keyword()) :: {:ok, [Lockspire.Domain.ConsentGrant.t()]} | {:error, store_error()}
@callback list_consents_for_account(String.t()) :: {:ok, [Lockspire.Domain.ConsentGrant.t()]} | {:error, store_error()}
@callback list_reusable_consents(String.t(), String.t()) :: {:ok, [Lockspire.Domain.ConsentGrant.t()]} | {:error, store_error()}
@callback revoke_consent_grant(integer(), map()) :: {:ok, Lockspire.Domain.ConsentGrant.t()} | {:error, store_error()}