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,4 +1,4 @@
import { SigningStatus } from '@prisma/client';
import { EnvelopeType, SigningStatus } from '@prisma/client';
import { prisma } from '@documenso/prisma';
@ -6,10 +6,12 @@ export type GetCompletedFieldsForTokenOptions = {
token: string;
};
// Todo: Envelopes - This needs to be redone since we need to determine which document to show the fields on.
export const getCompletedFieldsForToken = async ({ token }: GetCompletedFieldsForTokenOptions) => {
return await prisma.field.findMany({
where: {
document: {
envelope: {
type: EnvelopeType.DOCUMENT,
recipients: {
some: {
token,