Skip to content

Add batch_begin_at to deliveries#1976

Merged
stephencdaly merged 3 commits intomainfrom
add-batch-begin-at
Mar 18, 2026
Merged

Add batch_begin_at to deliveries#1976
stephencdaly merged 3 commits intomainfrom
add-batch-begin-at

Conversation

@stephencdaly
Copy link
Contributor

@stephencdaly stephencdaly commented Mar 18, 2026

What problem does this pull request solve?

Trello card: https://trello.com/c/v2LQDGgq

For sending weekly submission batches, we need to know the start date for the batch to include in the email content and when handling bounced emails.

For daily batch deliveries, all submissions were on the same day so we could use the created_at for any of the submissions.

Store the time the batch starts on the delivery in a new batch_begin_at column so this is easily retrievable.

This column is nullable and will only be set for daily and weekly deliveries. For immediate deliveries it will be null.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Do the end to end tests need updating before these changes will pass?
  • Has all relevant documentation been updated?

For sending weekly submission batches, we need to know the start date
for the batch to include in the email content and when handling
bounced emails.

For daily batch deliveries, all submissions were on the same day so
we could use the created_at for any of the submissions.

This column is nullable and will only be set for `daily` and `weekly`
deliveries. For `immediate` deliveries it will be null.
We've added batch_begin_at so that we know the start datetime of
weekly batch deliveries, but for consistency also set it for daily
batch deliveries.
Rather than get the date off a submission, use the batch_begin_at from
the delivery. This makes it easier to re-use the job for sending
weekly batches.
@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

🎉 A review copy of this PR has been deployed! It is made of up two components

  1. A review copy of forms-runner
  2. A production copy of forms-admin

Important

Not all of the functionality of forms-runner is present in review apps.
Functionality such as sending emails, file upload, and S3 submission types are
deliberately disabled for the sake of simplifying review apps.

You should use the full dev environment to test the functionality which is disabled here.

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

@stephencdaly stephencdaly added this pull request to the merge queue Mar 18, 2026
Merged via the queue into main with commit 4841b0f Mar 18, 2026
8 checks passed
@stephencdaly stephencdaly deleted the add-batch-begin-at branch March 18, 2026 12:04
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.

2 participants