From 4bb161305de4cbca5fcf0733a0245e4cdc34a06c Mon Sep 17 00:00:00 2001 From: sairamkantheti1 <101887377+sairamkantheti1@users.noreply.github.com> Date: Mon, 18 Nov 2024 10:38:32 +0000 Subject: [PATCH] FPET-1167 Work allocation tasks skils updated (#185) * resolved conflicts * FPET-1167 Work allocation tasks skils updated --- ...wa-task-permissions-privatelaw-prlapps.dmn | 190 +++++++++++++++++- .../dmn/CamundaTaskPermissionTest.java | 153 +++++++++++++- 2 files changed, 332 insertions(+), 11 deletions(-) diff --git a/src/main/resources/wa-task-permissions-privatelaw-prlapps.dmn b/src/main/resources/wa-task-permissions-privatelaw-prlapps.dmn index 80d07faa..bb32409d 100644 --- a/src/main/resources/wa-task-permissions-privatelaw-prlapps.dmn +++ b/src/main/resources/wa-task-permissions-privatelaw-prlapps.dmn @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@ "r1" - + @@ -419,7 +419,7 @@ Court admin hearing management skills permission - "produceHearingBundleFL401","updateHearingActualsFL401","createHearingRequestReserveListAssist","createHearingRequest","createMultipleHearingRequest" + "produceHearingBundleFL401","updateHearingActualsFL401" @@ -479,7 +479,7 @@ Admin task permissions - "serviceOfApplicationFL401","adminServeOrderFL401","recreateApplicationPack","appStatementOfServiceBySol","appStatementOfServiceByLiP","appStatementOfServiceByBailiff","arrangeBailiffSOA","appStatementOfServiceByAdmin","completefl416AndServe","checkAndReServeDocuments" + "serviceOfApplicationFL401","adminServeOrderFL401","completefl416AndServe","checkAndReServeDocuments" @@ -628,7 +628,7 @@ Admin task permissions - "reviewAdminOrderByManager","confidentialCheckSOA","confidentialCheckDocuments" + "reviewAdminOrderByManager","confidentialCheckDocuments" @@ -897,6 +897,186 @@ false + + Admin task permissions + + "appStatementOfServiceBySol","recreateApplicationPack","appStatementOfServiceByLiP","appStatementOfServiceByBailiff","arrangeBailiffSOA","appStatementOfServiceByAdmin" + + + caseData.caseTypeOfApplication = "FL401" + + + + + + "hearing-centre-admin" + + + "Read,Own,UnclaimAssign,Claim,Unclaim,UnassignClaim" + + + "ADMIN" + + + "SKILL:ABA5:ORDERMANAGEMENTFL401" + + + + + + false + + + + Admin task permissions + + "appStatementOfServiceBySol","recreateApplicationPack","appStatementOfServiceByLiP","appStatementOfServiceByBailiff","arrangeBailiffSOA","appStatementOfServiceByAdmin" + + + caseData.caseTypeOfApplication = "C100" + + + + + + "hearing-centre-admin" + + + "Read,Own,UnclaimAssign,Claim,Unclaim,UnassignClaim" + + + "ADMIN" + + + "SKILL:ABA5:ORDERMANAGEMENTC100" + + + + + + false + + + + Admin task permissions + + "confidentialCheckSOA" + + + caseData.caseTypeOfApplication = "FL401" + + + + + + "hearing-centre-team-leader" + + + "Read,Own,UnclaimAssign,Claim,Unclaim,UnassignClaim" + + + "ADMIN" + + + "SKILL:ABA5:ORDERMANAGEMENTFL401" + + + + + + false + + + + Admin task permissions + + "confidentialCheckSOA" + + + caseData.caseTypeOfApplication = "C100" + + + + + + "hearing-centre-team-leader" + + + "Read,Own,UnclaimAssign,Claim,Unclaim,UnassignClaim" + + + "ADMIN" + + + "SKILL:ABA5:ORDERMANAGEMENTC100" + + + + + + false + + + + Court admin hearing management skills permission + + "createHearingRequestReserveListAssist","createHearingRequest","createMultipleHearingRequest" + + + caseData.caseTypeOfApplication = "FL401" + + + + + + "hearing-centre-admin" + + + "Read,Own,UnclaimAssign,Claim,Unclaim,UnassignClaim" + + + "ADMIN" + + + "SKILL:ABA5:HEARINGMANAGEMENTFL401" + + + + + + false + + + + Court admin hearing management skills permission + + "createHearingRequestReserveListAssist","createHearingRequest","createMultipleHearingRequest" + + + caseData.caseTypeOfApplication = "C100" + + + + + + "hearing-centre-admin" + + + "Read,Own,UnclaimAssign,Claim,Unclaim,UnassignClaim" + + + "ADMIN" + + + "SKILL:ABA5:HEARINGMANAGEMENTC100" + + + + + + false + + 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 bf9b3d85..4d9e1ea7 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 @@ -15,6 +15,7 @@ import uk.gov.hmcts.reform.prl.taskconfiguration.DmnDecisionTableBaseUnitTest; import java.io.Serializable; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Stream; @@ -246,7 +247,7 @@ void given_null_or_empty_inputs_when_evaluate_dmn_it_returns_expected_rules(Stri List> expectation) { VariableMap inputVariables = new VariableMapImpl(); inputVariables.putValue("taskAttributes", Map.of("taskType", taskType)); - inputVariables.putValue("case", caseData); + inputVariables.putValue("caseData", caseData); DmnDecisionTableResult dmnDecisionTableResult = evaluateDmnTable(inputVariables); @@ -726,7 +727,6 @@ void evaluate_task_admin_reviewInactiveRaRequestFL401(String taskType) { @ParameterizedTest @CsvSource(value = { "reviewAdminOrderByManager", - "confidentialCheckSOA", "confidentialCheckDocuments" }) void evaluate_task_admin_confidentialCheckSoa(String taskType) { @@ -747,6 +747,56 @@ void evaluate_task_admin_confidentialCheckSoa(String taskType) { ))); } + @ParameterizedTest + @CsvSource(value = { + "confidentialCheckSOA", + }) + void evaluate_task_admin_confidentialCheckSoaC100(String taskType) { + VariableMap inputVariables = new VariableMapImpl(); + inputVariables.putValue("taskAttributes", Map.of("taskType", taskType)); + Map caseData = new HashMap<>(); // allow null values + caseData.put("caseTypeOfApplication", "C100"); + inputVariables.putValue("caseData", caseData); + + DmnDecisionTableResult dmnDecisionTableResult = evaluateDmnTable(inputVariables); + + MatcherAssert.assertThat(dmnDecisionTableResult.getResultList(), is(List.of( + taskSupervisor, + Map.of( + "autoAssignable", false, + "name", "hearing-centre-team-leader", + "roleCategory", "ADMIN", + "authorisations", "SKILL:ABA5:ORDERMANAGEMENTC100", + "value", "Read,Own,UnclaimAssign,Claim,Unclaim,UnassignClaim" + ) + ))); + } + + @ParameterizedTest + @CsvSource(value = { + "confidentialCheckSOA", + }) + void evaluate_task_admin_confidentialCheckSoaFl401(String taskType) { + VariableMap inputVariables = new VariableMapImpl(); + inputVariables.putValue("taskAttributes", Map.of("taskType", taskType)); + Map caseData = new HashMap<>(); // allow null values + caseData.put("caseTypeOfApplication", "FL401"); + inputVariables.putValue("caseData", caseData); + + DmnDecisionTableResult dmnDecisionTableResult = evaluateDmnTable(inputVariables); + + MatcherAssert.assertThat(dmnDecisionTableResult.getResultList(), is(List.of( + taskSupervisor, + Map.of( + "autoAssignable", false, + "name", "hearing-centre-team-leader", + "roleCategory", "ADMIN", + "authorisations", "SKILL:ABA5:ORDERMANAGEMENTFL401", + "value", "Read,Own,UnclaimAssign,Claim,Unclaim,UnassignClaim" + ) + ))); + } + @ParameterizedTest @CsvSource(value = { "replyToMessageForJudiciary" @@ -770,9 +820,12 @@ void evaluate_task_admin_replyToMessageForJudiciary(String taskType) { "createHearingRequest", "createMultipleHearingRequest" }) - void evaluate_task_admin_createHearingRequest(String taskType) { + void evaluate_task_admin_createHearingRequestFL401(String taskType) { VariableMap inputVariables = new VariableMapImpl(); inputVariables.putValue("taskAttributes", Map.of("taskType", taskType)); + Map caseData = new HashMap<>(); // allow null values + caseData.put("caseTypeOfApplication", "FL401"); + inputVariables.putValue("caseData", caseData); DmnDecisionTableResult dmnDecisionTableResult = evaluateDmnTable(inputVariables); @@ -791,18 +844,106 @@ void evaluate_task_admin_createHearingRequest(String taskType) { @ParameterizedTest @CsvSource(value = { + "createHearingRequestReserveListAssist", + "createHearingRequest", + "createMultipleHearingRequest" + }) + void evaluate_task_admin_createHearingRequestC100(String taskType) { + VariableMap inputVariables = new VariableMapImpl(); + inputVariables.putValue("taskAttributes", Map.of("taskType", taskType)); + Map caseData = new HashMap<>(); // allow null values + caseData.put("caseTypeOfApplication", "C100"); + inputVariables.putValue("caseData", caseData); + + 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,UnclaimAssign,Claim,Unclaim,UnassignClaim", + "authorisations", "SKILL:ABA5:HEARINGMANAGEMENTC100" + ) + + ))); + } + + @ParameterizedTest + @CsvSource(value = { + "completefl416AndServe", + }) + void evaluate_task_admin_statementOfService(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,UnclaimAssign,Claim,Unclaim,UnassignClaim", + "authorisations", "SKILL:ABA5:ORDERMANAGEMENTFL401" + ) + + ))); + } + + @ParameterizedTest + @CsvSource(value = { + "appStatementOfServiceBySol", "recreateApplicationPack", + "appStatementOfServiceByLiP", + "appStatementOfServiceByBailiff", + "arrangeBailiffSOA", + "arrangeBailiffSOA", + "appStatementOfServiceByAdmin", + }) + void evaluate_task_admin_statementOfServiceBySol(String taskType) { + VariableMap inputVariables = new VariableMapImpl(); + inputVariables.putValue("taskAttributes", Map.of("taskType", taskType)); + Map caseData = new HashMap<>(); // allow null values + caseData.put("caseTypeOfApplication", "C100"); + inputVariables.putValue("caseData", caseData); + + + 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,UnclaimAssign,Claim,Unclaim,UnassignClaim", + "authorisations", "SKILL:ABA5:ORDERMANAGEMENTC100" + ) + + ))); + } + + + @ParameterizedTest + @CsvSource(value = { "appStatementOfServiceBySol", + "recreateApplicationPack", "appStatementOfServiceByLiP", "appStatementOfServiceByBailiff", "arrangeBailiffSOA", "arrangeBailiffSOA", "appStatementOfServiceByAdmin", - "completefl416AndServe", }) - void evaluate_task_admin_statementOfService(String taskType) { + void evaluate_task_admin_statementOfServiceBySolFL401(String taskType) { VariableMap inputVariables = new VariableMapImpl(); inputVariables.putValue("taskAttributes", Map.of("taskType", taskType)); + Map caseData = new HashMap<>(); // allow null values + caseData.put("caseTypeOfApplication", "FL401"); + inputVariables.putValue("caseData", caseData); + DmnDecisionTableResult dmnDecisionTableResult = evaluateDmnTable(inputVariables); @@ -868,6 +1009,6 @@ 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(29)); + assertThat(logic.getRules().size(), is(35)); } }