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 storage 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 storage admin email when flag is disabled

  • Set GB flag to 'OFF'
  • Create a storage form without signature field and with admin email notif.
  • Submit the form. Assert the admin email is received and does not contain PDF.
  • Submit the form. Assert the admin email is received and does not contain PDF.

TC2: PDF is included in storage admin email when flag is enabled

  • Set GB flag to 'ON'
  • Create a storage form without signature field and with admin email notif.
  • Submit the form. Assert the admin email is received and contains PDF.

TC3: PDF is included in storage admin email when flag is signatures only

  • Set GB flag to 'SIGNATURES_ONLY'
  • Create a storage form without signature field and with admin email notif.
  • Add an email mode with respondent copy to the form.
  • Submit the form. Assert the admin email is received and does not contain PDF. However, assert the respondent copy email is received and contains PDF.
  • Add a signature field to the storage form.
  • Submit the form. Assert the admin email is received and contains PDF. Assert the respondent copy email is received and contains PDF also.

@kevin9foong kevin9foong requested a review from a team as a code owner December 5, 2025 14:01
@kevin9foong kevin9foong changed the base branch from develop to feat/add-admin-pdf-copy December 5, 2025 14:01
@kevin9foong kevin9foong self-assigned this Dec 5, 2025
@kevin9foong kevin9foong force-pushed the feat/add-storage-admin-copy branch from 66d22ba to 3f60fb0 Compare December 5, 2025 14:23
@datadog-opengovsg
Copy link

datadog-opengovsg bot commented Dec 5, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 3f60fb0 | Docs | Was this helpful? Give us feedback!

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