Conversation
… retreive an enforcement
…312-confirm-eviction-summary
…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.
…312-confirm-eviction-summary
…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.
CCD diff summary👉 Full report: https://github.com/hmcts/pcs-api/actions/runs/23738235310?check_suite_focus=true CaseField.json
AuthorisationCaseEvent/AuthorisationCaseEvent.json
AuthorisationCaseField/caseworker-pcs-solicitor.json
AuthorisationCaseField/DEFENDANT.json
CaseEvent/confirmEviction.json
CaseEventToFields/confirmEviction.json
CaseTypeTab/2_summary.json
|
src/main/java/uk/gov/hmcts/reform/pcs/ccd/entity/enforcetheorder/EnforcementOrderEntity.java
Show resolved
Hide resolved
| counter.incrementAndGet(); | ||
| } | ||
|
|
||
| private PageConfigurerHelper() { |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
Minor - could the markup texts be externalised in constants ?
| return instant.atZone(ZoneId.of("UTC")).format(outputFormatter); | ||
| } | ||
|
|
||
| private String minus72HoursFormatted(Instant instant) { |
There was a problem hiding this comment.
Could the time amount be parameterised ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I still think this method could be made more versatile instead of hardcoded.
Also maybe this could be moved to a Util class (static ?)
There was a problem hiding this comment.
I will gut it ... make a reusable version and keep this method here as it enforces the business requirement with the method name.
There was a problem hiding this comment.
This is changed now.
…312-confirm-eviction-summary
…312-confirm-eviction-summary
| .orElseThrow(() -> new CaseNotFoundException(caseReference)); | ||
| List<ClaimEntity> claims = pcsCaseEntity.getClaims(); | ||
| if (claims != null && !claims.isEmpty()) { | ||
| return enforcementOrderRepository.findByClaimId(claims.getFirst().getId()); |
There was a problem hiding this comment.
Do we know which type of enforcement case should be retrieved as there could be different ones linked to the same enf_case ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
You can find the enf_case associated with the warrant of possession if you use enforcementOrderService. retrieveEnforcementOrder.
There was a problem hiding this comment.
The Confirm Eviction may not have come from that though.
| } | ||
|
|
||
| Optional<EnforcementOrderEntity> getEnforcementOrder(long caseReference) { | ||
| PcsCaseEntity pcsCaseEntity = pcsCaseRepository.findByCaseReference(caseReference) |
There was a problem hiding this comment.
Could use EnforcementOrderService.retrieveEnforcementOrder() to retrieve by case_reference and enforcement type as the eviction would follow from Warrant of Possession.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Won't need this if EnforcementOrderService is used to retrieve the Enforcement order.
There was a problem hiding this comment.
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.
…312-confirm-eviction-summary
…312-confirm-eviction-summary
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.
EnforcementOrderMediatorDynamically generates summary markup and determines if the "Confirm Eviction" journey should be visible based on the presence of a in the enforcement record.
bailiffDateAdded a new
confirmEvictionevent accessible to .PCS_SOLICITORUpdated
CaseTypeto include a new "Summary" tab field () and a hidden field for journey visibility control ().confirmEvictionSummaryMarkup``showConfirmEvictionJourneyImplemented new UI pages: and .
ConfirmEvictionDetailsPage``EvictionDatePageAdded (Timestamp) to ( table) via a new flyway migration (
V070).bailiffDate``EnforcementOrderEntity``enf_caseUpdated domain model with necessary fields for eviction summaries.
PCSCaseAdded to .
findByClaimId``EnforcementOrderRepositoryComprehensive unit tests for ,
PCSCaseViewintegration, and page configuration.EnforcementOrderMediatorUpdated test case generation JSON files to support the new enforcement fields.