Interface IValidationRule

Namespace
EInvoice.Core.Abstractions
Assembly
EInvoice.Core.dll

A single validation rule that can be applied to an invoice.

public interface IValidationRule

Properties

RuleId

Rule identifier (e.g. "BR-01", "BR-DE-1").

string RuleId { get; }

Property Value

string

Methods

Apply(Invoice)

Apply this rule to the invoice and return any violations.

IEnumerable<ValidationMessage> Apply(Invoice invoice)

Parameters

invoice Invoice

Returns

IEnumerable<ValidationMessage>

Apply(Invoice, VatCategoryIndex)

Apply this rule using a pre-built category index for improved performance. The default implementation ignores the index and delegates to Apply(Invoice). Override in rules that benefit from pre-indexed data.

IEnumerable<ValidationMessage> Apply(Invoice invoice, VatCategoryIndex index)

Parameters

invoice Invoice
index VatCategoryIndex

Returns

IEnumerable<ValidationMessage>