From b34a9fe251d9193c054fe6bcfe04e7e2bc46edb0 Mon Sep 17 00:00:00 2001 From: Deepthi Doppalapudi <107422736+deepthidoppalapudihmcts@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:05:24 +0000 Subject: [PATCH] CIV-15500 HWF application type of fee not showing correctly in dashboard notification (#1574) * CIV-15500 modified condition for application fee and additional application fee * CIV-15858 application feeType * CIV-15500 corrected unit tests after resolving conflicts --- .../service/DashboardNotificationsParamsMapper.java | 12 ++++++------ .../DashboardNotificationsParamsMapperTest.java | 13 +++++++++++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/main/java/uk/gov/hmcts/reform/civil/service/DashboardNotificationsParamsMapper.java b/src/main/java/uk/gov/hmcts/reform/civil/service/DashboardNotificationsParamsMapper.java index fa81d0dbc..78e4208b8 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/service/DashboardNotificationsParamsMapper.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/service/DashboardNotificationsParamsMapper.java @@ -79,16 +79,16 @@ public HashMap mapCaseDataToParams(CaseData caseData) { DateUtils.formatDateInWelsh(caseData.getJudicialDecisionRequestMoreInfo().getJudgeRequestMoreInfoByDate())); } - if (caseData.getHwfFeeType() != null) { - if (FeeType.ADDITIONAL == caseData.getHwfFeeType()) { - params.put("applicationFeeTypeEn", "additional application"); - params.put("applicationFeeTypeCy", "cais ychwanegol"); - } else if (FeeType.APPLICATION == caseData.getHwfFeeType() - || caseData.getCcdState().equals(CaseState.AWAITING_APPLICATION_PAYMENT)) { + if (Objects.nonNull(caseData.getGeneralAppHelpWithFees())) { + if (caseData.getCcdState().equals(CaseState.AWAITING_APPLICATION_PAYMENT)) { params.put("applicationFeeTypeEn", "application"); params.put("applicationFeeTypeCy", "cais"); + } else if (caseData.getCcdState().equals(CaseState.APPLICATION_ADD_PAYMENT)) { + params.put("applicationFeeTypeEn", "additional application"); + params.put("applicationFeeTypeCy", "cais ychwanegol"); } } + if (Objects.nonNull(caseData.getJudicialDecisionMakeAnOrderForWrittenRepresentations())) { LocalDate applicantDeadlineDate; LocalDate respondentDeadlineDate; diff --git a/src/test/java/uk/gov/hmcts/reform/civil/service/DashboardNotificationsParamsMapperTest.java b/src/test/java/uk/gov/hmcts/reform/civil/service/DashboardNotificationsParamsMapperTest.java index 7b7951ccd..b9b77fe1a 100644 --- a/src/test/java/uk/gov/hmcts/reform/civil/service/DashboardNotificationsParamsMapperTest.java +++ b/src/test/java/uk/gov/hmcts/reform/civil/service/DashboardNotificationsParamsMapperTest.java @@ -16,6 +16,7 @@ import uk.gov.hmcts.reform.civil.model.BusinessProcess; import uk.gov.hmcts.reform.civil.model.CaseData; import uk.gov.hmcts.reform.civil.model.Fee; +import uk.gov.hmcts.reform.civil.model.citizenui.HelpWithFees; import uk.gov.hmcts.reform.civil.model.genapplication.GAApplicationType; import uk.gov.hmcts.reform.civil.model.genapplication.GAJudicialRequestMoreInfo; import uk.gov.hmcts.reform.civil.model.genapplication.GAJudicialWrittenRepresentations; @@ -157,6 +158,7 @@ void shouldMapParametersWhenHwfApplicationFeeIsRequested() { .legacyCaseReference("000DC001") .businessProcess(BusinessProcess.builder().status(BusinessProcessStatus.READY).build()) .generalAppSuperClaimType("SPEC_CLAIM") + .generalAppHelpWithFees(HelpWithFees.builder().helpWithFee(YesOrNo.YES).helpWithFeesReferenceNumber("HWF-A1B-23C").build()) .hwfFeeType(FeeType.APPLICATION) .build(); @@ -175,6 +177,7 @@ void shouldMapParametersWhenHwfApplicationFeeIsRequestedAndMoreInfoRequired() { .businessProcess(BusinessProcess.builder().status(BusinessProcessStatus.READY).build()) .generalAppSuperClaimType("SPEC_CLAIM") .hwfFeeType(FeeType.APPLICATION) + .generalAppHelpWithFees(HelpWithFees.builder().helpWithFee(YesOrNo.YES).helpWithFeesReferenceNumber("HWF-A1B-23C").build()) .gaHwfDetails(HelpWithFeesDetails.builder().hwfCaseEvent(CaseEvent.MORE_INFORMATION_HWF_GA) .remissionAmount(BigDecimal.valueOf(7500)) .outstandingFeeInPounds(new BigDecimal(200.00)).build()) @@ -190,11 +193,12 @@ void shouldMapParametersWhenHwfApplicationFeeIsRequestedAndMoreInfoRequired() { void shouldMapParametersWhenHwfAdditionalApplicationFeeIsRequestedAndMoreInfoRequired() { caseData = CaseDataBuilder.builder().build().toBuilder() .ccdCaseReference(1644495739087775L) - .ccdState(AWAITING_APPLICATION_PAYMENT) + .ccdState(APPLICATION_ADD_PAYMENT) .legacyCaseReference("000DC001") .businessProcess(BusinessProcess.builder().status(BusinessProcessStatus.READY).build()) .generalAppSuperClaimType("SPEC_CLAIM") .hwfFeeType(FeeType.ADDITIONAL) + .generalAppHelpWithFees(HelpWithFees.builder().helpWithFee(YesOrNo.YES).helpWithFeesReferenceNumber("HWF-A1B-23C").build()) .additionalHwfDetails(HelpWithFeesDetails.builder() .hwfCaseEvent(CaseEvent.MORE_INFORMATION_HWF_GA) .remissionAmount(BigDecimal.valueOf(7500)) @@ -216,6 +220,7 @@ void shouldMapParametersWhenHwfApplicationFeeIsRequestedAndIsPartAdmitted_PartRe .businessProcess(BusinessProcess.builder().status(BusinessProcessStatus.READY).build()) .generalAppSuperClaimType("SPEC_CLAIM") .hwfFeeType(FeeType.APPLICATION) + .generalAppHelpWithFees(HelpWithFees.builder().helpWithFee(YesOrNo.YES).helpWithFeesReferenceNumber("HWF-A1B-23C").build()) .gaHwfDetails(HelpWithFeesDetails.builder().hwfCaseEvent(CaseEvent.PARTIAL_REMISSION_HWF_GA) .remissionAmount(BigDecimal.valueOf(7500)) .outstandingFeeInPounds(new BigDecimal(200.00)).build()) @@ -233,11 +238,12 @@ void shouldMapParametersWhenHwfApplicationFeeIsRequestedAndIsPartAdmitted_PartRe void shouldMapParametersWhenHwfAdditionalApplicationFeeIsRequestedAndIsPartAdmitted_PartRemission() { caseData = CaseDataBuilder.builder().build().toBuilder() .ccdCaseReference(1644495739087775L) - .ccdState(AWAITING_APPLICATION_PAYMENT) + .ccdState(APPLICATION_ADD_PAYMENT) .legacyCaseReference("000DC001") .businessProcess(BusinessProcess.builder().status(BusinessProcessStatus.READY).build()) .generalAppSuperClaimType("SPEC_CLAIM") .hwfFeeType(FeeType.ADDITIONAL) + .generalAppHelpWithFees(HelpWithFees.builder().helpWithFee(YesOrNo.YES).helpWithFeesReferenceNumber("HWF-A1B-23C").build()) .additionalHwfDetails(HelpWithFeesDetails.builder() .hwfCaseEvent(CaseEvent.PARTIAL_REMISSION_HWF_GA).remissionAmount(BigDecimal.valueOf(7500)) .outstandingFeeInPounds(new BigDecimal(200.00)).build()) @@ -260,6 +266,7 @@ void shouldMapParametersWhenHwfApplicationFeeIsRequestedAndCaseStateIsAwaitingAp .generalAppSuperClaimType("SPEC_CLAIM") .generalAppType(GAApplicationType.builder().types(List.of(GeneralApplicationTypes.VARY_ORDER)) .build()) + .generalAppHelpWithFees(HelpWithFees.builder().helpWithFee(YesOrNo.YES).helpWithFeesReferenceNumber("HWF-A1B-23C").build()) .ccdState(CaseState.AWAITING_APPLICATION_PAYMENT) .hwfFeeType(FeeType.APPLICATION) .build(); @@ -277,6 +284,7 @@ void shouldMapParametersWhenHwfAdditionalApplicationFeeIsRequested() { .ccdState(APPLICATION_ADD_PAYMENT) .legacyCaseReference("000DC001") .businessProcess(BusinessProcess.builder().status(BusinessProcessStatus.READY).build()) + .generalAppHelpWithFees(HelpWithFees.builder().helpWithFee(YesOrNo.YES).helpWithFeesReferenceNumber("HWF-A1B-23C").build()) .generalAppSuperClaimType("SPEC_CLAIM") .hwfFeeType(FeeType.ADDITIONAL) .build(); @@ -296,6 +304,7 @@ void shouldMapParametersWhenHwfAdditionalApplicationFeeIsRequestedAndCaseStateIs .generalAppSuperClaimType("SPEC_CLAIM") .generalAppType(GAApplicationType.builder().types(List.of(GeneralApplicationTypes.VARY_ORDER)) .build()) + .generalAppHelpWithFees(HelpWithFees.builder().helpWithFee(YesOrNo.YES).helpWithFeesReferenceNumber("HWF-A1B-23C").build()) .ccdState(APPLICATION_ADD_PAYMENT) .hwfFeeType(FeeType.ADDITIONAL) .build();