Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f85c09a
initial commit of Summary page changes
Mar 10, 2026
5e5a643
Added Summary tab markup. Also Changed confirm eviction details page …
Mar 12, 2026
2051b40
I've added date formatters. Also have a current issue where i cannot…
Mar 16, 2026
f6229ee
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-4…
tvr-solirius Mar 16, 2026
464d212
[#4312] Update flyway version numbering.
tvr-solirius Mar 16, 2026
102f9d6
We can now toggle on the summary page
Mar 16, 2026
bcd77ad
Merge remote-tracking branch 'refs/remotes/origin/HDPI-4312-confirm-e…
Mar 16, 2026
dd08a0f
Added logs to see if we get pcs case objective for show condition
Mar 17, 2026
3d56407
Refactor confirm eviction event and related logic: rename the event t…
tvr-solirius Mar 20, 2026
5eb187a
Reverting local change
tvr-solirius Mar 20, 2026
25648ea
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-4…
tvr-solirius Mar 20, 2026
1d105e2
Move enforcement‑order handling into a dedicated mediator, removing t…
tvr-solirius Mar 20, 2026
3e6165b
Cleanup ConfirmEviction event and helpers: drop unused start method a…
tvr-solirius Mar 20, 2026
afbd098
Merge branch 'master' into HDPI-4312-confirm-eviction-summary
srinijg Mar 24, 2026
e294cb0
Merge branch 'master' into HDPI-4312-confirm-eviction-summary
srinijg Mar 24, 2026
2db4061
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-4…
tvr-solirius Mar 26, 2026
a5e7fb6
Flyway version update.
tvr-solirius Mar 26, 2026
8595499
Change of version in the flyway to the correct script this time :)
tvr-solirius Mar 26, 2026
3bcc795
Merge remote-tracking branch 'origin/master' into HDPI-4312-confirm-e…
tvr-solirius Mar 26, 2026
d68f6e1
flyway version update.
tvr-solirius Mar 26, 2026
1d6f98f
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-4…
tvr-solirius Mar 27, 2026
21df5f8
Refactor eviction summary formatting: extract date formatting to Date…
tvr-solirius Mar 27, 2026
cd9b42c
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-4…
tvr-solirius Mar 27, 2026
4541fd4
Flyway version update and fix of test
tvr-solirius Mar 27, 2026
1b81801
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-4…
tvr-solirius Mar 30, 2026
38fec04
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-4…
tvr-solirius Mar 31, 2026
31691ae
Version number update for flyway.
tvr-solirius Mar 31, 2026
d9573de
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-4…
tvr-solirius Mar 31, 2026
311bf85
Remove DateUtil and inline date formatting in EnforcementOrderMediato…
tvr-solirius Mar 31, 2026
d21fc54
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-4…
tvr-solirius Mar 31, 2026
51fd801
Change EnforcementOrderRepository to return list; update mediator to …
tvr-solirius Mar 31, 2026
84d7186
[#4312] Alteration based on PR comment of method hasBailiffDate which…
tvr-solirius Apr 1, 2026
f94dea1
[#4312] Method and local field rename
tvr-solirius Apr 1, 2026
70162e4
[#4312] Repackaging.
tvr-solirius Apr 1, 2026
6661d99
Update of the date displayed to align with the Figma design. Plus s…
tvr-solirius Apr 2, 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
3 changes: 2 additions & 1 deletion src/main/java/uk/gov/hmcts/reform/pcs/ccd/CaseType.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public void configure(final ConfigBuilder<PCSCase, State, UserRole> builder) {
.field("nextStepsMarkdown", NEVER_SHOW);

builder.tab("summary", "Summary")
.showCondition(ShowConditions.stateNotEquals(AWAITING_SUBMISSION_TO_HMCTS))
.label("confirmEvictionSummaryMarkupLabel", null, "${confirmEvictionSummaryMarkup}")
.field("confirmEvictionSummaryMarkup", NEVER_SHOW)
.field(PCSCase::getPropertyAddress);

builder.tab("CaseHistory", "History")
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/uk/gov/hmcts/reform/pcs/ccd/PCSCaseView.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import uk.gov.hmcts.reform.pcs.ccd.domain.PCSCase;
import uk.gov.hmcts.reform.pcs.ccd.domain.Party;
import uk.gov.hmcts.reform.pcs.ccd.domain.State;
import uk.gov.hmcts.reform.pcs.ccd.enforcementorder.EnforcementOrderMediator;
import uk.gov.hmcts.reform.pcs.ccd.entity.AddressEntity;
import uk.gov.hmcts.reform.pcs.ccd.entity.ClaimEntity;
import uk.gov.hmcts.reform.pcs.ccd.entity.PcsCaseEntity;
Expand Down Expand Up @@ -69,7 +70,7 @@ public class PCSCaseView implements CaseView<PCSCase, State> {
private final NoticeOfPossessionView noticeOfPossessionView;
private final StatementOfTruthView statementOfTruthView;
private final CaseFieldsView caseFieldsView;

private final EnforcementOrderMediator enforcementOrderMediator;

/**
* Invoked by CCD to load PCS cases by reference.
Expand All @@ -80,12 +81,12 @@ public PCSCase getCase(CaseViewRequest<State> request) {
long caseReference = request.caseRef();
State state = request.state();
PCSCase pcsCase = getSubmittedCase(caseReference);

boolean hasUnsubmittedCaseData = caseHasUnsubmittedData(caseReference, state);

caseFieldsView.setCaseFields(pcsCase);

setMarkdownFields(pcsCase, hasUnsubmittedCaseData);
enforcementOrderMediator.handleEnforcementRequirements(caseReference, pcsCase);

//allows indexing for Global Search
pcsCase.setSearchCriteria(new SearchCriteria());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,4 +532,10 @@ public class PCSCase {
)
private String caseManagementLocationFormatted;

@CCD(searchable = false)
private String confirmEvictionSummaryMarkup;

@CCD(searchable = false, access = {ClaimantAccess.class})
private YesOrNo showConfirmEvictionJourney;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package uk.gov.hmcts.reform.pcs.ccd.enforcementorder;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import uk.gov.hmcts.ccd.sdk.type.YesOrNo;
import uk.gov.hmcts.reform.pcs.ccd.domain.PCSCase;
import uk.gov.hmcts.reform.pcs.ccd.entity.ClaimEntity;
import uk.gov.hmcts.reform.pcs.ccd.entity.PcsCaseEntity;
import uk.gov.hmcts.reform.pcs.ccd.entity.enforcetheorder.EnforcementOrderEntity;
import uk.gov.hmcts.reform.pcs.ccd.repository.PcsCaseRepository;
import uk.gov.hmcts.reform.pcs.ccd.repository.enforcetheorder.EnforcementOrderRepository;
import uk.gov.hmcts.reform.pcs.exception.CaseNotFoundException;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Locale;
import java.util.Optional;

import static uk.gov.hmcts.reform.pcs.ccd.page.enforcetheorder.confirmeviction.MarkupContent.CONFIRM_EVICTION_SUMMARY_NO_DATES;
import static uk.gov.hmcts.reform.pcs.ccd.page.enforcetheorder.confirmeviction.MarkupContent.CONFIRM_EVICTION_SUMMARY_WITH_DATES;

@Component
@Slf4j
@AllArgsConstructor
public class EnforcementOrderMediator {

private final PcsCaseRepository pcsCaseRepository;
private final EnforcementOrderRepository enforcementOrderRepository;

public void handleEnforcementRequirements(long caseReference, PCSCase pcsCase) {
if (caseReference > 0 && pcsCase != null) {
getEnforcementOrder(caseReference).ifPresent(enforcementOrderEntity ->
Optional.ofNullable(enforcementOrderEntity.getBailiffDate())
.ifPresentOrElse(
date -> prepareEvictionWithDates(pcsCase, date),
() -> prepareEvictionWithNoDates(pcsCase)
));
}
}

Optional<EnforcementOrderEntity> getEnforcementOrder(long caseReference) {
PcsCaseEntity pcsCaseEntity = pcsCaseRepository.findByCaseReference(caseReference)
.orElseThrow(() -> new CaseNotFoundException(caseReference));
List<ClaimEntity> claims = pcsCaseEntity.getClaims();
if (claims != null && !claims.isEmpty()) {
// At this point we do not know which Enforcement Order the Confirm Eviction is placed against.
// this to be confirmed beyond this ticket scope (HDPI-4312)
List<EnforcementOrderEntity> enforcementOrderEntities = enforcementOrderRepository
.findByClaimId(claims.getFirst().getId());
if (!enforcementOrderEntities.isEmpty()) {
return Optional.of(enforcementOrderEntities.getFirst());
}
}
return Optional.empty();
}

private void prepareEvictionWithDates(PCSCase pcsCase, LocalDateTime localDateTime) {
pcsCase.setShowConfirmEvictionJourney(YesOrNo.YES);
pcsCase.setConfirmEvictionSummaryMarkup(String.format(
CONFIRM_EVICTION_SUMMARY_WITH_DATES,
formatDate(localDateTime),
getEvictionCancellationDeadline(localDateTime)));
}

private static void prepareEvictionWithNoDates(PCSCase pcsCase) {
pcsCase.setShowConfirmEvictionJourney(YesOrNo.NO);
pcsCase.setConfirmEvictionSummaryMarkup(CONFIRM_EVICTION_SUMMARY_NO_DATES);
}

public String formatDate(LocalDateTime localDateTime) {
DateTimeFormatter outputFormatter = DateTimeFormatter
.ofPattern("EEEE, d MMMM yyyy 'at' h:mm a", Locale.UK);
return localDateTime.format(outputFormatter);
}

public String getEvictionCancellationDeadline(LocalDateTime localDateTime) {
DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("d MMMM yyyy", Locale.UK);
return localDateTime.minusHours(72).format(outputFormatter);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToOne;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.type.SqlTypes;
import uk.gov.hmcts.reform.pcs.ccd.domain.enforcetheorder.EnforcementOrder;
import uk.gov.hmcts.reform.pcs.ccd.entity.ClaimEntity;

import java.time.LocalDateTime;
import java.util.UUID;

import static jakarta.persistence.FetchType.LAZY;
Expand All @@ -25,6 +28,8 @@
@Table(name = "enf_case")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class EnforcementOrderEntity {

@Id
Expand All @@ -43,4 +48,7 @@ public class EnforcementOrderEntity {
@OneToOne(mappedBy = "enforcementOrder", fetch = LAZY)
private WarrantEntity warrantDetails;

@Column(name = "bailiff_date")
private LocalDateTime bailiffDate;

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ public enum EventId {
enforceTheOrder,
respondPossessionClaim,
submitDefendantResponse,
createTestCase
createTestCase,
confirmEviction
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package uk.gov.hmcts.reform.pcs.ccd.event.confirmeviction;

import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
import uk.gov.hmcts.ccd.sdk.api.CCDConfig;
import uk.gov.hmcts.ccd.sdk.api.DecentralisedConfigBuilder;
import uk.gov.hmcts.ccd.sdk.api.Event;
import uk.gov.hmcts.ccd.sdk.api.EventPayload;
import uk.gov.hmcts.ccd.sdk.api.Permission;
import uk.gov.hmcts.ccd.sdk.api.callback.SubmitResponse;
import uk.gov.hmcts.reform.pcs.ccd.accesscontrol.UserRole;
import uk.gov.hmcts.reform.pcs.ccd.common.PageBuilder;
import uk.gov.hmcts.reform.pcs.ccd.domain.PCSCase;
import uk.gov.hmcts.reform.pcs.ccd.domain.State;
import uk.gov.hmcts.reform.pcs.ccd.page.enforcetheorder.confirmeviction.ConfirmEvictionConfigurer;

import static uk.gov.hmcts.reform.pcs.ccd.event.EventId.confirmEviction;

@Component
@AllArgsConstructor
public class ConfirmEviction implements CCDConfig<PCSCase, State, UserRole> {

private final ConfirmEvictionConfigurer confirmEvictionConfigurer;

@Override
public void configureDecentralised(DecentralisedConfigBuilder<PCSCase, State, UserRole> configBuilder) {
Event.EventBuilder<PCSCase, UserRole, State> eventBuilder =
configBuilder
.decentralisedEvent(confirmEviction.name(), this::submit)
.forAllStates()
.name("Confirm the eviction details")
.grant(Permission.CRUD, UserRole.PCS_SOLICITOR)
.showSummary();
confirmEvictionConfigurer.configurePages(new PageBuilder(eventBuilder));
}

private SubmitResponse<State> submit(EventPayload<PCSCase, State> eventPayload) {
return SubmitResponse.defaultResponse();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package uk.gov.hmcts.reform.pcs.ccd.page.enforcetheorder.confirmeviction;

import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
import uk.gov.hmcts.reform.pcs.ccd.common.PageBuilder;
import uk.gov.hmcts.reform.pcs.ccd.common.PageConfigurer;

@Component
@AllArgsConstructor
public class ConfirmEvictionConfigurer implements PageConfigurer {

@Override
public void configurePages(PageBuilder pageBuilder) {
pageBuilder
.add(new ConfirmEvictionDetailsPage())
.add(new EvictionDatePage());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package uk.gov.hmcts.reform.pcs.ccd.page.enforcetheorder.confirmeviction;

import uk.gov.hmcts.reform.pcs.ccd.common.CcdPageConfiguration;
import uk.gov.hmcts.reform.pcs.ccd.common.PageBuilder;
import uk.gov.hmcts.reform.pcs.ccd.page.CcdPage;

public class ConfirmEvictionDetailsPage implements CcdPageConfiguration, CcdPage {

public static final String CONFIRM_EVICTION_DETAILS_CONTENT = """
<p class="govuk-body">
The bailiff has arranged a date for the eviction and they need you to confirm if you are
available.
</p>
<p class="govuk-body">
They will also ask you to confirm if the person being evicted poses any risk.
</p>
<p class="govuk-body">
The bailiff needs this information to carry out the eviction safely. If you do not provide it,
they may not be able to complete the eviction.
</p>
<p class="govuk-body govuk-!-font-weight-bold govuk-!-font-size-24">What you’ll need
</p>
<p class="govuk-body govuk-!-margin-bottom-0">You’ll need to know:</p>
<ul class="govuk-list govuk-list--bullet">
<li class="govuk-!-font-size-19">who will attend the eviction (you, or someone else)</li>
<li class="govuk-!-font-size-19">if you (or they) can attend the eviction on the date suggested
by the bailiff</li>
</ul>
<p class="govuk-body govuk-!-margin-bottom-0">We will also ask you to:</p>
<ul class="govuk-list govuk-list--bullet">
<li class="govuk-!-font-size-19">describe the person who will be evicted</li>
<li class="govuk-!-font-size-19">tell us how to access the property</li>
<li class="govuk-!-font-size-19">book a locksmith (this is to make sure that the person being
evicted cannot return to the property)</li>
</ul>
<p class="govuk-body">
Once you have confirmed the eviction date, we’ll send you an email reminding you to book a
locksmith.
</p>
""";

@Override
public void addTo(PageBuilder pageBuilder) {
String pageKey = getPageKey();
pageBuilder
.page(pageKey)
.pageLabel("Confirm the eviction details")
.label(pageKey + "-line-separator", "---")
.label(pageKey + "-content", CONFIRM_EVICTION_DETAILS_CONTENT);
}

@Override
public String getPageKey() {
return CcdPage.derivePageKey(this.getClass());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package uk.gov.hmcts.reform.pcs.ccd.page.enforcetheorder.confirmeviction;

import uk.gov.hmcts.reform.pcs.ccd.common.CcdPageConfiguration;
import uk.gov.hmcts.reform.pcs.ccd.common.PageBuilder;
import uk.gov.hmcts.reform.pcs.ccd.page.CcdPage;

public class EvictionDatePage implements CcdPageConfiguration, CcdPage {

@Override
public void addTo(PageBuilder pageBuilder) {
String pageKey = getPageKey();
pageBuilder
.page(pageKey)
.pageLabel("The eviction date")
.label(pageKey + "-line-separator", "---");
}

@Override
public String getPageKey() {
return CcdPage.derivePageKey(this.getClass());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package uk.gov.hmcts.reform.pcs.ccd.page.enforcetheorder.confirmeviction;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class MarkupContent {

public static String CONFIRM_EVICTION_SUMMARY_WITH_DATES =
"""
<h2 class="govuk-heading-m govuk-!-padding-top-1">Confirm the eviction date</h2>
<p class="govuk-body govuk-!-padding-bottom-2">
The bailiff has given you an eviction date of %s.
</p>
<p class="govuk-body govuk-!-padding-bottom-2">
They need you to confirm if you are available on this date.
</p>
<p class="govuk-body govuk-!-padding-bottom-2">
You must confirm the eviction details before %s.
If you try to confirm the eviction after this
date, the bailiff will cancel your eviction.
</p>
<p class="govuk-body govuk-!-padding-bottom-2">
They will also ask you to confirm if the defendants
(the person or people being evicted) pose any risk to the
bailiff.
</p>
<p class="govuk-body govuk-!-padding-bottom-2">
The bailiff needs this information to carry out the eviction
safely.
</p>
<p class="govuk-body">
To confirm the eviction date, select ‘Confirm the eviction
date’ from the dropdown menu.
</p>
""";

public static String CONFIRM_EVICTION_SUMMARY_NO_DATES =
"""
<h2 class="govuk-heading-m govuk-!-padding-top-1">You cannot enforce the order at the moment</h2>
<p class="govuk-body govuk-!-padding-bottom-2">
You cannot enforce the order at the moment (use a bailiff to evict someone).
</p>
<p class="govuk-body govuk-!-font-weight-bold govuk-!-padding-bottom-2"> How to find out why you cannot
enforce the order
</p>
<p class="govuk-body govuk-!-margin-bottom-0">To find out why you cannot enforce the order, you can:</p>
<ul class="govuk-list govuk-list--bullet">
<li class="govuk-!-font-size-19">check the tab: ‘Case file view’ (you should see an order from the court,
explaining why you cannot enforce), or</li>
<li class="govuk-!-font-size-19">
<a href="https://www.gov.uk/find-court-tribunal"
rel="noreferrer noopener"
target="_blank" class="govuk-link">
contact your local court.</a> You will need to tell them your case number
(you can find this at the top of this page). If you do not know the name of your local court, select the
‘Money’ category and then the ‘Housing’ category to find it.</li>
</ul>
""";

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import org.springframework.data.jpa.repository.JpaRepository;
import uk.gov.hmcts.reform.pcs.ccd.entity.enforcetheorder.EnforcementOrderEntity;

import java.util.List;
import java.util.UUID;

public interface EnforcementOrderRepository extends JpaRepository<EnforcementOrderEntity, UUID> {

List<EnforcementOrderEntity> findByClaimId(UUID claimId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE enf_case
ADD COLUMN bailiff_date timestamp;
Loading
Loading