Merged PR 2242: Refactor: New Appeal flow structural cleanup (Slices 1–8, no behaviour change)

## Summary

This PR merges the completed new-appeal refactor stream (Slices 1–8) into SIPS-Development.

This refactor was executed in controlled slices with regression validation at each step.

## Scope

Structural and readability improvements only:
- XML/form derivation extraction
- payload and file helper extraction
- side-effect facade introduction
- BuildSection and BuildCheckSection decomposition
- BuildCheckRow formatter map refactor
- nested prop boundary cleanup
- start-flow cleanup (CreateCase / AboutYou)

## Behaviour

No intended behavioural changes.

The following were explicitly preserved:
- S78 journey behaviour
- payload shapes and field names/ids
- HASCAS mapping logic
- appellant/agent branching
- validation rules and messages
- redirect/query parameters (`lpa`, `apt`, `id`)
- navigation and side-effect sequencing
- EN/CY output parity

## Validation

Full regression has been performed on:
- start flow (CreateCase / AboutYou)
- save and resume flows
- file upload handling
- check answers rendering
- submit/finalisation sequence
- confirmation flow
- CRM insertion path
- EN/CY parity

Additional checks:
- docsOffline branch behaviour
- completion and partial-save email paths
- negative-path validation scenarios
- lint (warnings baseline unchanged)

## Risk

Low:
- changes are structural only
- no business logic changes
- no contract changes

## Rollback

Safe rollback via reverting this merge commit.

## Notes

This refactor reduces coupling and prepares the new-appeal flow for future appeal-type expansion.

Related work items: #22570, #22576, #22577, #22583, #22586, #22587, #22588, #22590
This commit is contained in:
Robert Bond
2026-04-13 13:09:12 +00:00
parent bd3d311cfb
commit 0de9268255
47 changed files with 2010 additions and 945 deletions
+12 -8
View File
@@ -378,6 +378,7 @@ let CreateCase = (props) => {
const router = useRouter();
const { locale } = router;
const isWelsh = router.locale == "cy";
const { LPAData, onSubmit, handleSubmit, formData } = props;
@@ -399,16 +400,17 @@ let CreateCase = (props) => {
event.preventDefault();
var appTypeCollection = values.appealTypes;
const selectedAppealType = values.appealTypes;
const confirmHASCAS = values.confirmHASCAS;
formStep == 0 && setFormStep(1);
whichAppealType =
values.appealTypes == "846040004" && values.confirmHASCAS == "true"
selectedAppealType == "846040004" && confirmHASCAS == "true"
? "846040004"
: values.appealTypes == "846040004" &&
values.confirmHASCAS == "false"
: selectedAppealType == "846040004" && confirmHASCAS == "false"
? "846040000"
: values.appealTypes;
: selectedAppealType;
var whichAppealType = whichAppealType;
@@ -435,15 +437,17 @@ let CreateCase = (props) => {
// values,
// props.containerID
// )
const selectedLpaName = props.LPAData.LPAData.value.filter((obj) => {
return obj.accountid === values.lpaTypes;
})[0].name;
createNewCaseBlob(
appTypeCollection.appealTypeID,
values.lpaTypes,
props.loggedInUser,
values,
props.containerID,
props.LPAData.LPAData.value.filter((obj) => {
return obj.accountid === values.lpaTypes;
})[0].name
selectedLpaName
)
.then((data) => {
router.replace(
@@ -477,7 +481,7 @@ let CreateCase = (props) => {
// }
// );
};
const yesNo = router.locale == "cy" ? ["Ydw", "Na"] : ["Yes", "No"];
const yesNo = isWelsh ? ["Ydw", "Na"] : ["Yes", "No"];
var parentField = "appealTypes",
formProps = props.whichForm,