Robert Bond
9595ad86df
Merged PR 2374: addeding domain layer extrraction
# Summary
This PR introduces a **Case Lifecycle Domain Boundary** to centralize lifecycle decision logic and reduce coupling within the appeals application.
The work is **behaviour-preserving** and introduces no intentional changes to business rules, CRM integrations, translations, dashboards, API routes, or user-facing functionality.
## What was added
New lifecycle boundary:
```text
lib/domain/case-lifecycle/
```
Key responsibilities extracted:
- Specialist process normalization
- Appeal type mapping
- Specialist process stage override mapping
- Stage case-type resolution
- Stage catalogue lookup
- Closed-case status recognition
- Lifecycle stage index resolution
- Lifecycle stage status assignment
## Behaviour preserved
Characterization tests were added before each extraction to preserve:
- Appeal type mapping and aliases
- Specialist process handling
- Lifecycle stage progression
- Closed-case handling
- Status assignment (`complete`, `in-progress`, `not-started`)
- Existing ROW behaviour
- Existing `statuscode` lifecycle semantics
Closed-case recognition remains unchanged for:
```text
1000
5
6
846040013
846040059
846040060
```
## Documentation
Added:
```text
lib/domain/case-lifecycle/README.md
```
Documenting:
- Boundary ownership
- Non-goals
- Lifecycle invariants
- Known architectural constraints
- Future extraction roadmap
## Testing
Added lifecycle characterization coverage for:
- Stage wrapper behaviour
- Specialist process normalization
- Appeal type mapping
- Specialist process stage mapping
- Stage case-type resolution
- Stage catalogue lookup
- Progress behaviour
- Closed-case status handling
- Stage index resolution
- Stage status assignment
## Validation
- Lifecycle characterization tests passed
- `npm run lint` passed with no errors
## Out of Scope
No changes to:
- Stage catalogue ownership
- Representation eligibility
- Dashboard calculations
- CRM/OData queries
- API routes
- Redux state
- EN/CY translations
- Event visibility logic
## Risk
**Low risk**
The refactor was delivered through small, characterization-first slices with no functional changes intended.
Related work items: #23527
2026-06-08 09:34:30 +00:00
..
2026-05-11 10:47:39 +00:00
2026-05-29 16:35:27 +00:00
2026-06-08 09:34:30 +00:00
2024-09-05 12:25:43 +01:00
2024-06-19 06:32:38 +01:00
2026-04-08 10:00:01 +01:00
2024-11-29 07:44:17 +00:00
2026-03-18 14:11:37 +00:00
2026-03-13 06:24:38 +00:00
2026-05-14 08:55:49 +00:00
2026-05-11 10:47:39 +00:00
2026-03-30 12:35:41 +01:00
2026-06-03 12:44:59 +00:00
2024-06-19 06:32:38 +01:00
2026-05-14 08:55:49 +00:00
2025-04-14 18:00:30 +01:00
2026-06-02 08:34:51 +00:00
2024-06-19 06:32:38 +01:00
2024-06-19 06:32:38 +01:00
2024-06-19 06:32:38 +01:00
2026-04-23 04:59:06 +00:00
2024-10-31 09:48:38 +00:00
2024-06-19 06:32:38 +01:00
2026-04-09 16:26:44 +01:00
2026-02-04 11:19:35 +00:00
2024-06-19 06:32:38 +01:00
2024-06-19 06:32:38 +01:00
2024-09-05 12:25:43 +01:00
2024-06-19 06:32:38 +01:00
2024-06-19 06:32:38 +01:00
2025-11-28 08:45:13 +00:00
2024-06-19 06:32:38 +01:00
2026-01-22 12:18:03 +00:00
2026-05-14 08:55:49 +00:00
2024-06-19 06:32:38 +01:00
2026-02-04 11:19:35 +00:00
2026-05-14 08:55:49 +00:00
2024-06-19 06:32:38 +01:00
2024-06-19 06:32:38 +01:00
2021-11-29 17:35:52 +00:00
2026-04-28 12:00:12 +00:00
2025-03-21 17:40:11 +00:00
2024-06-19 06:32:38 +01:00
2026-02-04 11:19:35 +00:00
2021-07-07 12:53:07 +01:00
2024-06-19 06:32:38 +01:00
2024-06-19 06:32:38 +01:00