Skip to content

NPA-5191: Update POST QuestionnaireResponse DUPLICATE_RELATIONSHIP#231

Merged
LeoKHoward merged 6 commits into
masterfrom
task/NPA-5191/update-oas-postman-duplicate-relationship
Jul 3, 2025
Merged

NPA-5191: Update POST QuestionnaireResponse DUPLICATE_RELATIONSHIP#231
LeoKHoward merged 6 commits into
masterfrom
task/NPA-5191/update-oas-postman-duplicate-relationship

Conversation

@LeoKHoward

@LeoKHoward LeoKHoward commented Jul 2, 2025

Copy link
Copy Markdown
Contributor

Pull Request

🧾 Ticket Link

https://nhsd-jira.digital.nhs.uk/browse/NPA-5191

📄 Description/Summary of Changes

  • Updated the OAS for POST /QuestionnaireResponse endpoint to include new DUPLICATE_RELATIONSHIP error response

  • Created DUPLICATE_RELATIONSHIP error

  • Updated Postman to include a test scenario for the DUPLICATE_RELATIONSHIP error

  • Modified Sandbox to handle DUPLICATE_RELATIONSHIP error for requests with specific NHS number

  • Updated Sandbox to include test case for the DUPLICATE_RELATIONSHIP error

  • Updated Postman URL


🧪 Developer Testing Carried Out

  • Updated unit tests in Sandbox to cover both successful (200) and DUPLICATE_RELATIONSHIP (409) scenarios

  • Validated OAS via Swagger


🧪 Reviewer Testing Required

  • Testing Environment:

  • Deploy the changes to the sandbox environment (dev/test/int) with the feature flag for proposed proxy roles enabled

  • Verify Postman:

  • Run the DUPLICATE_RELATIONSHIP test ensuring request with source.identifier.value="9000000049" returns a 409 and the expected error response body

  • Verify Sandbox API:

  • Send a POST request to QuestionnaireResponse in the sandbox with the body containing source.identifier.value="9000000049"

  • Confirm the response is a 409 with the OperationOutcome resource containing code: DUPLICATE_RELATIONSHIP

  • Test with a different NHS number 9000000009 to ensure a 200 response is returned


✅ Developer Checklist

  • PR title follows the format: NPA-XXXX: <short-description>
  • Branch name follows the convention: <type>/NPA-XXXX-<short-description>
  • Commit messages follow the template: NPA-XXXX: <short-description>
  • All acceptance criteria from the Jira ticket are addressed
  • Automated tests (unit/integration/API/infrastructure etc. tests) are added or updated
  • The traceability matrix is updated
    with
    new tests or requirements
  • Assignees and appropriate labels (e.g. terraform, documentation) are added

👀 Reviewer Checklist

  • Changes meet the acceptance criteria of the Jira ticket
  • Code is able to be merged (no conflicts and adheres to coding standards)
  • Sufficient test evidence is provided (manual and/or automated)
  • Infrastructure/operational/build changes are validated (if applicable)

🚀 Post-merge

After merging and deploying changes to the sandbox, Postman collection or spec examples please run the Run Postman
collection workflow.

This will run the tests within the collection to check that the sandbox is working as expected once deployed.

@LeoKHoward LeoKHoward self-assigned this Jul 2, 2025
@github-actions

github-actions Bot commented Jul 2, 2025

Copy link
Copy Markdown

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

NPA-5191

@github-actions

github-actions Bot commented Jul 2, 2025

Copy link
Copy Markdown

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

NPA-5191

@LeoKHoward LeoKHoward added postman Changes to the postman collection endpoints labels Jul 2, 2025
@github-actions

github-actions Bot commented Jul 2, 2025

Copy link
Copy Markdown

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

NPA-5191

Comment thread specification/validated-relationships-service-api.yaml Outdated
Comment thread sandbox/api/tests/test_post_questionnaire_response.py
| Scenario | Request | Response |
| --------------- | ----------------------------------------------- | -------------------------------- |
| Example request | Example questionnaire response from try it now | HTTP Status 200 Success response |
| Scenario | Request | Response |

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.

With update to postman json would expect an update to the try it out in postman url

@github-actions

github-actions Bot commented Jul 2, 2025

Copy link
Copy Markdown

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

NPA-5191

@github-actions

github-actions Bot commented Jul 2, 2025

Copy link
Copy Markdown

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

NPA-5191

@github-actions

github-actions Bot commented Jul 3, 2025

Copy link
Copy Markdown

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

NPA-5191

@LeoKHoward LeoKHoward merged commit 2a81bbc into master Jul 3, 2025
17 checks passed
@LeoKHoward LeoKHoward deleted the task/NPA-5191/update-oas-postman-duplicate-relationship branch July 3, 2025 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

endpoints postman Changes to the postman collection

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants