Skip to content

Commit 4a18129

Browse files
Merge pull request #26 from hmcts/vnd_updates
Vnd updates
2 parents 8e8d30d + a4ef99c commit 4a18129

File tree

1 file changed

+82
-93
lines changed

1 file changed

+82
-93
lines changed

src/main/resources/openapi/case-admin-doc-knowledge-api.openapi.yml

Lines changed: 82 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ paths:
4242
'200':
4343
description: Canonical queries
4444
content:
45-
application/json:
45+
application/vnd.casedocumentknowledge-service.query-catalogue+json:
4646
schema:
4747
type: object
4848
properties:
@@ -74,12 +74,12 @@ paths:
7474
'200':
7575
description: Canonical query
7676
content:
77-
application/json:
77+
application/vnd.casedocumentknowledge-service.query-catalogue+json:
7878
schema: { $ref: '#/components/schemas/QueryCatalogueItem' }
7979
'404':
8080
description: Not found
8181
content:
82-
application/json:
82+
application/vnd.casedocumentknowledge-service.query-catalogue+json:
8383
schema: { $ref: '#/components/schemas/ErrorResponse' }
8484

8585
/query-catalogue/{queryId}/label:
@@ -96,7 +96,7 @@ paths:
9696
requestBody:
9797
required: true
9898
content:
99-
application/json:
99+
application/vnd.casedocumentknowledge-service.query-catalogue+json:
100100
schema: { $ref: '#/components/schemas/LabelUpdateRequest' }
101101
examples:
102102
example:
@@ -105,22 +105,22 @@ paths:
105105
'200':
106106
description: Updated canonical label
107107
content:
108-
application/json:
108+
application/vnd.casedocumentknowledge-service.query-catalogue+json:
109109
schema: { $ref: '#/components/schemas/QueryCatalogueItem' }
110110
'400':
111111
description: Invalid label
112112
content:
113-
application/json:
113+
application/vnd.casedocumentknowledge-service.query-catalogue+json:
114114
schema: { $ref: '#/components/schemas/ErrorResponse' }
115115
'404':
116116
description: QueryId not found (if the canonical set is fixed)
117117
content:
118-
application/json:
118+
application/vnd.casedocumentknowledge-service.query-catalogue+json:
119119
schema: { $ref: '#/components/schemas/ErrorResponse' }
120120
'409':
121121
description: Label conflict (if uniqueness enforced)
122122
content:
123-
application/json:
123+
application/vnd.casedocumentknowledge-service.query-catalogue+json:
124124
schema: { $ref: '#/components/schemas/ErrorResponse' }
125125

126126
# ---------------------------
@@ -149,30 +149,6 @@ paths:
149149
'200':
150150
description: Queries as of the requested time
151151
content:
152-
application/json:
153-
schema:
154-
$ref: '#/components/schemas/QueryStatusResponse'
155-
examples:
156-
example:
157-
value:
158-
asOf: "2025-05-01T12:00:00Z"
159-
scope:
160-
caseId: "7b1c6a7b-07e3-42f9-9e3b-3f4e17f73a20"
161-
queries:
162-
- queryId: "1c9d3a9a-1f1b-4a2a-9d7c-3f6b4b9d1f10"
163-
caseId: "7b1c6a7b-07e3-42f9-9e3b-3f4e17f73a20"
164-
label: "Case Summary (All Witnesses)"
165-
userQuery: "Summarise the case based on all witness statements."
166-
queryPrompt: "Summarise the case using all witness statements. Focus on timeline and key claims."
167-
status: ANSWERS_AVAILABLE
168-
effectiveAt: "2025-05-01T11:59:00Z"
169-
- queryId: "5b2a0aa4-7e16-4a62-8d7a-3d1c3c1b9f22"
170-
caseId: "7b1c6a7b-07e3-42f9-9e3b-3f4e17f73a20"
171-
label: "Defendant Position"
172-
userQuery: "Summarise the defendant's position based on witness statements."
173-
queryPrompt: "Provide the defendant summary using the supplied witness statements."
174-
status: INGESTED
175-
effectiveAt: "2025-05-01T11:58:00Z"
176152
application/vnd.casedocumentknowledge-service.queries+json:
177153
schema:
178154
$ref: '#/components/schemas/QueryStatusResponse'
@@ -188,7 +164,7 @@ paths:
188164
label: "Case Summary (All Witnesses)"
189165
userQuery: "Summarise the case based on all witness statements."
190166
queryPrompt: "Summarise the case using all witness statements. Focus on timeline and key claims."
191-
status: ANSWERS_AVAILABLE
167+
status: ANSWER_AVAILABLE
192168
effectiveAt: "2025-05-01T11:59:00Z"
193169
- queryId: "5b2a0aa4-7e16-4a62-8d7a-3d1c3c1b9f22"
194170
caseId: "7b1c6a7b-07e3-42f9-9e3b-3f4e17f73a20"
@@ -200,7 +176,7 @@ paths:
200176
'400':
201177
description: Missing or invalid filters
202178
content:
203-
application/json:
179+
application/vnd.casedocumentknowledge-service.queries+json:
204180
schema: { $ref: '#/components/schemas/ErrorResponse' }
205181

206182
post:
@@ -216,7 +192,7 @@ paths:
216192
requestBody:
217193
required: true
218194
content:
219-
application/json:
195+
application/vnd.casedocumentknowledge-service.queries+json:
220196
schema: { $ref: '#/components/schemas/QueryUpsertRequest' }
221197
examples:
222198
example:
@@ -230,12 +206,12 @@ paths:
230206
'202':
231207
description: Accepted and stored; returns the **definition snapshot** at `effectiveAt` (no per-case status).
232208
content:
233-
application/json:
209+
application/vnd.casedocumentknowledge-service.queries+json:
234210
schema: { $ref: '#/components/schemas/QueryDefinitionsResponse' }
235211
'400':
236212
description: Invalid request
237213
content:
238-
application/json:
214+
application/vnd.casedocumentknowledge-service.queries+json:
239215
schema: { $ref: '#/components/schemas/ErrorResponse' }
240216

241217
/queries/{queryId}:
@@ -263,12 +239,12 @@ paths:
263239
'200':
264240
description: Query as-of the requested time
265241
content:
266-
application/json:
242+
application/vnd.casedocumentknowledge-service.queries+json:
267243
schema: { $ref: '#/components/schemas/QuerySummary' }
268244
'404':
269245
description: Query not found
270246
content:
271-
application/json:
247+
application/vnd.casedocumentknowledge-service.queries+json:
272248
schema: { $ref: '#/components/schemas/ErrorResponse' }
273249

274250
/queries/{queryId}/versions:
@@ -286,7 +262,7 @@ paths:
286262
'200':
287263
description: Definition versions ordered by effectiveAt ascending
288264
content:
289-
application/json:
265+
application/vnd.casedocumentknowledge-service.queries+json:
290266
schema:
291267
type: object
292268
properties:
@@ -297,7 +273,7 @@ paths:
297273
'404':
298274
description: Not found
299275
content:
300-
application/json:
276+
application/vnd.casedocumentknowledge-service.queries+json:
301277
schema: { $ref: '#/components/schemas/ErrorResponse' }
302278

303279
# ---------------------------
@@ -332,16 +308,6 @@ paths:
332308
'200':
333309
description: Answer for the query
334310
content:
335-
application/json:
336-
schema: { $ref: '#/components/schemas/AnswerResponse' }
337-
examples:
338-
example:
339-
value:
340-
queryId: "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
341-
userQuery: "Summarise the case."
342-
answer: "..."
343-
version: 1
344-
createdAt: "2025-01-01T11:11:11Z"
345311
application/vnd.casedocumentknowledge-service.answers+json:
346312
schema: { $ref: '#/components/schemas/AnswerResponse' }
347313
examples:
@@ -355,7 +321,7 @@ paths:
355321
'404':
356322
description: Query/version not found
357323
content:
358-
application/json:
324+
application/vnd.casedocumentknowledge-service.answers+json:
359325
schema: { $ref: '#/components/schemas/ErrorResponse' }
360326

361327
/answers/{caseId}/{queryId}/with-llm:
@@ -385,7 +351,7 @@ paths:
385351
'200':
386352
description: Answer and LLM input
387353
content:
388-
application/json:
354+
application/vnd.casedocumentknowledge-service.answers+json:
389355
schema: { $ref: '#/components/schemas/AnswerWithLlmResponse' }
390356
examples:
391357
example:
@@ -399,7 +365,7 @@ paths:
399365
'404':
400366
description: Query/version not found
401367
content:
402-
application/json:
368+
application/vnd.casedocumentknowledge-service.answers+json:
403369
schema: { $ref: '#/components/schemas/ErrorResponse' }
404370

405371
# ---------------------------
@@ -420,61 +386,50 @@ paths:
420386
'200':
421387
description: Ingestion status
422388
content:
423-
application/json:
389+
application/vnd.casedocumentknowledge-service.ingestion+json:
424390
schema: { $ref: '#/components/schemas/IngestionStatusResponse' }
425391
'400':
426392
description: Missing filters
427393
content:
428-
application/json:
394+
application/vnd.casedocumentknowledge-service.ingestion+json:
429395
schema: { $ref: '#/components/schemas/ErrorResponse' }
430396
# ---------------------------
431-
# Background Processing
397+
# Ingestion Background Processing
432398
# ---------------------------
433-
/backend-process/{courtCentreId}/{roomId}/{date}:
434-
parameters:
435-
- name: courtCentreId
436-
in: path
437-
required: true
438-
schema: { type: string, format: uuid }
439-
- name: roomId
440-
in: path
441-
required: true
442-
schema: { type: string, format: uuid }
443-
- name: date
444-
in: path
445-
required: true
446-
schema: { type: string, format: date }
447-
description: date for which allocated hearings needs to be processed in backend
448-
449-
get:
450-
tags: [ Backend Process ]
399+
/ingestion-process:
400+
post:
401+
tags: [ Ingestion ]
451402
summary: Start backend process for the allocated hearings based on specific courtCentreId,roomId and date
452403
description: Returns the response by starting backend ingestion process silently
453-
operationId: getBackendProcessStarted
404+
operationId: startIngestionProcess
405+
requestBody:
406+
required: true
407+
content:
408+
application/vnd.casedocumentknowledge-service.ingestion-process+json:
409+
schema: { $ref: '#/components/schemas/IngestionProcessRequest' }
410+
examples:
411+
example:
412+
value:
413+
courtCentreId: "f8254db1-1683-483e-afb3-b87fde5a0a26"
414+
roomId: "9e4932f7-97b2-3010-b942-ddd2624e4dd8"
415+
date: "2025-10-23"
416+
effectiveAt: "2025-05-01T12:00:00Z"
454417
responses:
455418
'200':
456-
description: Get backend process started
419+
description: ingestion process started
457420
content:
458-
application/json:
459-
schema: { $ref: '#/components/schemas/BackendProcessResponse' }
421+
application/vnd.casedocumentknowledge-service.ingestion-process+json:
422+
schema: { $ref: '#/components/schemas/IngestionProcessResponse' }
460423
examples:
461424
example:
462425
value:
463-
courtCentreId: "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
464-
roomId: "7dgf67g4-0b8a-43b9-b35d-6489e6dbh678"
465-
date: "2025-01-01"
466-
application/vnd.casedocumentknowledge-service.backend-process+json:
467-
schema: { $ref: '#/components/schemas/BackendProcessResponse' }
468-
examples:
469-
example:
470-
value:
471-
courtCentreId: "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
472-
roomId: "7dgf67g4-0b8a-43b9-b35d-6489e6dbh678"
473-
date: "2025-01-01"
426+
phase: "STARTED"
427+
lastUpdated: "2025-01-02T10:00:00Z"
428+
message: "Ingestion process started"
474429
'404':
475-
description: backend-process not found
430+
description: ingestion process not found
476431
content:
477-
application/json:
432+
application/vnd.casedocumentknowledge-service.ingestion-process+json:
478433
schema: { $ref: '#/components/schemas/ErrorResponse' }
479434

480435
components:
@@ -653,14 +608,35 @@ components:
653608
type: string
654609
description: LLM prompt/input captured for diagnostics.
655610

611+
IngestionProcessRequest:
612+
type: object
613+
required: [ courtCentreId, roomId, date ]
614+
properties:
615+
courtCentreId:
616+
type: string
617+
format: uuid
618+
description: courtCentreId.
619+
roomId:
620+
type: string
621+
format: uuid
622+
description: roomId.
623+
date:
624+
type: string
625+
format: date
626+
description: date for which allocated case hearings needs to be processed in backend.
627+
effectiveAt:
628+
type: string
629+
format: date-time
630+
description: Version effective timestamp.
631+
656632
# ---- Ingestion ----
657633
DocumentIngestionPhase:
658634
type: string
659635
description: Document pipeline phase for a Case.
660636
enum: [NOT_FOUND, UPLOADING, UPLOADED, INGESTING, INGESTED, FAILED]
661637

662638
# ---- backend process ----
663-
BackendProcessResponse:
639+
IngestionProcessPhase:
664640
type: string
665641
description: Backend process response.
666642
enum: [ STARTED, FAILED ]
@@ -679,6 +655,19 @@ components:
679655
type: string
680656
nullable: true
681657

658+
IngestionProcessResponse:
659+
type: object
660+
properties:
661+
phase:
662+
$ref: '#/components/schemas/IngestionProcessPhase'
663+
lastUpdated:
664+
type: string
665+
format: date-time
666+
nullable: true
667+
message:
668+
type: string
669+
nullable: true
670+
682671
# ---- Errors ----
683672
ErrorResponse:
684673
type: object

0 commit comments

Comments
 (0)