Skip to content

Commit 76a6cce

Browse files
CAD-65: Update schema for sending materials to support linking to multiple defendants and general clean up
1 parent 02182a9 commit 76a6cce

File tree

1 file changed

+92
-48
lines changed

1 file changed

+92
-48
lines changed

src/main/resources/openapi/dcs-caseadmin.openapi.yml

Lines changed: 92 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ components:
2424
datePattern:
2525
type: string
2626
pattern: ^\d{4}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])$
27+
hearing:
28+
description: 'Hearing details for the defendant'
29+
type: object
30+
properties:
31+
hearingDate:
32+
allOf:
33+
- $ref: '#/components/schemas/datePattern'
34+
- description: "Future hearing date for the defendant"
35+
courtHouse:
36+
type: string
37+
description: "Future hearing venue for the defendant"
38+
required:
39+
- courtHouse
2740
defendantPerson:
2841
description: 'Individual representing the defendant'
2942
type: object
@@ -67,17 +80,7 @@ components:
6780
hearings:
6881
type: array
6982
items:
70-
type: object
71-
properties:
72-
hearingDate:
73-
allOf:
74-
- $ref: '#/components/schemas/datePattern'
75-
- description: "Future hearing date for the defendant"
76-
courtHouse:
77-
type: string
78-
description: "Future hearing venue for the defendant"
79-
required:
80-
- courtHouse
83+
$ref: '#/components/schemas/hearing'
8184
bailStatus:
8285
type: string
8386
description: "Bail status of the defendant"
@@ -96,6 +99,43 @@ components:
9699
- oneOf
97100
- defendantPerson
98101
- defendantOrganisation
102+
defendantMetadata:
103+
type: object
104+
properties:
105+
defendantId:
106+
allOf:
107+
- $ref: '#/components/schemas/uuid'
108+
- description: "Unique identifier to track the ID of the defendant on the CP system"
109+
defendantReferral:
110+
allOf:
111+
- $ref: '#/components/schemas/uuid'
112+
- description: "Unique identifier to track the ID of the defendant on the DCS system"
113+
required:
114+
- defendantId
115+
- defendantReferral
116+
defenceRepresentation:
117+
type: object
118+
description: Representation details for the defendant
119+
properties:
120+
organisationName:
121+
type: string
122+
description: Name of the organisation
123+
maxLength: 50
124+
forename:
125+
type: string
126+
description: Given Name
127+
maxLength: 50
128+
surname:
129+
type: string
130+
description: Surname or Family name
131+
maxLength: 50
132+
email:
133+
type: string
134+
description: email address (check on CP to see if its available)
135+
maxLength: 100
136+
required:
137+
- organisationName
138+
- email
99139
requestFulfilledResponsePayload:
100140
description: 'Payload representing the response from the synchronous API call'
101141
type: object
@@ -151,6 +191,7 @@ components:
151191
- "CASE_NOT_CREATED"
152192
- "DEFENDANT_NOT_CREATED"
153193
- "DEFENDANT_NOT_UPDATED"
194+
- "CASE_HAS_SPLIT_OR_MERGED"
154195
description: "Error code if the request failed"
155196
errorMessage:
156197
type: string
@@ -419,28 +460,7 @@ paths:
419460
description: "Create, Update or Delete defence representation"
420461
maxLength: 10
421462
defenceRepresentation:
422-
type: object
423-
description: Representation details for the defendant
424-
properties:
425-
organisationName:
426-
type: string
427-
description: Name of the organisation
428-
maxLength: 50
429-
forename:
430-
type: string
431-
description: Given Name
432-
maxLength: 50
433-
surname:
434-
type: string
435-
description: Surname or Family name
436-
maxLength: 50
437-
email:
438-
type: string
439-
description: email address (check on CP to see if its available)
440-
maxLength: 100
441-
required:
442-
- organisationName
443-
- email
463+
$ref: '#/components/schemas/defenceRepresentation'
444464
required:
445465
- transactionRef
446466
- caseId
@@ -517,6 +537,14 @@ paths:
517537
allOf:
518538
- $ref: '#/components/schemas/uuid'
519539
- description: "Unique identifier to track the ID of the case on the external system"
540+
materialId:
541+
allOf:
542+
- $ref: '#/components/schemas/uuid'
543+
- description: "Unique identifier to track the ID of the material on the external system"
544+
checksum:
545+
allOf:
546+
- type: string
547+
- description: "Checksum of the material file to be uploaded"
520548
caseReferral:
521549
type: string
522550
description: "referral link to the case"
@@ -533,32 +561,48 @@ paths:
533561
uploadedByUser:
534562
type: string
535563
description: "User id of person or system requesting the upload to DCS "
536-
defendantId:
537-
type: string
538-
description: "An optional reference to the identity of the defendant within this prosecution case indicating this should be attached at the defendant level "
539-
defendantReferral:
540-
type: string
541-
description: "referral link to the defendant"
564+
defendants:
565+
type: array
566+
items:
567+
$ref: '#/components/schemas/defendantMetadata'
542568
documentSection:
543569
type: string
544570
description: "The document section from within the SOURCE system "
545571
required:
546572
- caseReferral
547573
- transactionRef
548574
- caseId
575+
- materialId
549576
- materialUrl
550577
- documentName
551578
- documentSection
552579
- uploadedByUser
553-
example:
554-
caseId: 'd9fe4c51-1783-4fe4-a2b4-7c0e25905484'
555-
caseReferral: 'd9fe4c51-1783-4fe4-a2b4-7c0e25905483'
556-
transactionRef: 'd9fe4c51-1783-4fe4-a2b4-7c0e25905484'
557-
materialUrl: 'https://azure.storage.com/some-material-reference'
558-
documentName: 'Test file.pdf'
559-
documentDate: '2025-01-01'
560-
uploadedByUser: 'Common Platform'
561-
documentSection: 'Exhibits'
580+
examples:
581+
caseLevelDocument:
582+
value:
583+
caseId: 'd9fe4c51-1783-4fe4-a2b4-7c0e25905484'
584+
materialId: 'd9fe4c51-1783-4fe4-a2b4-7c0e25905484'
585+
caseReferral: 'd9fe4c51-1783-4fe4-a2b4-7c0e25905483'
586+
transactionRef: 'd9fe4c51-1783-4fe4-a2b4-7c0e25905484'
587+
materialUrl: 'https://azure.storage.com/some-material-reference'
588+
documentName: 'Test file.pdf'
589+
documentDate: '2025-01-01'
590+
uploadedByUser: 'Common Platform'
591+
documentSection: 'Exhibits'
592+
defendantLevelDocument:
593+
value:
594+
caseId: 'd9fe4c51-1783-4fe4-a2b4-7c0e25905484'
595+
materialId: 'd9fe4c51-1783-4fe4-a2b4-7c0e25905484'
596+
caseReferral: 'd9fe4c51-1783-4fe4-a2b4-7c0e25905483'
597+
transactionRef: 'd9fe4c51-1783-4fe4-a2b4-7c0e25905484'
598+
materialUrl: 'https://azure.storage.com/some-material-reference'
599+
documentName: 'Test file.pdf'
600+
documentDate: '2025-01-01'
601+
uploadedByUser: 'Common Platform'
602+
documentSection: 'Exhibits'
603+
defendants:
604+
- defendantId: 'd9fe4c51-1783-4fe4-a2b4-7c0e25905485'
605+
defendantReferral: 'd9fe4c51-1783-4fe4-a2b4-7c0e25905486'
562606

563607
responses:
564608
'202':

0 commit comments

Comments
 (0)