From d2bc6be4911c5fb642e09bae3efc0b5818de7c1a Mon Sep 17 00:00:00 2001 From: praneethhm <101885945+praneethhm@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:06:45 +0000 Subject: [PATCH] PRL-6564 Hearing status change notification to court admin --- ...-task-configuration-privatelaw-prlapps.dmn | 20 + .../wa-task-initiation-privatelaw-prlapps.dmn | 432 ++++++++++++++++++ ...wa-task-permissions-privatelaw-prlapps.dmn | 30 ++ .../dmn/CamundaTaskConfigurationTest.java | 25 +- .../dmn/CamundaTaskInitiationTest.java | 23 +- .../dmn/CamundaTaskPermissionTest.java | 23 +- 6 files changed, 548 insertions(+), 5 deletions(-) diff --git a/src/main/resources/wa-task-configuration-privatelaw-prlapps.dmn b/src/main/resources/wa-task-configuration-privatelaw-prlapps.dmn index afc283da..acfc84be 100644 --- a/src/main/resources/wa-task-configuration-privatelaw-prlapps.dmn +++ b/src/main/resources/wa-task-configuration-privatelaw-prlapps.dmn @@ -1870,6 +1870,26 @@ taskAttributes. taskType else if(taskType != null) then taskType else null + + + + + + "hearingListed" + + + + + + "description" + + + "[Create notice of proceeding or add date to Judge's order]" + + + + + diff --git a/src/main/resources/wa-task-initiation-privatelaw-prlapps.dmn b/src/main/resources/wa-task-initiation-privatelaw-prlapps.dmn index d7f55065..b76280c5 100644 --- a/src/main/resources/wa-task-initiation-privatelaw-prlapps.dmn +++ b/src/main/resources/wa-task-initiation-privatelaw-prlapps.dmn @@ -24,6 +24,19 @@ "C100","FL401" + + + +if(additionalData != null and additionalData.Data != null and additionalData.Data.hearingListed + != null) then + additionalData.Data.hearingListed + else + "" + + + "true" + + if(additionalData != null and additionalData.Data != null @@ -217,6 +230,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + - @@ -297,6 +313,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + - @@ -377,6 +396,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + - @@ -457,6 +479,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -537,6 +562,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -617,6 +645,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -697,6 +728,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -777,6 +811,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -857,6 +894,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -937,6 +977,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -1017,6 +1060,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -1097,6 +1143,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -1177,6 +1226,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -1257,6 +1309,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -1337,6 +1392,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -1417,6 +1475,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -1497,6 +1558,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + - @@ -1577,6 +1641,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -1657,6 +1724,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -1737,6 +1807,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -1817,6 +1890,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + - @@ -1897,6 +1973,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -1977,6 +2056,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + @@ -2059,6 +2141,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + @@ -2141,6 +2226,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -2221,6 +2309,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -2303,6 +2394,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + @@ -2385,6 +2479,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + @@ -2467,6 +2564,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + @@ -2549,6 +2649,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + @@ -2631,6 +2734,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + @@ -2713,6 +2819,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + @@ -2794,6 +2903,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + "JUDGE" @@ -2875,6 +2987,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + "JUDGE" @@ -2957,6 +3072,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + "JUDGE" @@ -3039,6 +3157,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + "JUDGE" @@ -3119,6 +3240,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100","FL401" + + + @@ -3199,6 +3323,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100","FL401" + + + @@ -3279,6 +3406,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100","FL401" + + + @@ -3359,6 +3489,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + "TO BE REMOVED LATER" @@ -3439,6 +3572,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + "TO BE REMOVED LATER" @@ -3519,6 +3655,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + "TO BE REMOVED LATER" @@ -3601,6 +3740,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + "TO BE REMOVED LATER" @@ -3683,6 +3825,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + @@ -3765,6 +3910,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + @@ -3845,6 +3993,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + "COURT_ADMIN" @@ -3925,6 +4076,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + "COURT_ADMIN" @@ -4005,6 +4159,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100","FL401" + + + "COURT_ADMIN" @@ -4085,6 +4242,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100","FL401" + + + "JUDGE" @@ -4165,6 +4325,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100","FL401" + + + "COURT_ADMIN" @@ -4245,6 +4408,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100","FL401" + + + "JUDGE" @@ -4325,6 +4491,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100","FL401" + + + "COURT_ADMIN" @@ -4405,6 +4574,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100","FL401" + + + "JUDGE" @@ -4485,6 +4657,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + @@ -4565,6 +4740,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + @@ -4645,6 +4823,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -4725,6 +4906,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -4805,6 +4989,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -4885,6 +5072,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -4965,6 +5155,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -5045,6 +5238,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -5125,6 +5321,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + @@ -5205,6 +5404,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -5285,6 +5487,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -5365,6 +5570,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -5445,6 +5653,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -5525,6 +5736,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -5605,6 +5819,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -5685,6 +5902,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -5765,6 +5985,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + @@ -5845,6 +6068,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + @@ -5925,6 +6151,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + @@ -6005,6 +6234,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + @@ -6085,6 +6317,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -6165,6 +6400,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -6245,6 +6483,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -6325,6 +6566,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -6405,6 +6649,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + @@ -6485,6 +6732,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + @@ -6565,6 +6815,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + @@ -6645,6 +6898,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + @@ -6725,6 +6981,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + @@ -6805,6 +7064,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + @@ -6885,6 +7147,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + @@ -6965,6 +7230,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + @@ -7045,6 +7313,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -7125,6 +7396,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -7205,6 +7479,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -7285,6 +7562,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -7365,6 +7645,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + @@ -7445,6 +7728,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + @@ -7525,6 +7811,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -7605,6 +7894,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -7685,6 +7977,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -7765,6 +8060,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -7845,6 +8143,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -7925,6 +8226,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -8005,6 +8309,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -8085,6 +8392,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -8165,6 +8475,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -8245,6 +8558,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -8325,6 +8641,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -8405,6 +8724,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -8485,6 +8807,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -8565,6 +8890,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -8645,6 +8973,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "C100" + + + @@ -8725,6 +9056,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then "FL401" + + + @@ -8805,6 +9139,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -8885,6 +9222,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -8965,6 +9305,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -9045,6 +9388,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -9125,6 +9471,9 @@ and additionalData.Data.isHearingTaskNeeded != null) then + + + @@ -9195,6 +9544,89 @@ and additionalData.Data.isHearingTaskNeeded != null) then "newCaseTransferredToCourt" + + + "hmcCaseUpdPrepForHearing" + + + "JUDICIAL_REVIEW", "PREPARE_FOR_HEARING_CONDUCT_HEARING" + + + + + + "true" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "hearingListed" + + + "Hearing has been listed" + + + + + + "hearingListed" + + diff --git a/src/main/resources/wa-task-permissions-privatelaw-prlapps.dmn b/src/main/resources/wa-task-permissions-privatelaw-prlapps.dmn index bb32409d..f2bfa64a 100644 --- a/src/main/resources/wa-task-permissions-privatelaw-prlapps.dmn +++ b/src/main/resources/wa-task-permissions-privatelaw-prlapps.dmn @@ -1077,6 +1077,36 @@ false + + Admin task permissions + + "hearingListed" + + + + + + + + + "hearing-centre-admin" + + + "Read,Own,Complete,UnclaimAssign,Claim,Unclaim,UnassignClaim" + + + "ADMIN" + + + + + + + + + false + + diff --git a/src/test/java/uk/gov/hmcts/reform/prl/taskconfiguration/dmn/CamundaTaskConfigurationTest.java b/src/test/java/uk/gov/hmcts/reform/prl/taskconfiguration/dmn/CamundaTaskConfigurationTest.java index a14ba9ea..ecf84b4c 100644 --- a/src/test/java/uk/gov/hmcts/reform/prl/taskconfiguration/dmn/CamundaTaskConfigurationTest.java +++ b/src/test/java/uk/gov/hmcts/reform/prl/taskconfiguration/dmn/CamundaTaskConfigurationTest.java @@ -34,7 +34,7 @@ void if_this_test_fails_needs_updating_with_your_changes() { DmnDecisionTableImpl logic = (DmnDecisionTableImpl) decision.getDecisionLogic(); assertThat(logic.getInputs().size(), is(3)); assertThat(logic.getOutputs().size(), is(3)); - assertThat(logic.getRules().size(), is(92)); + assertThat(logic.getRules().size(), is(93)); } @@ -1531,6 +1531,9 @@ private static String getDescriptionBasedOnTaskType(String taskType) { return "[Check and re-serve documents](/cases/case-details/${[CASE_REFERENCE]}" + "/trigger/serviceOfDocuments/serviceOfDocuments1)"; + case "hearingListed": + return "[Create notice of proceeding or add date to Judge's order]"; + default: break; } @@ -1734,4 +1737,24 @@ void when_given_task_type_then_name_workType_and_validate_value_access_requests( "value", "access_requests" ))); } + + @ParameterizedTest + @CsvSource({ + "hearingListed" + }) + void when_given_task_type_then_ForHearingListed_and_validate_description( + String taskType) { + VariableMap inputVariables = new VariableMapImpl(); + inputVariables.putValue( + "taskAttributes", + Map.of("taskId", "1234", + "taskType", taskType, + "name", "LastName" + ) + ); + + DmnDecisionTableResult dmnDecisionTableResult = evaluateDmnTable(inputVariables); + + assertDescriptionField(taskType, dmnDecisionTableResult); + } } diff --git a/src/test/java/uk/gov/hmcts/reform/prl/taskconfiguration/dmn/CamundaTaskInitiationTest.java b/src/test/java/uk/gov/hmcts/reform/prl/taskconfiguration/dmn/CamundaTaskInitiationTest.java index cc4b26f3..55be2878 100644 --- a/src/test/java/uk/gov/hmcts/reform/prl/taskconfiguration/dmn/CamundaTaskInitiationTest.java +++ b/src/test/java/uk/gov/hmcts/reform/prl/taskconfiguration/dmn/CamundaTaskInitiationTest.java @@ -39,9 +39,9 @@ public static void initialization() { void if_this_test_fails_needs_updating_with_your_changes() { //The purpose of this test is to prevent adding new rows without being tested DmnDecisionTableImpl logic = (DmnDecisionTableImpl) decision.getDecisionLogic(); - assertThat(logic.getInputs().size(), is(22)); + assertThat(logic.getInputs().size(), is(23)); assertThat(logic.getOutputs().size(), is(4)); - assertThat(logic.getRules().size(), is(112)); + assertThat(logic.getRules().size(), is(113)); } static Stream scenarioProvider() { @@ -1360,7 +1360,24 @@ static Stream scenarioProvider() { "taskId", "checkAndReServeDocuments" ) ) - ) + ), + Arguments.of( + "hmcCaseUpdPrepForHearing", + "PREPARE_FOR_HEARING_CONDUCT_HEARING", + mapAdditionalData("{\n" + + " \"Data\":{\n" + + " \"hearingListed\":\"" + "true" + "\"\n" + + " }" + + "}"), + singletonList( + Map.of( + "taskId", "hearingListed", + "name", "Hearing has been listed", + "processCategories", "hearingListed" + ) + ) + ) + ); } diff --git a/src/test/java/uk/gov/hmcts/reform/prl/taskconfiguration/dmn/CamundaTaskPermissionTest.java b/src/test/java/uk/gov/hmcts/reform/prl/taskconfiguration/dmn/CamundaTaskPermissionTest.java index 4d9e1ea7..265c8ad8 100644 --- a/src/test/java/uk/gov/hmcts/reform/prl/taskconfiguration/dmn/CamundaTaskPermissionTest.java +++ b/src/test/java/uk/gov/hmcts/reform/prl/taskconfiguration/dmn/CamundaTaskPermissionTest.java @@ -1009,6 +1009,27 @@ void if_this_test_fails_needs_updating_with_your_changes() { DmnDecisionTableImpl logic = (DmnDecisionTableImpl) decision.getDecisionLogic(); assertThat(logic.getInputs().size(), is(2)); assertThat(logic.getOutputs().size(), is(7)); - assertThat(logic.getRules().size(), is(35)); + assertThat(logic.getRules().size(), is(36)); + } + + @ParameterizedTest + @CsvSource(value = { + "hearingListed" + }) + void evaluate_task_admin_hearingListed(String taskType) { + VariableMap inputVariables = new VariableMapImpl(); + inputVariables.putValue("taskAttributes", Map.of("taskType", taskType)); + + DmnDecisionTableResult dmnDecisionTableResult = evaluateDmnTable(inputVariables); + MatcherAssert.assertThat(dmnDecisionTableResult.getResultList(), is(List.of( + taskSupervisor, + Map.of( + "autoAssignable", false, + "name", "hearing-centre-admin", + "roleCategory", "ADMIN", + "value", "Read,Own,Complete,UnclaimAssign,Claim,Unclaim,UnassignClaim" + + ) + ))); } }