validate

public final Unit validate(Map<String, GiniCaptureCompoundExtraction> compoundExtractions)

Checks that the compound extractions contain valid line items.

In case it's not valid an appropriate DigitalInvoiceException subclass will be thrown.

Parameters

compoundExtractions

Throws

DigitalInvoiceException.LineItemsMissingException

if line items are missing from the compound extractions

DigitalInvoiceException.DescriptionMissingException

if description is missing from at least one line item

DigitalInvoiceException.QuantityMissingException

if quantity is missing from at least one line item

DigitalInvoiceException.GrossPriceMissingException

if gross price is missing from at least one line item

DigitalInvoiceException.MixedCurrenciesException

if line items contain more than one currency

DigitalInvoiceException.QuantityParsingException

if a line item's quantity field could not be parsed

DigitalInvoiceException.GrossPriceParsingException

if a line item's gross price field could not be parsed