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 ​
The rule.
hit ​
The context node.
verdict ​
false | { at?: ModelPath; data?: Readonly<Record<string, string>>; }
The failing verdict: false, or a refinement.
env ​
The run's shared fields.
Returns ​
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'