docs: add signing reminders guide (#2716)

This commit is contained in:
Lucas Smith
2026-04-27 10:51:14 +10:00
committed by GitHub
parent 135b676cd4
commit 19c2f7b4a1
10 changed files with 258 additions and 8 deletions
@@ -44,13 +44,16 @@ export const run = async ({
const now = new Date();
// Atomically claim this reminder by setting lastReminderSentAt and clearing
// nextReminderAt so no other sweep picks it up.
// nextReminderAt so no other sweep picks it up. The expiration filter
// guards against races where the expiration sweep hasn't yet flagged
// a recipient whose deadline has already passed.
const updatedCount = await prisma.recipient.updateMany({
where: {
id: recipientId,
signingStatus: SigningStatus.NOT_SIGNED,
sendStatus: SendStatus.SENT,
role: { not: RecipientRole.CC },
OR: [{ expiresAt: null }, { expiresAt: { gt: now } }],
envelope: {
status: DocumentStatus.PENDING,
deletedAt: null,