open-nav
    Preparing search index...

    Interface InvoiceValidationContext

    Business rules that are decidable from the document alone.

    Each rule reports NAV's own fault code where one exists, so a local failure names exactly what the service would have said. Rules that need state only NAV holds — whether an invoice number was used before, whether a referenced invoice exists, whether a tax number is registered — cannot be checked here and are listed in LOCALLY_UNDECIDABLE for the record.

    interface InvoiceValidationContext {
        operation?: "CREATE" | "MODIFY" | "STORNO";
        supplierTaxNumber?: string;
        today?: string;
    }

    Hierarchy (View Summary)

    Index
    operation?: "CREATE" | "MODIFY" | "STORNO"

    The operation the document will be submitted under.

    Several rules depend on it: an original invoice must not reference another document, and a modification must.

    supplierTaxNumber?: string

    The tax number the request authenticates as. NAV rejects a report whose supplier is someone else.

    today?: string

    Today's date as yyyy-mm-dd, for the date rules. Defaults to the system date.