From 1aa08fde7c9558053687fb83b633601c88404ec3 Mon Sep 17 00:00:00 2001 From: Angel Pastor Date: Wed, 1 Apr 2026 16:09:01 +0100 Subject: [PATCH 1/2] CCM-15019: adding plane: data --- .../dl/cloudwatch_event_rule_data_plane.tf | 21 ++++++++++++++++++ .../components/dl/modules_eventpub.tf | 4 +++- .../src/__tests__/constants.ts | 7 ++++-- .../src/__tests__/domain/mapper.test.ts | 2 ++ .../src/__tests__/apis/sqs-handler.test.ts | 9 ++++---- .../mesh_acknowledge/__tests__/fixtures.py | 4 +++- .../mesh_acknowledge/__tests__/test_events.py | 6 ++++- .../mesh_acknowledge/events.py | 2 ++ .../mesh_download/__tests__/test_processor.py | 10 +++++++-- .../mesh-download/mesh_download/processor.py | 2 ++ lambdas/mesh-poll/mesh_poll/processor.py | 7 ++++-- .../src/__tests__/apis/sqs-handler.test.ts | 20 +++++++++++++++++ .../src/__tests__/domain/mapper.test.ts | 16 ++++++++++---- .../src/domain/mapper.ts | 16 ++++++++++---- .../src/__tests__/test-data.ts | 5 +++-- .../pdm-uploader-lambda/src/__tests__/data.ts | 5 +++-- .../src/__tests__/apis/sqs-handler.test.ts | 2 +- .../print-analyser/src/__tests__/test-data.ts | 5 +++-- .../print-analyser/src/apis/sqs-handler.ts | 3 +-- .../__tests__/apis/sqs-trigger-lambda.test.ts | 6 +++-- .../src/__tests__/app/print-sender.test.ts | 6 ++++- .../src/__tests__/apis/sqs-handler.test.ts | 6 +++-- .../src/apis/sqs-handler.ts | 5 +++-- .../src/__tests__/test-data.ts | 3 +-- .../__tests__/apis/sqs-trigger-lambda.test.ts | 5 ++++- .../__tests__/app/report-generator.test.ts | 4 ++++ .../apis/scheduled-event-handler.test.ts | 4 +++- .../src/apis/scheduled-event-handler.ts | 7 +++++- .../__tests__/test_report_sender_processor.py | 9 +++++++- .../report_sender/report_sender_processor.py | 6 +++-- .../__tests__/apis/sqs-trigger-lambda.test.ts | 3 +-- .../ttl-create-lambda/src/__tests__/data.ts | 5 +++-- .../apis/dynamodb-stream-handler.test.ts | 7 +++--- ...ital-letters-event-bus-profile.schema.yaml | 4 ++-- .../digital-letters-fhir-profile.schema.yaml | 4 ++-- ...digital-letters-letter-profile.schema.yaml | 4 ++-- .../digital-letters-mesh-profile.schema.yaml | 4 ++-- ...gital-letters-messages-profile.schema.yaml | 4 ++-- .../digital-letters-pdm-profile.schema.yaml | 4 ++-- .../digital-letters-print-profile.schema.yaml | 4 ++-- .../digital-letters-profile.schema.yaml | 22 ++++++++++++++++--- .../digital-letters-queue-profile.schema.yaml | 4 ++-- ...ital-letters-reporting-profile.schema.yaml | 4 ++-- ...digital-letters-viewer-profile.schema.yaml | 4 ++-- ...al.letters.letter.available.v1.schema.yaml | 2 +- ....inbox.message.acknowledged.v1.schema.yaml | 2 +- ...sh.inbox.message.downloaded.v1.schema.yaml | 2 +- ....mesh.inbox.message.invalid.v1.schema.yaml | 2 +- ...mesh.inbox.message.received.v1.schema.yaml | 2 +- ...s.messages.request.rejected.v1.schema.yaml | 2 +- ...rs.messages.request.skipped.v1.schema.yaml | 2 +- ....messages.request.submitted.v1.schema.yaml | 2 +- ...ters.pdm.resource.available.v1.schema.yaml | 2 +- ...m.resource.retries.exceeded.v1.schema.yaml | 2 +- ...esource.submission.rejected.v1.schema.yaml | 2 +- ...ters.pdm.resource.submitted.v1.schema.yaml | 2 +- ...rs.pdm.resource.unavailable.v1.schema.yaml | 2 +- ...ters.print.file.quarantined.v1.schema.yaml | 2 +- ...tal.letters.print.file.safe.v1.schema.yaml | 2 +- ...s.print.letter.transitioned.v1.schema.yaml | 2 +- ....letters.print.pdf.analysed.v1.schema.yaml | 2 +- ...s.queue.digital.letter.read.v1.schema.yaml | 2 +- ...letters.queue.item.dequeued.v1.schema.yaml | 2 +- ...letters.queue.item.enqueued.v1.schema.yaml | 2 +- ...s.reporting.generate.report.v1.schema.yaml | 2 +- ....reporting.report.generated.v1.schema.yaml | 2 +- ...tters.reporting.report.sent.v1.schema.yaml | 2 +- .../example-generator/example-generator.ts | 5 ++++- src/digital-letters-events/README.md | 8 +++++-- src/typescript-schema-generator/PLAN.md | 4 ++-- .../core-notify.component.spec.ts | 5 +++-- .../file-scanner.component.spec.ts | 8 +++++-- .../mesh-acknowledge.component.spec.ts | 5 +++-- .../mesh-poll-download.component.spec.ts | 6 +++-- .../pdm-poll.component.spec.ts | 5 +++-- .../pdm-uploader.component.spec.ts | 5 +++-- .../print-analyser.component.spec.ts | 5 +++-- .../print-sender.component.spec.ts | 10 +++++---- .../send-reports-trust.component.spec.ts | 4 +++- .../ttl-create.component.spec.ts | 5 +++-- .../ttl-handle.component.spec.ts | 5 +++-- tests/playwright/helpers/event-builders.ts | 4 +++- tests/playwright/helpers/report-helpers.ts | 8 +++++-- .../__tests__/test_event_publisher.py | 12 ++++++---- .../event-publisher/event-publisher.test.ts | 4 ++-- 85 files changed, 303 insertions(+), 135 deletions(-) create mode 100644 infrastructure/terraform/components/dl/cloudwatch_event_rule_data_plane.tf diff --git a/infrastructure/terraform/components/dl/cloudwatch_event_rule_data_plane.tf b/infrastructure/terraform/components/dl/cloudwatch_event_rule_data_plane.tf new file mode 100644 index 000000000..988e1493b --- /dev/null +++ b/infrastructure/terraform/components/dl/cloudwatch_event_rule_data_plane.tf @@ -0,0 +1,21 @@ +resource "aws_cloudwatch_event_rule" "data_plane" { + name = "${local.csi}-data-plane" + description = "Data plane event rule" + event_bus_name = aws_cloudwatch_event_bus.main.name + + event_pattern = jsonencode({ + "detail" : { + "plane" : [ + "data" + ], + } + }) +} + +resource "aws_cloudwatch_event_target" "data-plane-main-bus-target" { + rule = aws_cloudwatch_event_rule.data_plane.name + arn = module.eventpub.sns_topic.arn + event_bus_name = aws_cloudwatch_event_bus.main.name + + input_path = "$.detail" +} diff --git a/infrastructure/terraform/components/dl/modules_eventpub.tf b/infrastructure/terraform/components/dl/modules_eventpub.tf index 7aa868775..dc2b02f6a 100644 --- a/infrastructure/terraform/components/dl/modules_eventpub.tf +++ b/infrastructure/terraform/components/dl/modules_eventpub.tf @@ -60,7 +60,9 @@ data "aws_iam_policy_document" "sns_publish" { condition { test = "ArnEquals" variable = "aws:SourceArn" - values = [aws_cloudwatch_event_rule.letter_prepared.arn] + values = [aws_cloudwatch_event_rule.letter_prepared.arn, + aws_cloudwatch_event_rule.data_plane.arn + ] } } } diff --git a/lambdas/core-notifier-lambda/src/__tests__/constants.ts b/lambdas/core-notifier-lambda/src/__tests__/constants.ts index e81c888a0..593df6364 100644 --- a/lambdas/core-notifier-lambda/src/__tests__/constants.ts +++ b/lambdas/core-notifier-lambda/src/__tests__/constants.ts @@ -60,8 +60,11 @@ export const mockResponse: SingleMessageResponse = { export const validPdmEvent: PDMResourceAvailable = { id: 'event-id-123', - source: - '/nhs/england/notify/development/dev-12345/data-plane/digitalletters/pdm', + plane: 'data', + dataschemaversion: '1.0.0', + source: '/nhs/england/notify/development/dev-12345/digitalletters/pdm', + dataschema: + 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-pdm-resource-available-data.schema.json', specversion: '1.0', type: 'uk.nhs.notify.digital.letters.pdm.resource.available.v1', time: '2025-12-15T10:00:00Z', diff --git a/lambdas/core-notifier-lambda/src/__tests__/domain/mapper.test.ts b/lambdas/core-notifier-lambda/src/__tests__/domain/mapper.test.ts index f2e8b8a82..ca23ee88e 100644 --- a/lambdas/core-notifier-lambda/src/__tests__/domain/mapper.test.ts +++ b/lambdas/core-notifier-lambda/src/__tests__/domain/mapper.test.ts @@ -28,6 +28,8 @@ describe('mapper', () => { specversion: '1.0', id: 'event-123', source: 'pdm-service', + plane: 'data', + dataschemaversion: '1.0.0', subject: 'resource/available', type: 'uk.nhs.notify.digital.letters.pdm.resource.available.v1', time: '2024-01-15T10:30:00Z', diff --git a/lambdas/file-scanner-lambda/src/__tests__/apis/sqs-handler.test.ts b/lambdas/file-scanner-lambda/src/__tests__/apis/sqs-handler.test.ts index 0f961678e..414e14a50 100644 --- a/lambdas/file-scanner-lambda/src/__tests__/apis/sqs-handler.test.ts +++ b/lambdas/file-scanner-lambda/src/__tests__/apis/sqs-handler.test.ts @@ -42,8 +42,9 @@ const createValidItemDequeuedBody = ( detail: { specversion: '1.0', id: `event-${messageReference}`, - source: - '/nhs/england/notify/development/primary/data-plane/digitalletters/queue', + plane: 'data', + dataschemaversion: '1.0.0', + source: '/nhs/england/notify/development/primary/digitalletters/queue', subject: `message/${messageReference}`, type: 'uk.nhs.notify.digital.letters.queue.item.dequeued.v1', time: '2026-01-19T12:00:00Z', @@ -319,7 +320,7 @@ describe('SQS Handler', () => { specversion: '1.0', id: 'event-001', source: - '/nhs/england/notify/development/primary/data-plane/digitalletters/queue', + '/nhs/england/notify/development/primary/digitalletters/queue', type: 'uk.nhs.notify.wrong.event.type.v1', time: '2026-01-19T12:00:00Z', data: { @@ -386,7 +387,7 @@ describe('SQS Handler', () => { specversion: '1.0', id: 'event-001', source: - '/nhs/england/notify/development/primary/data-plane/digitalletters/queue', + '/nhs/england/notify/development/primary/digitalletters/queue', type: 'uk.nhs.notify.digital.letters.queue.item.dequeued.v1', time: '2026-01-19T12:00:00Z', data: { diff --git a/lambdas/mesh-acknowledge/mesh_acknowledge/__tests__/fixtures.py b/lambdas/mesh-acknowledge/mesh_acknowledge/__tests__/fixtures.py index c21eb130f..4433bda61 100644 --- a/lambdas/mesh-acknowledge/mesh_acknowledge/__tests__/fixtures.py +++ b/lambdas/mesh-acknowledge/mesh_acknowledge/__tests__/fixtures.py @@ -9,7 +9,7 @@ def create_downloaded_event_dict(event_id: str) -> Dict[str, str | int | Dict[st "specversion": "1.0", "source": ( "/nhs/england/notify/production/primary/" - 'data-plane/digitalletters/mesh' + 'digitalletters/mesh' ), "subject": ( 'customer/920fca11-596a-4eca-9c47-99f624614658/' @@ -18,6 +18,7 @@ def create_downloaded_event_dict(event_id: str) -> Dict[str, str | int | Dict[st "type": ( 'uk.nhs.notify.digital.letters.mesh.inbox.message.downloaded.v1' ), + "plane": "data", "time": '2026-01-08T10:00:00Z', "recordedtime": '2026-01-08T10:00:00Z', "severitynumber": 2, @@ -28,6 +29,7 @@ def create_downloaded_event_dict(event_id: str) -> Dict[str, str | int | Dict[st 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/' 'digital-letters-mesh-inbox-message-downloaded-data.schema.json' ), + "dataschemaversion": '1.0.0', "datacategory": "non-sensitive", "dataclassification": "public", "dataregulation": "GDPR", diff --git a/lambdas/mesh-acknowledge/mesh_acknowledge/__tests__/test_events.py b/lambdas/mesh-acknowledge/mesh_acknowledge/__tests__/test_events.py index cbfa2de87..dea95b826 100644 --- a/lambdas/mesh-acknowledge/mesh_acknowledge/__tests__/test_events.py +++ b/lambdas/mesh-acknowledge/mesh_acknowledge/__tests__/test_events.py @@ -66,12 +66,14 @@ def create_invalid_sqs_record(event_id: str) -> Dict[str, str]: 'detail': { 'id': event_id, 'specversion': '1.0', - 'source': '/nhs/england/notify/production/primary/data-plane/digitalletters/mesh', + 'source': '/nhs/england/notify/production/primary/digitalletters/mesh', 'subject': ( 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/' '769acdd4-6a47-496f-999f-76a6fd2c3959' ), 'type': 'uk.nhs.notify.digital.letters.mesh.inbox.message.downloaded.v1', + 'plane': 'data', + 'dataschemaversion': '1.0.0', 'time': '2026-01-08T10:00:00Z', 'recordedtime': '2026-01-08T10:00:00Z', 'severitynumber': 2, @@ -155,6 +157,8 @@ def test_publish_success( 'time': fixed_time.isoformat(), 'recordedtime': fixed_time.isoformat(), 'type': 'uk.nhs.notify.digital.letters.mesh.inbox.message.acknowledged.v1', + 'plane': 'data', + 'dataschemaversion': '1.0.0', 'dataschema': ( 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/' 'digital-letters-mesh-inbox-message-acknowledged-data.schema.json' diff --git a/lambdas/mesh-acknowledge/mesh_acknowledge/events.py b/lambdas/mesh-acknowledge/mesh_acknowledge/events.py index 8bac47f4b..1850b5be3 100644 --- a/lambdas/mesh-acknowledge/mesh_acknowledge/events.py +++ b/lambdas/mesh-acknowledge/mesh_acknowledge/events.py @@ -51,6 +51,8 @@ def publish_acknowledged_event( 'time': now, 'recordedtime': now, 'type': 'uk.nhs.notify.digital.letters.mesh.inbox.message.acknowledged.v1', + 'plane': 'data', + 'dataschemaversion': '1.0.0', 'dataschema': ( 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/' 'digital-letters-mesh-inbox-message-acknowledged-data.schema.json' diff --git a/lambdas/mesh-download/mesh_download/__tests__/test_processor.py b/lambdas/mesh-download/mesh_download/__tests__/test_processor.py index fd2d9a253..c30f5a640 100644 --- a/lambdas/mesh-download/mesh_download/__tests__/test_processor.py +++ b/lambdas/mesh-download/mesh_download/__tests__/test_processor.py @@ -40,9 +40,12 @@ def create_valid_cloud_event(): return { 'id': str(uuid4()), 'specversion': '1.0', - 'source': '/nhs/england/notify/development/primary/data-plane/digitalletters/mesh', + 'source': '/nhs/england/notify/development/primary/digitalletters/mesh', 'subject': 'customer/00000000-0000-0000-0000-000000000000/recipient/00000000-0000-0000-0000-000000000000', 'type': 'uk.nhs.notify.digital.letters.mesh.inbox.message.received.v1', + 'plane': 'data', + 'dataschemaversion': '1.0.0', + 'datacontenttype': 'application/json', 'time': '2023-01-01T12:00:00Z', 'recordedtime': '2023-01-01T12:00:00Z', 'severitynumber': 2, @@ -218,9 +221,12 @@ def test_process_sqs_message_success(self, mock_datetime): # Verify CloudEvent envelope fields assert published_event['type'] == 'uk.nhs.notify.digital.letters.mesh.inbox.message.downloaded.v1' - assert published_event['source'] == '/nhs/england/notify/development/primary/data-plane/digitalletters/mesh' + assert published_event['source'] == '/nhs/england/notify/development/primary/digitalletters/mesh' assert published_event['subject'] == 'customer/00000000-0000-0000-0000-000000000000/recipient/00000000-0000-0000-0000-000000000000' assert published_event['time'] == '2025-11-19T15:30:45+00:00' + assert published_event['plane'] == 'data' + assert published_event['dataschemaversion'] == '1.0.0' + assert published_event['datacontenttype'] == 'application/json' assert 'id' in published_event assert 'tracestate' not in published_event assert 'partitionkey' not in published_event diff --git a/lambdas/mesh-download/mesh_download/processor.py b/lambdas/mesh-download/mesh_download/processor.py index 2f391c556..2a3327cd0 100644 --- a/lambdas/mesh-download/mesh_download/processor.py +++ b/lambdas/mesh-download/mesh_download/processor.py @@ -148,6 +148,8 @@ def _publish_downloaded_event(self, incoming_event, message_uri): 'time': now, 'recordedtime': now, 'type': 'uk.nhs.notify.digital.letters.mesh.inbox.message.downloaded.v1', + 'plane': 'data', + 'dataschemaversion': '1.0.0', 'dataschema': ( 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/' 'digital-letters-mesh-inbox-message-downloaded-data.schema.json' diff --git a/lambdas/mesh-poll/mesh_poll/processor.py b/lambdas/mesh-poll/mesh_poll/processor.py index 79ff65273..7b0dc5cc2 100644 --- a/lambdas/mesh-poll/mesh_poll/processor.py +++ b/lambdas/mesh-poll/mesh_poll/processor.py @@ -30,9 +30,8 @@ def __init__(self, **kwargs): environment = 'development' deployment = 'primary' - plane = 'data-plane' self.__cloud_event_source = ( - f'/nhs/england/notify/{environment}/{deployment}/{plane}/' + f'/nhs/england/notify/{environment}/{deployment}/' 'digitalletters/mesh' ) @@ -163,6 +162,8 @@ def _publish_mesh_inbox_message_received_event(self, event_detail): f'{event_detail["data"]["messageReference"]}' ), 'type': 'uk.nhs.notify.digital.letters.mesh.inbox.message.received.v1', + 'plane': 'data', + 'dataschemaversion': '1.0.0', 'time': now, 'recordedtime': now, 'severitynumber': 2, @@ -199,6 +200,8 @@ def _publish_mesh_inbox_message_invalid_event(self, event_detail): 'source': self.__cloud_event_source, 'subject': f'customer/{event_detail["data"]["senderId"]}', 'type': 'uk.nhs.notify.digital.letters.mesh.inbox.message.invalid.v1', + 'plane': 'data', + 'dataschemaversion': '1.0.0', 'time': now, 'recordedtime': now, 'severitynumber': 3, diff --git a/lambdas/move-scanned-files-lambda/src/__tests__/apis/sqs-handler.test.ts b/lambdas/move-scanned-files-lambda/src/__tests__/apis/sqs-handler.test.ts index a219a5293..78facaed6 100644 --- a/lambdas/move-scanned-files-lambda/src/__tests__/apis/sqs-handler.test.ts +++ b/lambdas/move-scanned-files-lambda/src/__tests__/apis/sqs-handler.test.ts @@ -68,6 +68,11 @@ describe('sqs-handler', () => { specversion: '1.0', id: 'test-id', source: '/test', + plane: 'data', + dataschemaversion: '1.0.0', + datacontenttype: 'application/json', + dataschema: + 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-print-file-safe-data.schema.json', type: 'uk.nhs.notify.digital.letters.print.file.safe.v1', time: '2024-01-01T00:00:00Z', data: { @@ -107,6 +112,11 @@ describe('sqs-handler', () => { specversion: '1.0', id: 'test-id-1', source: '/test', + plane: 'data', + dataschema: + 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-print-file-safe-data.schema.json', + dataschemaversion: '1.0.0', + datacontenttype: 'application/json', type: 'uk.nhs.notify.digital.letters.print.file.safe.v1', time: '2024-01-01T00:00:00Z', data: { @@ -125,6 +135,11 @@ describe('sqs-handler', () => { specversion: '1.0', id: 'test-id-2', source: '/test', + plane: 'data', + dataschema: + 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-print-file-quarantined-data.schema.json', + dataschemaversion: '1.0.0', + datacontenttype: 'application/json', type: 'uk.nhs.notify.digital.letters.print.file.quarantined.v1', time: '2024-01-01T00:00:00Z', data: { @@ -190,6 +205,11 @@ describe('sqs-handler', () => { specversion: '1.0', id: 'test-id', source: '/test', + plane: 'data', + dataschemaversion: '1.0.0', + datacontenttype: 'application/json', + dataschema: + 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-print-file-safe-data.schema.json', type: 'uk.nhs.notify.digital.letters.print.file.safe.v1', time: '2024-01-01T00:00:00Z', data: { diff --git a/lambdas/move-scanned-files-lambda/src/__tests__/domain/mapper.test.ts b/lambdas/move-scanned-files-lambda/src/__tests__/domain/mapper.test.ts index 40826e9f6..94b20c17d 100644 --- a/lambdas/move-scanned-files-lambda/src/__tests__/domain/mapper.test.ts +++ b/lambdas/move-scanned-files-lambda/src/__tests__/domain/mapper.test.ts @@ -43,8 +43,12 @@ describe('mapper', () => { specversion: '1.0', id: 'mocked-uuid-12345', subject: `customer/${senderId}/recipient/${messageReference}`, - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/print', + source: '/nhs/england/notify/production/primary/digitalletters/print', + plane: 'data', + dataschema: + 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-print-file-safe-data.schema.json', + dataschemaversion: '1.0.0', + datacontenttype: 'application/json', traceparent: '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01', type: 'uk.nhs.notify.digital.letters.print.file.safe.v1', time: '2024-01-15T10:30:00.000Z', @@ -99,8 +103,12 @@ describe('mapper', () => { specversion: '1.0', id: 'mocked-uuid-12345', subject: `customer/${senderId}/recipient/${messageReference}`, - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/print', + plane: 'data', + dataschema: + 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-print-file-quarantined-data.schema.json', + dataschemaversion: '1.0.0', + datacontenttype: 'application/json', + source: '/nhs/england/notify/production/primary/digitalletters/print', traceparent: '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01', type: 'uk.nhs.notify.digital.letters.print.file.quarantined.v1', time: '2024-01-15T10:30:00.000Z', diff --git a/lambdas/move-scanned-files-lambda/src/domain/mapper.ts b/lambdas/move-scanned-files-lambda/src/domain/mapper.ts index c42208a04..5764c913b 100644 --- a/lambdas/move-scanned-files-lambda/src/domain/mapper.ts +++ b/lambdas/move-scanned-files-lambda/src/domain/mapper.ts @@ -11,8 +11,12 @@ export function createFileSafeEvent( specversion: '1.0', id: randomUUID(), subject: `customer/${senderId}/recipient/${messageReference}`, - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/print', // Note CCM-13892. + plane: 'data', + dataschema: + 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-print-file-safe-data.schema.json', + dataschemaversion: '1.0.0', + datacontenttype: 'application/json', + source: '/nhs/england/notify/production/primary/digitalletters/print', // Note CCM-13892. traceparent: '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01', // Note CCM-14255. type: 'uk.nhs.notify.digital.letters.print.file.safe.v1', time: new Date().toISOString(), @@ -37,8 +41,12 @@ export function createFileQuarantinedEvent( specversion: '1.0', id: randomUUID(), subject: `customer/${senderId}/recipient/${messageReference}`, - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/print', // Note CCM-13892. + plane: 'data', + dataschema: + 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-print-file-quarantined-data.schema.json', + dataschemaversion: '1.0.0', + datacontenttype: 'application/json', + source: '/nhs/england/notify/production/primary/digitalletters/print', // Note CCM-13892. traceparent: '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01', // Note CCM-14255. type: 'uk.nhs.notify.digital.letters.print.file.quarantined.v1', time: new Date().toISOString(), diff --git a/lambdas/pdm-poll-lambda/src/__tests__/test-data.ts b/lambdas/pdm-poll-lambda/src/__tests__/test-data.ts index 72698e3e7..58724731c 100644 --- a/lambdas/pdm-poll-lambda/src/__tests__/test-data.ts +++ b/lambdas/pdm-poll-lambda/src/__tests__/test-data.ts @@ -7,10 +7,11 @@ import { const baseEvent = { id: '550e8400-e29b-41d4-a716-446655440001', specversion: '1.0', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/pdm', + source: '/nhs/england/notify/production/primary/digitalletters/pdm', subject: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', + plane: 'data', + dataschemaversion: '1.0.0', type: 'uk.nhs.notify.digital.letters.pdm.resource.submitted.v1', time: '2023-06-20T12:00:00Z', recordedtime: '2023-06-20T12:00:00.250Z', diff --git a/lambdas/pdm-uploader-lambda/src/__tests__/data.ts b/lambdas/pdm-uploader-lambda/src/__tests__/data.ts index bc8bef9dc..ef429989b 100644 --- a/lambdas/pdm-uploader-lambda/src/__tests__/data.ts +++ b/lambdas/pdm-uploader-lambda/src/__tests__/data.ts @@ -3,8 +3,9 @@ import { MESHInboxMessageDownloaded } from 'digital-letters-events'; export const mockEvent: MESHInboxMessageDownloaded = { id: 'a449d419-e683-4ab4-9291-a0451b5cef8e', specversion: '1.0', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/mesh', + source: '/nhs/england/notify/production/primary/digitalletters/mesh', + plane: 'data', + dataschemaversion: '1.0.0', subject: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', type: 'uk.nhs.notify.digital.letters.mesh.inbox.message.downloaded.v1', diff --git a/lambdas/print-analyser/src/__tests__/apis/sqs-handler.test.ts b/lambdas/print-analyser/src/__tests__/apis/sqs-handler.test.ts index 800803e40..c90372cc7 100644 --- a/lambdas/print-analyser/src/__tests__/apis/sqs-handler.test.ts +++ b/lambdas/print-analyser/src/__tests__/apis/sqs-handler.test.ts @@ -58,7 +58,7 @@ describe('SQS Handler', () => { 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-print-pdf-analysed-data.schema.json', type: 'uk.nhs.notify.digital.letters.print.pdf.analysed.v1', source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/print', + '/nhs/england/notify/production/primary/digitalletters/print', data: { senderId: fileSafeEvent.data.senderId, messageReference: fileSafeEvent.data.messageReference, diff --git a/lambdas/print-analyser/src/__tests__/test-data.ts b/lambdas/print-analyser/src/__tests__/test-data.ts index d03caaade..59e993582 100644 --- a/lambdas/print-analyser/src/__tests__/test-data.ts +++ b/lambdas/print-analyser/src/__tests__/test-data.ts @@ -6,8 +6,9 @@ import { FileSafe } from 'digital-letters-events'; export const fileSafeEvent: FileSafe = { id: '550e8400-e29b-41d4-a716-446655440001', specversion: '1.0', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/print', + source: '/nhs/england/notify/production/primary/digitalletters/print', + plane: 'data', + dataschemaversion: '1.0.0', subject: 'letter-origin/digital-letters/letter/f47ac10b-58cc-4372-a567-0e02b2c3d479', type: 'uk.nhs.notify.digital.letters.print.file.safe.v1', diff --git a/lambdas/print-analyser/src/apis/sqs-handler.ts b/lambdas/print-analyser/src/apis/sqs-handler.ts index 5299a2645..c1a06db82 100644 --- a/lambdas/print-analyser/src/apis/sqs-handler.ts +++ b/lambdas/print-analyser/src/apis/sqs-handler.ts @@ -69,8 +69,7 @@ function generateUpdatedEvent(event: FileSafe, pdfInfo: PdfInfo): PDFAnalysed { 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-print-pdf-analysed-data.schema.json', type: 'uk.nhs.notify.digital.letters.print.pdf.analysed.v1', // NOTE: CCM-13892 Generate event digital letters source property from scratch - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/print', + source: '/nhs/england/notify/production/primary/digitalletters/print', data: { senderId, messageReference, diff --git a/lambdas/print-sender-lambda/src/__tests__/apis/sqs-trigger-lambda.test.ts b/lambdas/print-sender-lambda/src/__tests__/apis/sqs-trigger-lambda.test.ts index c0d17cd8a..c91b932e4 100644 --- a/lambdas/print-sender-lambda/src/__tests__/apis/sqs-trigger-lambda.test.ts +++ b/lambdas/print-sender-lambda/src/__tests__/apis/sqs-trigger-lambda.test.ts @@ -28,8 +28,10 @@ const createValidEvent = (overrides = {}): PDFAnalysed => ({ type: 'uk.nhs.notify.digital.letters.print.pdf.analysed.v1', dataschema: 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-print-pdf-analysed-data.schema.json', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/print', + plane: 'data', + dataschemaversion: '1.0.0', + datacontenttype: 'application/json', + source: '/nhs/england/notify/production/primary/digitalletters/print', specversion: '1.0', traceparent: '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01', severitynumber: 2, diff --git a/lambdas/print-sender-lambda/src/__tests__/app/print-sender.test.ts b/lambdas/print-sender-lambda/src/__tests__/app/print-sender.test.ts index 8f9e71d81..4e86c8b1e 100644 --- a/lambdas/print-sender-lambda/src/__tests__/app/print-sender.test.ts +++ b/lambdas/print-sender-lambda/src/__tests__/app/print-sender.test.ts @@ -15,7 +15,11 @@ describe('PrintSender', () => { type: 'uk.nhs.notify.digital.letters.print.pdf.analysed.v1', dataschema: 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-print-pdf-analysed-data.schema.json', - source: '/data-plane/digital-letters/dev/main', + source: + '/nhs/england/notify/production/primary/data-plane/digitalletters/print', + plane: 'data', + dataschemaversion: '1.0.0', + datacontenttype: 'application/json', specversion: '1.0', traceparent: '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01', severitynumber: 2, diff --git a/lambdas/print-status-handler/src/__tests__/apis/sqs-handler.test.ts b/lambdas/print-status-handler/src/__tests__/apis/sqs-handler.test.ts index 34100f8c5..dc1317217 100644 --- a/lambdas/print-status-handler/src/__tests__/apis/sqs-handler.test.ts +++ b/lambdas/print-status-handler/src/__tests__/apis/sqs-handler.test.ts @@ -45,9 +45,10 @@ describe('SQS Handler', () => { 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-print-letter-transitioned-data.schema.json', type: 'uk.nhs.notify.digital.letters.print.letter.transitioned.v1', source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/print', + '/nhs/england/notify/production/primary/digitalletters/print', subject: 'client/f47ac10b-58cc-4372-a567-0e02b2c3d479/letter-request/2503cbd5-6722-4e90-9fbd-5f1e96d65c22', + dataschemaversion: '1.0.0', data: { senderId: acceptedLetterEvent.data.origin.subject.split('/')[1], messageReference: @@ -84,9 +85,10 @@ describe('SQS Handler', () => { 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-print-letter-transitioned-data.schema.json', type: 'uk.nhs.notify.digital.letters.print.letter.transitioned.v1', source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/print', + '/nhs/england/notify/production/primary/digitalletters/print', subject: 'client/f47ac10b-58cc-4372-a567-0e02b2c3d480/letter-request/2503cbd5-6722-4e90-9fbd-5f1e96d65c22', + dataschemaversion: '1.0.0', data: { senderId: failedLetterEvent.data.origin.subject.split('/')[1], messageReference: diff --git a/lambdas/print-status-handler/src/apis/sqs-handler.ts b/lambdas/print-status-handler/src/apis/sqs-handler.ts index 9d599c9fd..9a3feeb94 100644 --- a/lambdas/print-status-handler/src/apis/sqs-handler.ts +++ b/lambdas/print-status-handler/src/apis/sqs-handler.ts @@ -113,8 +113,9 @@ function generateUpdatedEvent(event: LetterEvent): PrintLetterTransitioned { 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-print-letter-transitioned-data.schema.json', type: 'uk.nhs.notify.digital.letters.print.letter.transitioned.v1', // NOTE: CCM-13892 Generate event digital letters source property from scratch - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/print', + source: '/nhs/england/notify/production/primary/digitalletters/print', + plane: 'data', + dataschemaversion: '1.0.0', data: { senderId, messageReference, diff --git a/lambdas/report-event-transformer/src/__tests__/test-data.ts b/lambdas/report-event-transformer/src/__tests__/test-data.ts index f017e165b..af2e66fba 100644 --- a/lambdas/report-event-transformer/src/__tests__/test-data.ts +++ b/lambdas/report-event-transformer/src/__tests__/test-data.ts @@ -4,8 +4,7 @@ import { DigitalLettersEvent } from 'types/events'; export const digitalLettersEvent = { id: '550e8400-e29b-41d4-a716-446655440001', specversion: '1.0', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/pdm', + source: '/nhs/england/notify/production/primary/digitalletters/pdm', subject: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', type: 'uk.nhs.notify.digital.letters.pdm.resource.submitted.v1', diff --git a/lambdas/report-generator/src/__tests__/apis/sqs-trigger-lambda.test.ts b/lambdas/report-generator/src/__tests__/apis/sqs-trigger-lambda.test.ts index 7cb243548..133dc1ef0 100644 --- a/lambdas/report-generator/src/__tests__/apis/sqs-trigger-lambda.test.ts +++ b/lambdas/report-generator/src/__tests__/apis/sqs-trigger-lambda.test.ts @@ -23,7 +23,10 @@ const createMockSQSRecord = ( id: event.id || mockUuid, source: event.source || - '/nhs/england/notify/development/primary/data-plane/digitalletters/reporting', + '/nhs/england/notify/development/primary/digitalletters/reporting', + plane: 'data', + dataschemaversion: '1.0.0', + datacontenttype: 'application/json', specversion: event.specversion || '1.0', type: event.type || diff --git a/lambdas/report-generator/src/__tests__/app/report-generator.test.ts b/lambdas/report-generator/src/__tests__/app/report-generator.test.ts index 60de0c41b..45d43855d 100644 --- a/lambdas/report-generator/src/__tests__/app/report-generator.test.ts +++ b/lambdas/report-generator/src/__tests__/app/report-generator.test.ts @@ -47,6 +47,10 @@ describe('ReportGenerator', () => { time: '2025-01-15T10:00:00Z', datacontenttype: 'application/json', subject: 'customer/5661de82-7453-44a1-9922-e0c98e5411c1', + plane: 'data', + dataschema: + 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-reporting-generate-report-data.schema.json', + dataschemaversion: '1.0.0', traceparent: '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01', recordedtime: '2025-12-15T10:00:00Z', severitynumber: 2, diff --git a/lambdas/report-scheduler/src/__tests__/apis/scheduled-event-handler.test.ts b/lambdas/report-scheduler/src/__tests__/apis/scheduled-event-handler.test.ts index fe8cd4fa0..c50b4a2d1 100644 --- a/lambdas/report-scheduler/src/__tests__/apis/scheduled-event-handler.test.ts +++ b/lambdas/report-scheduler/src/__tests__/apis/scheduled-event-handler.test.ts @@ -98,8 +98,9 @@ describe('scheduled-event-handler', () => { expect(event.data.reportDate).toBe('2024-01-14'); expect(event.specversion).toBe('1.0'); expect(event.id).toBeDefined(); + expect(event.plane).toBe('data'); expect(event.source).toBe( - '/nhs/england/notify/production/primary/data-plane/digitalletters/reporting', + '/nhs/england/notify/production/primary/digitalletters/reporting', ); expect(event.subject).toBe('customer/test-sender-123'); expect(event.type).toBe( @@ -107,6 +108,7 @@ describe('scheduled-event-handler', () => { ); expect(event.time).toBe('2024-01-15T12:00:00.000Z'); expect(event.severitynumber).toBe(2); + expect(event.datacontenttype).toBe('application/json'); expect(() => validateGenerateReport(event, mockLogger)).not.toThrow(); }); diff --git a/lambdas/report-scheduler/src/apis/scheduled-event-handler.ts b/lambdas/report-scheduler/src/apis/scheduled-event-handler.ts index 6e85a0dc2..506b64853 100644 --- a/lambdas/report-scheduler/src/apis/scheduled-event-handler.ts +++ b/lambdas/report-scheduler/src/apis/scheduled-event-handler.ts @@ -27,8 +27,13 @@ export const createHandler = ({ }, specversion: '1.0', id: randomUUID(), + plane: 'data', + dataschemaversion: '1.0.0', + datacontenttype: 'application/json', + dataschema: + 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-reporting-generate-report-data.schema.json', source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/reporting', // CCM-13892 + '/nhs/england/notify/production/primary/digitalletters/reporting', // CCM-13892 subject: `customer/${sender.senderId}`, type: 'uk.nhs.notify.digital.letters.reporting.generate.report.v1', time: new Date().toISOString(), diff --git a/lambdas/report-sender/report_sender/__tests__/test_report_sender_processor.py b/lambdas/report-sender/report_sender/__tests__/test_report_sender_processor.py index 339f72adb..7048b961f 100644 --- a/lambdas/report-sender/report_sender/__tests__/test_report_sender_processor.py +++ b/lambdas/report-sender/report_sender/__tests__/test_report_sender_processor.py @@ -92,9 +92,11 @@ def create_valid_sqs_record(sender_id=SENDER_ID, report_uri=REPORT_URI): 'detail': { 'id': '6f1c2a53-3d54-4a0a-9a0b-0e9ae2d4c111', 'specversion': '1.0', - 'source': '/nhs/england/notify/development/primary/data-plane/digitalletters/reporting', + 'source': '/nhs/england/notify/development/primary/digitalletters/reporting', 'subject': 'customer/920fca11-596a-4eca-9c47-99f624614658', 'type': 'uk.nhs.notify.digital.letters.reporting.report.generated.v1', + 'plane': 'data', + 'dataschemaversion': '1.0.0', 'time': '2026-02-03T10:00:00Z', 'datacontenttype': 'application/json', 'dataschema': 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-reporting-report-generated-data.schema.json', @@ -133,6 +135,8 @@ def test_parse_and_validate_event_validation_error(self, processor, mock_logger) 'specversion': '1.0', 'source': '/test/source', 'type': 'uk.nhs.notify.digital.letters.reporting.report.generated.v1', + 'plane': 'data', + 'dataschemaversion': '1.0.0', 'time': '2026-02-03T10:00:00Z', 'data': { # Missing required fields @@ -241,6 +245,9 @@ def test_publish_report_sent_event_success( assert event['data']['senderId'] == SENDER_ID assert event['data']['meshMailboxReportsId'] == mesh_mailbox_reports_id assert event['specversion'] == '1.0' + assert event['plane'] == 'data' + assert event['dataschemaversion'] == '1.0.0' + assert event['datacontenttype'] == 'application/json' assert 'id' in event assert 'time' in event assert 'recordedtime' in event diff --git a/lambdas/report-sender/report_sender/report_sender_processor.py b/lambdas/report-sender/report_sender/report_sender_processor.py index daddf28c2..29d0f2522 100644 --- a/lambdas/report-sender/report_sender/report_sender_processor.py +++ b/lambdas/report-sender/report_sender/report_sender_processor.py @@ -24,8 +24,7 @@ def __init__(self, **kwargs): environment = 'development' deployment = 'primary' - plane = 'data-plane' - self.__cloud_event_source = f'/nhs/england/notify/{environment}/{deployment}/{plane}/digitalletters/reporting' + self.__cloud_event_source = f'/nhs/england/notify/{environment}/{deployment}/digitalletters/reporting' def _parse_and_validate_event(self, sqs_record) -> ReportGenerated: """Extract report generated data from SQS record""" @@ -93,6 +92,9 @@ def _publish_report_sent_event(self, sender_id, mesh_mailbox_reports_id, report_ 'specversion': '1.0', 'source': self.__cloud_event_source, 'subject': f'customer/{sender_id}', + 'plane': 'data', + 'dataschemaversion': '1.0.0', + 'datacontenttype': 'application/json', 'type': 'uk.nhs.notify.digital.letters.reporting.report.sent.v1', 'time': now, 'recordedtime': now, diff --git a/lambdas/ttl-create-lambda/src/__tests__/apis/sqs-trigger-lambda.test.ts b/lambdas/ttl-create-lambda/src/__tests__/apis/sqs-trigger-lambda.test.ts index f31d41cc2..c795001dd 100644 --- a/lambdas/ttl-create-lambda/src/__tests__/apis/sqs-trigger-lambda.test.ts +++ b/lambdas/ttl-create-lambda/src/__tests__/apis/sqs-trigger-lambda.test.ts @@ -26,8 +26,7 @@ describe('createHandler', () => { const itemEnqueuedEvent: ItemEnqueued = { ...messageDownloadedEvent, id: '550e8400-e29b-41d4-a716-446655440001', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/queue', + source: '/nhs/england/notify/production/primary/digitalletters/queue', type: 'uk.nhs.notify.digital.letters.queue.item.enqueued.v1', time: '2023-06-20T12:00:00.250Z', recordedtime: '2023-06-20T12:00:00.250Z', diff --git a/lambdas/ttl-create-lambda/src/__tests__/data.ts b/lambdas/ttl-create-lambda/src/__tests__/data.ts index b0c36fa18..e11e16b49 100644 --- a/lambdas/ttl-create-lambda/src/__tests__/data.ts +++ b/lambdas/ttl-create-lambda/src/__tests__/data.ts @@ -3,10 +3,11 @@ import { MESHInboxMessageDownloaded } from 'digital-letters-events'; export const messageDownloadedEvent: MESHInboxMessageDownloaded = { id: '550e8400-e29b-41d4-a716-446655440001', specversion: '1.0', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/mesh', + source: '/nhs/england/notify/production/primary/digitalletters/mesh', subject: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', + plane: 'data', + dataschemaversion: '1.0.0', type: 'uk.nhs.notify.digital.letters.mesh.inbox.message.downloaded.v1', time: '2023-06-20T12:00:00Z', recordedtime: '2023-06-20T12:00:00.250Z', diff --git a/lambdas/ttl-handle-expiry-lambda/src/__tests__/apis/dynamodb-stream-handler.test.ts b/lambdas/ttl-handle-expiry-lambda/src/__tests__/apis/dynamodb-stream-handler.test.ts index ef3bee90b..f81f1a144 100644 --- a/lambdas/ttl-handle-expiry-lambda/src/__tests__/apis/dynamodb-stream-handler.test.ts +++ b/lambdas/ttl-handle-expiry-lambda/src/__tests__/apis/dynamodb-stream-handler.test.ts @@ -33,11 +33,13 @@ const mockEvent: DynamoDBStreamEvent = { id: { S: '550e8400-e29b-41d4-a716-446655440001' }, specversion: { S: '1.0' }, source: { - S: '/nhs/england/notify/production/primary/data-plane/digitalletters/mesh', + S: '/nhs/england/notify/production/primary/digitalletters/mesh', }, subject: { S: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', }, + plane: { S: 'data' }, + dataschemaversion: { S: '1.0.0' }, type: { S: 'uk.nhs.notify.digital.letters.mesh.inbox.message.downloaded.v1', }, @@ -108,8 +110,7 @@ describe('createHandler', () => { [ expect.objectContaining({ specversion: '1.0', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/queue', + source: '/nhs/england/notify/production/primary/digitalletters/queue', subject: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', type: 'uk.nhs.notify.digital.letters.queue.item.dequeued.v1', diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-event-bus-profile.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-event-bus-profile.schema.yaml index 94d77a7f7..f98b7afc7 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-event-bus-profile.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-event-bus-profile.schema.yaml @@ -14,6 +14,6 @@ properties: pattern: ^uk\.nhs\.notify\.digital\.letters\.eventbus\.[a-z0-9]+(?:\.[a-z0-9]+)*\.v[0-9]+$ source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/(data-plane|control-plane)/digitalletters/eventbus - minLength: 40 + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/eventbus + minLength: 30 format: uri-reference diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-fhir-profile.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-fhir-profile.schema.yaml index dc0000d3e..e1eceb2ac 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-fhir-profile.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-fhir-profile.schema.yaml @@ -14,6 +14,6 @@ properties: pattern: ^uk\.nhs\.notify\.digital\.letters\.fhir\.[a-z0-9]+(?:\.[a-z0-9]+)*\.v[0-9]+$ source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/(data-plane|control-plane)/digitalletters/fhir - minLength: 40 + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/fhir + minLength: 30 format: uri-reference diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-letter-profile.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-letter-profile.schema.yaml index 8b6471279..387b74b95 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-letter-profile.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-letter-profile.schema.yaml @@ -14,6 +14,6 @@ properties: pattern: ^uk\.nhs\.notify\.digital\.letters\.letter\.[a-z0-9]+(?:\.[a-z0-9]+)*\.v[0-9]+$ source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/(data-plane|control-plane)/digitalletters/letter - minLength: 40 + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/letter + minLength: 30 format: uri-reference diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-mesh-profile.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-mesh-profile.schema.yaml index e778f4aba..322f2b199 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-mesh-profile.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-mesh-profile.schema.yaml @@ -14,6 +14,6 @@ properties: pattern: ^uk\.nhs\.notify\.digital\.letters\.mesh\.[a-z0-9]+(?:\.[a-z0-9]+)*\.v[0-9]+$ source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/(data-plane|control-plane)/digitalletters/mesh - minLength: 40 + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/mesh + minLength: 30 format: uri-reference diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-messages-profile.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-messages-profile.schema.yaml index 694f3b694..5deb0ec81 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-messages-profile.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-messages-profile.schema.yaml @@ -14,6 +14,6 @@ properties: pattern: ^uk\.nhs\.notify\.digital\.letters\.messages\.[a-z0-9]+(?:\.[a-z0-9]+)*\.v[0-9]+$ source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/(data-plane|control-plane)/digitalletters/messages - minLength: 40 + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/messages + minLength: 30 format: uri-reference diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-pdm-profile.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-pdm-profile.schema.yaml index e3ad7e1a5..c6ce19258 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-pdm-profile.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-pdm-profile.schema.yaml @@ -14,6 +14,6 @@ properties: pattern: ^uk\.nhs\.notify\.digital\.letters\.pdm\.[a-z0-9]+(?:\.[a-z0-9]+)*\.v[0-9]+$ source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/(data-plane|control-plane)/digitalletters/pdm - minLength: 40 + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/pdm + minLength: 30 format: uri-reference diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-print-profile.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-print-profile.schema.yaml index 2023a9bc0..90f741be8 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-print-profile.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-print-profile.schema.yaml @@ -14,6 +14,6 @@ properties: pattern: ^uk\.nhs\.notify\.digital\.letters\.print\.[a-z0-9]+(?:\.[a-z0-9]+)*\.v[0-9]+$ source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/(data-plane|control-plane)/digitalletters/print - minLength: 40 + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/print + minLength: 30 format: uri-reference diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-profile.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-profile.schema.yaml index b4a26e68c..d31a87c5d 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-profile.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-profile.schema.yaml @@ -3,7 +3,7 @@ title: Digital Letters Profile description: NHS Notify Digital Letters profile for CloudEvents 1.0 including additional governance and tracing attributes. type: object allOf: - - $ref: https://notify.nhs.uk/cloudevents/schemas/common/2025-11-draft/nhs-notify-profile.schema.json + - $ref: https://notify.nhs.uk/cloudevents/schemas/common/2026-04/nhs-notify-profile.schema.json properties: type: type: string @@ -14,6 +14,22 @@ properties: pattern: ^uk\.nhs\.notify\.digital\.letters\.[a-z0-9]+(?:\.[a-z0-9]+)*\.v[0-9]+$ source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/(data-plane|control-plane)/digitalletters - minLength: 40 + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters + minLength: 30 format: uri-reference + plane: + type: string + enum: + - data + dataschemaversion: + type: string + const: "1.0.0" + description: Data Schema version (fixed to 1.0.0). + examples: + - "1.0.0" + datacontenttype: + type: string + const: "application/json" + description: Data Content type (fixed to application/json). + examples: + - "application/json" diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-queue-profile.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-queue-profile.schema.yaml index 430c44d2e..684ad83fe 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-queue-profile.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-queue-profile.schema.yaml @@ -14,6 +14,6 @@ properties: pattern: ^uk\.nhs\.notify\.digital\.letters\.queue\.[a-z0-9]+(?:\.[a-z0-9]+)*\.v[0-9]+$ source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/(data-plane|control-plane)/digitalletters/queue - minLength: 40 + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/queue + minLength: 30 format: uri-reference diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-reporting-profile.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-reporting-profile.schema.yaml index d3dc20767..1b80b732e 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-reporting-profile.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-reporting-profile.schema.yaml @@ -14,6 +14,6 @@ properties: pattern: ^uk\.nhs\.notify\.digital\.letters\.reporting\.[a-z0-9]+(?:\.[a-z0-9]+)*\.v[0-9]+$ source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/(data-plane|control-plane)/digitalletters/reporting - minLength: 40 + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/reporting + minLength: 30 format: uri-reference diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-viewer-profile.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-viewer-profile.schema.yaml index d77365de1..c139aa2cd 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-viewer-profile.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/digital-letters-viewer-profile.schema.yaml @@ -14,6 +14,6 @@ properties: pattern: ^uk\.nhs\.notify\.digital\.letters\.viewer\.[a-z0-9]+(?:\.[a-z0-9]+)*\.v[0-9]+$ source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/(data-plane|control-plane)/digitalletters/viewer - minLength: 40 + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/viewer + minLength: 30 format: uri-reference diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.letter.available.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.letter.available.v1.schema.yaml index 9e22ed8f6..aab869498 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.letter.available.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.letter.available.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this example event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/letter + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/letter description: Event source for digital letters examples. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.acknowledged.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.acknowledged.v1.schema.yaml index d008704a9..b254640c1 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.acknowledged.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.acknowledged.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/mesh + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/mesh description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.downloaded.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.downloaded.v1.schema.yaml index ffb6d8168..bee428575 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.downloaded.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.downloaded.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/mesh + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/mesh description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.invalid.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.invalid.v1.schema.yaml index 70e9907c0..8fc828ec1 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.invalid.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.invalid.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/mesh + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/mesh description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.received.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.received.v1.schema.yaml index b41128d40..c48d298c6 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.received.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.mesh.inbox.message.received.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/mesh + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/mesh description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.messages.request.rejected.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.messages.request.rejected.v1.schema.yaml index d1984c0af..ae9570c21 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.messages.request.rejected.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.messages.request.rejected.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/messages + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/messages description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.messages.request.skipped.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.messages.request.skipped.v1.schema.yaml index fb86ac3c9..dd5d958af 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.messages.request.skipped.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.messages.request.skipped.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/messages + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/messages description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.messages.request.submitted.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.messages.request.submitted.v1.schema.yaml index 8b2167105..68edf4510 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.messages.request.submitted.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.messages.request.submitted.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/messages + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/messages description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.available.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.available.v1.schema.yaml index 9ff20626d..15253dd4e 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.available.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.available.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/pdm + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/pdm description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.retries.exceeded.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.retries.exceeded.v1.schema.yaml index ccbeb08b4..46b9f2402 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.retries.exceeded.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.retries.exceeded.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/pdm + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/pdm description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.submission.rejected.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.submission.rejected.v1.schema.yaml index 8d8410d90..8e749904b 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.submission.rejected.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.submission.rejected.v1.schema.yaml @@ -11,7 +11,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/pdm + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/pdm description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.submitted.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.submitted.v1.schema.yaml index 8f882c2bb..4e6c647e3 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.submitted.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.submitted.v1.schema.yaml @@ -11,7 +11,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/pdm + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/pdm description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.unavailable.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.unavailable.v1.schema.yaml index 6417bba0d..7d10ab842 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.unavailable.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.pdm.resource.unavailable.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/pdm + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/pdm description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.file.quarantined.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.file.quarantined.v1.schema.yaml index 1d9e8b492..637cb8b67 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.file.quarantined.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.file.quarantined.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/print + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/print description: Event source for digital letters. dataschema: type: string diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.file.safe.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.file.safe.v1.schema.yaml index 86811464d..e7851e4b1 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.file.safe.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.file.safe.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/print + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/print description: Event source for digital letters. dataschema: type: string diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.letter.transitioned.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.letter.transitioned.v1.schema.yaml index 73780c95f..a455bc1c8 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.letter.transitioned.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.letter.transitioned.v1.schema.yaml @@ -11,7 +11,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/print + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/print description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.pdf.analysed.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.pdf.analysed.v1.schema.yaml index 54f1829ff..5e95700f4 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.pdf.analysed.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.pdf.analysed.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/print + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/print description: Event source for digital letters. dataschema: type: string diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1.schema.yaml index 533823937..d0555e9c2 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.read.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/queue + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/queue description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1.schema.yaml index fcf71cff8..53b2fd811 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/queue + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/queue description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1.schema.yaml index 9ced7d09a..4d37b17c6 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/queue + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/queue description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.generate.report.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.generate.report.v1.schema.yaml index 60781d491..478d34f98 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.generate.report.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.generate.report.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/reporting + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/reporting description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.generated.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.generated.v1.schema.yaml index 92ee9a949..33972180b 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.generated.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.generated.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/reporting + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/reporting description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.sent.v1.schema.yaml b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.sent.v1.schema.yaml index eeef261ad..0c0175599 100644 --- a/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.sent.v1.schema.yaml +++ b/src/cloudevents/domains/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.reporting.report.sent.v1.schema.yaml @@ -10,7 +10,7 @@ properties: description: Concrete versioned event type string for this event (.vN suffix). source: type: string - pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/data-plane/digitalletters/reporting + pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/reporting description: Event source for digital letters. dataschema: diff --git a/src/cloudevents/tools/generator/example-generator/example-generator.ts b/src/cloudevents/tools/generator/example-generator/example-generator.ts index e16ccce94..554008168 100644 --- a/src/cloudevents/tools/generator/example-generator/example-generator.ts +++ b/src/cloudevents/tools/generator/example-generator/example-generator.ts @@ -167,8 +167,11 @@ export class ExampleGenerator { example.source = generatedSource; } } + // 5. Notify events are data plane and dataschemaversion + example.plane = "data"; + example.dataschemaversion = "1.0.0"; - // 5. Generate subject from the most specific pattern + // 6. Generate subject from the most specific pattern const subjectSchema = dereferencedSchema.properties?.subject; const hasSpecificSubjectPattern = subjectSchema?.pattern && !subjectSchema.$ref; diff --git a/src/digital-letters-events/README.md b/src/digital-letters-events/README.md index 4bec683b4..acd0f76ff 100644 --- a/src/digital-letters-events/README.md +++ b/src/digital-letters-events/README.md @@ -29,8 +29,10 @@ import { PDMResourceSubmitted } from 'digital-letters-events'; const pdmResourceSubmittedEvent: PDMResourceSubmitted = { type: 'uk.nhs.notify.digital.letters.pdm.resource.submitted.v1', + plane : 'data', + dataschemaversion: '1.0.0', source: - '/nhs/england/notify/staging/dev-647563337/data-plane/digitalletters/pdm', + '/nhs/england/notify/staging/dev-647563337/digitalletters/pdm', dataschema: 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-pdm-resource-submitted-data.schema.json', specversion: '1.0', @@ -96,7 +98,9 @@ try: # Validate and parse an event event_data = { "type": "uk.nhs.notify.digital.letters.pdm.resource.submitted.v1", - "source": "/nhs/england/notify/staging/dev-647563337/data-plane/digitalletters/pdm", + "plane": "data", + "dataschemaversion": '1.0', + "source": "/nhs/england/notify/staging/dev-647563337/digitalletters/pdm", "dataschema": "https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-pdm-resource-submitted-data.schema.json", "specversion": "1.0", "id": "0249e529-f947-4012-819e-b634eb71be79", diff --git a/src/typescript-schema-generator/PLAN.md b/src/typescript-schema-generator/PLAN.md index 69af34637..385638ce1 100644 --- a/src/typescript-schema-generator/PLAN.md +++ b/src/typescript-schema-generator/PLAN.md @@ -491,7 +491,7 @@ describe('LetterAvailable', () => { it('should create instance with valid data', () => { const event = new LetterAvailableBuilder() .withType('uk.nhs.notify.digital.letters.letter.available.v1') - .withSource('/nhs/england/notify/development/primary/data-plane/digitalletters/letter') + .withSource('/nhs/england/notify/development/primary/digitalletters/letter') .withData(/* ... */) .build(); @@ -551,7 +551,7 @@ const client = new CloudEventClient({ const event = new LetterAvailable({ type: 'uk.nhs.notify.digital.letters.letter.available.v1', - source: '/nhs/england/notify/development/primary/data-plane/digitalletters/letter', + source: '/nhs/england/notify/development/primary/digitalletters/letter', data: { /* ... */ } }); diff --git a/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts b/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts index de9e137fd..96ad87362 100644 --- a/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/core-notify.component.spec.ts @@ -21,8 +21,9 @@ import { v4 as uuidv4 } from 'uuid'; const baseEvent: Omit = { specversion: '1.0', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/pdm', + plane: 'data', + dataschemaversion: '1.0.0', + source: '/nhs/england/notify/production/primary/digitalletters/pdm', subject: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', type: 'uk.nhs.notify.digital.letters.pdm.resource.available.v1', diff --git a/tests/playwright/digital-letters-component-tests/file-scanner.component.spec.ts b/tests/playwright/digital-letters-component-tests/file-scanner.component.spec.ts index a1c7e5836..e96cbb604 100644 --- a/tests/playwright/digital-letters-component-tests/file-scanner.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/file-scanner.component.spec.ts @@ -58,8 +58,10 @@ test('should extract PDF from DocumentReference and store in unscanned bucket wi [ { id: eventId, + plane: 'data', + dataschemaversion: '1.0.0', specversion: '1.0', - source: `/nhs/england/notify/development/dev-1/data-plane/digitalletters/queue`, + source: `/nhs/england/notify/development/dev-1/digitalletters/queue`, subject: `message/${messageReference}`, type: 'uk.nhs.notify.digital.letters.queue.item.dequeued.v1', time: eventTime, @@ -125,7 +127,9 @@ test('should handle validation errors by sending messages to DLQ', async () => { { id: eventId, specversion: '1.0', - source: `/nhs/england/notify/development/dev-1/data-plane/digitalletters/queue`, + plane: 'data', + dataschemaversion: '1.0.0', + source: `/nhs/england/notify/development/dev-1/digitalletters/queue`, subject: `message/${messageReference}`, type: 'uk.nhs.notify.digital.letters.queue.item.dequeued.v1', time: eventTime, diff --git a/tests/playwright/digital-letters-component-tests/mesh-acknowledge.component.spec.ts b/tests/playwright/digital-letters-component-tests/mesh-acknowledge.component.spec.ts index a55e148bb..7d2419c81 100644 --- a/tests/playwright/digital-letters-component-tests/mesh-acknowledge.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/mesh-acknowledge.component.spec.ts @@ -24,8 +24,9 @@ test.describe('Digital Letters - Mesh Acknowledger', () => { const validMessageDownloadedEvent: MESHInboxMessageDownloaded = { id: uuidv4(), specversion: '1.0', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/mesh', + plane: 'data', + dataschemaversion: '1.0.0', + source: '/nhs/england/notify/production/primary/digitalletters/mesh', subject: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', type: 'uk.nhs.notify.digital.letters.mesh.inbox.message.downloaded.v1', diff --git a/tests/playwright/digital-letters-component-tests/mesh-poll-download.component.spec.ts b/tests/playwright/digital-letters-component-tests/mesh-poll-download.component.spec.ts index 4dd9e7815..6c599cfa9 100644 --- a/tests/playwright/digital-letters-component-tests/mesh-poll-download.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/mesh-poll-download.component.spec.ts @@ -226,8 +226,10 @@ test.describe('Digital Letters - MESH Poll and Download', () => { { id: uuidv4(), specversion: '1.0', - source: - '/nhs/england/notify/development/primary/data-plane/digitalletters/mesh', + plane: 'data', + dataschemaversion: '1.0.0', + datacontenttype: 'application/json', + source: '/nhs/england/notify/development/primary/digitalletters/mesh', subject: 'customer/00000000-0000-0000-0000-000000000000/recipient/00000000-0000-0000-0000-000000000000', type: 'uk.nhs.notify.digital.letters.mesh.inbox.message.received.v1', diff --git a/tests/playwright/digital-letters-component-tests/pdm-poll.component.spec.ts b/tests/playwright/digital-letters-component-tests/pdm-poll.component.spec.ts index 8d31cfb8d..fca7aff57 100644 --- a/tests/playwright/digital-letters-component-tests/pdm-poll.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/pdm-poll.component.spec.ts @@ -16,8 +16,9 @@ import { v4 as uuidv4 } from 'uuid'; const baseEvent = { specversion: '1.0', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/pdm', + plane: 'data', + dataschemaversion: '1.0.0', + source: '/nhs/england/notify/production/primary/digitalletters/pdm', subject: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', time: '2023-06-20T12:00:00Z', diff --git a/tests/playwright/digital-letters-component-tests/pdm-uploader.component.spec.ts b/tests/playwright/digital-letters-component-tests/pdm-uploader.component.spec.ts index 5b2993eb2..6dfebc614 100644 --- a/tests/playwright/digital-letters-component-tests/pdm-uploader.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/pdm-uploader.component.spec.ts @@ -36,8 +36,9 @@ const pdmRequest = { const baseEvent = { specversion: '1.0', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/mesh', + plane: 'data', + dataschemaversion: '1.0.0', + source: '/nhs/england/notify/production/primary/digitalletters/mesh', subject: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', type: 'uk.nhs.notify.digital.letters.mesh.inbox.message.downloaded.v1', diff --git a/tests/playwright/digital-letters-component-tests/print-analyser.component.spec.ts b/tests/playwright/digital-letters-component-tests/print-analyser.component.spec.ts index 46720477c..befb25d11 100644 --- a/tests/playwright/digital-letters-component-tests/print-analyser.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/print-analyser.component.spec.ts @@ -17,8 +17,9 @@ import { putFileS3 } from 'utils'; export const fileSafeEvent: FileSafe = { id: '550e8400-e29b-41d4-a716-446655440001', specversion: '1.0', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/print', + plane: 'data', + dataschemaversion: '1.0.0', + source: '/nhs/england/notify/production/primary/digitalletters/print', subject: 'letter-origin/digital-letters/letter/f47ac10b-58cc-4372-a567-0e02b2c3d479', type: 'uk.nhs.notify.digital.letters.print.file.safe.v1', diff --git a/tests/playwright/digital-letters-component-tests/print-sender.component.spec.ts b/tests/playwright/digital-letters-component-tests/print-sender.component.spec.ts index b761c54ab..3feff36cc 100644 --- a/tests/playwright/digital-letters-component-tests/print-sender.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/print-sender.component.spec.ts @@ -27,8 +27,9 @@ test.describe('Digital Letters - Print Sender', () => { { id: letterId, specversion: '1.0', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/print', + plane: 'data', + dataschemaversion: '1.0.0', + source: '/nhs/england/notify/production/primary/digitalletters/print', subject: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', type: 'uk.nhs.notify.digital.letters.print.pdf.analysed.v1', @@ -76,8 +77,9 @@ test.describe('Digital Letters - Print Sender', () => { const event = { id: uuidv4(), specversion: '1.0', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/print', + plane: 'data', + dataschemaversion: '1.0.0', + source: '/nhs/england/notify/production/primary/digitalletters/print', subject: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', type: 'uk.nhs.notify.digital.letters.print.pdf.analysed.v1', diff --git a/tests/playwright/digital-letters-component-tests/send-reports-trust.component.spec.ts b/tests/playwright/digital-letters-component-tests/send-reports-trust.component.spec.ts index 2a8311680..7647f4c3e 100644 --- a/tests/playwright/digital-letters-component-tests/send-reports-trust.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/send-reports-trust.component.spec.ts @@ -25,8 +25,10 @@ test.describe('Digital Letters - Send reports to Trust', () => { { id: uuidv4(), specversion: '1.0', + plane: 'data', + dataschemaversion: '1.0.0', source: - '/nhs/england/notify/development/dev-12345/data-plane/digitalletters/reporting', + '/nhs/england/notify/development/dev-12345/digitalletters/reporting', subject: `report/${uuidv4()}`, type: 'uk.nhs.notify.digital.letters.reporting.report.generated.v1', time: new Date().toISOString(), diff --git a/tests/playwright/digital-letters-component-tests/ttl-create.component.spec.ts b/tests/playwright/digital-letters-component-tests/ttl-create.component.spec.ts index 6a5d35fa2..2fb59eda5 100644 --- a/tests/playwright/digital-letters-component-tests/ttl-create.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/ttl-create.component.spec.ts @@ -27,8 +27,9 @@ test.describe('Digital Letters - Create TTL', () => { const baseEvent: MESHInboxMessageDownloaded = { id: 'id', specversion: '1.0', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/mesh', + plane: 'data', + dataschemaversion: '1.0.0', + source: '/nhs/england/notify/production/primary/digitalletters/mesh', subject: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', type: 'uk.nhs.notify.digital.letters.mesh.inbox.message.downloaded.v1', diff --git a/tests/playwright/digital-letters-component-tests/ttl-handle.component.spec.ts b/tests/playwright/digital-letters-component-tests/ttl-handle.component.spec.ts index b726abe00..de6f3ec99 100644 --- a/tests/playwright/digital-letters-component-tests/ttl-handle.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/ttl-handle.component.spec.ts @@ -15,8 +15,9 @@ test.describe('Digital Letters - Handle TTL', () => { const baseEvent: MESHInboxMessageDownloaded = { id: 'sample-id', specversion: '1.0', - source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/mesh', + plane: 'data', + dataschemaversion: '1.0.0', + source: '/nhs/england/notify/production/primary/digitalletters/mesh', subject: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', type: 'uk.nhs.notify.digital.letters.mesh.inbox.message.downloaded.v1', diff --git a/tests/playwright/helpers/event-builders.ts b/tests/playwright/helpers/event-builders.ts index 6383a37fe..79c2d1eed 100644 --- a/tests/playwright/helpers/event-builders.ts +++ b/tests/playwright/helpers/event-builders.ts @@ -11,7 +11,9 @@ import { function buildBaseEvent(sourceComponent: string, time: string) { return { specversion: '1.0', - source: `/nhs/england/notify/production/primary/data-plane/digitalletters/${sourceComponent}`, + plane: 'data', + dataschemaversion: '1.0.0', + source: `/nhs/england/notify/production/primary/digitalletters/${sourceComponent}`, subject: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', time, diff --git a/tests/playwright/helpers/report-helpers.ts b/tests/playwright/helpers/report-helpers.ts index 6e02b8b29..a9d3ff701 100644 --- a/tests/playwright/helpers/report-helpers.ts +++ b/tests/playwright/helpers/report-helpers.ts @@ -257,8 +257,10 @@ export async function publishGenerateReport( { id: generateReportEventId, specversion: '1.0', + plane: 'data', + dataschemaversion: '1.0.0', source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/reporting', + '/nhs/england/notify/production/primary/digitalletters/reporting', subject: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', type: 'uk.nhs.notify.digital.letters.reporting.generate.report.v1', @@ -291,8 +293,10 @@ export async function publishEventNotInReports(senderId: string) { { id: skippedEventId, specversion: '1.0', + plane: 'data', + dataschemaversion: '1.0.0', source: - '/nhs/england/notify/production/primary/data-plane/digitalletters/messages', + '/nhs/england/notify/production/primary/digitalletters/messages', subject: 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', type: 'uk.nhs.notify.digital.letters.messages.request.skipped.v1', diff --git a/utils/py-utils/dl_utils/__tests__/test_event_publisher.py b/utils/py-utils/dl_utils/__tests__/test_event_publisher.py index d8c0a5f3e..15172fa12 100644 --- a/utils/py-utils/dl_utils/__tests__/test_event_publisher.py +++ b/utils/py-utils/dl_utils/__tests__/test_event_publisher.py @@ -44,7 +44,9 @@ def valid_cloud_event(): 'profilepublished': '2025-10', 'id': '550e8400-e29b-41d4-a716-446655440001', 'specversion': '1.0', - 'source': '/nhs/england/notify/production/primary/data-plane/digitalletters/mesh', + 'plane': 'data', + 'dataschemaversion': '1.0.0', + 'source': '/nhs/england/notify/production/primary/digitalletters/mesh', 'subject': 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', 'type': 'uk.nhs.notify.digital.letters.mesh.inbox.message.received.v1', 'time': '2023-06-20T12:00:00Z', @@ -53,7 +55,7 @@ def valid_cloud_event(): 'severitytext': 'INFO', 'traceparent': '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01', 'dataschema': 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10/digital-letters-mesh-inbox-message-received-data.schema.json', - 'dataschemaversion': '1.0', + 'dataschemaversion': '1.0.0', 'data': { 'meshMessageId': 'test-123', 'senderId': 'sender1', @@ -69,7 +71,9 @@ def valid_cloud_event2(): 'profilepublished': '2025-10', 'id': '550e8400-e29b-41d4-a716-446655440002', 'specversion': '1.0', - 'source': '/nhs/england/notify/development/primary/data-plane/digitalletters/mesh', + 'plane': 'data', + 'dataschemaversion': '1.0.0', + 'source': '/nhs/england/notify/development/primary/digitalletters/mesh', 'subject': 'customer/920fca11-596a-4eca-9c47-99f624614658/recipient/769acdd4-6a47-496f-999f-76a6fd2c3959', 'type': 'uk.nhs.notify.digital.letters.mesh.inbox.message.received.v1', 'time': '2023-06-20T12:00:00Z', @@ -77,7 +81,7 @@ def valid_cloud_event2(): 'severitynumber': 2, 'traceparent': '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01', 'dataschema': 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10/digital-letters-mesh-inbox-message-received-data.schema.json', - 'dataschemaversion': '1.0', + 'dataschemaversion': '1.0.0', 'data': { 'meshMessageId': 'test-123', 'senderId': 'sender1', diff --git a/utils/utils/src/__tests__/event-publisher/event-publisher.test.ts b/utils/utils/src/__tests__/event-publisher/event-publisher.test.ts index 34b081e82..83bd09538 100644 --- a/utils/utils/src/__tests__/event-publisher/event-publisher.test.ts +++ b/utils/utils/src/__tests__/event-publisher/event-publisher.test.ts @@ -31,13 +31,13 @@ const testConfig: EventPublisherDependencies = { const event: TestEvent = { id: '550e8400-e29b-41d4-a716-446655440001', - source: '/nhs/england/notify/production/primary/data-plane/digital-letters', + source: '/nhs/england/notify/production/primary/digital-letters', type: 'uk.nhs.notify.digital.letters.sent.v1', }; const event2: TestEvent = { id: '550e8400-e29b-41d4-a716-446655440002', - source: '/nhs/england/notify/development/primary/data-plane/digital-letters', + source: '/nhs/england/notify/development/primary/digital-letters', type: 'uk.nhs.notify.digital.letters.sent.v2', }; From 19977365ec876a75ef217a8552f5f22f345d8adc Mon Sep 17 00:00:00 2001 From: Angel Pastor Date: Fri, 10 Apr 2026 15:32:54 +0100 Subject: [PATCH 2/2] CCM-15019: Fix broken tests after rebase --- .../mesh-download/mesh_download/__tests__/test_processor.py | 5 ++++- .../mesh-poll-download.component.spec.ts | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lambdas/mesh-download/mesh_download/__tests__/test_processor.py b/lambdas/mesh-download/mesh_download/__tests__/test_processor.py index c30f5a640..02ac52943 100644 --- a/lambdas/mesh-download/mesh_download/__tests__/test_processor.py +++ b/lambdas/mesh-download/mesh_download/__tests__/test_processor.py @@ -293,9 +293,12 @@ def test_process_sqs_message_invalid_fhir_content(self, mock_datetime): # Verify CloudEvent envelope fields assert published_event['type'] == 'uk.nhs.notify.digital.letters.mesh.inbox.message.invalid.v1' - assert published_event['source'] == '/nhs/england/notify/development/primary/data-plane/digitalletters/mesh' + assert published_event['source'] == '/nhs/england/notify/development/primary/digitalletters/mesh' assert published_event['subject'] == 'customer/00000000-0000-0000-0000-000000000000/recipient/00000000-0000-0000-0000-000000000000' assert published_event['time'] == '2025-11-19T15:30:45+00:00' + assert published_event['plane'] == 'data' + assert published_event['dataschemaversion'] == '1.0.0' + assert published_event['datacontenttype'] == 'application/json' assert 'id' in published_event assert 'tracestate' not in published_event assert 'partitionkey' not in published_event diff --git a/tests/playwright/digital-letters-component-tests/mesh-poll-download.component.spec.ts b/tests/playwright/digital-letters-component-tests/mesh-poll-download.component.spec.ts index 6c599cfa9..6dc26cd2a 100644 --- a/tests/playwright/digital-letters-component-tests/mesh-poll-download.component.spec.ts +++ b/tests/playwright/digital-letters-component-tests/mesh-poll-download.component.spec.ts @@ -356,8 +356,7 @@ test.describe('Digital Letters - MESH Poll and Download', () => { { id: uuidv4(), specversion: '1.0', - source: - '/nhs/england/notify/development/primary/data-plane/digitalletters/mesh', + source: '/nhs/england/notify/development/primary/digitalletters/mesh', subject: 'customer/00000000-0000-0000-0000-000000000000/recipient/00000000-0000-0000-0000-000000000000', type: 'uk.nhs.notify.digital.letters.mesh.inbox.message.received.v1', @@ -369,6 +368,9 @@ test.describe('Digital Letters - MESH Poll and Download', () => { '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01', dataschema: 'https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-mesh-inbox-message-received-data.schema.json', + dataschemaversion: '1.0.0', + datacontenttype: 'application/json', + plane: 'data', data: { meshMessageId, senderId,