DocuSign

Dormant — not wired into any runtime path (verified 2026-06-12). The API client (backend/src/lib/docusign-client.ts) exists with unit tests, and the signature tables remain in schema.ts, but no service or route imports the client and nothing writes the tables at runtime. The client was last touched in PR#591 (2025-12-09). DocuSign appears in live features only as an external-service link: portal flow steps of type docusign render an “Open in DocuSign” button (external_service step type alongside KfW and Calendly — backend/src/routes/flow-definitions.ts, frontend/src/types/portal.ts).

What Exists in the Codebase

ComponentPathStatus
API clientbackend/src/lib/docusign-client.tsDormant — zero non-test importers
Client testsbackend/src/test/lib/docusign-client.test.tsPassing unit tests
Schema tablessignature_requests, signed_documents, signed_documents_metadataPresent, no runtime writers
Portal flow stepexternal_service step type docusignLive — external link only, no API call

Earlier descriptions of backend/src/services/docusign-service.ts, backend/src/routes/docusign/, DB-stored encrypted OAuth tokens, and webhook status updates do not match the code — those components were never built.

Authentication (as implemented in the client)

JWT grant OAuth 2.0 (not authorization-code): the client requests tokens with a private key, no tokens are persisted. Configuration via environment variables:

VariablePurpose
DOCUSIGN_INTEGRATION_KEYApp integration key
DOCUSIGN_USER_IDImpersonated API user
DOCUSIGN_ACCOUNT_IDDocuSign account
DOCUSIGN_PRIVATE_KEYRSA key for the JWT grant
DOCUSIGN_BASE_PATHAPI base (defaults to the demo environment)
DOCUSIGN_OAUTH_BASE_PATHOAuth base (defaults to account-d.docusign.com)

Intended Capability (if revived)

The client implements envelope creation/sending (documents as base64, signers with sign-here tabs) and status mapping to SignatureStatusEnum from @shared/types. The schema links signature_requests to users, buildings, and dataverse_imports — a Dataverse-era design that would need rework against the current contact/file conventions (contact FKs, CAS fileId) before going live.