TASK22269: add signed request client and migrate portal deleteWatchedCases pilot

This commit is contained in:
2026-03-25 13:37:49 +00:00
parent 35ff16b2b2
commit 811655c8d2
6 changed files with 120 additions and 10 deletions
+43
View File
@@ -2725,3 +2725,46 @@ Validation:
Follow-ups:
- Sequence A step3 targeted gaps are now covered; further test expansion should be treated as new scope (e.g., deeper end-to-end journey assertions).
---
### CL-076: TASK22269 Slice B1.1 — signed-request helper set + portal pilot signed-flow migration
date: 2026-03-25
author: Cline
scope: `actions/clients/{signedRequestClient,index}.js`, `actions/services/portalDirectService.js`, `tests/{serviceHarness,phase22/portal-service-behaviour}.cjs`
type: change
rationale: Execute Sequence B Workstream B1 pilot by introducing shared signed request helpers (GET/POST/DELETE) and migrating one bounded portal signed flow without broader module rollout.
impact: Reduces duplication and drift risk in hash-signing + method execution paths while preserving existing signed-flow behavior contracts.
status: completed
Summary:
- Added new shared signed-request client helper module:
- `actions/clients/signedRequestClient.js`
- exports:
- `getSignedJson(queryUrl, config?)`
- `postSignedJson(queryUrl, data, config?)`
- `deleteSignedJson(queryUrl, config?)`
- all helpers use existing `buildHashedQueryUrl(...)` + `requestJson(...)` composition to preserve signing semantics
- Exported new helper module via `actions/clients/index.js`.
- Migrated exactly one pilot signed flow in portal service:
- `deleteWatchedCases` in `actions/services/portalDirectService.js`
- from inline `buildHashedQueryUrl(...).then(requestJson(...))` to `deleteSignedJson(queryUrl)`
- preserved existing catch/log behavior (`consoleLogger` + `undefined` return on catch)
- Added test harness compatibility for VM import-stripping suites:
- `tests/serviceHarness.cjs` now injects default `deleteSignedJson` mock behavior.
- Expanded portal behavioral tests with explicit negative-path assertion:
- `tests/phase22/portal-service-behaviour.test.cjs`
- verifies `deleteWatchedCases` logs and safely returns `undefined` when signed delete fails.
Validation:
- `npm run lint` -> pass with warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
- `node tests/phase22/index.test.cjs` -> pass
- portal-service suite now 5/5 including signed-delete failure path
- `node tests/phase7/service-behaviour.test.cjs` -> pass (13/13)
Follow-ups:
- Continue Sequence B B1 in future bounded slices by migrating additional signed flows one module/function cluster at a time (outside this slice).