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-13440 Changing Trial Arrangements Date To 4 weeks Before The Hearing #5110

Merged
merged 4 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -11,6 +11,7 @@
import uk.gov.hmcts.reform.civil.handler.callback.camunda.dashboardnotifications.claimant.TrialArrangementsClaimantNotificationHandler;
import uk.gov.hmcts.reform.civil.model.CaseData;
import uk.gov.hmcts.reform.civil.sampledata.CaseDataBuilder;
import uk.gov.hmcts.reform.dashboard.data.TaskStatus;

import java.time.LocalDate;

Expand Down Expand Up @@ -43,7 +44,7 @@ void shouldCreateAddTrialArrangementsForClaimant() throws Exception {
.claimsTrack(ClaimsTrack.fastTrack)
.orderType(OrderType.DECIDE_DAMAGES)
.ccdCaseReference(Long.valueOf(caseId))
.hearingDate(LocalDate.of(2024, 03, 25))
.hearingDate(LocalDate.of(2024, 04, 1))
.build();

handler.handle(callbackParams(caseData));
Expand All @@ -62,6 +63,20 @@ void shouldCreateAddTrialArrangementsForClaimant() throws Exception {
jsonPath("$[0].descriptionCy").value(
"<p class=\"govuk-body\">Rhaid i chi <a href=\"{ADD_TRIAL_ARRANGEMENTS}\" class=\"govuk-link\">gadarnhau eich trefniadau treial</a> erbyn 4 Mawrth 2024. Mae hyn yn golygu y bydd angen i chi gadarnhau a yw'r achos yn barod ar gyfer treial ai peidio. Bydd angen i chi hefyd gadarnhau a yw'r amgylchiadau wedi newid ers i chi gwblhau'r holiadur cyfarwyddiadau. Cyfeiriwch at yr <a href=\"{VIEW_CLAIMANT_HEARING_REQS}\" rel=\"noopener noreferrer\" class=\"govuk-link\" target=\"_blank\">holiadur a gyflwynwyd gennych</a> os nad ydych yn siŵr beth ddywedoch chi o'r blaen.</p>")
);

doGet(BEARER_TOKEN, GET_TASKS_ITEMS_URL, caseId, "CLAIMANT")
.andExpectAll(
status().is(HttpStatus.OK.value()),
jsonPath("$[0].reference").value(caseId.toString()),
jsonPath("$[0].taskNameEn").value(
"<a href={ADD_TRIAL_ARRANGEMENTS} class=\"govuk-link\">Add the trial arrangements</a>"),
jsonPath("$[0].currentStatusEn").value(TaskStatus.ACTION_NEEDED.getName()),
jsonPath("$[0].taskNameCy").value(
"<a href={ADD_TRIAL_ARRANGEMENTS} class=\"govuk-link\">Ychwanegu trefniadau'r treial</a>"),
jsonPath("$[0].currentStatusCy").value(TaskStatus.ACTION_NEEDED.getWelshName()),
jsonPath("$[0].hintTextEn").value("Deadline is 12am on 4 March 2024"),
jsonPath("$[0].hintTextCy").value("Deadline is 12am on 4 Mawrth 2024")
);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import uk.gov.hmcts.reform.civil.handler.callback.camunda.dashboardnotifications.defendant.TrialArrangementsDefendantNotificationHandler;
import uk.gov.hmcts.reform.civil.model.CaseData;
import uk.gov.hmcts.reform.civil.sampledata.CaseDataBuilder;
import uk.gov.hmcts.reform.dashboard.data.TaskStatus;

import java.time.LocalDate;

Expand All @@ -35,7 +36,7 @@ void shouldCreateAddTrialArrangementsForDefendant() throws Exception {
.drawDirectionsOrderSmallClaims(NO)
.claimsTrack(ClaimsTrack.fastTrack)
.orderType(OrderType.DECIDE_DAMAGES)
.hearingDate(LocalDate.of(2024, 03, 25))
.hearingDate(LocalDate.of(2024, 04, 1))
.build();

handler.handle(callbackParams(caseData));
Expand All @@ -54,5 +55,19 @@ void shouldCreateAddTrialArrangementsForDefendant() throws Exception {
jsonPath("$[0].descriptionCy").value(
"<p class=\"govuk-body\">Rhaid i chi <a href=\"{ADD_TRIAL_ARRANGEMENTS}\" class=\"govuk-link\">gadarnhau eich trefniadau treial</a> erbyn 4 Mawrth 2024. Mae hyn yn golygu y bydd angen i chi gadarnhau a yw'r achos yn barod ar gyfer treial ai peidio. Bydd angen i chi hefyd gadarnhau a yw'r amgylchiadau wedi newid ers i chi gwblhau'r holiadur cyfarwyddiadau. Cyfeiriwch at yr <a href=\"{VIEW_DEFENDANT_HEARING_REQS}\" rel=\"noopener noreferrer\" class=\"govuk-link\" target=\"_blank\">holiadur a gyflwynwyd gennych</a> os nad ydych yn siŵr beth ddywedoch chi o'r blaen.</p>")
);

doGet(BEARER_TOKEN, GET_TASKS_ITEMS_URL, caseId, "DEFENDANT")
.andExpectAll(
status().is(HttpStatus.OK.value()),
jsonPath("$[0].reference").value(caseId.toString()),
jsonPath("$[0].taskNameEn").value(
"<a href={ADD_TRIAL_ARRANGEMENTS} class=\"govuk-link\">Add the trial arrangements</a>"),
jsonPath("$[0].currentStatusEn").value(TaskStatus.ACTION_NEEDED.getName()),
jsonPath("$[0].taskNameCy").value(
"<a href={ADD_TRIAL_ARRANGEMENTS} class=\"govuk-link\">Ychwanegu trefniadau'r treial</a>"),
jsonPath("$[0].currentStatusCy").value(TaskStatus.ACTION_NEEDED.getWelshName()),
jsonPath("$[0].hintTextEn").value("Deadline is 12am on 4 March 2024"),
jsonPath("$[0].hintTextCy").value("Deadline is 12am on 4 Mawrth 2024")
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ && nonNull(caseData.getActiveJudgment().getPaymentPlan())
}

if (nonNull(caseData.getHearingDate())) {
LocalDate date = caseData.getHearingDate().minusWeeks(3);
LocalDate date = caseData.getHearingDate().minusWeeks(4);
params.put("trialArrangementDeadlineEn", DateUtils.formatDate(date));
params.put("trialArrangementDeadlineCy", DateUtils.formatDateInWelsh(date));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ public void shouldMapAllParameters_WhenIsRequested() {
.isEqualTo("1 Ebrill 2024");
assertThat(result).extracting("hearingFee")
.isEqualTo("£100");
assertThat(result).extracting("trialArrangementDeadlineEn")
.isEqualTo("4 March 2024");
assertThat(result).extracting("trialArrangementDeadlineCy")
.isEqualTo("4 Mawrth 2024");
}

@ParameterizedTest
Expand Down
Loading