Merged PR 2257: refactor(representations): isolate finalisation boundary helpers (slice R8)

refactor(representations): isolate finalisation boundary helpers (slice R8)

Related work items: #22441
This commit is contained in:
Robert Bond
2026-04-17 13:23:55 +00:00
parent 7713fc3724
commit b6ca73d76a
3 changed files with 182 additions and 95 deletions
@@ -321,6 +321,29 @@ Isolate submission logic.
**Risk Level:** HIGH
(Must only be done after earlier slices stabilised)
**Completion notes (this slice):**
- Implemented on feature branch created from `refactor`: `rep-slice-r8-finalisation-boundary`.
- Added a small representation-specific helper module:
- `components/case/representation/utils/finalisationBoundary.js`
- Extracted only approved R8 seams:
- `buildRepresentationUpdateBody(...)` (pure shaping)
- `buildSubmitEnrichedValues(...)` (pure shaping)
- `runFinalisationSequence(...)` (ultra-thin orchestration wrapper)
- Wired `components/case/representation/index.js` to use the new helpers while preserving parent-owned business branching.
- Explicitly preserved R8 constraints:
- no completion-side-effect extraction from `representationComplete.js`
- no route/query changes
- no payload contract changes
- no validation logic changes
- no file upload/PDF/email behaviour changes
- no sequencing drift in finalisation success path
**Validation evidence:**
- `npm run lint` completed (warnings only, no new errors).
- `npm run test:reps` completed: **7 passed (4.4m)**.
---
## Rules