cover/Elixir.WalletSettlement.Events.ReconciliationCompleted.html

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