Skip to content

Documentation / @einvoice-ts/validator / failureIssue

Function: failureIssue() ​

failureIssue(rule, hit, verdict, env): Issue

Defined in: packages/validator/src/engine/issue.ts:234

The issue for a rule that failed on one of its context nodes.

The context XPath is the hit's own xpath when it has one, else the XPath of its model path. The issue's xpath is the context XPath, or the XPath of the refined path when the verdict has an at.

Parameters ​

rule ​

Rule

The rule.

hit ​

Hit

The context node.

verdict ​

false | { at?: ModelPath; data?: Readonly<Record<string, string>>; }

The failing verdict: false, or a refinement.

env ​

IssueEnvironment

The run's shared fields.

Returns ​

Issue

The issue.

Throws ​

When the refinement's at does not exist in the schema.

Example ​

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

failureIssue(br01, { node: invoice, path: [] }, { at: ['customizationId'] }, env).xpath;
// '/ubl:Invoice/cbc:CustomizationID'

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.