Skip to content

CCM-13304: Generate reports#203

Open
simonlabarere wants to merge 64 commits intomainfrom
feature/CCM-13304_generate_reports
Open

CCM-13304: Generate reports#203
simonlabarere wants to merge 64 commits intomainfrom
feature/CCM-13304_generate_reports

Conversation

@simonlabarere
Copy link
Contributor

@simonlabarere simonlabarere commented Feb 10, 2026

Description

Generate report component.
image

Testing

Generate Report Event
image

Report Generated in S3
image

Report Generated Event
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 February 10, 2026 10:21
@gareth-allan gareth-allan requested a review from a team as a code owner February 13, 2026 13:54
@nhsd-angel-pastor nhsd-angel-pastor force-pushed the feature/CCM-13304_generate_reports branch from 0da8129 to bab96e7 Compare February 25, 2026 11:48
@simonlabarere simonlabarere force-pushed the feature/CCM-13304_generate_reports branch from ae5f4af to 4f2f398 Compare March 3, 2026 10:35
Comment on lines +116 to +117
logger.error({ err: result.reason });
processed.failed += 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

These are not covered by unit tests. If we can get them tested we can remove the coverage thresholds in the jest config file.

const { reportDate, senderId } = event.data;

try {
const query = fs.readFileSync('/var/task/queries/report.sql', 'utf8');
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 the pattern we've followed else where? The reports in core use saved athena queries rather than a local file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I copied this from core but happy to start using saved queries.

Ian-Hodges
Ian-Hodges previously approved these changes Mar 3, 2026
Comment on lines +157 to +168
statement {
sid = "SQSDLQPermissions"
effect = "Allow"

actions = [
"sqs:SendMessage",
]

resources = [
module.sqs_report_generator.sqs_dlq_arn,
]
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need these permissions now we're not sending directly to the DLQ?

{
"dependencies": {
"@aws-sdk/client-athena": "^3.984.0",
"@aws-sdk/client-sqs": "^3.984.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure we need this if we're no longer sending events directly to the DLQ.

| **Uk.nhs.notify.digital.letters.print.printed.v1** | [`../../output/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.print.printed.v1-event.json`](../../output/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.print.printed.v1-event.json) | [`../../output/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.print.printed.v1-event.md`](../../output/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.print.printed.v1-event.md) |
| **Uk.nhs.notify.digital.letters.queue.item.dequeued.v1** | [`../../output/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1-event.json`](../../output/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1-event.json) | [`../../output/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1-event.md`](../../output/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.dequeued.v1-event.md) |
| **Uk.nhs.notify.digital.letters.queue.item.enqueued.v1** | [`../../output/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1-event.json`](../../output/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1-event.json) | [`../../output/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1-event.md`](../../output/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.enqueued.v1-event.md) |
| **Uk.nhs.notify.digital.letters.queue.item.removed.v1** | [`../../output/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.removed.v1-event.json`](../../output/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.removed.v1-event.json) | [`../../output/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.removed.v1-event.md`](../../output/digital-letters/2025-10-draft/example-events/uk.nhs.notify.digital.letters.queue.item.removed.v1-event.md) |
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we have a new entry for uk.nhs.notify.digital.letters.queue.digital.letter.read.v1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I might need some help figuring out what's missing here! I see that it's missing from src/cloudevents/readme-index.yaml but I'm not sure what else should be added.

@simonlabarere simonlabarere added skip-trivy-package Skip the Trivy Package Scan enhancement New feature or request labels Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request skip-trivy-package Skip the Trivy Package Scan

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants