Skip to content

Open-source document signature platform. Not affiliated with DocuSign.

TypeScript

Merge PR #24 (correct a signer after sending) on top of PR #25

Claude6c6c0ba3d7bf
diff --cc db/migrations/20261116100000_signer_corrected.sql
index 0000000,1648008..f666936
mode 000000,100644..100644
--- a/db/migrations/20261116100000_signer_corrected.sql
+++ b/db/migrations/20261116100000_signer_corrected.sql
@@@ -1,0 -1,27 +1,29 @@@
+ -- Sender correction of a waiting signer's name or email after send.
+ -- A new audit event kind records the old and new values in the hash chain.
++-- Keeps 'copied' (copy to a new draft, the migration before this one) in the list.
+
+ alter table public.audit_events
+ drop constraint if exists audit_events_event_check;
+
+ alter table public.audit_events
+ add constraint audit_events_event_check
+ check (event in (
+ 'created',
+ 'sent',
+ 'viewed',
+ 'consented',
+ 'verified',
+ 'verification_failed',
+ 'signed',
+ 'declined',
+ 'reminded_manual',
+ 'email_sent',
+ 'completed',
+ 'voided',
+ 'deadline_changed',
+ 'expired',
+ 'reminded_auto',
+ 'reauthentication_failed',
++ 'copied',
+ 'signer_corrected'
+ ));
diff --cc src/components/envelopes/envelope-detail-shell.tsx
index f51ad81,bc57feb..447e29c
--- a/src/components/envelopes/envelope-detail-shell.tsx
+++ b/src/components/envelopes/envelope-detail-shell.tsx
@@@ -71,7 -72,7 +72,8 @@@ type EnvelopeDetailRecord =
type ModalState =
| "change-deadline"
| "change-reminders"
+ | "copy-draft"
+ | "correct-signer"
| "delete-draft"
| "save-template"
| "void-envelope"
@@@ -130,7 -131,7 +132,8 @@@ export function EnvelopeDetailShell(
const [actionError, setActionError] = useState<string | null>(null);
const [isChangingDeadline, setIsChangingDeadline] = useState(false);
const [isChangingReminders, setIsChangingReminders] = useState(false);
+ const [isCopyingDraft, setIsCopyingDraft] = useState(false);
+ const [isCorrectingSigner, setIsCorrectingSigner] = useState(false);
const [isDeletingDraft, setIsDeletingDraft] = useState(false);
const [isSendingReminder, setIsSendingReminder] = useState(false);
const [isVoidingEnvelope, setIsVoidingEnvelope] = useState(false);
@@@ -794,15 -811,20 +857,29 @@@
/>
) : null}
+ {activeModal === "copy-draft" ? (
+ <CopyDraftDialog
+ errorMessage={actionError}
+ onCancel={() => setActiveModal(null)}
+ onConfirm={handleConfirmCopyDraft}
+ processing={isCopyingDraft}
+ />
+ ) : null}
+
+ {activeModal === "correct-signer" && correctingSigner ? (
+ <CorrectSignerDialog
+ email={correctingSigner.email}
+ errorMessage={actionError}
+ name={correctingSigner.name}
+ onCancel={() => {
+ setActiveModal(null);
+ setCorrectingSigner(null);
+ }}
+ onConfirm={handleConfirmCorrectSigner}
+ processing={isCorrectingSigner}
+ />
+ ) : null}
+
{activeModal === "save-template" ? (
<SaveTemplateDialog
envelopeId={envelopeId}
diff --cc src/lib/envelopes.ts
index 6bd9fd6,bc46d99..0281fc0
--- a/src/lib/envelopes.ts
+++ b/src/lib/envelopes.ts
@@@ -445,7 -468,7 +471,8 @@@ export type ReplaceDraftSignersResult
export type ReplaceDraftFieldsResult = ReplaceFieldsResponse;
export type SendDraftEnvelopeResult = SendEnvelopeResponse;
export type VoidEnvelopeResult = VoidEnvelopeResponse;
+export type CopyEnvelopeToDraftResult = CopyEnvelopeResponse;
+ export type CorrectSentSignerResult = CorrectSentSignerResponse;
const FIELD_TYPE_SUMMARY_LABELS: Record<
FieldRecord["type"],
diff --cc src/lib/types/domain.ts
index 11ad57c,40a6131..81dcb52
--- a/src/lib/types/domain.ts
+++ b/src/lib/types/domain.ts
@@@ -64,7 -64,7 +64,8 @@@ export const auditEventTypes =
"expired",
"reminded_auto",
"reauthentication_failed",
+ "copied",
+ "signer_corrected",
] as const;
/**