Skip to content

Documentation / @einvoice-ts/validator / registerRuleset

Function: registerRuleset() ​

registerRuleset(registration): void

Defined in: packages/validator/src/rulesets/registry.ts:82

Registers a composition for a customization id, so that documents carrying it resolve to it.

The composition is compiled on registration, so a broken one fails here rather than on the first document.

Parameters ​

registration ​

RulesetRegistration

The customization id, the composition and whether to match by prefix.

Returns ​

void

Throws ​

When the customization id is already registered, or when the composition does not compile.

Example ​

ts
import { en16931Ruleset, peppolRuleset, registerRuleset } from '@einvoice-ts/validator';

registerRuleset({
  customizationId: 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0#acme',
  ruleset: [en16931Ruleset, peppolRuleset, acme],
});

MIT licensed. Specification material belongs to OpenPeppol, CEN and OASIS (see NOTICE). Peppol is a trademark of OpenPeppol AISBL; this project is not affiliated with it.