refactor(case): normalize route composition with fileRouteBuilder

This commit is contained in:
2026-03-25 11:49:19 +00:00
parent ae64ee6c2b
commit 05f26ff12c
3 changed files with 164 additions and 89 deletions
+43
View File
@@ -2559,3 +2559,46 @@ Validation:
Follow-ups:
- Optional next widened slice: apply the same query-normalization helpers in `caseDirectService` and add dedicated phase22 behavioral assertions for `portalDirectService` route-building/signing composition.
---
### CL-072: TASK22260 next widened cross-module slice — case service query normalization via fileRouteBuilder
date: 2026-03-25
author: Cline
scope: `actions/services/caseDirectService.js`, `tests/phase6/service-behaviour.test.cjs`
type: change
rationale: Continue widened cross-module rollout by applying shared query/route composition helpers to `caseDirectService`, reducing repeated string concatenation and aligning route construction style with document/portal services.
impact: Improves maintainability and consistency in case service URL/query composition while preserving existing runtime behavior and error contracts.
status: completed
Summary:
- Refactored `actions/services/caseDirectService.js` to use `fileRouteBuilder` helpers:
- `buildFileQuery`
- `withBaseUrl`
- Normalized route composition for read and write helpers, including:
- case retrieval/search flows (`getCaseMessage`, `getIncidentbyID`, `getIsPublishedbyID`, `getPartSavedAppeal`, `getSIPSEvents`, `getSIPSMedia`)
- appeal resolution/update/create flows (`getAppealID`, `createNewCase`, `createNewCaseBlob`, `updateCase`, `updateCaseBlob`, `patchCase`)
- case/detail/document/module reads (`getCase`, `getCaseByID`, `getAppealPDFDocs`, `getAppealPDFDocument`, `getPortalModuleDetails`, `getPortalModuleDetailsProxy`)
- Preserved existing contracts:
- BASE_URL usage patterns where previously applied
- method/payload semantics for `requestJson` paths
- catch-path logging and return behavior (`logAndReturnResponse`, `consoleLogger`, `error.response` paths)
- Expanded phase6 behavioural coverage with a focused assertion for case route composition:
- `case/getPortalModuleDetails composes BASE_URL route with encoded case reference`
Validation:
- `node tests/phase6/service-behaviour.test.cjs` -> pass (9/9)
- `node tests/phase7/service-behaviour.test.cjs` -> pass (13/13)
- `node tests/phase22/index.test.cjs` -> pass
- core-token: 2/2
- client-utils: 6/6
- file-client: 4/4
- phase22 combined: pass
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
Follow-ups:
- Optional next widened slice: add a focused phase22 behavioral suite for `caseDirectService` and normalize any remaining specialized encoding usage behind explicit helper options where appropriate.