Skip to content

Conversation

@kevin9foong
Copy link
Contributor

@kevin9foong kevin9foong commented Dec 5, 2025

Problem

Signatures do not provide utility by themselves and need to be signed against content to be of utility. Hence, a pdf copy should be included for admins so the signature can be verified against the form fields submitted.

A feature flag is included to protect against excessive pdf generation load.
There are 3 flags: ['ON', 'OFF', 'SIGNATURES_ONLY'] to control when pdfs should be generated.

Solution

Generate and include pdf in admin mrf workflow completion.
To reduce load, the same pdf is reused for any potential respondent pdf copy. Hence, hoisting to the post submission actions of the check for if generation is needed and generation is done.

Breaking Changes

No - this PR is backwards compatible

Tests

TC1: PDF is not included in mrf workflow completion email when flag is disabled

  • Set GB flag to 'OFF'
  • Create an MRF form without signature field and with email notifications for workflow completion.
  • Create 3 step workflow, where 2nd step is approval step.
  • Submit the form and reject at step 2. Assert the workflow completion email is received and does not contain PDF.
  • Submit the form at step 3 (approved). Assert the workflow completion email is received and does not contain PDF.

TC2: PDF is included in mrf workflow completion email when flag is enabled

  • Set GB flag to 'ON'
  • Create an MRF form without signature field and with email notifications for workflow completion.
  • Create 3 step workflow, where 2nd step is approval step.
  • Submit the form and reject at step 2. Assert the workflow completion email is received and contains PDF.
  • Submit the form at step 3 (approved). Assert the workflow completion email is received and contains PDF.

TC3: PDF is included in mrf workflow completion email when flag is signatures only

  • Set GB flag to 'SIGNATURES_ONLY'
  • Create an MRF form without signature field and with email notifications for workflow completion.
  • Create 1 step only workflow.
  • Add an email field with respondent copy + pdf to the MRF step 1.
  • Submit the form. Assert the workflow completion email is received and does not contain PDF. However, assert the respondent copy email is received but without PDF.
  • Add a signature field to the MRF.
  • Submit the form. Assert the workflow completion email is received and contains PDF. Assert the respondent copy email is received and also contains PDF.

@kevin9foong kevin9foong force-pushed the feat/add-admin-pdf-copy branch 2 times, most recently from 4208303 to b32befa Compare December 5, 2025 13:17
@kevin9foong kevin9foong force-pushed the feat/encapsulate-pdf-data-formatting branch 2 times, most recently from a2bcfef to 5d426d0 Compare December 5, 2025 13:43
@kevin9foong kevin9foong force-pushed the feat/add-admin-pdf-copy branch from b32befa to 499c092 Compare December 5, 2025 13:49
@kevin9foong kevin9foong force-pushed the feat/encapsulate-pdf-data-formatting branch from 5d426d0 to e1d68d2 Compare December 5, 2025 13:51
@kevin9foong kevin9foong force-pushed the feat/add-admin-pdf-copy branch from 499c092 to fa8865f Compare December 5, 2025 13:52
@kevin9foong kevin9foong changed the title feat: add admin pdf copy feat: add admin pdf copy for mrf Dec 5, 2025
@kevin9foong kevin9foong self-assigned this Dec 5, 2025
@kevin9foong kevin9foong marked this pull request as ready for review December 5, 2025 14:11
@kevin9foong kevin9foong requested a review from a team as a code owner December 5, 2025 14:11
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