private void Apply(AccountOpened @event)
 {
     Id            = new AccountId(@event.AccountId);
     _status       = Active;
     _balance      = @event.Balance;
     _interestRate = new InterestRate(@event.InterestRate);
 }
Esempio n. 2
0
 /// <summary>
 /// Apply account opened state changes.
 /// </summary>
 /// <param name="e">The account opened event.</param>
 protected void Apply(AccountOpened e)
 {
     Type    = e.AccountType;
     Number  = e.AccountNumber;
     Balance = e.Balance;
     Status  = e.Status;
 }
Esempio n. 3
0
        public void OpenAccount(OpenAccount command)
        {
            AccountNumber number        = new AccountNumber("NL12ABCD0001234567");
            AccountOpened accountOpened = new AccountOpened(number, command.Owner);

            RaiseEvent(accountOpened);
        }
        public void EnactCommand(OpenAccount command)
        {
            var created = new AccountOpened {
                CustomerId = command.CustomerId
            };

            RecordEvent(created);
        }
            public async Task EnactCommand(BankAccount target, OpenAccount command)
            {
                var created = new AccountOpened {
                    CustomerId = command.CustomerId
                };

                target.RecordEvent(created);
                await _scheduler.Schedule(target.Id,
                                          new CalculateAndDepositInterestDaily(), Clock.Now().AddDays(1));
            }
Esempio n. 6
0
 public void Apply(AccountOpened e)
 {
     AccountId = e.AccountId;
     Balance   = e.InitialBalance;
 }
 public void Handle(AccountOpened c)
 {
     _store.InsertAccount(c.IdentityTenant, c.AggregateIdentifier, c.Code, "Open", c.Owner);
 }
Esempio n. 8
0
 void IEventHandler <AccountOpened> .Handle(AccountOpened evnt)
 {
     AccountNumber = evnt.AccountNumber;
     Owner         = evnt.Owner;
 }
Esempio n. 9
0
 public void Process(AccountOpened @event)
 {
     _repository.Insert(new Account {
         Owner = @event.Owner
     });
 }
Esempio n. 10
0
 public void Apply(AccountOpened accountOpened)
 {
     Context.ActorOf(Account.Create(accountOpened.Number, accountOpened.InitialBalance), $"Account-{accountOpened.Number}");
 }
 public void Process(AccountOpened @event)
 {
     _logger.Information($"Account was opened for {@event.Owner}");
 }
Esempio n. 12
0
 public void Handle(AccountOpened e)
 {
 }
Esempio n. 13
0
 void IEventHandler <AccountOpened> .Handle(AccountOpened evnt)
 {
     Owner = evnt.Owner;
 }
Esempio n. 14
0
 public void Handle(AccountOpened accountOpened)
 {
 }