cover/Elixir.WalletAuth.Events.DeviceRevoked.html

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