Commit Graph
4 Commits
Author SHA1 Message Date
Leon Tonhäuser 70ebcc9cd5 feat: standardizer changes 2026-08-11 11:19:10 +02:00
Leon Tonhäuser 0b1ffdfdfc feat: Add flatrate billing model for editorial accounts 2026-08-11 03:27:10 +02:00
Leon TonhäuserandClaude a384c4c35e fix: deterministic pdf render and restore pnpm pin
- Revert packageManager from pnpm@11.16.0 back to pnpm@10.34.5
  (restore the plan's pinned version; the PATH pnpm is unaffected).
- Inject a deterministic PDFKit document /ID derived from
  SHA-256(snapshot.documentId) so the same snapshot always produces
  byte-identical output, making the stored SHA-256 a verifiable
  integrity fingerprint.
- Add covering test: render same fixture twice, assert bytes.equals()
  and sha256 equality.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-10 18:04:18 +02:00
Leon TonhäuserandClaude 89d76e2711 feat: render billing usage pdf
Add the immutable PDF renderer for "Nutzungsnachweis" billing reports.

- src/modules/billing/types.ts: BillingReportSnapshot self-contained type
  (address, selected positions, repeat downloads, net total in cents,
  report/invoice metadata, period, document ID, legal notice).
- src/modules/pdf/document.ts: pdfmake document definition builder with
  monochrome invoice layout (black logo, sender/recipient blocks, rounded
  black summary panel, repeated black table headers, light-gray rows,
  German dates, cents-derived totals, page numbers, document ID, invoice
  reference, legal separation notice).
- src/modules/pdf/render.ts: renderBillingPdf → { bytes, sha256 } using
  pdfmake 0.3 with IBM Plex Mono (OFL) embedded via the VFS.
- scripts/render-pdf-fixture.ts: stress fixture generator (1 row, 60 rows,
  long address, long fields, umlauts, 3-page case) into tmp/pdfs/.
- tests/fixtures/billing-report.ts: deterministic reportFixture (60,00 EUR).
- tsconfig.json: server-only path alias for tsx script execution.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-10 17:54:19 +02:00