Current section

Files

Jump to
commanded test example_domain bank_account withdraw_money_handler.ex
Raw

test/example_domain/bank_account/withdraw_money_handler.ex

defmodule Commanded.ExampleDomain.WithdrawMoneyHandler do
@moduledoc false
@behaviour Commanded.Commands.Handler
alias Commanded.ExampleDomain.BankAccount
alias Commanded.ExampleDomain.BankAccount.Commands.WithdrawMoney
def handle(%BankAccount{} = aggregate, %WithdrawMoney{} = withdraw_money) do
BankAccount.withdraw(aggregate, withdraw_money)
end
end