Example #1
0
        public void Handle(CreateAccountCommand command)
        {
            var accountOwner = _accountOwnerService.GetAccountOwner(command.OwnerId);
            var account      = new AccountAggregate(accountOwner);

            _accountAggregateRepository.Save(account);
        }
Example #2
0
        public AccountNumber GenerateNumber(Guid accountOwnerId, Guid accountTypeId)
        {
            var accountOwner          = accountOwnerService.GetAccountOwner(accountOwnerId);
            var accountType           = accountTypeRepository.Get(accountTypeId);
            var ownerAccountTypeCount = accountRepository.GetOwnerAccountTypeCount(accountOwnerId, accountTypeId).Result;

            return(new AccountNumber(accountOwner.NationalCode, accountType.Code, ownerAccountTypeCount));
        }