Added backend and integration for FilterPage and CourseTable done

This commit is contained in:
Harshitha Shetty
2024-12-09 05:06:08 +05:30
parent 6b06b9722f
commit e22727eefd
16 changed files with 756 additions and 118 deletions

View File

@@ -0,0 +1,11 @@
const mongoose = require("mongoose");
const { v4: uuidv4 } = require("uuid"); // For UUID generation
const AppointmentSchema = new mongoose.Schema({
appointmentId: { type: String, default: uuidv4 }, // Auto-generate using UUID
courseId: { type: String, required: true, ref: "Course" },
facultyId: { type: String, required: true, ref: "Faculty" },
appointmentType: { type: [String], required: true }, // Array of appointment types
});
module.exports = mongoose.model("Appointment", AppointmentSchema);

13
server/models/Course.js Normal file
View File

@@ -0,0 +1,13 @@
const mongoose = require("mongoose");
const CourseSchema = new mongoose.Schema({
courseId: { type: String, required: true, unique: true },
name: { type: String, required: true },
department: { type: String, required: true },
program: { type: String, required: true },
scheme: { type: String, required: true },
semester: { type: Number, required: true },
status: { type: String, enum: ["submitted", "not submitted"], default: "not submitted" },
});
module.exports = mongoose.model("Course", CourseSchema);

11
server/models/Faculty.js Normal file
View File

@@ -0,0 +1,11 @@
const mongoose = require("mongoose");
const FacultySchema = new mongoose.Schema({
facultyId: { type: String, required: true, unique: true },
name: { type: String, required: true },
email: { type: String, required: true },
department: { type: String, required: true },
program: { type: String, required: true },
});
module.exports = mongoose.model("Faculty", FacultySchema);