-
Notifications
You must be signed in to change notification settings - Fork 2
Hdpi 5213 confirm eviction update data model #1583
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
Open
tvr-hmcts
wants to merge
21
commits into
master
Choose a base branch
from
HDPI-5213-Confirm-eviction-Update-data-model
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
1f53675
Add enforcement_confirm_eviction migration: create `enf_confirm_evict…
tvr-solirius 2cb6480
Add confirm eviction entity, repository, and service methods; extend …
tvr-solirius 908864f
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-5…
tvr-solirius 80abba6
Refactor EnforcementOrderService: use new enforcement type lookup and…
tvr-solirius 7cf97ae
[#5213] Branch swithing
tvr-solirius 80e348a
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-5…
tvr-solirius 525d8f7
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-5…
tvr-solirius 14cf82f
Adding tests and update to the service for mapping.
tvr-solirius adce66d
flyway file rename and test update.
tvr-solirius 49964fd
Add `UnavailableDateEntity` and link it to `ConfirmEvictionEntity`; r…
tvr-solirius b1b6c98
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-5…
tvr-solirius 5bb77c5
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-5…
tvr-solirius 3a585fb
Rename of flyway script to update the numbering following merge from …
tvr-solirius b951c37
Refactor EnforcementOrderService: expose getEnforcementOrderEntities,…
tvr-solirius 30527c5
Alteration for Sonar
tvr-solirius b6ed360
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-5…
tvr-solirius 5605d27
[#5213] As per PR comments. Renamed to just Eviction
tvr-solirius bf2dab0
[#5213] Renaming as per PR comment to just be Eviction
tvr-solirius 20fcf25
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-5…
tvr-solirius 5ec9954
Flyway version update.
tvr-solirius c5b8ce9
Merge remote-tracking branch 'refs/remotes/origin/master' into HDPI-5…
tvr-solirius File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
97 changes: 97 additions & 0 deletions
97
src/main/java/uk/gov/hmcts/reform/pcs/ccd/entity/confirmeviction/EvictionEntity.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| package uk.gov.hmcts.reform.pcs.ccd.entity.confirmeviction; | ||
|
|
||
| import jakarta.persistence.CascadeType; | ||
| import jakarta.persistence.Column; | ||
| import jakarta.persistence.Entity; | ||
| import jakarta.persistence.EnumType; | ||
| import jakarta.persistence.Enumerated; | ||
| import jakarta.persistence.GeneratedValue; | ||
| import jakarta.persistence.GenerationType; | ||
| import jakarta.persistence.Id; | ||
| import jakarta.persistence.JoinColumn; | ||
| import jakarta.persistence.OneToMany; | ||
| import jakarta.persistence.OneToOne; | ||
| import jakarta.persistence.Table; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
| import lombok.Setter; | ||
| import org.hibernate.annotations.CreationTimestamp; | ||
| import org.hibernate.annotations.JdbcTypeCode; | ||
| import org.hibernate.type.SqlTypes; | ||
| import uk.gov.hmcts.reform.pcs.ccd.domain.LanguageUsed; | ||
| import uk.gov.hmcts.reform.pcs.ccd.domain.VerticalYesNo; | ||
| import uk.gov.hmcts.reform.pcs.ccd.entity.enforcetheorder.EnforcementOrderEntity; | ||
| import uk.gov.hmcts.reform.pcs.ccd.entity.enforcetheorder.UnavailableDateEntity; | ||
|
|
||
| import java.time.Instant; | ||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
| import java.util.UUID; | ||
|
|
||
| @Entity | ||
| @Builder | ||
| @Getter | ||
| @Setter | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| @Table(name = "enf_eviction") | ||
| public class EvictionEntity { | ||
|
|
||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.UUID) | ||
| private UUID id; | ||
|
|
||
| @OneToOne | ||
| @JoinColumn(name = "enf_case_id", nullable = false) | ||
| private EnforcementOrderEntity enforcementOrder; | ||
|
|
||
| @Enumerated(EnumType.STRING) | ||
| @JdbcTypeCode(SqlTypes.NAMED_ENUM) | ||
| private VerticalYesNo evictionDateConfirmed; | ||
|
|
||
| @Enumerated(EnumType.STRING) | ||
| @JdbcTypeCode(SqlTypes.NAMED_ENUM) | ||
| private VerticalYesNo hasUnavailableDates; | ||
|
|
||
| @OneToMany(mappedBy = "eviction", cascade = CascadeType.ALL, orphanRemoval = true) | ||
| @Builder.Default | ||
| private List<UnavailableDateEntity> unavailableDates = new ArrayList<>(); | ||
|
|
||
| private String beforeEvictionNameOrDepartment; | ||
|
|
||
| private String beforeEvictionTelephoneNumber; | ||
|
|
||
| private String beforeEvictionEmailAddress; | ||
|
|
||
| private String afterEvictionNameOrDepartment; | ||
|
|
||
| private String afterEvictionTelephoneNumber; | ||
|
|
||
| private String afterEvictionEmailAddress; | ||
|
|
||
| @Enumerated(EnumType.STRING) | ||
| @JdbcTypeCode(SqlTypes.NAMED_ENUM) | ||
| private VerticalYesNo difficultToAccess; | ||
|
|
||
| private String difficultToAccessDetails; | ||
|
|
||
| @Enumerated(EnumType.STRING) | ||
| @JdbcTypeCode(SqlTypes.NAMED_ENUM) | ||
| private VerticalYesNo anythingElse; | ||
|
|
||
| private String anythingElseDetails; | ||
|
|
||
| @Enumerated(EnumType.STRING) | ||
| @JdbcTypeCode(SqlTypes.NAMED_ENUM) | ||
| private VerticalYesNo confirmArrangementForAccess; | ||
|
|
||
| @Enumerated(EnumType.STRING) | ||
| private LanguageUsed languageUsed; | ||
|
|
||
| @CreationTimestamp | ||
| @Column(updatable = false, nullable = false) | ||
| private Instant created; | ||
|
|
||
| } |
42 changes: 42 additions & 0 deletions
42
src/main/java/uk/gov/hmcts/reform/pcs/ccd/entity/enforcetheorder/UnavailableDateEntity.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| package uk.gov.hmcts.reform.pcs.ccd.entity.enforcetheorder; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonBackReference; | ||
| import jakarta.persistence.Entity; | ||
| import jakarta.persistence.GeneratedValue; | ||
| import jakarta.persistence.GenerationType; | ||
| import jakarta.persistence.Id; | ||
| import jakarta.persistence.JoinColumn; | ||
| import jakarta.persistence.ManyToOne; | ||
| import jakarta.persistence.Table; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
| import lombok.Setter; | ||
| import uk.gov.hmcts.reform.pcs.ccd.entity.confirmeviction.EvictionEntity; | ||
|
|
||
| import java.time.LocalDate; | ||
| import java.util.UUID; | ||
|
|
||
| @Entity | ||
| @Builder | ||
| @Getter | ||
| @Setter | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| @Table(name = "enf_unavailable_date") | ||
| public class UnavailableDateEntity { | ||
|
|
||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.UUID) | ||
| private UUID id; | ||
|
|
||
| @ManyToOne | ||
| @JoinColumn(name = "enf_eviction_id", nullable = false) | ||
| @JsonBackReference | ||
| private EvictionEntity eviction; | ||
|
|
||
| private LocalDate unavailableDate; | ||
|
|
||
| } | ||
|
|
9 changes: 9 additions & 0 deletions
9
src/main/java/uk/gov/hmcts/reform/pcs/ccd/repository/enforcetheorder/EvictionRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package uk.gov.hmcts.reform.pcs.ccd.repository.enforcetheorder; | ||
|
|
||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import uk.gov.hmcts.reform.pcs.ccd.entity.confirmeviction.EvictionEntity; | ||
|
|
||
| import java.util.UUID; | ||
|
|
||
| public interface EvictionRepository extends JpaRepository<EvictionEntity, UUID> { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/main/resources/db/migration/V075__enforcement_confirm_eviction.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| CREATE TABLE enf_eviction( | ||
| id UUID PRIMARY KEY, | ||
| enf_case_id UUID NOT NULL REFERENCES enf_case (id) ON DELETE CASCADE, | ||
|
|
||
| -- The eviction date | ||
| eviction_date_confirmed YES_NO NOT NULL, | ||
|
|
||
| -- Dates when you can not attend an eviction | ||
| has_unavailable_dates YES_NO NOT NULL, | ||
|
|
||
| -- separate table for dates unavailable table | ||
|
|
||
| -- Contact for Bailiff | ||
| before_eviction_name_or_department VARCHAR(100), | ||
| before_eviction_telephone_number VARCHAR(20), | ||
| before_eviction_email_address VARCHAR(60), | ||
|
|
||
| after_eviction_name_or_department VARCHAR(100), | ||
| after_eviction_telephone_number VARCHAR(20), | ||
| after_eviction_email_address VARCHAR(60), | ||
|
|
||
| -- access to the property | ||
| difficult_to_access YES_NO, | ||
| difficult_to_access_details VARCHAR(6800), | ||
|
|
||
| -- Anything else that could help with the eviction | ||
| anything_else YES_NO, | ||
| anything_else_details VARCHAR(6800), | ||
|
|
||
| -- Gaining access to and securing the property after the eviction | ||
| confirm_arrangement_for_access YES_NO, | ||
|
|
||
| language_used VARCHAR(30), | ||
| created TIMESTAMP WITHOUT TIME ZONE NOT NULL, | ||
|
|
||
| CONSTRAINT unique_confirm_eviction_per_enforcement UNIQUE(enf_case_id) | ||
| ); | ||
|
|
||
| ALTER TABLE enf_risk_profile | ||
| ADD COLUMN physical_description_of_risk_defendant YES_NO; | ||
|
|
||
| ALTER TABLE enf_risk_profile | ||
| ADD COLUMN physical_description_of_risk_defendant_details VARCHAR(6800); | ||
|
|
||
| CREATE TABLE enf_unavailable_date ( | ||
| id UUID PRIMARY KEY, | ||
| enf_eviction_id UUID NOT NULL REFERENCES enf_eviction (id) ON DELETE CASCADE, | ||
| unavailable_date DATE NOT NULL | ||
| ); | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.