-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Elsie Xu
committed
Oct 30, 2024
1 parent
cecc0b6
commit 180bf21
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import mongoose, { InferSchemaType, Schema } from "mongoose"; | ||
|
||
import { schemaOptions } from "../lib/common"; | ||
|
||
const decalSection = { | ||
title: String, | ||
faciliators: String, | ||
size: Number, | ||
location: String, | ||
time: String, | ||
starts: String, | ||
status: String, | ||
ccn: Number, | ||
} | ||
|
||
const decalSchemaObject = { | ||
id: { | ||
type: Number, | ||
required: true, | ||
}, | ||
category: { | ||
type: String, | ||
required: true, | ||
}, | ||
units: { | ||
type: Number, | ||
required: true, | ||
}, | ||
date: { | ||
type: Date, | ||
required: true, | ||
}, | ||
title: String, | ||
description: String, | ||
website: String, | ||
application: String, | ||
sections: [decalSection], | ||
enroll: String, | ||
contact: String, | ||
course: String, | ||
semester: String, | ||
} | ||
|
||
|
||
export const decalSchema = new Schema(decalSchemaObject, schemaOptions); | ||
export const decalModel = mongoose.model("Decal", decalSchema, "decal"); | ||
export type decalType = InferSchemaType<typeof decalSchema>; |