cover/Elixir.WalletAuth.Events.TokenRefreshed.html

1 defmodule WalletAuth.Events.TokenRefreshed do
2 @moduledoc "Emitted when a refresh token rotation completes successfully."
3 @behaviour WalletEvents.DomainEvent
4
5 @impl true
6 3 def event_name, do: "TokenRefreshed.v1"
7
8 @impl true
9 3 def event_version, do: 1
10
11
:-(
def build(session_id, user_id, opts \\ []) do
12 3 %{
13 event_id: WalletSharedKernel.Correlation.new_request_id(),
14 event_name: event_name(),
15 event_version: event_version(),
16 aggregate_id: session_id,
17 correlation_id: Keyword.get(opts, :correlation_id, WalletSharedKernel.Correlation.new_correlation_id()),
18 occurred_at: DateTime.utc_now(),
19 payload: %{
20 session_id: session_id,
21 user_id: user_id
22 }
23 }
24 end
25 end
Line Hits Source