forked from DepartmentOfHealth-htbhf/htbhf-claimant-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yml
577 lines (577 loc) · 16.5 KB
/
swagger.yml
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
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
swagger: "2.0"
info:
description: "Responsible for the persistence and retrieval of Claims (and Claimants)\
\ for Help To Buy Healthy Food"
version: "1.0"
title: "Claimant Service"
contact:
name: "Department Of Health"
url: "https://github.com/DepartmentOfHealth-htbhf"
email: "dh-htbhf-team@equalexperts.com"
license:
name: "MIT"
url: "https://opensource.org/licenses/MIT"
host: "localhost:8090"
basePath: "/"
tags:
- name: "claim-controller"
description: "Endpoints for dealing with claims, e.g. persisting a claim."
paths:
/v3/claims:
post:
tags:
- "claim-controller"
summary: "Create a claim."
operationId: "createClaimUsingPOST"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "newClaimDTO"
description: "The claim to persist"
required: false
schema:
$ref: "#/definitions/NewClaimDTO"
responses:
"200":
description: "OK"
schema:
$ref: "#/definitions/ClaimResultDTO"
"201":
description: "Created"
"400":
description: "Bad request"
schema:
$ref: "#/definitions/ErrorResponse"
"401":
description: "Unauthorized"
"403":
description: "Forbidden"
"404":
description: "Not Found"
deprecated: false
/v3/claims/{id}:
get:
tags:
- "claim-controller"
summary: "Retrieve a claim by id."
operationId: "retrieveClaimByIdUsingGET"
produces:
- "application/json"
parameters:
- name: "id"
in: "path"
description: "id"
required: true
type: "string"
format: "uuid"
responses:
"200":
description: "OK"
schema:
$ref: "#/definitions/ClaimDTO"
"401":
description: "Unauthorized"
"403":
description: "Forbidden"
"404":
description: "Claim not found"
schema:
$ref: "#/definitions/ErrorResponse"
deprecated: false
definitions:
AddressDTO:
type: "object"
properties:
addressLine1:
type: "string"
example: "Flat B"
description: "First line of the address"
minLength: 1
maxLength: 500
addressLine2:
type: "string"
example: "221 Baker Street"
description: "Second line of the address"
minLength: 0
maxLength: 500
county:
type: "string"
example: "Devon"
description: "County of the address"
minLength: 0
maxLength: 500
postcode:
type: "string"
example: "AA1 1AA"
description: "The postcode of the address."
pattern: "^(GIR ?0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]([0-9ABEHMNPRV-Y])?)|[0-9][A-HJKPS-UW])\
\ ?[0-9][ABD-HJLNP-UW-Z]{2})$"
townOrCity:
type: "string"
example: "London"
description: "Town or city of the address"
minLength: 1
maxLength: 500
title: "AddressDTO"
description: "Multi purpose address object"
ClaimDTO:
type: "object"
properties:
cardAccountId:
type: "string"
example: "8b66a86f-778e-47f9-b998-a042476ef2c0"
description: "Card id returned from the card provider"
cardStatus:
type: "string"
description: "The current card status"
enum:
- "ACTIVE"
- "PENDING_CANCELLATION"
- "SCHEDULED_FOR_CANCELLATION"
- "CANCELLED"
cardStatusTimestamp:
type: "string"
format: "date-time"
example: "2020/01/06T14:00:00.352"
description: "Time of when the card status was last updated"
claimStatus:
type: "string"
description: "The claim's current status"
enum:
- "REJECTED"
- "NEW"
- "PENDING"
- "ACTIVE"
- "PENDING_EXPIRY"
- "EXPIRED"
- "ERROR"
claimStatusTimestamp:
type: "string"
format: "date-time"
example: "2020/01/06T14:00:00.352"
description: "Timestamp of when the claim status was last updated"
claimant:
$ref: "#/definitions/ClaimantDTO"
currentIdentityAndEligibilityResponse:
description: "The current identity and eligibility response when processing\
\ the last payment cycle."
$ref: "#/definitions/CombinedIdentityAndEligibilityResponse"
dwpHouseholdIdentifier:
type: "string"
example: "dd77e887-49cf-43cd-b974-b17273602018"
description: "Household identifier returned from DWP"
eligibilityOverride:
description: "An override of the DWP/HMRC eligibility decision"
$ref: "#/definitions/EligibilityOverrideDTO"
eligibilityStatus:
type: "string"
description: "The claim's eligibility status"
enum:
- "ELIGIBLE"
- "INELIGIBLE"
- "PENDING"
- "NO_MATCH"
- "ERROR"
- "DUPLICATE"
eligibilityStatusTimestamp:
type: "string"
format: "date-time"
example: "2020/01/06T14:00:00.352"
description: "Timestamp of when the eligibility status was last updated"
hmrcHouseholdIdentifier:
type: "string"
example: "4c697b0a-5709-423b-8e31-b63796cdca7f"
description: "Household identifier returned from HMRC"
id:
type: "string"
format: "uuid"
example: "96c3f8c0-f6d9-4ad4-9ed9-72fcbd8d692d"
description: "The claim's unique id."
initialIdentityAndEligibilityResponse:
description: "The initial identity and eligibility response that was performed\
\ when the claimant first applied."
$ref: "#/definitions/CombinedIdentityAndEligibilityResponse"
title: "ClaimDTO"
description: "An existing claim for Apply for healthy start."
ClaimResultDTO:
type: "object"
properties:
claimStatus:
type: "string"
description: "The status of the claim"
enum:
- "REJECTED"
- "NEW"
- "PENDING"
- "ACTIVE"
- "PENDING_EXPIRY"
- "EXPIRED"
- "ERROR"
claimUpdated:
type: "boolean"
description: "True if an existing, active, claim was updated. May be null\
\ if a new claim is created."
eligibilityStatus:
type: "string"
description: "The eligibility status of the claim"
enum:
- "ELIGIBLE"
- "INELIGIBLE"
- "PENDING"
- "NO_MATCH"
- "ERROR"
- "DUPLICATE"
updatedFields:
type: "array"
description: "List of fields that were updated in the existing claim. May\
\ be null if a new claim is created."
items:
type: "string"
verificationResult:
description: "The result of verifying the claimant's details"
$ref: "#/definitions/VerificationResult"
voucherEntitlement:
description: "Details of the vouchers that the claimant is entitled to"
$ref: "#/definitions/VoucherEntitlementDTO"
title: "ClaimResultDTO"
ClaimantDTO:
type: "object"
properties:
address:
description: "The address of the claimant"
$ref: "#/definitions/AddressDTO"
dateOfBirth:
type: "string"
format: "date"
example: "1985-12-30"
description: "The date of birth, in the format YYYY-MM-DD"
emailAddress:
type: "string"
example: "test@email.com"
description: "The claimant's email address. e.g. test@email.com"
minLength: 0
maxLength: 256
pattern: "(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$)"
expectedDeliveryDate:
type: "string"
format: "date"
example: "2020-06-28"
description: "If the claimant is pregnant, this is the expected date of delivery\
\ (due date) of their baby, in the format YYYY-MM-DD. The due date must\
\ be between one month in the past and 8 months in the future."
firstName:
type: "string"
example: "Jo"
description: "First (given) name"
minLength: 1
maxLength: 500
initiallyDeclaredChildrenDob:
type: "array"
example:
- "2018-01-30"
- "2019-12-31"
description: "The dates of birth of the claimant's declared children (if they\
\ have any)"
items:
type: "string"
lastName:
type: "string"
example: "Bloggs"
description: "Last (surname or family) name"
minLength: 1
maxLength: 500
nino:
type: "string"
example: "QQ123456C"
description: "National Insurance number"
pattern: "^(?!BG|GB|NK|KN|TN|NT|ZZ)[A-CEGHJ-PR-TW-Z][A-CEGHJ-NPR-TW-Z](\\\
d{6})[A-D]$"
phoneNumber:
type: "string"
example: "+447123456789"
description: "The claimant's UK phone number. Must be in +44 format, e.g.\
\ +447123456789"
pattern: "^\\+44\\d{9,10}$"
title: "ClaimantDTO"
description: "A claimant for help to buy healthy foods."
CombinedIdentityAndEligibilityResponse:
type: "object"
properties:
addressLine1Match:
type: "string"
enum:
- "matched"
- "not_matched"
- "not_held"
- "not_supplied"
- "invalid_format"
- "not_set"
deathVerificationFlag:
type: "string"
enum:
- "n/a"
- "death_not_verified"
- "limited_supporting_documentation"
- "partial_supporting_documentation"
- "full_supporting_documentation"
dobOfChildrenUnder4:
type: "array"
items:
type: "string"
dwpHouseholdIdentifier:
type: "string"
eligibilityStatus:
type: "string"
enum:
- "confirmed"
- "not_confirmed"
- "not_set"
emailAddressMatch:
type: "string"
enum:
- "matched"
- "not_matched"
- "not_held"
- "not_supplied"
- "invalid_format"
- "not_set"
hmrcHouseholdIdentifier:
type: "string"
identityStatus:
type: "string"
enum:
- "matched"
- "not_matched"
mobilePhoneMatch:
type: "string"
enum:
- "matched"
- "not_matched"
- "not_held"
- "not_supplied"
- "invalid_format"
- "not_set"
postcodeMatch:
type: "string"
enum:
- "matched"
- "not_matched"
- "not_held"
- "not_supplied"
- "invalid_format"
- "not_set"
pregnantChildDOBMatch:
type: "string"
enum:
- "matched"
- "not_matched"
- "not_held"
- "not_supplied"
- "invalid_format"
- "not_set"
qualifyingBenefits:
type: "string"
enum:
- "universal_credit"
- "employment_and_support_allowance"
- "income_support"
- "jobseekers_allowance"
- "pension_credit"
- "child_tax_credit"
- "not_set"
title: "CombinedIdentityAndEligibilityResponse"
EligibilityOverrideDTO:
type: "object"
properties:
childrenDob:
type: "array"
example:
- "2018-01-30"
- "2019-12-31"
description: "The dates of birth of the claimant's children (if none then\
\ an empty list must be passed)"
items:
type: "string"
eligibilityOutcome:
type: "string"
example: "confirmed"
description: "Overrides the eligibility outcome from eligibility service"
enum:
- "confirmed"
- "not_confirmed"
- "not_set"
overrideUntil:
type: "string"
format: "date"
example: "2025-05-17"
description: "The date at which the override expires"
title: "EligibilityOverrideDTO"
description: "Used to override eligibility decision from eligibility service"
ErrorResponse:
type: "object"
properties:
fieldErrors:
type: "array"
items:
$ref: "#/definitions/FieldError"
message:
type: "string"
requestId:
type: "string"
status:
type: "integer"
format: "int32"
timestamp:
type: "string"
title: "ErrorResponse"
description: "The format of all error responses"
FieldError:
type: "object"
properties:
field:
type: "string"
message:
type: "string"
title: "FieldError"
NewClaimDTO:
type: "object"
properties:
claimant:
description: "The person making the claim"
$ref: "#/definitions/ClaimantDTO"
deviceFingerprint:
type: "object"
description: "The fingerprint of the device used to make the claim, as best\
\ it can be identified. Probably a collection of header values."
eligibilityOverride:
description: "Eligibility override decision based on eligibility outcome and\
\ until date"
$ref: "#/definitions/EligibilityOverrideDTO"
webUIVersion:
type: "string"
example: 1.0
description: "The version of the web-ui application used to create this request.\
\ Identifies which version of the Terms and Conditions the applicant accepted."
title: "NewClaimDTO"
description: "A claim (application) for help to buy healthy foods. Contains all\
\ details that need to be persisted as part of the application."
VerificationResult:
type: "object"
properties:
addressLine1Match:
type: "string"
enum:
- "matched"
- "not_matched"
- "not_held"
- "not_supplied"
- "invalid_format"
- "not_set"
deathVerificationFlag:
type: "string"
enum:
- "n/a"
- "death_not_verified"
- "limited_supporting_documentation"
- "partial_supporting_documentation"
- "full_supporting_documentation"
eligibilityOutcome:
type: "string"
enum:
- "confirmed"
- "not_confirmed"
- "not_set"
emailAddressMatch:
type: "string"
enum:
- "matched"
- "not_matched"
- "not_held"
- "not_supplied"
- "invalid_format"
- "not_set"
identityOutcome:
type: "string"
enum:
- "matched"
- "not_matched"
isPregnantOrAtLeast1ChildMatched:
type: "boolean"
mobilePhoneMatch:
type: "string"
enum:
- "matched"
- "not_matched"
- "not_held"
- "not_supplied"
- "invalid_format"
- "not_set"
postcodeMatch:
type: "string"
enum:
- "matched"
- "not_matched"
- "not_held"
- "not_supplied"
- "invalid_format"
- "not_set"
pregnantChildDOBMatch:
type: "string"
enum:
- "matched"
- "not_matched"
- "not_held"
- "not_supplied"
- "invalid_format"
- "not_set"
qualifyingBenefits:
type: "string"
enum:
- "universal_credit"
- "employment_and_support_allowance"
- "income_support"
- "jobseekers_allowance"
- "pension_credit"
- "child_tax_credit"
- "not_set"
title: "VerificationResult"
description: "The result of verifying the claimant's details"
VoucherEntitlementDTO:
type: "object"
properties:
singleVoucherValueInPence:
type: "integer"
format: "int32"
example: 310
description: "The financial value of a single voucher"
totalVoucherEntitlement:
type: "integer"
format: "int32"
example: 4
description: "The total number of vouchers the claimant is entitled to"
totalVoucherValueInPence:
type: "integer"
format: "int32"
example: 1240
description: "The sum total value of all vouchers the claimant is entitled\
\ to"
vouchersForChildrenBetweenOneAndFour:
type: "integer"
format: "int32"
example: 1
description: "The number of vouchers for children between one and 4 years\
\ old"
vouchersForChildrenUnderOne:
type: "integer"
format: "int32"
example: 2
description: "The number of vouchers for children under one year old"
vouchersForPregnancy:
type: "integer"
format: "int32"
example: 1
description: "The number of vouchers for pregnancy"
title: "VoucherEntitlementDTO"