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); }
public SupplierPaymentService(ISupplierPaymentBuilder supplierPaymentBuilder) { _supplierPaymentBuilder = supplierPaymentBuilder; _invoiceTransactionRepository = new InvoiceTransactionRepository(); }