Storage and integrity
Vavang Invoice persists compliance artefacts in its own Doctrine model. There is no storage key in sylius_invoice.yaml to select a filesystem or bucket.
What is stored
For each compliance document, the plugin stores notably:
- the structured Factur-X XML;
- the Factur-X PDF;
- a SHA-256 checksum of the XML;
- a SHA-256 checksum of the PDF;
- the validation status;
- normalized validation errors;
- the link to the source Sylius invoice.
PDF content is stored as a BLOB and XML as text in the database through Doctrine.
Immutability
Once stored, the XML and PDF cannot be replaced. Attempting to overwrite either artefact raises an error.
When reading or regenerating a document, the plugin verifies its SHA-256 checksums. A document whose integrity no longer matches is rejected rather than transmitted.
Extension contract
SyliusInvoicePlugin\Generation\ComplianceDocumentStoreInterface is aliased to the default Doctrine store and exposes only:
public function find(string $id): ?ComplianceDocument;
public function save(ComplianceDocument $document): void;
This makes decoration possible for logging, metrics or controlled mirroring. A full replacement is higher risk because the rest of the pipeline expects the returned ComplianceDocument to preserve the same deterministic identity, immutability, validation state and checksum semantics.
A decorator should normally delegate find() and save() to the inner Doctrine store and add its side effect around that call. Do not use a decorator to mutate stored XML/PDF after the integrity contract has been established.
External storage boundary
The interface is a compliance-document repository abstraction, not a generic binary-object-storage driver. There is currently no built-in S3/filesystem adapter and no supported storage configuration switch.
If a project needs off-database archival, prefer mirroring or export from the authoritative Doctrine-backed document while keeping integrity metadata and restoration procedures tested. Replacing the authoritative store requires end-to-end tests for generation, idempotent regeneration, download, validation and transmission.
Operational consequence
Database backups are therefore part of the compliance-document backup strategy. Until an external storage backend is explicitly implemented and supported, do not document S3, an external filesystem or a storage option as available functionality.