refactor(document): complete signed post flows via fileClient

This commit is contained in:
2026-03-25 11:14:57 +00:00
parent 391040b5ac
commit ad855fec88
4 changed files with 119 additions and 52 deletions
+46
View File
@@ -2383,3 +2383,49 @@ Validation:
Follow-ups:
- Optional next bounded slice: evaluate adding equivalent focused behavioural coverage in phase6 if download helper behavior becomes part of that suites scope.
---
### CL-068: TASK22260 widened module-completion slice — documentDirectService signed POST flows via fileClient
date: 2026-03-25
author: Cline
scope: `actions/clients/fileClient.js`, `actions/services/documentDirectService.js`, `tests/phase22/file-client-behaviour.test.cjs`
type: change
rationale: Per user request to widen slices, complete a larger coherent module-level increment by moving the remaining signed POST file-route flows in document service onto `fileClient`.
impact: Further reduces request/signing boilerplate in document service and centralizes signed file-route behavior in client wrapper layer with added regression coverage.
status: completed
Summary:
- Extended `actions/clients/fileClient.js` with:
- `postSignedFileJson(queryUrl, data, config = {})`
- signs query URL via `buildHashedQueryUrl` and executes POST via `requestJson`
- Migrated all remaining signed POST helper paths in `actions/services/documentDirectService.js` to `postSignedFileJson`:
- `uploadFiles`
- `uploadSingleFile`
- `uploadRepFiles`
- `generateRepPDF`
- `generateAppealPDF`
- Preserved existing catch-path logging and request-option semantics:
- multipart headers for upload flows
- conditional `responseType: "blob"` for download variants
- Expanded phase22 file-client behavior suite with explicit POST-signed contract test:
- URL signing + POST method
- data passthrough
- config/header passthrough
Validation:
- `node tests/phase22/file-client-behaviour.test.cjs` -> pass (4/4)
- `node tests/phase22/index.test.cjs` -> pass
- core-token: 2/2
- client-utils: 5/5
- file-client: 4/4
- phase22 combined: pass
- `node tests/phase7/service-behaviour.test.cjs` -> pass (13/13)
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
Follow-ups:
- Optional next widened slice: evaluate consolidating remaining direct `getJson` file-read flows in `documentDirectService` behind `fileClient` for full per-module client symmetry.