You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HMAI-307 Add Prisons filter to /v1/persons/{hmppsId}/protected-characteristics so can be used by kilco (#745)
* remove encodedhmppsid from controller and add filters
* add filtering to service layer
* add /v1/persons/.*/protected-characteristics to private prison role
Copy file name to clipboardexpand all lines: src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/controllers/v1/person/ProtectedCharacteristicsController.kt
Copy file name to clipboardexpand all lines: src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/services/GetProtectedCharacteristicsService.kt
val consumerPrisonFilterCheck = consumerPrisonAccessService.checkConsumerHasPrisonAccess<PersonProtectedCharacteristics>(prisonOffender?.data?.prisonId, filters)
44
+
if (consumerPrisonFilterCheck.errors.isNotEmpty()) {
45
+
return consumerPrisonFilterCheck
46
+
}
47
+
}
48
+
49
+
val result = probationOffender.data.toPersonProtectedCharacteristics()
Copy file name to clipboardexpand all lines: src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/controllers/v1/person/ProtectedCharacteristicsControllerTest.kt
Copy file name to clipboardexpand all lines: src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/integration/person/ProtectedCharacteristicsIntegrationTest.kt
0 commit comments