Skip to content

Commit

Permalink
feat: create documentSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
sab115 committed Feb 3, 2025
1 parent 296b8a5 commit 52b5ba7
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/database/documentSchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import mongoose, { Schema, Document } from "mongoose";

interface IDocument extends Document {
clerkId: string;
eventId: string;
s3DocId: string;
documentType: string;
createdAt: Date;
status: "Completed" | "Pending" | "Not Submitted";
checkList: string[];
}

const DocumentSchema = new Schema<IDocument>({
clerkId: { type: String, required: true },
eventId: { type: String, 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",
},
checkList: { type: [String], default: [] },
});

export default mongoose.models.Document || mongoose.model<IDocument>("Document", DocumentSchema);

0 comments on commit 52b5ba7

Please sign in to comment.