Commit Graph
18 Commits
Author SHA1 Message Date
m3ta-chiron ccf8ad67fa feat(tests): fixture sweep, anonymized real-invoice regression corpus, CI
CI / docker (push) Canceled after 0s
CI / test (push) Canceled after 0s
- test_fixture_sweep: extract+validate every fixture PDF on every run;
  known extractor/validator gaps are catalogued explicitly and the sweep
  fails on any deviation from that catalogue
- tests/fixtures/real/: anonymized XML from real production invoices that
  revealed bugs (verified to contain no real-world data); first entry
  locks in the FC-tax-number/basis-quantity/spaced-VAT-ID regressions
- CI workflow: uv sync --frozen from lockfile + pytest + docker build
2026-09-11 16:06:27 +02:00
m3ta-chiron 0cf359d201 build(deps): upgrade factur-x to 6.8, commit lockfile and pin python 3.11
The venv had drifted (python 3.14 interpreter with python 3.13 packages)
because uv.lock was never committed. Lockfile is now tracked and CI syncs
from it with --frozen.
2026-09-11 16:06:13 +02:00
m3ta-chiron 7fcb3ff21d fix: extract tax number, price basis quantity, spaced VAT IDs and contact email
- supplier/buyer: extract FC tax registration (BT-32/BT-49) into new
  tax_number field; previously only VA (USt-IdNr.) was read
- pflichtfelder: critical error only when neither vat_id nor tax_number
  is present (EN 16931 BR-CO-26)
- ustid: tolerate formatting whitespace inside VAT IDs (e.g. 'DE 140 978 617')
- line items: normalize unit price by basis quantity (BT-149), so a
  price per 100 units no longer inflates line totals by factor 100
- supplier email: also look in DefinedTradeContact (BT-42)
- rewrite xrechnung fallback test to assert only our own behavior,
  independent of factur-x version specifics
2026-09-11 16:05:41 +02:00
m3ta-chiron e2e1d8c046 Allow zero-euro line item amounts 2026-06-03 07:52:52 +02:00
m3ta-chiron d497a4cb5b fix(extractor): detect xrechnung XML attachments 2026-05-21 14:45:20 +02:00
sascha.koenig 18a902bcc9 fallback in extractor if URN not valid 2026-04-09 08:50:35 +02:00
sascha.koenig e47e36d55c feat(nix): expose NixOS module and add CLI args for host/port
- Expose nixosModules.default in flake outputs for easy import
- Add argparse to main.py for --host and --port CLI flags
- Support priority: CLI args > env vars > defaults
2026-02-18 09:19:38 +01:00
sascha.koenig d0f4f0ff2e +devshell with opencode rules 2026-02-18 08:28:46 +01:00
sascha.koenig aeaa171bbf + validation schema 2026-02-17 11:33:32 +01:00
m3tm3reandSisyphus d585390289 fix: resolve test failures and update flake.nix for factur-x source distribution
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-02-04 21:08:08 +01:00
m3tm3reandSisyphus 3eddd66003 build(nix): add Nix flake, NixOS module, and README documentation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-02-04 20:39:43 +01:00
m3tm3re 1a01b46ed6 build(docker): add integration tests, Dockerfile, and docker-compose for packaging 2026-02-04 20:20:39 +01:00
m3tm3reandSisyphus 867b47efd0 feat(api): implement /extract and /validate endpoints with error handling
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-02-04 20:07:35 +01:00
m3tm3re 4791c91f06 feat(api): add validator, FastAPI app structure, and health endpoint
Wave 3 tasks complete:
- Task 7: Validator with 4 checks (pflichtfelder, betraege, ustid, pdf_abgleich)
- Task 8: FastAPI app with CORS, exception handlers, JSON logging
- Task 9: Health endpoint returning status and version

Features:
- validate_invoice() runs selected validation checks
- Exception handlers for ExtractionError and generic errors
- GET /health returns {status: healthy, version: 1.0.0}

Tests: 52 validator tests covering all validation rules
2026-02-04 19:57:12 +01:00
m3tm3re c1f603cd46 feat(core): implement extractor, pdf_parser, and utils with TDD
Wave 2 tasks complete:
- Task 4: ZUGFeRD extractor with profile detection (factur-x)
- Task 5: PDF text parser with regex patterns
- Task 6: Utils with unit code mapping and tolerance checks

Features:
- extract_zugferd() extracts XML and text from PDFs
- parse_zugferd_xml() parses UN/CEFACT CII XML to models
- extract_from_text() extracts values using regex patterns
- translate_unit_code() maps UN/ECE codes to German
- amounts_match() checks with 0.01 EUR tolerance
- German number/date format handling

Tests: 27 utils tests, 27 pdf_parser tests, extractor tests
2026-02-04 19:42:32 +01:00
m3tm3re 29bd8453ec test(fixtures): add ZUGFeRD sample PDFs and feat(models): add Pydantic models
- Download 11 official ZUGFeRD sample PDFs
- Cover profiles: BASIC, BASIC WL, EN16931, EXTENDED, XRechnung
- Add non-ZUGFeRD PDF for negative testing
- Create MANIFEST.md documenting all samples
- Implement all Pydantic models from spec
- Add 28 TDD tests for models
- All tests pass
2026-02-04 19:26:01 +01:00
m3tm3re 0db2482bf2 feat(project): initialize ZUGFeRD service with pyproject.toml and directory structure 2026-02-04 19:19:44 +01:00
m3tm3re 48ad42aa19 first commit 2026-02-04 18:33:16 +01:00