TASK22224: prune dead code in pdf handlers

This commit is contained in:
2026-03-24 05:58:31 +00:00
parent c6205bbb39
commit dfdfd3653c
3 changed files with 40 additions and 107 deletions
+37
View File
@@ -583,3 +583,40 @@ Validation:
Follow-ups:
- Optional: dead import cleanup (`Document/Page/Text/View/StyleSheet/PDFViewer`, `middleware`, `nextConnect`, `fs`, etc.) can be done in a dedicated non-behavioral hygiene PR.
---
### CL-015: TASK22224 pdf handler dead-code hygiene slice
date: 2026-03-24
author: Cline
scope: `pages/api/file/{generatepdf,generateappealpdf}.js`
type: change
rationale: Execute the requested next low-risk slice by removing dead imports and unused locals in recently hardened PDF handlers.
impact: Non-behavioral maintainability cleanup; reduces lint noise and future edit risk while preserving existing contracts.
status: completed
Summary:
- `pages/api/file/generatepdf.js`
- pruned unused Azure storage imports, leaving only `createRepPDFBlob`
- pruned unused `@react-pdf/renderer` named imports
- removed unused imports (`middleware`, `nextConnect`, `fs`)
- removed unused locals (`casefolderID`, `representationType`, `repRaiser`, `localeSelect`, `repCapacity`, `repType`)
- `pages/api/file/generateappealpdf.js`
- pruned unused Azure storage imports to only required functions
- pruned unused `@react-pdf/renderer` named imports
- removed unused imports (`middleware`, `nextConnect`, `fs`, `path`, unused pdf templates)
- removed unused local (`caseRef`)
Validation:
- `node tests/phase21/api-contract-slice1.test.cjs` -> pass
- helper: 4/4
- file-handler: 53/53
- email-handler: 12/12
- endpoint-handler: 152/152
Follow-ups:
- Optional: run full repo lint in a separate pass for broader non-slice hygiene now that targeted contract suite is stable.