From 8eb78cc5c9daee44ba4ae04e5174c7eff3bae547 Mon Sep 17 00:00:00 2001 From: "scott.fullerton1" Date: Mon, 11 May 2026 10:25:13 +0100 Subject: [PATCH 1/5] CCM-17639: Updated event to include reasonCode and text --- README.md | 4 +++- ...gital-letter-unsuccessful-data.schema.yaml | 12 +++++------ src/cloudevents/readme-index.yaml | 21 +++++++++++++------ 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 557127960..9fd89fcf3 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,7 @@ _No common schemas defined yet._ | **Digital Letters Print Letter Transitioned Data** | [`src/digital-letters/2025-10-draft/data/digital-letters-print-letter-transitioned-data.schema.yaml`](src/digital-letters/2025-10-draft/data/digital-letters-print-letter-transitioned-data.schema.yaml) | [`schemas/digital-letters/2025-10-draft/data/digital-letters-print-letter-transitioned-data.schema.json`](schemas/digital-letters/2025-10-draft/data/digital-letters-print-letter-transitioned-data.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/data/digital-letters-print-letter-transitioned-data.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/data/digital-letters-print-letter-transitioned-data.schema.md) | | **Digital Letters Print Pdf Analysed Data** | [`src/digital-letters/2025-10-draft/data/digital-letters-print-pdf-analysed-data.schema.yaml`](src/digital-letters/2025-10-draft/data/digital-letters-print-pdf-analysed-data.schema.yaml) | [`schemas/digital-letters/2025-10-draft/data/digital-letters-print-pdf-analysed-data.schema.json`](schemas/digital-letters/2025-10-draft/data/digital-letters-print-pdf-analysed-data.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/data/digital-letters-print-pdf-analysed-data.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/data/digital-letters-print-pdf-analysed-data.schema.md) | | **Digital Letters Queue Digital Letter Read Data** | [`src/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-read-data.schema.yaml`](src/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-read-data.schema.yaml) | [`schemas/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-read-data.schema.json`](schemas/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-read-data.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-read-data.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-read-data.schema.md) | +| **Digital Letters Queue Digital Letter Unsuccessful Data** | [`src/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-unsuccessful-data.schema.yaml`](src/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-unsuccessful-data.schema.yaml) | [`schemas/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-unsuccessful-data.schema.json`](schemas/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-unsuccessful-data.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-unsuccessful-data.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-unsuccessful-data.schema.md) | | **Digital Letters Queue Item Dequeued Data** | [`src/digital-letters/2025-10-draft/data/digital-letters-queue-item-dequeued-data.schema.yaml`](src/digital-letters/2025-10-draft/data/digital-letters-queue-item-dequeued-data.schema.yaml) | [`schemas/digital-letters/2025-10-draft/data/digital-letters-queue-item-dequeued-data.schema.json`](schemas/digital-letters/2025-10-draft/data/digital-letters-queue-item-dequeued-data.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/data/digital-letters-queue-item-dequeued-data.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/data/digital-letters-queue-item-dequeued-data.schema.md) | | **Digital Letters Queue Item Enqueued Data** | [`src/digital-letters/2025-10-draft/data/digital-letters-queue-item-enqueued-data.schema.yaml`](src/digital-letters/2025-10-draft/data/digital-letters-queue-item-enqueued-data.schema.yaml) | [`schemas/digital-letters/2025-10-draft/data/digital-letters-queue-item-enqueued-data.schema.json`](schemas/digital-letters/2025-10-draft/data/digital-letters-queue-item-enqueued-data.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/data/digital-letters-queue-item-enqueued-data.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/data/digital-letters-queue-item-enqueued-data.schema.md) | | **Digital Letters Reporting Generate Report Data** | [`src/digital-letters/2025-10-draft/data/digital-letters-reporting-generate-report-data.schema.yaml`](src/digital-letters/2025-10-draft/data/digital-letters-reporting-generate-report-data.schema.yaml) | [`schemas/digital-letters/2025-10-draft/data/digital-letters-reporting-generate-report-data.schema.json`](schemas/digital-letters/2025-10-draft/data/digital-letters-reporting-generate-report-data.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/data/digital-letters-reporting-generate-report-data.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/data/digital-letters-reporting-generate-report-data.schema.md) | @@ -171,13 +172,13 @@ _No common schemas defined yet._ | **uk.nhs.notify.digital.letters.print.letter.transitioned.v1** | [`src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.letter.transitioned.v1.schema.yaml`](src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.letter.transitioned.v1.schema.yaml) | [`schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.letter.transitioned.v1.schema.json`](schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.letter.transitioned.v1.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.letter.transitioned.v1.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.letter.transitioned.v1.schema.md) | | **uk.nhs.notify.digital.letters.print.pdf.analysed.v1** | [`src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.pdf.analysed.v1.schema.yaml`](src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.pdf.analysed.v1.schema.yaml) | [`schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.pdf.analysed.v1.schema.json`](schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.pdf.analysed.v1.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.pdf.analysed.v1.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.pdf.analysed.v1.schema.md) | | **uk.nhs.notify.digital.letters.queue.digital.letter.read.v1** | [`src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1.schema.yaml`](src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1.schema.yaml) | [`schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1.schema.json`](schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1.schema.md) | +| **uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1** | [`src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1.schema.yaml`](src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1.schema.yaml) | [`schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1.schema.json`](schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1.schema.md) | | **uk.nhs.notify.digital.letters.queue.item.dequeued.v1** | [`src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1.schema.yaml`](src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1.schema.yaml) | [`schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1.schema.json`](schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1.schema.md) | | **uk.nhs.notify.digital.letters.queue.item.enqueued.v1** | [`src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1.schema.yaml`](src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1.schema.yaml) | [`schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1.schema.json`](schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1.schema.md) | | **uk.nhs.notify.digital.letters.reporting.generate.report.v1** | [`src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.generate.report.v1.schema.yaml`](src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.generate.report.v1.schema.yaml) | [`schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.generate.report.v1.schema.json`](schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.generate.report.v1.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.generate.report.v1.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.generate.report.v1.schema.md) | | **uk.nhs.notify.digital.letters.reporting.report.generated.v1** | [`src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.generated.v1.schema.yaml`](src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.generated.v1.schema.yaml) | [`schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.generated.v1.schema.json`](schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.generated.v1.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.generated.v1.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.generated.v1.schema.md) | | **uk.nhs.notify.digital.letters.reporting.report.sent.v1** | [`src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.sent.v1.schema.yaml`](src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.sent.v1.schema.yaml) | [`schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.sent.v1.schema.json`](schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.sent.v1.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.sent.v1.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.sent.v1.schema.md) | | **Nhs Notify Document Reference** | [`src/digital-letters/2025-10-draft/nhs-notify-document-reference.schema.yaml`](src/digital-letters/2025-10-draft/nhs-notify-document-reference.schema.yaml) | [`schemas/digital-letters/2025-10-draft/nhs-notify-document-reference.schema.json`](schemas/digital-letters/2025-10-draft/nhs-notify-document-reference.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/nhs-notify-document-reference.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/nhs-notify-document-reference.schema.md) | -| **Profile** | [`src/digital-letters/2025-10-draft/supplierapi-profile.schema.yaml`](src/digital-letters/2025-10-draft/supplierapi-profile.schema.yaml) | [`schemas/digital-letters/2025-10-draft/supplierapi-profile.schema.json`](schemas/digital-letters/2025-10-draft/supplierapi-profile.schema.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/supplierapi-profile.schema.md`](../../docs/cloudevents/digital-letters/2025-10-draft/supplierapi-profile.schema.md) | #### Example Events @@ -202,6 +203,7 @@ _No common schemas defined yet._ | **Uk.nhs.notify.digital.letters.print.letter.transitioned.v1** | [`../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.print.letter.transitioned.v1-event.json`](../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.print.letter.transitioned.v1-event.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.print.letter.transitioned.v1-event.md`](../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.print.letter.transitioned.v1-event.md) | | **Uk.nhs.notify.digital.letters.print.pdf.analysed.v1** | [`../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.print.pdf.analysed.v1-event.json`](../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.print.pdf.analysed.v1-event.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.print.pdf.analysed.v1-event.md`](../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.print.pdf.analysed.v1-event.md) | | **Uk.nhs.notify.digital.letters.queue.digital.letter.read.v1** | [`../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1-event.json`](../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1-event.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1-event.md`](../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1-event.md) | +| **Uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1** | [`../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1-event.json`](../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1-event.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1-event.md`](../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1-event.md) | | **Uk.nhs.notify.digital.letters.queue.item.dequeued.v1** | [`../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1-event.json`](../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1-event.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1-event.md`](../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1-event.md) | | **Uk.nhs.notify.digital.letters.queue.item.enqueued.v1** | [`../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1-event.json`](../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1-event.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1-event.md`](../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1-event.md) | | **Uk.nhs.notify.digital.letters.reporting.generate.report.v1** | [`../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.reporting.generate.report.v1-event.json`](../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.reporting.generate.report.v1-event.json) | [`../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.reporting.generate.report.v1-event.md`](../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.reporting.generate.report.v1-event.md) | diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-unsuccessful-data.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-unsuccessful-data.schema.yaml index d8e30a06c..525b6349e 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-unsuccessful-data.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-unsuccessful-data.schema.yaml @@ -8,12 +8,12 @@ properties: $ref: ../defs/requests.schema.yaml#/properties/messageReference senderId: $ref: ../defs/requests.schema.yaml#/properties/senderId - failureCode: - $ref: ../defs/core.schema.yaml#/properties/failureCode - failureReason: - $ref: ../defs/core.schema.yaml#/properties/failureReason + reasonCode: + $ref: ../defs/print.schema.yaml#/properties/reasonCode + reasonText: + $ref: ../defs/print.schema.yaml#/properties/reasonText required: - messageReference - senderId - - failureCode - - failureReason + - reasonCode + - reasonText diff --git a/src/cloudevents/readme-index.yaml b/src/cloudevents/readme-index.yaml index 4643324c0..dca43983e 100644 --- a/src/cloudevents/readme-index.yaml +++ b/src/cloudevents/readme-index.yaml @@ -3,7 +3,7 @@ # To regenerate, run: make update-readme # To customize labels and purposes, edit: readme-metadata.yaml -generated: '2026-04-09T13:48:22.150Z' +generated: '2026-05-11T09:16:35.071Z' common: null domains: - name: digital-letters @@ -112,6 +112,11 @@ domains: source: src/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-read-data.schema.yaml published: schemas/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-read-data.schema.json docs: ../../docs/cloudevents/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-read-data.schema.md + - type: Digital Letters Queue Digital Letter Unsuccessful Data + category: data + source: src/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-unsuccessful-data.schema.yaml + published: schemas/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-unsuccessful-data.schema.json + docs: ../../docs/cloudevents/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-unsuccessful-data.schema.md - type: Digital Letters Queue Item Dequeued Data category: data source: src/digital-letters/2025-10-draft/data/digital-letters-queue-item-dequeued-data.schema.yaml @@ -327,6 +332,11 @@ domains: source: src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1.schema.yaml published: schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1.schema.json docs: ../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1.schema.md + - type: uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1 + category: events + source: src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1.schema.yaml + published: schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1.schema.json + docs: ../../docs/cloudevents/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1.schema.md - type: uk.nhs.notify.digital.letters.queue.item.dequeued.v1 category: events source: src/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1.schema.yaml @@ -357,11 +367,6 @@ domains: source: src/digital-letters/2025-10-draft/nhs-notify-document-reference.schema.yaml published: schemas/digital-letters/2025-10-draft/nhs-notify-document-reference.schema.json docs: ../../docs/cloudevents/digital-letters/2025-10-draft/nhs-notify-document-reference.schema.md - - type: Profile - category: profile - source: src/digital-letters/2025-10-draft/supplierapi-profile.schema.yaml - published: schemas/digital-letters/2025-10-draft/supplierapi-profile.schema.json - docs: ../../docs/cloudevents/digital-letters/2025-10-draft/supplierapi-profile.schema.md exampleEvents: - name: Uk.nhs.notify.digital.letters.letter.available.v1 filename: uk.nhs.notify.digital.letters.letter.available.v1-event @@ -439,6 +444,10 @@ domains: filename: uk.nhs.notify.digital.letters.queue.digital.letter.read.v1-event json: ../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1-event.json markdown: ../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1-event.md + - name: Uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1 + filename: uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1-event + json: ../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1-event.json + markdown: ../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1-event.md - name: Uk.nhs.notify.digital.letters.queue.item.dequeued.v1 filename: uk.nhs.notify.digital.letters.queue.item.dequeued.v1-event json: ../../docs/cloudevents/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1-event.json From 62d908aa4dc5f8f93b2d40a02ffc98f21d2665a8 Mon Sep 17 00:00:00 2001 From: Angel Pastor Date: Fri, 8 May 2026 15:35:46 +0100 Subject: [PATCH 2/5] CCM-17641: Handle the event DigitalLetterUnsuccessful in the reports for trusts --- .../dl/scripts/sql/reports/daily_report.sql | 8 +++++-- .../report-generator.component.spec.ts | 18 +++++++++++++++ tests/playwright/helpers/event-builders.ts | 23 +++++++++++++++++++ tests/playwright/helpers/report-helpers.ts | 18 +++++++++++++++ 4 files changed, 65 insertions(+), 2 deletions(-) diff --git a/infrastructure/terraform/components/dl/scripts/sql/reports/daily_report.sql b/infrastructure/terraform/components/dl/scripts/sql/reports/daily_report.sql index d9ccb57de..b0ea46845 100644 --- a/infrastructure/terraform/components/dl/scripts/sql/reports/daily_report.sql +++ b/infrastructure/terraform/components/dl/scripts/sql/reports/daily_report.sql @@ -10,7 +10,8 @@ WITH vars AS ( OR e.type LIKE '%.queue.digital.letter.read.%' OR e.type LIKE '%.pdm.resource.submission.rejected.%' OR e.type LIKE '%.pdm.resource.retries.exceeded.%' - OR e.type LIKE '%.messages.request.rejected.%' THEN 'Digital' + OR e.type LIKE '%.messages.request.rejected.%' + OR e.type LIKE '%.queue.digital.letter.unsuccessful.%' THEN 'Digital' WHEN e.type LIKE '%.print.letter.transitioned.%' OR e.type LIKE '%.print.file.quarantined.%' OR e.type LIKE '%.print.invalid.attachment.received.%' THEN 'Print' ELSE NULL @@ -23,6 +24,7 @@ WITH vars AS ( WHEN e.type LIKE '%.messages.request.rejected.%' THEN 'Failed' WHEN e.type LIKE '%.print.file.quarantined.%' THEN 'Failed' WHEN e.type LIKE '%.print.invalid.attachment.received.%' THEN 'Failed' + WHEN e.type LIKE '%.queue.digital.letter.unsuccessful.%' THEN 'Failed' WHEN e.letterstatus = 'RETURNED' THEN 'Returned' WHEN e.letterstatus = 'FAILED' THEN 'Failed' WHEN e.letterstatus = 'DELIVERED' THEN 'Delivered' @@ -30,7 +32,9 @@ WITH vars AS ( END as status, e.reasoncode, COALESCE( - CASE WHEN e.type LIKE '%.messages.request.rejected.%' THEN e.reasontext END, + CASE + WHEN e.type LIKE '%.messages.request.rejected.%' + OR e.type LIKE '%.queue.digital.letter.unsuccessful.%' THEN e.reasontext END, fcl.description, e.reasontext, e.reasoncode diff --git a/tests/playwright/digital-letters-component-tests/report-generator.component.spec.ts b/tests/playwright/digital-letters-component-tests/report-generator.component.spec.ts index 05bd497a9..db6e08235 100644 --- a/tests/playwright/digital-letters-component-tests/report-generator.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/report-generator.component.spec.ts @@ -36,6 +36,24 @@ const scenarios = [ 'Unread', senderId, ), + new ReportScenario( + 'component-test-digitalLetterUnsuccessful', + CommunicationType.Digital, + [EventStatus.DigitalLetterNhsAppUnsuccessful], + 'Failed', + senderId, + 'DL_INTE_001', + 'Failed enrichment', + ), + new ReportScenario( + 'component-test-itemDequeued-digitalLetterUnsuccessful', + CommunicationType.Digital, + [EventStatus.Unread, EventStatus.DigitalLetterNhsAppUnsuccessful], + 'Failed', + senderId, + 'DL_INTE_001', + 'Failed enrichment', + ), new ReportScenario( 'component-test-itemDequeued-digitalLetterRead', CommunicationType.Digital, diff --git a/tests/playwright/helpers/event-builders.ts b/tests/playwright/helpers/event-builders.ts index a156bb92b..9fd225dd7 100644 --- a/tests/playwright/helpers/event-builders.ts +++ b/tests/playwright/helpers/event-builders.ts @@ -1,5 +1,6 @@ import { DigitalLetterRead, + DigitalLetterUnsuccessful, FileQuarantined, InvalidAttachmentReceived, ItemDequeued, @@ -162,6 +163,28 @@ export function buildMessageRequestRejectedEvent( } as MessageRequestRejected; } +export function buildDigitalLetterUnsuccessfulEvent( + eventId: string, + time: string, + messageReference: string, + senderId: string, +): DigitalLetterUnsuccessful { + const baseEvent = buildBaseEvent('queue', time); + return { + ...baseEvent, + id: eventId, + type: 'uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1', + dataschema: + 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-unsuccessful-data.schema.json', + data: { + messageReference, + senderId, + reasonCode: 'DL_INTE_001', + reasonText: 'Failed enrichment', + }, + } as DigitalLetterUnsuccessful; +} + export function buildFileQuarantinedEvent( eventId: string, time: string, diff --git a/tests/playwright/helpers/report-helpers.ts b/tests/playwright/helpers/report-helpers.ts index 544eb1aa9..721c85e89 100644 --- a/tests/playwright/helpers/report-helpers.ts +++ b/tests/playwright/helpers/report-helpers.ts @@ -11,6 +11,7 @@ import { v4 as uuidv4 } from 'uuid'; import { DigitalLetterRead, + DigitalLetterUnsuccessful, FileQuarantined, GenerateReport, InvalidAttachmentReceived, @@ -21,6 +22,7 @@ import { PDMResourceSubmissionRejected, PrintLetterTransitioned, validateDigitalLetterRead, + validateDigitalLetterUnsuccessful, validateFileQuarantined, validateGenerateReport, validateInvalidAttachmentReceived, @@ -41,6 +43,7 @@ import eventPublisher from 'helpers/event-bus-helpers'; import expectToPassEventually from 'helpers/expectations'; import { buildDigitalLetterReadEvent, + buildDigitalLetterUnsuccessfulEvent, buildFileQuarantinedEvent, buildInvalidAttachmentReceivedEvent, buildItemDequeuedEvent, @@ -72,6 +75,7 @@ export enum EventStatus { DigitalMessageRequestRejected = 'MessageRequestRejected', PrintFileQuarantined = 'FileQuarantined', PrintInvalidAttachmentReceived = 'InvalidAttachmentReceived', + DigitalLetterNhsAppUnsuccessful = 'DigitalLetterNhsAppUnsuccessful', } /** * Utility class to proof the SQL logic to determine which status should be reported for a given message reference, @@ -207,6 +211,20 @@ export function publishEventForScenario(scenario: ReportScenario) { ); break; } + case EventStatus.DigitalLetterNhsAppUnsuccessful: { + eventPublisher.sendEvents( + [ + buildDigitalLetterUnsuccessfulEvent( + uuidv4(), + scenario.time, + scenario.messageReference, + scenario.senderId, + ), + ], + validateDigitalLetterUnsuccessful, + ); + break; + } default: } break; From 88d555033373b503a307a58c52760d24c488f92a Mon Sep 17 00:00:00 2001 From: Angel Pastor Date: Thu, 14 May 2026 12:25:40 +0100 Subject: [PATCH 3/5] Review comments, add another scenario with different reason and code --- .../report-generator.component.spec.ts | 13 +++++++++++-- tests/playwright/helpers/event-builders.ts | 6 ++++-- tests/playwright/helpers/report-helpers.ts | 17 +++++++++++++++++ 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/tests/playwright/digital-letters-component-tests/report-generator.component.spec.ts b/tests/playwright/digital-letters-component-tests/report-generator.component.spec.ts index db6e08235..a9b12db27 100644 --- a/tests/playwright/digital-letters-component-tests/report-generator.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/report-generator.component.spec.ts @@ -42,16 +42,25 @@ const scenarios = [ [EventStatus.DigitalLetterNhsAppUnsuccessful], 'Failed', senderId, - 'DL_INTE_001', + 'CFR_CNSN_0001', 'Failed enrichment', ), + new ReportScenario( + 'component-test-digitalLetterUnsuccessful-other-reason', + CommunicationType.Digital, + [EventStatus.DigitalLetterNhsAppUnsuccessfulOtherReason], + 'Failed', + senderId, + 'CFR_CNSN_0002', + 'Letter failed to be delivered to NHS App', + ), new ReportScenario( 'component-test-itemDequeued-digitalLetterUnsuccessful', CommunicationType.Digital, [EventStatus.Unread, EventStatus.DigitalLetterNhsAppUnsuccessful], 'Failed', senderId, - 'DL_INTE_001', + 'CFR_CNSN_0001', 'Failed enrichment', ), new ReportScenario( diff --git a/tests/playwright/helpers/event-builders.ts b/tests/playwright/helpers/event-builders.ts index 9fd225dd7..9632d0e82 100644 --- a/tests/playwright/helpers/event-builders.ts +++ b/tests/playwright/helpers/event-builders.ts @@ -168,6 +168,8 @@ export function buildDigitalLetterUnsuccessfulEvent( time: string, messageReference: string, senderId: string, + reasonCode = 'CFR_CNSN_0001', + reasonText = 'Failed enrichment', ): DigitalLetterUnsuccessful { const baseEvent = buildBaseEvent('queue', time); return { @@ -179,8 +181,8 @@ export function buildDigitalLetterUnsuccessfulEvent( data: { messageReference, senderId, - reasonCode: 'DL_INTE_001', - reasonText: 'Failed enrichment', + reasonCode, + reasonText, }, } as DigitalLetterUnsuccessful; } diff --git a/tests/playwright/helpers/report-helpers.ts b/tests/playwright/helpers/report-helpers.ts index 721c85e89..12a301303 100644 --- a/tests/playwright/helpers/report-helpers.ts +++ b/tests/playwright/helpers/report-helpers.ts @@ -76,6 +76,7 @@ export enum EventStatus { PrintFileQuarantined = 'FileQuarantined', PrintInvalidAttachmentReceived = 'InvalidAttachmentReceived', DigitalLetterNhsAppUnsuccessful = 'DigitalLetterNhsAppUnsuccessful', + DigitalLetterNhsAppUnsuccessfulOtherReason = 'DigitalLetterNhsAppUnsuccessfulOtherReason', } /** * Utility class to proof the SQL logic to determine which status should be reported for a given message reference, @@ -225,6 +226,22 @@ export function publishEventForScenario(scenario: ReportScenario) { ); break; } + case EventStatus.DigitalLetterNhsAppUnsuccessfulOtherReason: { + eventPublisher.sendEvents( + [ + buildDigitalLetterUnsuccessfulEvent( + uuidv4(), + scenario.time, + scenario.messageReference, + scenario.senderId, + 'CFR_CNSN_0002', + 'Letter failed to be delivered to NHS App', + ), + ], + validateDigitalLetterUnsuccessful, + ); + break; + } default: } break; From 34ddd3463dc5fb35605b072397e3029195a91f17 Mon Sep 17 00:00:00 2001 From: Angel Pastor Date: Mon, 18 May 2026 16:27:07 +0100 Subject: [PATCH 4/5] remove no longer needed gitleak --- .gitleaksignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitleaksignore b/.gitleaksignore index 6e6e03d29..ca9a47c62 100644 --- a/.gitleaksignore +++ b/.gitleaksignore @@ -19,4 +19,3 @@ d1c0a37078cbed4fbedae044e5cbafac71717af0:utils/utils/src/__tests__/key-generatio f0eebf1356a699213340a45f64c6b990afcbb869:infrastructure/terraform/components/dl/ssm_parameter_mesh.tf:hashicorp-tf-password:11 e75d9e202c1fad2c9591c4fe0e411194bf19c8f6:infrastructure/terraform/components/dl/ssm_parameter_mesh_config.tf:hashicorp-tf-password:11 712ea0b0f178f5ffa7475bf7781ecd00b950cfbb:utils/utils/src/__tests__/key-generation-utils/jwk-key.test.ts:private-key:3 -72c1f9356ce8773949204e60b6f787d667b1bd2b:utils/utils/src/__tests__/key-generation-utils/jwk-key.test.ts:private-key:3 From 0c3dfa60d6cb4e8fef6dd86554835a9f909c1677 Mon Sep 17 00:00:00 2001 From: Angel Pastor Date: Wed, 20 May 2026 11:26:53 +0100 Subject: [PATCH 5/5] npm update @nhsdigital/nhs-notify-event-schemas-supplier-api --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c9c8ebcfe..e5f263e90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9995,9 +9995,9 @@ } }, "node_modules/@nhsdigital/nhs-notify-event-schemas-supplier-api": { - "version": "1.0.18", - "resolved": "https://npm.pkg.github.com/download/@nhsdigital/nhs-notify-event-schemas-supplier-api/1.0.18/e81996aca0271b686b521dec9ec33a8735b351b5", - "integrity": "sha512-+PJ4XSWYZ+hZ2jhbvt2Wpi0QzPAYug2bnl6NrdEQmcURVhAh5JxJkuQ7OayHXFS2A7hiEF+4nJnS6B0ZLiWSgw==", + "version": "1.0.19", + "resolved": "https://npm.pkg.github.com/download/@nhsdigital/nhs-notify-event-schemas-supplier-api/1.0.19/46a72901639161b3dafa0d47af70d1e9ec8f4686", + "integrity": "sha512-DqS0GmQ64jfLuKDerUuUFMZEdTjsEtpHROoMeXsjc54zELH4RLmZTok/gJozDXqSpn0twWPLu8QlP7bss7tmXQ==", "license": "MIT", "dependencies": { "@asyncapi/bundler": "^0.6.4",