diff --git a/ccd-definition/AuthorisationCaseEvent/CareSupervision/AuthorisationCaseEvent.json b/ccd-definition/AuthorisationCaseEvent/CareSupervision/AuthorisationCaseEvent.json index d111135ab0c..dd85d6236d3 100644 --- a/ccd-definition/AuthorisationCaseEvent/CareSupervision/AuthorisationCaseEvent.json +++ b/ccd-definition/AuthorisationCaseEvent/CareSupervision/AuthorisationCaseEvent.json @@ -487,7 +487,7 @@ "[SOLICITORA]", "[CHILDSOLICITORA]" ], - "CRUD": "CR" + "CRUD": "R" }, { "UserRoles": [ diff --git a/ccd-definition/CaseEvent/CareSupervision/DEPRECATED.json b/ccd-definition/CaseEvent/CareSupervision/DEPRECATED.json index 4221110dfc4..2aa980be7a1 100644 --- a/ccd-definition/CaseEvent/CareSupervision/DEPRECATED.json +++ b/ccd-definition/CaseEvent/CareSupervision/DEPRECATED.json @@ -366,5 +366,20 @@ "ShowSummary": "N", "ShowEventNotes": "Y", "EndButtonLabel": "Submit" + }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "ID": "enterParentingFactors", + "Name": "Factors affecting parenting", + "Description": "Entering the factors affecting parenting", + "DisplayOrder": 10, + "PreConditionState(s)": "Open;RETURNED", + "PostConditionState": "*", + "SecurityClassification": "Public", + "ShowSummary": "Y", + "ShowEventNotes": "N", + "EndButtonLabel": "Save and continue", + "CallBackURLSubmittedEvent": "${CCD_DEF_CASE_SERVICE_BASE_URL}/callback/update-task-list/submitted" } ] diff --git a/ccd-definition/CaseEvent/CareSupervision/MultiState.json b/ccd-definition/CaseEvent/CareSupervision/MultiState.json index 8f1bff8fa8e..ff69f90bd2e 100644 --- a/ccd-definition/CaseEvent/CareSupervision/MultiState.json +++ b/ccd-definition/CaseEvent/CareSupervision/MultiState.json @@ -393,22 +393,6 @@ "CallBackURLSubmittedEvent": "${CCD_DEF_CASE_SERVICE_BASE_URL}/callback/update-task-list/submitted", "EventEnablingCondition": "otherOrderType!=\"YES\" AND secureAccommodationOrderType!=\"YES\" AND refuseContactWithChildOrderType!=\"YES\" AND contactWithChildInCareOrderType!=\"YES\"" }, - { - "LiveFrom": "01/01/2017", - "CaseTypeID": "CARE_SUPERVISION_EPO", - "ID": "enterParentingFactors", - "Name": "Factors affecting parenting", - "Description": "Entering the factors affecting parenting", - "DisplayOrder": 10, - "PreConditionState(s)": "Open;RETURNED", - "PostConditionState": "*", - "SecurityClassification": "Public", - "ShowSummary": "Y", - "ShowEventNotes": "N", - "EndButtonLabel": "Save and continue", - "CallBackURLSubmittedEvent": "${CCD_DEF_CASE_SERVICE_BASE_URL}/callback/update-task-list/submitted", - "EventEnablingCondition": "otherOrderType!=\"YES\" AND secureAccommodationOrderType!=\"YES\" AND refuseContactWithChildOrderType!=\"YES\" AND contactWithChildInCareOrderType!=\"YES\"" - }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-definition/CaseEventToComplexTypes/RiskAndHarm/enterRiskHarm.json b/ccd-definition/CaseEventToComplexTypes/RiskAndHarm/enterRiskHarm.json new file mode 100644 index 00000000000..8ab5cc57ea6 --- /dev/null +++ b/ccd-definition/CaseEventToComplexTypes/RiskAndHarm/enterRiskHarm.json @@ -0,0 +1,32 @@ +[ + { + "LiveFrom": "01/01/2017", + "ID": "RiskAndHarm", + "CaseEventID": "enterRiskHarm", + "CaseFieldID": "risks", + "ListElementCode": "whatKindOfRiskAndHarmToChildren", + "EventElementLabel": "What kind of harm is the child at risk of?", + "FieldDisplayOrder": 1, + "DisplayContext": "MANDATORY" + }, + { + "LiveFrom": "01/01/2017", + "ID": "RiskAndHarm", + "CaseEventID": "enterRiskHarm", + "CaseFieldID": "risks", + "ListElementCode": "factorsAffectingParenting", + "EventElementLabel": "Is there anything affecting any respondent's ability to parent?", + "FieldDisplayOrder": 2, + "DisplayContext": "MANDATORY" + }, + { + "LiveFrom": "01/01/2017", + "ID": "RiskAndHarm", + "CaseEventID": "enterRiskHarm", + "CaseFieldID": "risks", + "ListElementCode": "anythingElseAffectingParenting", + "EventElementLabel": "Tell us what else is affecting their ability to parent", + "FieldDisplayOrder": 3, + "DisplayContext": "MANDATORY" + } +] diff --git a/ccd-definition/CaseEventToFields/CareSupervision/enterRiskHarm.json b/ccd-definition/CaseEventToFields/CareSupervision/enterRiskHarm.json index 1e5e808d27b..47525e61894 100644 --- a/ccd-definition/CaseEventToFields/CareSupervision/enterRiskHarm.json +++ b/ccd-definition/CaseEventToFields/CareSupervision/enterRiskHarm.json @@ -5,7 +5,7 @@ "CaseEventID": "enterRiskHarm", "CaseFieldID": "risks", "PageFieldDisplayOrder": 1, - "DisplayContext": "OPTIONAL", + "DisplayContext": "MANDATORY", "PageID": 1, "PageDisplayOrder": 1, "PageColumnNumber": 1, diff --git a/ccd-definition/CaseField/CareSupervision/DEPRECATED.json b/ccd-definition/CaseField/CareSupervision/DEPRECATED.json index 6f4d80ef73e..adc5e7bc5a3 100644 --- a/ccd-definition/CaseField/CareSupervision/DEPRECATED.json +++ b/ccd-definition/CaseField/CareSupervision/DEPRECATED.json @@ -845,5 +845,14 @@ "Label": "Further evidence documents for hearings", "SecurityClassification": "Public", "Searchable": "N" + }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "ID": "factorsAffectingParentingLink", + "FieldType": "Label", + "Label": "[Make changes to factors affecting parenting](/case/${[JURISDICTION]}/${[CASE_TYPE]}/${[CASE_REFERENCE]}/trigger/enterParentingFactors)", + "SecurityClassification": "Public", + "Searchable": "N" } ] diff --git a/ccd-definition/CaseField/CareSupervision/eventLinks.json b/ccd-definition/CaseField/CareSupervision/eventLinks.json index cf0ce0104ea..8f1d70d27c4 100644 --- a/ccd-definition/CaseField/CareSupervision/eventLinks.json +++ b/ccd-definition/CaseField/CareSupervision/eventLinks.json @@ -35,15 +35,6 @@ "SecurityClassification": "Public", "Searchable": "N" }, - { - "LiveFrom": "01/01/2017", - "CaseTypeID": "CARE_SUPERVISION_EPO", - "ID": "factorsAffectingParentingLink", - "FieldType": "Label", - "Label": "[Make changes to factors affecting parenting](/case/${[JURISDICTION]}/${[CASE_TYPE]}/${[CASE_REFERENCE]}/trigger/enterParentingFactors)", - "SecurityClassification": "Public", - "Searchable": "N" - }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-definition/CaseTypeTab/CareSupervision/1_ViewApplication.json b/ccd-definition/CaseTypeTab/CareSupervision/1_ViewApplication.json index efa0b2706d4..60a5cc733d5 100644 --- a/ccd-definition/CaseTypeTab/CareSupervision/1_ViewApplication.json +++ b/ccd-definition/CaseTypeTab/CareSupervision/1_ViewApplication.json @@ -83,7 +83,7 @@ "TabLabel": "View application", "TabDisplayOrder": 1, "CaseFieldID": "groundsForTheApplicationHeadingLabel", - "FieldShowCondition": "grounds!=\"\" OR groundsForEPO!=\"\" OR groundsForSecureAccommodationOrder!=\"\" OR risks!=\"\" OR factorsParenting!=\"\" OR proceeding!=\"\" OR internationalElement!=\"\"", + "FieldShowCondition": "grounds!=\"\" OR groundsForEPO!=\"\" OR groundsForSecureAccommodationOrder!=\"\" OR risks!=\"\" OR proceeding!=\"\" OR internationalElement!=\"\"", "TabFieldDisplayOrder": 8 }, { @@ -247,17 +247,6 @@ "CaseFieldID": "factorsParenting", "TabFieldDisplayOrder": 18 }, - { - "LiveFrom": "01/01/2017", - "CaseTypeID": "CARE_SUPERVISION_EPO", - "Channel": "CaseWorker", - "TabID": "ViewApplicationTab", - "TabLabel": "View application", - "TabDisplayOrder": 1, - "CaseFieldID": "factorsAffectingParentingLink", - "FieldShowCondition": "factorsParenting!=\"\"", - "TabFieldDisplayOrder": 19 - }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-definition/ComplexTypes/CareSupervision/DEPRECATED.json b/ccd-definition/ComplexTypes/CareSupervision/DEPRECATED.json index 704537b01a8..460e2d7ea60 100644 --- a/ccd-definition/ComplexTypes/CareSupervision/DEPRECATED.json +++ b/ccd-definition/ComplexTypes/CareSupervision/DEPRECATED.json @@ -314,5 +314,90 @@ "ElementLabel": "Give reason", "FieldShowCondition": "whichCountriesInvolved=\"DO_NOT_SHOW\"", "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "RiskAndHarm", + "ListElementCode": "evidenceQuestion", + "FieldType": "Label", + "ElementLabel": "## Is there evidence of any of the following?", + "FieldShowCondition": "whatKindOfRiskAndHarmToChildren=\"DO_NOT_SHOW\"", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "RiskAndHarm", + "ListElementCode": "physicalHarm", + "FieldType": "YesOrNo", + "ElementLabel": "Physical harm including non-accidental injury", + "FieldShowCondition": "whatKindOfRiskAndHarmToChildren=\"DO_NOT_SHOW\"", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "RiskAndHarm", + "ListElementCode": "physicalHarmOccurrences", + "FieldType": "MultiSelectList", + "FieldTypeParameter": "PastOrFutureHarmSelect", + "ElementLabel": "Select all that apply", + "FieldShowCondition": "whatKindOfRiskAndHarmToChildren=\"DO_NOT_SHOW\"", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "RiskAndHarm", + "ListElementCode": "emotionalHarm", + "FieldType": "YesOrNo", + "ElementLabel": "Emotional harm", + "FieldShowCondition": "whatKindOfRiskAndHarmToChildren=\"DO_NOT_SHOW\"", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "RiskAndHarm", + "ListElementCode": "emotionalHarmOccurrences", + "FieldType": "MultiSelectList", + "FieldTypeParameter": "PastOrFutureHarmSelect", + "ElementLabel": "Select all that apply", + "FieldShowCondition": "whatKindOfRiskAndHarmToChildren=\"DO_NOT_SHOW\"", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "RiskAndHarm", + "ListElementCode": "sexualAbuse", + "FieldType": "YesOrNo", + "ElementLabel": "Sexual abuse", + "FieldShowCondition": "whatKindOfRiskAndHarmToChildren=\"DO_NOT_SHOW\"", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "RiskAndHarm", + "ListElementCode": "sexualAbuseOccurrences", + "FieldType": "MultiSelectList", + "FieldTypeParameter": "PastOrFutureHarmSelect", + "ElementLabel": "Select all that apply", + "FieldShowCondition": "whatKindOfRiskAndHarmToChildren=\"DO_NOT_SHOW\"", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "RiskAndHarm", + "ListElementCode": "neglect", + "FieldType": "YesOrNo", + "ElementLabel": "Neglect", + "FieldShowCondition": "whatKindOfRiskAndHarmToChildren=\"DO_NOT_SHOW\"", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "RiskAndHarm", + "ListElementCode": "neglectOccurrences", + "FieldType": "MultiSelectList", + "FieldTypeParameter": "PastOrFutureHarmSelect", + "ElementLabel": "Select all that apply", + "FieldShowCondition": "whatKindOfRiskAndHarmToChildren=\"DO_NOT_SHOW\"", + "SecurityClassification": "Public" } ] diff --git a/ccd-definition/ComplexTypes/CareSupervision/RiskAndHarm.json b/ccd-definition/ComplexTypes/CareSupervision/RiskAndHarm.json index fb1277de786..00441c06f42 100644 --- a/ccd-definition/ComplexTypes/CareSupervision/RiskAndHarm.json +++ b/ccd-definition/ComplexTypes/CareSupervision/RiskAndHarm.json @@ -2,81 +2,28 @@ { "LiveFrom": "01/01/2017", "ID": "RiskAndHarm", - "ListElementCode": "evidenceQuestion", - "FieldType": "Label", - "ElementLabel": "## Is there evidence of any of the following?", - "SecurityClassification": "Public" - }, - { - "LiveFrom": "01/01/2017", - "ID": "RiskAndHarm", - "ListElementCode": "physicalHarm", - "FieldType": "YesOrNo", - "ElementLabel": "Physical harm including non-accidental injury", - "SecurityClassification": "Public" - }, - { - "LiveFrom": "01/01/2017", - "ID": "RiskAndHarm", - "ListElementCode": "physicalHarmOccurrences", - "FieldType": "MultiSelectList", - "FieldTypeParameter": "PastOrFutureHarmSelect", - "ElementLabel": "Select all that apply", - "FieldShowCondition": "physicalHarm=\"Yes\"", - "SecurityClassification": "Public" - }, - { - "LiveFrom": "01/01/2017", - "ID": "RiskAndHarm", - "ListElementCode": "emotionalHarm", - "FieldType": "YesOrNo", - "ElementLabel": "Emotional harm", - "SecurityClassification": "Public" - }, - { - "LiveFrom": "01/01/2017", - "ID": "RiskAndHarm", - "ListElementCode": "emotionalHarmOccurrences", + "ListElementCode": "whatKindOfRiskAndHarmToChildren", "FieldType": "MultiSelectList", - "FieldTypeParameter": "PastOrFutureHarmSelect", - "ElementLabel": "Select all that apply", - "FieldShowCondition": "emotionalHarm=\"Yes\"", - "SecurityClassification": "Public" - }, - { - "LiveFrom": "01/01/2017", - "ID": "RiskAndHarm", - "ListElementCode": "sexualAbuse", - "FieldType": "YesOrNo", - "ElementLabel": "Sexual abuse", + "FieldTypeParameter": "RiskAndHarmToChildrenList", + "ElementLabel": "What kind of harm is the child at risk of?", "SecurityClassification": "Public" }, { "LiveFrom": "01/01/2017", "ID": "RiskAndHarm", - "ListElementCode": "sexualAbuseOccurrences", + "ListElementCode": "factorsAffectingParenting", "FieldType": "MultiSelectList", - "FieldTypeParameter": "PastOrFutureHarmSelect", - "ElementLabel": "Select all that apply", - "FieldShowCondition": "sexualAbuse=\"Yes\"", - "SecurityClassification": "Public" - }, - { - "LiveFrom": "01/01/2017", - "ID": "RiskAndHarm", - "ListElementCode": "neglect", - "FieldType": "YesOrNo", - "ElementLabel": "Neglect", + "FieldTypeParameter": "FactorsAffectingParentingList", + "ElementLabel": "Is there anything affecting any respondent's ability to parent?", "SecurityClassification": "Public" }, { "LiveFrom": "01/01/2017", "ID": "RiskAndHarm", - "ListElementCode": "neglectOccurrences", - "FieldType": "MultiSelectList", - "FieldTypeParameter": "PastOrFutureHarmSelect", - "ElementLabel": "Select all that apply", - "FieldShowCondition": "neglect=\"Yes\"", + "ListElementCode": "anythingElseAffectingParenting", + "FieldType": "TextArea", + "ElementLabel": "Tell us what else is affecting their ability to parent", + "FieldShowCondition": "factorsAffectingParenting CONTAINS \"ANYTHING_ELSE\"", "SecurityClassification": "Public" } ] diff --git a/ccd-definition/FixedLists/CareSupervision/FactorsAffectingParentingList.json b/ccd-definition/FixedLists/CareSupervision/FactorsAffectingParentingList.json new file mode 100644 index 00000000000..1a0a28c1729 --- /dev/null +++ b/ccd-definition/FixedLists/CareSupervision/FactorsAffectingParentingList.json @@ -0,0 +1,23 @@ +[ + { + "LiveFrom": "01/01/2017", + "ID": "FactorsAffectingParentingList", + "ListElementCode": "ALCOHOL_DRUG_ABUSE", + "ListElement": "Alcohol or drug abuse", + "DisplayOrder": 1 + }, + { + "LiveFrom": "01/01/2017", + "ID": "FactorsAffectingParentingList", + "ListElementCode": "DOMESTIC_ABUSE", + "ListElement": "Domestic abuse", + "DisplayOrder": 2 + }, + { + "LiveFrom": "01/01/2017", + "ID": "FactorsAffectingParentingList", + "ListElementCode": "ANYTHING_ELSE", + "ListElement": "Anything else", + "DisplayOrder": 3 + } +] diff --git a/ccd-definition/FixedLists/CareSupervision/RiskAndHarmToChildrenList.json b/ccd-definition/FixedLists/CareSupervision/RiskAndHarmToChildrenList.json new file mode 100644 index 00000000000..8e313494352 --- /dev/null +++ b/ccd-definition/FixedLists/CareSupervision/RiskAndHarmToChildrenList.json @@ -0,0 +1,30 @@ +[ + { + "LiveFrom": "01/01/2017", + "ID": "RiskAndHarmToChildrenList", + "ListElementCode": "PHYSICAL_HARM", + "ListElement": "Physical harm including non-accidental injury", + "DisplayOrder": 1 + }, + { + "LiveFrom": "01/01/2017", + "ID": "RiskAndHarmToChildrenList", + "ListElementCode": "EMOTIONAL_HARM", + "ListElement": "Emotional harm", + "DisplayOrder": 2 + }, + { + "LiveFrom": "01/01/2017", + "ID": "RiskAndHarmToChildrenList", + "ListElementCode": "SEXUAL_ABUSE", + "ListElement": "Sexual abuse", + "DisplayOrder": 3 + }, + { + "LiveFrom": "01/01/2017", + "ID": "RiskAndHarmToChildrenList", + "ListElementCode": "NEGLECT", + "ListElement": "Neglect", + "DisplayOrder": 4 + } +] diff --git a/docker/docmosis/templates/FL-PLW-APP-ENG-C110A.doc b/docker/docmosis/templates/FL-PLW-APP-ENG-C110A.doc index 17d2ad22531..ce6f614fb8d 100644 Binary files a/docker/docmosis/templates/FL-PLW-APP-ENG-C110A.doc and b/docker/docmosis/templates/FL-PLW-APP-ENG-C110A.doc differ diff --git a/service/src/integrationTest/resources/fixtures/taskList-legacyApplicant.md b/service/src/integrationTest/resources/fixtures/taskList-legacyApplicant.md index e3d4cb68450..69a4df63078 100644 --- a/service/src/integrationTest/resources/fixtures/taskList-legacyApplicant.md +++ b/service/src/integrationTest/resources/fixtures/taskList-legacyApplicant.md @@ -34,12 +34,6 @@
-Factors affecting parenting - -In emergency cases, you can send your application without this information - -
-
## Add application documents diff --git a/service/src/integrationTest/resources/fixtures/taskList.md b/service/src/integrationTest/resources/fixtures/taskList.md index 9fc62f3b82f..5f78eab0ff1 100644 --- a/service/src/integrationTest/resources/fixtures/taskList.md +++ b/service/src/integrationTest/resources/fixtures/taskList.md @@ -34,12 +34,6 @@
-Factors affecting parenting - -In emergency cases, you can send your application without this information - -
-
## Add application documents diff --git a/service/src/integrationTest/resources/fixtures/taskListWithLanguageRequirement.md b/service/src/integrationTest/resources/fixtures/taskListWithLanguageRequirement.md index 5c4b42e186b..bc6646c0334 100644 --- a/service/src/integrationTest/resources/fixtures/taskListWithLanguageRequirement.md +++ b/service/src/integrationTest/resources/fixtures/taskListWithLanguageRequirement.md @@ -34,12 +34,6 @@
-Factors affecting parenting - -In emergency cases, you can send your application without this information - -
-
## Add application documents diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/enums/FactorsAffectingParentingType.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/enums/FactorsAffectingParentingType.java new file mode 100644 index 00000000000..2ea1b56876a --- /dev/null +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/enums/FactorsAffectingParentingType.java @@ -0,0 +1,7 @@ +package uk.gov.hmcts.reform.fpl.enums; + +public enum FactorsAffectingParentingType { + ALCOHOL_DRUG_ABUSE, + DOMESTIC_ABUSE, + ANYTHING_ELSE +} diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/enums/RiskAndHarmToChildrenType.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/enums/RiskAndHarmToChildrenType.java new file mode 100644 index 00000000000..a2df136eb93 --- /dev/null +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/enums/RiskAndHarmToChildrenType.java @@ -0,0 +1,8 @@ +package uk.gov.hmcts.reform.fpl.enums; + +public enum RiskAndHarmToChildrenType { + PHYSICAL_HARM, + EMOTIONAL_HARM, + SEXUAL_ABUSE, + NEGLECT +} diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/model/Risks.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/model/Risks.java index 885512a7a78..df16f4e4bd3 100644 --- a/service/src/main/java/uk/gov/hmcts/reform/fpl/model/Risks.java +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/model/Risks.java @@ -3,6 +3,8 @@ import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; +import uk.gov.hmcts.reform.fpl.enums.FactorsAffectingParentingType; +import uk.gov.hmcts.reform.fpl.enums.RiskAndHarmToChildrenType; import java.util.List; @@ -18,4 +20,7 @@ public class Risks { private final List sexualAbuseOccurrences; private final List physicalHarmOccurrences; private final List emotionalHarmOccurrences; + private final List whatKindOfRiskAndHarmToChildren; + private final List factorsAffectingParenting; + private final String anythingElseAffectingParenting; } diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/model/docmosis/DocmosisRisks.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/model/docmosis/DocmosisRisks.java index 5ce403ba3ce..05c164bfc6a 100644 --- a/service/src/main/java/uk/gov/hmcts/reform/fpl/model/docmosis/DocmosisRisks.java +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/model/docmosis/DocmosisRisks.java @@ -14,4 +14,11 @@ public class DocmosisRisks { private final String sexualAbuseDetails; private final String physicalHarmDetails; private final String emotionalHarmDetails; + private final String physicalHarm; + private final String emotionalHarm; + private final String sexualAbuse; + private final String neglect; + private final String alcoholDrugAbuse; + private final String domesticAbuse; + private final String anythingElse; } diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/TaskListRenderer.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/TaskListRenderer.java index 5c7aecd044e..a8c0a56078e 100644 --- a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/TaskListRenderer.java +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/TaskListRenderer.java @@ -28,7 +28,6 @@ import static uk.gov.hmcts.reform.fpl.enums.Event.CASE_NAME; import static uk.gov.hmcts.reform.fpl.enums.Event.CHILDREN; import static uk.gov.hmcts.reform.fpl.enums.Event.COURT_SERVICES; -import static uk.gov.hmcts.reform.fpl.enums.Event.FACTORS_AFFECTING_PARENTING; import static uk.gov.hmcts.reform.fpl.enums.Event.GROUNDS; import static uk.gov.hmcts.reform.fpl.enums.Event.HEARING_URGENCY; import static uk.gov.hmcts.reform.fpl.enums.Event.INTERNATIONAL_ELEMENT; @@ -95,9 +94,6 @@ private List groupInSections(List allTasks, Optional task.withHint("In emergency cases, you can send your application without this information")) .ifPresent(applicationGrounds::withTask); - ofNullable(tasks.get(FACTORS_AFFECTING_PARENTING)) - .map(task -> task.withHint("In emergency cases, you can send your application without this information")) - .ifPresent(applicationGrounds::withTask); final TaskSection documents = newSection("Add application documents") .withTask(tasks.get(APPLICATION_DOCUMENTS)) diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/TaskListService.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/TaskListService.java index 60b0c4bb5bf..508b68d2826 100644 --- a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/TaskListService.java +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/TaskListService.java @@ -22,7 +22,6 @@ import static uk.gov.hmcts.reform.fpl.enums.Event.CASE_NAME; import static uk.gov.hmcts.reform.fpl.enums.Event.CHILDREN; import static uk.gov.hmcts.reform.fpl.enums.Event.COURT_SERVICES; -import static uk.gov.hmcts.reform.fpl.enums.Event.FACTORS_AFFECTING_PARENTING; import static uk.gov.hmcts.reform.fpl.enums.Event.GROUNDS; import static uk.gov.hmcts.reform.fpl.enums.Event.HEARING_URGENCY; import static uk.gov.hmcts.reform.fpl.enums.Event.INTERNATIONAL_ELEMENT; @@ -101,7 +100,6 @@ private List getEvents(CaseData caseData) { && !caseData.isRefuseContactWithChildApplication() && !caseData.isContactWithChildInCareApplication()) { events.add(RISK_AND_HARM); - events.add(FACTORS_AFFECTING_PARENTING); } // C1s and C110a's (except DoC) diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/docmosis/CaseSubmissionGenerationService.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/docmosis/CaseSubmissionGenerationService.java index c243922ab56..d58f8446e31 100644 --- a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/docmosis/CaseSubmissionGenerationService.java +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/docmosis/CaseSubmissionGenerationService.java @@ -9,9 +9,11 @@ import org.springframework.stereotype.Service; import uk.gov.hmcts.reform.fpl.config.utils.EmergencyProtectionOrderReasonsType; import uk.gov.hmcts.reform.fpl.enums.ChildRecoveryOrderGround; +import uk.gov.hmcts.reform.fpl.enums.FactorsAffectingParentingType; import uk.gov.hmcts.reform.fpl.enums.OrderType; import uk.gov.hmcts.reform.fpl.enums.ParticularsOfChildren; import uk.gov.hmcts.reform.fpl.enums.PriorConsultationType; +import uk.gov.hmcts.reform.fpl.enums.RiskAndHarmToChildrenType; import uk.gov.hmcts.reform.fpl.enums.SecureAccommodationOrderGround; import uk.gov.hmcts.reform.fpl.enums.YesNo; import uk.gov.hmcts.reform.fpl.model.Address; @@ -21,7 +23,6 @@ import uk.gov.hmcts.reform.fpl.model.Child; import uk.gov.hmcts.reform.fpl.model.ChildParty; import uk.gov.hmcts.reform.fpl.model.Colleague; -import uk.gov.hmcts.reform.fpl.model.FactorsParenting; import uk.gov.hmcts.reform.fpl.model.Grounds; import uk.gov.hmcts.reform.fpl.model.GroundsForChildAssessmentOrder; import uk.gov.hmcts.reform.fpl.model.GroundsForChildRecoveryOrder; @@ -54,7 +55,6 @@ import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisC20Supplement; import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisCaseSubmission; import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisChild; -import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisFactorsParenting; import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisHearing; import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisHearingPreferences; import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisInternationalElement; @@ -327,7 +327,6 @@ public DocmosisCaseSubmission getTemplateData(final CaseData caseData) { .internationalElement(buildDocmosisInternationalElement(caseData.getInternationalElement(), applicationLanguage)) .risks(buildDocmosisRisks(caseData.getRisks(), applicationLanguage)) - .factorsParenting(buildDocmosisFactorsParenting(caseData.getFactorsParenting(), applicationLanguage)) .respondents(buildDocmosisRespondents(caseData.getAllRespondents(), applicationLanguage)) .applicants(buildDocmosisApplicants(caseData)) .children(buildDocmosisChildren(caseData.getAllChildren(), applicationLanguage)) @@ -993,42 +992,33 @@ private DocmosisRisks buildDocmosisRisks(final Risks risks, Language applicationLanguage) { final boolean risksPresent = (risks != null); return DocmosisRisks.builder() - .neglectDetails(risksPresent - ? concatenateYesOrNoKeyAndValue( - risks.getNeglect(), - listToString(risks.getNeglectOccurrences()), applicationLanguage) : DEFAULT_STRING) - .sexualAbuseDetails(risksPresent - ? concatenateYesOrNoKeyAndValue( - risks.getSexualAbuse(), - listToString(risks.getSexualAbuseOccurrences()), applicationLanguage) : DEFAULT_STRING) - .physicalHarmDetails(risksPresent - ? concatenateYesOrNoKeyAndValue( - risks.getPhysicalHarm(), - listToString(risks.getPhysicalHarmOccurrences()), applicationLanguage) : DEFAULT_STRING) - .emotionalHarmDetails(risksPresent - ? concatenateYesOrNoKeyAndValue( - risks.getEmotionalHarm(), - listToString(risks.getEmotionalHarmOccurrences()), applicationLanguage) : DEFAULT_STRING) - .build(); - } - - private DocmosisFactorsParenting buildDocmosisFactorsParenting(final FactorsParenting factorsParenting, - Language applicationLanguage) { - final boolean factorsParentingPresent = (factorsParenting != null); - - return DocmosisFactorsParenting.builder() - .alcoholDrugAbuseDetails(factorsParentingPresent - ? concatenateYesOrNoKeyAndValue( - factorsParenting.getAlcoholDrugAbuse(), - factorsParenting.getAlcoholDrugAbuseReason(), applicationLanguage) : DEFAULT_STRING) - .domesticViolenceDetails(factorsParentingPresent - ? concatenateYesOrNoKeyAndValue( - factorsParenting.getDomesticViolence(), - factorsParenting.getDomesticViolenceReason(), applicationLanguage) : DEFAULT_STRING) - .anythingElse(factorsParentingPresent - ? concatenateYesOrNoKeyAndValue( - factorsParenting.getAnythingElse(), - factorsParenting.getAnythingElseReason(), applicationLanguage) : DEFAULT_STRING) + .physicalHarm(risksPresent + ? (risks.getWhatKindOfRiskAndHarmToChildren().contains(RiskAndHarmToChildrenType.PHYSICAL_HARM) + ? YES.getValue(applicationLanguage) : NO.getValue(applicationLanguage)) + : DEFAULT_STRING) + .emotionalHarm(risksPresent + ? (risks.getWhatKindOfRiskAndHarmToChildren().contains(RiskAndHarmToChildrenType.EMOTIONAL_HARM) + ? YES.getValue(applicationLanguage) : NO.getValue(applicationLanguage)) + : DEFAULT_STRING) + .sexualAbuse(risksPresent + ? (risks.getWhatKindOfRiskAndHarmToChildren().contains(RiskAndHarmToChildrenType.SEXUAL_ABUSE) + ? YES.getValue(applicationLanguage) : NO.getValue(applicationLanguage)) + : DEFAULT_STRING) + .neglect(risksPresent + ? (risks.getWhatKindOfRiskAndHarmToChildren().contains(RiskAndHarmToChildrenType.NEGLECT) + ? YES.getValue(applicationLanguage) : NO.getValue(applicationLanguage)) + : DEFAULT_STRING) + .alcoholDrugAbuse(risksPresent + ? (risks.getFactorsAffectingParenting().contains(FactorsAffectingParentingType.ALCOHOL_DRUG_ABUSE) + ? YES.getValue(applicationLanguage) : NO.getValue(applicationLanguage)) + : DEFAULT_STRING) + .domesticAbuse(risksPresent + ? (risks.getFactorsAffectingParenting().contains(FactorsAffectingParentingType.DOMESTIC_ABUSE) + ? YES.getValue(applicationLanguage) : NO.getValue(applicationLanguage)) + : DEFAULT_STRING) + .anythingElse(risksPresent + ? risks.getAnythingElseAffectingParenting() + : DEFAULT_STRING) .build(); } diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/robotics/RoboticsDataService.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/robotics/RoboticsDataService.java index f6f324cc2d9..ddca1710ea8 100644 --- a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/robotics/RoboticsDataService.java +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/robotics/RoboticsDataService.java @@ -42,6 +42,7 @@ import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toSet; +import static org.apache.commons.lang3.ObjectUtils.anyNotNull; import static org.apache.commons.lang3.ObjectUtils.isEmpty; import static org.apache.commons.lang3.ObjectUtils.isNotEmpty; import static org.apache.commons.lang3.StringUtils.deleteWhitespace; @@ -299,8 +300,8 @@ private boolean hasRisks(final Risks risks) { return false; } - return isAnyConfirmed(risks.getPhysicalHarm(), risks.getEmotionalHarm(), risks.getSexualAbuse(), - risks.getNeglect()); + return anyNotNull(risks.getWhatKindOfRiskAndHarmToChildren(), + risks.getFactorsAffectingParenting(), risks.getAnythingElseAffectingParenting()); } private boolean isAnyConfirmed(final String... values) { diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/validators/FactorsAffectingParentingChecker.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/validators/FactorsAffectingParentingChecker.java index 781aab3273e..f39a8920dc4 100644 --- a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/validators/FactorsAffectingParentingChecker.java +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/validators/FactorsAffectingParentingChecker.java @@ -16,6 +16,7 @@ import static uk.gov.hmcts.reform.fpl.service.validators.EventCheckerHelper.anyNonEmpty; @Service +@Deprecated public class FactorsAffectingParentingChecker implements EventChecker { @Override diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/validators/RiskAndHarmChecker.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/validators/RiskAndHarmChecker.java index 74309720582..a293f0f763c 100644 --- a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/validators/RiskAndHarmChecker.java +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/validators/RiskAndHarmChecker.java @@ -9,8 +9,6 @@ import static java.util.Collections.emptyList; import static org.springframework.util.ObjectUtils.isEmpty; -import static uk.gov.hmcts.reform.fpl.enums.YesNo.NO; -import static uk.gov.hmcts.reform.fpl.enums.YesNo.YES; import static uk.gov.hmcts.reform.fpl.model.tasklist.TaskState.COMPLETED_FINISHED; import static uk.gov.hmcts.reform.fpl.service.validators.EventCheckerHelper.anyEmpty; import static uk.gov.hmcts.reform.fpl.service.validators.EventCheckerHelper.anyNonEmpty; @@ -32,10 +30,9 @@ public boolean isStarted(CaseData caseData) { } return anyNonEmpty( - risks.getNeglect(), - risks.getSexualAbuse(), - risks.getPhysicalHarm(), - risks.getEmotionalHarm()); + risks.getWhatKindOfRiskAndHarmToChildren(), + risks.getFactorsAffectingParenting(), + risks.getAnythingElseAffectingParenting()); } @Override @@ -43,30 +40,12 @@ public boolean isCompleted(CaseData caseData) { final Risks risks = caseData.getRisks(); if (risks == null || anyEmpty( - risks.getNeglect(), - risks.getSexualAbuse(), - risks.getPhysicalHarm(), - risks.getEmotionalHarm())) { + risks.getWhatKindOfRiskAndHarmToChildren(), + risks.getFactorsAffectingParenting())) { return false; } - if (YES.getValue().equals(risks.getNeglect()) - && isEmpty(risks.getNeglectOccurrences())) { - return false; - } - - if (YES.getValue().equals(risks.getSexualAbuse()) - && isEmpty(risks.getSexualAbuseOccurrences())) { - return false; - } - - if (YES.getValue().equals(risks.getPhysicalHarm()) - && isEmpty(risks.getPhysicalHarmOccurrences())) { - return false; - } - - return NO.getValue().equals(risks.getEmotionalHarm()) - || !isEmpty(risks.getEmotionalHarmOccurrences()); + return true; } @Override diff --git a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/TaskListRendererTest.java b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/TaskListRendererTest.java index 6792fcce8a2..0f429bc5585 100644 --- a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/TaskListRendererTest.java +++ b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/TaskListRendererTest.java @@ -103,7 +103,6 @@ class WithLocalAuthority { task(HEARING_URGENCY, COMPLETED_FINISHED), task(GROUNDS, COMPLETED), task(RISK_AND_HARM, IN_PROGRESS), - task(FACTORS_AFFECTING_PARENTING, COMPLETED_FINISHED), task(APPLICATION_DOCUMENTS, COMPLETED), task(LOCAL_AUTHORITY_DETAILS, COMPLETED), task(CHILDREN, COMPLETED), @@ -147,7 +146,6 @@ class SingleCourt { task(HEARING_URGENCY, COMPLETED_FINISHED), task(GROUNDS, COMPLETED), task(RISK_AND_HARM, IN_PROGRESS), - task(FACTORS_AFFECTING_PARENTING, COMPLETED_FINISHED), task(APPLICATION_DOCUMENTS, COMPLETED), task(LOCAL_AUTHORITY_DETAILS, COMPLETED), task(CHILDREN, COMPLETED), @@ -193,7 +191,6 @@ class MultipleCourts { task(HEARING_URGENCY, COMPLETED_FINISHED), task(GROUNDS, COMPLETED), task(RISK_AND_HARM, IN_PROGRESS), - task(FACTORS_AFFECTING_PARENTING, COMPLETED_FINISHED), task(APPLICATION_DOCUMENTS, COMPLETED), task(LOCAL_AUTHORITY_DETAILS, COMPLETED), task(CHILDREN, COMPLETED), diff --git a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/TaskListServiceTest.java b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/TaskListServiceTest.java index 5052af8b43c..b834c3b3d97 100644 --- a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/TaskListServiceTest.java +++ b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/TaskListServiceTest.java @@ -35,7 +35,6 @@ import static uk.gov.hmcts.reform.fpl.enums.Event.CASE_NAME; import static uk.gov.hmcts.reform.fpl.enums.Event.CHILDREN; import static uk.gov.hmcts.reform.fpl.enums.Event.COURT_SERVICES; -import static uk.gov.hmcts.reform.fpl.enums.Event.FACTORS_AFFECTING_PARENTING; import static uk.gov.hmcts.reform.fpl.enums.Event.GROUNDS; import static uk.gov.hmcts.reform.fpl.enums.Event.HEARING_URGENCY; import static uk.gov.hmcts.reform.fpl.enums.Event.INTERNATIONAL_ELEMENT; @@ -551,7 +550,6 @@ private List getTasks(TaskState state, boolean additionalContacts, boolean && !isRefuseContactApplication && !isContactWithChildInCareApplication) { events.add(RISK_AND_HARM); - events.add(FACTORS_AFFECTING_PARENTING); } if (!dischargeOfCare) { diff --git a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/casesubmission/SampleCaseSubmissionTestDataHelper.java b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/casesubmission/SampleCaseSubmissionTestDataHelper.java index 2f879afc4b9..40753379a33 100644 --- a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/casesubmission/SampleCaseSubmissionTestDataHelper.java +++ b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/casesubmission/SampleCaseSubmissionTestDataHelper.java @@ -16,7 +16,6 @@ import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisC20Supplement; import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisCaseSubmission; import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisChild; -import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisFactorsParenting; import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisHearing; import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisHearingPreferences; import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisInternationalElement; @@ -68,7 +67,6 @@ public static DocmosisCaseSubmission expectedDocmosisCaseSubmission() { + "from a parent.\nBeyond parental control.") .thresholdDetails("grounds for application criteria") .risks(expectedDocmosisRisks()) - .factorsParenting(expectedDocmosisFactorsParenting()) .proceeding(expectedDocmosisProceeding()) .relevantProceedings("Yes") .build(); @@ -245,18 +243,13 @@ private static DocmosisInternationalElement expectedDocmosisInternationalElement private static DocmosisRisks expectedDocmosisRisks() { return DocmosisRisks.builder() - .neglectDetails("Yes\nPast harm\nFuture risk of harm") - .sexualAbuseDetails("Yes\nPast harm\nFuture risk of harm") - .physicalHarmDetails("Yes\nPast harm\nFuture risk of harm") - .emotionalHarmDetails("Yes\nPast harm\nFuture risk of harm") - .build(); - } - - private static DocmosisFactorsParenting expectedDocmosisFactorsParenting() { - return DocmosisFactorsParenting.builder() - .anythingElse("No") - .alcoholDrugAbuseDetails("Yes\nhistory of drug abuse") - .domesticViolenceDetails("Yes\nhistory of domestic violence") + .physicalHarm("Yes") + .emotionalHarm("Yes") + .sexualAbuse("Yes") + .neglect("Yes") + .alcoholDrugAbuse("Yes") + .domesticAbuse("Yes") + .anythingElse("Something else") .build(); } diff --git a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/docmosis/CaseSubmissionGenerationServiceTest.java b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/docmosis/CaseSubmissionGenerationServiceTest.java index 84a4474bd6e..1b8271c1184 100644 --- a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/docmosis/CaseSubmissionGenerationServiceTest.java +++ b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/docmosis/CaseSubmissionGenerationServiceTest.java @@ -58,7 +58,6 @@ import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisC18Supplement; import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisC20Supplement; import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisCaseSubmission; -import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisFactorsParenting; import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisHearing; import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisHearingPreferences; import uk.gov.hmcts.reform.fpl.model.docmosis.DocmosisInternationalElement; @@ -1367,30 +1366,16 @@ void shouldReturnDefaultRisksWhenInfoNotGiven() { DocmosisCaseSubmission caseSubmission = underTest.getTemplateData(updatedCaseData); DocmosisRisks expectedDefaultRisk = DocmosisRisks.builder() - .emotionalHarmDetails("-") - .neglectDetails("-") - .physicalHarmDetails("-") - .sexualAbuseDetails("-") - .build(); - - assertThat(caseSubmission.getRisks()).isEqualTo(expectedDefaultRisk); - } - - @Test - void shouldReturnDefaultFactorsAffectingParentingWhenInfoNotGiven() { - CaseData updatedCaseData = givenCaseData.toBuilder() - .factorsParenting(null) - .build(); - - DocmosisCaseSubmission caseSubmission = underTest.getTemplateData(updatedCaseData); - - DocmosisFactorsParenting expectedFactorsParenting = DocmosisFactorsParenting.builder() - .alcoholDrugAbuseDetails("-") + .physicalHarm("-") + .emotionalHarm("-") + .sexualAbuse("-") + .neglect("-") + .alcoholDrugAbuse("-") + .domesticAbuse("-") .anythingElse("-") - .domesticViolenceDetails("-") .build(); - assertThat(caseSubmission.getFactorsParenting()).isEqualTo(expectedFactorsParenting); + assertThat(caseSubmission.getRisks()).isEqualTo(expectedDefaultRisk); } @Test diff --git a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/robotics/RoboticsDataServiceTest.java b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/robotics/RoboticsDataServiceTest.java index abb01cd3b8a..473794ac174 100644 --- a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/robotics/RoboticsDataServiceTest.java +++ b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/robotics/RoboticsDataServiceTest.java @@ -18,6 +18,7 @@ import uk.gov.hmcts.reform.fpl.config.HighCourtAdminEmailLookupConfiguration; import uk.gov.hmcts.reform.fpl.enums.ColleagueRole; import uk.gov.hmcts.reform.fpl.enums.OrderType; +import uk.gov.hmcts.reform.fpl.enums.RiskAndHarmToChildrenType; import uk.gov.hmcts.reform.fpl.exceptions.robotics.RoboticsDataException; import uk.gov.hmcts.reform.fpl.model.Address; import uk.gov.hmcts.reform.fpl.model.Allocation; @@ -273,14 +274,11 @@ void shouldReturnFalseForHarmAllegedWhenNoSelectionForRisks() { } @Test - void shouldReturnTrueForHarmAllegedWhenOneOfTheOptionsForRisksIsYes() { + void shouldReturnTrueForHarmAllegedWhenOneOfTheOptionsisNotEmpty() { CaseData caseData = prepareCaseData(); CaseData caseDataWithRisks = caseData.toBuilder() .risks(Risks.builder() - .physicalHarm("Yes") - .emotionalHarm("No") - .sexualAbuse("No") - .neglect("No") + .whatKindOfRiskAndHarmToChildren(List.of(RiskAndHarmToChildrenType.EMOTIONAL_HARM)) .build()) .build(); @@ -290,14 +288,10 @@ void shouldReturnTrueForHarmAllegedWhenOneOfTheOptionsForRisksIsYes() { } @Test - void shouldReturnFalseForHarmAllegedWhenAllOfTheOptionsForRisksIsNo() { + void shouldReturnFalseForHarmAllegedWhenAllOfTheOptionsForRisksIsEmpty() { CaseData caseData = prepareCaseData(); CaseData caseDataWithRisks = caseData.toBuilder() .risks(Risks.builder() - .physicalHarm("No") - .emotionalHarm("No") - .sexualAbuse("No") - .neglect("No") .build()) .build(); diff --git a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/validators/RiskAndHarmCheckerIsStartedTest.java b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/validators/RiskAndHarmCheckerIsStartedTest.java index 931d88f93c7..57c83aa1780 100644 --- a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/validators/RiskAndHarmCheckerIsStartedTest.java +++ b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/validators/RiskAndHarmCheckerIsStartedTest.java @@ -7,11 +7,16 @@ import org.junit.jupiter.params.provider.NullSource; import org.mockito.InjectMocks; import org.mockito.junit.jupiter.MockitoExtension; + +import uk.gov.hmcts.reform.fpl.enums.FactorsAffectingParentingType; +import uk.gov.hmcts.reform.fpl.enums.RiskAndHarmToChildrenType; import uk.gov.hmcts.reform.fpl.model.CaseData; import uk.gov.hmcts.reform.fpl.model.Risks; +import java.util.List; import java.util.stream.Stream; +import static java.util.Collections.emptyList; import static org.assertj.core.api.Assertions.assertThat; @ExtendWith(MockitoExtension.class) @@ -43,10 +48,11 @@ void shouldReturnTrueWhenNonEmptyRisks(Risks risks) { private static Stream nonEmptyRisks() { return Stream.of( - Risks.builder().neglect("Yes").build(), - Risks.builder().sexualAbuse("No").build(), - Risks.builder().physicalHarm("Yes").build(), - Risks.builder().emotionalHarm("No").build()) + Risks.builder().whatKindOfRiskAndHarmToChildren( + List.of(RiskAndHarmToChildrenType.EMOTIONAL_HARM)).build(), + Risks.builder().factorsAffectingParenting( + List.of(FactorsAffectingParentingType.ANYTHING_ELSE)).build(), + Risks.builder().anythingElseAffectingParenting("Something else").build()) .map(Arguments::of); } @@ -54,10 +60,9 @@ private static Stream emptyRisks() { return Stream.of( Risks.builder().build(), Risks.builder() - .neglect("") - .sexualAbuse("") - .physicalHarm("") - .emotionalHarm("") + .whatKindOfRiskAndHarmToChildren(emptyList()) + .factorsAffectingParenting(emptyList()) + .anythingElseAffectingParenting("") .build()) .map(Arguments::of); } diff --git a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/validators/RiskAndHarmCheckerTest.java b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/validators/RiskAndHarmCheckerTest.java index 59b0716ec46..65a527bd801 100644 --- a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/validators/RiskAndHarmCheckerTest.java +++ b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/validators/RiskAndHarmCheckerTest.java @@ -9,13 +9,16 @@ import org.junit.jupiter.params.provider.NullSource; import org.mockito.InjectMocks; import org.mockito.junit.jupiter.MockitoExtension; + +import uk.gov.hmcts.reform.fpl.enums.FactorsAffectingParentingType; +import uk.gov.hmcts.reform.fpl.enums.RiskAndHarmToChildrenType; import uk.gov.hmcts.reform.fpl.model.CaseData; import uk.gov.hmcts.reform.fpl.model.Risks; +import java.util.List; import java.util.stream.Stream; import static java.util.Collections.emptyList; -import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static uk.gov.hmcts.reform.fpl.model.tasklist.TaskState.COMPLETED_FINISHED; @@ -71,31 +74,17 @@ private static Stream incompleteRisks() { return Stream.of( Risks.builder().build(), completedRisk() - .emotionalHarmOccurrences(null) - .build(), - completedRisk() - .emotionalHarmOccurrences(emptyList()) - .build(), - - completedRisk() - .physicalHarmOccurrences(null) - .build(), - completedRisk() - .physicalHarmOccurrences(emptyList()) - .build(), - - completedRisk() - .sexualAbuseOccurrences(null) + .whatKindOfRiskAndHarmToChildren(null) .build(), completedRisk() - .sexualAbuseOccurrences(emptyList()) + .whatKindOfRiskAndHarmToChildren(emptyList()) .build(), completedRisk() - .neglectOccurrences(null) + .factorsAffectingParenting(null) .build(), completedRisk() - .neglectOccurrences(emptyList()) + .factorsAffectingParenting(emptyList()) .build() ).map(Arguments::of); } @@ -103,10 +92,8 @@ private static Stream incompleteRisks() { private static Stream completeRisks() { return Stream.of( Risks.builder() - .emotionalHarm("No") - .physicalHarm("No") - .sexualAbuse("No") - .neglect("No") + .whatKindOfRiskAndHarmToChildren(List.of(RiskAndHarmToChildrenType.EMOTIONAL_HARM)) + .factorsAffectingParenting(List.of(FactorsAffectingParentingType.DOMESTIC_ABUSE)) .build(), completedRisk() .build() @@ -115,13 +102,8 @@ private static Stream completeRisks() { private static Risks.RisksBuilder completedRisk() { return Risks.builder() - .emotionalHarm("Yes") - .emotionalHarmOccurrences(singletonList("Past harm")) - .physicalHarm("Yes") - .physicalHarmOccurrences(singletonList("Past harm")) - .sexualAbuse("Yes") - .sexualAbuseOccurrences(singletonList("Past harm")) - .neglect("Yes") - .neglectOccurrences(singletonList("Past harm")); + .whatKindOfRiskAndHarmToChildren(List.of(RiskAndHarmToChildrenType.EMOTIONAL_HARM)) + .factorsAffectingParenting(List.of(FactorsAffectingParentingType.ANYTHING_ELSE)) + .anythingElseAffectingParenting("Something else"); } } diff --git a/service/src/test/resources/core-case-data-store-api/callback-request.json b/service/src/test/resources/core-case-data-store-api/callback-request.json index 8f6123b8315..b3a319ae6f6 100644 --- a/service/src/test/resources/core-case-data-store-api/callback-request.json +++ b/service/src/test/resources/core-case-data-store-api/callback-request.json @@ -28,26 +28,18 @@ ], "caseLocalAuthority": "${localAuthority:-test1}", "risks": { - "neglect": "Yes", - "sexualAbuse": "Yes", - "physicalHarm": "Yes", - "emotionalHarm": "Yes", - "neglectOccurrences": [ - "Past harm", - "Future risk of harm" + "whatKindOfRiskAndHarmToChildren": [ + "PHYSICAL_HARM", + "EMOTIONAL_HARM", + "SEXUAL_ABUSE", + "NEGLECT" ], - "sexualAbuseOccurrences": [ - "Past harm", - "Future risk of harm" + "factorsAffectingParenting": [ + "ALCOHOL_DRUG_ABUSE", + "DOMESTIC_ABUSE", + "ANYTHING_ELSE" ], - "physicalHarmOccurrences": [ - "Past harm", - "Future risk of harm" - ], - "emotionalHarmOccurrences": [ - "Past harm", - "Future risk of harm" - ] + "anythingElseAffectingParenting": "Something else" }, "orders": { "orderType": [ @@ -383,13 +375,6 @@ } } ], - "factorsParenting": { - "anythingElse": "No", - "alcoholDrugAbuse": "Yes", - "domesticViolence": "Yes", - "alcoholDrugAbuseReason": "history of drug abuse", - "domesticViolenceReason": "history of domestic violence" - }, "allocationProposal": { "proposal": "Section 9 circuit judge", "proposalReason": "allocation proposal reason" diff --git a/service/src/test/resources/core-case-data-store-api/populated-case-details.json b/service/src/test/resources/core-case-data-store-api/populated-case-details.json index 31774a07f16..f9712820b5c 100644 --- a/service/src/test/resources/core-case-data-store-api/populated-case-details.json +++ b/service/src/test/resources/core-case-data-store-api/populated-case-details.json @@ -14,26 +14,18 @@ "gatekeeperEmail": "FamilyPublicLaw+gatekeeper@gmail.com", "caseLocalAuthority": "${caseLocalAuthority:-test1}", "risks": { - "neglect": "Yes", - "sexualAbuse": "Yes", - "physicalHarm": "Yes", - "emotionalHarm": "Yes", - "neglectOccurrences": [ - "Past harm", - "Future risk of harm" + "whatKindOfRiskAndHarmToChildren": [ + "PHYSICAL_HARM", + "EMOTIONAL_HARM", + "SEXUAL_ABUSE", + "NEGLECT" ], - "sexualAbuseOccurrences": [ - "Past harm", - "Future risk of harm" + "factorsAffectingParenting": [ + "ALCOHOL_DRUG_ABUSE", + "DOMESTIC_ABUSE", + "ANYTHING_ELSE" ], - "physicalHarmOccurrences": [ - "Past harm", - "Future risk of harm" - ], - "emotionalHarmOccurrences": [ - "Past harm", - "Future risk of harm" - ] + "anythingElseAffectingParenting": "Something else" }, "orders": { "orderType": [ @@ -366,13 +358,6 @@ } } ], - "factorsParenting": { - "anythingElse": "No", - "alcoholDrugAbuse": "Yes", - "domesticViolence": "Yes", - "alcoholDrugAbuseReason": "history of drug abuse", - "domesticViolenceReason": "history of domestic violence" - }, "allocationProposal": { "proposal": "Section 9 circuit judge", "proposalReason": "allocation proposal reason" diff --git a/service/src/test/resources/task-list/expected-task-list-multi-courts.md b/service/src/test/resources/task-list/expected-task-list-multi-courts.md index 0be2a04c350..0516d2c52d2 100644 --- a/service/src/test/resources/task-list/expected-task-list-multi-courts.md +++ b/service/src/test/resources/task-list/expected-task-list-multi-courts.md @@ -34,12 +34,6 @@
-Factors affecting parenting - -In emergency cases, you can send your application without this information - -
-
## Add application documents diff --git a/service/src/test/resources/task-list/expected-task-list-no-errors-multi-courts.md b/service/src/test/resources/task-list/expected-task-list-no-errors-multi-courts.md index 6f1ab509697..a593b2ad54a 100644 --- a/service/src/test/resources/task-list/expected-task-list-no-errors-multi-courts.md +++ b/service/src/test/resources/task-list/expected-task-list-no-errors-multi-courts.md @@ -34,12 +34,6 @@
-Factors affecting parenting - -In emergency cases, you can send your application without this information - -
-
## Add application documents diff --git a/service/src/test/resources/task-list/expected-task-list-no-errors.md b/service/src/test/resources/task-list/expected-task-list-no-errors.md index 244812a367b..97448ffad42 100644 --- a/service/src/test/resources/task-list/expected-task-list-no-errors.md +++ b/service/src/test/resources/task-list/expected-task-list-no-errors.md @@ -34,12 +34,6 @@
-Factors affecting parenting - -In emergency cases, you can send your application without this information - -
-
## Add application documents diff --git a/service/src/test/resources/task-list/expected-task-list.md b/service/src/test/resources/task-list/expected-task-list.md index a27474756b7..e87560d5fde 100644 --- a/service/src/test/resources/task-list/expected-task-list.md +++ b/service/src/test/resources/task-list/expected-task-list.md @@ -34,12 +34,6 @@
-Factors affecting parenting - -In emergency cases, you can send your application without this information - -
-
## Add application documents diff --git a/service/src/test/resources/task-list/legacy-applicant/expected-task-list-no-errors.md b/service/src/test/resources/task-list/legacy-applicant/expected-task-list-no-errors.md index b08f9c1cff5..78012b3641c 100644 --- a/service/src/test/resources/task-list/legacy-applicant/expected-task-list-no-errors.md +++ b/service/src/test/resources/task-list/legacy-applicant/expected-task-list-no-errors.md @@ -34,12 +34,6 @@
-Factors affecting parenting - -In emergency cases, you can send your application without this information - -
-
## Add application documents diff --git a/service/src/test/resources/task-list/legacy-applicant/expected-task-list.md b/service/src/test/resources/task-list/legacy-applicant/expected-task-list.md index 3851f10e97b..ffcb7ecf342 100644 --- a/service/src/test/resources/task-list/legacy-applicant/expected-task-list.md +++ b/service/src/test/resources/task-list/legacy-applicant/expected-task-list.md @@ -34,12 +34,6 @@
-Factors affecting parenting - -In emergency cases, you can send your application without this information - -
-
## Add application documents