Skip to content

Commit

Permalink
PI-1668 added potential matches to results (#2888)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevomcallister authored Dec 7, 2023
1 parent 146c71f commit d4b1ad5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() -> {
Expand Down

0 comments on commit d4b1ad5

Please sign in to comment.