/// <inheritdoc />
        public void Deposit(string accountId, decimal amount)
        {
            accountId = accountId ?? throw new ArgumentNullException($"{nameof(accountId)} cannot be null.");
            amount    = amount >= 0
                    ? amount
                    : throw new ArgumentOutOfRangeException($"{nameof(amount)} cannot be less than zero.");

            BankAccountDto bankAccountDto = repository.GetAccountById(accountId) ??
                                            throw new ArgumentException($"Such account doesn't exist.");

            BankAccount account = bankAccountDto.ToAccount();

            DepositToAccount(account, amount);

            repository.Update(account.ToAccountDto(AccountResolver.GetBankAccountTypeName(account.GetType())));
            unitOfWork.Commit();
        }
        /// <inheritdoc />
        public void CloseAccount(string accountId)
        {
            accountId = accountId ?? throw new ArgumentNullException($"{nameof(accountId)} cannot be null.");

            BankAccountDto accountDto = repository.GetAccountById(accountId) ??
                                        throw new ArgumentException($"Such account doesn't exist.");

            if (accountDto.IsClosed)
            {
                throw new InvalidOperationException($"Specified account is already closed.");
            }

            BankAccount account = accountDto.ToAccount();

            account.Close();

            repository.Update(account.ToAccountDto(AccountResolver.GetBankAccountTypeName(account.GetType())));
            unitOfWork.Commit();
        }