Skip to content

CCM-13475: Send print events#179

Open
simonlabarere wants to merge 31 commits intomainfrom
feature/CCM-13475_send_print_events
Open

CCM-13475: Send print events#179
simonlabarere wants to merge 31 commits intomainfrom
feature/CCM-13475_send_print_events

Conversation

@simonlabarere
Copy link
Contributor

@simonlabarere simonlabarere commented Jan 13, 2026

Description

Create new Print Sender component that triggers a Letter Prepared Event to be eventually passed to the Supplier API from a Letter Analysed Event.

Contains changes from #174 to pull packages from GitHub.

Note: When merging main, @nhsdigital/nhs-notify-event-schemas-supplier-api was updated to 1.0.10, which introduces a breaking change requiring billingRef in the events. As this change is not yet supported, the dependency has been temporarily pinned to 1.0.6.

Test evidence

Print Sender logs

image

Event Bus logs

Input Letter Analysed event + Output Letter Prepared event
image

Event is published to the cross domain event bus
image

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming
  • If I have used the 'skip-trivy-package' label I have done so responsibly and in the knowledge that this is being fixed as part of a separate ticket/PR.

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@simonlabarere simonlabarere requested review from a team as code owners January 13, 2026 13:22
@simonlabarere simonlabarere force-pushed the feature/CCM-13475_send_print_events branch from 61703dc to d9a4b1a Compare January 13, 2026 13:33
@simonlabarere simonlabarere requested a review from a team as a code owner January 13, 2026 13:33
@simonlabarere simonlabarere force-pushed the feature/CCM-13475_send_print_events branch 2 times, most recently from 16dabad to d9a4b1a Compare January 13, 2026 13:57
]

resources = [
"arn:aws:sqs:${var.region}:${var.aws_account_id}:${var.project}-${var.environment}-${local.component}-print-sender-queue"
Copy link
Contributor

Choose a reason for hiding this comment

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

tiny one, is it worth using ${local.csi} instead of ${var.project}-${var.environment}-${local.component}? from the file terraform/components/dl/locals_tfscaffold.tf:

csi = replace(
format(
"%s-%s-%s",
var.project,
var.environment,
local.component,
),
"_",
"",
)

@lapenna-bjss lapenna-bjss force-pushed the feature/CCM-13475_send_print_events branch from a35e9f1 to 4ba840b Compare January 28, 2026 08:58
module "eventpub" {
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.30/terraform-eventpub.zip"

name = "eventpub"
Copy link
Contributor

Choose a reason for hiding this comment

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

is this how we expose the events to the digital letters API? just wondering if the name should be a bit more descriptive.

@gareth-allan gareth-allan self-assigned this Jan 30, 2026
Copy link
Contributor

@gareth-allan gareth-allan left a comment

Choose a reason for hiding this comment

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

A couple of last comments, but it otherwise looks good!


create_dlq = true
create_dlq = true
max_receive_count = 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Why set the max receive count to 1 for this lambda? Do we not want to benefit from automatic retries before sending a message to the DLQ?

export const HANDLE_TTL_DLQ_NAME = `${CSI}-ttl-handle-expiry-errors-queue`;
export const PRINT_ANALYSER_DLQ_NAME = `${CSI}-print-analyser-dlq`;
export const PRINT_SENDER_DLQ_NAME = `${CSI}-print-sender-dlq`;
export const EVENT_PUBLISHER_DLQ_NAME = `${CSI}-event-publisher-errors`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is EVENT_PUBLISHER_DLQ_NAME used anywhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants