Related work items: #22570, #22576, #22577, #22583, #22586, #22587, #22588, #22590, #22591
3.0 KiB
3.0 KiB
Refactor Branch Charter — Portal Journeys
Purpose
This branch exists to safely refactor core portal journeys so they are:
- easier to maintain
- safer to change
- better structured for future extensibility
This is a behaviour-preserving refactor branch, not a feature branch.
Primary Goal
Improve internal structure of portal workflows while preserving all current live behaviour.
Scope
In Scope
- behaviour-preserving refactor of:
- new appeal flow (
pages/newappeal/**,components/newappeal/**) - representations flow (case summary → representation journey)
- new appeal flow (
- extraction of reusable workflow logic
- improved separation between:
- UI
- workflow orchestration
- data fetching
- integrations
- preparation for future extensibility
Out of Scope
- business rule changes
- UI redesign
- payload/schema changes
- replacing dynamic/config-driven logic with hardcoding
- feature delivery mixed with refactor work
Branch Model
Roles
-
SIPS-Development- BAU branch
- ongoing production work
-
refactor- refactor integration branch
-
feature branches
- created from
refactor - one per slice
- created from
Flow
SIPS-Development → refactor → slice branches → refactor → SIPS-Development
Refactor Streams
1. New Appeal Flow (Completed)
- Slice-based refactor (Slices 1–8)
- Behaviour preserved (S78)
- Improved structure and maintainability
This serves as the reference model for future refactors
2. Representations Flow (Active)
Scope includes:
- Case summary entry (CTA logic)
- Representation journey:
- capacity selection
- representation type
- content entry
- file upload
- check answers
- submission
- completion
- SSR/data loading and Redux hydration
- integration points (CRM, blob storage)
Non-Negotiable Principles
- Preserve live behaviour
- Prefer extraction over rewrite
- Work in small, safe slices
- Keep changes reversible
- Protect:
- save/resume flows
- upload behaviour
- submission/finalisation
- Maintain EN/CY parity
Target Direction
Move towards:
- shared journey/workflow engine
- smaller, composable components
- clear separation of:
- decision logic
- rendering
- integration logic
- ability to support:
- multiple appeal types
- additional portal journeys (like representations)
Definition of Success
This branch is successful when:
- behaviour is preserved across all journeys
- complexity is reduced
- code is easier to understand and change
- regression risk is lower
- new journeys/types can be added safely
Delivery Model
Each refactor stream must:
- follow slice-based approach
- implement one concern per slice
- validate behaviour after each slice
- merge into
refactoronly when safe - merge to
SIPS-Developmentonly when stable
Safety Reminder
This is a live system.
If there is any doubt:
Preserve behaviour, reduce risk, and keep changes small.