Skip to content

Commit 1f90650

Browse files
CAT-1760: create get applicant consents endpoint (#161)
1 parent edf0598 commit 1f90650

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

openapi.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ paths:
3838
$ref: paths/applicants.yaml#/applicant
3939
/applicants/{applicant_id}/restore:
4040
$ref: paths/applicants.yaml#/restore
41+
/applicants/{applicant_id}/consents:
42+
$ref: paths/applicants.yaml#/consents
4143
# Workflow Runs
4244
/workflow_runs:
4345
$ref: paths/workflow_runs.yaml#/workflow_runs

paths/applicants.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,29 @@ restore:
153153
description: No Content
154154
default:
155155
$ref: ../responses/default_error.yaml
156+
157+
consents:
158+
get:
159+
summary: Retrieve Applicant Consents
160+
operationId: find_applicant_consents
161+
description: >
162+
Retrieves consents for single applicant.
163+
parameters:
164+
- name: applicant_id
165+
in: path
166+
required: true
167+
schema:
168+
type: string
169+
format: uuid
170+
responses:
171+
"200":
172+
description: Applicant Consents object
173+
content:
174+
application/json:
175+
schema:
176+
type: array
177+
description: The applicant's consents
178+
items:
179+
$ref: "../schemas/applicants/definitions.yaml#/applicant_consent"
180+
default:
181+
$ref: ../responses/default_error.yaml

schemas/applicants/definitions.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,23 @@ applicant_consent_builder:
9898
granted:
9999
type: boolean
100100

101+
applicant_consent:
102+
type: object
103+
required:
104+
- name
105+
- granted
106+
- granted_at
107+
properties:
108+
name:
109+
$ref: "#/applicant_consent_name"
110+
granted:
111+
type: boolean
112+
granted_at:
113+
type: string
114+
nullable: true
115+
format: date-time
116+
description: The date and time when this applicant consent was granted, if not granted the value is nil.
117+
101118
applicant_consent_name:
102119
type: string
103120
enum:

0 commit comments

Comments
 (0)