Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BACK-3183] Add ability to request connection to multiple providers #162

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

toddkazakov
Copy link
Contributor

  • Refactored the existing data model to support multiple providers
  • The API is backward compatible to allow Tidepool Web to switch to the new endpoints and data model
  • Added the ability to request twiist account connection

@toddkazakov
Copy link
Contributor Author

/deploy qa1

@tidebot
Copy link
Collaborator

tidebot commented Oct 18, 2024

toddkazakov updated values.yaml file in qa1

@tidebot
Copy link
Collaborator

tidebot commented Oct 18, 2024

toddkazakov updated flux policies file in qa1

@tidebot
Copy link
Collaborator

tidebot commented Oct 18, 2024

toddkazakov deployed clinic tk-connect-twiist branch to qa1 namespace

@tidebot
Copy link
Collaborator

tidebot commented Oct 18, 2024

Error: 409 is at a1eba92bec367e25d41188dddda405a36a3f1094 but expected ee70c3eee31c708747c89d60e0baf56fe01b4e27!

lostlevels
lostlevels previously approved these changes Oct 25, 2024
Describe("Create Patient", func() {
It("Succeeds", func() {
rec := httptest.NewRecorder()
req := prepareRequest(http.MethodPost, fmt.Sprintf("/v1/clinics/%s/patients", *clinic.Id), "./test/common_fixtures/02_create_patient.json")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was clinic's Id ever populated before this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests are executed in order. The clinic id was populated in the previous test:

Expect(json.Unmarshal(body, &clinic)).To(Succeed())

Describe("Update Data Sources", func() {
It("Succeeds", func() {
rec := httptest.NewRecorder()
req := prepareRequest(http.MethodPut, fmt.Sprintf("/v1/patients/%s/data_sources", *patient.Id), "./test/common_fixtures/03_update_data_sources.json")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question here, was patient ever setup before this test? Maybe I'm missing it, but isn't patient.Id nil here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are executed in order and the id was populated in the previous test.

Describe("Send Dexcom Connection Request", func() {
It("Succeeds", func() {
rec := httptest.NewRecorder()
req := prepareRequest(http.MethodPost, fmt.Sprintf("/v1/clinics/%s/patients/%s/connect/dexcom", *clinic.Id, *patient.Id), "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same setup .Id nil question.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are executed in order and the id was populated in the previous two tests.

summary: Connect Data Provider
operationId: ConnectProvider
responses:
'204':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this consistent w/ the actual response code? Looks like its 200 OK?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll need to change the spec, because the frontend expects a patient object response. Good catch.

@toddkazakov
Copy link
Contributor Author

/deploy qa4

@tidebot
Copy link
Collaborator

tidebot commented Nov 22, 2024

toddkazakov updated values.yaml file in qa4

@tidebot
Copy link
Collaborator

tidebot commented Nov 22, 2024

toddkazakov updated flux policies file in qa4

@tidebot
Copy link
Collaborator

tidebot commented Nov 22, 2024

toddkazakov deployed clinic tk-connect-twiist branch to qa4 namespace

lostlevels
lostlevels previously approved these changes Nov 27, 2024
api/mappers.go Outdated
return empty
}
requestsForProvider, exist := requests[string(provider)]
if !exist || len(requests) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the intent here to check requests to be empty or requestsForProvider

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent was to check requestsForProvider so the logic was incorrect, good catch. I have simplified this.

lostlevels
lostlevels previously approved these changes Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants