fix(zugferd): Refactor Zugferd decoders to properly extract house numbers from street names and remove unused imports; update readme hints with additional TInvoice reference and refresh PDF metadata timestamps.

This commit is contained in:
2025-04-03 20:23:09 +00:00
parent a077f5c335
commit a5d5525e7a
8 changed files with 104 additions and 32 deletions

View File

@ -1,11 +1,24 @@
import { CIIBaseValidator } from '../cii.validator.js';
import { ValidationLevel } from '../../../interfaces/common.js';
import type { ValidationResult } from '../../../interfaces/common.js';
/**
* Validator for ZUGFeRD invoice format
*/
export class ZUGFeRDValidator extends CIIBaseValidator {
/**
* Validates ZUGFeRD XML structure
* @returns True if structure validation passed
*/
protected validateStructure(): boolean {
// Check for required elements in ZUGFeRD structure
const invoiceId = this.getText('//rsm:ExchangedDocument/ram:ID');
if (!invoiceId) {
this.addError('ZUGFERD-STRUCT-1', 'Invoice ID is required', '//rsm:ExchangedDocument/ram:ID');
return false;
}
return true;
}
/**
* Validates ZUGFeRD XML against business rules
* @returns True if business validation passed