public void UpdateCashTransactionType(CashTransactionType cashTransactionType) { //TODO add validation to CashTransactionType CashTransactionType = cashTransactionType; UpdateLastModifiedDate(); CheckValidity(); }
public CashAccountTransaction ( CashTransactionType transactionType, CashAccountId cashAcctID, CashAcctTransactionDate transactionDate, CashAcctTransactionAmount transactionAmount, ExternalAgentId agentId, EconomicEventId eventId, CheckNumber checkNumber, string remittanceAdvice, UserId userID ) : this() { CashTransactionType = transactionType; CashAccountId = cashAcctID ?? throw new ArgumentNullException("The cash account id is required."); CashAcctTransactionDate = transactionDate ?? throw new ArgumentNullException("The cash transaction date is required."); CashAcctTransactionAmount = transactionAmount ?? throw new ArgumentNullException("The cash transaction amount is required."); AgentId = agentId ?? throw new ArgumentNullException("The external agent id is required."); EventId = eventId ?? throw new ArgumentNullException("The cash economic event id is required."); CheckNumber = checkNumber ?? throw new ArgumentNullException("The check number is required."); RemittanceAdvice = remittanceAdvice; UserId = userID ?? throw new ArgumentNullException("The user id is required."); CheckValidity(); }
public void AddTransaction(Date date, CashTransactionType type, string description, decimal amount, decimal balance) { var transaction = new Transaction() { Date = date, Type = type, Description = description, Amount = amount, Balance = balance }; Transactions.Add(transaction); }
public CreateCashTransactionRequest(CashTransactionType type, BankAssetType initiatedBy, string from, string to, decimal senderRemainingBalance, decimal recipientRemainingBalance, string description, PaymentType paymentType, DateTime transactionDate, string recipeintFirstName, string recipeintLastName, string creditCardNo, string debitCardNo, string pin) { Type = Throw.ArgumentNullException.IfNull(type, nameof(type)); InitiatedBy = Throw.ArgumentNullException.IfNull(initiatedBy, nameof(initiatedBy)); From = from; To = to; SenderRemainingBalance = senderRemainingBalance; RecipientRemainingBalance = recipientRemainingBalance; Description = description; PaymentType = Throw.ArgumentNullException.IfNull(paymentType, nameof(paymentType)); TransactionDate = Throw.ArgumentNullException.IfNull(transactionDate, nameof(transactionDate)); RecipeintFirstName = recipeintFirstName; RecipeintLastName = recipeintLastName; CreditCardNo = creditCardNo; DebitCardNo = debitCardNo; PIN = pin; }
public void EditCash(float cash_edit, CashTransactionType ctt = CashTransactionType.Edit) { //Error check if (cash_edit < 0) { if (Math.Abs(cash_edit) > Cash) { throw new Exception("Trying to withdraw more cash than portfolio has. Trying to withdraw: $" + cash_edit.ToString("#,##0.00") + ", portfolio has $" + Cash.ToString("#,##0.00")); } } //Perform the edit! Cash = Cash + cash_edit; CashTransaction ct = new CashTransaction(); ct.ChangeType = ctt; ct.UpdateTransactionTime(); ct.CashChange = cash_edit; CashTransactionLog.Add(ct); }