Commit Graph
72 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 c754e04034 batch uploads on frontend 2026-04-02 16:09:56 +01:00
robbond c4ad9ab7a2 refactor(actions): complete priority-1 consumer import migration pass 2026-03-12 13:26:48 +00:00
robbond 96e180040d fix for pdf formatting and hyperlinks 2026-03-09 13:11:28 +00:00
robbond 0e9a4da4be regex update to include apostrophe 2026-02-27 09:41:40 +00:00
robbond cfe732f299 included emdash in doc upload validation 2026-02-26 13:04:28 +00:00
robbond dd12dc99da 21099 api serverside validation check 2026-01-21 13:17:03 +00:00
robbond e6b0b0763a 21099 update filename validation with # 2026-01-20 15:20:54 +00:00
robbond 5889c4093b Merge branch 'Development' into SIPS-Development 2025-12-02 14:03:48 +00:00
robbond e9fc8816c1 url encode values corect for hash and remove .zip files allowed 2025-09-11 10:51:14 +01:00
robbond eae42c3622 16435 logic to disable continue button so cant submit empty rep 2025-04-28 17:14:59 +01:00
robbond 2c97986b19 checking mime types by magic sig, extension and headers 2025-03-27 12:48:34 +00:00
robbond 4bc4edf537 welsh lang for yes no 2025-02-11 10:18:26 +00:00
robbond 130102ad30 welsh text amends on reps 2025-02-10 14:13:39 +00:00
robbond f765411992 rep defect 45 2025-02-07 12:44:03 +00:00
robbond bedaa79281 rep defect 42, questionnaire defect 67, enf defect 16 2025-02-03 17:04:05 +00:00
robbond 5cadd05364 welsh language updated for errors on uploads 2025-02-03 11:54:27 +00:00
robbond 3ad21d2c82 questionnaire defect 67, enf 16,reps 42 2025-01-28 12:57:52 +00:00
robbond 32a3542f79 rep defect 42,questioinnaire defect 67, enf defect 16 2025-01-21 16:04:52 +00:00
robbond d0075d6112 questionnaire defect 48 continued 2025-01-14 18:31:36 +00:00
robbond ab66b969b4 questionnaire defect 52 2025-01-14 17:24:04 +00:00
robbond 665c4bbba5 uat defect 124, rep defect 11, questionnaire defect 26 2025-01-13 18:21:40 +00:00
robbond 48b7ab6298 rep defect 21 2025-01-08 13:04:22 +00:00
robbond 47f99bf65b rep defect 20, 21 2025-01-07 13:40:53 +00:00
robbond c3fcfe60da uat defect 119 2025-01-07 12:02:43 +00:00
robbond b1edb208c6 uat defect 128 file uploads size update and copy change 2025-01-07 09:21:43 +00:00
robbond 086942df7a questionnaire defect 22 and 9 2025-01-07 08:01:25 +00:00
robbond 29d8090630 questionnaire defect 21, rep defect 30,11 2025-01-07 06:56:06 +00:00
robbond b785e068db rep defect 30, 21 2025-01-02 13:31:46 +00:00
robbond b133dca25a rep defect 13, 8, 20 2025-01-02 13:10:09 +00:00
robbond 9a58417abd default icon from txt to blank generic icon 2024-12-19 09:40:50 +00:00
robbond 97cfeb562a upodated rep file upload 2024-12-18 12:39:17 +00:00
robbond f44725ee5e rep defect 6 2024-12-10 15:06:40 +00:00
robbond 49d39e052e questionnaire for callins and uploads 2024-12-03 18:27:51 +00:00
robbond b423bb0cea updatd documents needed list 2024-11-28 06:30:24 +00:00
robbond e690bc6725 moved alot of stuff from client side 2024-11-18 19:54:23 +00:00
robbond 4bf10d97db hooks fixes and ordering of events 2024-11-16 07:45:38 +00:00
robbond 61e645c963 added in options for uploadstream for rep pdfs 2024-11-14 14:33:19 +00:00
robbond 19f255111d updated validation to trigger correctly 2024-11-14 06:49:02 +00:00
robbond dc71d16a1f when click change linik values persisted 2024-10-21 15:39:28 +01:00
robbond 113c39a7e9 select drop down selected on reopen 2024-10-10 11:30:02 +01:00
robbond 062d8e8cb5 apply GEL to reps 2024-10-01 13:51:36 +01:00
robbond b0e2bb6e14 remove unused imports 2024-06-19 06:32:38 +01:00
robbond f8a2d44443 welsh lang updates 2024-06-10 10:36:27 +01:00
robbond 87672a14b9 uploading files to reps 2024-06-05 19:52:31 +01:00
robbond ef2e41a377 reps defects 2024-06-05 06:35:13 +01:00
robbond 53e96b18bd updated to fix breadcrumb 2024-06-04 07:56:35 +01:00
robbond c947995e7b reps defects 2024-06-03 11:57:11 +01:00
robbond 9549318b64 include commonlands variant of statementdue date 2024-05-28 19:04:41 +01:00
robbond 6bf933b2f1 updated file name prefixes 2024-05-21 14:03:24 +01:00