Skip to content

Hdpi 5213 confirm eviction update data model#1583

Open
tvr-hmcts wants to merge 18 commits intomasterfrom
HDPI-5213-Confirm-eviction-Update-data-model
Open

Hdpi 5213 confirm eviction update data model#1583
tvr-hmcts wants to merge 18 commits intomasterfrom
HDPI-5213-Confirm-eviction-Update-data-model

Conversation

@tvr-hmcts
Copy link
Copy Markdown
Contributor

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

Introduces the ability to confirm an eviction against an existing enforcement order, including persistence of eviction details and unavailable dates.

NOTE: Does not cover the Statement of Work at this time.

New ConfirmEvictionEntity and UnavailableDateEntity JPA entities with a one-to-many relationship for tracking dates the party is unavailable for eviction

New ConfirmEvictionRepository for persistence

Flyway migration creating enf_confirm_eviction and enf_unavailable_date tables, plus two new columns on enf_risk_profile

EnforcementOrderService additions: confirmEviction() method with mapping logic, and a new getClaimEntity() helper that throws IllegalStateException when no claim exists (for the save path)

…ion` table to store confirmed eviction details.
…risk profile with physical description fields.
…213-Confirm-eviction-Update-data-model

# Conflicts:
#	src/main/java/uk/gov/hmcts/reform/pcs/ccd/service/enforcetheorder/EnforcementOrderService.java
… replace case‑not‑found exception with clearer IllegalStateException. Update migration V067.
…213-Confirm-eviction-Update-data-model

# Conflicts:
#	src/main/java/uk/gov/hmcts/reform/pcs/ccd/service/enforcetheorder/EnforcementOrderService.java
#	src/test/java/uk/gov/hmcts/reform/pcs/ccd/service/enforcetheorder/EnforcementOrderServiceTest.java
…ename `hasUnavaliableDates` to `hasUnavailableDates`. Simplify `retrieveEnforcementOrderEntity` to return first order or null. Update migration V071 to include `enf_unavailable_date` and adjust schema. Remove obsolete tests and add new ones for the updated model.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

CCD diff summary

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

AuthorisationCaseField/citizen.json

UserRoleCaseFieldIDCRUD
-citizen
-tenancy_DetailsOfOtherTypeOfTenancyLicence
-CRUD

AuthorisationCaseField/caseworker-pcs.json

UserRoleCaseFieldIDCRUD
-caseworker-pcs
-tenancy_DetailsOfOtherTypeOfTenancyLicence
-R
-caseworker-pcs
-tenancy_TenancyLicenceDate
-R

ComplexTypes/2_DefendantResponses.json

ListElementCodeIDFieldTypeParameterFieldTypeElementLabel
-tenancyType
-DefendantResponses
-
-Text
- 
-tenancyStartDateCorrect
-DefendantResponses
-YesNoNotSure
-FixedRadioList
- 

ComplexTypes/1_PaymentAgreement.json

SearchableFieldTypeParameterListElementCodeIDFieldTypeElementLabel
-N
-YesNoNotSure
-repaymentPlanAgreed
-PaymentAgreement
-FixedRadioList
- 
-
-
-repaymentAgreedDetails
-PaymentAgreement
-Text
- 

… change confirmEviction to only require caseReference, return an empty set instead of null, simplify enforcement order retrieval. Update related tests accordingly.

import java.util.UUID;

public interface ConfirmEvictionRepository extends JpaRepository<ConfirmEvictionEntity, UUID> {
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 these names just be "Eviction" ? I know the event name is different but just sounds wrong similar to enforceTheOrder in the name

@@ -0,0 +1,95 @@
package uk.gov.hmcts.reform.pcs.ccd.entity.enforcetheorder;
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.

Shouldn't it be in confirmeviction package (for the event)

Set<EnforcementOrderEntity> enforcementEntitySet = claimEntity.getEnforcementOrders();
if (CollectionUtils.isEmpty(enforcementEntitySet)) {
Set<EnforcementOrderEntity> enforcementEntitySet = getEnforcementOrderEntities(caseReference);
if (enforcementEntitySet == null) {
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.

Need test case for empty enforcement cases scenarios

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.

Aleady is one - shouldReturnNullIfNotFoundInDatabase()


language_used VARCHAR(30),
created TIMESTAMP WITHOUT TIME ZONE NOT NULL,

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 add the DB column Statement of Truth leaving the entity, domain and mappings out (I did something similar in HDPI-5188). At least won't need to revisit with a alter table script later.

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.

It would still need to be altered. In order to put it in here I would need to make it nullable today. Then make it not nullable later.

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.

4 participants