diff --git a/packages/prisma/seed/templates.ts b/packages/prisma/seed/templates.ts index 7f1b2f8e9..3feb82289 100644 --- a/packages/prisma/seed/templates.ts +++ b/packages/prisma/seed/templates.ts @@ -2,7 +2,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { prisma } from '..'; -import { DocumentDataType } from '../client'; +import { DocumentDataType, ReadStatus, RecipientRole, SendStatus, SigningStatus } from '../client'; const examplePdf = fs .readFileSync(path.join(__dirname, '../../../assets/example.pdf')) @@ -28,9 +28,36 @@ export const seedTemplate = async (options: SeedTemplateOptions) => { return await prisma.template.create({ data: { title, - templateDocumentDataId: documentData.id, - userId: userId, - teamId, + templateDocumentData: { + connect: { + id: documentData.id, + }, + }, + User: { + connect: { + id: userId, + }, + }, + Recipient: { + create: { + email: 'recipient.1@documenso.com', + name: 'Recipient 1', + token: Math.random().toString().slice(2, 7), + sendStatus: SendStatus.NOT_SENT, + signingStatus: SigningStatus.NOT_SIGNED, + readStatus: ReadStatus.NOT_OPENED, + role: RecipientRole.SIGNER, + }, + }, + ...(teamId + ? { + team: { + connect: { + id: teamId, + }, + }, + } + : {}), }, }); };