Implement comprehensive FatturaPA (Italian e-invoicing) support with 300+ fields, XML/JSON exporters, and full test coverage#77
Merged
maxchampoux merged 4 commits intoJul 29, 2025
Conversation
Co-authored-by: maxchampoux <11485623+maxchampoux@users.noreply.github.com>
Co-authored-by: maxchampoux <11485623+maxchampoux@users.noreply.github.com>
…tion Co-authored-by: maxchampoux <11485623+maxchampoux@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [FEATURE] FatturaPA (Italian e-invoicing) full compatibility: schema, serialization, prompts, tests, and docs
Implement comprehensive FatturaPA (Italian e-invoicing) support with 300+ fields, XML/JSON exporters, and full test coverage
Jul 29, 2025
maxchampoux
approved these changes
Jul 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements complete support for FatturaPA, the Italian electronic invoicing standard mandated by the Agenzia delle Entrate (Italian Revenue Agency). The implementation covers all document types, cross-border scenarios, and provides production-ready XML/JSON exporters.
🚀 Key Features
Comprehensive Data Model
Production-Ready Exporters
Intelligent Extraction
📁 Files Added/Modified
Core Implementation
src/models/invoice.ts- Comprehensive FatturaPA data model with Zod schema validationsrc/prompts/extract-invoice-fatturapa.prompt.ts- Specialized extraction prompt for FatturaPAsrc/exporters/fatturapa-xml.ts- SDI-compliant XML exportersrc/exporters/fatturapa-json.ts- Structured JSON exporter with multiple formatssrc/constants.ts- Added FatturaPA prompt supportsrc/types.ts- Updated types to include Anthropic vendorTesting Infrastructure
tests/unit/exporters/fatturapa-exporters.test.ts- Comprehensive exporter tests (15+ scenarios)tests/integration/extractor-integration.test.ts- Integration tests for domestic/cross-border scenariosExamples & Documentation
examples/fatturapa/domestic-invoice-sample.json- Complete Italian domestic invoice exampleexamples/fatturapa/crossborder-invoice-sample.json- Cross-border (TD18) invoice exampleexamples/fatturapa/README.md- Example documentationREADME.mdwith comprehensive FatturaPA documentation💼 Business Value
For Italian Businesses
For Developers
🧪 Testing
The implementation includes comprehensive testing:
📋 Usage Examples
CLI Usage
Programmatic Usage
🔍 Sample Output
The XML exporter generates valid FatturaPA XML:
✅ Compliance & Validation
This implementation makes the AI Invoice Extractor the most comprehensive FatturaPA solution available, supporting the full complexity of Italian e-invoicing requirements while maintaining ease of use.
This pull request was created as a result of the following prompt from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.