# `Decree.Store.Notifications.Notification`
[🔗](https://github.com/sparkle-space/decree/blob/v0.1.0/lib/decree/store/notifications/notification.ex#L1)

Represents a notification received from PostgreSQL's `LISTEN/NOTIFY` mechanism.

Parsed from a comma-separated payload containing the stream UUID, stream ID, and the first and
last stream versions of newly appended events.

## Examples:

    iex> Decree.Store.Notifications.Notification.new("stream-12345,1,2,5")
    %Decree.Store.Notifications.Notification{
      stream_uuid: "stream-12345",
      stream_id: 1,
      from_stream_version: 2,
      to_stream_version: 5
    }

# `new`

Parses the PostgreSQL `NOTIFY` payload and builds a new struct.

## Example

    iex> Decree.Store.Notifications.Notification.new("stream-12345,1,1,5")
    %Decree.Store.Notifications.Notification{
      stream_uuid: "stream-12345",
      stream_id: 1,
      from_stream_version: 1,
      to_stream_version: 5
    }

---

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