Skip to content

Conversation

@gareth-allan
Copy link
Contributor

@gareth-allan gareth-allan commented Dec 8, 2025

Description

Following #138, we now have auto-generated TypeScript types and JS validator code for all digital-letters events that we have produced schemas for. This PR updates all TypeScript code that uses manually-created Zod schemas for our events to use our new types and validation functions. The main changes are:

  • Updated the ttl-create-lambda to use the new MESHInboxMessageDownloaded and ItemEnqueued types
  • Updated the ttl-handle-expiry-lambda to use the new MESHInboxMessageDownloaded and ItemDequeued types
  • Updated the EventPublisher library to work with our new auto-generated types
  • Updated the Playwright tests to use the new event types
  • Removed the old, manually created, TTL item and CloudEvent types from the utils package

Context

Using auto-generated types based on our JSON schemas, which are the source of truth for the digital letters event definitions, means that our code will always be using the correct shape for events published.

Validation

Verified the integration tests are working as expected:
Screenshot 2025-12-11 at 09 16 02

After the latest set of changes was deployed, I used CloudWatch to verify events were being processed as expected.

The ttl-create lambda adding an entry to the table in DynamoDB and then publishing the ItemEnqueued event:
Screenshot 2025-12-10 at 16 13 21

The ttl-handle-expiry lambda detecting the deletion of the entry from DynamoDB and sending the ItemDequeued event:
Screenshot 2025-12-10 at 16 33 45

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

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.

@gareth-allan gareth-allan changed the title Feature/ccm 12896 use generated code CCM-12896: Use Generated Event Types and Validators in Lambdas Dec 8, 2025
@gareth-allan gareth-allan force-pushed the feature/CCM-12896_use_generated_code branch from bb60bd3 to 05e3d66 Compare December 10, 2025 09:40
@gareth-allan gareth-allan marked this pull request as ready for review December 10, 2025 12:13
@gareth-allan gareth-allan requested review from a team as code owners December 10, 2025 12:13
Ian-Hodges
Ian-Hodges previously approved these changes Dec 10, 2025
@gareth-allan gareth-allan merged commit f509cf4 into main Dec 11, 2025
36 checks passed
@gareth-allan gareth-allan deleted the feature/CCM-12896_use_generated_code branch December 11, 2025 14:49
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.

4 participants