CCM-17208: Supplier API Pact tests#319
Open
simonlabarere wants to merge 12 commits intomainfrom
Open
Conversation
601eb22 to
5b667d8
Compare
There was a problem hiding this comment.
Pull request overview
Adds consumer-side Pact coverage for Supplier API letter status events and updates the print-status-handler to transform Supplier events into Digital Letters print.letter.transitioned events without reusing the Supplier event as a base.
Changes:
- Added Supplier API Pact consumer + provider verification tests using Supplier schema example payloads.
- Updated print-status-handler to validate/consume a new
utilsZod shape and construct Digital Letters events explicitly. - Updated contract test script to enforce up-to-date schema packages; adjusted schema package dependency ranges.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/utils/src/types/supplier-api-letter-event.ts | Introduces a new Zod schema/type used to validate Supplier API letter events (partial shape). |
| utils/utils/src/types/index.ts | Exports the new Supplier API event schema/type. |
| lambdas/print-status-handler/src/apis/sqs-handler.ts | Switches validation away from supplier schema types and rebuilds the outgoing Digital Letters event explicitly. |
| lambdas/print-status-handler/src/tests/test-data.ts | Updates test typings to LetterStatusChangeEvent. |
| lambdas/print-status-handler/src/tests/apis/sqs-handler.test.ts | Adjusts unit test expectations to match the new event construction behavior. |
| tests/playwright/digital-letters-component-tests/print-status-handler.component.spec.ts | Updates component test typing/generics for publishing Supplier API events. |
| tests/pact-tests/consumer/supplier-api.consumer.pact.test.ts | Adds Pact consumer tests for Supplier API letter status messages. |
| tests/pact-tests/pact-verification/supplier-api.provider.pact.test.ts | Adds provider-side Pact verification wired to schema example messages. |
| tests/pact-tests/package.json | Adds supplier-api schema package dependency for pact tests. |
| tests/playwright/package.json | Adjusts supplier-api schema package dependency range. |
| scripts/tests/contract.sh | Extends schema “outdated” checks to include supplier-api schemas. |
| lambdas/print-status-handler/package.json | Updates supplier-api schema dependency range. |
| package-lock.json | Updates lockfile to reflect dependency changes and resolved versions. |
11 tasks
c35530d to
fb5ff7b
Compare
gareth-allan
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Consumer side pact tests for events produced by the Supplier API and consumed by Digital Letters:
scripts/tests/contract.shto check that the latest version of the@nhsdigital/nhs-notify-event-schemas-supplier-apipackage is used@nhsdigital/nhs-notify-event-schemas-supplier-apito the latest version (1.18.0)Provider side of the tests: NHSDigital/nhs-notify-supplier-api#557
Testing
Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.