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
ApiResponse(responseCode ="403", description ="Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON", content = [Content(examples = [])]),
127
+
ApiResponse(
128
+
responseCode ="401",
129
+
description ="Unauthorised, requires a valid Oauth2 token",
130
+
content = [Content(examples = [])]
131
+
),
132
+
ApiResponse(
133
+
responseCode ="403",
134
+
description ="Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON",
135
+
content = [Content(examples = [])]
136
+
),
128
137
],
129
138
)
130
139
@PostMapping("/phrase")
@@ -143,9 +152,21 @@ class OffenderSearchController(
ApiResponse(responseCode ="403", description ="Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON", content = [Content(examples = [])]),
148
-
ApiResponse(responseCode ="500", description ="The list of CRNs provided exceeds the maximum of 512", content = [Content(examples = [])]),
155
+
ApiResponse(
156
+
responseCode ="401",
157
+
description ="Unauthorised, requires a valid Oauth2 token",
158
+
content = [Content(examples = [])]
159
+
),
160
+
ApiResponse(
161
+
responseCode ="403",
162
+
description ="Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON",
163
+
content = [Content(examples = [])]
164
+
),
165
+
ApiResponse(
166
+
responseCode ="500",
167
+
description ="The list of CRNs provided exceeds the maximum of 512",
168
+
content = [Content(examples = [])]
169
+
),
149
170
],
150
171
)
151
172
@PostMapping("/crns")
@@ -169,12 +190,23 @@ class OffenderSearchController(
ApiResponse(responseCode ="403", description ="Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON", content = [Content(examples = [])]),
193
+
ApiResponse(
194
+
responseCode ="401",
195
+
description ="Unauthorised, requires a valid Oauth2 token",
196
+
content = [Content(examples = [])]
197
+
),
198
+
ApiResponse(
199
+
responseCode ="403",
200
+
description ="Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON",
201
+
content = [Content(examples = [])]
202
+
),
174
203
],
175
204
)
176
205
@PostMapping("/nomsNumbers")
177
-
@Operation(description ="Match prisoners by a list of prisoner noms numbers", summary ="Requires ROLE_PROBATION__SEARCH_PERSON role")
206
+
@Operation(
207
+
description ="Match prisoners by a list of prisoner noms numbers",
ApiResponse(responseCode ="403", description ="Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON", content = [Content(examples = [])]),
220
+
ApiResponse(
221
+
responseCode ="401",
222
+
description ="Unauthorised, requires a valid Oauth2 token",
223
+
content = [Content(examples = [])]
224
+
),
225
+
ApiResponse(
226
+
responseCode ="403",
227
+
description ="Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON",
228
+
content = [Content(examples = [])]
229
+
),
190
230
],
191
231
)
192
232
@PostMapping("/ldu-codes")
@@ -202,7 +242,10 @@ class OffenderSearchController(
202
242
example ="10",
203
243
),
204
244
)
205
-
@Operation(summary ="Match prisoners by a list of ldu codes", description ="Requires ROLE_PROBATION__SEARCH_PERSON role")
245
+
@Operation(
246
+
summary ="Match prisoners by a list of ldu codes",
ApiResponse(responseCode ="403", description ="Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON", content = [Content(examples = [])]),
264
+
ApiResponse(
265
+
responseCode ="401",
266
+
description ="Unauthorised, requires a valid Oauth2 token",
267
+
content = [Content(examples = [])]
268
+
),
269
+
ApiResponse(
270
+
responseCode ="403",
271
+
description ="Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON",
272
+
content = [Content(examples = [])]
273
+
),
223
274
],
224
275
)
225
276
@PostMapping("/team-codes")
@@ -235,7 +286,10 @@ class OffenderSearchController(
235
286
example ="10",
236
287
),
237
288
)
238
-
@Operation(description ="Match prisoners by a list of team codes", summary ="Requires ROLE_PROBATION__SEARCH_PERSON role")
289
+
@Operation(
290
+
description ="Match prisoners by a list of team codes",
ApiResponse(responseCode ="403", description ="Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON", content = [Content(examples = [])]),
318
+
ApiResponse(
319
+
responseCode ="401",
320
+
description ="Unauthorised, requires a valid Oauth2 token",
321
+
content = [Content(examples = [])]
322
+
),
323
+
ApiResponse(
324
+
responseCode ="403",
325
+
description ="Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON",
326
+
content = [Content(examples = [])]
327
+
),
266
328
],
267
329
)
268
330
@GetMapping("/ldu-codes/{lduCode}")
@@ -286,8 +348,16 @@ class OffenderSearchController(
ApiResponse(responseCode ="403", description ="Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON", content = [Content(examples = [])]),
351
+
ApiResponse(
352
+
responseCode ="401",
353
+
description ="Unauthorised, requires a valid Oauth2 token",
354
+
content = [Content(examples = [])]
355
+
),
356
+
ApiResponse(
357
+
responseCode ="403",
358
+
description ="Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON",
359
+
content = [Content(examples = [])]
360
+
),
291
361
],
292
362
)
293
363
@GetMapping("/team-codes/{teamCode}")
@@ -302,6 +372,10 @@ class OffenderSearchController(
302
372
val start =System.currentTimeMillis()
303
373
val results = searchService.performSearch(SearchDto(surname ="Smith"))
304
374
305
-
telemetryClient.trackEvent("synthetic-monitor", mapOf("results" to "${results.size}", "timeMs" to (System.currentTimeMillis() - start).toString()), null)
375
+
telemetryClient.trackEvent(
376
+
"synthetic-monitor",
377
+
mapOf("results" to "${results.size}", "timeMs" to (System.currentTimeMillis() - start).toString()),
Copy file name to clipboardexpand all lines: src/main/kotlin/uk/gov/justice/hmpps/probationsearch/dto/MatchRequest.kt
+12-3
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,17 @@ data class MatchRequest(
13
13
@field:Past(message = "Date of birth must be in the past")
14
14
@Schema(description ="Offender date of birth", example ="1996-02-10")
15
15
valdateOfBirth:LocalDate? = null,
16
-
@Schema(description ="Police National Computer (PNC) number", example ="2018/0123456X") valpncNumber:String? = null,
16
+
@Schema(
17
+
description ="Police National Computer (PNC) number",
18
+
example ="2018/0123456X"
19
+
) valpncNumber:String? = null,
17
20
@Schema(description ="Criminal Records Office (CRO) number", example ="SF80/655108T") valcroNumber:String? = null,
18
-
@Schema(description ="The Offender NOMIS Id (aka prison number/offender no in DPS)", example ="G5555TT") valnomsNumber:String? = null,
19
-
@Schema(description ="Filter so only offenders on a current sentence managed by probation will be returned", example ="true") valactiveSentence:Boolean = false,
21
+
@Schema(
22
+
description ="The Offender NOMIS Id (aka prison number/offender no in DPS)",
23
+
example ="G5555TT"
24
+
) valnomsNumber:String? = null,
25
+
@Schema(
26
+
description ="Filter so only offenders on a current sentence managed by probation will be returned",
Copy file name to clipboardexpand all lines: src/main/kotlin/uk/gov/justice/hmpps/probationsearch/dto/OffenderDetail.kt
+4-1
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,10 @@ data class OffenderDetail(
27
27
valrestrictionMessage:String? = null,
28
28
valcurrentExclusion:Boolean? = null,
29
29
valexclusionMessage:String? = null,
30
-
@Schema(description ="map of fields which matched a search term (Only return for phrase searching)", example ="{\"surname\": [\"Smith\"], \"offenderAliases.surname\": [\"SMITH\"]}")
30
+
@Schema(
31
+
description ="map of fields which matched a search term (Only return for phrase searching)",
32
+
example ="{\"surname\": [\"Smith\"], \"offenderAliases.surname\": [\"SMITH\"]}"
Copy file name to clipboardexpand all lines: src/main/kotlin/uk/gov/justice/hmpps/probationsearch/dto/SearchPhraseFilter.kt
+9-2
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,13 @@ data class SearchPhraseFilter(
7
7
@field:NotBlank(message = "phrase must be supplied")
8
8
@Schema(required =true, description ="Phrase containing the terms to search for", example ="john smith 19/07/1965")
9
9
valphrase:String = "",
10
-
@Schema(required =false, description ="When true, only match offenders that match all terms. Analogous to AND versus OR") valmatchAllTerms:Boolean = false,
11
-
@Schema(required =false, description ="Filter of probation area codes. Only offenders that have an active offender manager in one of the areas will be returned", example ="[\"N01\",\"N02\"]") valprobationAreasFilter:List<String> = listOf(),
10
+
@Schema(
11
+
required =false,
12
+
description ="When true, only match offenders that match all terms. Analogous to AND versus OR"
13
+
) valmatchAllTerms:Boolean = false,
14
+
@Schema(
15
+
required =false,
16
+
description ="Filter of probation area codes. Only offenders that have an active offender manager in one of the areas will be returned",
Copy file name to clipboardexpand all lines: src/test/kotlin/uk/gov/justice/hmpps/probationsearch/controllers/OffenderSearchPhraseAPIIntegrationTest.kt
+7-1
Original file line number
Diff line number
Diff line change
@@ -1097,7 +1097,13 @@ class OffenderSearchPhraseAPIIntegrationTest : ElasticIntegrationBase() {
1097
1097
OffenderReplacement(
1098
1098
crn ="X00006",
1099
1099
surname ="Gramsci",
1100
-
offenderManagers =listOf(OffenderManagerReplacement(code ="N07", description ="NPS London", active =true)),
0 commit comments