Skip to content

CCM-22090: Recipient response message retrieval API - #1090

Open
rhyscoxnhs wants to merge 20 commits into
releasefrom
feature/CCM-22090
Open

rhyscoxnhs wants to merge 20 commits into
releasefrom
feature/CCM-22090

Conversation

@rhyscoxnhs

@rhyscoxnhs rhyscoxnhs commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds proxy configuration for new recipient response message retrieval API.

Reviews Required

  • Dev
  • Test
  • Tech Author
  • Product Owner

Checklist

  • Brief description of work completed, and any technical decisions made as part of the PR
  • PR link added as a comment to the relevant JIRA ticket
  • PR link shared on Slack and/or Teams
  • 2 reviews received
  • Tester approval

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

@github-actions

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

cgitim
cgitim previously requested changes Aug 10, 2026
Comment thread proxies/shared/policies/ExtractVariables.MessageResponses.Get.Request.xml Outdated
Comment thread proxies/shared/policies/AssignMessage.MessageResponses.Get.Request.xml Outdated
Comment thread sandbox/handlers/message_responses.js Outdated
Comment thread specification/documentation/APIDescription.md Outdated
Comment thread specification/documentation/GetResponses.md Outdated
Comment thread specification/schemas/components/ResponseItem.yaml Outdated
Comment thread specification/responses/2xx/200_Responses.yaml Outdated
Comment thread specification/communications-manager.yaml Outdated
Comment thread sandbox/handlers/message_responses.js Outdated
Comment thread specification/schemas/responses/GetResponsesSuccess.yaml Outdated
@github-actions

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

@rhyscoxnhs
rhyscoxnhs requested a review from cgitim August 12, 2026 10:44
Comment thread specification/documentation/GetMessageResponses.md
Comment thread specification/documentation/GetMessageResponses.md Outdated
Comment thread specification/responses/4xx/message_responses/422_TooManyResponses.yaml Outdated
Comment thread specification/endpoints/get_responses.yaml Outdated
Comment thread specification/responses/4xx/message_responses/400_UnableToGetResponses.yaml Outdated
Comment thread specification/schemas/enums/ErrorTooManyResponses.yaml Outdated
Comment thread sandbox/handlers/message_responses.js
Comment thread specification/documentation/APIDescription.md Outdated
Comment thread tests/sandbox/message_responses/test_success.py Outdated
@github-actions

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

@rhyscoxnhs
rhyscoxnhs requested a review from mjewildnhs August 14, 2026 13:37

@mjewildnhs mjewildnhs left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I've paused reviewing until we get an answer on whether we should be following the JSON:API convention as per my review comment.

Comment thread specification/endpoints/get_responses.yaml
@mark-r-bjss

Copy link
Copy Markdown
Collaborator

After a team discussion we decided that

  1. It would be best to align the response more closely with existing API responses by adding in a data object wrapper and listing the items within.
  2. To stick with a 500 response if there are too many responses found for the messageId as this is an unexpected real-world scenario.
  3. To extract the repeated fields messageId and messageReference into the new data wrapper.
  4. To sort the patient-responses so that the API produces consistent responses for the same query as this would make testing easier.

@rhyscoxnhs

Copy link
Copy Markdown
Collaborator Author

One revision to the above - since JSON API mandates specific fields for the data wrapper, we can't extract messageId and messageReference out of the attributes object, the only valid fields in the data wrapper are id, attributes, links, relationships and type.

@github-actions

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

@rhyscoxnhs

Copy link
Copy Markdown
Collaborator Author

Migrated to JSON:API

@mjewildnhs mjewildnhs left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not finished yet but posting feedback I have.

Comment thread specification/documentation/GetMessageResponses.md Outdated
Comment thread specification/responses/4xx/415_UnsupportedMedia.yaml
Comment thread specification/endpoints/get_responses.yaml
Comment thread sandbox/handlers/message_responses.js Outdated
Comment thread sandbox/handlers/message_responses.js Outdated
Comment thread sandbox/handlers/message_responses.js
Comment thread sandbox/handlers/message_responses.js Outdated
@github-actions

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

@rhyscoxnhs
rhyscoxnhs dismissed cgitim’s stale review August 24, 2026 07:26

Requested changes have been addressed

Comment thread sandbox/handlers/message_responses.js
Comment thread specification/responses/4xx/415_UnsupportedMedia.yaml
Comment thread tests/api/message_responses/test_200_success.py
@github-actions

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

@github-actions

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

Comment thread sandbox/__test__/message_responses.spec.js Outdated
Comment thread proxies/live/apiproxy/targets/app-response-target.xml
Comment thread sandbox/handlers/message_responses.js Outdated
Comment thread specification/schemas/responses/RecipientResponse.yaml
@github-actions

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

@github-actions

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

Comment thread proxies/shared/partials/Partial.Flows.GetMessageResponsesEndpoint.xml Outdated
@github-actions

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

@github-actions

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

@mjewildnhs

Copy link
Copy Markdown

Happy with the changes.
Leaving approval off as I suspect further changes to get the build/tests working when app-response routing resolved.
One outstanding comment is around tests which we'll have a bit more clarity on when we get things working.

@mark-r-bjss mark-r-bjss left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved, in that I can't see any issues but it's very hard to follow what's going on with these XML files and we will be relying heavily on the testing to find any issues. Also worth ensuring that somebody with experience in this area reviews this.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

@github-actions

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

@github-actions

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

@github-actions

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

@github-actions

Copy link
Copy Markdown

This branch is work on a ticket in the NHS Digital APM JIRA Project. Here's a handy link to the ticket:

CCM-22090

Comment thread sandbox/app.js
app: app.locals.app_name,
msg: "startup",
server_port: server.address().port,
server_port: address ? address.port : null,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This fixes some flakes with the unit tests, without this they sporadically fail in CI

)


@pytest.mark.devtestonly

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems a shame to only run these new tests against internal-dev. Any reason they can't?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just noticed Mike's comment above.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

In order for these tests to work we need to seed the environment with long lived test data. My feeling is that dev is the only environment where this is suitable.

Comment on lines +16 to +20
{% if ENVIRONMENT_TYPE == 'sandbox' %}
<Template>/api/v1/message-responses/{data.messageId}</Template>
{% else %}
<Template>/api/response/{data.messageId}</Template>
{% endif %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it would be nice for the sandbox to be as similar to the real backend as possible. Is there anything stopping us from changing sandbox so it responds to the same path?

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.

5 participants