Exemplo n.º 1
0
        /// <summary>
        /// Opens the account.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <param name="accountHolder">The account holder.</param>
        /// <param name="typeOfBankScore">The type of bank score.</param>
        public void OpenAccount(IAccountNumberGenerator id, AccountHolder accountHolder, TypeOfBankScore typeOfBankScore)
        {
            var account = fabric.Create(accountHolder, id.GenerateAccountNumbers(), typeOfBankScore);

            account.Status = Status.Open;
            repository.Create(account);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Opens the account.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <param name="accountHolder">The account holder.</param>
        /// <param name="typeOfBankScore">The type of bank score.</param>
        public void OpenAccount(string firstName, string lastName, string email, TypeOfBankScore typeOfBankScore)
        {
            var accountHolder = new AccountHolder(firstName, lastName, email);

            var account = AccountFabric.Create(accountHolder, numberGenerator.GenerateAccountNumbers(), typeOfBankScore);

            repositoryAccountHolders.Create(accountHolder.ToDalAccountHolder());

            repositoryAccounts.Create(account.ToDalAccount());
        }