From d4b1ad541ece069c0b5721452539a288112a99c3 Mon Sep 17 00:00:00 2001 From: stevomcallister <78762879+stevomcallister@users.noreply.github.com> Date: Thu, 7 Dec 2023 15:35:48 +0000 Subject: [PATCH] PI-1668 added potential matches to results (#2888) --- .../resources/simulations/__files/hmpps-auth-token-body.json | 2 +- .../justice/digital/hmpps/controller/PersonUpdateController.kt | 2 +- .../kotlin/uk/gov/justice/digital/hmpps/sevice/PersonService.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/prison-identifier-and-delius/src/dev/resources/simulations/__files/hmpps-auth-token-body.json b/projects/prison-identifier-and-delius/src/dev/resources/simulations/__files/hmpps-auth-token-body.json index 81859b724f..2eb429c057 100644 --- a/projects/prison-identifier-and-delius/src/dev/resources/simulations/__files/hmpps-auth-token-body.json +++ b/projects/prison-identifier-and-delius/src/dev/resources/simulations/__files/hmpps-auth-token-body.json @@ -1,5 +1,5 @@ { - "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJwcm9iYXRpb24taW50ZWdyYXRpb24tZGV2IiwiZ3JhbnRfdHlwZSI6ImNsaWVudF9jcmVkZW50aWFscyIsInVzZXJfbmFtZSI6InByb2JhdGlvbi1pbnRlZ3JhdGlvbi1kZXYiLCJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiYXV0aF9zb3VyY2UiOiJub25lIiwiaXNzIjoiaHR0cHM6Ly9zaWduLWluLWRldi5obXBwcy5zZXJ2aWNlLmp1c3RpY2UuZ292LnVrL2F1dGgvaXNzdWVyIiwiZXhwIjo5OTk5OTk5OTk5LCJhdXRob3JpdGllcyI6WyJST0xFX1VQREFURV9OT01TX05VTUJFUiJdLCJqdGkiOiIyNUR1Um4xLWh5SFpld0xjZEpKeHdWTDAzS1UiLCJjbGllbnRfaWQiOiJwcm9iYXRpb24taW50ZWdyYXRpb24tZGV2IiwiaWF0IjoxNjYzNzU3MzExfQ.bAcMem3ScY0HuH1B156hsOPkNtpPCO2RiKmY_Dddj9v77HZUCAxuNyWw887OVRvMJYeCOhFC-6X5pjZQifNNbTobSJDl9T2iwjEbBpZji-AQlyAZSwzZ6800Y318S0GzmSf3DCxG0NnEdNWw6FuLXJAtalHhwRGS9BVovA71UIY", + "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJwcm9iYXRpb24taW50ZWdyYXRpb24tZGV2IiwiZ3JhbnRfdHlwZSI6ImNsaWVudF9jcmVkZW50aWFscyIsInVzZXJfbmFtZSI6InByb2JhdGlvbi1pbnRlZ3JhdGlvbi1kZXYiLCJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiYXV0aF9zb3VyY2UiOiJub25lIiwiaXNzIjoiaHR0cHM6Ly9zaWduLWluLWRldi5obXBwcy5zZXJ2aWNlLmp1c3RpY2UuZ292LnVrL2F1dGgvaXNzdWVyIiwiZXhwIjo5OTk5OTk5OTk5LCJhdXRob3JpdGllcyI6WyJST0xFX1BST0JBVElPTl9BUElfX1BSSVNPTl9JREVOVElGSUVSX19VUERBVEUiXSwianRpIjoiMjVEdVJuMS1oeUhaZXdMY2RKSnh3VkwwM0tVIiwiY2xpZW50X2lkIjoicHJvYmF0aW9uLWludGVncmF0aW9uLWRldiIsImlhdCI6MTY2Mzc1NzMxMX0.VHPkNnPx9CMYnZej9wDqK0KoyZMis8Wh2JabUhXyMTupP7Oi_tQ9LQBD3VhLbMwxByChlT0_ICWrJPMkw5P9vfqy3G5cEp03Y7kP89-90NLWWtxVKF-z8ojbTzRpGVb0QgiJWO1O_OCYUbo8A-JatG2KjtoUtJQ3KMcDl5p-kH0", "token_type": "bearer", "expires_in": 9999999999, "scope": "read write", diff --git a/projects/prison-identifier-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/controller/PersonUpdateController.kt b/projects/prison-identifier-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/controller/PersonUpdateController.kt index a61841376e..737425d0fa 100644 --- a/projects/prison-identifier-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/controller/PersonUpdateController.kt +++ b/projects/prison-identifier-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/controller/PersonUpdateController.kt @@ -13,7 +13,7 @@ import uk.gov.justice.digital.hmpps.sevice.PersonService @RequestMapping("person") class PersonUpdateController(private val personService: PersonService) { - @PreAuthorize("hasRole('ROLE_UPDATE_NOMS_NUMBER')") + @PreAuthorize("hasRole('ROLE_PROBATION_API__PRISON_IDENTIFIER__UPDATE')") @RequestMapping(value = ["/populate-noms-number"], method = [RequestMethod.GET, RequestMethod.POST]) fun populateNomsNumbers( @RequestParam(defaultValue = "true") trialOnly: Boolean, diff --git a/projects/prison-identifier-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/sevice/PersonService.kt b/projects/prison-identifier-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/sevice/PersonService.kt index 7876848b40..5eb4aa54e6 100644 --- a/projects/prison-identifier-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/sevice/PersonService.kt +++ b/projects/prison-identifier-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/sevice/PersonService.kt @@ -49,7 +49,7 @@ class PersonService( // attempt to find the person in nomis val searchResults = - prisonSearchAPI.matchPerson(person!!.asSearchRequest()).content.filter { it.bookingNumber != null } + prisonSearchAPI.matchPerson(person!!.asSearchRequest()).content.filter { it.bookingNumber != null && it.sentenceStartDate != null } return when { // not found searchResults.isEmpty() -> {