module AccountComponent::Controls::Write::Withdraw
Public Class Methods
call(id: nil, account_id: nil, amount: nil)
click to toggle source
# File lib/account_component/controls/write/withdraw.rb, line 5 def self.call(id: nil, account_id: nil, amount: nil) id ||= ID.example account_id ||= Account.id amount ||= Money.example deposit = Commands::Withdraw.example( id: id, account_id: account_id, amount: amount ) stream_name = Messaging::StreamName.command_stream_name(id, 'account') Messaging::Postgres::Write.(deposit, stream_name) end