+ ${CONSENT_DOCUMENT.institution} ·
+ PI: ${CONSENT_DOCUMENT.principalInvestigator} ·
+ IRB: ${CONSENT_DOCUMENT.irbProtocol} ·
+ Version: ${CONSENT_DOCUMENT.version}
+
+
+
Participant Signature
+
${signatureBlock}
+
Date signed: ${consentDate}
+ ${signature.participantName ? `
Name: ${signature.participantName}
` : ''}
+
+
+`;
+}
+
+// ── uploadConsentPdf ──────────────────────────────────────────────────────────
+
+/**
+ * Generates and uploads a signed consent PDF for the currently signed-in user.
+ *
+ * Call this after ConsentService.recordConsent() succeeds. Failures are
+ * returned in the result object — callers should not throw on failure since
+ * the local AsyncStorage record is the source of truth for gate-keeping.
+ */
+export async function uploadConsentPdf(
+ signature: ConsentSignatureData,
+): Promise