Skip to content

Commit af600bb

Browse files
committed
Change Person conditonal ID
Currently when a PNC search is carried out we start with probation and get a response where we then extract an ID and use this extracted ID to query PrisonerOffenderSearch. This ID was previously CRN however it makes more sense for this to be a NomisNumber. This is all because we cant directly query PrisonerOffenderSearch with PNC
1 parent 474f1e8 commit af600bb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/services/GetPersonsService.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class GetPersonsService(
1919
val personsFromProbationOffenderSearch = probationOffenderSearchGateway.getPersons(firstName, lastName, pncNumber, dateOfBirth, searchWithinAliases)
2020

2121
if (!pncNumber.isNullOrEmpty()) {
22-
hmppsId = personsFromProbationOffenderSearch.data.firstOrNull()?.identifiers?.deliusCrn
22+
hmppsId = personsFromProbationOffenderSearch.data.firstOrNull()?.identifiers?.nomisNumber
2323
}
2424

2525
val responseFromPrisonerOffenderSearch = prisonerOffenderSearchGateway.getPersons(firstName, lastName, hmppsId, dateOfBirth, searchWithinAliases)

src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/services/GetPersonsServiceTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ internal class GetPersonsServiceTest(
6868
}
6969

7070
it("allows prisonerOffenderSearchGateway to search with a hmppsId if a pncNumber is passed in") {
71-
val responseFromProbationOffenderSearch = Response(data = listOf(Person(firstName, lastName, middleName = "John", identifiers = Identifiers(deliusCrn = "A1234AA"))))
71+
val responseFromProbationOffenderSearch = Response(data = listOf(Person(firstName, lastName, middleName = "John", identifiers = Identifiers(nomisNumber = "A1234AA"))))
7272

7373
whenever(probationOffenderSearchGateway.getPersons(firstName, lastName, pncNumber, dateOfBirth)).thenReturn(responseFromProbationOffenderSearch)
7474
whenever(prisonerOffenderSearchGateway.getPersons(firstName, lastName, hmppsId, dateOfBirth)).thenReturn(Response(data = emptyList()))

0 commit comments

Comments
 (0)