public async Task <SavingsTransaction> CreateSavingsTransactionWhen(BankTransferAdded notification) { var isSavingsAccount = await _savingsAccountRepository.IsSavingsAccount(notification.Iban); if (isSavingsAccount) { var savingsTransaction = _savingsTransactionFactory.CreateFrom(SavingsTransactionType.BankTransfer, notification.Value, notification.PaymentDate, notification.RecipientName, notification.Details, notification.BankTransferId); return(savingsTransaction); } return(null); }
public async Task <Income> CreateIncomeWhen(CollectionAdded notification) { var isSavingsAccount = await _savingsAccountRepository.IsSavingsAccount(notification.FromIban); if (isSavingsAccount) { return(null); } var income = _incomeFactory.CreateFrom(IncomeType.Collection, notification.Value, notification.IncomeDate, notification.From, notification.FromIban, notification.Details, notification.CollectionId); return(income); }