public void Apply(CashWithdrawnEvent @event)
 {
     Balance -= @event.Amount;
     if (Balance < 0 && Math.Abs(Balance) > OverdraftLimit)
     {
         AccountState = Enumerations.AccountState.Blocked;
     }
 }
Example #2
0
 private void onWithdrawl(CashWithdrawnEvent cashWithdrawnEvent)
 {
     _ledgers.Add(new DebitMutation(cashWithdrawnEvent.Amount, new AccountNumber(string.Empty)));
     _balance = cashWithdrawnEvent.Balance;
 }