public async Task <List <PaymentDetail> > GetPaymentAsync(DateTime startDate, DateTime endDate) { var candidateInvoiceTransactions = _invoiceTransactionRepository.GetBetweenDates(startDate, endDate); if (!candidateInvoiceTransactions.Any()) { throw new InvalidOperationException(string.Format("No supplier invoice transactions found between dates {0} to {1}", startDate, endDate)); } return(await Task.FromResult(_supplierPaymentBuilder.Build(candidateInvoiceTransactions))); }
ISupplierBacsExport ISupplierPaymentService.GetSupplierPayments(DateTime startDate, DateTime endDate) { var invoiceTransactions = new InvoiceTransactionRepository(); var candidateInvoiceTransactions = (IList <IInvoiceTransaction>)invoiceTransactions.GetBetweenDates(startDate, endDate); if (!candidateInvoiceTransactions.Any()) { throw new InvalidOperationException(string.Format(NO_SUPPLIER_TRANSACTIONS_FORMAT, startDate, endDate)); } var candidateBacsExport = CreateCandidateBacxExportFromSupplierPayments(candidateInvoiceTransactions); return(candidateBacsExport); }