feat(mrf): retain workflow through a submission lifetime #7087
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When a submission is made, we want to save a snapshot of the workflow at that point and use it throughout the lifetime of the submission. This involves saving the workflow in the submission object, as well as using the submission workflow for routing.
Closes FRM-1637
Solution
Add a
workflow
field to multirespondent submissions, and populate it on creation with the form workflow. From then on, the submission object's workflow is used for routing, and passed to the frontend.Breaking Changes
Tests
a@gov.sg
and step 3 is another static valueb.gov.sg
.a@gov.sg
should receive an email reminder to submit the form.c@gov.sg
.a@gov.sg
received to fill the form. Submit the form.b@gov.sg
got the next respondent email, and notc@gov.sg
.Deploy Notes
New scripts:
mrf-retain-workflow-in-submissions
: This DB migration script creates a new workflow key in all existing mrf submissions, populated with the form's existing workflow. From this point on, workflows should be captured when the submission is initially created (i.e. the workflow is started),