From 66430e584db716e0affba9b6b828a08c0f8c9a4e Mon Sep 17 00:00:00 2001 From: Deepthi Doppalapudi <107422736+deepthidoppalapudihmcts@users.noreply.github.com> Date: Tue, 12 Nov 2024 19:07:35 +0000 Subject: [PATCH] CIV-15702 Made Progressable tasks to Inactive (#5792) Co-authored-by: neeta-hmcts <115545612+neeta-hmcts@users.noreply.github.com> Co-authored-by: CourtneySuhr-Solirius Co-authored-by: sankhajuria --- .../ClaimSettledDashboardNotificationHandler.java | 15 +++++++++++++++ ...tledDefendantDashboardNotificationHandler.java | 15 +++++++++++++++ ...imSettledDashboardNotificationHandlerTest.java | 9 +++++++++ ...DefendantDashboardNotificationHandlerTest.java | 9 +++++++++ 4 files changed, 48 insertions(+) diff --git a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/dashboardnotifications/claimant/ClaimSettledDashboardNotificationHandler.java b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/dashboardnotifications/claimant/ClaimSettledDashboardNotificationHandler.java index 54839eb0073..5eef409149b 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/dashboardnotifications/claimant/ClaimSettledDashboardNotificationHandler.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/dashboardnotifications/claimant/ClaimSettledDashboardNotificationHandler.java @@ -45,4 +45,19 @@ public List handledEvents() { public String getScenario(CaseData caseData) { return SCENARIO_AAA6_CLAIMANT_INTENT_CLAIM_SETTLED_EVENT_CLAIMANT.getScenario(); } + + @Override + protected void beforeRecordScenario(CaseData caseData, String authToken) { + dashboardApiClient.deleteNotificationsForCaseIdentifierAndRole( + caseData.getCcdCaseReference().toString(), + "CLAIMANT", + authToken + ); + + dashboardApiClient.makeProgressAbleTasksInactiveForCaseIdentifierAndRole( + caseData.getCcdCaseReference().toString(), + "CLAIMANT", + authToken + ); + } } diff --git a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/dashboardnotifications/defendant/ClaimSettledDefendantDashboardNotificationHandler.java b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/dashboardnotifications/defendant/ClaimSettledDefendantDashboardNotificationHandler.java index ac24cf1bfdb..16ca6481bc0 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/dashboardnotifications/defendant/ClaimSettledDefendantDashboardNotificationHandler.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/dashboardnotifications/defendant/ClaimSettledDefendantDashboardNotificationHandler.java @@ -41,4 +41,19 @@ public List handledEvents() { public String getScenario(CaseData caseData) { return SCENARIO_AAA6_CLAIMANT_INTENT_CLAIM_SETTLE_EVENT_DEFENDANT.getScenario(); } + + @Override + protected void beforeRecordScenario(CaseData caseData, String authToken) { + dashboardApiClient.deleteNotificationsForCaseIdentifierAndRole( + caseData.getCcdCaseReference().toString(), + "DEFENDANT", + authToken + ); + + dashboardApiClient.makeProgressAbleTasksInactiveForCaseIdentifierAndRole( + caseData.getCcdCaseReference().toString(), + "DEFENDANT", + authToken + ); + } } diff --git a/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/dashboardnotifications/claimant/ClaimSettledDashboardNotificationHandlerTest.java b/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/dashboardnotifications/claimant/ClaimSettledDashboardNotificationHandlerTest.java index fe9f3d22ae2..d278782b278 100644 --- a/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/dashboardnotifications/claimant/ClaimSettledDashboardNotificationHandlerTest.java +++ b/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/dashboardnotifications/claimant/ClaimSettledDashboardNotificationHandlerTest.java @@ -83,6 +83,15 @@ void shouldRecordScenario_whenInvoked() { ).build(); handler.handle(params); + verify(dashboardApiClient).deleteNotificationsForCaseIdentifierAndRole( + caseData.getCcdCaseReference().toString(), + "CLAIMANT", + "BEARER_TOKEN"); + verify(dashboardApiClient).makeProgressAbleTasksInactiveForCaseIdentifierAndRole( + caseData.getCcdCaseReference().toString(), + "CLAIMANT", + "BEARER_TOKEN"); + verify(dashboardApiClient).recordScenario( caseData.getCcdCaseReference().toString(), "Scenario.AAA6.ClaimantIntent.ClaimSettledEvent.Claimant", diff --git a/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/dashboardnotifications/defendant/ClaimSettledDefendantDashboardNotificationHandlerTest.java b/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/dashboardnotifications/defendant/ClaimSettledDefendantDashboardNotificationHandlerTest.java index f7259454c3c..a20a7103512 100644 --- a/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/dashboardnotifications/defendant/ClaimSettledDefendantDashboardNotificationHandlerTest.java +++ b/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/dashboardnotifications/defendant/ClaimSettledDefendantDashboardNotificationHandlerTest.java @@ -87,6 +87,15 @@ void shouldRecordScenario_whenInvoked() { ).build(); handler.handle(params); + verify(dashboardApiClient).deleteNotificationsForCaseIdentifierAndRole( + caseData.getCcdCaseReference().toString(), + "DEFENDANT", + "BEARER_TOKEN"); + verify(dashboardApiClient).makeProgressAbleTasksInactiveForCaseIdentifierAndRole( + caseData.getCcdCaseReference().toString(), + "DEFENDANT", + "BEARER_TOKEN"); + verify(dashboardApiClient).recordScenario( caseData.getCcdCaseReference().toString(), SCENARIO_AAA6_CLAIMANT_INTENT_CLAIM_SETTLE_EVENT_DEFENDANT.getScenario(),