public NegativeInvoice( LocalCompany issuer, NegativeInvoiceHeader header, IEnumerable <NegativeRevenue> revenueItems, StringIdentifier invoiceIdentifier = null, InvoiceRegistrationNumber invoiceRegistrationNumber = null, InvoiceRegistrationNumber cancelledByInvoiceRegistrationNumber = null, ForeignCompany counterpart = null, IEnumerable <NegativePayment> payments = null) : base(issuer, header, revenueItems, invoiceIdentifier, invoiceRegistrationNumber, cancelledByInvoiceRegistrationNumber, counterpart, payments) { }
public Invoice( LocalCompany issuer, InvoiceHeader header, IEnumerable <Revenue> revenueItems, StringIdentifier invoiceIdentifier = null, InvoiceRegistrationNumber invoiceRegistrationNumber = null, InvoiceRegistrationNumber cancelledByInvoiceRegistrationNumber = null, ForeignCompany counterpart = null, IEnumerable <Payment> payments = null) { Issuer = issuer ?? throw new ArgumentNullException(nameof(issuer)); Header = header ?? throw new ArgumentNullException(nameof(header)); InvoiceIdentifier = invoiceIdentifier; InvoiceRegistrationNumber = invoiceRegistrationNumber; CanceledByInvoiceRegistrationNumber = cancelledByInvoiceRegistrationNumber; Counterpart = counterpart; RevenueItems = revenueItems; Payments = payments; if (revenueItems.Count() == 0) { throw new ArgumentException($"Minimal count of {nameof(revenueItems)} is 1."); } }