PR 2 of the behandlingshistorik plan (stacked on #1787).
- lib/reports/behandlingshistorik-pdf-template.tsx: landscape A4 react-pdf
document. Fixed header (räkenskapsår, urval, legal reference, company) and
footer (page x of y, generated in Europe/Stockholm), repeated table header,
wrap={false} rows, no `break` props. Two sections in the order the reader
needs them: "Ändringar i bokföringssystemet" (p. 9.16 second paragraph)
then "Bokföringsposter i registreringsordning" (first paragraph). Meta row:
generated, programversion, antal händelser, källor. Details as one wrapped
paragraph per row (real-data render 371 events: 1.5 s, 23 pages). Glyphs the
bundled Helvetica lacks (arrow, true minus) are mapped to ASCII.
- GET /api/reports/behandlingshistorik?format=pdf with a 4 000-event guard
(413 REPORT_PDF_TOO_LARGE, CSV/XLSX remain complete); PDF first in the
export menu; catalog exports pdf+xlsx.
- lib/reports/app-version.ts shared by the route and the archive:
revision/systemdokumentation.json now carries system.version and a
behandlingshistorik block (where and how it is produced, p. 9.15); the
shipped systemdokumentation template §9.3 points at Rapporter >
Behandlingshistorik (PDF/CSV/Excel) as well as the backup ZIP.
- Settings values that are objects render as "key: value" pairs in every
format; report carries category_filter so the document states its urval.
- Tests: 4 PDF template tests (valid PDF, empty report, filtered range,
220-row pagination), route pdf 200 + 413, route "unknown format" moved off
pdf. Prod read-only render verified visually (header, sections, paging).
Claude-Session: https://claude.ai/code/session_01Kw2CFCEt8MxzbJiXMAgMVi
Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>