Repository navigation
Get latest delivery configuration on submission - #2438
DavidBiddle wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Existing submissions can lose pending batch deliveries without a backfill or fallback, and two configuration-removal tests no longer exercise their intended scenarios.
3 open issues
What changed in this PR
This PR snapshots the latest delivery configurations when a form is submitted, separating delivery settings from the stored form document.
Changes:
- Adds a JSONB column for submission delivery configurations.
- Uses the saved configurations for immediate delivery and daily/weekly batch selection.
- Updates service expectations and batch-selection fixtures.
| File | Description |
|---|---|
spec/services/form_submission_service_spec.rb |
Expects delivery configurations in the saved submission. |
spec/lib/batch_submissions_selector_spec.rb |
Moves batch configuration fixtures onto submissions. |
db/schema.rb |
Records the new delivery configurations column. |
db/migrate/20261023083239_add_delivery_configuration_to_submissions.rb |
Adds the JSONB column to submissions. |
app/services/form_submission_service.rb |
Fetches and saves current configurations, then uses them for immediate delivery. |
app/lib/batch_submissions_selector.rb |
Selects batches using submission-level configurations. |
Review effort: Balanced
| @@ -0,0 +1,5 @@ | |||
| class AddDeliveryConfigurationToSubmissions < ActiveRecord::Migration[8.1] | |||
| def change | |||
| add_column :submissions, :delivery_configurations, :jsonb | |||
1e12bc7 to
6e540f5
Compare
|
🎉 A review copy of this PR has been deployed! It is made of up two components It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready For the sign in details and more information, see the review apps wiki page. |
|
This was an alternative to #2399 but we're sticking with the original approach |


What problem does this pull request solve?
Trello card:
Things to consider when reviewing