Finalize a document
THE act. One transaction, in this order: validate the composition → mint `doc_no` gap-free from `document_counter` → render UBL + PDF → validate the UBL IN-PROCESS against EN 16931 and Peppol BIS → write both into `evidence/` through the artifact port → for an invoice or credit note, mint the `sale` event and hand the derived proposal to the SAME ledger door as everything else → flip `finalized 0→1`. A document that fails its own schematron never finalizes, and the counter mint rolls back with it. A quote takes its number and its PDF, no UBL: `entryId` is null and `files` holds its PDF alone in the 200, which is an answer rather than an absence. Finalize fires AT MOST ONCE per row — a retry returns the truth re-selected from the row, `alreadyFinalized: true`, with no second number minted.