From ca08ab8e3c2b8dafdcf6c8ba56337d07d7a48b74 Mon Sep 17 00:00:00 2001 From: kalachandrasekar1 Date: Tue, 25 Jul 2023 17:35:26 +0100 Subject: [PATCH 1/8] RET-2347 testing --- ...-initiation-employment-et_englandwales.dmn | 28 +++++++------- .../dmn/EmploymentTaskInitiationTest.java | 38 ++++++++++++++----- 2 files changed, 43 insertions(+), 23 deletions(-) diff --git a/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn b/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn index b9ee6b90..63257815 100644 --- a/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn +++ b/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn @@ -1,5 +1,5 @@ - + @@ -15,17 +15,19 @@ - if(additionalData != null and additionalData.Data != null and additionalData.Data.referCaseTo != null) - then additionalData.Data.referCaseTo - else null +if(additionalData!=null and additionalData.Data!=null and additionalData.Data.referralCollection!=null and +count(additionalData.Data.referralCollection) > 0) +then (reverse(additionalData.Data.referralCollection)[1]).value.referCaseTo +else null - if(additionalData != null and additionalData.Data != null and additionalData.Data.referralSubject != null) - then additionalData.Data.referralSubject - else null + if(additionalData!=null and additionalData.Data!=null and additionalData.Data.referralCollection!=null and +count(additionalData.Data.referralCollection) > 0) +then (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject +else null @@ -140,7 +142,7 @@ else "Other" "ReviewReferralAdmin" - "Review Referral - " + additionalData.Data.referralSubject + "Review Referral - "+(reverse(additionalData.Data.referralCollection)[1]).value.referralSubject @@ -178,7 +180,7 @@ else "Other" "ReviewReferralJudiciary" - "Review Referral - " + additionalData.Data.referralSubject + "Review Referral - "+(reverse(additionalData.Data.referralCollection)[1]).value.referralSubject @@ -216,7 +218,7 @@ else "Other" "ReviewReferralLegalOps" - "Review Referral - " + additionalData.Data.referralSubject + "Review Referral - "+(reverse(additionalData.Data.referralCollection)[1]).value.referralSubject @@ -406,7 +408,7 @@ else "Other" "ReviewReferralResponseAdmin" - "Review Referral Response - " + additionalData.Data.referralSubject + "Review Referral Response - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject @@ -558,7 +560,7 @@ else "Other" "ReviewReferralResponseJudiciary" - "Review Referral Response - " + additionalData.Data.referralSubject + "Review Referral Response - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject @@ -596,7 +598,7 @@ else "Other" "ReviewReferralResponseLegalOps" - "Review Referral Response - " + additionalData.Data.referralSubject + "Review Referral Response - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject diff --git a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java index 06c034b5..4ce9fec6 100644 --- a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java +++ b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java @@ -69,7 +69,7 @@ public static void initialization() { public static Stream scenarioProvider() { return Stream.of( - Arguments.of( + Arguments.of( "SUBMIT_CASE_DRAFT", "Submitted", null, @@ -86,10 +86,12 @@ public static Stream scenarioProvider() { "Submitted", mapAdditionalData("{\n" + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + REFERCASETO_ADMIN + "," + REFERRAL_SUBJECT + "," + ISURGENT_YES - + " }" + + " }}]}" + "}"), List.of( mapExpectedOutput( @@ -104,10 +106,12 @@ public static Stream scenarioProvider() { "Submitted", mapAdditionalData("{\n" + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + REFERCASETO_JUDGE + "," + REFERRAL_SUBJECT + "," + ISURGENT_YES - + " }" + + " }}]}" + "}"), List.of( mapExpectedOutput( @@ -122,10 +126,12 @@ public static Stream scenarioProvider() { "Submitted", mapAdditionalData("{\n" + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + REFERCASETO_LEGALOFFICER + "," + REFERRAL_SUBJECT + "," + ISURGENT_YES - + " }" + + " }}]}" + "}"), List.of( mapExpectedOutput( @@ -198,10 +204,12 @@ public static Stream scenarioProvider() { "Submitted", mapAdditionalData("{\n" + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + REFERCASETO_ADMIN + "," + REFERRAL_SUBJECT + "," + ISURGENT_YES - + " }" + + " }}]}" + "}"), List.of( mapExpectedOutput( @@ -228,10 +236,12 @@ public static Stream scenarioProvider() { "Accepted", mapAdditionalData("{\n" + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + REFERCASETO_JUDGE + "," + REFERRAL_RULE21 + "," + ISURGENT_YES - + " }" + + " }}]}" + "}"), List.of( mapExpectedOutput( @@ -246,9 +256,11 @@ public static Stream scenarioProvider() { null, mapAdditionalData("{\n" + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + REFERCASETO_ADMIN + "," + REFERRAL_HEARINGS - + " }" + + " }}]}" + "}"), List.of( mapExpectedOutput( @@ -263,10 +275,12 @@ public static Stream scenarioProvider() { "Submitted", mapAdditionalData("{\n" + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + REFERCASETO_JUDGE + "," + REFERRAL_RULE21 + "," + ISURGENT_YES - + " }" + + " }}]}" + "}"), List.of( mapExpectedOutput( @@ -281,10 +295,12 @@ public static Stream scenarioProvider() { "Accepted", mapAdditionalData("{\n" + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + REFERCASETO_LEGALOFFICER + "," + REFERRAL_SUBJECT + "," + ISURGENT_YES - + " }" + + " }}]}" + "}"), List.of( mapExpectedOutput( @@ -299,9 +315,11 @@ public static Stream scenarioProvider() { "Accepted", mapAdditionalData("{\n" + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + REFERCASETO_ADMIN + "," + REFERRAL_JUDGMENT - + " }" + + " }}]}" + "}"), List.of( mapExpectedOutput( From 3ad6bee0d3a684aaf29ac2b76cb98946313a8868 Mon Sep 17 00:00:00 2001 From: kalachandrasekar1 Date: Wed, 26 Jul 2023 16:48:41 +0100 Subject: [PATCH 2/8] RET-2347 replyToReferral-directionTo added --- ...nfiguration-employment-et_englandwales.dmn | 86 +++++++++++++++--- ...-initiation-employment-et_englandwales.dmn | 91 ++++++++++++++++++- .../dmn/EmploymentTaskConfigurationTest.java | 19 ++-- .../dmn/EmploymentTaskInitiationTest.java | 54 +++++++---- 4 files changed, 209 insertions(+), 41 deletions(-) diff --git a/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn b/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn index 89004af6..17d37b1f 100644 --- a/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn +++ b/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn @@ -1,5 +1,5 @@ - + @@ -639,10 +639,8 @@ else "" "ReviewReferralAdmin", "ReviewReferralJudiciary", -"ReviewReferralLegalOps", -"ReviewReferralResponseAdmin", -"ReviewReferralResponseJudiciary", -"ReviewReferralResponseLegalOps" +"ReviewReferralLegalOps" + "majorPriority" @@ -656,6 +654,28 @@ else 5000 false + + + + + + "ReviewReferralResponseAdmin", +"ReviewReferralResponseJudiciary", +"ReviewReferralResponseLegalOps" + + + "majorPriority" + + + if caseData!=null and caseData.referralCollection!=null and count(caseData.referralCollection[count(value.referralReplyCollection)>0])>0 and + (reverse((reverse(caseData.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.isUrgentReply= "Yes" +then 1000 +else 5000 + + + + + @@ -692,10 +712,8 @@ else 5000 "ReviewReferralAdmin", "ReviewReferralJudiciary", -"ReviewReferralLegalOps", -"ReviewReferralResponseAdmin", -"ReviewReferralResponseJudiciary", -"ReviewReferralResponseLegalOps" +"ReviewReferralLegalOps" + "minorPriority" @@ -709,6 +727,28 @@ else 500 false + + + + + + "ReviewReferralResponseAdmin", +"ReviewReferralResponseJudiciary", +"ReviewReferralResponseLegalOps" + + + "minorPriority" + + + if caseData!=null and caseData.referralCollection!=null and count(caseData.referralCollection[count(value.referralReplyCollection)>0])>0 and + (reverse((reverse(caseData.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.isUrgentReply= "Yes" +then 100 +else 500 + + + + + @@ -835,10 +875,8 @@ else 500 "ReviewReferralAdmin", "ReviewReferralJudiciary", -"ReviewReferralLegalOps", -"ReviewReferralResponseAdmin", -"ReviewReferralResponseJudiciary", -"ReviewReferralResponseLegalOps" +"ReviewReferralLegalOps" + "dueDateIntervalDays" @@ -852,6 +890,28 @@ else 2 + + + + + + "ReviewReferralResponseAdmin", +"ReviewReferralResponseJudiciary", +"ReviewReferralResponseLegalOps" + + + "dueDateIntervalDays" + + + if caseData!=null and caseData.referralCollection!=null and count(caseData.referralCollection[count(value.referralReplyCollection)>0])>0 and + (reverse((reverse(caseData.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.isUrgentReply= "Yes" +then 1 +else 2 + + + + + diff --git a/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn b/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn index 63257815..78e6d0e4 100644 --- a/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn +++ b/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn @@ -12,6 +12,13 @@ + + + if(additionalData!=null and additionalData.Data!=null and additionalData.Data.referralCollection!=null and count(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])>0) +then (reverse((reverse(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.directionTo +else null + + @@ -82,6 +89,9 @@ else "Other" "Submitted" + + + @@ -120,6 +130,9 @@ else "Other" "Submitted" + + + "Admin" @@ -158,6 +171,9 @@ else "Other" "Submitted" + + + "Judge" @@ -196,6 +212,9 @@ else "Other" "Submitted" + + + "Legal officer" @@ -234,6 +253,9 @@ else "Other" "Accepted" + + + @@ -272,6 +294,9 @@ else "Other" "Accepted" + + + @@ -310,6 +335,9 @@ else "Other" "Accepted" + + + @@ -348,6 +376,9 @@ else "Other" "Accepted","Rejected" + + + @@ -386,9 +417,12 @@ else "Other" "Submitted" - + "Admin" + + + @@ -424,6 +458,9 @@ else "Other" "Accepted" + + + @@ -462,6 +499,9 @@ else "Other" "Accepted" + + + "Judge" @@ -500,6 +540,9 @@ else "Other" + + + "Admin" @@ -538,9 +581,12 @@ else "Other" "Submitted" - + "Judge" + + + @@ -576,9 +622,12 @@ else "Other" "Accepted" - + "Legal officer" + + + @@ -614,6 +663,9 @@ else "Other" "Accepted" + + + @@ -652,6 +704,9 @@ else "Other" "Accepted" + + + "Admin" @@ -690,6 +745,9 @@ else "Other" "Accepted" + + + @@ -728,6 +786,9 @@ else "Other" "Accepted" + + + @@ -766,6 +827,9 @@ else "Other" "Accepted" + + + @@ -815,6 +879,9 @@ else "Other" "Accepted" + + + @@ -853,6 +920,9 @@ else "Other" "Accepted" + + + @@ -901,6 +971,9 @@ else "Other" "Accepted" + + + @@ -939,6 +1012,9 @@ else "Other" "Accepted" + + + @@ -977,6 +1053,9 @@ else "Other" "Accepted" + + + @@ -1015,6 +1094,9 @@ else "Other" "Accepted" + + + @@ -1053,6 +1135,9 @@ else "Other" "Accepted" + + + diff --git a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskConfigurationTest.java b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskConfigurationTest.java index 7d4fa9ae..c5af3217 100644 --- a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskConfigurationTest.java +++ b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskConfigurationTest.java @@ -40,7 +40,12 @@ class EmploymentTaskConfigurationTest extends DmnDecisionTableBaseUnitTest { + "civil-wa-task-configuration/master/src/main/resources/privilege-calendar.json"; public static final String IS_URGENT = "{\"referralCollection\":[{\"value\": {\"isUrgent\": \"Yes\"}}]}"; + public static final String NOT_URGENT = "{\"referralCollection\":[{\"value\": {\"isUrgent\": \"No\"}}]}"; + public static final String ISURGENT_REPLY_YES = "{\"referralCollection\":[{\"value\": {\"referralReplyCollection\":" + + "[{\"value\": {\"isUrgentReply\": \"Yes\"}}]}}]}"; + public static final String ISURGENT_REPLY_NO = "{\"referralCollection\":[{\"value\": {\"referralReplyCollection\":" + + "[{\"value\": {\"isUrgentReply\": \"No\"}}]}}]}"; @BeforeAll public static void initialization() { @@ -573,28 +578,28 @@ public static Stream priority_ScenarioProvider() { Arguments.of("ReviewReferralAdmin", IS_URGENT, dueDateIntervalDays1, urgentMajorPriority, urgentMinorPriority), - Arguments.of("ReviewReferralResponseAdmin", IS_URGENT, + Arguments.of("ReviewReferralResponseAdmin", ISURGENT_REPLY_YES, dueDateIntervalDays1, urgentMajorPriority, urgentMinorPriority), Arguments.of("ReviewReferralJudiciary", IS_URGENT, dueDateIntervalDays1, urgentMajorPriority, urgentMinorPriority), - Arguments.of("ReviewReferralResponseJudiciary", IS_URGENT, + Arguments.of("ReviewReferralResponseJudiciary", ISURGENT_REPLY_YES, dueDateIntervalDays1, urgentMajorPriority, urgentMinorPriority), Arguments.of("ReviewReferralLegalOps", IS_URGENT, dueDateIntervalDays1, urgentMajorPriority, urgentMinorPriority), - Arguments.of("ReviewReferralResponseLegalOps", IS_URGENT, + Arguments.of("ReviewReferralResponseLegalOps", ISURGENT_REPLY_YES, dueDateIntervalDays1, urgentMajorPriority, urgentMinorPriority), Arguments.of("ReviewReferralAdmin", NOT_URGENT, dueDateIntervalDays2, defaultMajorPriority, defaultMinorPriority), - Arguments.of("ReviewReferralResponseAdmin", NOT_URGENT, + Arguments.of("ReviewReferralResponseAdmin", ISURGENT_REPLY_NO, dueDateIntervalDays2, defaultMajorPriority, defaultMinorPriority), Arguments.of("ReviewReferralJudiciary", NOT_URGENT, dueDateIntervalDays2, defaultMajorPriority, defaultMinorPriority), - Arguments.of("ReviewReferralResponseJudiciary", NOT_URGENT, + Arguments.of("ReviewReferralResponseJudiciary", ISURGENT_REPLY_NO, dueDateIntervalDays2, defaultMajorPriority, defaultMinorPriority), Arguments.of("ReviewReferralLegalOps", NOT_URGENT, dueDateIntervalDays2, defaultMajorPriority, defaultMinorPriority), - Arguments.of("ReviewReferralResponseLegalOps", NOT_URGENT, + Arguments.of("ReviewReferralResponseLegalOps", ISURGENT_REPLY_NO, dueDateIntervalDays2, defaultMajorPriority, defaultMinorPriority) ); } @@ -690,7 +695,7 @@ 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.getRules().size(), is(48)); + assertThat(logic.getRules().size(), is(51)); } private static Map mapData(String source) { diff --git a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java index 4ce9fec6..e5c9e57a 100644 --- a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java +++ b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java @@ -26,15 +26,18 @@ class EmploymentTaskInitiationTest extends DmnDecisionTableBaseUnitTest { public static final String REFERCASETO_ADMIN = "\"referCaseTo\":\"Admin\""; + public static final String DIRECTIONTO_ADMIN = "\"directionTo\":\"Admin\""; public static final String REFERCASETO_JUDGE = "\"referCaseTo\":\"Judge\""; + public static final String DIRECTIONTO_JUDGE = "\"directionTo\":\"Judge\""; public static final String REFERCASETO_LEGALOFFICER = "\"referCaseTo\":\"Legal officer\""; - + public static final String DIRECTIONTO_LEGALOFFICER = "\"directionTo\":\"Legal officer\""; public static final String REFERRAL_SUBJECT = "\"referralSubject\":\"(Referral Subject)\""; public static final String REFERRAL_RULE21 = "\"referralSubject\":\"Rule 21\""; public static final String REFERRAL_HEARINGS = "\"referralSubject\":\"Hearings\""; public static final String REFERRAL_JUDGMENT = "\"referralSubject\":\"Judgment\""; public static final String ISURGENT_YES = "\"isUrgent\":\"Yes\""; + public static final String ISURGENT_REPLY_YES = "\"isUrgentReply\":\"Yes\""; public static final String RULE26_YES = "\"et3Rule26\":\"Yes\""; public static final String APPLICATION_COLLECTION = @@ -208,7 +211,12 @@ public static Stream scenarioProvider() { + " \"value\":{\n" + REFERCASETO_ADMIN + "," + REFERRAL_SUBJECT + "," - + ISURGENT_YES + + ISURGENT_YES + "," + + " \"referralReplyCollection\":[{\n" + + " \"value\":{\n" + + DIRECTIONTO_ADMIN + "," + + ISURGENT_REPLY_YES + + " }}]" + " }}]}" + "}"), List.of( @@ -274,14 +282,19 @@ public static Stream scenarioProvider() { "replyToReferral", "Submitted", mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_JUDGE + "," - + REFERRAL_RULE21 + "," - + ISURGENT_YES - + " }}]}" - + "}"), + + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + + REFERCASETO_JUDGE + "," + + REFERRAL_RULE21 + "," + + ISURGENT_YES + "," + + " \"referralReplyCollection\":[{\n" + + " \"value\":{\n" + + DIRECTIONTO_JUDGE + "," + + ISURGENT_REPLY_YES + + " }}]" + + " }}]}" + + "}"), List.of( mapExpectedOutput( "ReviewReferralResponseJudiciary", @@ -294,14 +307,19 @@ public static Stream scenarioProvider() { "replyToReferral", "Accepted", mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_LEGALOFFICER + "," - + REFERRAL_SUBJECT + "," - + ISURGENT_YES - + " }}]}" - + "}"), + + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + + REFERCASETO_LEGALOFFICER + "," + + REFERRAL_SUBJECT + "," + + ISURGENT_YES + "," + + " \"referralReplyCollection\":[{\n" + + " \"value\":{\n" + + DIRECTIONTO_LEGALOFFICER + "," + + ISURGENT_REPLY_YES + + " }}]" + + " }}]}" + + "}"), List.of( mapExpectedOutput( "ReviewReferralResponseLegalOps", From ef921386068da2b36bbf48ca1d57ce89bc1e8457 Mon Sep 17 00:00:00 2001 From: kalachandrasekar1 Date: Thu, 27 Jul 2023 14:00:17 +0100 Subject: [PATCH 3/8] RET-2347-testing merge issue resolved --- ...-initiation-employment-et_englandwales.dmn | 77 ++++---- .../dmn/EmploymentTaskInitiationTest.java | 182 +++++++++--------- 2 files changed, 130 insertions(+), 129 deletions(-) diff --git a/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn b/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn index d24bfd1b..8622a78f 100644 --- a/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn +++ b/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn @@ -1,5 +1,5 @@ - + @@ -12,8 +12,8 @@ - - + + if(additionalData!=null and additionalData.Data!=null and additionalData.Data.referralCollection!=null and count(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])>0) then (reverse((reverse(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.directionTo else null @@ -21,19 +21,17 @@ else null - -if(additionalData!=null and additionalData.Data!=null and additionalData.Data.referralCollection!=null and + if(additionalData!=null and additionalData.Data!=null and additionalData.Data.referralCollection!=null and count(additionalData.Data.referralCollection) > 0) then (reverse(additionalData.Data.referralCollection)[1]).value.referCaseTo -else null - +else null if(additionalData!=null and additionalData.Data!=null and additionalData.Data.referralCollection!=null and count(additionalData.Data.referralCollection) > 0) -then (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject +then (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject else null @@ -89,7 +87,7 @@ else "Other" "Submitted" - + @@ -130,7 +128,7 @@ else "Other" "Submitted" - + @@ -155,7 +153,7 @@ else "Other" "ReviewReferralAdmin" - "Review Referral - "+(reverse(additionalData.Data.referralCollection)[1]).value.referralSubject + "Review Referral - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject @@ -171,7 +169,7 @@ else "Other" "Submitted" - + @@ -196,7 +194,7 @@ else "Other" "ReviewReferralJudiciary" - "Review Referral - "+(reverse(additionalData.Data.referralCollection)[1]).value.referralSubject + "Review Referral - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject @@ -212,7 +210,7 @@ else "Other" "Submitted" - + @@ -237,7 +235,7 @@ else "Other" "ReviewReferralLegalOps" - "Review Referral - "+(reverse(additionalData.Data.referralCollection)[1]).value.referralSubject + "Review Referral - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject @@ -253,7 +251,7 @@ else "Other" "Accepted" - + @@ -294,7 +292,7 @@ else "Other" "Accepted" - + @@ -335,7 +333,7 @@ else "Other" "Accepted" - + @@ -376,7 +374,7 @@ else "Other" "Accepted","Rejected" - + @@ -417,7 +415,7 @@ else "Other" "Submitted" - + "Admin" @@ -458,7 +456,7 @@ else "Other" "Accepted" - + @@ -499,7 +497,7 @@ else "Other" "Accepted" - + @@ -540,7 +538,7 @@ else "Other" - + @@ -581,7 +579,7 @@ else "Other" "Submitted" - + "Judge" @@ -622,7 +620,7 @@ else "Other" "Accepted" - + "Legal officer" @@ -663,7 +661,7 @@ else "Other" "Accepted" - + @@ -704,7 +702,7 @@ else "Other" "Accepted" - + @@ -745,7 +743,7 @@ else "Other" "Accepted" - + @@ -786,7 +784,7 @@ else "Other" "Accepted" - + @@ -827,7 +825,7 @@ else "Other" "Accepted" - + @@ -878,7 +876,7 @@ else "Other" "Accepted" - + @@ -919,7 +917,7 @@ else "Other" "Accepted" - + @@ -970,7 +968,7 @@ else "Other" "Accepted" - + @@ -1011,7 +1009,7 @@ else "Other" "Accepted" - + @@ -1052,7 +1050,7 @@ else "Other" "Accepted" - + @@ -1093,7 +1091,7 @@ else "Other" "Accepted" - + @@ -1134,7 +1132,7 @@ else "Other" "Accepted" - + @@ -1175,6 +1173,9 @@ else "Other" "Accepted" + + + @@ -1215,4 +1216,4 @@ else "Other" - \ No newline at end of file + diff --git a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java index e71306da..4ab858d1 100644 --- a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java +++ b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java @@ -26,18 +26,15 @@ class EmploymentTaskInitiationTest extends DmnDecisionTableBaseUnitTest { public static final String REFERCASETO_ADMIN = "\"referCaseTo\":\"Admin\""; - public static final String DIRECTIONTO_ADMIN = "\"directionTo\":\"Admin\""; public static final String REFERCASETO_JUDGE = "\"referCaseTo\":\"Judge\""; - public static final String DIRECTIONTO_JUDGE = "\"directionTo\":\"Judge\""; public static final String REFERCASETO_LEGALOFFICER = "\"referCaseTo\":\"Legal officer\""; - public static final String DIRECTIONTO_LEGALOFFICER = "\"directionTo\":\"Legal officer\""; + public static final String REFERRAL_SUBJECT = "\"referralSubject\":\"(Referral Subject)\""; public static final String REFERRAL_RULE21 = "\"referralSubject\":\"Rule 21\""; public static final String REFERRAL_HEARINGS = "\"referralSubject\":\"Hearings\""; public static final String REFERRAL_JUDGMENT = "\"referralSubject\":\"Judgment\""; public static final String ISURGENT_YES = "\"isUrgent\":\"Yes\""; - public static final String ISURGENT_REPLY_YES = "\"isUrgentReply\":\"Yes\""; public static final String RULE26_YES = "\"et3Rule26\":\"Yes\""; public static final String APPLICATION_COLLECTION = @@ -66,7 +63,10 @@ class EmploymentTaskInitiationTest extends DmnDecisionTableBaseUnitTest { createApplications("Change personal details", "Claimant"); public static final String CLAIMANT_WITHDRAW_ALL_OR_PART_OF_CASE = createApplications("Strike out all/part of response", "Claimant"); - + public static final String DIRECTIONTO_ADMIN = "\"directionTo\":\"Admin\""; + public static final String DIRECTIONTO_JUDGE = "\"directionTo\":\"Judge\""; + public static final String DIRECTIONTO_LEGALOFFICER = "\"directionTo\":\"Legal officer\""; + public static final String ISURGENT_REPLY_YES = "\"isUrgentReply\":\"Yes\""; @BeforeAll public static void initialization() { CURRENT_DMN_DECISION_TABLE = DmnDecisionTable.WA_TASK_INITIATION_ET_EW; @@ -74,7 +74,7 @@ public static void initialization() { public static Stream scenarioProvider() { return Stream.of( - Arguments.of( + Arguments.of( "SUBMIT_CASE_DRAFT", "Submitted", null, @@ -90,14 +90,14 @@ public static Stream scenarioProvider() { "createReferral", "Submitted", mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_ADMIN + "," - + REFERRAL_SUBJECT + "," - + ISURGENT_YES - + " }}]}" - + "}"), + + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + + REFERCASETO_ADMIN + "," + + REFERRAL_SUBJECT + "," + + ISURGENT_YES + + " }}]}" + + "}"), List.of( mapExpectedOutput( "ReviewReferralAdmin", @@ -110,14 +110,14 @@ public static Stream scenarioProvider() { "createReferral", "Submitted", mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_JUDGE + "," - + REFERRAL_SUBJECT + "," - + ISURGENT_YES - + " }}]}" - + "}"), + + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + + REFERCASETO_JUDGE + "," + + REFERRAL_SUBJECT + "," + + ISURGENT_YES + + " }}]}" + + "}"), List.of( mapExpectedOutput( "ReviewReferralJudiciary", @@ -130,14 +130,14 @@ public static Stream scenarioProvider() { "createReferral", "Submitted", mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_LEGALOFFICER + "," - + REFERRAL_SUBJECT + "," - + ISURGENT_YES - + " }}]}" - + "}"), + + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + + REFERCASETO_LEGALOFFICER + "," + + REFERRAL_SUBJECT + "," + + ISURGENT_YES + + " }}]}" + + "}"), List.of( mapExpectedOutput( "ReviewReferralLegalOps", @@ -208,19 +208,19 @@ public static Stream scenarioProvider() { "replyToReferral", "Submitted", mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_ADMIN + "," - + REFERRAL_SUBJECT + "," - + ISURGENT_YES + "," - + " \"referralReplyCollection\":[{\n" - + " \"value\":{\n" - + DIRECTIONTO_ADMIN + "," - + ISURGENT_REPLY_YES - + " }}]" - + " }}]}" - + "}"), + + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + + REFERCASETO_ADMIN + "," + + REFERRAL_SUBJECT + "," + + ISURGENT_YES + "," + + " \"referralReplyCollection\":[{\n" + + " \"value\":{\n" + + DIRECTIONTO_ADMIN + "," + + ISURGENT_REPLY_YES + + " }}]" + + " }}]}" + + "}"), List.of( mapExpectedOutput( "ReviewReferralResponseAdmin", @@ -245,14 +245,14 @@ public static Stream scenarioProvider() { "createReferral", "Accepted", mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_JUDGE + "," - + REFERRAL_RULE21 + "," - + ISURGENT_YES - + " }}]}" - + "}"), + + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + + REFERCASETO_JUDGE + "," + + REFERRAL_RULE21 + "," + + ISURGENT_YES + + " }}]}" + + "}"), List.of( mapExpectedOutput( "DraftAndSignJudgment", @@ -265,13 +265,13 @@ public static Stream scenarioProvider() { "createReferral", null, mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_ADMIN + "," - + REFERRAL_HEARINGS - + " }}]}" - + "}"), + + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + + REFERCASETO_ADMIN + "," + + REFERRAL_HEARINGS + + " }}]}" + + "}"), List.of( mapExpectedOutput( "IssuePostHearingDirection", @@ -284,19 +284,19 @@ public static Stream scenarioProvider() { "replyToReferral", "Submitted", mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_JUDGE + "," - + REFERRAL_RULE21 + "," - + ISURGENT_YES + "," - + " \"referralReplyCollection\":[{\n" - + " \"value\":{\n" - + DIRECTIONTO_JUDGE + "," - + ISURGENT_REPLY_YES - + " }}]" - + " }}]}" - + "}"), + + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + + REFERCASETO_JUDGE + "," + + REFERRAL_RULE21 + "," + + ISURGENT_YES + "," + + " \"referralReplyCollection\":[{\n" + + " \"value\":{\n" + + DIRECTIONTO_JUDGE + "," + + ISURGENT_REPLY_YES + + " }}]" + + " }}]}" + + "}"), List.of( mapExpectedOutput( "ReviewReferralResponseJudiciary", @@ -309,19 +309,19 @@ public static Stream scenarioProvider() { "replyToReferral", "Accepted", mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_LEGALOFFICER + "," - + REFERRAL_SUBJECT + "," - + ISURGENT_YES + "," - + " \"referralReplyCollection\":[{\n" - + " \"value\":{\n" - + DIRECTIONTO_LEGALOFFICER + "," - + ISURGENT_REPLY_YES - + " }}]" - + " }}]}" - + "}"), + + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + + REFERCASETO_LEGALOFFICER + "," + + REFERRAL_SUBJECT + "," + + ISURGENT_YES + "," + + " \"referralReplyCollection\":[{\n" + + " \"value\":{\n" + + DIRECTIONTO_LEGALOFFICER + "," + + ISURGENT_REPLY_YES + + " }}]" + + " }}]}" + + "}"), List.of( mapExpectedOutput( "ReviewReferralResponseLegalOps", @@ -334,13 +334,13 @@ public static Stream scenarioProvider() { "createReferral", "Accepted", mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_ADMIN + "," - + REFERRAL_JUDGMENT - + " }}]}" - + "}"), + + " \"Data\":{\n" + + " \"referralCollection\":[{\n" + + " \"value\":{\n" + + REFERCASETO_ADMIN + "," + + REFERRAL_JUDGMENT + + " }}]}" + + "}"), List.of( mapExpectedOutput( "IssueJudgment", From 46677348d7418dc48e010565c784920f3d2ea8a0 Mon Sep 17 00:00:00 2001 From: kalachandrasekar1 Date: Thu, 27 Jul 2023 14:03:38 +0100 Subject: [PATCH 4/8] RET-2347-testing added space --- .../et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java index 4ab858d1..e869f2ee 100644 --- a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java +++ b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java @@ -67,6 +67,7 @@ class EmploymentTaskInitiationTest extends DmnDecisionTableBaseUnitTest { public static final String DIRECTIONTO_JUDGE = "\"directionTo\":\"Judge\""; public static final String DIRECTIONTO_LEGALOFFICER = "\"directionTo\":\"Legal officer\""; public static final String ISURGENT_REPLY_YES = "\"isUrgentReply\":\"Yes\""; + @BeforeAll public static void initialization() { CURRENT_DMN_DECISION_TABLE = DmnDecisionTable.WA_TASK_INITIATION_ET_EW; From edab3b2eb58efa17a2acff4adad40b81ebb41c57 Mon Sep 17 00:00:00 2001 From: "fergus.oshea" Date: Fri, 28 Jul 2023 12:08:40 +0100 Subject: [PATCH 5/8] Merge branch 'master' into RET-3182-WithdrawAllOrPartOfCase # Conflicts: # src/main/resources/wa-task-cancellation-employment-et_englandwales.dmn # src/main/resources/wa-task-completion-employment-et_englandwales.dmn # src/main/resources/wa-task-configuration-employment-et_englandwales.dmn # src/main/resources/wa-task-initiation-employment-et_englandwales.dmn # src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskCancellationTest.java # src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskCompletionTest.java # src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java --- ...nfiguration-employment-et_englandwales.dmn | 8 +- ...-initiation-employment-et_englandwales.dmn | 710 +++++++++--------- 2 files changed, 361 insertions(+), 357 deletions(-) diff --git a/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn b/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn index 106a2503..b613bf2e 100644 --- a/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn +++ b/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn @@ -640,8 +640,7 @@ else "" "ReviewReferralAdmin", "ReviewReferralJudiciary", -"ReviewReferralLegalOps" - +"ReviewReferralLegalOps" "majorPriority" @@ -714,8 +713,7 @@ else 5000 "ReviewReferralAdmin", "ReviewReferralJudiciary", -"ReviewReferralLegalOps" - +"ReviewReferralLegalOps" "minorPriority" @@ -1034,4 +1032,4 @@ else 2 - \ No newline at end of file + diff --git a/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn b/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn index 8622a78f..00486896 100644 --- a/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn +++ b/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn @@ -1,5 +1,5 @@ - + @@ -12,68 +12,74 @@ - - - if(additionalData!=null and additionalData.Data!=null and additionalData.Data.referralCollection!=null and count(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])>0) -then (reverse((reverse(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.directionTo -else null - - - if(additionalData!=null and additionalData.Data!=null and additionalData.Data.referralCollection!=null and -count(additionalData.Data.referralCollection) > 0) -then (reverse(additionalData.Data.referralCollection)[1]).value.referCaseTo -else null + if(additionalData!=null + and additionalData.Data!=null + and additionalData.Data.referralCollection!=null + and count(additionalData.Data.referralCollection) > 0) + then (reverse(additionalData.Data.referralCollection)[1]).value.referCaseTo + else null - if(additionalData!=null and additionalData.Data!=null and additionalData.Data.referralCollection!=null and -count(additionalData.Data.referralCollection) > 0) -then (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject -else null + if(additionalData!=null + and additionalData.Data!=null + and additionalData.Data.referralCollection!=null + and count(additionalData.Data.referralCollection) > 0) + then (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject + else null + + + + + if(additionalData!=null + and additionalData.Data!=null + and additionalData.Data.referralCollection!=null + and count(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])>0) + then (reverse((reverse(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.directionTo + else null - if(additionalData != null and additionalData.Data != null and additionalData.Data.et3Rule26 != null) + if(additionalData != null + and additionalData.Data != null + and additionalData.Data.et3Rule26 != null) then additionalData.Data.et3Rule26 else null - if(additionalData!=null and additionalData.Data!=null and additionalData.Data.genericTseApplicationCollection!=null and -count(additionalData.Data.genericTseApplicationCollection) > 0) -then (reverse(additionalData.Data.genericTseApplicationCollection)[1]).value.type -else null + if(additionalData!=null + and additionalData.Data!=null + and additionalData.Data.genericTseApplicationCollection!=null + and count(additionalData.Data.genericTseApplicationCollection) > 0) + then (reverse(additionalData.Data.genericTseApplicationCollection)[1]).value.type + else null + if (additionalData!=null -and additionalData.Data!=null -and additionalData.Data.genericTseApplicationCollection!=null -and count(additionalData.Data.genericTseApplicationCollection[ - value.type="Change personal details" - and (reverse(value.respondCollection)[1]).value.from = "Claimant" - ]) > 0) -then "Change personal details" -else "Other" + and additionalData.Data!=null + and additionalData.Data.genericTseApplicationCollection!=null + and count(additionalData.Data.genericTseApplicationCollection[value.type="Change personal details" and (reverse(value.respondCollection)[1]).value.from = "Claimant"]) > 0) + then "Change personal details" + else "Other" if (additionalData!=null -and additionalData.Data!=null -and additionalData.Data.genericTseApplicationCollection!=null -and count(additionalData.Data.genericTseApplicationCollection[ - value.type="Change my personal details" - and (reverse(value.respondCollection)[1]).value.from = "Respondent" - ]) > 0) -then "Change my personal details" -else "Other" + and additionalData.Data!=null + and additionalData.Data.genericTseApplicationCollection!=null + and count(additionalData.Data.genericTseApplicationCollection[value.type="Change my personal details" and (reverse(value.respondCollection)[1]).value.from = "Respondent"]) > 0) + then "Change my personal details" + else "Other" @@ -87,15 +93,15 @@ else "Other" "Submitted" - - - + + + @@ -128,15 +134,15 @@ else "Other" "Submitted" - - - "Admin" + + + @@ -162,496 +168,537 @@ else "Other" "Vetting" - - + + "createReferral" - - "Submitted" + + - + + "Admin" + + + "Hearings" + + - - "Judge" + + - + - + - + - + + "IssuePostHearingDirection" + + + "Issue Post Hearing Direction" + + + + + "Hearing" + + + + + "createReferral" - + + "Accepted" + + + "Admin" + + + "Judgment" + + - - "ReviewReferralJudiciary" + + + + + + + + + + + + + + "IssueJudgment" - - "Review Referral - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject + + "Issue Judgment" - + - - "Vetting" + + "Hearing" - - + + "createReferral" - + "Submitted" - - + + "Judge" - - "Legal officer" + + - + - + - + - + - + - - "ReviewReferralLegalOps" + + "ReviewReferralJudiciary" - + "Review Referral - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject - + - + "Vetting" - - - "et3Response" + + + "createReferral" - + "Accepted" - - + + "Judge" - - + + "Rule 21" - + - + - + - + - + - - "ET3Processing" + + "DraftAndSignJudgment" - - "ET3 Processing" + + "Draft And Sign Judgment" - + - - "processing" + + "Judgment" - - - "initialConsideration" + + + "createReferral" - - "Accepted" + + "Submitted" - - + + "Legal officer" - + - + - + - + - + - + - - "IssueInitialConsiderationDirections" + + "ReviewReferralLegalOps" - - "Issue Initial Consideration Directions" + + "Review Referral - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject - + - - "Hearing" + + "Vetting" - - - "preAcceptanceCase" + + + "replyToReferral" - - "Accepted" + + "Submitted" - + - + - - + + "Admin" - + - + - + - + - - "ListServeClaim" + + "ReviewReferralResponseAdmin" - - "List/ Serve Claim" + + "Review Referral Response - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject - + - - "Vetting" + + "processing" - - - "preAcceptanceCase" + + + "replyToReferral" - - "Accepted","Rejected" + + "Submitted" - + - + - - + + "Judge" - + - + - + - + - - "SendEt1Notification" + + "ReviewReferralResponseJudiciary" - - "Send ET1 Notification" + + "Review Referral Response - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject - + - - "Vetting" + + "processing" - - + + "replyToReferral" - - "Submitted" - - - "Admin" + + "Accepted" - + - + - + + "Legal officer" + + - + - + - + - - "ReviewReferralResponseAdmin" + + "ReviewReferralResponseLegalOps" - + "Review Referral Response - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject - + - + "processing" - - - "updateHearing" + + + "et3Response" - + "Accepted" - + - + - + - + - + - + - + - - "DraftAndSignJudgment" + + "ET3Processing" - - "Draft And Sign Judgment" + + "ET3 Processing" - + - - "Judgment" + + "processing" - - - "createReferral" + + + "initialConsideration" - + "Accepted" - + - - "Judge" + + - - "Rule 21" + + - + - + - + - + - - "DraftAndSignJudgment" + + "IssueInitialConsiderationDirections" - - "Draft And Sign Judgment" + + "Issue Initial Consideration Directions" - + - - "Judgment" + + "Hearing" - - - "createReferral" + + + "preAcceptanceCase" - - + + "Accepted" - + - - "Admin" + + - - "Hearings" + + - + - + - + - + - - "IssuePostHearingDirection" + + "ListServeClaim" - - "Issue Post Hearing Direction" + + "List/ Serve Claim" - + - - "Hearing" + + "Vetting" - - - "replyToReferral" + + + "preAcceptanceCase" - - "Submitted" + + "Accepted","Rejected" - - "Judge" + + - + - + - + - + - + - + - - "ReviewReferralResponseJudiciary" + + "SendEt1Notification" - - "Review Referral Response - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject + + "Send ET1 Notification" - + - - "processing" + + "Vetting" - - - "replyToReferral" + + + "updateHearing" - + "Accepted" - - "Legal officer" + + - + - + - + - + - + - + - - "ReviewReferralResponseLegalOps" + + "DraftAndSignJudgment" - - "Review Referral Response - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject + + "Draft And Sign Judgment" - + - - "processing" + + "Judgment" @@ -661,15 +708,15 @@ else "Other" "Accepted" - - - + + + @@ -695,47 +742,6 @@ else "Other" "processing" - - - "createReferral" - - - "Accepted" - - - - - - "Admin" - - - "Judgment" - - - - - - - - - - - - - - - "IssueJudgment" - - - "Issue Judgment" - - - - - - "Hearing" - - "et3Vetting" @@ -743,15 +749,15 @@ else "Other" "Accepted" - - - + + + "Yes" @@ -784,15 +790,15 @@ else "Other" "Accepted" - - - + + + @@ -825,15 +831,15 @@ else "Other" "Accepted" - - - + + + @@ -876,15 +882,15 @@ else "Other" "Accepted" - - - + + + @@ -917,15 +923,15 @@ else "Other" "Accepted" - - - + + + @@ -968,15 +974,15 @@ else "Other" "Accepted" - - - + + + @@ -1009,15 +1015,15 @@ else "Other" "Accepted" - - - + + + @@ -1050,15 +1056,15 @@ else "Other" "Accepted" - - - + + + @@ -1091,15 +1097,15 @@ else "Other" "Accepted" - - - + + + @@ -1132,15 +1138,15 @@ else "Other" "Accepted" - - - + + + @@ -1173,15 +1179,15 @@ else "Other" "Accepted" - - - + + + From 37c9b6ebf64a10c03309296744210df71470bdfe Mon Sep 17 00:00:00 2001 From: "fergus.oshea" Date: Mon, 31 Jul 2023 17:18:14 +0100 Subject: [PATCH 6/8] RET-2347: Use new fields for Referrals --- ...nfiguration-employment-et_englandwales.dmn | 40 +- ...-initiation-employment-et_englandwales.dmn | 90 +++-- .../dmn/EmploymentTaskConfigurationTest.java | 19 +- .../dmn/EmploymentTaskInitiationTest.java | 353 +++++++----------- 4 files changed, 216 insertions(+), 286 deletions(-) diff --git a/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn b/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn index b613bf2e..fc3121c0 100644 --- a/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn +++ b/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn @@ -14,9 +14,7 @@ then taskAttributes.taskType else if(taskType != null) then taskType - else - null - + else null @@ -646,7 +644,10 @@ else "" "majorPriority" - if caseData != null and caseData.referralCollection != null and count(caseData.referralCollection) > 0 and (reverse(caseData.referralCollection)[1]).value.isUrgent = "Yes" + if caseData != null +and caseData.referralCollection != null +and count(caseData.referralCollection) > 0 +and (reverse(caseData.referralCollection)[1]).value.isUrgent = "Yes" then 1000 else 5000 @@ -667,8 +668,10 @@ else 5000 "majorPriority" - if caseData!=null and caseData.referralCollection!=null and count(caseData.referralCollection[count(value.referralReplyCollection)>0])>0 and - (reverse((reverse(caseData.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.isUrgentReply= "Yes" + if caseData!=null +and caseData.referralCollection!=null +and count(caseData.referralCollection[count(value.referralReplyCollection)>0])>0 +and (reverse((reverse(caseData.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.isUrgentReply= "Yes" then 1000 else 5000 @@ -719,7 +722,10 @@ else 5000 "minorPriority" - if caseData != null and caseData.referralCollection != null and count(caseData.referralCollection) > 0 and (reverse(caseData.referralCollection)[1]).value.isUrgent = "Yes" + if caseData != null +and caseData.referralCollection != null +and count(caseData.referralCollection) > 0 +and (reverse(caseData.referralCollection)[1]).value.isUrgent = "Yes" then 100 else 500 @@ -740,8 +746,10 @@ else 500 "minorPriority" - if caseData!=null and caseData.referralCollection!=null and count(caseData.referralCollection[count(value.referralReplyCollection)>0])>0 and - (reverse((reverse(caseData.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.isUrgentReply= "Yes" + if caseData!=null +and caseData.referralCollection!=null +and count(caseData.referralCollection[count(value.referralReplyCollection)>0])>0 +and (reverse((reverse(caseData.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.isUrgentReply= "Yes" then 100 else 500 @@ -875,14 +883,16 @@ else 500 "ReviewReferralAdmin", "ReviewReferralJudiciary", -"ReviewReferralLegalOps" - +"ReviewReferralLegalOps" "dueDateIntervalDays" - if caseData != null and caseData.referralCollection != null and count(caseData.referralCollection) > 0 and (reverse(caseData.referralCollection)[1]).value.isUrgent = "Yes" + if caseData != null +and caseData.referralCollection != null +and count(caseData.referralCollection) > 0 +and (reverse(caseData.referralCollection)[1]).value.isUrgent = "Yes" then 1 else 2 @@ -903,8 +913,10 @@ else 2 "dueDateIntervalDays" - if caseData!=null and caseData.referralCollection!=null and count(caseData.referralCollection[count(value.referralReplyCollection)>0])>0 and - (reverse((reverse(caseData.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.isUrgentReply= "Yes" + if caseData!=null +and caseData.referralCollection!=null +and count(caseData.referralCollection[count(value.referralReplyCollection)>0])>0 +and (reverse((reverse(caseData.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.isUrgentReply= "Yes" then 1 else 2 diff --git a/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn b/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn index 00486896..22f1af3e 100644 --- a/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn +++ b/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn @@ -15,71 +15,70 @@ if(additionalData!=null - and additionalData.Data!=null - and additionalData.Data.referralCollection!=null - and count(additionalData.Data.referralCollection) > 0) - then (reverse(additionalData.Data.referralCollection)[1]).value.referCaseTo - else null +and additionalData.Data!=null +and additionalData.Data.referralCollection!=null +and count(additionalData.Data.referralCollection) > 0) +then (reverse(additionalData.Data.referralCollection)[1]).value.referCaseTo +else null if(additionalData!=null - and additionalData.Data!=null - and additionalData.Data.referralCollection!=null - and count(additionalData.Data.referralCollection) > 0) - then (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject - else null +and additionalData.Data!=null +and additionalData.Data.referralCollection!=null +and count(additionalData.Data.referralCollection) > 0) +then (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject +else null if(additionalData!=null - and additionalData.Data!=null - and additionalData.Data.referralCollection!=null - and count(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])>0) - then (reverse((reverse(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.directionTo - else null +and additionalData.Data!=null +and additionalData.Data.referralCollection!=null +and count(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])>0) +then (reverse((reverse(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.directionTo +else null if(additionalData != null - and additionalData.Data != null - and additionalData.Data.et3Rule26 != null) - then additionalData.Data.et3Rule26 - else null +and additionalData.Data != null +and additionalData.Data.et3Rule26 != null) +then additionalData.Data.et3Rule26 +else null if(additionalData!=null - and additionalData.Data!=null - and additionalData.Data.genericTseApplicationCollection!=null - and count(additionalData.Data.genericTseApplicationCollection) > 0) - then (reverse(additionalData.Data.genericTseApplicationCollection)[1]).value.type - else null - +and additionalData.Data!=null +and additionalData.Data.genericTseApplicationCollection!=null +and count(additionalData.Data.genericTseApplicationCollection) > 0) +then (reverse(additionalData.Data.genericTseApplicationCollection)[1]).value.type +else null if (additionalData!=null - and additionalData.Data!=null - and additionalData.Data.genericTseApplicationCollection!=null - and count(additionalData.Data.genericTseApplicationCollection[value.type="Change personal details" and (reverse(value.respondCollection)[1]).value.from = "Claimant"]) > 0) - then "Change personal details" - else "Other" +and additionalData.Data!=null +and additionalData.Data.genericTseApplicationCollection!=null +and count(additionalData.Data.genericTseApplicationCollection[value.type="Change personal details" and (reverse(value.respondCollection)[1]).value.from = "Claimant"]) > 0) +then "Change personal details" +else "Other" if (additionalData!=null - and additionalData.Data!=null - and additionalData.Data.genericTseApplicationCollection!=null - and count(additionalData.Data.genericTseApplicationCollection[value.type="Change my personal details" and (reverse(value.respondCollection)[1]).value.from = "Respondent"]) > 0) - then "Change my personal details" - else "Other" +and additionalData.Data!=null +and additionalData.Data.genericTseApplicationCollection!=null +and count(additionalData.Data.genericTseApplicationCollection[value.type="Change my personal details" and (reverse(value.respondCollection)[1]).value.from = "Respondent"]) > 0) +then "Change my personal details" +else "Other" @@ -159,7 +158,8 @@ "ReviewReferralAdmin" - "Review Referral - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject + "Review Referral - " ++ (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject @@ -282,7 +282,8 @@ "ReviewReferralJudiciary" - "Review Referral - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject + "Review Referral - " ++ (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject @@ -364,7 +365,8 @@ "ReviewReferralLegalOps" - "Review Referral - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject + "Review Referral - " ++ (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject @@ -405,7 +407,9 @@ "ReviewReferralResponseAdmin" - "Review Referral Response - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject + "Review Referral Response - " ++ (reverse(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralSubject + @@ -446,7 +450,9 @@ "ReviewReferralResponseJudiciary" - "Review Referral Response - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject + "Review Referral Response - " ++ (reverse(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralSubject + @@ -487,7 +493,9 @@ "ReviewReferralResponseLegalOps" - "Review Referral Response - " + (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject + "Review Referral Response - " ++ (reverse(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralSubject + diff --git a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskConfigurationTest.java b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskConfigurationTest.java index 0c48f814..74b8f1f7 100644 --- a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskConfigurationTest.java +++ b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskConfigurationTest.java @@ -39,13 +39,17 @@ class EmploymentTaskConfigurationTest extends DmnDecisionTableBaseUnitTest { private static final String EXTRA_TEST_CALENDAR = "https://raw.githubusercontent.com/hmcts/" + "civil-wa-task-configuration/master/src/main/resources/privilege-calendar.json"; - public static final String IS_URGENT = "{\"referralCollection\":[{\"value\": {\"isUrgent\": \"Yes\"}}]}"; - - public static final String NOT_URGENT = "{\"referralCollection\":[{\"value\": {\"isUrgent\": \"No\"}}]}"; - public static final String ISURGENT_REPLY_YES = "{\"referralCollection\":[{\"value\": {\"referralReplyCollection\":" - + "[{\"value\": {\"isUrgentReply\": \"Yes\"}}]}}]}"; - public static final String ISURGENT_REPLY_NO = "{\"referralCollection\":[{\"value\": {\"referralReplyCollection\":" - + "[{\"value\": {\"isUrgentReply\": \"No\"}}]}}]}"; + public static final String IS_URGENT = + "{\"referralCollection\":[{\"value\": {\"isUrgent\": \"Yes\"}}]}"; + public static final String NOT_URGENT = + "{\"referralCollection\":[{\"value\": {\"isUrgent\": \"No\"}}]}"; + + public static final String ISURGENT_REPLY_YES = + "{\"referralCollection\":[{\"value\": {\"referralReplyCollection\":" + + "[{\"value\": {\"isUrgentReply\": \"Yes\"}}]}}]}"; + public static final String ISURGENT_REPLY_NO = + "{\"referralCollection\":[{\"value\": {\"referralReplyCollection\":" + + "[{\"value\": {\"isUrgentReply\": \"No\"}}]}}]}"; @BeforeAll public static void initialization() { @@ -184,6 +188,7 @@ public static Stream workType_ScenarioProvider() { Arguments.of("IssuePostHearingDirection", hearingWork), Arguments.of("IssueJudgment", hearingWork), + Arguments.of("ContactTribunalWithAnApplication", applications), Arguments.of("AmendPartyDetails", applications), Arguments.of("WithdrawAllOrPartOfCase", applications), diff --git a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java index e869f2ee..4d19c8f9 100644 --- a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java +++ b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java @@ -25,16 +25,6 @@ class EmploymentTaskInitiationTest extends DmnDecisionTableBaseUnitTest { - public static final String REFERCASETO_ADMIN = "\"referCaseTo\":\"Admin\""; - public static final String REFERCASETO_JUDGE = "\"referCaseTo\":\"Judge\""; - public static final String REFERCASETO_LEGALOFFICER = "\"referCaseTo\":\"Legal officer\""; - - public static final String REFERRAL_SUBJECT = "\"referralSubject\":\"(Referral Subject)\""; - public static final String REFERRAL_RULE21 = "\"referralSubject\":\"Rule 21\""; - public static final String REFERRAL_HEARINGS = "\"referralSubject\":\"Hearings\""; - public static final String REFERRAL_JUDGMENT = "\"referralSubject\":\"Judgment\""; - - public static final String ISURGENT_YES = "\"isUrgent\":\"Yes\""; public static final String RULE26_YES = "\"et3Rule26\":\"Yes\""; public static final String APPLICATION_COLLECTION = @@ -63,10 +53,31 @@ class EmploymentTaskInitiationTest extends DmnDecisionTableBaseUnitTest { createApplications("Change personal details", "Claimant"); public static final String CLAIMANT_WITHDRAW_ALL_OR_PART_OF_CASE = createApplications("Strike out all/part of response", "Claimant"); - public static final String DIRECTIONTO_ADMIN = "\"directionTo\":\"Admin\""; - public static final String DIRECTIONTO_JUDGE = "\"directionTo\":\"Judge\""; - public static final String DIRECTIONTO_LEGALOFFICER = "\"directionTo\":\"Legal officer\""; - public static final String ISURGENT_REPLY_YES = "\"isUrgentReply\":\"Yes\""; + + public static final String REFERRAL_COLLECTION = + "\"referralCollection\":[{\"value\": {\"referralSubject\": \"%s\",\"referCaseTo\": \"%s\",\"isUrgent\": \"%s\"%s}}]"; + public static final String REFERRALREPLY_COLLECTION = + ",\"referralReplyCollection\": [{\"value\": {\"directionTo\": \"%s\",\"isUrgentReply\": \"%s\"}}]"; + + public static final String REFERRAL_ADMIN = + createReferrals("(Referral Subject)", "Admin", "Yes", "", ""); + public static final String REFERRAL_ADMIN_HEARING = + createReferrals("Hearings", "Admin", "Yes", "", ""); + public static final String REFERRAL_ADMIN_JUDGMENT = + createReferrals("Judgment", "Admin", "Yes", "", ""); + public static final String REFERRAL_JUDGE = + createReferrals("(Referral Subject)", "Judge", "Yes", "", ""); + public static final String REFERRAL_JUDGE_RULE21 = + createReferrals("Rule 21", "Judge", "Yes", "", ""); + public static final String REFERRAL_LEGALOFFICER = + createReferrals("(Referral Subject)", "Legal officer", "Yes", "", ""); + + public static final String REFERRAL_REPLY_ADMIN = + createReferrals("(Referral Subject)", "", "", "Admin", "Yes"); + public static final String REFERRAL_REPLY_JUDGE = + createReferrals("Rule 21", "", "", "Judge", "Yes"); + public static final String REFERRAL_REPLY_LEGALOFFICER = + createReferrals("(Referral Subject)", "", "", "Legal officer", "Yes"); @BeforeAll public static void initialization() { @@ -90,15 +101,7 @@ public static Stream scenarioProvider() { Arguments.of( "createReferral", "Submitted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_ADMIN + "," - + REFERRAL_SUBJECT + "," - + ISURGENT_YES - + " }}]}" - + "}"), + mapAdditionalData("{\"Data\":{" + REFERRAL_ADMIN + "}}"), List.of( mapExpectedOutput( "ReviewReferralAdmin", @@ -107,18 +110,34 @@ public static Stream scenarioProvider() { ) ) ), + Arguments.of( + "createReferral", + null, + mapAdditionalData("{\"Data\":{" + REFERRAL_ADMIN_HEARING + "}}"), + List.of( + mapExpectedOutput( + "IssuePostHearingDirection", + "Issue Post Hearing Direction", + "Hearing" + ) + ) + ), + Arguments.of( + "createReferral", + "Accepted", + mapAdditionalData("{\"Data\":{" + REFERRAL_ADMIN_JUDGMENT + "}}"), + List.of( + mapExpectedOutput( + "IssueJudgment", + "Issue Judgment", + "Hearing" + ) + ) + ), Arguments.of( "createReferral", "Submitted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_JUDGE + "," - + REFERRAL_SUBJECT + "," - + ISURGENT_YES - + " }}]}" - + "}"), + mapAdditionalData("{\"Data\":{" + REFERRAL_JUDGE + "}}"), List.of( mapExpectedOutput( "ReviewReferralJudiciary", @@ -127,18 +146,22 @@ public static Stream scenarioProvider() { ) ) ), + Arguments.of( + "createReferral", + "Accepted", + mapAdditionalData("{\"Data\":{" + REFERRAL_JUDGE_RULE21 + "}}"), + List.of( + mapExpectedOutput( + "DraftAndSignJudgment", + "Draft And Sign Judgment", + "Judgment" + ) + ) + ), Arguments.of( "createReferral", "Submitted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_LEGALOFFICER + "," - + REFERRAL_SUBJECT + "," - + ISURGENT_YES - + " }}]}" - + "}"), + mapAdditionalData("{\"Data\":{" + REFERRAL_LEGALOFFICER + "}}"), List.of( mapExpectedOutput( "ReviewReferralLegalOps", @@ -147,6 +170,42 @@ public static Stream scenarioProvider() { ) ) ), + Arguments.of( + "replyToReferral", + "Submitted", + mapAdditionalData("{\"Data\":{" + REFERRAL_REPLY_ADMIN + "}}"), + List.of( + mapExpectedOutput( + "ReviewReferralResponseAdmin", + "Review Referral Response - (Referral Subject)", + "processing" + ) + ) + ), + Arguments.of( + "replyToReferral", + "Submitted", + mapAdditionalData("{\"Data\":{" + REFERRAL_REPLY_JUDGE + "}}"), + List.of( + mapExpectedOutput( + "ReviewReferralResponseJudiciary", + "Review Referral Response - Rule 21", + "processing" + ) + ) + ), + Arguments.of( + "replyToReferral", + "Accepted", + mapAdditionalData("{\"Data\":{" + REFERRAL_REPLY_LEGALOFFICER + "}}"), + List.of( + mapExpectedOutput( + "ReviewReferralResponseLegalOps", + "Review Referral Response - (Referral Subject)", + "processing" + ) + ) + ), Arguments.of( "et3Response", "Accepted", @@ -205,31 +264,6 @@ public static Stream scenarioProvider() { ) ) ), - Arguments.of( - "replyToReferral", - "Submitted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_ADMIN + "," - + REFERRAL_SUBJECT + "," - + ISURGENT_YES + "," - + " \"referralReplyCollection\":[{\n" - + " \"value\":{\n" - + DIRECTIONTO_ADMIN + "," - + ISURGENT_REPLY_YES - + " }}]" - + " }}]}" - + "}"), - List.of( - mapExpectedOutput( - "ReviewReferralResponseAdmin", - "Review Referral Response - (Referral Subject)", - "processing" - ) - ) - ), Arguments.of( "updateHearing", "Accepted", @@ -242,122 +276,10 @@ public static Stream scenarioProvider() { ) ) ), - Arguments.of( - "createReferral", - "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_JUDGE + "," - + REFERRAL_RULE21 + "," - + ISURGENT_YES - + " }}]}" - + "}"), - List.of( - mapExpectedOutput( - "DraftAndSignJudgment", - "Draft And Sign Judgment", - "Judgment" - ) - ) - ), - Arguments.of( - "createReferral", - null, - mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_ADMIN + "," - + REFERRAL_HEARINGS - + " }}]}" - + "}"), - List.of( - mapExpectedOutput( - "IssuePostHearingDirection", - "Issue Post Hearing Direction", - "Hearing" - ) - ) - ), - Arguments.of( - "replyToReferral", - "Submitted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_JUDGE + "," - + REFERRAL_RULE21 + "," - + ISURGENT_YES + "," - + " \"referralReplyCollection\":[{\n" - + " \"value\":{\n" - + DIRECTIONTO_JUDGE + "," - + ISURGENT_REPLY_YES - + " }}]" - + " }}]}" - + "}"), - List.of( - mapExpectedOutput( - "ReviewReferralResponseJudiciary", - "Review Referral Response - Rule 21", - "processing" - ) - ) - ), - Arguments.of( - "replyToReferral", - "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_LEGALOFFICER + "," - + REFERRAL_SUBJECT + "," - + ISURGENT_YES + "," - + " \"referralReplyCollection\":[{\n" - + " \"value\":{\n" - + DIRECTIONTO_LEGALOFFICER + "," - + ISURGENT_REPLY_YES - + " }}]" - + " }}]}" - + "}"), - List.of( - mapExpectedOutput( - "ReviewReferralResponseLegalOps", - "Review Referral Response - (Referral Subject)", - "processing" - ) - ) - ), - Arguments.of( - "createReferral", - "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + " \"referralCollection\":[{\n" - + " \"value\":{\n" - + REFERCASETO_ADMIN + "," - + REFERRAL_JUDGMENT - + " }}]}" - + "}"), - List.of( - mapExpectedOutput( - "IssueJudgment", - "Issue Judgment", - "Hearing" - ) - ) - ), Arguments.of( "et3Vetting", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + RULE26_YES - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + RULE26_YES + "}}"), List.of( mapExpectedOutput( "CompleteInitialConsideration", @@ -374,11 +296,7 @@ public static Stream scenarioProvider() { Arguments.of( "SUBMIT_CLAIMANT_TSE", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + SUBMISSION_REASON_CLAIMANT_AMEND - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + SUBMISSION_REASON_CLAIMANT_AMEND + "}}"), List.of( mapExpectedOutput( "ContactTribunalWithAnApplication", @@ -390,11 +308,7 @@ public static Stream scenarioProvider() { Arguments.of( "CLAIMANT_TSE_RESPOND", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + CLAIMANT_RESPONDING_TO_RESPONDENT_AMEND - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + CLAIMANT_RESPONDING_TO_RESPONDENT_AMEND + "}}"), List.of( mapExpectedOutput( "ContactTribunalWithAnApplication", @@ -406,11 +320,7 @@ public static Stream scenarioProvider() { Arguments.of( "respondentTSE", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + SUBMISSION_REASON_RESPONDENT_AMEND - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + SUBMISSION_REASON_RESPONDENT_AMEND + "}}"), List.of( mapExpectedOutput( "ContactTribunalWithAnApplication", @@ -422,11 +332,7 @@ public static Stream scenarioProvider() { Arguments.of( "tseRespond", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + RESPONDENT_RESPONDING_TO_CLAIMANT_AMEND - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + RESPONDENT_RESPONDING_TO_CLAIMANT_AMEND + "}}"), List.of( mapExpectedOutput( "ContactTribunalWithAnApplication", @@ -438,11 +344,7 @@ public static Stream scenarioProvider() { Arguments.of( "SUBMIT_CLAIMANT_TSE", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + SUBMISSION_REASON_CLAIMANT_PERSONALDETAILS - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + SUBMISSION_REASON_CLAIMANT_PERSONALDETAILS + "}}"), List.of( mapExpectedOutput( "AmendPartyDetails", @@ -454,11 +356,7 @@ public static Stream scenarioProvider() { Arguments.of( "CLAIMANT_TSE_RESPOND", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + CLAIMANT_RESPONDING_TO_RESPONDENT_PERSONALDETAILS - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + CLAIMANT_RESPONDING_TO_RESPONDENT_PERSONALDETAILS + "}}"), List.of( mapExpectedOutput( "AmendPartyDetails", @@ -470,11 +368,7 @@ public static Stream scenarioProvider() { Arguments.of( "respondentTSE", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + SUBMISSION_REASON_RESPONDENT_PERSONALDETAILS - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + SUBMISSION_REASON_RESPONDENT_PERSONALDETAILS + "}}"), List.of( mapExpectedOutput( "AmendPartyDetails", @@ -486,11 +380,7 @@ public static Stream scenarioProvider() { Arguments.of( "tseRespond", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + RESPONDENT_RESPONDING_TO_CLAIMANT_PERSONALDETAILS - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + RESPONDENT_RESPONDING_TO_CLAIMANT_PERSONALDETAILS + "}}"), List.of( mapExpectedOutput( "AmendPartyDetails", @@ -502,11 +392,7 @@ public static Stream scenarioProvider() { Arguments.of( "SUBMIT_CLAIMANT_TSE", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + CLAIMANT_WITHDRAW_ALL_OR_PART_OF_CASE - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + CLAIMANT_WITHDRAW_ALL_OR_PART_OF_CASE + "}}"), List.of( mapExpectedOutput( "WithdrawAllOrPartOfCase", @@ -558,6 +444,25 @@ private static String createApplications(String appliciationType, String respond return String.format(APPLICATION_COLLECTION, appliciationType, respondCollection); } + private static String createReferrals( + String referralSubject, + String referralReferCaseTo, + String referralUrgency, + String referralDirectionTo, + String referralReplyUrgency) { + + String replyCollection = ""; + if (referralDirectionTo != "") { + replyCollection = String.format(REFERRALREPLY_COLLECTION, referralDirectionTo, referralReplyUrgency); + } + + return String.format(REFERRAL_COLLECTION, + referralSubject, + referralReferCaseTo, + referralUrgency, + replyCollection); + } + private static Map mapAdditionalData(String additionalData) { ObjectMapper mapper = new ObjectMapper(); try { From 6b9ab17580a3b4d28679391550cf079b9a44ed4f Mon Sep 17 00:00:00 2001 From: "fergus.oshea" Date: Tue, 1 Aug 2023 09:33:19 +0100 Subject: [PATCH 7/8] RET-2347: Reconfigure --- .../wa-task-configuration-employment-et_englandwales.dmn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn b/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn index 3a8a07b9..62e3f627 100644 --- a/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn +++ b/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn @@ -676,7 +676,7 @@ then 1000 else 5000 - + true @@ -754,7 +754,7 @@ then 100 else 500 - + true @@ -1044,4 +1044,4 @@ else 2 - \ No newline at end of file + From a6637e38f326dc7ebeee82dc310a4b24c2bccf09 Mon Sep 17 00:00:00 2001 From: "fergus.oshea" Date: Tue, 1 Aug 2023 10:13:44 +0100 Subject: [PATCH 8/8] RET-2347: CheckStyle --- .../taskconfiguration/dmn/EmploymentTaskInitiationTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java index 4d19c8f9..281db184 100644 --- a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java +++ b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java @@ -55,7 +55,9 @@ class EmploymentTaskInitiationTest extends DmnDecisionTableBaseUnitTest { createApplications("Strike out all/part of response", "Claimant"); public static final String REFERRAL_COLLECTION = - "\"referralCollection\":[{\"value\": {\"referralSubject\": \"%s\",\"referCaseTo\": \"%s\",\"isUrgent\": \"%s\"%s}}]"; + "\"referralCollection\":[{\"value\": " + + "{\"referralSubject\": \"%s\",\"referCaseTo\": \"%s\",\"isUrgent\": \"%s\"%s}" + + "}]"; public static final String REFERRALREPLY_COLLECTION = ",\"referralReplyCollection\": [{\"value\": {\"directionTo\": \"%s\",\"isUrgentReply\": \"%s\"}}]";