Skip to content

Documentation / @facturometro/validator / ValidateOptions

Interface: ValidateOptions ​

Defined in: packages/validator/src/engine/validate.ts:51

Options of validate and assertValid.

Example ​

ts
import { parse } from '@facturometro/parser';
import { dkRuleset, en16931Ruleset, peppolRuleset, validate } from '@facturometro/validator';

validate(invoice, { ruleset: [en16931Ruleset, peppolRuleset, dkRuleset] });

const parsed = parse(xml);
validate(parsed.document, { diagnostics: parsed.diagnostics });

Properties ​

diagnostics? ​

readonly optional diagnostics?: readonly Issue[]

Defined in: packages/validator/src/engine/validate.ts:59

The diagnostics @facturometro/parser reported for the document, so that rules can account for what the model cannot hold: PEPPOL-EN16931-R008 reports the parser's EINV-XML-EMPTY diagnostics as empty elements next to the ones it finds in the model, one issue per element. Omit for a built document. The diagnostics themselves are not copied into the result, and their paths refer to the document as parsed, before the composition's normalize hooks run.


ruleset? ​

readonly optional ruleset?: RulesetComposition

Defined in: packages/validator/src/engine/validate.ts:71

The ruleset constants to run, as an ordered list of layers: later entries modify earlier ones, and a constant must come after what it requires ([en16931Ruleset, peppolRuleset, dkRuleset]; the reverse throws). When omitted, the registry resolves a composition from the document's cbc:CustomizationID: the Peppol BIS Billing 3.0 id, or an id that starts with it, gives [en16931Ruleset, peppolRuleset]; every other id (missing, unknown, the plain CEN id, another CIUS) gives [en16931Ruleset], so Peppol rules run only for documents that declare Peppol. A default never includes national rules: pass dkRuleset explicitly to validate the way the official Peppol validator does for Danish suppliers.

MIT licensed. Specification artefacts belong to OpenPEPPOL, CEN and OASIS.