From 1363411561e769f75e8443fbca1083701fc3e75c Mon Sep 17 00:00:00 2001 From: stevomcallister Date: Thu, 12 Dec 2024 11:35:17 +0000 Subject: [PATCH] updated to return actual results from PLP --- .../controllers/v1/person/PLPController.kt | 4 ++-- .../digital/hmpps/hmppsintegrationapi/gateways/PLPGateway.kt | 1 - .../hmpps/hmppsintegrationapi/models/hmpps/ReviewSchedule.kt | 1 - .../integration/person/PLPIntegrationTest.kt | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/controllers/v1/person/PLPController.kt b/src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/controllers/v1/person/PLPController.kt index a15210c1..18ba9b33 100644 --- a/src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/controllers/v1/person/PLPController.kt +++ b/src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/controllers/v1/person/PLPController.kt @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RestController import uk.gov.justice.digital.hmpps.hmppsintegrationapi.exception.EntityNotFoundException import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.DataResponse import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.InductionSchedule -import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.ReviewSchedule +import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.ReviewSchedules import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.UpstreamApiError import uk.gov.justice.digital.hmpps.hmppsintegrationapi.services.GetInductionScheduleForPersonService import uk.gov.justice.digital.hmpps.hmppsintegrationapi.services.GetReviewScheduleForPersonService @@ -61,7 +61,7 @@ class PLPController( ) fun getReviewSchedule( @Parameter(description = "A HmppsId ", example = "A123123") @PathVariable hmppsId: String, - ): DataResponse { + ): DataResponse { val response = getReviewScheduleForPersonService.execute(hmppsId) if (response.hasError(UpstreamApiError.Type.ENTITY_NOT_FOUND)) { diff --git a/src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/gateways/PLPGateway.kt b/src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/gateways/PLPGateway.kt index 72941eec..4abf6a6b 100644 --- a/src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/gateways/PLPGateway.kt +++ b/src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/gateways/PLPGateway.kt @@ -8,7 +8,6 @@ import uk.gov.justice.digital.hmpps.hmppsintegrationapi.extensions.WebClientWrap import uk.gov.justice.digital.hmpps.hmppsintegrationapi.extensions.WebClientWrapper.WebClientWrapperResponse import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.InductionSchedule import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.Response -import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.ReviewSchedule import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.ReviewSchedules import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.UpstreamApi diff --git a/src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/hmpps/ReviewSchedule.kt b/src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/hmpps/ReviewSchedule.kt index 1d9dbe02..23ec62c2 100644 --- a/src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/hmpps/ReviewSchedule.kt +++ b/src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/hmpps/ReviewSchedule.kt @@ -5,7 +5,6 @@ import com.fasterxml.jackson.annotation.JsonInclude import java.time.Instant import java.time.LocalDate - @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.USE_DEFAULTS) data class ReviewSchedules( diff --git a/src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/integration/person/PLPIntegrationTest.kt b/src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/integration/person/PLPIntegrationTest.kt index 1da0f82f..96f6e5f1 100644 --- a/src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/integration/person/PLPIntegrationTest.kt +++ b/src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/integration/person/PLPIntegrationTest.kt @@ -25,7 +25,6 @@ class PLPIntegrationTest : IntegrationTestBase() { ) } - @Test fun `returns a persons review schedule`() { callApi("$basePath/K5995YZ/plp-review-schedule")