feat: extract due date and buyer reference, require it on XRechnung
- CII: due_date is read from the payment due date (BT-9) instead of the delivery terms description, normalized to YYYY-MM-DD - new field buyer_reference (BT-10, the Leitweg-ID) for CII and UBL - /validate accepts an optional profile; on XRECHNUNG_* profiles a missing buyer reference is a critical error (BR-DE-15) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,10 @@
|
||||
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
|
||||
"examples": ["2024-02-01", "2025-01-15"]
|
||||
},
|
||||
"buyer_reference": {
|
||||
"type": ["string", "null"],
|
||||
"description": "Buyer reference (BT-10). On XRechnung invoices this is the Leitweg-ID and mandatory. Optional otherwise."
|
||||
},
|
||||
"due_date": {
|
||||
"type": ["string", "null"],
|
||||
"description": "Payment due date in ISO 8601 format (YYYY-MM-DD). Optional but recommended.",
|
||||
@@ -283,6 +287,11 @@
|
||||
"description": "Raw text extracted from the PDF document. Used for 'pdf_abgleich' validation check to compare XML data with PDF text.",
|
||||
"examples": ["Invoice RE-2024-001\nTotal: 1190.00 EUR\n..."]
|
||||
},
|
||||
"profile": {
|
||||
"type": ["string", "null"],
|
||||
"description": "Invoice profile as returned by /extract in 'zugferd_profil' (e.g. EN16931, XRECHNUNG_3.0). Optional. Enables profile-specific rules: on XRECHNUNG_* profiles the buyer_reference is a required field.",
|
||||
"examples": ["EN16931", "XRECHNUNG_3.0"]
|
||||
},
|
||||
"checks": {
|
||||
"type": "array",
|
||||
"description": "List of validation checks to run. Each check validates different aspects of the invoice data.",
|
||||
|
||||
Reference in New Issue
Block a user