Commit Graph
31 Commits
Author SHA1 Message Date
Robert Bond 37a81522d5 Merged PR 2260: refactor(representations): complete slice-based refactor of representations flow
## Representations Refactor — Behaviour-Preserving Structural Improvements

This PR delivers a full refactor of the representations flow, improving structure, readability, and maintainability while preserving all existing behaviour.

The work was completed using a controlled, slice-based approach with strict guardrails and regression validation at each step. No changes have been made to user journeys, payloads, routing, or EN/CY behaviour.

The result is a cleaner, more maintainable codebase with reduced coupling and clearer separation of concerns, ready for future enhancements without increased risk.

---

## What Was Done

The refactor was delivered incrementally across the following slices:

- **R1** — Representation entry logic extraction
- **R2** — Page loader separation (SSR/data orchestration)
- **R3** — Journey step resolution extraction
- **R4** — Flow shell decomposition
- **R5** — Representation elements normalisation
- **R6** — Data/service layer cleanup
- **R7** — Summary rendering proof slice
- **R8** — Submission/finalisation boundary isolation
- **R9** — Summary rollout (Batch 1)

Each slice:
- was isolated to a single concern
- followed strict guardrails
- was validated before merge

Full detail is available in:
`context/representations-refactor-tracker.md`

---

## Key Improvements

- Reduced coupling across the representations journey
- Separated data loading, orchestration, and rendering concerns
- Simplified complex conditional logic into testable helpers
- Standardised summary rendering using shared primitives (`SummaryCard`, `SummaryRow`)
- Isolated submission/finalisation sequencing into explicit boundaries
- Improved overall readability and maintainability

---

## Behaviour Preservation

This refactor does **not** change:

- User journeys (APP / IP / Agent / LPA)
- Route and query behaviour
- Payload contracts and API interactions
- Redux state shape and usage
- Validation rules and messaging
- EN/CY behaviour
- File upload / PDF / email sequencing
- Linked-case logic

All changes are structural only.

---

## Validation

### Automated

- `npm run lint` — passed (warnings only, no new errors)
- `npm run test:reps` — passed (7/7)

### Manual

Validated end-to-end across:

- APP
- IP
- Agent
- LPA

Including:

- representation creation
- editing/resuming representations
- submission flow
- confirmation/completion behaviour
- summary rendering across case types
- EN/CY parity

---

## Risk Management

The refactor targeted several high-risk areas:

- Case summary entry logic
- Representation submission/finalisation sequencing
- Dual-mode entry (new vs existing representation)

Risk was controlled through:

- small, incremental slices
- one branch per slice
- regression validation per slice
- strict behaviour-preservation guardrails
- controlled rollout for summary rendering changes

---

## Reviewer Guidance

Suggested areas to focus on:

- End-to-end representation journey (create → submit → complete)
- S...
2026-04-20 13:09:07 +00:00
robbond 72e4655188 refactor phase 3a myportal representation and case imports 2026-03-12 09:26:34 +00:00
robbond e6b0b0763a 21099 update filename validation with # 2026-01-20 15:20:54 +00:00
robbond 4710d3e420 21097 remove ui for further details 2026-01-19 13:15:50 +00:00
robbond 9241fe0b84 updated restriction to disallow partial reps and appeals from being submitted when not docapi 2026-01-15 13:20:07 +00:00
robbond 5889c4093b Merge branch 'Development' into SIPS-Development 2025-12-02 14:03:48 +00:00
robbond c0dbaa2c3f reps files to use ticket number not title for case ref 2025-09-11 10:49:47 +01:00
robbond 92ceacb57b Merge branch 'Development' into SIPS-Development 2025-08-20 12:11:55 +01:00
robbond 986d5a382f case ref not case title 2025-08-04 06:27:29 +01:00
robbond c738d2bde9 added nrw domain as env variable 2025-05-15 10:15:41 +01:00
robbond 8ed6921804 uat defect 37 2025-01-13 16:21:33 +00:00
robbond 97cfeb562a upodated rep file upload 2024-12-18 12:39:17 +00:00
robbond 49d39e052e questionnaire for callins and uploads 2024-12-03 18:27:51 +00:00
robbond 2e557c85b1 added additional current refs ticketnumber variants + reps on results 2024-11-19 10:47:06 +00:00
robbond e690bc6725 moved alot of stuff from client side 2024-11-18 19:54:23 +00:00
robbond a000c70243 updated logout modal message and added to reps 2024-10-07 15:37:19 +01:00
robbond c73cf2a013 added service account header removed duplicate sign in button 2024-08-12 11:09:59 +01:00
robbond 07de9705e4 pre prod fixes 2024-07-04 11:29:35 +01:00
robbond b0e2bb6e14 remove unused imports 2024-06-19 06:32:38 +01:00
robbond c947995e7b reps defects 2024-06-03 11:57:11 +01:00
robbond 20cd10394f added ticketnumber props to footer component 2024-04-09 15:00:30 +01:00
robbond ef1f773022 updated 2023-11-08 13:20:43 +00:00
robbond 2cbd2d731c rep questionnaire nav/progress 2023-10-26 11:59:20 +01:00
robbond f3da69dc75 reps raised with correct return url 2023-10-25 10:33:08 +01:00
robbond 31375a5999 updated authentication on protected pages 2023-06-05 12:00:28 +01:00
robbond a2ee8c58a6 build warning clean up 2023-02-03 17:00:32 +00:00
robbond ee4d00a500 reps trigger for logged out & upload storage acc 2023-01-05 14:26:08 +00:00
robbond 98aefdd867 reps wip 2022-12-16 11:36:01 +00:00
robbond 38e70b1ec1 information banner from api with date range 2022-09-22 11:12:04 +01:00
robbond f0b69141d4 removed unused imports & watch case on adv search 2022-01-20 10:31:53 +00:00
robbond 5fef09f76a added display of representatons on my portal 2021-11-09 15:19:52 +00:00