Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mrf): retain workflow through a submission lifetime #7087

Merged
merged 4 commits into from
Feb 21, 2024

Conversation

justynoh
Copy link
Contributor

@justynoh justynoh commented Feb 15, 2024

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

  • No - this PR is backwards compatible

Tests

  • Create an MRF form without a workflow. The usual response link passing should still work, with all fields enabled for all respondents.
  • Create an MRF form.
    • Create a workflow where step 2 is a static value a@gov.sg and step 3 is another static value b.gov.sg.
    • Submit the form once as Respondent 1. a@gov.sg should receive an email reminder to submit the form.
    • Now, change step 3 to be a different static value c@gov.sg.
    • Click the button in the email that a@gov.sg received to fill the form. Submit the form.
    • Check that b@gov.sg got the next respondent email, and not c@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),

Copy link

linear bot commented Feb 15, 2024

@justynoh
Copy link
Contributor Author

Hold off on this. I need to do a bit of git surgery

@justynoh justynoh changed the title feat: retain workflow through a submission lifetime feat(mrf): retain workflow through a submission lifetime Feb 19, 2024
@justynoh justynoh changed the base branch from develop to feat/field-locking February 19, 2024 09:08
@justynoh justynoh force-pushed the feat/retain-workflow branch 3 times, most recently from 7ec7c7b to 6c01de4 Compare February 19, 2024 10:17
Copy link
Contributor

@KenLSM KenLSM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@justynoh justynoh marked this pull request as ready for review February 21, 2024 00:58
Base automatically changed from feat/field-locking to develop February 21, 2024 01:45
@justynoh
Copy link
Contributor Author

no code changes, just rebase onto develop

@justynoh justynoh merged commit 51ce234 into develop Feb 21, 2024
25 checks passed
@justynoh justynoh deleted the feat/retain-workflow branch February 21, 2024 03:27
@justynoh justynoh mentioned this pull request Feb 21, 2024
30 tasks
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