Skip to content

feat(membership): in-app Zoho Sign agreement signing#290

Open
dkaygithub wants to merge 1 commit into
mainfrom
feat/membership-agreement-signing
Open

feat(membership): in-app Zoho Sign agreement signing#290
dkaygithub wants to merge 1 commit into
mainfrom
feat/membership-agreement-signing

Conversation

@dkaygithub

Copy link
Copy Markdown
Collaborator

What

Implements the "send for signature" half of the Zoho Sign integration (the webhook half already existed) and the applicant CUJ: after the Your Family intake step, a green "Sign your membership agreement →" button creates a Zoho signing request once (stored on the process), prefills Printed Name, and drops the applicant straight into an embedded signing ceremony (embedtoken URL). Re-clicking reuses the stored request ("Resume signing"); the existing webhook flips the contract task to ✓.

Ported from innovationtreehouse/sign-script (send_for_signature.py) as the source of truth: OAuth refresh, create/submit request, and the exact 5-field layout (Signature, Date, Printed Name, Insurance Company, Policy #). PDF geometry read via pdf-lib.

Changes

  • schema: MembershipProcess.zohoActionId (+ migration), paired with zohoEnvelopeId
  • contract/{signFields,zohoClient,agreementDocument}.ts + getOrCreateContractSigningUrl service in external.ts
  • POST /api/membership/contract/sign + green button in membership/page.tsx
  • config accessors + next.config file-tracing for the (pending) agreement PDF
  • unit tests (mocked) + CI-only integration test (idempotency / phase guard / 403 / 503)

⛔ Blocked — DO NOT MERGE yet

A CI guard (block-pending-issue.yml) fails this PR until issue #289 is closed. Two things are pending:

  1. Real agreement PDF → drop at checkin-app/src/lib/membership/contract/assets/membership-agreement.pdf (TODO Add membership pdf to checkin repo #289). Until then the endpoint returns 503.
  2. Zoho OAuth secrets in AWS Secrets Manager (zoho-client-id / -client-secret / -refresh-token / -webhook-secret) — see the companion infra PR. Plus Zoho console: webhook → /api/webhooks/zoho with x-zoho-webhook-token, and allow-list the host for embedded signing.

Companion infra PR: declares the secret shells.

🤖 Generated with Claude Code

Adds the "send for signature" half of the Zoho Sign integration (the webhook
half already existed) and the applicant CUJ: after the "Your Family" intake
step, a green "Sign your membership agreement" button creates a Zoho signing
request once (stored on the process), prefills Printed Name, and drops the
applicant straight into an embedded signing ceremony via an embedtoken URL.
Re-clicking reuses the stored request; the existing webhook flips the contract
task to signed.

Ported from innovationtreehouse/sign-script (send_for_signature.py): the OAuth
refresh flow, create/submit request, and the exact 5-field layout (Signature,
Date, Printed Name, Insurance Company, Policy #). PDF geometry read via pdf-lib.

- schema: MembershipProcess.zohoActionId (+ migration) paired with zohoEnvelopeId
- contract/{signFields,zohoClient,agreementDocument}.ts + service in external.ts
- POST /api/membership/contract/sign + green button in membership/page.tsx
- config accessors + next.config file-tracing for the (pending) agreement PDF
- unit tests (mocked) + CI-only integration test (idempotency/phase/403/503)

The real agreement PDF and the Zoho AWS secrets are pending; a CI guard
(block-pending-issue.yml) fails this PR until issue #289 is closed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VFRSkNj6e2abgSe5PC66g3
@dkaygithub dkaygithub requested review from jee7s and thpr June 21, 2026 23:12
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.

1 participant