Skip to content

Documentation / @facturometro/einvoice / failureIssue

Function: failureIssue() ​

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

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

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

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 '@facturometro/validator';

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

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