Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
8c9bc99
adding atrings and dummy condition
scottbdavey1993 Jan 27, 2026
c931e2f
adding date format into strings
scottbdavey1993 Jan 29, 2026
fc3103c
adding tests with dummy data
scottbdavey1993 Jan 29, 2026
9c0da8a
Merge branch 'master' into DTSSTCI-1276
scottbdavey1993 Jan 29, 2026
365787d
[DTSSTCI-1509] CICA bundle initial due date add holiday service
oleon23 Feb 5, 2026
272a7eb
[DTSSTCI-1509] add holiday service and update feign for bankholidays
oleon23 Feb 12, 2026
fa4cc5e
[DTSSTCI-1509] update holiday calculation
oleon23 Feb 12, 2026
db648fe
[DTSSTCI-1509] remove trailing lines
oleon23 Feb 12, 2026
79b3490
Merge branch 'master' into DTSSTCI-1509-new
oleon23 Feb 12, 2026
19bd82e
Merge branch 'master' into DTSSTCI-1509-new
oleon23 Feb 13, 2026
fb01d36
[DTSSTCI-1509] fix checkstyle
oleon23 Feb 13, 2026
eea05ce
Merge branch 'master' into DTSSTCI-1509-new
oleon23 Feb 13, 2026
57375dc
[DTSSTCI-1649] add test junit-platform dependency
oleon23 Feb 13, 2026
84da91d
[DTSSTCI-1509] update bankholiday check and tests
oleon23 Feb 19, 2026
981193d
Merge branch 'master' into DTSSTCI-1509-new
oleon23 Feb 19, 2026
b960a11
[DTSSTCI-1509] Remove missed comments
oleon23 Feb 19, 2026
07f7ae8
Merge branch 'master' into DTSSTCI-1509-new
oleon23 Feb 19, 2026
8ce0476
[DTSSTCI-1509] suppress unneccessary tests in bankholiday service
oleon23 Feb 19, 2026
2a457f4
Merge remote-tracking branch 'origin/DTSSTCI-1509-new' into DTSSTCI-1…
oleon23 Feb 19, 2026
3f56e2d
[DTSSTCI-1509] add tests for service but suppress model and config
oleon23 Feb 19, 2026
341c307
[DTSSTCI-1509] fix sonar issues
oleon23 Feb 19, 2026
1e9370c
[DTSSTCI-1509] fix checkstyle test
oleon23 Feb 19, 2026
60893c8
[DTSSTCI-1509] update IT
oleon23 Feb 19, 2026
3701e67
[DTSSTCI-1509] update IT
oleon23 Feb 19, 2026
eae77fe
[DTSSTCI-1509] fix IT date response format
oleon23 Feb 19, 2026
9319ca9
[DTSSTCI-1509] update date field label and add to CICA details tab
oleon23 Feb 19, 2026
c38e148
Merge branch 'master' into DTSSTCI-1509-new
oleon23 Feb 25, 2026
10b1f35
merging master into branch
MiddlehurstBen Mar 4, 2026
59e70ea
adding atrings and dummy condition
scottbdavey1993 Jan 27, 2026
50bbe21
adding date format into strings
scottbdavey1993 Jan 29, 2026
8dc066b
adding tests with dummy data
scottbdavey1993 Jan 29, 2026
310f943
Update dependency org.springdoc:springdoc-openapi-starter-webmvc-ui t…
renovate[bot] Mar 1, 2026
38e4999
Update dependency org.flywaydb:flyway-database-postgresql to v11.20.3…
renovate[bot] Mar 1, 2026
accafc8
Update plugin org.owasp.dependencycheck to v12.2.0 (#2448)
renovate[bot] Mar 1, 2026
37d5f1e
Update plugin au.com.dius.pact to v4.6.20 (#2447)
renovate[bot] Mar 2, 2026
886a932
flywaydb build fix (#2475)
pr00279 Mar 2, 2026
57043c5
adding bundle date wip
MiddlehurstBen Mar 5, 2026
34e332f
added changes and updated unit tests
MiddlehurstBen Mar 9, 2026
80f32c5
Merge branch 'DTSSTCI-1276' of https://github.com/hmcts/sptribs-case-…
MiddlehurstBen Mar 9, 2026
ddd9f5b
added more tests
MiddlehurstBen Mar 9, 2026
89249b6
Merge branch 'master' of https://github.com/hmcts/sptribs-case-api in…
MiddlehurstBen Mar 9, 2026
f37ac86
merging master into current
MiddlehurstBen Mar 20, 2026
0d796d2
added more tests for date in time/out of time
MiddlehurstBen Mar 20, 2026
742e585
remove changes to build.gradle
MiddlehurstBen Mar 20, 2026
d66fa38
updates based on PR comments
MiddlehurstBen Mar 27, 2026
34b1321
Merge branch 'master' of https://github.com/hmcts/sptribs-case-api in…
MiddlehurstBen Mar 27, 2026
2356f8b
Merge branch 'master' of https://github.com/hmcts/sptribs-case-api in…
MiddlehurstBen Mar 30, 2026
6a649dc
updated email response constants & fixed broken tests
MiddlehurstBen Mar 30, 2026
f8a04c1
fixing failing tests
MiddlehurstBen Mar 30, 2026
4321428
testing DST test fix
MiddlehurstBen Mar 30, 2026
0d1c9e5
updated build.gradle timezone
MiddlehurstBen Mar 30, 2026
21170f4
removed test changes
MiddlehurstBen Mar 31, 2026
e83ccfc
Merge branch 'master' of https://github.com/hmcts/sptribs-case-api in…
MiddlehurstBen Apr 1, 2026
514d177
updated logic and tests
MiddlehurstBen Apr 1, 2026
bca77e6
fixed failing test
MiddlehurstBen Apr 1, 2026
f1cd456
fixed failing IT tests
MiddlehurstBen Apr 1, 2026
beed60f
formatted the date to dd/MM/yyyy
MiddlehurstBen Apr 1, 2026
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 @@ -13,13 +13,15 @@
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import uk.gov.hmcts.ccd.sdk.type.YesOrNo;
import uk.gov.hmcts.sptribs.caseworker.model.CaseIssue;
import uk.gov.hmcts.sptribs.ciccase.model.CaseData;
import uk.gov.hmcts.sptribs.ciccase.model.CicCase;
import uk.gov.hmcts.sptribs.common.config.WebMvcConfig;
import uk.gov.hmcts.sptribs.notification.NotificationServiceCIC;
import uk.gov.hmcts.sptribs.testutil.IdamWireMock;

import java.time.LocalDate;
import java.util.Set;

import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson;
Expand Down Expand Up @@ -160,6 +162,8 @@ void shouldReturnConfirmationMessageIfNotificationsDispatchedOnSubmitted() throw
.respondentEmail("respondent@test.com")
.applicantFullName("Applicant Name")
.applicantEmailAddress("applicant@test.com")
.respondentBundleDueDate(LocalDate.now())
.isCaseInTime(YesOrNo.YES)
.build()
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import uk.gov.hmcts.ccd.sdk.type.DynamicListElement;
import uk.gov.hmcts.ccd.sdk.type.DynamicMultiSelectList;
import uk.gov.hmcts.ccd.sdk.type.ListValue;
import uk.gov.hmcts.ccd.sdk.type.YesOrNo;
import uk.gov.hmcts.sptribs.caseworker.model.CaseIssue;
import uk.gov.hmcts.sptribs.ciccase.model.CaseData;
import uk.gov.hmcts.sptribs.ciccase.model.CicCase;
Expand All @@ -23,6 +24,8 @@
import uk.gov.hmcts.sptribs.notification.dispatcher.CaseIssuedNotification;
import uk.gov.hmcts.sptribs.notification.model.NotificationRequest;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -35,6 +38,7 @@
import static uk.gov.hmcts.sptribs.ciccase.model.ContactPreferenceType.POST;
import static uk.gov.hmcts.sptribs.common.CommonConstants.ADDRESS_LINE_1;
import static uk.gov.hmcts.sptribs.common.CommonConstants.ADDRESS_LINE_7;
import static uk.gov.hmcts.sptribs.common.CommonConstants.CIC_BUNDLE_DUE_DATE_TEXT;
import static uk.gov.hmcts.sptribs.common.CommonConstants.CIC_CASE_NUMBER;
import static uk.gov.hmcts.sptribs.common.CommonConstants.CIC_CASE_RESPONDENT_NAME;
import static uk.gov.hmcts.sptribs.common.CommonConstants.CIC_CASE_SUBJECT_NAME;
Expand Down Expand Up @@ -263,12 +267,60 @@ void shouldSendLetterToRepresentative() {
}

@Test
void shouldSendEmailToRespondent() {
void shouldSendEmailToRespondentDateInTime() {

LocalDate today = LocalDate.now();
String todayFormatted = today.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"));

final CaseData data = CaseData.builder()
.cicCase(CicCase.builder()
.fullName("Subject Name")
.respondentName("Respondent Name")
.alternativeRespondentEmail("test@email.com")
.respondentBundleDueDate(today)
.isCaseInTime(YesOrNo.YES)
.build())
.build();

final Map<String, Object> expectedTemplateVars = Map.of(
TRIBUNAL_NAME, CIC,
CIC_CASE_NUMBER, TEST_CASE_ID.toString(),
CIC_CASE_SUBJECT_NAME, "Subject Name",
CONTACT_NAME, "Respondent Name",
CIC_CASE_RESPONDENT_NAME, "Respondent Name",
CIC_BUNDLE_DUE_DATE_TEXT, "You should provide the tribunal and the Subject/Applicant/Representative "
+ "with a case bundle by " + todayFormatted
);

caseIssuedNotification.sendToRespondent(data, TEST_CASE_ID.toString());

verify(notificationServiceCIC).sendEmail(notificationRequestCaptor.capture(), eq(TEST_CASE_ID.toString()));

NotificationRequest notificationRequest = notificationRequestCaptor.getValue();

assertThat(notificationRequest.getDestinationAddress())
.isEqualTo("test@email.com");
assertThat(notificationRequest.getTemplate())
.isEqualTo(CASE_ISSUED_RESPONDENT_EMAIL);
assertThat(notificationRequest.getTemplateVars())
.containsAllEntriesOf(expectedTemplateVars);
assertThat(notificationRequest.getUploadedDocuments())
.isNull();
}

@Test
void shouldSendEmailToRespondentDateOutOfTime() {

LocalDate today = LocalDate.now();
String todayFormatted = today.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"));

final CaseData data = CaseData.builder()
.cicCase(CicCase.builder()
.fullName("Subject Name")
.respondentName("Respondent Name")
.alternativeRespondentEmail("test@email.com")
.respondentBundleDueDate(today)
.isCaseInTime(YesOrNo.NO)
.build())
.build();

Expand All @@ -277,7 +329,10 @@ void shouldSendEmailToRespondent() {
CIC_CASE_NUMBER, TEST_CASE_ID.toString(),
CIC_CASE_SUBJECT_NAME, "Subject Name",
CONTACT_NAME, "Respondent Name",
CIC_CASE_RESPONDENT_NAME, "Respondent Name"
CIC_CASE_RESPONDENT_NAME, "Respondent Name",
CIC_BUNDLE_DUE_DATE_TEXT, "Out of time appeal - You should provide the tribunal with a case bundle by "
+ todayFormatted
+ ". Do not issue to the Subject/Applicant/Representative until we notify you the appeal has been admitted."
);

caseIssuedNotification.sendToRespondent(data, TEST_CASE_ID.toString());
Expand All @@ -297,7 +352,82 @@ void shouldSendEmailToRespondent() {
}

@Test
void shouldSendEmailToRespondentWithDocument() {
void shouldSendEmailToRespondentWithDocumentDateInTime() {
final String documentLabel =
"[Document 1.pdf A - First decision](http://exui.net/documents/5e32a0d2-9b37-4548-b007-b9b2eb580d0a/binary)";
final DynamicListElement listItem = DynamicListElement
.builder()
.label(documentLabel)
.code(UUID.randomUUID())
.build();
final Document document = Document.builder()
.categoryId("A")
.filename("Document 1.pdf")
.binaryUrl("http://exui.net/documents/5e32a0d2-9b37-4548-b007-b9b2eb580d0a/binary")
.url("http://exui.net/documents/5e32a0d2-9b37-4548-b007-b9b2eb580d0a")
.build();

final CaseworkerCICDocument cicDocument = CaseworkerCICDocument.builder()
.documentLink(document)
.documentEmailContent("Description")
.documentCategory(DocumentType.EVIDENCE_CORRESPONDENCE_FROM_THE_APPELLANT)
.build();
final List<ListValue<CaseworkerCICDocument>> applicantCaseDocuments =
List.of(ListValue.<CaseworkerCICDocument>builder().value(cicDocument).build());
final List<CaseworkerCICDocument> selectedDocuments = List.of(cicDocument);

final List<DynamicListElement> listItems = new ArrayList<>();
listItems.add(listItem);

final DynamicMultiSelectList documentList = new DynamicMultiSelectList();
documentList.setListItems(listItems);
documentList.setValue(listItems);

LocalDate today = LocalDate.now();
String todayFormatted = today.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"));

final CaseData data = CaseData.builder()
.cicCase(CicCase.builder()
.fullName("Subject Name")
.respondentName("Respondent Name")
.alternativeRespondentEmail("test@email.com")
.applicantDocumentsUploaded(applicantCaseDocuments)
.respondentBundleDueDate(today)
.isCaseInTime(YesOrNo.YES)
.build())
.caseIssue(CaseIssue.builder()
.documentList(documentList)
.build())
.build();

final Map<String, Object> expectedTemplateVars = Map.of(
TRIBUNAL_NAME, CIC,
CIC_CASE_NUMBER, TEST_CASE_ID.toString(),
CIC_CASE_SUBJECT_NAME, "Subject Name",
CONTACT_NAME, "Respondent Name",
CIC_CASE_RESPONDENT_NAME, "Respondent Name",
CIC_BUNDLE_DUE_DATE_TEXT, "You should provide the tribunal and the Subject/Applicant/Representative "
+ "with a case bundle by " + todayFormatted
);

caseIssuedNotification.sendToRespondent(data, TEST_CASE_ID.toString());

verify(notificationServiceCIC).sendEmail(notificationRequestCaptor.capture(), eq(selectedDocuments), eq(TEST_CASE_ID.toString()));

NotificationRequest notificationRequest = notificationRequestCaptor.getValue();

assertThat(notificationRequest.getDestinationAddress())
.isEqualTo("test@email.com");
assertThat(notificationRequest.getTemplate())
.isEqualTo(CASE_ISSUED_RESPONDENT_EMAIL);
assertThat(notificationRequest.getTemplateVars())
.containsAllEntriesOf(expectedTemplateVars);
assertThat(notificationRequest.getUploadedDocuments())
.isNotNull();
}

@Test
void shouldSendEmailToRespondentWithDocumentDateOutOfTime() {
final String documentLabel =
"[Document 1.pdf A - First decision](http://exui.net/documents/5e32a0d2-9b37-4548-b007-b9b2eb580d0a/binary)";
final DynamicListElement listItem = DynamicListElement
Expand Down Expand Up @@ -328,12 +458,17 @@ void shouldSendEmailToRespondentWithDocument() {
documentList.setListItems(listItems);
documentList.setValue(listItems);

LocalDate today = LocalDate.now();
String todayFormatted = today.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"));

final CaseData data = CaseData.builder()
.cicCase(CicCase.builder()
.fullName("Subject Name")
.respondentName("Respondent Name")
.alternativeRespondentEmail("test@email.com")
.applicantDocumentsUploaded(applicantCaseDocuments)
.respondentBundleDueDate(today)
.isCaseInTime(YesOrNo.NO)
.build())
.caseIssue(CaseIssue.builder()
.documentList(documentList)
Expand All @@ -345,7 +480,10 @@ void shouldSendEmailToRespondentWithDocument() {
CIC_CASE_NUMBER, TEST_CASE_ID.toString(),
CIC_CASE_SUBJECT_NAME, "Subject Name",
CONTACT_NAME, "Respondent Name",
CIC_CASE_RESPONDENT_NAME, "Respondent Name"
CIC_CASE_RESPONDENT_NAME, "Respondent Name",
CIC_BUNDLE_DUE_DATE_TEXT, "Out of time appeal - You should provide the tribunal with a case bundle by "
+ todayFormatted
+ ". Do not issue to the Subject/Applicant/Representative until we notify you the appeal has been admitted."
);

caseIssuedNotification.sendToRespondent(data, TEST_CASE_ID.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"orderDueDates" : [ ],
"cicCaseSelectedDocument" : { }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public AboutToStartOrSubmitResponse<CaseData, State> aboutToSubmit(final CaseDet
LocalDate dueDate = LocalDate.now().plusDays(ALLOWED_RESPONSE_TIME_DAYS);
LocalDate verifiedDueDate = isWorkingDay(dueDate, bankHolidays) ? dueDate : getNextWorkingDay(dueDate, bankHolidays);
cicCase.setRespondentBundleDueDate(verifiedDueDate);

return AboutToStartOrSubmitResponse.<CaseData, State>builder()
.data(caseData)
.state(details.getState())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public final class CommonConstants {
public static final String CIC_CASE_RECORD_HEARING_1FACE_TO_FACE = "hearingFormatFaceToFace";
public static final String CIC_CASE_RECORD_REMOTE_HEARING = "Remote Hearing";
public static final String CIC_CASE_UK_DATE_FORMAT = "dd-MM-yyyy";
public static final String CIC_BUNDLE_DUE_DATE_TEXT = "bundleDueDateText";

public static final String HEARING_DATE = "HearingDate";
public static final String HEARING_TIME = "HearingTime";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package uk.gov.hmcts.sptribs.notification;

public enum EmailRespondentResponses {

OUT_OF_TIME_RESPONSE(
"Out of time appeal - You should provide the tribunal with a case bundle by %s. "
+ "Do not issue to the Subject/Applicant/Representative until we notify you the appeal has been admitted."
),
IN_TIME_RESPONSE(
"You should provide the tribunal and the "
+ "Subject/Applicant/Representative with a case bundle by %s"
);

private final String template;

EmailRespondentResponses(String template) {
this.template = template;
}

public String format(String date) {
return String.format(template, date);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,22 @@
import uk.gov.hmcts.sptribs.ciccase.model.NotificationResponse;
import uk.gov.hmcts.sptribs.common.CommonConstants;
import uk.gov.hmcts.sptribs.document.model.CaseworkerCICDocument;
import uk.gov.hmcts.sptribs.notification.EmailRespondentResponses;
import uk.gov.hmcts.sptribs.notification.NotificationHelper;
import uk.gov.hmcts.sptribs.notification.NotificationServiceCIC;
import uk.gov.hmcts.sptribs.notification.PartiesNotification;
import uk.gov.hmcts.sptribs.notification.TemplateName;
import uk.gov.hmcts.sptribs.notification.model.NotificationRequest;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import static uk.gov.hmcts.sptribs.notification.EmailRespondentResponses.IN_TIME_RESPONSE;
import static uk.gov.hmcts.sptribs.notification.EmailRespondentResponses.OUT_OF_TIME_RESPONSE;

@RequiredArgsConstructor
@Component
@Slf4j
Expand Down Expand Up @@ -98,6 +104,10 @@ public void sendToRespondent(final CaseData caseData, final String caseNumber) {
final Map<String, Object> templateVarsRespondent = notificationHelper.getRespondentCommonVars(caseNumber, caseData);
templateVarsRespondent.put(CommonConstants.CIC_CASE_RESPONDENT_NAME, caseData.getCicCase().getRespondentName());

LocalDate dueDate = cicCase.getRespondentBundleDueDate();
templateVarsRespondent.put(CommonConstants.CIC_BUNDLE_DUE_DATE_TEXT,
cicCase.getIsCaseInTime().toBoolean() ? buildTimeString(true, dueDate) : buildTimeString(false, dueDate));

final NotificationResponse notificationResponse;
if (ObjectUtils.isNotEmpty(caseData.getCaseIssue().getDocumentList())) {
final Map<String, String> uploadedDocuments = getUploadedDocuments(caseData);
Expand All @@ -116,6 +126,17 @@ public void sendToRespondent(final CaseData caseData, final String caseNumber) {
}
}

private String buildTimeString(boolean isInTime, LocalDate dueDate) {
EmailRespondentResponses response = isInTime
? IN_TIME_RESPONSE
: OUT_OF_TIME_RESPONSE;

DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");
String formattedDate = dueDate.format(formatter);

return response.format(formattedDate);
}

private NotificationResponse sendEmailNotification(final Map<String, Object> templateVars, String toEmail,
TemplateName emailTemplateName, String caseReferenceNumber) {
return notificationService.sendEmail(
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ uk:
APPLICATION_RECEIVED_CY: '86e6988c-dfc8-43de-8890-e38269ee40d1'
CASE_ISSUED_CITIZEN_EMAIL: '03a0bbaa-10ee-4304-a1b1-6fdf76a2fd69'
CASE_ISSUED_CITIZEN_POST: 'eedc916f-088f-4653-99ed-b954e1dbd58d'
CASE_ISSUED_RESPONDENT_EMAIL: 'd90a4a2d-1406-48d3-a319-924cc8f67d5e'
CASE_ISSUED_RESPONDENT_EMAIL: 'a8f94ce2-e220-4879-83cf-486bec2c188f'
CASE_LINKED_EMAIL: '14633cea-db23-4a44-a477-3f3b37202b72'
CASE_LINKED_POST: 'd69207af-ed64-4a60-b0a3-224d429d8b17'
CASE_STAYED_EMAIL: '474266c4-f583-43b6-b464-3faad6567037'#
Expand Down
Loading
Loading