-
Notifications
You must be signed in to change notification settings - Fork 3
/
family-context-api.yaml
544 lines (516 loc) · 14.4 KB
/
family-context-api.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
openapi: 3.0.1
info:
title: Family Context
description: >
This is the *DRAFT / WORK IN PROGRESS* API definition for Family Context.
This document is currently undergoing rapid change and should not be used as basis for implementation
without discussing with the project team.
license:
name: MIT
url: https://opensource.org/licenses/MIT
version: 0.0.1
paths:
/api/auth/status:
get:
summary: Get authentication status
description: >
Checks to see if there is currently an active authentication session. Returns the name of the
current credentials if known.
operationId: getAuthStatus
tags:
- auth
responses:
200:
description: authorized credentials present - details in message
content:
application/json:
schema:
type: object
properties:
id:
type: string
name:
type: string
status:
type: string
pattern: "[authenticated]"
required:
- status
403:
description: authenticated credentials were present, but were not valid for this application
401:
description: no authenticated credentials present
content: {}
/api/auth/login:
post:
summary: Submit authentication details
description: >
TODO:
security: []
operationId: postAuthLogin
tags:
- auth
requestBody:
content:
application/json:
schema:
type: object
properties:
userid:
type: string
password:
type: string
required:
- userid
- password
responses:
302:
description: authenticated credentials present - details in message
content: {}
401:
description: no authenticated credentials present or credentials not valid for this application
content: {}
/api/auth/logout:
post:
summary: Logout of the service
description: >
TODO:
operationId: postAuthLogout
tags:
- auth
responses:
302:
description: logout successful, redirect to status
content: {}
/api/search/person:
post:
summary: Search for a person
description: Returns a list of individuals matching the criteria
operationId: searchPerson
tags:
- person
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PersonQuery'
responses:
200:
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Person'
501:
description: Person search is not supported by this application
head:
summary: Is person search supported
description: >
Tests whether the person search API is supported by this implementation. A return value of 200 indicates
that the operation is supported. A 501 indicates that it is not supported, and any front-end applications
should suppress the search functionality.
operationId: searchPersonSupported
tags:
- person
responses:
200:
description: Person search supported
501:
description: Person search is not supported by this application
#/api/search/person/{cmsId}:
# get:
# summary: Search for a person by cms ID
# description: Returns a single person
# operationId: getPersonByCmsId
# tags:
# - person
# parameters:
# - name: cmsId
# in: path
# description: Cms ID of person to return
# required: true
# schema:
# type: string
# responses:
# 200:
# description: successful operation
# content:
# application/json:
# schema:
# $ref: '#/components/schemas/Person'
# 404:
# description: Person not found
# content: {}
/api/person/detail/{personId}:
get:
summary: Find person by ID
description: Returns a single person
operationId: getPersonById
tags:
- person
parameters:
- name: personId
in: path
description: ID of person to return
required: true
schema:
type: string
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Person'
404:
description: Person not found
content: {}
/api/person/detail/{personId}/service:
get:
summary: Get a summary of the services a person has interacted with
operationId: getPersonServicesById
tags:
- person
parameters:
- name: personId
in: path
description: ID of person to return
required: true
schema:
type: string
responses:
200:
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ServiceSummary'
404:
description: Person not found
content: {}
/api/person/detail/{personId}/service/{serviceType}:
get:
summary: Find person by ID
description: Returns a single person
operationId: getPersonServiceByTypeAndId
tags:
- person
parameters:
- name: personId
in: path
description: ID of person to return
required: true
schema:
type: string
- name: serviceType
in: path
description: Servic type to return
required: true
schema:
type: string
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceDetail'
404:
description: Person or service not found
content: {}
/api/person/related/{personId}/:
get:
summary: Get related individuals
description: Returns individuals related to the person
operationId: getPersonRelated
tags:
- person
parameters:
- name: personId
in: path
description: ID of person
required: true
schema:
type: string
responses:
200:
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PersonWithRelationship'
404:
description: Person not found
501:
description: Related individuals is not supported by this application
head:
summary: Is related person supported
description: >
Tests whether the related person API is supported by this implementation. A return value of 200 indicates
that the operation is supported. A 501 indicates that it is not supported, and any front-end applications
should suppress the functionality.
operationId: getPersonRelatedSupported
tags:
- person
parameters:
- name: personId
in: path
description: ID of person
required: true
schema:
type: string
responses:
200:
description: successful operation
501:
description: Related individuals is not supported by this application
security:
- cookieAuth: []
components:
securitySchemes:
cookieAuth:
type: apiKey
in: cookie
name: FCSESSIONID
schemas:
Person:
description: this is a person
type: object
properties:
id:
type: string
cmsId:
type: string
firstName:
type: string
lastName:
type: string
dateOfBirth:
type: string
format: date
gender:
type: string
description: The person's gender. Leave blank for 'unknown'.
pattern: "[male|female|other]"
address:
type: string
required:
- id
- firstName
- lastName
PersonWithRelationship:
description: A related person - describes the relationship to an individual
allOf:
- $ref: '#/components/schemas/Person'
- type: object
properties:
relationship:
type: string
description: A description of the relationship.
relationshipToId:
type: string
description: The ID of the individual this relationship refers to
ServiceSummary:
type: object
properties:
id:
type: string
title:
type: string
lastSynchronised:
type: string
format: date-time
coverageStartDate:
type: string
format: date
coverageEndDate:
type: string
format: date
dataSource:
type: string
recordsAvailable:
type: boolean
coverageExplanation:
type: string
ServiceDetail:
type: object
properties:
summary:
$ref: '#/components/schemas/ServiceSummary'
schema:
type: object
data:
type: object
PersonQuery:
description: >
Used for querying a person.
TODO: As long as this the fields are a subset of the Person object this could be the same, however
we may want more flexibility around the search criteria, such as min/max values for dob.
type: object
properties:
firstName:
type: string
lastName:
type: string
dateOfBirth:
type: string
format: date
paginationDetails:
$ref: '#/components/schemas/PaginationDetails'
required:
- firstName
- lastName
PaginationDetails:
description: When making search requests this may be included to specify a subset of data to be sent.
type: object
properties:
resultsPerPage:
type: integer
pageNumber:
type: integer
SearchResults:
description: Results from querying a person.
properties:
paginationInfo:
$ref: '#/components/schemas/PaginationInfo'
results:
type: array
items:
$ref: '#/components/schemas/Person'
PaginationInfo:
description: Search results may include this to specify that a subset of data was sent.
type: object
properties:
totalResults:
type: integer
resultsPerPage:
type: integer
pageNumber:
type: integer
Police:
type: object
properties:
policeArea:
title: Police Area
type: string
contact:
title: Contact
$ref: '#/components/schemas/Contact'
safeGuardingOffences:
title: Safeguarding Offences (a maximum of 3 will be listed)
type: array
items:
$ref: '#/components/schemas/OffenceSummary'
nonSafeGuardingOffences:
title: Non-safeguarding Offences
type: array
items:
$ref: '#/components/schemas/OffenceRecordsFound'
OffenceSummary:
type: object
properties:
dateOfOffence:
type: string
format: date
title: Date of Offence
typeOfOffence:
type: string
title: Type of Offence
natureOfInvolvement:
type: string
title: Nature of Involvement
OffenceRecordsFound:
type: object
properties:
recordsFound:
type: string
title: Records Found
School:
type: object
properties:
serviceInvolvement:
title: Service involvement
type: string
pattern: "[current|historic]"
contact:
title: Contact
$ref: '#/components/schemas/Contact'
schoolName:
title: School name
type: string
admissionType:
title: Admission type
type: string
AdultSocialCare:
type: object
properties:
serviceInvolvement:
title: Service involvement
type: string
pattern: "[current|historic]"
localAuthorityOrganisation:
title: Local Authority Organisation
type: string
contact:
title: Contact
$ref: '#/components/schemas/Contact'
startDateOfLastInvolvement:
title: Start of last involvement
type: string
format: date
dateOfMostRecentInteraction:
title: Date of most recent interaction
type: string
format: date
Housing:
type: object
properties:
serviceInvolvement:
title: Service involvement
type: string
pattern: "[current|historic]"
housingAssociation:
title: Housing Association
type: string
contact:
title: Contact
$ref: '#/components/schemas/Contact'
tenancyStart:
title: Tenancy Start
type: string
format: date
antiSocialBehaviour:
title: Anti social behaviour
type: string
pattern: "[open|closed]"
rentArrears:
title: Rent arrears
type: string
pattern: "[open|closed]"
noticeSeekingPossession:
title: Notice seeking possession
type: string
pattern: "[open|closed]"
eviction:
title: Eviction
type: string
pattern: "[open|closed]"
Contact:
type: object
description: Generic object describing the contact information
properties:
name:
type: string
email:
type: string
phone:
type: string
role:
type: string