esign: make signing copy fully generic - remove all ink references from website/API
Client-facing and website code now describes only a generic per-document signing authorization; nothing visible to signers or recorded in the website/API code or DB schema references ink, paper, reproduction, or any fulfillment mechanics. - rename esign-ink-consent.ts -> esign-sign-consent.ts; INK_CONSENT_TEXT -> SIGN_CONSENT_TEXT (generic: 'use my signature to complete and submit this single filing', no ink/paper/reproduce language); helpers ink* -> sign* - portal-esign-generic.ts: API field ink_reproduction -> require_sign_consent, ink_consent_text -> sign_consent_text, request field ink_consent -> sign_consent - signing page (site/public/portal/esign): all ids/vars/comments ink* -> sign*; no 'ink' string remains - npi_provider metadata flag ink_reproduction -> require_sign_consent - migration 090/092 + live DB column comments rewritten to drop ink/plotter wording (DB column names kept as ink_consent* for compat, internal only) - order-timeline.ts buffer comments neutralized - tests: 37 checks, consent text asserted to omit ink/plotter/paper/reproduce/etc DB columns ink_consent* retained (internal, never sent to clients) to avoid a risky rename of already-applied prod columns.
This commit is contained in:
parent
dba7632ce2
commit
e5db147319
11 changed files with 210 additions and 222 deletions
|
|
@ -52,7 +52,7 @@ body{font-family:'Inter',system-ui,sans-serif;color:#1f2937;background:#f1f5f9;l
|
|||
#loading{text-align:center;padding:4rem 1rem;color:#64748b}
|
||||
#error-screen{display:none;text-align:center;padding:3rem 1rem}
|
||||
.hidden{display:none}
|
||||
/* Signature block locked until ink-reproduction consent is given */
|
||||
/* Signature block locked until signing authorization is given */
|
||||
#sig-block.locked{opacity:.45;pointer-events:none;filter:grayscale(.3)}
|
||||
</style>
|
||||
<script defer src="https://analytics.performancewest.net/script.js" data-website-id="55250014-ee15-44ac-a1f6-81dabad3fe0f"></script><script defer src="/js/pw-analytics.js"></script></head>
|
||||
|
|
@ -79,13 +79,13 @@ body{font-family:'Inter',system-ui,sans-serif;color:#1f2937;background:#f1f5f9;l
|
|||
<div class="card">
|
||||
<h2>Step 2 — Your Signature</h2>
|
||||
|
||||
<!-- Ink-reproduction consent gate (shown only for ink-path documents).
|
||||
The signer must authorize use of their signature on the official form
|
||||
<!-- Signing-authorization gate (shown only when the document requires it).
|
||||
The signer must authorize use of their signature to complete the filing
|
||||
BEFORE they can draw it. -->
|
||||
<div id="ink-consent-box" class="hidden" style="padding:1rem;background:#eff6ff;border:1px solid #bfdbfe;border-radius:8px;margin-bottom:1rem">
|
||||
<p style="font-size:.85rem;color:#1f2937;margin:0 0 .75rem" id="ink-consent-text"></p>
|
||||
<div id="sign-consent-box" class="hidden" style="padding:1rem;background:#eff6ff;border:1px solid #bfdbfe;border-radius:8px;margin-bottom:1rem">
|
||||
<p style="font-size:.85rem;color:#1f2937;margin:0 0 .75rem" id="sign-consent-text"></p>
|
||||
<label style="display:flex;gap:.6rem;align-items:flex-start;font-size:.85rem;color:#1f2937;cursor:pointer">
|
||||
<input type="checkbox" id="ink-consent-chk" style="margin-top:2px;flex-shrink:0;width:16px;height:16px;accent-color:#1e3a5f">
|
||||
<input type="checkbox" id="sign-consent-chk" style="margin-top:2px;flex-shrink:0;width:16px;height:16px;accent-color:#1e3a5f">
|
||||
<span>I authorize this and confirm the signature I draw is my own.</span>
|
||||
</label>
|
||||
</div>
|
||||
|
|
@ -206,13 +206,12 @@ body{font-family:'Inter',system-ui,sans-serif;color:#1f2937;background:#f1f5f9;l
|
|||
document.getElementById("perjury-box").classList.remove("hidden");
|
||||
}
|
||||
|
||||
// Ink-reproduction consent gate: for documents whose signature will be
|
||||
// reproduced in ink on the official paper form, require an explicit
|
||||
// per-document authorization BEFORE the signer can draw. Lock the signature
|
||||
// block until the consent box is checked.
|
||||
if (data.ink_reproduction && data.ink_consent_text) {
|
||||
document.getElementById("ink-consent-text").textContent = data.ink_consent_text;
|
||||
document.getElementById("ink-consent-box").classList.remove("hidden");
|
||||
// Signing-authorization gate: for documents that require it, show an
|
||||
// explicit per-document authorization that must be accepted BEFORE the
|
||||
// signer can draw. Lock the signature block until the box is checked.
|
||||
if (data.require_sign_consent && data.sign_consent_text) {
|
||||
document.getElementById("sign-consent-text").textContent = data.sign_consent_text;
|
||||
document.getElementById("sign-consent-box").classList.remove("hidden");
|
||||
document.getElementById("sig-block").classList.add("locked");
|
||||
}
|
||||
|
||||
|
|
@ -242,7 +241,7 @@ body{font-family:'Inter',system-ui,sans-serif;color:#1f2937;background:#f1f5f9;l
|
|||
var hasSig = false;
|
||||
|
||||
// Vector capture: stroke paths normalized to the capture box (0..1, origin
|
||||
// top-left), resolution-independent. Drives the pen-plotter ink pipeline.
|
||||
// top-left), resolution-independent.
|
||||
var sigStrokes = []; // array of strokes; each stroke = array of {x,y,t}
|
||||
var curStroke = null;
|
||||
var strokeStart = 0;
|
||||
|
|
@ -344,12 +343,12 @@ body{font-family:'Inter',system-ui,sans-serif;color:#1f2937;background:#f1f5f9;l
|
|||
var agreeChk = document.getElementById("agree-chk");
|
||||
agreeChk.addEventListener("change", updateSubmit);
|
||||
|
||||
// ── Ink-reproduction consent: unlock the signature block when authorized ──
|
||||
var inkConsentChk = document.getElementById("ink-consent-chk");
|
||||
inkConsentChk.addEventListener("change", function() {
|
||||
// ── Signing authorization: unlock the signature block when authorized ──
|
||||
var signConsentChk = document.getElementById("sign-consent-chk");
|
||||
signConsentChk.addEventListener("change", function() {
|
||||
var data = window._esignData || {};
|
||||
var needsInk = !!(data.ink_reproduction && data.ink_consent_text);
|
||||
if (needsInk) {
|
||||
var needsConsent = !!(data.require_sign_consent && data.sign_consent_text);
|
||||
if (needsConsent) {
|
||||
document.getElementById("sig-block").classList.toggle("locked", !this.checked);
|
||||
// If they un-check after drawing, clear the now-unauthorized capture.
|
||||
if (!this.checked) document.getElementById("sig-clear").click();
|
||||
|
|
@ -357,18 +356,18 @@ body{font-family:'Inter',system-ui,sans-serif;color:#1f2937;background:#f1f5f9;l
|
|||
updateSubmit();
|
||||
});
|
||||
|
||||
function inkConsentOk() {
|
||||
function signConsentOk() {
|
||||
var data = window._esignData || {};
|
||||
var needsInk = !!(data.ink_reproduction && data.ink_consent_text);
|
||||
// Ink consent is only required for a DRAWN signature on an ink-path doc.
|
||||
if (!needsInk || sigMode !== "draw") return true;
|
||||
return inkConsentChk.checked;
|
||||
var needsConsent = !!(data.require_sign_consent && data.sign_consent_text);
|
||||
// Authorization is only required for a DRAWN signature on a consent-required doc.
|
||||
if (!needsConsent || sigMode !== "draw") return true;
|
||||
return signConsentChk.checked;
|
||||
}
|
||||
|
||||
function updateSubmit() {
|
||||
var hasSignature = sigMode === "draw" ? hasSig : typedInput.value.trim().length >= 2;
|
||||
document.getElementById("submit-btn").disabled =
|
||||
!(hasSignature && agreeChk.checked && inkConsentOk());
|
||||
!(hasSignature && agreeChk.checked && signConsentOk());
|
||||
}
|
||||
|
||||
document.getElementById("submit-btn").addEventListener("click", async function() {
|
||||
|
|
@ -382,7 +381,7 @@ body{font-family:'Inter',system-ui,sans-serif;color:#1f2937;background:#f1f5f9;l
|
|||
if (sigMode === "draw") {
|
||||
signatureData = { type: "drawn", image_b64: canvas.toDataURL("image/png") };
|
||||
// Attach the vector strokes (resolution-independent) so the same signing
|
||||
// event can also drive the pen-plotter ink-signature pipeline.
|
||||
// event resumes the filing pipeline.
|
||||
if (sigStrokes.length) {
|
||||
signatureData.vector = { v: 1, w: captureW, h: captureH, strokes: sigStrokes };
|
||||
}
|
||||
|
|
@ -401,7 +400,7 @@ body{font-family:'Inter',system-ui,sans-serif;color:#1f2937;background:#f1f5f9;l
|
|||
signature: signatureData,
|
||||
agreed_at: new Date().toISOString(),
|
||||
user_agent: navigator.userAgent,
|
||||
ink_consent: inkConsentOk() && sigMode === "draw" && inkConsentChk.checked,
|
||||
sign_consent: signConsentOk() && sigMode === "draw" && signConsentChk.checked,
|
||||
}),
|
||||
});
|
||||
var result = await resp.json();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue