Skip to content

Commit

Permalink
PI-1991: Make address type optional
Browse files Browse the repository at this point in the history
  • Loading branch information
pmcphee77 committed Mar 18, 2024
1 parent 5726e30 commit c73f06b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import java.time.LocalDate
@Immutable
@Entity(name = "PersonalDetailsAddress")
@Table(name = "offender_address")
@SQLRestriction("soft_deleted = 0 and address_type_id is not null")
@SQLRestriction("soft_deleted = 0")
class PersonAddress(

@Column(name = "offender_id")
Expand All @@ -25,7 +25,7 @@ class PersonAddress(

@ManyToOne
@JoinColumn(name = "address_type_id")
val type: ReferenceData,
val type: ReferenceData?,

@Column(name = "building_name")
val buildingName: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ fun PersonAddress.toAddress() = Address.from(
verified = typeVerified,
lastUpdated = lastUpdated,
status = status.description,
type = type.description,
type = type?.description,
telephoneNumber = telephoneNumber,
lastUpdatedBy = Name(forename = lastUpdatedUser.forename, surname = lastUpdatedUser.surname)

Expand Down

0 comments on commit c73f06b

Please sign in to comment.