Skip to content

Commit

Permalink
Merge branch 'main' into feature/BR-59
Browse files Browse the repository at this point in the history
  • Loading branch information
karlfosterBCL authored Mar 7, 2025
2 parents 32c39ee + f1847af commit 639a5ba
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ data class AddressEntity(
@Id
val id: UUID = UUID.randomUUID(),
val addressId: Long,
val type: String? = null,
val status: String? = null,
val buildingName: String? = null,
val addressNumber: String? = null,
val streetName: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty

data class Address(
val addressId: Long,
val type: String? = null,
val status: String? = null,
val buildingName: String? = null,
@JsonProperty("buildingNumber")
val addressNumber: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class BreachNoticeService(

private fun AddressEntity.toModel() = Address(
addressId = addressId,
type = type,
status = status,
buildingName = buildingName,
addressNumber = addressNumber,
streetName = streetName,
Expand All @@ -226,7 +226,7 @@ class BreachNoticeService(

private fun Address.toEntity(existingEntity: AddressEntity? = null) = existingEntity?.copy(
addressId = addressId,
type = type,
status = status,
buildingName = buildingName,
addressNumber = addressNumber,
streetName = streetName,
Expand All @@ -236,7 +236,7 @@ class BreachNoticeService(
postcode = postcode,
) ?: AddressEntity(
addressId = addressId,
type = type,
status = status,
buildingName = buildingName,
addressNumber = addressNumber,
streetName = streetName,
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/db/migration/V1_4__address_status.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE public.address RENAME COLUMN type to status;
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class BreachNoticeCrudTests : IntegrationTestBase() {
completedDate = LocalDateTime.now(),
offenderAddress = Address(
addressId = 25,
type = "ENDO",
status = "ENDO",
buildingName = "MOO",
),
replyAddress = null,
Expand Down Expand Up @@ -129,7 +129,7 @@ class BreachNoticeCrudTests : IntegrationTestBase() {
completedDate = LocalDateTime.now(),
offenderAddress = Address(
addressId = 25,
type = "ENDO",
status = "ENDO",
buildingName = "MOO",
),
replyAddress = null,
Expand Down

0 comments on commit 639a5ba

Please sign in to comment.