From 371129ee51c7925395fba264c77e966dcd59b4bb Mon Sep 17 00:00:00 2001 From: karthick mohanasundaram <92928238+karthick-mohanasundaram-HMCTS@users.noreply.github.com> Date: Tue, 22 Oct 2024 10:50:11 +0100 Subject: [PATCH] CIV-15536 refactor hwf more info template id --- .../camunda/notification/NotificationData.java | 1 + .../civil/service/HwfNotificationService.java | 15 +++++++++------ src/main/resources/application.yaml | 2 +- .../civil/service/HwfNotificationServiceTest.java | 9 +++++++-- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/notification/NotificationData.java b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/notification/NotificationData.java index c43b1a3e7..f27a155e0 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/notification/NotificationData.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/notification/NotificationData.java @@ -26,6 +26,7 @@ public interface NotificationData { String TYPE_OF_FEE = "typeOfFee"; String TYPE_OF_FEE_WELSH = "typeOfFeeWelsh"; String HWF_MORE_INFO_DATE = "date"; + String HWF_MORE_INFO_DATE_IN_WELSH = "dateInWelsh"; String HWF_MORE_INFO_DOCUMENTS = "documents"; String HWF_MORE_INFO_DOCUMENTS_WELSH = "documentsWelsh"; String PART_AMOUNT = "partAmount"; diff --git a/src/main/java/uk/gov/hmcts/reform/civil/service/HwfNotificationService.java b/src/main/java/uk/gov/hmcts/reform/civil/service/HwfNotificationService.java index c06898440..f36cf6463 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/service/HwfNotificationService.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/service/HwfNotificationService.java @@ -1,5 +1,7 @@ package uk.gov.hmcts.reform.civil.service; +import static uk.gov.hmcts.reform.civil.helpers.DateFormatHelper.DATE; +import static uk.gov.hmcts.reform.civil.helpers.DateFormatHelper.formatLocalDate; import static uk.gov.hmcts.reform.civil.utils.DateUtils.formatDateInWelsh; import uk.gov.hmcts.reform.civil.callback.CaseEvent; @@ -195,12 +197,13 @@ private Map getMoreInformationProperties(CaseData caseData) { ? caseData.getHelpWithFeesMoreInformationGa() : caseData.getHelpWithFeesMoreInformationAdditional(); return Map.of( - HWF_MORE_INFO_DATE, formatDateInWelsh(moreInformation.getHwFMoreInfoDocumentDate()), - HWF_MORE_INFO_DOCUMENTS, getMoreInformationDocumentList( - moreInformation.getHwFMoreInfoRequiredDocuments() - ), - HWF_MORE_INFO_DOCUMENTS_WELSH, getMoreInformationDocumentListWelsh( - moreInformation.getHwFMoreInfoRequiredDocuments()) + HWF_MORE_INFO_DATE, formatLocalDate(moreInformation.getHwFMoreInfoDocumentDate(), DATE), + HWF_MORE_INFO_DATE_IN_WELSH, formatDateInWelsh(moreInformation.getHwFMoreInfoDocumentDate()), + HWF_MORE_INFO_DOCUMENTS, getMoreInformationDocumentList( + moreInformation.getHwFMoreInfoRequiredDocuments() + ), + HWF_MORE_INFO_DOCUMENTS_WELSH, getMoreInformationDocumentListWelsh( + moreInformation.getHwFMoreInfoRequiredDocuments()) ); } diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index a423a8090..55ae9f228 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -169,7 +169,7 @@ notifications: notifyApplicantForNoRemission: "3008a18a-07ec-445b-a226-62ffa19132ce" notifyApplicantForHwfPaymentOutcome: "64c4047f-3256-45ff-9b4e-9a11bccf14fe" notifyApplicantForHwfInvalidRefNumberBilingual: "8950e206-6d15-4575-9d99-734908389fa7" - notifyApplicantForHwFMoreInformationNeededWelsh: "65b3524b-b58c-4cdb-b8b5-5fc2cec505a5" + notifyApplicantForHwFMoreInformationNeededWelsh: "70267e5b-9f11-4549-bc59-56bf7fbdeca7" notifyApplicantForHwfNoRemissionWelsh: "f9d2f0db-2ae4-4691-8076-bfbb82548846" notifyApplicantForHwfUpdateRefNumberBilingual: "a7c206b5-8a27-4419-83ff-61351cbc69fb" notifyApplicantForHwfPartialRemissionBilingual: "5bbd4518-5501-4737-8a1e-a6adacd5e679" diff --git a/src/test/java/uk/gov/hmcts/reform/civil/service/HwfNotificationServiceTest.java b/src/test/java/uk/gov/hmcts/reform/civil/service/HwfNotificationServiceTest.java index 6fabdafa8..791a3cfa7 100644 --- a/src/test/java/uk/gov/hmcts/reform/civil/service/HwfNotificationServiceTest.java +++ b/src/test/java/uk/gov/hmcts/reform/civil/service/HwfNotificationServiceTest.java @@ -18,6 +18,7 @@ import static uk.gov.hmcts.reform.civil.handler.callback.camunda.notification.NotificationData.CLAIMANT_NAME; import static uk.gov.hmcts.reform.civil.handler.callback.camunda.notification.NotificationData.FEE_AMOUNT; import static uk.gov.hmcts.reform.civil.handler.callback.camunda.notification.NotificationData.HWF_MORE_INFO_DATE; +import static uk.gov.hmcts.reform.civil.handler.callback.camunda.notification.NotificationData.HWF_MORE_INFO_DATE_IN_WELSH; import static uk.gov.hmcts.reform.civil.handler.callback.camunda.notification.NotificationData.HWF_MORE_INFO_DOCUMENTS; import static uk.gov.hmcts.reform.civil.handler.callback.camunda.notification.NotificationData.HWF_MORE_INFO_DOCUMENTS_WELSH; import static uk.gov.hmcts.reform.civil.handler.callback.camunda.notification.NotificationData.HWF_REFERENCE_NUMBER; @@ -27,6 +28,8 @@ import static uk.gov.hmcts.reform.civil.handler.callback.camunda.notification.NotificationData.REMAINING_AMOUNT; import static uk.gov.hmcts.reform.civil.handler.callback.camunda.notification.NotificationData.TYPE_OF_FEE; import static uk.gov.hmcts.reform.civil.handler.callback.camunda.notification.NotificationData.TYPE_OF_FEE_WELSH; +import static uk.gov.hmcts.reform.civil.helpers.DateFormatHelper.DATE; +import static uk.gov.hmcts.reform.civil.helpers.DateFormatHelper.formatLocalDate; import static uk.gov.hmcts.reform.civil.utils.DateUtils.formatDateInWelsh; import uk.gov.hmcts.reform.ccd.client.model.CaseDetails; @@ -291,7 +294,8 @@ private List getMoreInformationDocumentList() { private Map getNotificationDataMapMoreInfoGa() { return Map.of( - HWF_MORE_INFO_DATE, formatDateInWelsh(NOW), + HWF_MORE_INFO_DATE, formatLocalDate(NOW, DATE), + HWF_MORE_INFO_DATE_IN_WELSH, formatDateInWelsh(NOW), CLAIMANT_NAME, APPLICANT, CASE_REFERENCE, GA_REFERENCE, TYPE_OF_FEE, FeeType.APPLICATION.getLabel(), @@ -304,7 +308,8 @@ HWF_MORE_INFO_DOCUMENTS_WELSH, getMoreInformationDocumentListStringWelsh(), private Map getNotificationDataMapMoreInfoAdditional() { return Map.of( - HWF_MORE_INFO_DATE, formatDateInWelsh(NOW), + HWF_MORE_INFO_DATE, formatLocalDate(NOW, DATE), + HWF_MORE_INFO_DATE_IN_WELSH, formatDateInWelsh(NOW), CLAIMANT_NAME, APPLICANT, CASE_REFERENCE, GA_REFERENCE, TYPE_OF_FEE, FeeType.ADDITIONAL.getLabel(),