Skip to content

Commit

Permalink
Merge branch 'master' into SSCSCI-1176-3
Browse files Browse the repository at this point in the history
  • Loading branch information
gemmatalbot authored Nov 27, 2024
2 parents 395caaf + 0d5250a commit 7ee4170
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 39 deletions.
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,9 @@ dependencies {
implementation group: 'com.mchange', name: 'c3p0', version: '0.10.1'
implementation group: 'org.flywaydb', name: 'flyway-core', version: '9.22.3'

implementation group: 'com.github.hmcts', name: 'sscs-common', version: '5.12.17'
implementation group: 'com.github.hmcts', name: 'sscs-common', version: '5.12.18'
implementation group: 'com.github.hmcts', name: 'sscs-pdf-email-common', version: '5.2.18'


implementation group: 'com.azure', name: 'azure-core', version: '1.46.0'
implementation group: 'com.azure', name: 'azure-messaging-servicebus', version: '7.15.1'

Expand Down
4 changes: 2 additions & 2 deletions definitions/benefit/sheets/CaseField/CaseField.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
{"LiveFrom": "20/08/2019", "CaseTypeID": "Benefit", "ID": "summaryRole", "Label": "**Role** \r\n${appeal.appellant.role.name}", "FieldType": "Label", "SecurityClassification": "PUBLIC"},
{"LiveFrom": "20/08/2019", "CaseTypeID": "Benefit", "ID": "summaryRoleDescription", "Label": "**Role Description** \r\n${appeal.appellant.role.description}", "FieldType": "Label", "SecurityClassification": "PUBLIC"},
{"LiveFrom": "20/08/2019", "CaseTypeID": "Benefit", "ID": "summaryDOB", "Label": "**Date of birth** \r\n${appeal.appellant.identity.dob}", "FieldType": "Label", "SecurityClassification": "PUBLIC"},
{"LiveFrom": "20/08/2019", "CaseTypeID": "Benefit", "ID": "summaryIbcaReference", "Label": "**IBCA Reference** \r\n${appeal.appellant.identity.ibcaReference}", "FieldType": "Label", "SecurityClassification": "PUBLIC"},
{"LiveFrom": "20/08/2019", "CaseTypeID": "Benefit", "ID": "summaryBenefitType", "Label": "**Benefit type** \r\n${appeal.benefitType.description}", "FieldType": "Label", "SecurityClassification": "PUBLIC"},
{"LiveFrom": "20/08/2019", "CaseTypeID": "Benefit", "ID": "summaryAppealType", "Label": "**Appeal type** \r\n${appeal.benefitType.description}", "FieldType": "Label", "SecurityClassification": "PUBLIC"},
{"LiveFrom": "20/08/2019", "CaseTypeID": "Benefit", "ID": "summaryCaseReference", "Label": "**SC number** \r\n${caseReference}", "FieldType": "Label", "SecurityClassification": "PUBLIC"},
Expand Down Expand Up @@ -515,6 +516,5 @@
{"LiveFrom": "01/01/2018", "CaseTypeID": "Benefit", "ID": "judgeReserved", "Label": "Reserve to Judge?", "FieldType": "YesOrNo", "SecurityClassification": "PUBLIC"},
{"LiveFrom": "01/01/2018", "CaseTypeID": "Benefit", "ID": "tribunalDirectPoToAttend", "Label": "Tribunal direct PO to attend?", "FieldType": "YesOrNo", "SecurityClassification": "PUBLIC"},
{"LiveFrom": "06/02/2024", "CaseTypeID": "Benefit", "ID": "preWorkAllocation", "Label": "Case created before WA went Live", "FieldType": "YesOrNo", "SecurityClassification": "PUBLIC"},
{"LiveFrom": "07/08/2024", "CaseTypeID": "Benefit", "ID": "ignoreCallbackWarnings", "Label": "Ignore callback warnings", "FieldType": "YesOrNo", "SecurityClassification": "PUBLIC"},
{"LiveFrom": "20/08/2019", "CaseTypeID": "Benefit", "ID": "summaryIbcaReference", "Label": "**IBCA Reference** \r\n${appeal.appellant.identity.ibcaReference}", "FieldType": "Label", "SecurityClassification": "PUBLIC"}
{"LiveFrom": "07/08/2024", "CaseTypeID": "Benefit", "ID": "ignoreCallbackWarnings", "Label": "Ignore callback warnings", "FieldType": "YesOrNo", "SecurityClassification": "PUBLIC"}
]
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import static uk.gov.hmcts.reform.sscs.ccd.domain.YesNo.isYes;
import static uk.gov.hmcts.reform.sscs.ccd.presubmit.directionissued.ExtensionNextEventItemList.*;
import static uk.gov.hmcts.reform.sscs.helper.SscsHelper.getPreValidStates;
import static uk.gov.hmcts.reform.sscs.model.AppConstants.BENEFIT_CODES_FOR_ISSUE_AND_SEND_TO_ADMIN;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -65,6 +66,10 @@ private void setDirectionTypeDropDown(SscsCaseData sscsCaseData) {
listOptions.add(new DynamicListItem(APPEAL_TO_PROCEED.toString(), APPEAL_TO_PROCEED.getLabel()));
listOptions.add(new DynamicListItem(PROVIDE_INFORMATION.toString(), PROVIDE_INFORMATION.getLabel()));

if (sscsCaseData.getBenefitCode() != null && BENEFIT_CODES_FOR_ISSUE_AND_SEND_TO_ADMIN.contains(sscsCaseData.getBenefitCode())) {
listOptions.add(new DynamicListItem(ISSUE_AND_SEND_TO_ADMIN.toString(), ISSUE_AND_SEND_TO_ADMIN.getLabel()));
}

if (isYes(sscsCaseData.getSscsHearingRecordingCaseData().getHearingRecordingRequestOutstanding())) {
listOptions.add(new DynamicListItem(REFUSE_HEARING_RECORDING_REQUEST.toString(), REFUSE_HEARING_RECORDING_REQUEST.getLabel()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ private SscsCaseData updateCaseForDirectionType(CaseDetails<SscsCaseData> caseDe
} 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 if (DirectionType.ISSUE_AND_SEND_TO_ADMIN.toString().equals(caseData.getDirectionTypeDl().getValue().getCode())) {
caseData.setInterlocReviewState(AWAITING_ADMIN_ACTION);
} else {
caseData.setInterlocReviewState(null);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package uk.gov.hmcts.reform.sscs.model;

import java.util.List;
import java.util.Objects;

public class AppConstants {

public static final String ADDRESS_LINE_1 = "addressLine1";
Expand Down Expand Up @@ -37,7 +40,7 @@ public class AppConstants {
public static final String DWP_DOCUMENT_EDITED_RESPONSE_FILENAME_PREFIX = "FTA edited response received";
public static final String DWP_DOCUMENT_EDITED_EVIDENCE_FILENAME_PREFIX = "FTA edited evidence received";
public static final String DATE_FORMAT_YYYYMMDD = "yyyy-MM-dd";

public static final List<String> BENEFIT_CODES_FOR_ISSUE_AND_SEND_TO_ADMIN = Objects.equals(System.getenv("INFECTED_BLOOD_COMPENSATION_ENABLED"), "true") ? List.of("093", "016", "022") : List.of("093");
public static final String IBCA_BENEFIT_CODE = "093";
public static final String INFECTED_BLOOD_COMPENSATION = "infectedBloodCompensation";
public static final int FUNCTIONAL_FETCH_ATTEMPTS = 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import static uk.gov.hmcts.reform.sscs.ccd.domain.YesNo.NO;
import static uk.gov.hmcts.reform.sscs.ccd.domain.YesNo.YES;
import static uk.gov.hmcts.reform.sscs.ccd.presubmit.directionissued.ExtensionNextEventItemList.*;
import static uk.gov.hmcts.reform.sscs.model.AppConstants.BENEFIT_CODES_FOR_ISSUE_AND_SEND_TO_ADMIN;

import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -81,7 +82,7 @@ public void givenValidAppeal_populateExtensionNextEventDropdown() {
listOptions.add(new DynamicListItem(NO_FURTHER_ACTION.getCode(), NO_FURTHER_ACTION.getLabel()));
DynamicList expected = new DynamicList(new DynamicListItem("", ""), listOptions);
assertEquals(expected, response.getData().getExtensionNextEventDl());
assertEquals(2, listOptions.size());
assertEquals(2, response.getData().getExtensionNextEventDl().getListItems().size());
}

@Test
Expand All @@ -99,7 +100,7 @@ public void givenValidAppealWithExtensionNextEventDropdownAlreadyPopulated_thenA

DynamicList expected = new DynamicList(new DynamicListItem(NO_FURTHER_ACTION.getCode(), NO_FURTHER_ACTION.getCode()), listOptions);
assertEquals(expected, response.getData().getExtensionNextEventDl());
assertEquals(2, listOptions.size());
assertEquals(2, response.getData().getExtensionNextEventDl().getListItems().size());
}

@Test
Expand All @@ -117,7 +118,7 @@ public void givenNonValidAppeal_populateExtensionNextEventDropdown(State state)

DynamicList expected = new DynamicList(new DynamicListItem("", ""), listOptions);
assertEquals(expected, response.getData().getExtensionNextEventDl());
assertEquals(3, listOptions.size());
assertEquals(3, response.getData().getExtensionNextEventDl().getListItems().size());
}

@Test
Expand All @@ -136,7 +137,42 @@ public void givenAppealWithTimeExtension_populateDirectionTypeDropdown() {

DynamicList expected = new DynamicList(new DynamicListItem("", ""), listOptions);
assertEquals(expected, response.getData().getDirectionTypeDl());
assertEquals(4, listOptions.size());
assertEquals(4, response.getData().getDirectionTypeDl().getListItems().size());
}

@Test
public void givenSpecificBenefitCodeAppeal_populateDirectionTypeDropdown() {
for (String benefitCode : BENEFIT_CODES_FOR_ISSUE_AND_SEND_TO_ADMIN) {
when(callback.getEvent()).thenReturn(EventType.DIRECTION_ISSUED);
sscsCaseData.setBenefitCode(benefitCode);

List<DynamicListItem> listOptions = new ArrayList<>();
listOptions.add(new DynamicListItem(APPEAL_TO_PROCEED.toString(), APPEAL_TO_PROCEED.getLabel()));
listOptions.add(new DynamicListItem(PROVIDE_INFORMATION.toString(), PROVIDE_INFORMATION.getLabel()));
listOptions.add(new DynamicListItem(ISSUE_AND_SEND_TO_ADMIN.toString(), ISSUE_AND_SEND_TO_ADMIN.getLabel()));

PreSubmitCallbackResponse<SscsCaseData> response = handler.handle(ABOUT_TO_START, callback, USER_AUTHORISATION);

DynamicList expected = new DynamicList(new DynamicListItem("", ""), listOptions);
assertEquals(expected, response.getData().getDirectionTypeDl());
assertEquals(3, response.getData().getDirectionTypeDl().getListItems().size());
}
}

@Test
public void givenNonSpecificBenefitCodeAppeal_doNotPopulateIssueAndSendToAdmin() {
when(callback.getEvent()).thenReturn(EventType.DIRECTION_ISSUED);
sscsCaseData.setBenefitCode("001");

List<DynamicListItem> listOptions = new ArrayList<>();
listOptions.add(new DynamicListItem(APPEAL_TO_PROCEED.toString(), APPEAL_TO_PROCEED.getLabel()));
listOptions.add(new DynamicListItem(PROVIDE_INFORMATION.toString(), PROVIDE_INFORMATION.getLabel()));

PreSubmitCallbackResponse<SscsCaseData> response = handler.handle(ABOUT_TO_START, callback, USER_AUTHORISATION);

DynamicList expected = new DynamicList(new DynamicListItem("", ""), listOptions);
assertEquals(expected, response.getData().getDirectionTypeDl());
assertEquals(2, response.getData().getDirectionTypeDl().getListItems().size());
}

@Test
Expand All @@ -157,7 +193,7 @@ public void givenAppealWithReinstatementRequest_populateDirectionTypeDropdown()

DynamicList expected = new DynamicList(new DynamicListItem("", ""), listOptions);
assertEquals(expected, response.getData().getDirectionTypeDl());
assertEquals(4, listOptions.size());
assertEquals(4, response.getData().getDirectionTypeDl().getListItems().size());
}

@Test
Expand All @@ -177,7 +213,7 @@ public void givenAppealWithUrgentHearingEnabledAndUrgentCaseYes_populateDirectio

DynamicList expected = new DynamicList(new DynamicListItem("", ""), listOptions);
assertEquals(expected, response.getData().getDirectionTypeDl());
assertEquals(4, listOptions.size());
assertEquals(4, response.getData().getDirectionTypeDl().getListItems().size());
}

@Test
Expand All @@ -195,7 +231,7 @@ public void givenAppealWithUrgentHearingEnabledAndUrgentCaseNo_populateDirection

DynamicList expected = new DynamicList(new DynamicListItem("", ""), listOptions);
assertEquals(expected, response.getData().getDirectionTypeDl());
assertEquals(2, listOptions.size());
assertEquals(2, response.getData().getDirectionTypeDl().getListItems().size());
}

@Test
Expand All @@ -216,7 +252,7 @@ public void givenValidAppealWithTimeExtensionAndDirectionTypeDropdownAlreadyPopu

DynamicList expected = new DynamicList(new DynamicListItem(GRANT_EXTENSION.toString(), GRANT_EXTENSION.toString()), listOptions);
assertEquals(expected, response.getData().getDirectionTypeDl());
assertEquals(4, listOptions.size());
assertEquals(4, response.getData().getDirectionTypeDl().getListItems().size());
}

@Test
Expand All @@ -232,7 +268,7 @@ public void givenAppealWithNoTimeExtension_populateDirectionTypeDropdown() {

DynamicList expected = new DynamicList(new DynamicListItem("", ""), listOptions);
assertEquals(expected, response.getData().getDirectionTypeDl());
assertEquals(2, listOptions.size());
assertEquals(2, response.getData().getDirectionTypeDl().getListItems().size());
}

@Test
Expand All @@ -251,7 +287,7 @@ public void givenAppealWithHearingRecordingRequestOutstanding_populateDirectionT
PreSubmitCallbackResponse<SscsCaseData> response = handler.handle(ABOUT_TO_START, callback, USER_AUTHORISATION);

DynamicList expected = new DynamicList(new DynamicListItem("", ""), listOptions);
assertEquals(3, listOptions.size());
assertEquals(3, response.getData().getDirectionTypeDl().getListItems().size());
assertEquals(expected, response.getData().getDirectionTypeDl());
}

Expand All @@ -270,7 +306,7 @@ public void givenAppealWithNoHearingRecordingRequestOutstanding_doNotPopulateDir
PreSubmitCallbackResponse<SscsCaseData> response = handler.handle(ABOUT_TO_START, callback, USER_AUTHORISATION);

DynamicList expected = new DynamicList(new DynamicListItem("", ""), listOptions);
assertEquals(2, listOptions.size());
assertEquals(2, response.getData().getDirectionTypeDl().getListItems().size());
assertEquals(expected, response.getData().getDirectionTypeDl());
}

Expand Down
Loading

0 comments on commit 7ee4170

Please sign in to comment.