feat: add envelope editor

This commit is contained in:
David Nguyen
2025-10-12 23:35:54 +11:00
parent bf89bc781b
commit 0da8e7dbc6
307 changed files with 24657 additions and 3681 deletions

View File

@ -330,6 +330,7 @@ enum DocumentSource {
DOCUMENT
TEMPLATE
TEMPLATE_DIRECT_LINK
NONE
}
enum DocumentVisibility {
@ -371,9 +372,10 @@ enum EnvelopeType {
TEMPLATE
}
/// @zod.import(["import { ZDocumentAuthOptionsSchema } from '@documenso/lib/types/document-auth';", "import { ZDocumentFormValuesSchema } from '@documenso/lib/types/document-form-values';"])
model Envelope {
id String @id // document_asdfasdfsadf template_123asdf
secondaryId String @unique // document_456456456 template_45465465
id String @id
secondaryId String @unique
externalId String? /// @zod.string.describe("A custom external ID you can use to identify the document.")
type EnvelopeType
@ -388,6 +390,7 @@ model Envelope {
source DocumentSource
qrToken String? /// @zod.string.describe("The token for viewing the document using the QR code on the certificate.")
internalVersion Int
useLegacyFieldInsertion Boolean @default(false)
envelopeItems EnvelopeItem[]
@ -406,7 +409,7 @@ model Envelope {
publicTitle String @default("")
publicDescription String @default("")
directLink TemplateDirectLink?
templateId Int? // Todo: Migrate from templateId -> This @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
templateId Int?
// Relations
userId Int /// @zod.number.describe("The ID of the user that created this document.")
@ -422,12 +425,13 @@ model Envelope {
documentMeta DocumentMeta @relation(fields: [documentMetaId], references: [id])
}
/// @zod.import(["import { ZDocumentAuthOptionsSchema } from '@documenso/lib/types/document-auth';", "import { ZDocumentFormValuesSchema } from '@documenso/lib/types/document-form-values';"])
model EnvelopeItem {
id String @id
title String
order Int
documentDataId String
documentData DocumentData @relation(fields: [documentDataId], references: [id], onDelete: Cascade)