The structured output of ExReconcile.reconcile/3.
Fields
:matched- list of{left, right}pairs that were successfully reconciled with no field differences outside configured tolerances.:discrepancies- list of{left, right, [field_diff]}tuples where the pair was matched (same key) but one or more fields differ beyond tolerance. Eachfield_diffis a map describing the field and the delta; seefield_diff/0.:unmatched_left- transactions from the left list with no counterpart in the right.:unmatched_right- transactions from the right list with no counterpart in the left.
field_diff shape
# Amount discrepancy
%{field: :amount, left: 1050, right: 1000, delta: -50}
# Date discrepancy
%{field: :date, left: ~D[2024-01-15], right: ~D[2024-01-16], delta: 1}
# Description discrepancy
%{field: :description, left: "Coffee Shop", right: "COFFESHOP LTD"}
Summary
Functions
Returns true when the reconciliation is clean: no discrepancies and no unmatched
transactions on either side.
Returns a summary map with counts for each category.
Types
@type discrepancy() :: {ExReconcile.Transaction.t(), ExReconcile.Transaction.t(), [field_diff()]}
@type pair() :: {ExReconcile.Transaction.t(), ExReconcile.Transaction.t()}
@type t() :: %ExReconcile.Result{ discrepancies: [discrepancy()], matched: [pair()], unmatched_left: [ExReconcile.Transaction.t()], unmatched_right: [ExReconcile.Transaction.t()] }
Functions
Returns true when the reconciliation is clean: no discrepancies and no unmatched
transactions on either side.
Examples
iex> ExReconcile.Result.clean?(%ExReconcile.Result{})
true
iex> ExReconcile.Result.clean?(%ExReconcile.Result{unmatched_left: [%ExReconcile.Transaction{amount: 1}]})
false
Returns a summary map with counts for each category.
Examples
iex> result = %ExReconcile.Result{matched: [{"a", "b"}], unmatched_left: ["c"]}
iex> ExReconcile.Result.summary(result)
%{matched: 1, discrepancies: 0, unmatched_left: 1, unmatched_right: 0, total_left: 2, total_right: 1}