Validation topic

Validation

validate returns what an invoice breaks, as a list of violations naming the rule and the business term.

The catalogue is compiled from the Schematron the CEN publishes, so it is complete by construction. en16931ArtefactRelease says which revision it was read from, which is what lines a rejection up with a rule.

Classes

RuleDescriptor Validation
One business rule of EN 16931, as the catalogue knows it.

Constants

conditionRules → const Map<String, RuleCheck> Validation
The rules of the BR-CO family, which say what has to follow from what.
en16931ArtefactRelease → const String Validation
The release of the artefacts the catalogue was read from.
presenceRules → const Map<String, RuleCheck> Validation
The rules of the BR family, which say what an invoice has to carry.
presenceSatisfiedByConstruction → const Map<String, String> Validation
The rules of the BR family an invoice built with this library cannot break, and what stops it.
ruleCatalogue → const List<RuleDescriptor> Validation
Every business rule EN 16931 defines.

Properties

codeListRules → Map<String, RuleCheck> Validation
The rules of the BR-CL family, which draw a code from a published list.
final
decimalRules → Map<String, RuleCheck> Validation
The rules of the BR-DEC family, which hold an amount to two decimals.
final
vatCategoryRules → Map<String, RuleCheck> Validation
The rules that hold for one VAT category at a time.
final

Functions

ruleFor(String id) → RuleDescriptor Validation
The rule the standard publishes as id.
validate(Invoice invoice) → List<RuleViolation> Validation
What invoice breaks, in the order the standard numbers its rules.

Enums

RuleSeverity Validation
How a receiver treats an invoice that breaks a rule.

Typedefs

RuleCheck = Iterable<RuleViolation> Function(Invoice invoice, RuleDescriptor rule) Validation
Checks one rule against an invoice and reports what it finds.