Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIV-16440 add application to master collection once hwf is made #1659

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,10 @@ private boolean isLipPaymentViaHelpWithFees(CaseData data) {
return data.getCcdState().equals(AWAITING_APPLICATION_PAYMENT)
&& !Objects.isNull(data.getGeneralAppHelpWithFees())
&& data.getGeneralAppHelpWithFees().getHelpWithFee() == YesOrNo.YES
&& !Objects.isNull(data.getFeePaymentOutcomeDetails())
&& (Objects.nonNull(data.getGeneralAppPBADetails().getPaymentDetails())
|| (!Objects.isNull(data.getFeePaymentOutcomeDetails())
&& (data.getFeePaymentOutcomeDetails().getHwfFullRemissionGrantedForGa() == YesOrNo.YES
|| (!Objects.isNull(data.getFeePaymentOutcomeDetails().getHwfOutstandingFeePaymentDoneForGa())
&& data.getFeePaymentOutcomeDetails().getHwfOutstandingFeePaymentDoneForGa().contains("Yes")));
|| (!Objects.isNull(data.getFeePaymentOutcomeDetails().getHwfOutstandingFeePaymentDoneForGa())
&& data.getFeePaymentOutcomeDetails().getHwfOutstandingFeePaymentDoneForGa().contains("Yes")))));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@
import uk.gov.hmcts.reform.civil.callback.CallbackParams;
import uk.gov.hmcts.reform.civil.callback.CaseEvent;
import uk.gov.hmcts.reform.civil.client.DashboardApiClient;
import uk.gov.hmcts.reform.civil.enums.YesOrNo;
import uk.gov.hmcts.reform.civil.model.CaseData;
import uk.gov.hmcts.reform.civil.service.DashboardNotificationsParamsMapper;
import uk.gov.hmcts.reform.civil.service.GaForLipService;
import uk.gov.hmcts.reform.civil.service.ParentCaseUpdateHelper;
import uk.gov.hmcts.reform.civil.utils.HwFFeeTypeService;
import uk.gov.hmcts.reform.dashboard.data.ScenarioRequestParams;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

import static uk.gov.hmcts.reform.civil.callback.CallbackParams.Params.BEARER_TOKEN;
import static uk.gov.hmcts.reform.civil.callback.CallbackType.ABOUT_TO_SUBMIT;
Expand All @@ -30,6 +34,8 @@ public class ApplyForHwFDashboardNotificationHandler extends CallbackHandler {
private final ObjectMapper objectMapper;
private final DashboardApiClient dashboardApiClient;
protected final DashboardNotificationsParamsMapper mapper;
private final GaForLipService gaForLipService;
private final ParentCaseUpdateHelper parentCaseUpdateHelper;

@Override
protected Map<String, Callback> callbacks() {
Expand All @@ -43,6 +49,13 @@ private CallbackResponse updateHWFDetailsAndSendNotification(CallbackParams call
CaseData.CaseDataBuilder caseDataBuilder = HwFFeeTypeService.updateHwfDetails(caseData);
String authToken = callbackParams.getParams().get(BEARER_TOKEN).toString();
HashMap<String, Object> paramsMap = mapper.mapCaseDataToParams(caseData);
if ((caseData.getGeneralAppPBADetails().getPaymentDetails() == null
|| caseData.getGeneralAppPBADetails().getAdditionalPaymentDetails() == null)
&& gaForLipService.isGaForLip(caseData) && Objects.nonNull(caseData.getGeneralAppHelpWithFees())
&& caseData.getGeneralAppHelpWithFees().getHelpWithFee().equals(YesOrNo.YES)) {
parentCaseUpdateHelper.updateMasterCollectionForHwf(caseData);
}

dashboardApiClient.recordScenario(caseData.getCcdCaseReference().toString(),
DashboardScenarios.SCENARIO_AAA6_GENERAL_APPS_HWF_REQUESTED_APPLICANT.getScenario(),
authToken,
Expand Down
Loading