Skip to content

Commit 838d0ae

Browse files
Smoke test ok
1 parent b375e7d commit 838d0ae

File tree

4 files changed

+115
-23
lines changed

4 files changed

+115
-23
lines changed

openapi.yml

+92-1
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,37 @@ paths:
722722
NoQueryParametersBadRequestError:
723723
$ref: "#/components/examples/InternalServerError"
724724

725+
/v1/persons/{Id}/person-responsible-officer:
726+
get:
727+
summary: Returns the person responsible officer associated with a person.
728+
parameters:
729+
- $ref: "#/components/parameters/HmppsId"
730+
responses:
731+
"200":
732+
description: Successfully found the person responsible officer for a person with the provided HMPPS ID.
733+
content:
734+
application/json:
735+
schema:
736+
$ref: "#/components/schemas/PersonResponsibleOfficer"
737+
"404":
738+
description: Failed to find licenses for a person with the provided HMPPS ID.
739+
content:
740+
application/json:
741+
schema:
742+
$ref: "#/components/schemas/Error"
743+
examples:
744+
PersonNotFoundError:
745+
$ref: "#/components/examples/PersonNotFoundError"
746+
"500":
747+
description: An upstream service was not responding, so we cannot verify the accuracy of any data we did get.
748+
content:
749+
application/json:
750+
schema:
751+
$ref: "#/components/schemas/Error"
752+
examples:
753+
NoQueryParametersBadRequestError:
754+
$ref: "#/components/examples/InternalServerError"
755+
725756
/v1/persons/{HmppsId}/licences/conditions:
726757
get:
727758
summary: Returns license conditions associated with a person.
@@ -1269,6 +1300,19 @@ components:
12691300
releaseDate:
12701301
type: string
12711302
format: date
1303+
CommunityOffenderManager:
1304+
type: object
1305+
properties:
1306+
name:
1307+
$ref: "#/components/schemas/PersonResponsibleOfficerName"
1308+
email:
1309+
type: string
1310+
nullable: true
1311+
telephoneNumber:
1312+
type: string
1313+
nullable: true
1314+
team:
1315+
$ref: "#/components/schemas/PersonResponsibleOfficerTeam"
12721316
ContactDetails:
12731317
properties:
12741318
phoneNumbers:
@@ -1755,6 +1799,30 @@ components:
17551799
description: Currently a hmppsId is a CRN identifier however this will change in the future to be a new unique Hmpps identifier
17561800
contactDetails:
17571801
$ref: "#/components/schemas/ContactDetails"
1802+
PersonResponsibleOfficerName:
1803+
type: object
1804+
properties:
1805+
forename:
1806+
type: string
1807+
nullable: true
1808+
surname:
1809+
type: string
1810+
nullable: true
1811+
PersonResponsibleOfficerTeam:
1812+
type: object
1813+
properties:
1814+
code:
1815+
type: string
1816+
nullable: true
1817+
description:
1818+
type: string
1819+
nullable: true
1820+
email:
1821+
type: string
1822+
nullable: true
1823+
telephoneNumber:
1824+
type: string
1825+
nullable: true
17581826
PhoneNumbers:
17591827
type: array
17601828
items:
@@ -1768,6 +1836,13 @@ components:
17681836
type: string
17691837
example: "TELEPHONE"
17701838
description: "The type of number"
1839+
PersonResponsibleOfficer:
1840+
type: object
1841+
properties:
1842+
prisonOffenderOfficer:
1843+
$ref: "#/components/schemas/PrisonOffenderOfficer"
1844+
communityOffenderManager:
1845+
$ref: "#/components/schemas/CommunityOffenderManager"
17711846
PersonLicencesData:
17721847
type: object
17731848
properties:
@@ -1839,7 +1914,23 @@ components:
18391914
minItems: 0
18401915
items:
18411916
$ref: "#/components/schemas/ReasonableAdjustment"
1842-
1917+
Prison:
1918+
type: object
1919+
properties:
1920+
code:
1921+
type: string
1922+
nullable: true
1923+
PrisonOffenderOfficer:
1924+
type: object
1925+
properties:
1926+
forename:
1927+
type: string
1928+
nullable: true
1929+
surname:
1930+
type: string
1931+
nullable: true
1932+
prison:
1933+
$ref: "#/components/schemas/Prison"
18431934

18441935
Punishment:
18451936
type: object

src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/gateways/ManagePOMCaseGateway.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ManagePOMCaseGateway(
2323
val result =
2424
webClient.request<AllocationPrimaryPOM>(
2525
HttpMethod.GET,
26-
"/allocation/$id/primary_pom",
26+
"/api/allocation/$id/primary_pom",
2727
authenticationHeader(),
2828
UpstreamApi.MANAGE_POM_CASE,
2929
)

src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/mockservers/ManagePOMCaseApiMockServer.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ManagePOMCaseApiMockServer : WireMockServer(WIREMOCK_PORT) {
1515
status: HttpStatus = HttpStatus.OK,
1616
) {
1717
stubFor(
18-
WireMock.get("/allocation/$id/primary_pom")
18+
WireMock.get("/api/allocation/$id/primary_pom")
1919
.withHeader(
2020
"Authorization",
2121
WireMock.matching("Bearer ${HmppsAuthMockServer.TOKEN}"),

src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/smoke/person/PersonResponsibleOfficerSmokeTest.kt

+21-20
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,30 @@ class PersonResponsibleOfficerSmokeTest : DescribeSpec(
2121
response.statusCode().shouldBe(HttpStatus.OK.value())
2222
response.body().shouldEqualJson(
2323
"""
24-
"data": {
25-
"manager": {
26-
"code": 0,
27-
"forename": "string",
28-
"surname": "string",
29-
"prison": {
30-
"code": "string"
31-
}
24+
{
25+
"data": {
26+
"prisonOffenderManager": {
27+
"forename": "string",
28+
"surname": "string",
29+
"prison": {
30+
"code": "string"
31+
}
3232
},
33-
"communityManager": {
34-
"name": {
35-
"forename": "string",
36-
"surname": "string"
37-
},
33+
"communityOffenderManager": {
34+
"name": {
35+
"forename": "string",
36+
"surname": "string"
37+
},
38+
"email": "string",
39+
"telephoneNumber": "string",
40+
"team": {
41+
"code": "string",
42+
"description": "string",
3843
"email": "string",
39-
"telephoneNumber": "string",
40-
"team": {
41-
"code": "string",
42-
"description": "string",
43-
"email": "string",
44-
"telephoneNumber": "string"
45-
}
44+
"telephoneNumber": "string"
45+
}
4646
}
47+
}
4748
}
4849
""".trimIndent(),
4950
)

0 commit comments

Comments
 (0)