efaturaefatura

Compliance Matrix

This matrix tracks implementation coverage against the official e-Fatura v11 manual and the XML-XSD package published at efatura.cv/docs/xsd.

ReferenceRuleTypeStatusImplementationTestNotes
Manual 6.2DFE XML must follow the official XSD.xsddoneXmllintXsdValidatortests/xsd.test.tsUses bundled 2024-05-27 XSD package.
Manual 6.2XML must be UTF-8 and compact.localdonebuildDfeXmltests/xml.test.tsGenerates XML without pretty-print whitespace.
Manual 6.2DFE root has Version, Id, and DocumentTypeCode.xsddonebuildDfeXmltests/xml.test.tsRoot namespace is urn:cv:efatura:xsd:v1.0.
Manual 6.2.2IUD has 45 characters and Luhn check digit.localdonebuildIud, validateIudtests/iud.test.tsLuhn is for IUD, not NIF.
Manual 6.3.1CV NIF format is [1-9][0-9]{8}.localdonetax-id value objecttests/validation.test.tsExistence is PE/DNRE external validation.
Manual 6.3Party, address, contacts, payments, references, transport and rent receipt are structured fields.localin progressdomain value objectstests/validation.test.tsRemaining known official fields must not rely on extraFields.
Manual 7.2Emitter party is mandatory and must include CV NIF, name, address, email and phone/mobile.localdoneinvoice-fiscal-rules, dfe-party-xmltests/official-rules.test.ts, tests/xml.test.tsRegistry existence is external.
Manual 7.2Receiver party rules vary by DFE type and threshold.localdonedocuments, invoice-datatests/validation.test.tsExternal NIF existence is separate.
Manual 7.2Payment party and transport service provider use the same TaxId format rules.localdoneparty-data, tax-idtests/validation.test.tsRegistry existence is external.
Manual 7.9Software code, name and version are required.localdoneresolveConfig, transmissionXmltests/config.test.ts, tests/xml.test.tsRegistered software validation is external.
Manual 7.18Transmission includes IssueMode, TransmitterTaxId and Software.xsddonetransmissionXmltests/xml.test.ts, tests/xsd.test.tsIssueMode enum preserves Online, Offline and Off.
Manual 7.19Contingency is required when IssueMode is not Online.localdoneassertContingencyMatchesEmissionModetests/official-rules.test.tsOff requires IUC.
Manual 7.21Online date/time tolerance and contingency tolerance must be validated.localdonevalidateIssueDateTolerancetests/event.test.ts, tests/official-rules.test.tsUses injectable clock.
Manual 7Tax type NA requires exemption reason.localdonetax-datatests/validation.test.tsTax code enum is exported.
Manual 7Totals must match line amounts and tax totals.localdoneinvoice-fiscal-rulestests/official-rules.test.tsUses money tolerance of 0.01.
Manual 7Corrective notes require valid references and reason codes.localdonedocuments, invoice-field-compatibilitytests/validation.test.tsIncludes credit, debit and return notes.
Manual 7Transport documents require transport type, route and service provider rules.localdonedocuments, transport-structurestests/validation.test.tsRecipient activity checks are external.
Manual 7Receipt type renda requires rent receipt structure.localdonedocuments, document-structurestests/validation.test.tsXSD validates generated XML.
Manual 8XML signature must be XAdES-BES with SHA-256/RSA.localdoneXadesBesSignertests/signing.test.tsSignature bytes are not compared to official vectors because none are published.
Manual 10Middleware submission sends Deflate ZIP with {IUD}.xml filenames.localdonebuildDfeZip, FetchMiddlewareTransporttests/middleware.test.tsInternal ZIP baseline fixture exists.
Manual 10PE/middleware responses must preserve documents, errors and metadata.localdoneresponse-parsertests/response-parser.test.tsHandles JSON/XML and Portuguese keys.
Manual 11Transmitter and emitter authorization are configured in middleware/PE.pedonefiscal authority contracts and fetch clientstests/fiscal-readiness.test.tsLive checks are opt-in with access token.
Manual 12DFA includes QR Code URL and contingency notice.localdonePdfDfaRenderer, dfaQrCodeUrltests/middleware.test.tsBase URL is configurable.
ArtifactsOfficial XML examples are validated against XSD.artifactdonebundled XML-XSD packagetests/xsd.test.tsSource is official XML-XSD package.
ArtifactsOfficial golden vectors for IUD, ZIP and signature.artifactnot publishedFileSystemGoldenVectorRepositorytests/golden-vectors.test.tsInternal fixtures are package baselines, not DNRE vectors.