Lockspire.Storage.ConsentStore behaviour (lockspire v1.0.0)

Copy Markdown

Domain-level persistence contract for consent grants.

Summary

Types

store_error()

@type store_error() :: term()

Callbacks

grant_consent(t)

@callback grant_consent(Lockspire.Domain.ConsentGrant.t()) ::
  {:ok, Lockspire.Domain.ConsentGrant.t()} | {:error, store_error()}

list_consents(keyword)

@callback list_consents(keyword()) ::
  {:ok, [Lockspire.Domain.ConsentGrant.t()]} | {:error, store_error()}

list_consents_for_account(t)

@callback list_consents_for_account(String.t()) ::
  {:ok, [Lockspire.Domain.ConsentGrant.t()]} | {:error, store_error()}

list_reusable_consents(t, t)

@callback list_reusable_consents(String.t(), String.t()) ::
  {:ok, [Lockspire.Domain.ConsentGrant.t()]} | {:error, store_error()}