Skip to content

Commit

Permalink
SSCS-12006 Work allocation ph tasks update (#3564)
Browse files Browse the repository at this point in the history
* allow invalid languages to update case data (#3530)

* Tribs: change error (#3506)

* Tribs: change error
SSCS-12094

* common bump
SSCS-12094

* common bump
SSCS-12094

---------

Co-authored-by: Nicholas Hill <nicholas.hill@HMCTS.net>
Co-authored-by: AV <46674657+vishwa-amit@users.noreply.github.com>

* SSCSCI-579 - Elinks feature toggling (#3524)

* SSCSCI-84 - Postponement doc appears twice V2 (#3534)

* Fixed an issue with blank decision notice (#3535)

Co-authored-by: Andrei Trushkov <andrei.trushkov@hmcts.net>
Co-authored-by: NickHill111 <47982351+nickhill111@users.noreply.github.com>

* SSCSCI-595 - Interpreter Language not showing in Appeal Details (#3539)

* SSCSCI-5 (#3509)

* Update dependency com.github.hmcts:sscs-common to v5.2.2 (#3550)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* global search changes (#3549)

* global search changes


---------

Co-authored-by: Andrei Trushkov <andrei.trushkov@hmcts.net>

* Implemented prePostHearing field in 'Send to interloc' and 'Send to Judge' events (#3516)

* SSCS-12139: implemented prePostHearing field in 'Send to interloc' and 'Send to Judge' events

* common bump
SSCS-12139

* cleanup, sscs-common bump

* tests

* fixed prePosthearing value is not null in about to start handler

* Update build.gradle

* update suppressions
SSCS-12139

* update flags
SSCS-12139

---------

Co-authored-by: Andrei Trushkov <andrei.trushkov@hmcts.net>
Co-authored-by: NickHill111 <47982351+nickhill111@users.noreply.github.com>
Co-authored-by: Nicholas Hill <nicholas.hill@HMCTS.net>

* New sscs-common version for QA (#3507)

* new sscs-common version for QA

* common bump

* sscs-common bump

* change to correct embedded title
SSCS-12122

* add unit test
SSCS-12122

* update suppressions
SSCS-12122

---------

Co-authored-by: Andrei Trushkov <andrei.trushkov@hmcts.net>
Co-authored-by: NickHill111 <47982351+nickhill111@users.noreply.github.com>
Co-authored-by: Nicholas Hill <nicholas.hill@HMCTS.net>
Co-authored-by: AV <46674657+vishwa-amit@users.noreply.github.com>

* fix ES match_all query (#3559)

* Fix merge

* SSCS-12223 Testing (#3565)

* SSCS-12223 Testing

* CCD Defs S12006PnonProd on preview

---------

Co-authored-by: gemmatalbot <116297417+gemmatalbot@users.noreply.github.com>
Co-authored-by: NickHill111 <47982351+nickhill111@users.noreply.github.com>
Co-authored-by: Nicholas Hill <nicholas.hill@HMCTS.net>
Co-authored-by: AV <46674657+vishwa-amit@users.noreply.github.com>
Co-authored-by: Andrei Trushkov <54980948+AndreiTrushkov@users.noreply.github.com>
Co-authored-by: Andrei Trushkov <andrei.trushkov@hmcts.net>
Co-authored-by: hashimalisolirius <140517911+hashimalisolirius@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: taleb <20416858+benouaer@users.noreply.github.com>
  • Loading branch information
10 people committed Dec 11, 2023
1 parent d2d417f commit df1c5f2
Show file tree
Hide file tree
Showing 15 changed files with 243 additions and 77 deletions.
9 changes: 6 additions & 3 deletions charts/sscs-tribunals-api/values.ccd.preview.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ xui-webapp:
SERVICES_ROLE_ASSIGNMENT_MAPPING_API: http://${SERVICE_NAME}-am-org-role-mapping-service
JURISDICTIONS: SSCS
WA_SUPPORTED_JURISDICTIONS: SSCS
GLOBAL_SEARCH_SERVICES: IA,CIVIL,PRIVATELAW,PUBLICLAW,SSCS,ST_CIC,EMPLOYMENT
GLOBAL_SEARCH_SERVICES: IA,CIVIL,PRIVATELAW,PUBLICLAW,SSCS
LAUNCH_DARKLY_CLIENT_ID: 5de6610b23ce5408280f2268
FEATURE_WORKALLOCATION_ENABLED: true
FEATURE_REDIS_ENABLED: false
Expand Down Expand Up @@ -530,6 +530,8 @@ ccd:
image: hmctspublic.azurecr.io/ccd/admin-web:latest
ingressHost: admin-web-${SERVICE_FQDN}
environment:
ADMINWEB_GLOBAL_SEARCH_INDEX_URL: http://${SERVICE_NAME}-ccd-definition-store/elastic-support/global-search/index
ADMINWEB_ELASTIC_CASE_TYPES_URL: http://${SERVICE_NAME}-ccd-definition-store/elastic-support/case-types
IDAM_ADMIN_WEB_SERVICE_KEY: ${ADMIN_S2S_KEY}
IDAM_OAUTH2_AW_CLIENT_SECRET: ${ADMIN_WEB_IDAM_SECRET}
keyVaults: [ ]
Expand Down Expand Up @@ -616,7 +618,7 @@ ccd:

#Use this image to import your CCD definition. To have an image available, create a git tag and push it.
ccd-definition-importer:
image: hmctspublic.azurecr.io/sscs/ccd-definition-importer-benefit:S12006MnonProd
image: hmctspublic.azurecr.io/sscs/ccd-definition-importer-benefit:S12006PnonProd
definitionFilename: sscs-ccd.xlsx
redirectUri: http://${SERVICE_NAME}-ccd-admin-web/oauth2redirect
environment:
Expand All @@ -635,7 +637,7 @@ ccd:
CCD_DEF_MYA_REPRESENTATIVE_LINK: http://${SERVICE_NAME}-ccd-definition-store
CCD_DEF_MYA_APPOINTEE_LINK: http://${SERVICE_NAME}-ccd-definition-store
CCD_DEF_ENV: 'PROD'
CCD_DEF_VERSION: S12006MnonProd
CCD_DEF_VERSION: S12006PnonProd
secrets: []
userRoles:
- citizen
Expand All @@ -657,6 +659,7 @@ ccd:
- caseworker-sscs-hmrcresponsewriter
- caseworker-wa-task-configuration
- caseworker-ras-validation
- GS_profile
elastic:
enabled: true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ protected SscsCaseData setField(SscsCaseData newSscsCaseData, String newValue, E
}

setInterlocReferralDate(newSscsCaseData, eventType);

clearDirectionDueDate(newSscsCaseData, eventType);

return newSscsCaseData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,19 @@ protected String getEmbeddedDocumentTypeLabel(SscsCaseData caseData, DocumentTyp
String embeddedDocumentTypeLabel = (FINAL_DECISION_NOTICE.equals(documentType) || CORRECTION_GRANTED.equals(documentType) ? "Decision Notice" : documentTypeLabel);

if (isPostHearingsEnabled) {
PostHearingReviewType postHearingReviewType = caseData.getPostHearing().getReviewType();
PostHearing postHearing = caseData.getPostHearing();
PostHearingReviewType postHearingReviewType = postHearing.getReviewType();

if (nonNull(postHearingReviewType)) {
if (PostHearingReviewType.PERMISSION_TO_APPEAL.equals(postHearingReviewType)
&& PermissionToAppealActions.REVIEW.equals(postHearing.getPermissionToAppeal().getAction())) {
return "Review Decision Notice";
}

return postHearingReviewType.getDescriptionEn() + " Decision Notice";
}

if (isYes(caseData.getPostHearing().getCorrection().getIsCorrectionFinalDecisionInProgress())) {
if (isYes(postHearing.getCorrection().getIsCorrectionFinalDecisionInProgress())) {
return documentTypeLabel;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import uk.gov.hmcts.reform.sscs.ccd.callback.Callback;
import uk.gov.hmcts.reform.sscs.ccd.callback.CallbackType;
Expand All @@ -20,11 +21,16 @@

@Service
public class DirectionIssuedAboutToStartHandler implements PreSubmitCallbackHandler<SscsCaseData> {
private final boolean isPostHearingsEnabled;

public DirectionIssuedAboutToStartHandler(@Value("${feature.postHearings.enabled}") boolean isPostHearingsEnabled) {
this.isPostHearingsEnabled = isPostHearingsEnabled;
}

@Override
public boolean canHandle(CallbackType callbackType, Callback<SscsCaseData> callback) {
requireNonNull(callback, "callback must not be null");
requireNonNull(callbackType, "callbacktype must not be null");
requireNonNull(callbackType, "callbackType must not be null");

return (callbackType.equals(CallbackType.ABOUT_TO_START)
|| callbackType.equals(CallbackType.MID_EVENT))
Expand All @@ -43,6 +49,10 @@ public PreSubmitCallbackResponse<SscsCaseData> handle(CallbackType callbackType,
setDirectionTypeDropDown(sscsCaseData);
setExtensionNextEventDropdown(callback.getCaseDetails().getState(), sscsCaseData);

if (isPostHearingsEnabled) {
sscsCaseData.setPrePostHearing(null);
}

clearFields(sscsCaseData);
setPartiesToSendLetter(sscsCaseData);
return new PreSubmitCallbackResponse<>(sscsCaseData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,7 @@ private SscsCaseData updateCaseAfterExtensionRefused(SscsCaseData caseData, Inte
private SscsCaseData updateCaseForDirectionType(CaseDetails<SscsCaseData> caseDetails, SscsCaseData caseData, SscsDocumentTranslationStatus documentTranslationStatus) {

if (DirectionType.PROVIDE_INFORMATION.toString().equals(caseData.getDirectionTypeDl().getValue().getCode())) {

caseData.setInterlocReviewState(AWAITING_INFORMATION);

} else if (getPreValidStates().contains(caseDetails.getState())
&& DirectionType.APPEAL_TO_PROCEED.toString().equals(caseData.getDirectionTypeDl().getValue().getCode())) {
caseData.setDateSentToDwp(LocalDate.now().toString());
Expand All @@ -161,29 +159,22 @@ private SscsCaseData updateCaseForDirectionType(CaseDetails<SscsCaseData> caseDe
} else if (DirectionType.REFUSE_EXTENSION.toString().equals(caseData.getDirectionTypeDl().getValue().getCode())
&& ExtensionNextEvent.SEND_TO_LISTING.toString().equals(caseData.getExtensionNextEventDl().getValue().getCode())) {
caseData = updateCaseAfterExtensionRefused(caseData, AWAITING_ADMIN_ACTION, State.RESPONSE_RECEIVED);

} else if (DirectionType.REFUSE_EXTENSION.toString().equals(caseData.getDirectionTypeDl().getValue().getCode())
&& ExtensionNextEvent.SEND_TO_VALID_APPEAL.toString().equals(caseData.getExtensionNextEventDl().getValue().getCode())) {
caseData = updateCaseAfterExtensionRefused(caseData, null, State.WITH_DWP);

} else if (DirectionType.GRANT_REINSTATEMENT.toString().equals(caseData.getDirectionTypeDl().getValue().getCode())) {
caseData = updateCaseAfterReinstatementGranted(caseData, documentTranslationStatus);

} else if (DirectionType.REFUSE_REINSTATEMENT.toString().equals(caseData.getDirectionTypeDl().getValue().getCode())) {
caseData = updateCaseAfterReinstatementRefused(caseData, documentTranslationStatus);

} else if (!SscsDocumentTranslationStatus.TRANSLATION_REQUIRED.equals(documentTranslationStatus)
&& DirectionType.GRANT_URGENT_HEARING.toString().equals(caseData.getDirectionTypeDl().getValue().getCode())) {
caseData = updateCaseAfterUrgentHearingGranted(caseData);

} else if (!SscsDocumentTranslationStatus.TRANSLATION_REQUIRED.equals(documentTranslationStatus)
&& DirectionType.REFUSE_URGENT_HEARING.toString().equals(caseData.getDirectionTypeDl().getValue().getCode())) {
caseData = updateCaseAfterUrgentHearingRefused(caseData);

} else if (DirectionType.REFUSE_HEARING_RECORDING_REQUEST.toString().equals(caseData.getDirectionTypeDl().getValue().getCode())) {
caseData.setInterlocReviewState(AWAITING_ADMIN_ACTION);
caseData.setInterlocReferralReason(REJECT_HEARING_RECORDING_REQUEST);

} else {
caseData.setInterlocReviewState(null);
}
Expand All @@ -197,15 +188,12 @@ private int getResponseDueDays(SscsCaseData caseData) {
}

private SscsCaseData updateCaseAfterReinstatementGranted(SscsCaseData caseData, SscsDocumentTranslationStatus documentTranslationStatus) {

if (!SscsDocumentTranslationStatus.TRANSLATION_REQUIRED.equals(documentTranslationStatus)) {
caseData.setReinstatementOutcome(RequestOutcome.GRANTED);
caseData.setDwpState(DwpState.REINSTATEMENT_GRANTED);

updateStateIfInterLockReviewState(caseData);

log.info("Case ID {} reinstatement granted on {}", caseData.getCcdCaseId(), LocalDate.now().toString());

} else {
log.info("Case ID {} reinstatement granted held pending Direction Translation {}", caseData.getCcdCaseId(), LocalDate.now().toString());
}
Expand All @@ -224,7 +212,6 @@ private boolean hasFtaBeenChosenAsOneOfThePartyMembers(SscsCaseData caseData) {
}

private SscsCaseData updateCaseAfterReinstatementRefused(SscsCaseData caseData, SscsDocumentTranslationStatus documentTranslationStatus) {

if (!SscsDocumentTranslationStatus.TRANSLATION_REQUIRED.equals(documentTranslationStatus)) {
caseData.setReinstatementOutcome(RequestOutcome.REFUSED);
caseData.setDwpState(DwpState.REINSTATEMENT_REFUSED);
Expand All @@ -236,15 +223,13 @@ private SscsCaseData updateCaseAfterReinstatementRefused(SscsCaseData caseData,
}

private SscsCaseData updateCaseAfterUrgentHearingGranted(SscsCaseData caseData) {

caseData.setUrgentHearingOutcome(RequestOutcome.GRANTED.getValue());
caseData.setInterlocReviewState(AWAITING_ADMIN_ACTION);
log.info("Case ID {} urgent hearing granted on {}", caseData.getCcdCaseId(), LocalDate.now().toString());
return caseData;
}

private SscsCaseData updateCaseAfterUrgentHearingRefused(SscsCaseData caseData) {

caseData.setUrgentHearingOutcome(RequestOutcome.REFUSED.getValue());
caseData.setUrgentCase("No");
caseData.setInterlocReviewState(NONE);
Expand All @@ -266,7 +251,6 @@ private void updateStateIfInterLockReviewState(SscsCaseData caseData) {
@NotNull
private PreSubmitCallbackResponse<SscsCaseData> validateForPdfAndCreateCallbackResponse(
Callback<SscsCaseData> callback, CaseDetails<SscsCaseData> caseDetails, SscsCaseData caseData, SscsDocumentTranslationStatus documentTranslationStatus) {

final PreSubmitCallbackResponse<SscsCaseData> sscsCaseDataPreSubmitCallbackResponse =
new PreSubmitCallbackResponse<>(caseData);

Expand Down Expand Up @@ -299,7 +283,6 @@ private PreSubmitCallbackResponse<SscsCaseData> buildResponse(Callback<SscsCaseD
PreSubmitCallbackResponse<SscsCaseData> sscsCaseDataPreSubmitCallbackResponse,
DocumentLink url,
SscsDocumentTranslationStatus documentTranslationStatus) {

if (isPostHearingsEnabled) {
clearInterlocReferralReason(caseData);
}
Expand Down Expand Up @@ -344,10 +327,6 @@ private PreSubmitCallbackResponse<SscsCaseData> buildResponse(Callback<SscsCaseD
log.info("Saved the new interloc direction document for case id: " + caseData.getCcdCaseId());
}

if (isPostHearingsEnabled) {
caseData.setPrePostHearing(null);
}

return sscsCaseDataPreSubmitCallbackResponse;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ public class InterlocSendToTcwAboutToSubmitHandler implements PreSubmitCallbackH
@Override
public boolean canHandle(CallbackType callbackType, Callback<SscsCaseData> callback) {
requireNonNull(callback, "callback must not be null");
requireNonNull(callbackType, "callbacktype must not be null");
requireNonNull(callbackType, "callbackType must not be null");

return callbackType.equals(CallbackType.ABOUT_TO_SUBMIT)
&& (callback.getEvent() == EventType.INTERLOC_SEND_TO_TCW
);
&& (callback.getEvent() == EventType.INTERLOC_SEND_TO_TCW);
}

@Override
Expand All @@ -38,8 +37,6 @@ public PreSubmitCallbackResponse<SscsCaseData> handle(CallbackType callbackType,

caseData.setDirectionDueDate(null);

PreSubmitCallbackResponse<SscsCaseData> sscsCaseDataPreSubmitCallbackResponse = new PreSubmitCallbackResponse<>(caseData);

return sscsCaseDataPreSubmitCallbackResponse;
return new PreSubmitCallbackResponse<>(caseData);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package uk.gov.hmcts.reform.sscs.ccd.presubmit.sendtojudge;

import static java.util.Objects.requireNonNull;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import uk.gov.hmcts.reform.sscs.ccd.callback.Callback;
import uk.gov.hmcts.reform.sscs.ccd.callback.CallbackType;
import uk.gov.hmcts.reform.sscs.ccd.callback.PreSubmitCallbackResponse;
import uk.gov.hmcts.reform.sscs.ccd.domain.EventType;
import uk.gov.hmcts.reform.sscs.ccd.domain.SscsCaseData;
import uk.gov.hmcts.reform.sscs.ccd.presubmit.PreSubmitCallbackHandler;

@Component
@Slf4j
public class SendToJudgeAboutToStartHandler implements PreSubmitCallbackHandler<SscsCaseData> {
private final boolean postHearingsB;

public SendToJudgeAboutToStartHandler(@Value("${feature.postHearingsB.enabled}") boolean postHearingsB) {
this.postHearingsB = postHearingsB;
}

@Override
public boolean canHandle(CallbackType callbackType, Callback<SscsCaseData> callback) {
requireNonNull(callback, "callback must not be null");
requireNonNull(callbackType, "callbackType must not be null");

return callbackType.equals(CallbackType.ABOUT_TO_START)
&& (callback.getEvent() == EventType.TCW_REFER_TO_JUDGE);
}

@Override
public PreSubmitCallbackResponse<SscsCaseData> handle(CallbackType callbackType, Callback<SscsCaseData> callback, String userAuthorisation) {
if (!canHandle(callbackType, callback)) {
throw new IllegalStateException("Cannot handle callback");
}

SscsCaseData sscsCaseData = callback.getCaseDetails().getCaseData();
if (postHearingsB) {
sscsCaseData.setPrePostHearing(null);
}

return new PreSubmitCallbackResponse<>(sscsCaseData);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@
public class ValidSendToInterlocAboutToStartHandler implements PreSubmitCallbackHandler<SscsCaseData> {

private final boolean postponementsFeature;
private final boolean postHearingsB;

public ValidSendToInterlocAboutToStartHandler(@Value("${feature.postponements.enabled}") boolean postponementsFeature) {
public ValidSendToInterlocAboutToStartHandler(@Value("${feature.postponements.enabled}") boolean postponementsFeature,
@Value("${feature.postHearingsB.enabled}") boolean postHearingsB) {
this.postponementsFeature = postponementsFeature;
this.postHearingsB = postHearingsB;
}

@Override
public boolean canHandle(CallbackType callbackType, Callback<SscsCaseData> callback) {
requireNonNull(callback, "callback must not be null");
requireNonNull(callbackType, "callbacktype must not be null");
requireNonNull(callbackType, "callbackType must not be null");

return callbackType.equals(CallbackType.ABOUT_TO_START)
&& (callback.getEvent() == EventType.VALID_SEND_TO_INTERLOC
Expand All @@ -47,6 +50,10 @@ public PreSubmitCallbackResponse<SscsCaseData> handle(CallbackType callbackType,
setSelectWhoReviewsCase(sscsCaseData);
setOriginalSenderDropdown(sscsCaseData);

if (postHearingsB) {
sscsCaseData.setPrePostHearing(null);
}

return new PreSubmitCallbackResponse<>(sscsCaseData);
}

Expand All @@ -67,5 +74,4 @@ private void setOriginalSenderDropdown(SscsCaseData sscsCaseData) {

sscsCaseData.setOriginalSender(new DynamicList(listOptions.get(0), listOptions));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ValidSendToInterlocAboutToSubmitHandler(PostponementRequestService postpo
@Override
public boolean canHandle(CallbackType callbackType, Callback<SscsCaseData> callback) {
requireNonNull(callback, "callback must not be null");
requireNonNull(callbackType, "callbacktype must not be null");
requireNonNull(callbackType, "callbackType must not be null");

return callbackType.equals(CallbackType.ABOUT_TO_SUBMIT)
&& (callback.getEvent() == EventType.VALID_SEND_TO_INTERLOC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ public List<CaseDetails> searchForCitizen(IdamTokens idamTokens) {

public List<CaseDetails> searchForCitizenAllCases(IdamTokens idamTokens) {
if (elasticSearchEnabled) {
String searchCriteria = "{"
+ " \"query\" : {\n"
+ " \"match_all\" : {}\n"
+ " }";
String searchCriteria = "{\"query\":{\"match_all\":{}}}";
SearchResult searchResult = coreCaseDataApi.searchCases(
idamTokens.getIdamOauth2Token(),
idamTokens.getServiceAuthorization(),
Expand Down
Loading

0 comments on commit df1c5f2

Please sign in to comment.