@casoon/invoice-generator
Version:
Generate PDF invoices, XRechnung XML, and ZUGFeRD PDF/A-3 from JSON data with TypeScript support
34 lines • 1.21 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadTestInvoice = loadTestInvoice;
exports.loadTestInvoiceData = loadTestInvoiceData;
const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
/**
* Lädt die zentrale Testdaten-JSON-Datei
*/
function loadTestInvoice() {
const testDataPath = path_1.default.join(process.cwd(), 'data', 'test-invoice.json');
if (!fs_1.default.existsSync(testDataPath)) {
throw new Error(`Testdaten-Datei nicht gefunden: ${testDataPath}`);
}
const jsonContent = fs_1.default.readFileSync(testDataPath, 'utf8');
return JSON.parse(jsonContent);
}
/**
* Lädt die Testdaten und gibt sie als InvoiceData-Objekt zurück (für Tests)
*/
function loadTestInvoiceData() {
const invoice = loadTestInvoice();
return {
invoices: [invoice],
extractionDate: "2025-01-30T12:00:00Z",
invoiceCount: 1,
formatVersion: "1.0",
description: "Test invoice data"
};
}
//# sourceMappingURL=test-data.js.map