Skip to content

Hdpi 4312 confirm eviction summary#1550

Open
tvr-hmcts wants to merge 25 commits intomasterfrom
HDPI-4312-confirm-eviction-summary
Open

Hdpi 4312 confirm eviction summary#1550
tvr-hmcts wants to merge 25 commits intomasterfrom
HDPI-4312-confirm-eviction-summary

Conversation

@tvr-hmcts
Copy link
Copy Markdown
Contributor

https://tools.hmcts.net/jira/browse/HDPI-4312

This PR introduces the "Confirm Eviction" journey into the Possession Claim Service (PCS), allowing claimants to confirm eviction details once a bailiff date has been assigned.

  • Introduced to handle logic for displaying eviction requirements. EnforcementOrderMediator

  • Dynamically generates summary markup and determines if the "Confirm Eviction" journey should be visible based on the presence of a in the enforcement record. bailiffDate

  • Added a new confirmEviction event accessible to . PCS_SOLICITOR

  • Updated CaseType to include a new "Summary" tab field () and a hidden field for journey visibility control (). confirmEvictionSummaryMarkup``showConfirmEvictionJourney

  • Implemented new UI pages: and . ConfirmEvictionDetailsPage``EvictionDatePage

  • Added (Timestamp) to ( table) via a new flyway migration (V070). bailiffDate``EnforcementOrderEntity``enf_case

  • Updated domain model with necessary fields for eviction summaries. PCSCase

  • Added to . findByClaimId``EnforcementOrderRepository

  • Comprehensive unit tests for , PCSCaseView integration, and page configuration. EnforcementOrderMediator

  • Updated test case generation JSON files to support the new enforcement fields.

Aqib and others added 13 commits March 10, 2026 14:21
…viction-summary' into HDPI-4312-confirm-eviction-summary
…o `ConfirmEviction`, reorganise page configuration classes, update the event ID and imports, and adjust `PCSCaseView` to handle optional enforcement orders and bailiff dates with new date formatting helpers. Adjust repository import and update the test suite accordingly.
…he old `EvictionDatePage` and `EnforcementOrderRepository` from `PCSCaseView`. Update page configuration tests, helper imports, and add comprehensive tests for the new `EnforcementOrderMediator`. This refactor centralises date formatting, bailiff‑date checks, and UI markup generation.
…nd logger, make PageConfigurerHelper final with a private constructor, remove debug logs from the mediator, and hide the showConfirmEvictionJourney field in CaseType.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 20, 2026

CCD diff summary

👉 Full report: https://github.com/hmcts/pcs-api/actions/runs/23738235310?check_suite_focus=true

CaseField.json

RegularExpressionMaxSearchableMinFieldTypeParameterHintTextLabelIDFieldType
+
+
+
+
+
+
+<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>
+confirmEvictionDetails-content
+Label
+
+
+
+
+
+
+---
+confirmEvictionDetails-line-separator
+Label
+
+
+N
+
+
+
+ 
+confirmEvictionSummaryMarkup
+Text
+
+
+
+
+
+
+${confirmEvictionSummaryMarkup}
+confirmEvictionSummaryMarkupLabel
+Label
+
+
+
+
+
+
+---
+evictionDate-line-separator
+Label
+
+
+N
+
+
+
+ 
+showConfirmEvictionJourney
+YesOrNo

AuthorisationCaseEvent/AuthorisationCaseEvent.json

UserRoleCaseEventIDCRUD
+caseworker-pcs-solicitor
+confirmEviction
+CRUD

AuthorisationCaseField/caseworker-pcs-solicitor.json

UserRoleCaseFieldIDCRUD
+caseworker-pcs-solicitor
+confirmEvictionDetails-content
+CR
+caseworker-pcs-solicitor
+confirmEvictionDetails-line-separator
+CR
+caseworker-pcs-solicitor
+confirmEvictionSummaryMarkup
+R
+caseworker-pcs-solicitor
+confirmEvictionSummaryMarkupLabel
+R
+caseworker-pcs-solicitor
+evictionDate-line-separator
+CR
+caseworker-pcs-solicitor
+showConfirmEvictionJourney
+CRU

AuthorisationCaseField/DEFENDANT.json

UserRoleCaseFieldIDCRUD
+[DEFENDANT]
+confirmEvictionSummaryMarkup
+R
+[DEFENDANT]
+confirmEvictionSummaryMarkupLabel
+R

CaseEvent/confirmEviction.json

DescriptionEndButtonLabelIDNamePostConditionStatePreConditionState(s)PublishShowEventNotesShowSummary
+Confirm the eviction details
+Save and continue
+confirmEviction
+Confirm the eviction details
+*
+*
+N
+N
+Y

CaseEventToFields/confirmEviction.json

CaseEventIDCaseFieldIDDisplayContextPageColumnNumberPageDisplayOrderPageFieldDisplayOrderPageIDPageLabel
+confirmEviction
+confirmEvictionDetails-content
+READONLY
+1
+1
+2
+confirmEvictionDetails
+Confirm the eviction details
+confirmEviction
+confirmEvictionDetails-line-separator
+READONLY
+1
+1
+1
+confirmEvictionDetails
+Confirm the eviction details
+confirmEviction
+evictionDate-line-separator
+READONLY
+1
+2
+1
+evictionDate
+The eviction date

CaseTypeTab/2_summary.json

UserRoleTabShowConditionTabLabelTabIDTabFieldDisplayOrderTabDisplayOrderChannelCaseFieldIDFieldShowCondition
+
+
+Summary
+summary
+2
+2
+CaseWorker
+confirmEvictionSummaryMarkup
+[STATE]="NEVER_SHOW"
+
+
+Summary
+summary
+1
+2
+CaseWorker
+confirmEvictionSummaryMarkupLabel
-[STATE]!="AWAITING_SUBMISSION_TO_HMCTS" 
+

Summary

summary

-1 
+3

2

CaseWorker

propertyAddress

counter.incrementAndGet();
}

private PageConfigurerHelper() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor - could use Lombok declaration for this

pcsCase.setShowConfirmEvictionJourney(YesOrNo.YES);
pcsCase.setConfirmEvictionSummaryMarkup(String.format(
"""
<h2 class="govuk-heading-m govuk-!-padding-top-1">Confirm the eviction date</h2>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor - could the markup texts be externalised in constants ?

return instant.atZone(ZoneId.of("UTC")).format(outputFormatter);
}

private String minus72HoursFormatted(Instant instant) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the time amount be parameterised ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you mean the 72 hours element then it was within an earlier implementation, however 72 is the business rule here and it would always be 72 for this point.

I guess if this is useful in the future for other business cases then it could be refactored at that point so I went with being explicit to the business requirement.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think this method could be made more versatile instead of hardcoded.

Also maybe this could be moved to a Util class (static ?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will gut it ... make a reusable version and keep this method here as it enforces the business requirement with the method name.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is changed now.

.orElseThrow(() -> new CaseNotFoundException(caseReference));
List<ClaimEntity> claims = pcsCaseEntity.getClaims();
if (claims != null && !claims.isEmpty()) {
return enforcementOrderRepository.findByClaimId(claims.getFirst().getId());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know which type of enforcement case should be retrieved as there could be different ones linked to the same enf_case ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yer this is a pain point and had me stuck. Have had conversations with Nafees on this a few times.

It may just link to the latest ... which at the time ... I did not have HDPI-4220 which has adds the "created" field. However, again, the latest of which?

It is possible we may need the enforcement type to be applied to the enf_case table for this type of scenario but all of this is unknown at the moment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can find the enf_case associated with the warrant of possession if you use enforcementOrderService. retrieveEnforcementOrder.

Copy link
Copy Markdown
Contributor Author

@tvr-hmcts tvr-hmcts Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Confirm Eviction may not have come from that though.

}

Optional<EnforcementOrderEntity> getEnforcementOrder(long caseReference) {
PcsCaseEntity pcsCaseEntity = pcsCaseRepository.findByCaseReference(caseReference)
Copy link
Copy Markdown
Contributor

@guygrewal77 guygrewal77 Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use EnforcementOrderService.retrieveEnforcementOrder() to retrieve by case_reference and enforcement type as the eviction would follow from Warrant of Possession.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with the other comment this is where the sticking point is at the moment. This is coded up to the current 'knowledge' and there are changes on route.

I can not use that method suggested as it requires the SelectEnforcementType. If I overload the method within there ... then I am doing the same as what I am doing here in the EnforcementOrderMediator. The EnforcementOrderMediator purpose is from this point in the journey.

The sticking point is we do not know which the Confirm Eviction is against.

There can be multiple Eviction Orders against an Claim and from that multiple types of Evictions. In reality it will probably not be many but currently there is no link from the Confirm to the specific eviction the confirm is against.

With the de-prioritising of Enforcement and the unknown elements this is as close as we can get at the moment.


public interface EnforcementOrderRepository extends JpaRepository<EnforcementOrderEntity, UUID> {

Optional<EnforcementOrderEntity> findByClaimId(UUID claimId);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't need this if EnforcementOrderService is used to retrieve the Enforcement order.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah actually it is used earlier in the process.

…Util and summary markup to MarkupContent constants. Remove inline formatter logic and private constructor in PageConfigurerHelper. Update mediator to use new utilities and constants.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants