PhoenixKit.Notifications.Notification (phoenix_kit v1.7.102)

Copy Markdown View Source

Schema for per-user notifications.

One row per (activity, recipient_user). Generated by PhoenixKit.Notifications.maybe_create_from_activity/1 whenever an activity targets a user other than the actor.

Fields

  • activity_uuid — FK to PhoenixKit.Activity.Entry
  • recipient_uuid — FK to PhoenixKit.Users.Auth.User
  • seen_atNULL until the user opens the notification or bulk-marks
  • dismissed_atNULL until the user dismisses it from the inbox
  • inserted_at — creation timestamp (no updated_at)

Summary

Functions

Changeset for creating a notification.

Types

t()

@type t() :: %PhoenixKit.Notifications.Notification{
  __meta__: term(),
  activity:
    PhoenixKit.Activity.Entry.t() | Ecto.Association.NotLoaded.t() | nil,
  activity_uuid: UUIDv7.t() | nil,
  dismissed_at: DateTime.t() | nil,
  inserted_at: DateTime.t() | nil,
  recipient:
    PhoenixKit.Users.Auth.User.t() | Ecto.Association.NotLoaded.t() | nil,
  recipient_uuid: UUIDv7.t() | nil,
  seen_at: DateTime.t() | nil,
  uuid: UUIDv7.t() | nil
}

Functions

changeset(notification, attrs)

Changeset for creating a notification.