From 5783ea5bc570eaf6ed1de6b98168bfbfb18109bb Mon Sep 17 00:00:00 2001 From: hmcts-version1-domini <107860057+hmcts-version1-domini@users.noreply.github.com> Date: Wed, 31 Jan 2024 17:46:43 +0100 Subject: [PATCH] Modify mediation handler to unblock the process (#3915) Co-authored-by: kdaHMCTS <128375235+kdaHMCTS@users.noreply.github.com> --- ...edMediationRespondentNotificationHandler.java | 13 ++++++++----- .../tasks/GenerateCsvAndTransferTaskHandler.java | 4 ++-- .../service/mediation/MediationCSVService.java | 16 ++++++++-------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/notification/ClaimantDefendantAgreedMediationRespondentNotificationHandler.java b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/notification/ClaimantDefendantAgreedMediationRespondentNotificationHandler.java index 0fce6c75e92..403f650a123 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/notification/ClaimantDefendantAgreedMediationRespondentNotificationHandler.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/notification/ClaimantDefendantAgreedMediationRespondentNotificationHandler.java @@ -46,11 +46,14 @@ public String camundaActivityId(CallbackParams callbackParams) { private CallbackResponse notifyDefendantMediationAgreement(CallbackParams callbackParams) { CaseData caseData = callbackParams.getCaseData(); - notificationService.sendMail( - addEmail(caseData), - addTemplate(caseData), - addProperties(caseData), - String.format(REFERENCE_TEMPLATE, caseData.getLegacyCaseReference())); + if (caseData.getRespondent1().getPartyEmail() != null || caseData.getRespondentSolicitor1EmailAddress() != null) { + notificationService.sendMail( + addEmail(caseData), + addTemplate(caseData), + addProperties(caseData), + String.format(REFERENCE_TEMPLATE, caseData.getLegacyCaseReference()) + ); + } return AboutToStartOrSubmitCallbackResponse.builder().build(); diff --git a/src/main/java/uk/gov/hmcts/reform/civil/handler/tasks/GenerateCsvAndTransferTaskHandler.java b/src/main/java/uk/gov/hmcts/reform/civil/handler/tasks/GenerateCsvAndTransferTaskHandler.java index 2ef6236a61c..e0357a93564 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/handler/tasks/GenerateCsvAndTransferTaskHandler.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/handler/tasks/GenerateCsvAndTransferTaskHandler.java @@ -52,8 +52,8 @@ public void handleTask(ExternalTask externalTask) { .map(caseDetailsConverter::toCaseData) .toList(); log.info("Job '{}' found {} case(s)", externalTask.getTopicName(), inMediationCases.size()); - String[] headers = {"SITE_ID", "CASE_NUMBER", "CASE_TYPE", "AMOUNT", "PARTY_TYPE", "COMPANY_NAME", - "CONTACT_NAME", "CONTACT_NUMBER", "CHECK_LIST", "PARTY_STATUS", "CONTACT_EMAIL", "PILOT"}; + String[] headers = {"SITE_ID", "CASE_TYPE", "CHECK_LIST", "PARTY_STATUS", "CASE_NUMBER", "AMOUNT", "PARTY_TYPE", + "COMPANY_NAME", "CONTACT_NAME", "CONTACT_NUMBER", "CONTACT_EMAIL", "PILOT"}; StringBuilder csvColContent = new StringBuilder(); try { if (!inMediationCases.isEmpty()) { diff --git a/src/main/java/uk/gov/hmcts/reform/civil/service/mediation/MediationCSVService.java b/src/main/java/uk/gov/hmcts/reform/civil/service/mediation/MediationCSVService.java index b1ee02a108e..b4072a01e11 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/service/mediation/MediationCSVService.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/service/mediation/MediationCSVService.java @@ -25,18 +25,18 @@ private String getCSVContent(MediationParams params) { DefendantContactDetails defendantContactDetails = getDefendantContactDetails(); String totalClaimAmount = data.getTotalClaimAmount().toString(); String[] claimantData = { - SITE_ID, data.getLegacyCaseReference(), CASE_TYPE, totalClaimAmount, - CLAIMANT, getCsvCompanyName(data.getApplicant1()), - applicantContactDetails.getApplicantContactName(params), applicantContactDetails.getApplicantContactNumber(params), - CHECK_LIST, PARTY_STATUS, applicantContactDetails.getApplicantContactEmail(params), + SITE_ID, CASE_TYPE, CHECK_LIST, PARTY_STATUS, data.getLegacyCaseReference(), totalClaimAmount, CLAIMANT, + getCsvCompanyName(data.getApplicant1()), applicantContactDetails.getApplicantContactName(params), + applicantContactDetails.getApplicantContactNumber(params), + applicantContactDetails.getApplicantContactEmail(params), isPilot(data.getTotalClaimAmount()) }; String[] respondentData = { - SITE_ID, data.getLegacyCaseReference(), CASE_TYPE, totalClaimAmount, - RESPONDENT, getCsvCompanyName(data.getRespondent1()), - defendantContactDetails.getDefendantContactName(params), defendantContactDetails.getDefendantContactNumber(params), - CHECK_LIST, PARTY_STATUS, defendantContactDetails.getDefendantContactEmail(params), + SITE_ID, CASE_TYPE, CHECK_LIST, PARTY_STATUS, data.getLegacyCaseReference(), totalClaimAmount, RESPONDENT, + getCsvCompanyName(data.getRespondent1()), defendantContactDetails.getDefendantContactName(params), + defendantContactDetails.getDefendantContactNumber(params), + defendantContactDetails.getDefendantContactEmail(params), isPilot(data.getTotalClaimAmount()) };