Skip to content

Documentation / @einvoice-ts/validator / Verdict

Type Alias: Verdict ​

Verdict = boolean | { at?: ModelPath; data?: Readonly<Record<string, string>>; }

Defined in: packages/validator/src/engine/rule.ts:34

What a rule's test returns: true passes, false fails at the context node, and an object fails with a refinement - at is a model path relative to the context node that points at the offending element, data carries the values that explain the failure.

Example ​

ts
import type { Verdict } from '@einvoice-ts/validator';

const verdict: Verdict = { at: ['payableAmount'], data: { actual: '99.00', expected: '100.00' } };

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.