Skip to content

Commit

Permalink
decal start branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Elsie Xu committed Oct 30, 2024
1 parent cecc0b6 commit 180bf21
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions packages/common/src/models/decal.ts
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>;

0 comments on commit 180bf21

Please sign in to comment.