refactor(portal): normalize route composition with fileRouteBuilder

This commit is contained in:
2026-03-25 11:36:59 +00:00
parent 65003bb08c
commit ae64ee6c2b
2 changed files with 149 additions and 76 deletions
+42
View File
@@ -2517,3 +2517,45 @@ Validation:
Follow-ups:
- Optional next widened slice: evaluate applying `fileRouteBuilder` to portal/case service file-route call sites for cross-module query-builder consistency.
---
### CL-071: TASK22260 next widened cross-module slice — portal service query normalization via fileRouteBuilder
date: 2026-03-25
author: Cline
scope: `actions/services/portalDirectService.js`
type: change
rationale: Deliver the requested next wider slice by extending `fileRouteBuilder` adoption beyond document service into portal service, reducing duplicated query string concatenation and improving consistency in signed/unsigned route construction.
impact: Improves maintainability and query-construction consistency across high-use portal service flows while preserving existing runtime behavior and hash-signing contracts.
status: completed
Summary:
- Refactored `actions/services/portalDirectService.js` to use shared route helpers:
- `buildFileQuery`
- `withBaseUrl`
- `appendQuerySuffix`
- Normalized query composition across portal service GET/DELETE/message flows:
- read/list endpoints (`getMyCases`, `getMyInvolvements`, `getMyLPACases`, `getMyRepresentations`, proxy and watched/awaiting variants)
- delete endpoints (`deleteMyRepresentations`, `deleteAwaitingSubmissions`, `deleteWatchedCases`)
- file-message endpoints (`sendCaseCompleteMessage`, `sendCaseCompleteMessageProxy`, `sendRepCompleteMessage`)
- Preserved behavior contracts:
- retained BASE_URL usage patterns for existing BASE_URL-prefixed routes
- retained hash-signing flow via `buildHashedQueryUrl`
- retained append semantics for signed suffixes in `sendCaseCompleteMessage`
- retained request methods, headers, payloads, and catch-path logging
Validation:
- `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: apply the same query-normalization helpers in `caseDirectService` and add dedicated phase22 behavioral assertions for `portalDirectService` route-building/signing composition.