Chimeway.Inbox (chimeway v1.1.0)

Copy Markdown View Source

Inbox query and explicit lifecycle transition APIs.

Summary

Functions

archive(notification_id, recipient_identity, at \\ DateTime.utc_now())

@spec archive(Ecto.UUID.t(), String.t(), DateTime.t()) :: :ok | {:error, :not_found}

list_for_recipient(recipient_identity, opts \\ [])

@spec list_for_recipient(
  String.t(),
  keyword()
) ::
  [Chimeway.Notifications.Notification.t()]
  | %{items: [map()], has_more: boolean()}

mark_read(notification_id, recipient_identity, at \\ DateTime.utc_now())

@spec mark_read(Ecto.UUID.t(), String.t(), DateTime.t()) :: :ok | {:error, :not_found}

mark_seen(notification_id, recipient_identity, at \\ DateTime.utc_now())

@spec mark_seen(Ecto.UUID.t(), String.t(), DateTime.t()) :: :ok | {:error, :not_found}

unread_count(recipient_identity, opts \\ [])

@spec unread_count(
  String.t(),
  keyword()
) :: non_neg_integer()