Skip to content

Chore: [AEA-6428] - Filter for notifications by application ID rather than name#2917

Merged
wildjames merged 15 commits intomainfrom
aea-6428-filter-notifications-by-product-id
Apr 7, 2026
Merged

Chore: [AEA-6428] - Filter for notifications by application ID rather than name#2917
wildjames merged 15 commits intomainfrom
aea-6428-filter-notifications-by-product-id

Conversation

@wildjames
Copy link
Copy Markdown
Contributor

Summary

  • Routine Change

Details

We need to update the code to filter notification suppliers based on product ID rather than by application name (which may change without us knowing).

However, there needs to be a switchover period. I will implement the logic for the new way in parallel to the old, and have an environment variable USE_PRODUCT_ID_FOR_NOTIFICATIONS_FILTERING that toggles from one to the other. The enabled product IDs will be a new parameter also.

The order of operations will be:

  • release this version out to prod, defaulting to still use the application name to filter on
  • Populate the product IDs for the currently enabled suppliers
  • Flip the environment variable to move to using product ID
    • Verify that it's working as expected
  • Create a new PR which removes the (now unused) product name filtering code, the EnabledSystemsParameter, and the environment variable USE_PRODUCT_ID_FOR_NOTIFICATIONS_FILTERING.
  • Release that to prod
  • Verify we're still good

Copilot AI review requested due to automatic review settings March 27, 2026 11:37
@github-actions
Copy link
Copy Markdown
Contributor

This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket:

AEA-6428

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the PSU pipeline to support identifying notification suppliers by application/product ID (via nhsd-application-id) instead of relying on application name, and propagates the new identifier through persisted data and filtering.

Changes:

  • Add ApplicationID to PSUDataItem and populate it from the nhsd-application-id request header.
  • Switch notification enablement filtering from ApplicationName to ApplicationID.
  • Update API specification and unit tests to reflect the new header/field.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/updatePrescriptionStatus/src/updatePrescriptionStatus.ts Reads nhsd-application-id header and persists it on generated data items.
packages/updatePrescriptionStatus/src/validation/notificationSiteAndSystemFilters.ts Changes supplier filtering to use ApplicationID instead of ApplicationName.
packages/common/commonTypes/src/index.ts Adds ApplicationID to the shared PSUDataItem type.
packages/specification/eps-prescription-status-update-api.yaml Enables product ID checking and declares nhsd-application-id as a target attribute/header.
packages/updatePrescriptionStatus/tests/utils/testUtils.ts Adds ApplicationID to mock data item helper.
packages/updatePrescriptionStatus/tests/testUpdatePrescriptionStatus.test.ts Updates buildDataItems calls for the new signature.
packages/updatePrescriptionStatus/tests/testSqsClient.test.ts Updates mock data to include ApplicationID where needed.
packages/updatePrescriptionStatus/tests/testDatabaseClient.test.ts Updates persisted item fixtures to include ApplicationID.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/common/commonTypes/src/index.ts
Comment thread packages/updatePrescriptionStatus/tests/testSqsClient.test.ts
@wildjames
Copy link
Copy Markdown
Contributor Author

Uses app ID and successfully passes through an enabled supplier (me)

image

Comment thread SAMtemplates/parameters/main.yaml Outdated
Comment thread SAMtemplates/parameters/main.yaml Outdated
Comment thread Makefile Outdated
Comment thread Makefile Outdated
Comment thread .github/workflows/run_release_code_and_api.yml Outdated
Comment thread .github/workflows/ci.yml
release_qa:
needs: [tag_release, release_dev, package_code, get_commit_id, get_config_values]
needs:
[tag_release, release_dev, package_code, get_commit_id, get_config_values]
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.

gratuitious whitespace change?

@wildjames wildjames enabled auto-merge (squash) April 2, 2026 14:29
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 7, 2026

@wildjames wildjames merged commit 95a6323 into main Apr 7, 2026
18 checks passed
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.

4 participants