public void Withdraw(string requestId, decimal amount) { if (amount <= 0) { throw new ArgumentException($"The amount to withdraw must be greater than 0."); } var transaction = new AccountTransaction( requestId, AccountTransactionType.DEPOSIT, AccountTransactionStatus.PENDING, amount ); transactions.Add(transaction); }
public AccountTransaction CreatePendingDepositTransaction(string requestId, decimal amount) { if (amount <= 0) { throw new ArgumentException($"The amount to deposit must be greater than 0."); } var transaction = new AccountTransaction( requestId, AccountTransactionType.DEPOSIT, AccountTransactionStatus.PENDING, amount ); transactions.Add(transaction); return(transaction); }