Skip to content

Commit

Permalink
Merge pull request #2677 from ministryofjustice/chore/remove-BedSearc…
Browse files Browse the repository at this point in the history
…hAttributes-enum-value

Remove camel case value from BedSearchAttribute enum
  • Loading branch information
daveawc authored Dec 12, 2024
2 parents 7567666 + 671bc23 commit 105c5ce
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ class BedSearchService(

val premisesCharacteristicsPropertyNames = propertyBedAttributes?.map {
when (it) {
BedSearchAttributes.singleOccupancy, BedSearchAttributes.SINGLE_OCCUPANCY -> BedSearchAttributes.SINGLE_OCCUPANCY.value
BedSearchAttributes.sharedProperty, BedSearchAttributes.SHARED_PROPERTY -> BedSearchAttributes.SHARED_PROPERTY.value
BedSearchAttributes.SINGLE_OCCUPANCY -> BedSearchAttributes.SINGLE_OCCUPANCY.value
BedSearchAttributes.SHARED_PROPERTY -> BedSearchAttributes.SHARED_PROPERTY.value
else -> ""
}
}
Expand All @@ -156,7 +156,7 @@ class BedSearchService(

val roomCharacteristicsPropertyNames = propertyBedAttributes?.map {
when (it) {
BedSearchAttributes.wheelchairAccessible, BedSearchAttributes.WHEELCHAIR_ACCESSIBLE -> BedSearchAttributes.WHEELCHAIR_ACCESSIBLE.value
BedSearchAttributes.WHEELCHAIR_ACCESSIBLE -> BedSearchAttributes.WHEELCHAIR_ACCESSIBLE.value
else -> ""
}
}
Expand Down
6 changes: 0 additions & 6 deletions src/main/resources/static/_shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4925,13 +4925,7 @@ components:
- isSharedProperty
- isSingleOccupancy
- isWheelchairAccessible
- sharedProperty
- singleOccupancy
- wheelchairAccessible
x-enum-varnames:
- SHARED_PROPERTY
- SINGLE_OCCUPANCY
- WHEELCHAIR_ACCESSIBLE
- sharedProperty
- singleOccupancy
- wheelchairAccessible
6 changes: 0 additions & 6 deletions src/main/resources/static/codegen/built-api-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9208,13 +9208,7 @@ components:
- isSharedProperty
- isSingleOccupancy
- isWheelchairAccessible
- sharedProperty
- singleOccupancy
- wheelchairAccessible
x-enum-varnames:
- SHARED_PROPERTY
- SINGLE_OCCUPANCY
- WHEELCHAIR_ACCESSIBLE
- sharedProperty
- singleOccupancy
- wheelchairAccessible
6 changes: 0 additions & 6 deletions src/main/resources/static/codegen/built-cas1-api-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6100,16 +6100,10 @@ components:
- isSharedProperty
- isSingleOccupancy
- isWheelchairAccessible
- sharedProperty
- singleOccupancy
- wheelchairAccessible
x-enum-varnames:
- SHARED_PROPERTY
- SINGLE_OCCUPANCY
- WHEELCHAIR_ACCESSIBLE
- sharedProperty
- singleOccupancy
- wheelchairAccessible
Cas1PremisesBasicSummary:
type: object
properties:
Expand Down
6 changes: 0 additions & 6 deletions src/main/resources/static/codegen/built-cas2-api-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5516,13 +5516,7 @@ components:
- isSharedProperty
- isSingleOccupancy
- isWheelchairAccessible
- sharedProperty
- singleOccupancy
- wheelchairAccessible
x-enum-varnames:
- SHARED_PROPERTY
- SINGLE_OCCUPANCY
- WHEELCHAIR_ACCESSIBLE
- sharedProperty
- singleOccupancy
- wheelchairAccessible
6 changes: 0 additions & 6 deletions src/main/resources/static/codegen/built-cas3-api-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5024,13 +5024,7 @@ components:
- isSharedProperty
- isSingleOccupancy
- isWheelchairAccessible
- sharedProperty
- singleOccupancy
- wheelchairAccessible
x-enum-varnames:
- SHARED_PROPERTY
- SINGLE_OCCUPANCY
- WHEELCHAIR_ACCESSIBLE
- sharedProperty
- singleOccupancy
- wheelchairAccessible
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ class BedSearchTest : IntegrationTestBase() {
val beds = createPremisesAndBedsWithCharacteristics(
localAuthorityArea,
searchPdu,
BedSearchAttributes.sharedProperty,
BedSearchAttributes.SHARED_PROPERTY,
)

val expextedPremisesOneBedOne = beds.first()
Expand All @@ -1015,7 +1015,7 @@ class BedSearchTest : IntegrationTestBase() {
durationDays = 84,
serviceName = "temporary-accommodation",
probationDeliveryUnits = listOf(searchPdu.id),
attributes = listOf(BedSearchAttributes.sharedProperty),
attributes = listOf(BedSearchAttributes.SHARED_PROPERTY),
),
)
.exchange()
Expand Down Expand Up @@ -1107,7 +1107,7 @@ class BedSearchTest : IntegrationTestBase() {
val beds = createPremisesAndBedsWithCharacteristics(
localAuthorityArea,
searchPdu,
BedSearchAttributes.singleOccupancy,
BedSearchAttributes.SINGLE_OCCUPANCY,
)

val expextedPremisesOneBedOne = beds.first()
Expand All @@ -1126,7 +1126,7 @@ class BedSearchTest : IntegrationTestBase() {
durationDays = 84,
serviceName = "temporary-accommodation",
probationDeliveryUnits = listOf(searchPdu.id),
attributes = listOf(BedSearchAttributes.singleOccupancy),
attributes = listOf(BedSearchAttributes.SINGLE_OCCUPANCY),
),
)
.exchange()
Expand Down Expand Up @@ -1218,7 +1218,7 @@ class BedSearchTest : IntegrationTestBase() {
val beds = createPremisesAndBedsWithCharacteristics(
localAuthorityArea,
searchPdu,
BedSearchAttributes.wheelchairAccessible,
BedSearchAttributes.WHEELCHAIR_ACCESSIBLE,
)

val expextedPremisesOneBedOne = beds.first()
Expand All @@ -1235,7 +1235,7 @@ class BedSearchTest : IntegrationTestBase() {
durationDays = 84,
serviceName = "temporary-accommodation",
probationDeliveryUnits = listOf(searchPdu.id),
attributes = listOf(BedSearchAttributes.wheelchairAccessible),
attributes = listOf(BedSearchAttributes.WHEELCHAIR_ACCESSIBLE),
),
)
.exchange()
Expand Down Expand Up @@ -2015,19 +2015,19 @@ class BedSearchTest : IntegrationTestBase() {
)

when (bedSearchAttribute) {
BedSearchAttributes.singleOccupancy, BedSearchAttributes.SINGLE_OCCUPANCY -> beds = listOf(
BedSearchAttributes.SINGLE_OCCUPANCY -> beds = listOf(
singleOccupancyBedOne,
premisesSingleOccupancyWomenOnlyBedOne,
premisesSingleOccupancyWheelchairAccessibleBedOne,
)

BedSearchAttributes.sharedProperty, BedSearchAttributes.SHARED_PROPERTY -> beds = listOf(
BedSearchAttributes.SHARED_PROPERTY -> beds = listOf(
sharedPropertyBedOne,
premisesSharedPropertyMenOnlyBedOne,
premisesSharedPropertyWheelchairAccessibleBedOne,
)

BedSearchAttributes.wheelchairAccessible, BedSearchAttributes.WHEELCHAIR_ACCESSIBLE ->
BedSearchAttributes.WHEELCHAIR_ACCESSIBLE ->
beds =
listOf(premisesSharedPropertyWheelchairAccessibleBedOne, premisesSingleOccupancyWheelchairAccessibleBedOne)
}
Expand Down

0 comments on commit 105c5ce

Please sign in to comment.