cover/Elixir.WalletNotifications.Events.NotificationQueued.html

1 defmodule WalletNotifications.Events.NotificationQueued do
2 @moduledoc "Emitted when a notification is queued for dispatch."
3 @behaviour WalletEvents.DomainEvent
4
5 @impl true
6 33 def event_name, do: "NotificationQueued.v1"
7 @impl true
8 33 def event_version, do: 1
9
10
:-(
def build(notification_id, opts \\ []) do
11 33 %{
12 event_id: WalletSharedKernel.Correlation.new_request_id(),
13 event_name: event_name(),
14 event_version: event_version(),
15 aggregate_id: notification_id,
16 correlation_id: Keyword.get(opts, :correlation_id, WalletSharedKernel.Correlation.new_correlation_id()),
17 occurred_at: DateTime.utc_now(),
18 payload: %{
19 notification_id: notification_id,
20 user_id: Keyword.get(opts, :user_id),
21 type: Keyword.get(opts, :type),
22 channel: Keyword.get(opts, :channel)
23 }
24 }
25 end
26 end
Line Hits Source