feat: migrate templates and documents to envelope model

This commit is contained in:
David Nguyen
2025-09-11 18:23:38 +10:00
parent eec2307634
commit bf89bc781b
234 changed files with 8677 additions and 6054 deletions

View File

@ -1,5 +1,9 @@
import { EnvelopeType } from '@prisma/client';
import { prisma } from '@documenso/prisma';
import { mapDocumentIdToSecondaryId } from '../../utils/envelope';
export const getNextPendingRecipient = async ({
documentId,
currentRecipientId,
@ -9,7 +13,10 @@ export const getNextPendingRecipient = async ({
}) => {
const recipients = await prisma.recipient.findMany({
where: {
documentId,
envelope: {
type: EnvelopeType.DOCUMENT,
secondaryId: mapDocumentIdToSecondaryId(documentId),
},
},
orderBy: [
{