first commit

This commit is contained in:
2023-10-12 18:29:47 +05:00
commit 826ac1f621
64 changed files with 5159 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
import { model, Schema } from "mongoose";
const buildSchema = new Schema(
{
companyId: {
type: Schema.Types.ObjectId,
required: true,
},
name: {
type: String,
required: true,
unique: true,
},
sessionLimit: {
type: Number,
required: true,
},
},
{
timestamps: true,
toJSON: { virtuals: true },
toObject: { virtuals: true },
}
);
buildSchema.virtual("scheduledSessions", {
ref: "Scheduled_Session",
localField: "_id",
foreignField: "buildId",
});
const Build = model("Build", buildSchema);
export default Build;