Skip to content

Commit

Permalink
Merge pull request #89 from tidepool-org/BACK-2500-add-ability-to-sen…
Browse files Browse the repository at this point in the history
…d-care-partner-invites

[BACK-2500] add ability to send care partner invites
  • Loading branch information
ewollesen committed Mar 19, 2024
2 parents 1bd3046 + ec6a5fc commit a246043
Show file tree
Hide file tree
Showing 6 changed files with 254 additions and 0 deletions.
170 changes: 170 additions & 0 deletions reference/alerts.v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
openapi: 3.0.0
info:
title: Alerts API
version: '1.0'
description: |-
The Tidepool API is an HTTP REST API used by Tidepool clients to communicate with the Tidepool Platform.
For more information, see the [Getting Started](../docs/quick-start.md) section.
termsOfService: https://developer.tidepool.org/terms-of-use/
contact:
name: API Support
url: https://support.tidepool.org/
email: support@tidepool.org
license:
name: BSD-2-Clause
url: https://github.com/tidepool-org/hydrophone/blob/master/LICENSE
x-tidepool-service: https://github.com/tidepool-org/hydrophone

servers:
- url: 'https://external.integration.tidepool.org'
description: integration
- url: 'https://api.tidepool.org'
description: production
- url: 'https://dev1.dev.tidepool.org'
description: dev1
- url: 'https://qa1.development.tidepool.org'
description: qa1
- url: 'https://qa2.development.tidepool.org'
description: qa2

security:
- sessionToken: []

tags:
- name: Alerts
description: >-
Endpoints related to alert configuration and management.
paths:
/v1/users/{userId}/followers/{followerUserId}/alerts:
parameters:
- $ref: '#/components/parameters/userId'
- $ref: '#/components/parameters/followerUserId'

delete:
summary: Delete an alerts configuration
description: >-
Delete an existing alerts configuration.
operationId: DeleteAlertsConfiguration
responses:
'200':
$ref: '#/components/responses/OK'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
tags:
- Alerts

get:
summary: Get an alerts configuration
description: >-
Retrieve an existing alerts configuration.
operationId: GetAlertsConfiguration
responses:
'200':
$ref: '#/components/responses/AlertsConfig'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
tags:
- Alerts

post:
summary: Create or update an alerts configuration
description: >-
Create or update an alerts configuration.
If no alerts configuration exists, it will be created.
operationId: UpsertAlertsConfiguration
requestBody:
required: true
content:
application/json:
schema:
$ref: './common/models/alertsconfig.v1.yaml'
responses:
'200':
$ref: '#/components/responses/OK'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
tags:
- Alerts


components:
securitySchemes:
sessionToken:
$ref: ./common/security/tidepoolsessiontoken.v1.yaml

responses:
OK:
description: 'OK'

BadRequest:
description: 'Bad Request'

Unauthorized:
description: 'Unauthorized'

Forbidden:
description: 'Forbidden'

NotFound:
description: 'Not Found'

ServerError:
description: 'Server Error'

AlertsConfig:
description: Alerts Config
content:
'application/json':
schema:
$ref: './common/models/alertsconfig.v1.yaml'

parameters:
userId:
name: userId
description: >-
Tidepool User ID of the user who granted follow access.
in: path
required: true
schema:
$ref: '#/components/schemas/tidepoolUserId'


followerUserId:
name: followerUserId
description: >-
Tidepool User ID of the care partner to receive alerts.
in: path
required: true
schema:
$ref: '#/components/schemas/tidepoolUserId'

schemas:
tidepoolUserId:
$ref: './common/models/tidepooluserid.yaml'
17 changes: 17 additions & 0 deletions reference/common/models/alerts/base.v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# intended as a mix-in to build complete alert specs
type: object
properties:
enabled:
type: boolean
default: false
description: >-
A toggle for disabling the alert.
repeat:
type: integer
default: 0
minimum: 0
maximum: 240
description: >-
Duration in minutes, after which an alert will be repeated.
A value of 0 disables the repeat functionality.
10 changes: 10 additions & 0 deletions reference/common/models/alerts/delay.v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# intended as a mix-in to build complete alert specs
type: object
properties:
delay:
type: integer
default: 0
minimum: 0
maximum: 120
description: >-
Duration in minutes to wait before alerting.
7 changes: 7 additions & 0 deletions reference/common/models/alerts/glucosethreshold.v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# intended as a mix-in to build complete alert specs
type: object
properties:
threshold:
$ref: '../../../data/models/blood/glucose/glucose.v1.yaml'
required:
- threshold
43 changes: 43 additions & 0 deletions reference/common/models/alertsconfig.v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
type: object
properties:
urgentLow:
allOf:
- $ref: './alerts/base.v1.yaml'
- $ref: './alerts/glucosethreshold.v1.yaml'
- type: object
description: >-
Blood glucose measurements at or below this value will trigger an immediate and urgent alert.
low:
allOf:
- $ref: './alerts/base.v1.yaml'
- $ref: './alerts/delay.v1.yaml'
- $ref: './alerts/glucosethreshold.v1.yaml'
- type: object
description: >-
Blood glucose measurements at or below this value will trigger an alert.
high:
allOf:
- $ref: './alerts/base.v1.yaml'
- $ref: './alerts/delay.v1.yaml'
- $ref: './alerts/glucosethreshold.v1.yaml'
- type: object
description: >-
Blood glucose measurements at or above this value will trigger an alert.
noCommunication:
allOf:
- $ref: './alerts/base.v1.yaml'
- $ref: './alerts/delay.v1.yaml'
- type: object
description: >-
An alert sent when issues prevent the display of CGM data.
notLooping:
allOf:
- $ref: './alerts/base.v1.yaml'
- $ref: './alerts/delay.v1.yaml'
- type: object
description: >-
An alert sent when the Tidepool Loop app is unable to loop.
minProperties: 1
description: >-
Configuration for alerts triggered in response to the status of a user's
device and data.
7 changes: 7 additions & 0 deletions reference/confirm/models/invitation.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ properties:
note: { }
upload: { }
view: { }
nickname:
description: A user-friendly name for the recipient of the invitation.
type: string
example: "Julia"
alertsConfig:
$ref: '../../common/models/alertsconfig.v1.yaml'

required:
- email
- permissions

0 comments on commit a246043

Please sign in to comment.