- Added validation types for EN16931 compliance in `validation.types.ts`, including interfaces for `ValidationResult`, `ValidationOptions`, and `ValidationReport`. - Introduced `VATCategoriesValidator` in `vat-categories.validator.ts` to validate VAT categories according to EN16931 rules, including detailed checks for standard, zero-rated, exempt, reverse charge, intra-community, export, and out-of-scope services. - Enhanced `IEInvoiceMetadata` interface in `en16931-metadata.ts` to include additional fields required for full standards compliance, such as delivery information, payment information, allowances, and charges. - Implemented helper methods for VAT calculations and validation logic to ensure accurate compliance with EN16931 standards.
70 lines
1.3 KiB
TypeScript
70 lines
1.3 KiB
TypeScript
/**
|
|
* Centralized imports for all external npm modules
|
|
* This file serves as a single point of import for all external dependencies
|
|
* to make the codebase more maintainable and follow the DRY principle.
|
|
*/
|
|
|
|
// Node.js built-in modules
|
|
import * as fs from 'fs/promises';
|
|
import * as path from 'path';
|
|
import * as crypto from 'crypto';
|
|
|
|
// PDF-related imports
|
|
import {
|
|
PDFDocument,
|
|
PDFDict,
|
|
PDFName,
|
|
PDFRawStream,
|
|
PDFArray,
|
|
PDFString,
|
|
AFRelationship
|
|
} from 'pdf-lib';
|
|
|
|
// XML-related imports
|
|
import { DOMParser, XMLSerializer } from 'xmldom';
|
|
import * as xmldom from 'xmldom';
|
|
import * as xpath from 'xpath';
|
|
|
|
// XSLT/Schematron imports
|
|
import * as SaxonJS from 'saxon-js';
|
|
|
|
// Compression-related imports
|
|
import * as pako from 'pako';
|
|
|
|
// Business model imports
|
|
import { business, finance, general } from '@tsclass/tsclass';
|
|
|
|
// Re-export all imports
|
|
export {
|
|
// Node.js built-in modules
|
|
fs,
|
|
path,
|
|
crypto,
|
|
|
|
// PDF-lib exports
|
|
PDFDocument,
|
|
PDFDict,
|
|
PDFName,
|
|
PDFRawStream,
|
|
PDFArray,
|
|
PDFString,
|
|
AFRelationship,
|
|
|
|
// XML-related exports
|
|
DOMParser,
|
|
XMLSerializer,
|
|
xmldom,
|
|
xpath,
|
|
|
|
// XSLT/Schematron exports
|
|
SaxonJS,
|
|
|
|
// Compression-related exports
|
|
pako,
|
|
|
|
// Business model exports
|
|
business,
|
|
finance,
|
|
general
|
|
};
|