feat: add external id to documents and templates (#1227)

## Description

Adds the external ID column to documents and templates with an option to
configure it in the API or UI.

External ID's can be used to link a document or template to an external
system and identify them via webhooks, etc.
This commit is contained in:
Lucas Smith
2024-07-13 16:45:09 +10:00
committed by GitHub
parent 7f5b27372f
commit c3035dbd15
19 changed files with 142 additions and 0 deletions

View File

@@ -233,6 +233,7 @@ export const ApiContractV1Implementation = createNextRoute(ApiContractV1, {
const document = await createDocument({
title: body.title,
externalId: body.externalId || null,
userId: user.id,
teamId: team?.id,
formValues: body.formValues,
@@ -398,6 +399,7 @@ export const ApiContractV1Implementation = createNextRoute(ApiContractV1, {
teamId: team?.id,
data: {
title: fileName,
externalId: body.externalId || null,
formValues: body.formValues,
documentData: {
connect: {
@@ -454,6 +456,7 @@ export const ApiContractV1Implementation = createNextRoute(ApiContractV1, {
try {
document = await createDocumentFromTemplate({
templateId,
externalId: body.externalId || null,
userId: user.id,
teamId: team?.id,
recipients: body.recipients,