Skip to content

Commit 0c7e038

Browse files
author
Bingjie Liu
committed
update open api yml for licence endpoint
1 parent 2662002 commit 0c7e038

File tree

1 file changed

+106
-16
lines changed

1 file changed

+106
-16
lines changed

openapi.yml

+106-16
Original file line numberDiff line numberDiff line change
@@ -456,16 +456,6 @@ paths:
456456
PersonNotFoundError:
457457
$ref: "#/components/examples/PersonNotFoundError"
458458

459-
460-
/{TBC}/v1/persons/{Id}/accommodations:
461-
get:
462-
summary: FUTURE ENDPOINT - Returns accommodation and referral information associated with a person.
463-
parameters:
464-
- $ref: "#/components/parameters/Id"
465-
responses:
466-
"200":
467-
description: Success.
468-
469459
/v1/persons/{Id}/adjudications:
470460
get:
471461
summary: Returns adjudications associated with a person.
@@ -492,27 +482,52 @@ paths:
492482
PersonNotFoundError:
493483
$ref: "#/components/examples/PersonNotFoundError"
494484

495-
/{TBC}/v1/persons/{Id}/interventions:
485+
/v1/persons/{HmppsId}/licenses:
496486
get:
497-
summary: FUTURE ENDPOINT - Returns activities and Non-Statutory Interventions (NSIs) associated with a person.
487+
summary: Returns license conditions associated with a person.
488+
parameters:
489+
- $ref: "#/components/parameters/HmppsId"
490+
responses:
491+
"200":
492+
description: Successfully found licenses for a person with the provided HMPPS ID.
493+
content:
494+
application/json:
495+
schema:
496+
type: object
497+
properties:
498+
data:
499+
$ref: "#/components/schemas/PersonLicences"
500+
"404":
501+
description: Failed to find licenses for a person with the provided HMPPS ID.
502+
content:
503+
application/json:
504+
schema:
505+
$ref: "#/components/schemas/Error"
506+
examples:
507+
PersonNotFoundError:
508+
$ref: "#/components/examples/PersonNotFoundError"
509+
510+
/{TBC}/v1/persons/{Id}/accommodations:
511+
get:
512+
summary: FUTURE ENDPOINT - Returns accommodation and referral information associated with a person.
498513
parameters:
499514
- $ref: "#/components/parameters/Id"
500515
responses:
501516
"200":
502517
description: Success.
503518

504-
/{TBC}/v1/persons/{Id}/key-workers:
519+
/{TBC}/v1/persons/{Id}/interventions:
505520
get:
506-
summary: FUTURE ENDPOINT - Returns responsible officer history, transfer history and consolidated transfer review associated with a person.
521+
summary: FUTURE ENDPOINT - Returns activities and Non-Statutory Interventions (NSIs) associated with a person.
507522
parameters:
508523
- $ref: "#/components/parameters/Id"
509524
responses:
510525
"200":
511526
description: Success.
512527

513-
/{TBC}/v1/persons/{Id}/licenses:
528+
/{TBC}/v1/persons/{Id}/key-workers:
514529
get:
515-
summary: FUTURE ENDPOINT - Returns license conditions associated with a person.
530+
summary: FUTURE ENDPOINT - Returns responsible officer history, transfer history and consolidated transfer review associated with a person.
516531
parameters:
517532
- $ref: "#/components/parameters/Id"
518533
responses:
@@ -967,6 +982,63 @@ components:
967982
format: date
968983
description: Calculated automatic (unconditional) release date for a person
969984
example: 2023-03-01
985+
Licence:
986+
type: object
987+
properties:
988+
status:
989+
type: string
990+
example: IN_PROGRESS
991+
"enum": [ "IN_PROGRESS","SUBMITTED","APPROVED","ACTIVE","VARIATION_IN_PROGRESS","VARIATION_SUBMITTED","VARIATION_APPROVED","VARIATION_REJECTED" ]
992+
description: Licence status
993+
typeCode:
994+
type: string
995+
example: AP
996+
enum: [ "AP","PSS","AP_PSS" ]
997+
description: The type of licence
998+
createdDate:
999+
type: string
1000+
format: date
1001+
example: 2015-09-23
1002+
description: The date and time when the version/variation of the licence was created at
1003+
approvedDate:
1004+
type: string
1005+
format: date
1006+
example: 2015-09-24
1007+
description: The date and time that the prison approved the licence, where licences approved before 01/04/2023 will not have an approved time
1008+
updatedDate:
1009+
type: string
1010+
format: date
1011+
example: 2015-10-23
1012+
description: The date and time that the licence was last updated
1013+
conditions:
1014+
type: array
1015+
minItems: 0
1016+
items:
1017+
$ref: "#/components/schemas/LicenceCondition"
1018+
description: list of conditions. The type of conditions on a licence which can be AP (All Purpose) and/or PSS (Post Sentence Supervision)
1019+
LicenceCondition:
1020+
type: object
1021+
properties:
1022+
type:
1023+
type: string
1024+
example: Standard
1025+
nullable: true
1026+
description: Condition type
1027+
code:
1028+
type: string
1029+
example: 5a105297-dce1-4d18-b9ea-4195b46b7594
1030+
nullable: true
1031+
description: The code shared by all instances of this condition
1032+
category:
1033+
type: string
1034+
example: Residence at a specific place
1035+
nullable: true
1036+
description: The category to which the condition belongs
1037+
condition:
1038+
type: string
1039+
example: Residence at a specific place
1040+
nullable: true
1041+
description: The condition of a licence, this can be a standard condition, a combination of inputted text and template text including any user input or the input for the bespoke condition
9701042
Name:
9711043
required:
9721044
- forename
@@ -1124,6 +1196,24 @@ components:
11241196
type: string
11251197
example: 2008/0545166T
11261198
description: Currently a hmppsId is a PNC identifier however this will change in the near future to be a CRN identifier
1199+
PersonLicences:
1200+
type: object
1201+
properties:
1202+
hmppsId:
1203+
type: string
1204+
example: 2008/0545166T
1205+
description: Currently a hmppsId is a PNC identifier however this will change in the near future to be a CRN identifier
1206+
offenderNumber:
1207+
type: string
1208+
example: Z1234ZZ
1209+
nullable: true
1210+
description: The prison identifier for the person on the licence. Also known as the NOMIS ID
1211+
licences:
1212+
type: array
1213+
minItems: 0
1214+
items:
1215+
$ref: "#/components/schemas/Licence"
1216+
description: list of licences
11271217
Punishment:
11281218
type: object
11291219
properties:

0 commit comments

Comments
 (0)