Commit Graph
116 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 13cd2514c7 ip app lpa ip can raise final comments 2026-03-30 12:34:48 +01:00
robbond 8ecde91bd9 removed app if not an app in capacity 2026-03-17 11:15:54 +00:00
robbond 071fcc0dab updated copy on representation complete submit 2026-03-16 12:07:39 +00:00
robbond a0a633a9ea refactor phase 3a components chunk 1 targeted actions imports 2026-03-12 12:13:29 +00:00
robbond 2c6d110d9b chekc box to download questionnaire 2026-03-09 12:13:24 +00:00
robbond 5e46495e79 reference ticket number not title, caters for long titles 2026-02-20 11:58:35 +00:00
robbond 1b586da1ae 21187 implement helper function on summary 2026-01-27 11:58:40 +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 92ceacb57b Merge branch 'Development' into SIPS-Development 2025-08-20 12:11:55 +01:00
robbond 21bba4a131 use ticketnumber not ref/title/pinswg_name 2025-08-12 12:52:43 +01:00
robbond 6fa2418b19 use ticketnumber not ref/title/pinswg_name 2025-08-12 07:20:17 +01:00
robbond f6cd76ed38 added chaining and a blank 2025-07-17 12:21:26 +01:00
robbond 91dcf6c5c3 rep create fix 2025-06-27 06:40:51 +01:00
robbond 40f7b92dc6 17105 no LIR for applicant and refactor 2025-06-11 10:44:18 +01:00
robbond c738d2bde9 added nrw domain as env variable 2025-05-15 10:15:41 +01:00
robbond c0b23fff6c set documentlocationid 2025-05-08 12:53:25 +01:00
robbond eae42c3622 16435 logic to disable continue button so cant submit empty rep 2025-04-28 17:14:59 +01:00
robbond a33018d225 16003 Sips Documents, 16010 Role baes reps for sips 2025-04-28 13:53:25 +01:00
robbond d882e65071 uodated queries to sort deep recursion 2025-04-16 08:44:45 +01:00
robbond 87f0dcd811 changes sandbox: {} to eval: true, caused errors in evaluated queries 2025-04-15 17:25:14 +01:00
robbond 05f791e6a8 update jsonpath for csp fix 2025-04-15 12:59:27 +01:00
robbond 0ad58a59be taking end date of dns fix 2025-03-25 12:49:26 +00:00
robbond 8642608c64 amended display logic for startemtns to fix previous 2025-03-24 16:07:08 +00:00
robbond 74774ddae0 added statements and cater for end rep period date 2025-03-24 12:49:33 +00:00
robbond 4ae78dec72 remove www text on reps 2025-02-27 13:05:16 +00:00
robbond 4bc4edf537 welsh lang for yes no 2025-02-11 10:18:26 +00:00
robbond 608348910f rep defect 46 2025-02-07 12:45:30 +00:00
robbond 37b2e1c734 fix fro incorrect month in repfile name 2025-02-05 11:14:36 +00:00
robbond bedaa79281 rep defect 42, questionnaire defect 67, enf defect 16 2025-02-03 17:04:05 +00:00
robbond 6dded01501 reps defect 43 - also handles not submitting reps when date passed 2025-01-30 14:12:15 +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 28aec45270 enf defect 17 - removed leftover enf type from questionnaire selection 2025-01-17 16:38:02 +00:00
robbond e539b7054b fix to delay moving on til large pdf completed 2025-01-16 14:06:56 +00:00
robbond c9ef4ffabb questionnaire defect 58 added dates for DNS 2025-01-16 07:51:52 +00:00
robbond e00d614067 questionnaire defect 58 2025-01-16 07:51:13 +00:00
robbond 3fdb9e8c3a enforcement pdf fixes 2025-01-15 16:36:35 +00:00
robbond 33ab93643d questionnaire defect 60.55,59,57 2025-01-15 11:30:58 +00:00
robbond 49418becf2 uat defect 131 link in new tab 2025-01-15 09:22:23 +00:00
robbond 665c4bbba5 uat defect 124, rep defect 11, questionnaire defect 26 2025-01-13 18:21:40 +00:00
robbond 0b541f8355 rep defect 36 2025-01-09 12:11:36 +00:00
robbond b0cafb58be two digit day month on reps doc 2025-01-07 11:23:53 +00:00
robbond 021cd9375c questionnaire defect 18 2025-01-07 06:36:19 +00:00
robbond 29971a7bbb questionnaire defect 1 2025-01-06 11:30:57 +00:00
robbond b133dca25a rep defect 13, 8, 20 2025-01-02 13:10:09 +00:00
robbond 97cfeb562a upodated rep file upload 2024-12-18 12:39:17 +00:00
robbond b2e1c01dea rep defect 2 2024-12-10 15:07:02 +00:00
robbond 853c053567 time delimiter in date time of reps uploaded 2024-12-09 16:44:48 +00:00
robbond 9734bffee3 adjsuted dates in community levy query 2024-12-05 17:29:20 +00:00