Skip to content

Add job to send a batch of submissions for a form#1901

Merged
SamJamCul merged 6 commits intomainfrom
add-batched-submissions-job
Feb 19, 2026
Merged

Add job to send a batch of submissions for a form#1901
SamJamCul merged 6 commits intomainfrom
add-batched-submissions-job

Conversation

@stephencdaly
Copy link
Copy Markdown
Contributor

What problem does this pull request solve?

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

Add a job that will send an email containing CSV(s) of submissions for a given form on a given day for a given mode.

This job is not scheduled by anything yet.

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?

@stephencdaly stephencdaly force-pushed the add-batched-submissions-job branch from 09b279d to 5ca0574 Compare February 13, 2026 18:37
@stephencdaly stephencdaly force-pushed the add-service-to-send-batch-submissions branch 5 times, most recently from 38a3d43 to 72f905b Compare February 16, 2026 18:07
@stephencdaly stephencdaly force-pushed the add-batched-submissions-job branch from 5ca0574 to d5f802d Compare February 16, 2026 18:13
Base automatically changed from add-service-to-send-batch-submissions to main February 17, 2026 14:24
@SamJamCul SamJamCul force-pushed the add-batched-submissions-job branch 2 times, most recently from 2443b2c to c43f10a Compare February 17, 2026 14:40
@SamJamCul SamJamCul marked this pull request as ready for review February 17, 2026 14:41
@stephencdaly stephencdaly marked this pull request as draft February 18, 2026 14:03
@SamJamCul SamJamCul force-pushed the add-batched-submissions-job branch 4 times, most recently from 781fe3e to 7861825 Compare February 19, 2026 11:42
SamJamCul and others added 2 commits February 19, 2026 11:52
This scopes submission based on their created_at, form_id and mode. The
given date is converted to the local time before the comparison to the
created_at value.

Co-authored-by: Stephen Daly <stephen.daly@digital.cabinet-office.gov.uk>
Add a job that will send an email containing CSV(s) of submissions
for a given form on a given day for a given mode.

This job is not scheduled by anything yet.

Co-authored-by: Samuel Culley <samuel.culley@digital.cabinet-office.gov.uk>
@SamJamCul SamJamCul force-pushed the add-batched-submissions-job branch from 7861825 to 5ccc9fd Compare February 19, 2026 11:52
@SamJamCul SamJamCul force-pushed the add-batched-submissions-job branch from df1446e to e91e7b2 Compare February 19, 2026 12:09
SamJamCul and others added 4 commits February 19, 2026 12:45
This index will be used to locate a batch of submissions for daily
batching.

Co-authored-by: Stephen Daly <stephen.daly@digital.cabinet-office.gov.uk>
This scope orders a list of submissions by their form's udpated_at,
which is used as a proxy for its version, and then the submission date.
The intention is to use this in the CSV generation for submission
batches, where we'll need to maintain the order that submissions were
made, but keep them in version clusters

Co-authored-by: Stephen Daly <stephen.daly@digital.cabinet-office.gov.uk>
The CSV generator now takes a submission query, and creates a set of
CSVs based on how many different versions it can pick out. If two
submissions have different versions but would still have the same CSV
headers, then they will be part of the same CSV.

Co-authored-by: Stephen Daly <stephen.daly@digital.cabinet-office.gov.uk>
Shifts the checks for a form having a submission_email out of the
submission batch service and into the batch job. This will mean that the
job will terminate early when no submission_email is present, rather
than continuing even though no email gets sent.
@SamJamCul SamJamCul force-pushed the add-batched-submissions-job branch from e91e7b2 to 29e494e Compare February 19, 2026 12:45
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
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.

@SamJamCul SamJamCul marked this pull request as ready for review February 19, 2026 14:27
@SamJamCul SamJamCul added this pull request to the merge queue Feb 19, 2026
Merged via the queue into main with commit 5812bed Feb 19, 2026
6 checks passed
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.

3 participants