# `PhoenixKit.Notifications.Notification`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.102/lib/phoenix_kit/notifications/notification.ex#L1)

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_at`         — `NULL` until the user opens the notification or bulk-marks
- `dismissed_at`    — `NULL` until the user dismisses it from the inbox
- `inserted_at`     — creation timestamp (no `updated_at`)

# `t`

```elixir
@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
}
```

# `changeset`

Changeset for creating a notification.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
