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-12772 Application Fee - Claimant Notification #1394

Closed
wants to merge 62 commits into from
Closed
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
cf988e3
CIV-14008 changes
kalachandrasekar1 Jun 6, 2024
0ad38a3
Update GeneralApplication.java
kalachandrasekar1 Jun 6, 2024
61a8a30
Merge branch 'master' into feat/14008
kalachandrasekar1 Jun 6, 2024
e53ceb4
CIV-14140 Authorise caseworker to view general application
manish14836 Jun 11, 2024
8e3cbc7
CIV-14140 Authorise caseworker to view general application
manish14836 Jun 11, 2024
1693f08
CIV-14140 Authorise caseworker to view general application
manish14836 Jun 11, 2024
86bbfa8
CIV-14140 Authorise caseworker to view general application
manish14836 Jun 11, 2024
33faa83
CIV-14140 Authorise caseworker to view general application
manish14836 Jun 12, 2024
b675985
CIV-14140 Authorise caseworker to view general application
manish14836 Jun 12, 2024
15db313
CIV-12761 add hwffee type; move duplicated fields back to ga pba field
pliao-hmcts Jun 13, 2024
a57bcf7
CIV-12761 add case controller to get applications of given civil case id
pliao-hmcts Jun 13, 2024
8bb4e98
CIV-12761 NO_REMISSION_HWF
pliao-hmcts Jun 14, 2024
510c9e5
CIV-12761 NO_REMISSION_HWF
pliao-hmcts Jun 18, 2024
e829aca
CIV-12761 unit test fix
pliao-hmcts Jun 18, 2024
58f38a6
Merge branch 'master' into feat/CIV-12761
pliao-hmcts Jun 18, 2024
3fa0c17
CIV-12761 add unit test
pliao-hmcts Jun 18, 2024
4553d0e
CIV-12761 check style
pliao-hmcts Jun 18, 2024
e91edb3
CIV-12761 fix cui urgency in draft create
pliao-hmcts Jun 18, 2024
5ceb8f8
Merge branch 'master' into feat/CIV-12761
pliao-hmcts Jun 19, 2024
f942e27
CIV-12771 Application Fee - HwF Caseworker - More Information Required
pliao-hmcts Jun 19, 2024
5ca0d0b
Merge branch 'master' into feat/CIV-12761
jeswanth-hmcts Jun 19, 2024
53f88ff
CIV-12761 Application Fee - HwF Caseworker - More Information Required
pliao-hmcts Jun 20, 2024
afbdad5
Merge remote-tracking branch 'origin/feat/CIV-12761' into feat/CIV-12761
pliao-hmcts Jun 20, 2024
20424f6
Merge branch 'feat/CIV-12761' into feat/CIV-12771
pliao-hmcts Jun 20, 2024
eeb71a8
CIV-12761 clean code
pliao-hmcts Jun 20, 2024
146f3ea
Merge branch 'feat/CIV-12761' into feat/CIV-12771
pliao-hmcts Jun 20, 2024
95a36c6
CIV-12773 Application Fee - HwF Caseworker - Full remission HwF - gra…
pliao-hmcts Jun 20, 2024
2eaf223
Merge branch 'feat/CIV-12761' into feat/CIV-12771
pliao-hmcts Jun 20, 2024
27e2505
Merge branch 'feat/CIV-12771' into feat/CIV-12773
pliao-hmcts Jun 20, 2024
19ab1c0
Merge branch 'master' into feat/CIV-12761
manish14836 Jun 21, 2024
b79fcf0
CIV-12773 Application Fee - HwF Caseworker - Full remission HwF - gra…
pliao-hmcts Jun 21, 2024
4d21c82
CIV-12761 sonar
pliao-hmcts Jun 21, 2024
a11a58e
Merge branch 'feat/CIV-12761' into feat/CIV-12771
pliao-hmcts Jun 21, 2024
e998c3e
Merge branch 'feat/CIV-12771' into feat/CIV-12773
pliao-hmcts Jun 21, 2024
d172d69
CIV-12765 Application Fee - HwF Caseworker - Part Remission
pliao-hmcts Jun 25, 2024
a830afa
CIV-12765 Application Fee - HwF Caseworker - Part Remission
pliao-hmcts Jun 25, 2024
f610d72
Merge branch 'master' into feat/CIV-12765
pliao-hmcts Jun 26, 2024
dee671d
Merge branch 'master' into feat/CIV-12765
pliao-hmcts Jun 26, 2024
4ec12de
CIV-12765 reduce duplicated code
pliao-hmcts Jun 26, 2024
93a655b
CIV-12765 update RemissionAmount
pliao-hmcts Jun 27, 2024
20cc440
CIV-12765 update RemissionAmount
pliao-hmcts Jun 27, 2024
a8f38cd
Merge branch 'master' into feat/CIV-12765
pliao-hmcts Jun 27, 2024
974d2e6
Merge branch 'master' into feat/CIV-12765
pliao-hmcts Jul 2, 2024
b3cc476
CIV-12764 base code; refactor InvalidHwFCallbackHandler
pliao-hmcts Jul 2, 2024
ea7b1fc
CIV-12764 Application Fee - HwF Caseworker - Fee Payment Outcome handler
pliao-hmcts Jul 4, 2024
4e3c7ae
CIV-12764 trigger business Process
pliao-hmcts Jul 4, 2024
4bc357a
CIV-12764 allow after payment tasks run
pliao-hmcts Jul 5, 2024
d0c7fd8
CIV-12764 unit tests
pliao-hmcts Jul 9, 2024
b691348
CIV-12764 unit tests
pliao-hmcts Jul 9, 2024
a87733e
CIV-12764 unit tests
pliao-hmcts Jul 9, 2024
c1c9f8b
CIV-12772 add process for hwf notify
pliao-hmcts Jul 11, 2024
9c1f56a
Merge branch 'master' into feat/CIV-12764
pliao-hmcts Jul 11, 2024
adfb969
CIV-127764 add unit tests
pliao-hmcts Jul 11, 2024
9dd8821
Merge branch 'feat/CIV-12764' into feat/CIV-12772
pliao-hmcts Jul 11, 2024
ddf5a3b
Merge branch 'master' into feat/CIV-12772
pliao-hmcts Jul 12, 2024
c37a5ec
CIV-12772 hwf events notification handler and service
pliao-hmcts Jul 15, 2024
8668ef3
Merge branch 'master' into feat/CIV-12772
pliao-hmcts Jul 16, 2024
1826374
CIV-12772 add tests
pliao-hmcts Jul 16, 2024
a94466e
Merge remote-tracking branch 'origin/feat/CIV-12772' into feat/CIV-12772
pliao-hmcts Jul 16, 2024
c591cd2
CIV-12772 refactor
pliao-hmcts Jul 17, 2024
93dfad2
CIV-12772 refactor
pliao-hmcts Jul 17, 2024
d30bd6f
Merge branch 'master' into feat/CIV-12772
paul-pearson Jul 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public enum CaseEvent {
END_JUDGE_BUSINESS_PROCESS_GASPEC(CAMUNDA),
END_HEARING_SCHEDULED_PROCESS_GASPEC(CAMUNDA),
GA_EVIDENCE_UPLOAD_CHECK(CAMUNDA),
END_GA_HWF_NOTIFY_PROCESS(CAMUNDA),

ASSIGN_GA_ROLES(CAMUNDA),

Expand Down Expand Up @@ -87,7 +88,8 @@ public enum CaseEvent {
UPDATE_HELP_WITH_FEE_NUMBER_GA(USER),
FEE_PAYMENT_OUTCOME_GA(USER),
UPDATE_TASK_LIST_GA_CREATED(CAMUNDA),
UPDATE_TASK_LIST_GA_COMPLETE(CAMUNDA);
UPDATE_TASK_LIST_GA_COMPLETE(CAMUNDA),
NOTIFY_APPLICANT_LIP_HWF(CAMUNDA);

private final UserType userType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,7 @@ public class NotificationsProperties {

@NotEmpty
private String evidenceUploadTemplate;

@NotEmpty
private String notifyApplicantForHwFMoreInformationNeeded;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package uk.gov.hmcts.reform.civil.handler.callback.camunda.businessprocess;

import static uk.gov.hmcts.reform.civil.callback.CallbackType.ABOUT_TO_SUBMIT;
import static uk.gov.hmcts.reform.civil.callback.CaseEvent.END_GA_HWF_NOTIFY_PROCESS;

import uk.gov.hmcts.reform.ccd.client.model.AboutToStartOrSubmitCallbackResponse;
import uk.gov.hmcts.reform.ccd.client.model.CallbackResponse;
import uk.gov.hmcts.reform.civil.callback.Callback;
import uk.gov.hmcts.reform.civil.callback.CallbackHandler;
import uk.gov.hmcts.reform.civil.callback.CallbackParams;
import uk.gov.hmcts.reform.civil.callback.CaseEvent;
import uk.gov.hmcts.reform.civil.helpers.CaseDetailsConverter;
import uk.gov.hmcts.reform.civil.model.CaseData;

import java.util.List;
import java.util.Map;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class EndHwfNotifyProcessCallbackHandler extends CallbackHandler {

private static final List<CaseEvent> EVENTS = List.of(END_GA_HWF_NOTIFY_PROCESS);

private final CaseDetailsConverter caseDetailsConverter;

@Override
protected Map<String, Callback> callbacks() {
return Map.of(callbackKey(ABOUT_TO_SUBMIT), this::endHwfNotifyBusinessProcess);
}

@Override
public List<CaseEvent> handledEvents() {
return EVENTS;
}

private CallbackResponse endHwfNotifyBusinessProcess(CallbackParams callbackParams) {
CaseData data = caseDetailsConverter.toCaseData(callbackParams.getRequest().getCaseDetails());
return evaluateReady(callbackParams);
}

private CallbackResponse evaluateReady(CallbackParams callbackParams) {
Map<String, Object> output = callbackParams.getRequest().getCaseDetails().getData();

return AboutToStartOrSubmitCallbackResponse.builder()
.data(output)
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package uk.gov.hmcts.reform.civil.handler.callback.camunda.notification;

import static uk.gov.hmcts.reform.civil.callback.CallbackType.ABOUT_TO_SUBMIT;
import static uk.gov.hmcts.reform.civil.callback.CaseEvent.NOTIFY_APPLICANT_LIP_HWF;

import uk.gov.hmcts.reform.ccd.client.model.AboutToStartOrSubmitCallbackResponse;
import uk.gov.hmcts.reform.ccd.client.model.CallbackResponse;
import uk.gov.hmcts.reform.civil.callback.Callback;
import uk.gov.hmcts.reform.civil.callback.CallbackHandler;
import uk.gov.hmcts.reform.civil.callback.CallbackParams;
import uk.gov.hmcts.reform.civil.callback.CaseEvent;
import uk.gov.hmcts.reform.civil.model.CaseData;
import uk.gov.hmcts.reform.civil.service.HwfNotificationService;

import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class HwfApplicantNotificationHandler extends CallbackHandler {

private final ObjectMapper objectMapper;
private final HwfNotificationService notificationService;
private static final List<CaseEvent> EVENTS = List.of(
NOTIFY_APPLICANT_LIP_HWF
);

@Override
protected Map<String, Callback> callbacks() {
return Map.of(
callbackKey(ABOUT_TO_SUBMIT), this::hwfApplicantNotification
);
}

@Override
public List<CaseEvent> handledEvents() {
return EVENTS;
}

private CallbackResponse hwfApplicantNotification(CallbackParams callbackParams) {
CaseData caseData = callbackParams.getCaseData();
notificationService.sendNotification(caseData);
return AboutToStartOrSubmitCallbackResponse.builder()
.data(caseData.toMap(objectMapper))
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ public interface NotificationData {
String GA_LIP_RESP_NAME = "respondentName";
String CASE_TITLE = "ClaimantvDefendant";

//hwf
String CLAIMANT_NAME = "claimantName";
String HWF_REFERENCE_NUMBER = "hwFReferenceNumber";
String TYPE_OF_FEE = "typeOfFee";
String HWF_MORE_INFO_DATE = "date";
String HWF_MORE_INFO_DOCUMENTS = "documents";

Map<String, String> addProperties(CaseData caseData);

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import static uk.gov.hmcts.reform.civil.callback.CallbackType.MID;
import static uk.gov.hmcts.reform.civil.callback.CallbackType.SUBMITTED;
import static uk.gov.hmcts.reform.civil.callback.CaseEvent.MORE_INFORMATION_HWF_GA;
import static uk.gov.hmcts.reform.civil.callback.CaseEvent.NOTIFY_APPLICANT_LIP_HWF;

import uk.gov.hmcts.reform.ccd.client.model.AboutToStartOrSubmitCallbackResponse;
import uk.gov.hmcts.reform.ccd.client.model.CallbackResponse;
import uk.gov.hmcts.reform.civil.callback.Callback;
import uk.gov.hmcts.reform.civil.callback.CallbackParams;
import uk.gov.hmcts.reform.civil.enums.FeeType;
import uk.gov.hmcts.reform.civil.model.BusinessProcess;
import uk.gov.hmcts.reform.civil.model.CaseData;
import uk.gov.hmcts.reform.civil.model.genapplication.HelpWithFeesDetails;
import uk.gov.hmcts.reform.civil.model.genapplication.HelpWithFeesMoreInformation;
Expand Down Expand Up @@ -68,7 +70,8 @@ private CallbackResponse validationMoreInformation(CallbackParams callbackParams

private CallbackResponse submitMoreInformationHwf(CallbackParams callbackParams) {
CaseData caseData = callbackParams.getCaseData();
CaseData.CaseDataBuilder updatedData = caseData.toBuilder();
CaseData.CaseDataBuilder updatedData = caseData.toBuilder()
.businessProcess(BusinessProcess.ready(NOTIFY_APPLICANT_LIP_HWF));

if (caseData.getHwfFeeType().equals(FeeType.ADDITIONAL)) {
HelpWithFeesDetails additionalFeeDetails =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ private CaseData updateHwFReference(CaseData caseData) {
ofNullable(caseData.getGeneralAppHelpWithFees())
.ifPresent(hwf -> updatedData.generalAppHelpWithFees(hwf.toBuilder().helpWithFeesReferenceNumber(newRefNumber).build()));
if (caseData.getGaHwfDetails() != null) {
updatedData.gaHwfDetails(caseData.getGaHwfDetails().toBuilder().hwfReferenceNumber(null).build());
updatedData.gaHwfDetails(caseData.getGaHwfDetails().toBuilder()
.hwfCaseEvent(UPDATE_HELP_WITH_FEE_NUMBER_GA).hwfReferenceNumber(null).build());
}
return updatedData.build();
}
Expand All @@ -76,7 +77,8 @@ private CaseData updateHwFReference(CaseData caseData) {
ofNullable(caseData.getGeneralAppHelpWithFees())
.ifPresent(hwf -> updatedData.generalAppHelpWithFees(hwf.toBuilder().helpWithFeesReferenceNumber(newRefNumber).build()));
if (caseData.getAdditionalHwfDetails() != null) {
updatedData.additionalHwfDetails(caseData.getAdditionalHwfDetails().toBuilder().hwfReferenceNumber(null).build());
updatedData.additionalHwfDetails(caseData.getAdditionalHwfDetails().toBuilder()
.hwfCaseEvent(UPDATE_HELP_WITH_FEE_NUMBER_GA).hwfReferenceNumber(null).build());
}
return updatedData.build();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package uk.gov.hmcts.reform.civil.handler.tasks;

import static uk.gov.hmcts.reform.civil.callback.CaseEvent.END_GA_HWF_NOTIFY_PROCESS;

import uk.gov.hmcts.reform.ccd.client.model.CaseDataContent;
import uk.gov.hmcts.reform.ccd.client.model.Event;
import uk.gov.hmcts.reform.ccd.client.model.StartEventResponse;
import uk.gov.hmcts.reform.civil.helpers.CaseDetailsConverter;
import uk.gov.hmcts.reform.civil.model.BusinessProcess;
import uk.gov.hmcts.reform.civil.model.CaseData;
import uk.gov.hmcts.reform.civil.service.CoreCaseDataService;
import uk.gov.hmcts.reform.civil.service.data.ExternalTaskInput;

import java.util.Map;

import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.camunda.bpm.client.task.ExternalTask;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RequiredArgsConstructor
public class EndGaHwfNotifyProcessTaskHandler implements BaseExternalTaskHandler {

private final CoreCaseDataService coreCaseDataService;
private final CaseDetailsConverter caseDetailsConverter;
private final ObjectMapper mapper;

@Override
public void handleTask(ExternalTask externalTask) {
ExternalTaskInput externalTaskInput = mapper.convertValue(externalTask.getAllVariables(),
ExternalTaskInput.class);
String caseId = externalTaskInput.getCaseId();
StartEventResponse startEventResponse = coreCaseDataService
.startGaUpdate(caseId, END_GA_HWF_NOTIFY_PROCESS);
CaseData data = caseDetailsConverter.toCaseData(startEventResponse.getCaseDetails());
BusinessProcess businessProcess = data.getBusinessProcess();
coreCaseDataService.submitGaUpdate(caseId, caseDataContent(startEventResponse, businessProcess));
}

private CaseDataContent caseDataContent(StartEventResponse startEventResponse, BusinessProcess businessProcess) {
Map<String, Object> data = startEventResponse.getCaseDetails().getData();
data.put("businessProcess", businessProcess.reset());

return CaseDataContent.builder()
.eventToken(startEventResponse.getToken())
.event(Event.builder().id(startEventResponse.getEventId()).build())
.data(data)
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
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 uk.gov.hmcts.reform.civil.callback.CaseEvent;
import uk.gov.hmcts.reform.civil.config.properties.notification.NotificationsProperties;
import uk.gov.hmcts.reform.civil.enums.FeeType;
import uk.gov.hmcts.reform.civil.enums.HwFMoreInfoRequiredDocuments;
import uk.gov.hmcts.reform.civil.handler.callback.camunda.notification.NotificationData;
import uk.gov.hmcts.reform.civil.helpers.CaseDetailsConverter;
import uk.gov.hmcts.reform.civil.model.CaseData;
import uk.gov.hmcts.reform.civil.model.genapplication.HelpWithFeesMoreInformation;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class HwfNotificationService implements NotificationData {

private final NotificationService notificationService;
private final NotificationsProperties notificationsProperties;
private final CaseDetailsConverter caseDetailsConverter;
private final CoreCaseDataService coreCaseDataService;
private final SolicitorEmailValidation solicitorEmailValidation;
private Map<CaseEvent, String> emailTemplates;

private static final String ERROR_HWF_EVENT = "Hwf Event not support";

public void sendNotification(CaseData caseData) throws NotificationException {
CaseData civilCaseData = caseDetailsConverter
.toCaseData(coreCaseDataService
.getCase(Long.parseLong(caseData.getGeneralAppParentCaseLink().getCaseReference())));

caseData = solicitorEmailValidation.validateSolicitorEmail(civilCaseData, caseData);
CaseEvent event = getEvent(caseData);

notificationService.sendMail(
caseData.getGeneralAppApplnSolicitor().getEmail(),
getTemplate(event),
addProperties(caseData),
caseData.getGeneralAppParentCaseLink().getCaseReference()
);
}

@Override
public Map<String, String> addProperties(CaseData caseData) {
Map<String, String> commonProperties = getCommonProperties(caseData);
Map<String, String> furtherProperties = getFurtherProperties(caseData);
return Collections.unmodifiableMap(
Stream.concat(commonProperties.entrySet().stream(), furtherProperties.entrySet().stream())
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)));
}

private Map<String, String> getCommonProperties(CaseData caseData) {
return Map.of(
CASE_REFERENCE, caseData.getCcdCaseReference().toString(),
CLAIMANT_NAME, caseData.getApplicantPartyName(),
TYPE_OF_FEE, caseData.getHwfFeeType().getLabel(),
HWF_REFERENCE_NUMBER, caseData.getGeneralAppHelpWithFees().getHelpWithFeesReferenceNumber()
);
}

private Map<String, String> getFurtherProperties(CaseData caseData) {
return switch (getEvent(caseData)) {
//case NO_REMISSION_HWF -> getNoRemissionProperties(caseData);
case MORE_INFORMATION_HWF_GA -> getMoreInformationProperties(caseData);
//case PARTIAL_REMISSION_HWF_GRANTED -> getPartialRemissionProperties(caseData);
//case INVALID_HWF_REFERENCE, UPDATE_HELP_WITH_FEE_NUMBER -> Collections.emptyMap();
default -> throw new NotificationException(new Exception(ERROR_HWF_EVENT));
};
}

private CaseEvent getEvent(CaseData caseData) {
if (caseData.getHwfFeeType().equals(FeeType.APPLICATION)) {
return caseData.getGaHwfDetails().getHwfCaseEvent();
} else if (caseData.getHwfFeeType().equals(FeeType.ADDITIONAL)) {
return caseData.getAdditionalHwfDetails().getHwfCaseEvent();
} else {
throw new NotificationException(new Exception(ERROR_HWF_EVENT));
}
}

private String getTemplate(CaseEvent hwfEvent) {
if (emailTemplates == null) {
emailTemplates = Map.of(
CaseEvent.MORE_INFORMATION_HWF_GA,
notificationsProperties.getNotifyApplicantForHwFMoreInformationNeeded()
);
}
return emailTemplates.get(hwfEvent);
}

private Map<String, String> getMoreInformationProperties(CaseData caseData) {
HelpWithFeesMoreInformation moreInformation =
null != caseData.getHelpWithFeesMoreInformationGa()
? caseData.getHelpWithFeesMoreInformationGa()
: caseData.getHelpWithFeesMoreInformationAdditional();
return Map.of(
HWF_MORE_INFO_DATE, formatLocalDate(moreInformation.getHwFMoreInfoDocumentDate(), DATE),
HWF_MORE_INFO_DOCUMENTS, getMoreInformationDocumentList(
moreInformation.getHwFMoreInfoRequiredDocuments()
)
);
}

private String getMoreInformationDocumentList(List<HwFMoreInfoRequiredDocuments> list) {
StringBuilder documentList = new StringBuilder();
for (HwFMoreInfoRequiredDocuments doc : list) {
documentList.append(doc.getName());
if (!doc.getDescription().isEmpty()) {
documentList.append(" - ");
documentList.append(doc.getDescription());
}
documentList.append("\n");
documentList.append("\n");
}
return documentList.toString();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package uk.gov.hmcts.reform.civil.service.tasklisteners;

import uk.gov.hmcts.reform.civil.handler.tasks.EndJudgeMakesDecisionBusinessProcessTaskHandler;

import org.camunda.bpm.client.ExternalTaskClient;
import org.camunda.bpm.client.topic.TopicSubscriptionBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class EndGaBusinessProcessExternalTaskListener {

private static final String TOPIC = "END_GA_BUSINESS_PROCESS";

@Autowired
private EndGaBusinessProcessExternalTaskListener(
EndJudgeMakesDecisionBusinessProcessTaskHandler handler,
ExternalTaskClient client) {
TopicSubscriptionBuilder subscriptionBuilder = client.subscribe(TOPIC);
subscriptionBuilder.handler(handler).open();
}
}
Loading
Loading