Skip to content

Commit

Permalink
DFPL-1269 Non-molestation order (FL404A) (#5455)
Browse files Browse the repository at this point in the history
* git dfpl1269

* fix test

* fix check style

* fix manageOrdersRecitalsAndPreamblesOptional and add unit test

* allow selecting appllicant and respondent

* fix test

* Update OrderTest.java

* update notification

* fix check style

* fix code check

* Update NotifyTemplates.java

* Update NonMolestationOrderEventHandler.java
  • Loading branch information
chak-shing-lo-justice committed Aug 14, 2024
1 parent 875575f commit 8d55ca2
Show file tree
Hide file tree
Showing 36 changed files with 1,064 additions and 852 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3674,6 +3674,13 @@
"UserRole": "caseworker-publiclaw-courtadmin",
"CRUD": "CRUD"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseFieldID": "manageOrdersRecitalsAndPreamblesOptional",
"UserRole": "caseworker-publiclaw-courtadmin",
"CRUD": "CRUD"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
Expand Down Expand Up @@ -5879,6 +5886,27 @@
"UserRole": "caseworker-publiclaw-courtadmin",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseFieldID": "manageOrdersNonMolestationOrder",
"UserRole": "caseworker-publiclaw-courtadmin",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseFieldID": "manageOrdersNonMolestationOrderApplicant",
"UserRole": "caseworker-publiclaw-courtadmin",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseFieldID": "manageOrdersNonMolestationOrderRespondent",
"UserRole": "caseworker-publiclaw-courtadmin",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3688,6 +3688,13 @@
"UserRole": "caseworker-publiclaw-gatekeeper",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseFieldID": "manageOrdersRecitalsAndPreamblesOptional",
"UserRole": "caseworker-publiclaw-gatekeeper",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
Expand Down Expand Up @@ -4829,6 +4836,27 @@
"UserRole": "caseworker-publiclaw-gatekeeper",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseFieldID": "manageOrdersNonMolestationOrder",
"UserRole": "caseworker-publiclaw-gatekeeper",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseFieldID": "manageOrdersNonMolestationOrderApplicant",
"UserRole": "caseworker-publiclaw-gatekeeper",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseFieldID": "manageOrdersNonMolestationOrderRespondent",
"UserRole": "caseworker-publiclaw-gatekeeper",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3954,6 +3954,13 @@
"UserRole": "caseworker-publiclaw-judiciary",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseFieldID": "manageOrdersRecitalsAndPreamblesOptional",
"UserRole": "caseworker-publiclaw-judiciary",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
Expand Down Expand Up @@ -5480,6 +5487,27 @@
"UserRole": "caseworker-publiclaw-judiciary",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseFieldID": "manageOrdersNonMolestationOrder",
"UserRole": "caseworker-publiclaw-judiciary",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseFieldID": "manageOrdersNonMolestationOrderApplicant",
"UserRole": "caseworker-publiclaw-judiciary",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseFieldID": "manageOrdersNonMolestationOrderRespondent",
"UserRole": "caseworker-publiclaw-judiciary",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2499,6 +2499,13 @@
"UserRole": "caseworker-publiclaw-systemupdate",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseFieldID": "manageOrdersRecitalsAndPreamblesOptional",
"UserRole": "caseworker-publiclaw-systemupdate",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
Expand Down Expand Up @@ -3213,6 +3220,27 @@
"UserRole": "caseworker-publiclaw-systemupdate",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseFieldID": "manageOrdersNonMolestationOrder",
"UserRole": "caseworker-publiclaw-systemupdate",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseFieldID": "manageOrdersNonMolestationOrderApplicant",
"UserRole": "caseworker-publiclaw-systemupdate",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseFieldID": "manageOrdersNonMolestationOrderRespondent",
"UserRole": "caseworker-publiclaw-systemupdate",
"CRUD": "CRU"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"PageID": "OrderDetails",
"PageDisplayOrder": 6,
"PageColumnNumber": 1,
"PageShowCondition": "orderTempQuestions.furtherDirections=\"YES\" OR orderTempQuestions.orderDetails=\"YES\" OR orderTempQuestions.needSealing=\"YES\" OR orderTempQuestions.uploadOrderFile=\"YES\" OR orderTempQuestions.childPlacementQuestions=\"YES\" OR orderTempQuestions.childPlacementQuestionsForBlankOrder=\"YES\" OR orderTempQuestions.manageOrdersEducationSupervision=\"YES\" OR orderTempQuestions.manageOrdersVaryOrExtendSupervisionOrder=\"YES\" OR orderTempQuestions.refuseContactQuestions=\"YES\" OR orderTempQuestions.manageOrdersChildAssessment=\"YES\" OR orderTempQuestions.leaveToChangeChildSurname=\"YES\" OR orderTempQuestions.partyAllowedContactsAndConditions=\"YES\" OR orderTempQuestions.declarationOfParentage=\"YES\" OR orderTempQuestions.partyAllowedContactsAndConditions=\"YES\" OR orderTempQuestions.manageOrdersTransparencyOrder=\"YES\"",
"PageShowCondition": "orderTempQuestions.furtherDirections=\"YES\" OR orderTempQuestions.orderDetails=\"YES\" OR orderTempQuestions.needSealing=\"YES\" OR orderTempQuestions.uploadOrderFile=\"YES\" OR orderTempQuestions.childPlacementQuestions=\"YES\" OR orderTempQuestions.childPlacementQuestionsForBlankOrder=\"YES\" OR orderTempQuestions.manageOrdersEducationSupervision=\"YES\" OR orderTempQuestions.manageOrdersVaryOrExtendSupervisionOrder=\"YES\" OR orderTempQuestions.refuseContactQuestions=\"YES\" OR orderTempQuestions.manageOrdersChildAssessment=\"YES\" OR orderTempQuestions.leaveToChangeChildSurname=\"YES\" OR orderTempQuestions.partyAllowedContactsAndConditions=\"YES\" OR orderTempQuestions.declarationOfParentage=\"YES\" OR orderTempQuestions.partyAllowedContactsAndConditions=\"YES\" OR orderTempQuestions.nonMolestationOrder=\"YES\" OR orderTempQuestions.manageOrdersTransparencyOrder=\"YES\"",
"FieldShowCondition": "manageOrdersOperation=\"CREATE\"",
"CallBackURLMidEvent": "${CCD_DEF_CASE_SERVICE_BASE_URL}/callback/manage-orders/order-details/mid-event",
"ShowSummaryChangeOption": "N"
Expand Down Expand Up @@ -1416,5 +1416,57 @@
"PageColumnNumber": 1,
"FieldShowCondition": "orderTempQuestions.manageOrdersTransparencyOrder=\"YES\"",
"ShowSummaryChangeOption": "Y"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseEventID": "manageOrders",
"CaseFieldID": "manageOrdersNonMolestationOrderApplicant",
"PageFieldDisplayOrder": 69,
"DisplayContext": "MANDATORY",
"PageID": "OrderDetails",
"PageDisplayOrder": 6,
"PageColumnNumber": 1,
"FieldShowCondition": "orderTempQuestions.nonMolestationOrder=\"YES\"",
"ShowSummaryChangeOption": "Y"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseEventID": "manageOrders",
"CaseFieldID": "manageOrdersNonMolestationOrderRespondent",
"PageFieldDisplayOrder": 70,
"DisplayContext": "MANDATORY",
"PageID": "OrderDetails",
"PageDisplayOrder": 6,
"PageColumnNumber": 1,
"FieldShowCondition": "orderTempQuestions.nonMolestationOrder=\"YES\"",
"ShowSummaryChangeOption": "Y"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseEventID": "manageOrders",
"CaseFieldID": "manageOrdersRecitalsAndPreamblesOptional",
"PageFieldDisplayOrder": 71,
"DisplayContext": "OPTIONAL",
"PageID": "OrderDetails",
"PageDisplayOrder": 6,
"PageColumnNumber": 1,
"FieldShowCondition": "orderTempQuestions.nonMolestationOrder=\"YES\"",
"ShowSummaryChangeOption": "Y"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"CaseEventID": "manageOrders",
"CaseFieldID": "manageOrdersNonMolestationOrder",
"PageFieldDisplayOrder": 72,
"DisplayContext": "MANDATORY",
"PageID": "OrderDetails",
"PageDisplayOrder": 6,
"PageColumnNumber": 1,
"FieldShowCondition": "orderTempQuestions.nonMolestationOrder=\"YES\"",
"ShowSummaryChangeOption": "Y"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,15 @@
"SecurityClassification": "PUBLIC",
"Searchable": "N"
},
{
"LiveFrom": "01/01/2017",
"ID": "manageOrdersRecitalsAndPreamblesOptional",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"FieldType": "TextArea",
"Label": "Add recitals or preamble",
"SecurityClassification": "PUBLIC",
"Searchable": "N"
},
{
"LiveFrom": "01/01/2017",
"ID": "manageOrdersEpoType",
Expand Down Expand Up @@ -1172,5 +1181,32 @@
"Label": "Permission to report is not effective until:",
"SecurityClassification": "Public",
"Searchable": "N"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"ID": "manageOrdersNonMolestationOrder",
"FieldType": "TextArea",
"Label": "The Court Orders",
"SecurityClassification": "Public",
"Searchable": "N"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"ID": "manageOrdersNonMolestationOrderApplicant",
"FieldType": "DynamicList",
"Label": "Applicant of this order",
"SecurityClassification": "Public",
"Searchable": "N"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"ID": "manageOrdersNonMolestationOrderRespondent",
"FieldType": "DynamicList",
"Label": "Respondent of this order",
"SecurityClassification": "Public",
"Searchable": "N"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -439,5 +439,14 @@
"ElementLabel": " ",
"FieldShowCondition": "manageOrdersTransparencyOrder=\"DO_NOT_SHOW\"",
"SecurityClassification": "Public"
},
{
"LiveFrom": "01/01/2017",
"ID": "OrderTempQuestions",
"ListElementCode": "nonMolestationOrder",
"FieldType": "YesOrNo",
"ElementLabel": " ",
"FieldShowCondition": "nonMolestationOrder=\"DO_NOT_SHOW\"",
"SecurityClassification": "Public"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,12 @@
"ListElementCode": "TRANSPARENCY_ORDER",
"ListElement": "Transparency Order",
"DisplayOrder": 24
},
{
"LiveFrom": "01/01/2017",
"ID": "ManageOrdersType",
"ListElementCode": "FL404A_NON_MOLESTATION_ORDER",
"ListElement": "Non-molestation order (FL404A)",
"DisplayOrder": 25
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ void shouldPrePopulateDocumentToAmendWhenUsingAmendOperation(UUID selectedId, Do
.familyAssistanceOrder(NO)
.partyAllowedContactsAndConditions(NO)
.manageOrdersTransparencyOrder(NO)
.nonMolestationOrder(NO)
.build()
);
}
Expand Down Expand Up @@ -193,6 +194,7 @@ void shouldPrePopulateIssueDetailsSectionDataWhenCreatingBlankOrderForClosedCase
.partyAllowedContactsAndConditions(NO)
.familyAssistanceOrder(NO)
.manageOrdersTransparencyOrder(NO)
.nonMolestationOrder(NO)
.build()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ class ManageOrdersMidEventControllerTest extends AbstractCallbackTest {
Map.entry("leaveToChangeChildSurname", "NO"),
Map.entry("partyAllowedContactsAndConditions", "NO"),
Map.entry("familyAssistanceOrder", "NO"),
Map.entry("manageOrdersTransparencyOrder", "NO")
Map.entry("manageOrdersTransparencyOrder", "NO"),
Map.entry("nonMolestationOrder", "NO")
));

private static final String FAMILY_MAN_CASE_NUMBER = "CASE_NUMBER";
Expand Down Expand Up @@ -436,7 +437,7 @@ void shouldNotReturnErrorsWhenEPOOrderDetailsAreValidForRemoveToAccommodation()
@Test
void shouldNotReturnErrorsWhenEPOOrderDetailsAreValidForPreventRemoval() {
CaseData caseData = buildCaseData().toBuilder().manageOrdersEventData(
buildPreventRemovalEventData(Address.builder().addressLine1("test").postcode("SW").build()))
buildPreventRemovalEventData(Address.builder().addressLine1("test").postcode("SW").build()))
.build();

when(docmosisGenerationService.generateDocmosisDocument(anyMap(), eq(EPO_V2), eq(PDF), eq(ENGLISH)))
Expand Down Expand Up @@ -595,7 +596,8 @@ void orderSelectionShouldPopulateQuestionConditionHolderForC35a() {
Map.entry("leaveToChangeChildSurname", "NO"),
Map.entry("partyAllowedContactsAndConditions", "NO"),
Map.entry("familyAssistanceOrder", "NO"),
Map.entry("manageOrdersTransparencyOrder", "NO")
Map.entry("manageOrdersTransparencyOrder", "NO"),
Map.entry("nonMolestationOrder", "NO")
);

assertThat(response.getData().get("orderTempQuestions")).isEqualTo(expectedQuestions);
Expand Down Expand Up @@ -658,7 +660,8 @@ void orderSelectionShouldPopulateQuestionConditionHolderForC33() {
Map.entry("leaveToChangeChildSurname", "NO"),
Map.entry("partyAllowedContactsAndConditions", "NO"),
Map.entry("familyAssistanceOrder", "NO"),
Map.entry("manageOrdersTransparencyOrder", "NO")
Map.entry("manageOrdersTransparencyOrder", "NO"),
Map.entry("nonMolestationOrder", "NO")
);

assertThat(response.getData().get("orderTempQuestions")).isEqualTo(expectedQuestions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ private NotifyTemplates() {
public static final String PLACEMENT_ORDER_GENERATED_NOTIFICATION_TEMPLATE =
"673ff6f1-2a1f-4f0a-8e3b-d2044047304d";
public static final String ORDER_ISSUED_NOTIFICATION_TEMPLATE_FOR_ADMIN = "bb40930c-a583-4868-a1f6-1e398e7554d3";
public static final String NON_MOLESTATION_ORDER_NOTIFICATION_TEMPLATE = "f3757b68-2c94-44df-8a70-5af6a8c8fb71";
public static final String URGENT_ORDER_ISSUED_NOTIFICATION_TEMPLATE_FOR_ADMIN =
"49b46d30-f719-4351-b634-9a75e700d9cb";
public static final String ORDER_ISSUED_NOTIFICATION_TEMPLATE_FOR_REPRESENTATIVES =
Expand Down
Loading

0 comments on commit 8d55ca2

Please sign in to comment.