From 6f07c3cb3726d53eba017c58a34372d34b3af5c2 Mon Sep 17 00:00:00 2001 From: sab115 Date: Tue, 4 Feb 2025 15:19:48 -0800 Subject: [PATCH] fix: update eventId to reference Event model in Document schema --- src/database/documentSchema.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/database/documentSchema.ts b/src/database/documentSchema.ts index 0940836..e2eaa73 100644 --- a/src/database/documentSchema.ts +++ b/src/database/documentSchema.ts @@ -2,7 +2,7 @@ import mongoose, { Schema, Document } from "mongoose"; type IDocument = Document & { clerkId: string; - eventId: string; + eventId: mongoose.Types.ObjectId; s3DocId: string; documentType: string; createdAt: Date; @@ -12,14 +12,14 @@ type IDocument = Document & { const DocumentSchema = new Schema({ clerkId: { type: String, required: true }, - eventId: { type: String, required: true }, + eventId: { type: Schema.Types.ObjectId, ref: "Event", required: true }, s3DocId: { type: String, required: true }, documentType: { type: String, required: true }, createdAt: { type: Date, default: Date.now }, status: { type: String, enum: ["Completed", "Pending", "Not Submitted"], - default: "Pending", + default: "Not Submitted", }, checkList: { type: [String], default: [] }, });