public void Apply(CashDepositedEvent @event) { Balance += @event.Amount; if (Balance >= 0 && AccountState == Enumerations.AccountState.Blocked) { AccountState = Enumerations.AccountState.Actif; } }
private void onDeposite(CashDepositedEvent cashDepositedEvent) { _ledgers.Add(new CreditMutation(cashDepositedEvent.Amount, new AccountNumber(string.Empty))); _balance = cashDepositedEvent.Balance; }